26#ifndef DUMUX_2P2C_VOLUME_VARIABLES_HH
27#define DUMUX_2P2C_VOLUME_VARIABLES_HH
43template <
class Traits,
bool enableChemicalNonEquilibrium,
bool useConstra
intSolver>
52template <
class Traits,
bool useConstra
intSolver = true>
61template <
class Traits,
class Impl>
69 using Scalar =
typename Traits::PrimaryVariables::value_type;
70 using ModelTraits =
typename Traits::ModelTraits;
76 comp0Idx = Traits::FluidSystem::comp0Idx,
77 comp1Idx = Traits::FluidSystem::comp1Idx,
78 phase0Idx = Traits::FluidSystem::phase0Idx,
79 phase1Idx = Traits::FluidSystem::phase1Idx
85 firstPhaseOnly = ModelTraits::Indices::firstPhaseOnly,
86 secondPhaseOnly = ModelTraits::Indices::secondPhaseOnly,
87 bothPhases = ModelTraits::Indices::bothPhases
93 switchIdx = ModelTraits::Indices::switchIdx,
94 pressureIdx = ModelTraits::Indices::pressureIdx
98 static constexpr auto formulation = ModelTraits::priVarFormulation();
100 using PermeabilityType =
typename Traits::PermeabilityType;
116 static constexpr bool useMoles() {
return ModelTraits::useMoles(); }
121 static_assert(ModelTraits::numFluidPhases() == 2,
"NumPhases set in the model is not two!");
122 static_assert(ModelTraits::numFluidComponents() == 2,
"NumComponents set in the model is not two!");
134 template<
class ElemSol,
class Problem,
class Element,
class Scv>
135 void update(
const ElemSol& elemSol,
const Problem& problem,
const Element& element,
const Scv& scv)
138 asImp_().completeFluidState(elemSol, problem, element, scv, fluidState_, solidState_);
142 typename FluidSystem::ParameterCache paramCache;
143 paramCache.updateAll(fluidState_);
145 using MaterialLaw =
typename Problem::SpatialParams::MaterialLaw;
146 const auto& matParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
148 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
149 const int nPhaseIdx = 1 - wPhaseIdx;
152 relativePermeability_[wPhaseIdx] = MaterialLaw::krw(matParams,
saturation(wPhaseIdx));
153 relativePermeability_[nPhaseIdx] = MaterialLaw::krn(matParams,
saturation(wPhaseIdx));
156 diffCoeff_[phase0Idx] = FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, phase0Idx, comp0Idx, comp1Idx);
157 diffCoeff_[phase1Idx] = FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, phase1Idx, comp0Idx, comp1Idx);
161 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv, solidState_);
162 permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
178 template<
class ElemSol,
class Problem,
class Element,
class Scv>
180 const Problem& problem,
181 const Element& element,
188 const auto&
priVars = elemSol[scv.localDofIndex()];
191 using MaterialLaw =
typename Problem::SpatialParams::MaterialLaw;
192 const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
193 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
221 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase presence.");
224 pc_ = MaterialLaw::pc(materialParams,
fluidState.saturation(wPhaseIdx));
228 fluidState.setPressure(phase1Idx, (wPhaseIdx == phase0Idx) ?
priVars[pressureIdx] + pc_
234 fluidState.setPressure(phase0Idx, (wPhaseIdx == phase0Idx) ?
priVars[pressureIdx] - pc_
243 {
return fluidState_; }
249 {
return solidState_; }
257 {
return fluidState_.averageMolarMass(phaseIdx); }
266 {
return fluidState_.saturation(phaseIdx); }
276 {
return fluidState_.massFraction(phaseIdx, compIdx); }
286 {
return fluidState_.moleFraction(phaseIdx, compIdx); }
295 {
return fluidState_.density(phaseIdx); }
304 {
return fluidState_.viscosity(phaseIdx); }
313 {
return fluidState_.molarDensity(phaseIdx); }
322 {
return fluidState_.pressure(phaseIdx); }
332 {
return fluidState_.temperature(0); }
341 {
return relativePermeability_[phaseIdx]; }
350 {
return relativePermeability_[phaseIdx]/fluidState_.viscosity(phaseIdx); }
363 {
return solidState_.porosity(); }
369 {
return permeability_; }
376 if(phaseIdx == compIdx)
377 DUNE_THROW(Dune::InvalidStateException,
"Diffusion coefficient called for phaseIdx = compIdx");
379 return diffCoeff_[phaseIdx];
387 PermeabilityType permeability_;
390 std::array<Scalar, ModelTraits::numFluidPhases()> relativePermeability_;
393 std::array<Scalar, ModelTraits::numFluidPhases()> diffCoeff_;
396 const Impl &
asImp_()
const {
return *
static_cast<const Impl*
>(
this); }
397 Impl &
asImp_() {
return *
static_cast<Impl*
>(
this); }
405template <
class Traits,
bool useConstra
intSolver>
412 using Scalar =
typename Traits::PrimaryVariables::value_type;
413 using ModelTraits =
typename Traits::ModelTraits;
415 static constexpr int numFluidComps = ParentType::numFluidComponents();
419 comp0Idx = Traits::FluidSystem::comp0Idx,
420 comp1Idx = Traits::FluidSystem::comp1Idx,
421 phase0Idx = Traits::FluidSystem::phase0Idx,
422 phase1Idx = Traits::FluidSystem::phase1Idx
428 firstPhaseOnly = ModelTraits::Indices::firstPhaseOnly,
429 secondPhaseOnly = ModelTraits::Indices::secondPhaseOnly,
430 bothPhases = ModelTraits::Indices::bothPhases
436 switchIdx = ModelTraits::Indices::switchIdx,
437 pressureIdx = ModelTraits::Indices::pressureIdx
441 static constexpr auto formulation = ModelTraits::priVarFormulation();
458 static constexpr bool useMoles() {
return ModelTraits::useMoles(); }
463 static_assert(useMoles() || (!useMoles() && useConstraintSolver),
"if !UseMoles, UseConstraintSolver has to be set to true");
467 static_assert(useConstraintSolver || (!FluidSystem::isGas(phase0Idx) && FluidSystem::isGas(phase1Idx)),
468 "Explicit composition calculation has to be re-checked for NON-liquid-gas equilibria");
483 template<
class ElemSol,
class Problem,
class Element,
class Scv>
485 const Problem& problem,
486 const Element& element,
491 ParentType::completeFluidState(elemSol, problem, element, scv, fluidState, solidState);
493 const auto& priVars = elemSol[scv.localDofIndex()];
497 typename FluidSystem::ParameterCache paramCache;
500 if(!useConstraintSolver)
502 for (
int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++ phaseIdx)
504 assert(FluidSystem::isIdealMixture(phaseIdx));
505 for (
int compIdx = 0; compIdx < ModelTraits::numFluidComponents(); ++ compIdx) {
506 Scalar phi = FluidSystem::fugacityCoefficient(fluidState, paramCache, phaseIdx, compIdx);
507 fluidState.setFugacityCoefficient(phaseIdx, compIdx, phi);
513 const Scalar p0 = fluidState.pressure(phase0Idx);
514 const Scalar p1 = fluidState.pressure(phase1Idx);
520 if(useConstraintSolver)
529 const Scalar partPressLiquid = FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp0Idx)*p0;
532 const Scalar partPressGas = p1 - partPressLiquid;
535 const Scalar xnn = partPressGas / p1;
536 const Scalar xnw = partPressLiquid / p1;
541 const Scalar xwn = partPressGas / (FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp1Idx)*p0);
542 const Scalar xww = 1.0 - xwn;
545 fluidState.setMoleFraction(phase0Idx, comp0Idx, xww);
546 fluidState.setMoleFraction(phase0Idx, comp1Idx, xwn);
547 fluidState.setMoleFraction(phase1Idx, comp0Idx, xnw);
548 fluidState.setMoleFraction(phase1Idx, comp1Idx, xnn);
556 fluidState.setMoleFraction(phase1Idx, comp1Idx, 1 - priVars[switchIdx]);
557 fluidState.setMoleFraction(phase1Idx, comp0Idx, priVars[switchIdx]);
561 fluidState.setMassFraction(phase1Idx, comp0Idx, priVars[switchIdx]);
566 if (useConstraintSolver)
575 const Scalar xnw = priVars[switchIdx];
576 const Scalar xnn = 1.0 - xnw;
585 const Scalar xww = xnw*p1/( FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp0Idx)*p0 );
592 const Scalar xwn = xnn*p1/( FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp1Idx)*p0 );
594 fluidState.setMoleFraction(phase0Idx, comp0Idx, xww);
595 fluidState.setMoleFraction(phase0Idx, comp1Idx, xwn);
604 fluidState.setMoleFraction(phase0Idx, comp0Idx, 1-priVars[switchIdx]);
605 fluidState.setMoleFraction(phase0Idx, comp1Idx, priVars[switchIdx]);
609 fluidState.setMassFraction(phase0Idx, comp1Idx, priVars[switchIdx]);
614 if (useConstraintSolver)
623 const Scalar xwn = priVars[switchIdx];
628 const Scalar xnw = ( FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp0Idx)*p0 )/p1;
636 const Scalar xnn = xwn*( FluidSystem::fugacityCoefficient(fluidState, phase0Idx, comp1Idx)*p0 )/p1;
638 fluidState.setMoleFraction(phase1Idx, comp1Idx, xnn);
639 fluidState.setMoleFraction(phase1Idx, comp0Idx, xnw);
643 for (
int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++phaseIdx)
646 if(!useConstraintSolver)
648 paramCache.updateComposition(fluidState, phaseIdx);
650 fluidState.setDensity(phaseIdx, rho);
652 fluidState.setMolarDensity(phaseIdx, rhoMolar);
657 fluidState.setViscosity(phaseIdx,mu);
658 Scalar h = EnergyVolVars::enthalpy(fluidState, paramCache, phaseIdx);
659 fluidState.setEnthalpy(phaseIdx, h);
671template <
class Traits,
bool useConstra
intSolver>
678 using Scalar =
typename Traits::PrimaryVariables::value_type;
679 using ModelTraits =
typename Traits::ModelTraits;
681 static constexpr int numFluidComps = ParentType::numFluidComponents();
685 comp0Idx = Traits::FluidSystem::comp0Idx,
686 comp1Idx = Traits::FluidSystem::comp1Idx,
687 phase0Idx = Traits::FluidSystem::phase0Idx,
688 phase1Idx = Traits::FluidSystem::phase1Idx
694 firstPhaseOnly = ModelTraits::Indices::firstPhaseOnly,
695 secondPhaseOnly = ModelTraits::Indices::secondPhaseOnly,
696 bothPhases = ModelTraits::Indices::bothPhases
702 switchIdx = ModelTraits::Indices::switchIdx,
703 pressureIdx = ModelTraits::Indices::pressureIdx
707 static constexpr auto formulation = ModelTraits::priVarFormulation();
709 using PermeabilityType =
typename Traits::PermeabilityType;
726 static constexpr bool useMoles() {
return ModelTraits::useMoles(); }
731 static_assert(useMoles() || (!useMoles() && useConstraintSolver),
"if !UseMoles, UseConstraintSolver has to be set to true");
736 static_assert(useConstraintSolver || (!FluidSystem::isGas(phase0Idx) && FluidSystem::isGas(phase1Idx)),
737 "Explicit composition calculation has to be re-checked for NON-liquid-gas equilibria");
752 template<
class ElemSol,
class Problem,
class Element,
class Scv>
754 const Problem& problem,
755 const Element& element,
760 ParentType::completeFluidState(elemSol, problem, element, scv, fluidState, solidState);
762 const auto& priVars = elemSol[scv.localDofIndex()];
767 typename FluidSystem::ParameterCache paramCache;
768 paramCache.updateAll(fluidState);
770 updateMoleFraction(fluidState,
775 for (
int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++phaseIdx)
779 fluidState.setViscosity(phaseIdx,mu);
780 Scalar h = EnergyVolVars::enthalpy(fluidState, paramCache, phaseIdx);
781 fluidState.setEnthalpy(phaseIdx, h);
793 typename Traits::FluidSystem::ParameterCache & paramCache,
794 const typename Traits::PrimaryVariables& priVars)
798 Scalar xwnNonEquil = 0.0;
799 Scalar xwwNonEquil = 0.0;
800 Scalar xnwNonEquil = 0.0;
801 Scalar xnnNonEquil = 0.0;
805 xwnNonEquil = priVars[ModelTraits::numFluidPhases()];
806 xwwNonEquil = 1-xwnNonEquil;
807 xnwNonEquil = priVars[ModelTraits::numFluidPhases()+comp1Idx];
810 if (actualFluidState.saturation(phase0Idx) < 0.01)
812 const Scalar p1 = actualFluidState.pressure(phase1Idx);
813 const Scalar partPressLiquid = FluidSystem::vaporPressure(actualFluidState, comp0Idx);
814 xnwNonEquil =std::min(partPressLiquid/p1, xnwNonEquil);
816 xnnNonEquil = 1- xnwNonEquil;
818 actualFluidState.setMoleFraction(phase0Idx, comp0Idx, xwwNonEquil);
819 actualFluidState.setMoleFraction(phase0Idx, comp1Idx, xwnNonEquil);
820 actualFluidState.setMoleFraction(phase1Idx, comp0Idx, xnwNonEquil);
821 actualFluidState.setMoleFraction(phase1Idx, comp1Idx, xnnNonEquil);
824 for(
int phaseIdx=0; phaseIdx<ModelTraits::numFluidPhases(); ++phaseIdx)
825 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
827 const Scalar phi = FluidSystem::fugacityCoefficient(actualFluidState,
831 actualFluidState.setFugacityCoefficient(phaseIdx,
837 equilFluidState.assign(actualFluidState) ;
839 if(!useConstraintSolver)
841 for (
int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++ phaseIdx)
843 assert(FluidSystem::isIdealMixture(phaseIdx));
844 for (
int compIdx = 0; compIdx < ModelTraits::numFluidComponents(); ++ compIdx) {
845 Scalar phi = FluidSystem::fugacityCoefficient(equilFluidState, paramCache, phaseIdx, compIdx);
846 equilFluidState.setFugacityCoefficient(phaseIdx, compIdx, phi);
852 const Scalar p0 = equilFluidState.pressure(phase0Idx);
853 const Scalar p1 = equilFluidState.pressure(phase1Idx);
857 if(useConstraintSolver)
866 const Scalar partPressLiquid = FluidSystem::fugacityCoefficient(equilFluidState, phase0Idx, comp0Idx)*p0;
869 const Scalar partPressGas = p1 - partPressLiquid;
872 const Scalar xnn = partPressGas / p1;
873 const Scalar xnw = partPressLiquid / p1;
878 const Scalar xwn = partPressGas / (FluidSystem::fugacityCoefficient(equilFluidState, phase0Idx, comp1Idx)*p0);
879 const Scalar xww = 1.0 - xwn;
882 equilFluidState.setMoleFraction(phase0Idx, comp0Idx, xww);
883 equilFluidState.setMoleFraction(phase0Idx, comp1Idx, xwn);
884 equilFluidState.setMoleFraction(phase1Idx, comp0Idx, xnw);
885 equilFluidState.setMoleFraction(phase1Idx, comp1Idx, xnn);
889 for(
int phaseIdx=0; phaseIdx<ModelTraits::numFluidPhases(); ++phaseIdx){
890 for (
int compIdx=0; compIdx< numFluidComps; ++ compIdx){
891 xEquil_[phaseIdx][compIdx] = equilFluidState.moleFraction(phaseIdx, compIdx);
897 DUNE_THROW(Dune::InvalidStateException,
"nonequilibrium is only possible for 2 phases present ");
900 for(
int phaseIdx=0; phaseIdx<ModelTraits::numFluidPhases(); ++phaseIdx)
903 actualFluidState.setDensity(phaseIdx, rho);
905 actualFluidState.setMolarDensity(phaseIdx, rhoMolar);
916 const Scalar
xEquil(
const unsigned int phaseIdx,
const unsigned int compIdx)
const
918 return xEquil_[phaseIdx][compIdx] ;
922 std::array<std::array<Scalar, numFluidComps>, ModelTraits::numFluidPhases()> xEquil_;
The available discretization methods in Dumux.
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...
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Update the solid volume fractions (inert and reacitve) and set them in the solidstate.
Defines an enumeration for the formulations accepted by the two-phase model.
TwoPFormulation
Enumerates the formulations which the two-phase model accepts.
Definition: formulation.hh:35
@ p1s0
first phase saturation and second phase pressure as primary variables
@ p0s1
first phase pressure and second phase saturation as primary variables
void updateSolidVolumeFractions(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, SolidState &solidState, const int solidVolFracOffset)
update the solid volume fractions (inert and reacitve) and set them in the solidstate
Definition: updatesolidvolumefractions.hh:36
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
std::string phasePresence() noexcept
I/O name of phase presence.
Definition: name.hh:147
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:74
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
Computes all quantities of a generic fluid state if a reference phase has been specified.
Definition: computefromreferencephase.hh:77
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:112
Computes the composition of all phases of a N-phase, N-component fluid system assuming that all N pha...
Definition: misciblemultiphasecomposition.hh:60
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:82
Definition: porousmediumflow/2p2c/volumevariables.hh:44
Contains the quantities which are constant within a finite volume in the two-phase two-component mode...
Definition: porousmediumflow/2p2c/volumevariables.hh:65
Scalar averageMolarMass(int phaseIdx) const
Returns the average molar mass of the fluid phase.
Definition: porousmediumflow/2p2c/volumevariables.hh:256
void completeFluidState(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, FluidState &fluidState, SolidState &solidState)
Sets complete fluid state.
Definition: porousmediumflow/2p2c/volumevariables.hh:179
const PermeabilityType & permeability() const
Returns the average permeability within the control volume in .
Definition: porousmediumflow/2p2c/volumevariables.hh:368
Scalar porosity() const
Returns the average porosity within the control volume in .
Definition: porousmediumflow/2p2c/volumevariables.hh:362
const Impl & asImp_() const
Definition: porousmediumflow/2p2c/volumevariables.hh:396
typename Traits::FluidSystem FluidSystem
The fluid system used here.
Definition: porousmediumflow/2p2c/volumevariables.hh:107
Scalar mobility(const int phaseIdx) const
Returns the effective mobility of a given phase within the control volume in .
Definition: porousmediumflow/2p2c/volumevariables.hh:349
Impl & asImp_()
Definition: porousmediumflow/2p2c/volumevariables.hh:397
Scalar relativePermeability(const int phaseIdx) const
Returns the relative permeability of a given phase within the control volume in .
Definition: porousmediumflow/2p2c/volumevariables.hh:340
Scalar diffusionCoefficient(int phaseIdx, int compIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition: porousmediumflow/2p2c/volumevariables.hh:374
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition: porousmediumflow/2p2c/volumevariables.hh:135
Scalar temperature() const
Returns temperature within the control volume in .
Definition: porousmediumflow/2p2c/volumevariables.hh:331
typename Traits::FluidState FluidState
The type of the object returned by the fluidState() method.
Definition: porousmediumflow/2p2c/volumevariables.hh:105
Scalar capillaryPressure() const
Returns the effective capillary pressure within the control volume in .
Definition: porousmediumflow/2p2c/volumevariables.hh:356
Scalar molarDensity(const int phaseIdx) const
Returns the mass density of a given phase within the control volume in .
Definition: porousmediumflow/2p2c/volumevariables.hh:312
const FluidState & fluidState() const
Returns the phase state within the control volume.
Definition: porousmediumflow/2p2c/volumevariables.hh:242
static constexpr TwoPFormulation priVarFormulation()
Return the two-phase formulation used here.
Definition: porousmediumflow/2p2c/volumevariables.hh:118
Scalar density(const int phaseIdx) const
Returns the mass density of a given phase within the control volume in .
Definition: porousmediumflow/2p2c/volumevariables.hh:294
typename Traits::SolidState SolidState
Export type of solid state.
Definition: porousmediumflow/2p2c/volumevariables.hh:109
Scalar saturation(const int phaseIdx) const
Returns the saturation of a given phase within the control volume in .
Definition: porousmediumflow/2p2c/volumevariables.hh:265
static constexpr bool useMoles()
Return whether moles or masses are balanced.
Definition: porousmediumflow/2p2c/volumevariables.hh:116
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition: porousmediumflow/2p2c/volumevariables.hh:111
Scalar moleFraction(const int phaseIdx, const int compIdx) const
Returns the mole fraction of a given component in a given phase within the control volume in .
Definition: porousmediumflow/2p2c/volumevariables.hh:285
const SolidState & solidState() const
Returns the phase state for the control-volume.
Definition: porousmediumflow/2p2c/volumevariables.hh:248
Scalar pressure(const int phaseIdx) const
Returns the effective pressure of a given phase within the control volume in .
Definition: porousmediumflow/2p2c/volumevariables.hh:321
Scalar viscosity(const int phaseIdx) const
Returns the dynamic viscosity of the fluid within the control volume in .
Definition: porousmediumflow/2p2c/volumevariables.hh:303
Scalar massFraction(const int phaseIdx, const int compIdx) const
Returns the mass fraction of a given component in a given phase within the control volume in .
Definition: porousmediumflow/2p2c/volumevariables.hh:275
typename Traits::FluidState FluidState
The type of the object returned by the fluidState() method.
Definition: porousmediumflow/2p2c/volumevariables.hh:447
typename Traits::SolidState SolidState
Export type of solid state.
Definition: porousmediumflow/2p2c/volumevariables.hh:451
void completeFluidState(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, FluidState &fluidState, SolidState &solidState)
Sets complete fluid state.
Definition: porousmediumflow/2p2c/volumevariables.hh:484
typename Traits::FluidSystem FluidSystem
The fluid system used here.
Definition: porousmediumflow/2p2c/volumevariables.hh:449
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition: porousmediumflow/2p2c/volumevariables.hh:453
static constexpr bool useMoles()
Return whether moles or masses are balanced.
Definition: porousmediumflow/2p2c/volumevariables.hh:458
static constexpr TwoPFormulation priVarFormulation()
Return the two-phase formulation used here.
Definition: porousmediumflow/2p2c/volumevariables.hh:460
void completeFluidState(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, FluidState &fluidState, SolidState &solidState)
Sets complete fluid state.
Definition: porousmediumflow/2p2c/volumevariables.hh:753
typename Traits::FluidSystem FluidSystem
The fluid system used here.
Definition: porousmediumflow/2p2c/volumevariables.hh:717
typename Traits::SolidState SolidState
Export type of solid state.
Definition: porousmediumflow/2p2c/volumevariables.hh:719
static constexpr TwoPFormulation priVarFormulation()
Return the two-phase formulation used here.
Definition: porousmediumflow/2p2c/volumevariables.hh:728
const Scalar xEquil(const unsigned int phaseIdx, const unsigned int compIdx) const
The mole fraction we would have in the case of chemical equilibrium / on the interface.
Definition: porousmediumflow/2p2c/volumevariables.hh:916
typename Traits::FluidState FluidState
The type of the object returned by the fluidState() method.
Definition: porousmediumflow/2p2c/volumevariables.hh:715
static constexpr bool useMoles()
Return whether moles or masses are balanced.
Definition: porousmediumflow/2p2c/volumevariables.hh:726
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition: porousmediumflow/2p2c/volumevariables.hh:721
void updateMoleFraction(FluidState &actualFluidState, typename Traits::FluidSystem::ParameterCache ¶mCache, const typename Traits::PrimaryVariables &priVars)
Updates composition of all phases from the primary variables.
Definition: porousmediumflow/2p2c/volumevariables.hh:792
The primary variable switch controlling the phase presence state variable.
Definition: 2pnc/primaryvariableswitch.hh:41
Definition: porousmediumflow/nonisothermal/volumevariables.hh:75
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:40
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition: porousmediumflow/volumevariables.hh:52
const PrimaryVariables & priVars() const
Returns the vector of primary variables.
Definition: porousmediumflow/volumevariables.hh:76
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition: porousmediumflow/volumevariables.hh:64
Base class for the model specific class which provides access to all volume averaged quantities.
Base class for the model specific class which provides access to all volume averaged quantities.
The primary variable switch for the 2pnc model.