24#ifndef DUMUX_MPNC_INITIALCONDITION_HELPER_HH
25#define DUMUX_MPNC_INITIALCONDITION_HELPER_HH
34namespace MPNCInitialConditions {
41template<
class PrimaryVariables,
class Flu
idSystem,
class ModelTraits>
44 using Scalar =
typename PrimaryVariables::value_type;
49 template<
class Flu
idState>
52 typename FluidSystem::ParameterCache paramCache;
58 template<
class Flu
idState>
61 typename FluidSystem::ParameterCache paramCache;
67 template<
class Flu
idState>
70 PrimaryVariables priVars(0.0);
72 static constexpr auto numComponents = FluidSystem::numComponents;
73 static constexpr auto numPhases = FluidSystem::numPhases;
74 static constexpr auto fug0Idx = ModelTraits::Indices::fug0Idx;
75 static constexpr auto s0Idx = ModelTraits::Indices::s0Idx;
76 static constexpr auto p0Idx = ModelTraits::Indices::p0Idx;
79 for (
int compIdx = 0; compIdx < numComponents; ++compIdx)
80 priVars[fug0Idx + compIdx] = fs.fugacity(0, compIdx);
83 for (
int phaseIdx = 0; phaseIdx < numPhases - 1; ++phaseIdx)
84 priVars[s0Idx + phaseIdx] = fs.saturation(phaseIdx);
86 static constexpr auto pressureFormulation = ModelTraits::pressureFormulation();
88 priVars[p0Idx] = fs.pressure(0);
90 priVars[p0Idx] = fs.pressure(numPhases-1);
92 DUNE_THROW(Dune::InvalidStateException,
"unknown pressure formulation");
Computes all quantities of a generic fluid state if a reference phase has been specified.
Computes the composition of all phases of a N-phase, N-component fluid system assuming that all N pha...
Enumeration of the formulations accepted by the MpNc model.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
static void solve(FluidState &fluidState, ParameterCache ¶mCache, int refPhaseIdx)
Computes all quantities of a generic fluid state if a reference phase has been specified.
Definition: computefromreferencephase.hh:111
static void solve(FluidState &fluidState, ParameterCache ¶mCache, int knownPhaseIdx=0)
Computes the composition of all phases of a N-phase, N-component fluid system assuming that all N pha...
Definition: misciblemultiphasecomposition.hh:81
Definition: initialconditionhelper.hh:36
int refPhaseIdx
Definition: initialconditionhelper.hh:36
Definition: initialconditionhelper.hh:37
int refPhaseIdx
Definition: initialconditionhelper.hh:37
Definition: initialconditionhelper.hh:43
PrimaryVariables getPrimaryVariables(const FluidState &fs) const
Definition: initialconditionhelper.hh:68
void solve(FluidState &fs, const AllPhasesPresent &allPhases) const
Definition: initialconditionhelper.hh:50
void solve(FluidState &fs, const NotAllPhasesPresent ¬AllPhases) const
Definition: initialconditionhelper.hh:59