28#ifndef OPM_PTFLASH_PRIMARY_VARIABLES_HH
29#define OPM_PTFLASH_PRIMARY_VARIABLES_HH
35#include <opm/material/common/Valgrind.hpp>
50template <
class TypeTag>
51class FlashPrimaryVariables :
public FvBasePrimaryVariables<TypeTag>
62 enum { z0Idx = Indices::z0Idx };
63 enum { pressure0Idx = Indices::pressure0Idx };
64 enum { water0Idx = Indices::water0Idx };
66 static constexpr bool waterEnabled = Indices::waterEnabled;
69 enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
70 enum { waterPhaseIdx = FluidSystem::waterPhaseIdx };
71 enum { oilPhaseIdx = FluidSystem::oilPhaseIdx };
80 FlashPrimaryVariables() : ParentType()
81 { Opm::Valgrind::SetDefined(*
this); }
90 using ParentType::operator=;
95 template <
class Flu
idState>
97 const MaterialLawParams&,
109 template <
class Flu
idState>
117 EnergyModule::setPriVarTemperatures(*
this, fluidState);
120 for (
int i = 0; i < numComponents - 1; ++i)
121 (*
this)[z0Idx + i] =
getValue(fluidState.moleFraction(i));
124 (*this)[pressure0Idx] =
getValue(fluidState.pressure(oilPhaseIdx));
127 if constexpr (waterEnabled) {
128 (*this)[water0Idx] =
getValue(fluidState.saturation(waterPhaseIdx));
137 void print(std::ostream&
os = std::cout)
const
139 os <<
"(p_" << FluidSystem::phaseName(FluidSystem::oilPhaseIdx) <<
" = "
140 << this->operator[](pressure0Idx);
142 os <<
", z_" << FluidSystem::componentName(
compIdx) <<
" = "
143 << this->operator[](z0Idx +
compIdx);
145 if constexpr (waterEnabled) {
146 os <<
", S_w = " << this->operator[](water0Idx);
148 os <<
")" << std::flush;
Represents the primary variables used by the compositional flow model based on flash calculations.
Definition flashprimaryvariables.hh:51
void print(std::ostream &os=std::cout) const
Prints the names of the primary variables and their values.
Definition flashprimaryvariables.hh:137
void assignNaive(const FluidState &fluidState)
Directly retrieve the primary variables from an arbitrary fluid state.
Definition flashprimaryvariables.hh:104
FlashPrimaryVariables(const FlashPrimaryVariables &value)=default
void assignMassConservative(const FluidState &fluidState, const MaterialLawParams &, bool=false)
< Import base class assignment operators.
Definition flashprimaryvariables.hh:96
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 blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
Defines the primary variable and equation indices for the compositional multi-phase model based on fl...