28 #ifndef EWOMS_FLASH_PRIMARY_VARIABLES_HH
29 #define EWOMS_FLASH_PRIMARY_VARIABLES_HH
37 #include <opm/material/constraintsolvers/NcpFlash.hpp>
38 #include <opm/material/fluidstates/CompositionalFluidState.hpp>
39 #include <opm/common/Valgrind.hpp>
40 #include <opm/common/Unused.hpp>
42 #include <dune/common/fvector.hh>
57 template <
class TypeTag>
62 typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
63 typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
64 typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
65 typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
66 typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
69 enum { cTot0Idx = Indices::cTot0Idx };
74 typedef typename Opm::MathToolbox<Evaluation> Toolbox;
79 { Opm::Valgrind::SetDefined(*
this); }
86 Opm::Valgrind::CheckDefined(value);
87 Opm::Valgrind::SetDefined(*
this);
100 template <
class Flu
idState>
102 const MaterialLawParams& matParams OPM_UNUSED,
103 bool isInEquilibrium OPM_UNUSED=
false)
114 template <
class Flu
idState>
122 EnergyModule::setPriVarTemperatures(*
this, fluidState);
125 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
126 for (
unsigned compIdx = 0; compIdx < numComponents; ++compIdx) {
127 this->operator[](cTot0Idx + compIdx) +=
128 fluidState.molarity(phaseIdx, compIdx) * fluidState.saturation(phaseIdx);
138 void print(std::ostream& os = std::cout)
const
140 for (
unsigned compIdx = 0; compIdx < numComponents; ++compIdx) {
141 os <<
"(c_tot," << FluidSystem::componentName(compIdx) <<
" = "
142 << this->operator[](cTot0Idx + compIdx);
144 os <<
")" << std::flush;
Provides the auxiliary methods required for consideration of the energy equation. ...
Definition: energymodule.hh:59
#define GET_PROP_VALUE(TypeTag, PropTagName)
Access the value attribute of a property for a type tag.
Definition: propertysystem.hh:469
Contains the classes required to consider energy as a conservation quantity in a multi-phase module...
Declares the properties required by the compositional multi-phase model based on flash calculations...
void assignMassConservative(const FluidState &fluidState, const MaterialLawParams &matParams OPM_UNUSED, bool isInEquilibrium OPM_UNUSED=false)
Set the primary variables from an arbitrary fluid state in a mass conservative way.
Definition: flashprimaryvariables.hh:101
Represents the primary variables used by the a model.
Definition: fvbaseprimaryvariables.hh:48
Defines the primary variable and equation indices for the compositional multi-phase model based on fl...
Represents the primary variables used by the compositional flow model based on flash calculations...
Definition: flashprimaryvariables.hh:58
Represents the primary variables used by the a model.
FlashPrimaryVariables(Scalar value)
Constructor with assignment from scalar.
Definition: flashprimaryvariables.hh:84
void print(std::ostream &os=std::cout) const
Prints the names of the primary variables and their values.
Definition: flashprimaryvariables.hh:138
void assignNaive(const FluidState &fluidState)
Directly retrieve the primary variables from an arbitrary fluid state.
Definition: flashprimaryvariables.hh:115