28#ifndef OPM_PTFLASH_PRIMARY_VARIABLES_HH
29#define OPM_PTFLASH_PRIMARY_VARIABLES_HH
31#include <opm/material/common/MathToolbox.hpp>
32#include <opm/material/common/Valgrind.hpp>
51template <
class TypeTag>
52class FlashPrimaryVariables :
public FvBasePrimaryVariables<TypeTag>
63 enum { z0Idx = Indices::z0Idx };
64 enum { pressure0Idx = Indices::pressure0Idx };
65 enum { water0Idx = Indices::water0Idx };
67 static constexpr bool waterEnabled = Indices::waterEnabled;
70 enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
71 enum { waterPhaseIdx = FluidSystem::waterPhaseIdx };
72 enum { oilPhaseIdx = FluidSystem::oilPhaseIdx };
81 FlashPrimaryVariables() : ParentType()
82 { Opm::Valgrind::SetDefined(*
this); }
91 using ParentType::operator=;
96 template <
class Flu
idState>
98 const MaterialLawParams&,
110 template <
class Flu
idState>
118 EnergyModule::setPriVarTemperatures(*
this, fluidState);
121 for (
int i = 0; i < numComponents - 1; ++i)
122 (*
this)[z0Idx + i] =
getValue(fluidState.moleFraction(i));
125 (*this)[pressure0Idx] =
getValue(fluidState.pressure(oilPhaseIdx));
128 if constexpr (waterEnabled) {
129 (*this)[water0Idx] =
getValue(fluidState.saturation(waterPhaseIdx));
140 os <<
"(p_" << FluidSystem::phaseName(FluidSystem::oilPhaseIdx) <<
" = "
141 << (*this)[pressure0Idx];
143 os <<
", z_" << FluidSystem::componentName(
compIdx) <<
" = "
146 if constexpr (waterEnabled) {
147 os <<
", S_w = " << (*this)[water0Idx];
149 os <<
")" << std::flush;
Represents the primary variables used by the compositional flow model based on flash calculations.
Definition flashprimaryvariables.hh:52
void assignNaive(const FluidState &fluidState)
Directly retrieve the primary variables from an arbitrary fluid state.
Definition flashprimaryvariables.hh:106
FlashPrimaryVariables(const FlashPrimaryVariables &value)=default
void print(std::ostream &os) const
Prints the names of the primary variables and their values.
Definition flashprimaryvariables.hh:138
void assignMassConservative(const FluidState &fluidState, const MaterialLawParams &, bool=false)
< Import base class assignment operators.
Definition flashprimaryvariables.hh:97
Contains the classes required to consider energy as a conservation quantity in a multi-phase module.
Represents the primary variables used by the a model.
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240
Defines the primary variable and equation indices for the compositional multi-phase model based on fl...