12#ifndef DUMUX_MPNC_INITIALCONDITION_HELPER_HH
13#define DUMUX_MPNC_INITIALCONDITION_HELPER_HH
22namespace MPNCInitialConditions {
29template<
class PrimaryVariables,
class Flu
idSystem,
class ModelTraits>
32 using Scalar =
typename PrimaryVariables::value_type;
37 template<
class Flu
idState>
40 typename FluidSystem::ParameterCache paramCache;
46 template<
class Flu
idState>
49 typename FluidSystem::ParameterCache paramCache;
55 template<
class Flu
idState>
58 PrimaryVariables priVars(0.0);
60 static constexpr auto numComponents = FluidSystem::numComponents;
61 static constexpr auto numPhases = FluidSystem::numPhases;
62 static constexpr auto fug0Idx = ModelTraits::Indices::fug0Idx;
63 static constexpr auto s0Idx = ModelTraits::Indices::s0Idx;
64 static constexpr auto p0Idx = ModelTraits::Indices::p0Idx;
67 for (
int compIdx = 0; compIdx < numComponents; ++compIdx)
68 priVars[fug0Idx + compIdx] = fs.fugacity(0, compIdx);
71 for (
int phaseIdx = 0; phaseIdx < numPhases - 1; ++phaseIdx)
72 priVars[s0Idx + phaseIdx] = fs.saturation(phaseIdx);
74 static constexpr auto pressureFormulation = ModelTraits::pressureFormulation();
76 priVars[p0Idx] = fs.pressure(0);
78 priVars[p0Idx] = fs.pressure(numPhases-1);
80 DUNE_THROW(Dune::InvalidStateException,
"unknown pressure formulation");
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:99
Definition: initialconditionhelper.hh:31
PrimaryVariables getPrimaryVariables(const FluidState &fs) const
Definition: initialconditionhelper.hh:56
void solve(FluidState &fs, const AllPhasesPresent &allPhases) const
Definition: initialconditionhelper.hh:38
void solve(FluidState &fs, const NotAllPhasesPresent ¬AllPhases) const
Definition: initialconditionhelper.hh:47
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:69
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...
Definition: initialconditionhelper.hh:24
int refPhaseIdx
Definition: initialconditionhelper.hh:24
Definition: initialconditionhelper.hh:25
int refPhaseIdx
Definition: initialconditionhelper.hh:25