29#ifndef DUMUX_COMPUTE_FROM_REFERENCE_PHASE_HH
30#define DUMUX_COMPUTE_FROM_REFERENCE_PHASE_HH
34#include <dune/common/fvector.hh>
35#include <dune/common/fmatrix.hh>
74template <
class Scalar,
class Flu
idSystem>
77 enum { numPhases = FluidSystem::numPhases };
78 enum { numComponents = FluidSystem::numComponents };
80 using ComponentVector = Dune::FieldVector<Scalar, numComponents>;
110 template <
class Flu
idState,
class ParameterCache>
111 static void solve(FluidState &fluidState,
112 ParameterCache ¶mCache,
115 ComponentVector fugVec;
119 paramCache.updatePhase(fluidState, refPhaseIdx);
120 fluidState.setDensity(refPhaseIdx,
124 fluidState.setMolarDensity(refPhaseIdx,
130 for (
int compIdx = 0; compIdx < numComponents; ++compIdx)
132 fluidState.setFugacityCoefficient(refPhaseIdx,
134 FluidSystem::fugacityCoefficient(fluidState,
138 fugVec[compIdx] = fluidState.fugacity(refPhaseIdx, compIdx);
142 for (
int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
144 if (phaseIdx == refPhaseIdx)
Some exceptions thrown in DuMux
Determines the fluid composition given the component fugacities and an arbitrary equation of state.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
std::string molarDensity(int phaseIdx) noexcept
I/O name of molar density for multiphase systems.
Definition: name.hh:83
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
Calculates the chemical equilibrium from the component fugacities in the phase .
Definition: compositionfromfugacities.hh:53
static void guessInitial(FluidState &fluidState, ParameterCache ¶mCache, int phaseIdx, const ComponentVector &fugVec)
Guess an initial value for the composition of the phase.
Definition: compositionfromfugacities.hh:68
static void solve(FluidState &fluidState, ParameterCache ¶mCache, int phaseIdx, const ComponentVector &targetFug)
Calculates the chemical equilibrium from the component fugacities in a phase.
Definition: compositionfromfugacities.hh:96
Computes all quantities of a generic fluid state if a reference phase has been specified.
Definition: computefromreferencephase.hh:76
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