26#ifndef DUMUX_MPNC_VOLUME_VARIABLES_HH
27#define DUMUX_MPNC_VOLUME_VARIABLES_HH
41template <
class Traits,
bool enableChemicalNonEquilibrium>
49template <
class Traits>
52template <
class Traits>
60 using Scalar =
typename Traits::PrimaryVariables::value_type;
61 using PermeabilityType =
typename Traits::PermeabilityType;
63 using ModelTraits =
typename Traits::ModelTraits;
64 static constexpr auto pressureFormulation = ModelTraits::pressureFormulation();
66 static constexpr bool enableThermalNonEquilibrium = ModelTraits::enableThermalNonEquilibrium();
67 static constexpr bool enableChemicalNonEquilibrium = ModelTraits::enableChemicalNonEquilibrium();
68 static constexpr bool enableDiffusion = ModelTraits::enableMolecularDiffusion();
70 using ComponentVector = Dune::FieldVector<Scalar, ModelTraits::numFluidComponents()>;
72 using EffDiffModel =
typename Traits::EffectiveDiffusivityModel;
73 using DiffusionCoefficients =
typename Traits::DiffusionType::DiffusionCoefficientsContainer;
77 using Indices =
typename Traits::ModelTraits::Indices;
88 static constexpr int numFluidPhases() {
return ModelTraits::numFluidPhases(); }
101 template<
class ElemSol,
class Problem,
class Element,
class Scv>
103 const Problem& problem,
104 const Element& element,
112 const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
113 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
115 using MaterialLaw =
typename Problem::SpatialParams::MaterialLaw;
119 typename FluidSystem::ParameterCache paramCache;
125 if constexpr (enableDiffusion)
127 auto getEffectiveDiffusionCoefficient = [&](
int phaseIdx,
int compIIdx,
int compJIdx)
128 {
return EffDiffModel::effectiveDiffusionCoefficient(*
this, phaseIdx, compIIdx, compJIdx); };
133 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv,
solidState_);
134 permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
135 EnergyVolVars::updateEffectiveThermalConductivity();
150 template<
class ElemSol,
class Problem,
class Element,
class Scv>
152 const Problem& problem,
153 const Element& element,
167 auto&&
priVars = elemSol[scv.localDofIndex()];
169 for (
int phaseIdx = 0; phaseIdx <
numFluidPhases() - 1; ++phaseIdx) {
170 sumSat +=
priVars[Indices::s0Idx + phaseIdx];
180 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
182 const auto& materialParams =
183 problem.spatialParams().materialLawParams(element, scv, elemSol);
186 using MaterialLaw =
typename Problem::SpatialParams::MaterialLaw;
188 MPAdapter::capillaryPressures(capPress, materialParams,
fluidState, wPhaseIdx);
195 const Scalar pw =
priVars[Indices::p0Idx];
197 fluidState.setPressure(phaseIdx, pw - capPress[0] + capPress[phaseIdx]);
202 const Scalar pn =
priVars[Indices::p0Idx];
203 for (
int phaseIdx =
numFluidPhases()-1; phaseIdx >= 0; --phaseIdx)
207 DUNE_THROW(Dune::InvalidStateException,
"MPNCVolumeVariables do not support the chosen pressure formulation");
212 typename FluidSystem::ParameterCache paramCache;
218 fug[compIdx] =
priVars[Indices::fug0Idx + compIdx];
240 Scalar mu = FluidSystem::viscosity(
fluidState, paramCache, phaseIdx);
244 Scalar h = FluidSystem::enthalpy(
fluidState, paramCache, phaseIdx);
279 {
return fluidState_.massFraction(phaseIdx, compIdx); }
289 {
return fluidState_.moleFraction(phaseIdx, compIdx); }
297 Scalar
molarity(
const int phaseIdx,
int compIdx)
const
298 {
return fluidState_.molarity(phaseIdx, compIdx); }
355 {
return FluidSystem::thermalConductivity(
fluidState_, phaseIdx); }
425 [[deprecated(
"Signature deprecated. Use diffusionCoefficient(phaseIdx, compIIdx, compJIdx)!")]]
428 if (compIdx != phaseIdx)
431 DUNE_THROW(Dune::InvalidStateException,
"Diffusion coefficient called for phaseIdx = compIdx");
439 typename FluidSystem::ParameterCache paramCache;
441 return FluidSystem::binaryDiffusionCoefficient(
fluidState_, paramCache, phaseIdx, compIIdx, compJIdx);
472 const unsigned int phaseIdx)
const
483 const unsigned int phaseIdx)
const
488 a -=
fluidState.moleFraction(phaseIdx, compIdx);
505template <
class Traits>
512 using Scalar =
typename Traits::PrimaryVariables::value_type;
513 using PermeabilityType =
typename Traits::PermeabilityType;
515 using ModelTraits =
typename Traits::ModelTraits;
516 static constexpr auto pressureFormulation = ModelTraits::pressureFormulation();
518 static constexpr bool enableThermalNonEquilibrium = ModelTraits::enableThermalNonEquilibrium();
519 static constexpr bool enableChemicalNonEquilibrium = ModelTraits::enableChemicalNonEquilibrium();
520 static constexpr bool enableDiffusion = ModelTraits::enableMolecularDiffusion();
522 using Indices =
typename ModelTraits::Indices;
523 using ComponentVector = Dune::FieldVector<Scalar, ModelTraits::numFluidComponents()>;
525 using ParameterCache =
typename Traits::FluidSystem::ParameterCache;
526 using EffDiffModel =
typename Traits::EffectiveDiffusivityModel;
527 using DiffusionCoefficients =
typename Traits::DiffusionType::DiffusionCoefficientsContainer;
554 template<
class ElemSol,
class Problem,
class Element,
class Scv>
556 const Problem& problem,
557 const Element& element,
565 const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
566 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
569 using MaterialLaw =
typename Problem::SpatialParams::MaterialLaw;
572 typename FluidSystem::ParameterCache paramCache;
577 if constexpr (enableDiffusion)
579 auto getEffectiveDiffusionCoefficient = [&](
int phaseIdx,
int compIIdx,
int compJIdx)
580 {
return EffDiffModel::effectiveDiffusionCoefficient(*
this, phaseIdx, compIIdx, compJIdx); };
585 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv,
solidState_);
586 permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
587 EnergyVolVars::updateEffectiveThermalConductivity();
601 template<
class ElemSol,
class Problem,
class Element,
class Scv>
603 const Problem& problem,
604 const Element& element,
616 auto&&
priVars = elemSol[scv.localDofIndex()];
618 for (
int phaseIdx = 0; phaseIdx <
numFluidPhases() - 1; ++phaseIdx) {
619 sumSat +=
priVars[Indices::s0Idx + phaseIdx];
629 const auto& materialParams =
630 problem.spatialParams().materialLawParams(element, scv, elemSol);
631 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
635 using MaterialLaw =
typename Problem::SpatialParams::MaterialLaw;
637 MPAdapter::capillaryPressures(capPress, materialParams,
fluidState, wPhaseIdx);
644 const Scalar pw =
priVars[Indices::p0Idx];
646 fluidState.setPressure(phaseIdx, pw - capPress[0] + capPress[phaseIdx]);
651 const Scalar pn =
priVars[Indices::p0Idx];
652 for (
int phaseIdx =
numFluidPhases()-1; phaseIdx >= 0; --phaseIdx)
656 DUNE_THROW(Dune::InvalidStateException,
"MPNCVolumeVariables do not support the chosen pressure formulation");
662 typename FluidSystem::ParameterCache paramCache;
668 fug[compIdx] =
priVars[Indices::fug0Idx + compIdx];
678 Scalar mu = FluidSystem::viscosity(
fluidState, paramCache, phaseIdx);
682 Scalar h = FluidSystem::enthalpy(
fluidState, paramCache, phaseIdx);
696 ParameterCache & paramCache,
697 const typename Traits::PrimaryVariables&
priVars)
704 actualFluidState.setMoleFraction(phaseIdx,
706 priVars[Indices::moleFrac00Idx +
716 const Scalar phi = FluidSystem::fugacityCoefficient(actualFluidState,
720 actualFluidState.setFugacityCoefficient(phaseIdx,
726 equilFluidState.assign(actualFluidState) ;
733 xEquil_[phaseIdx][compIdx] = equilFluidState.moleFraction(phaseIdx, compIdx);
739 const Scalar rho = FluidSystem::density(actualFluidState, paramCache, phaseIdx);
740 actualFluidState.setDensity(phaseIdx, rho);
741 const Scalar rhoMolar = FluidSystem::molarDensity(actualFluidState, paramCache, phaseIdx);
742 actualFluidState.setMolarDensity(phaseIdx, rhoMolar);
754 const Scalar
xEquil(
const unsigned int phaseIdx,
const unsigned int compIdx)
const
756 return xEquil_[phaseIdx][compIdx] ;
789 {
return fluidState_.massFraction(phaseIdx, compIdx); }
799 {
return fluidState_.moleFraction(phaseIdx, compIdx); }
807 Scalar
molarity(
const int phaseIdx,
int compIdx)
const
808 {
return fluidState_.molarity(phaseIdx, compIdx); }
862 {
return FluidSystem::thermalConductivity(
fluidState_, phaseIdx); }
932 [[deprecated(
"Will be removed after release 3.2. Use diffusionCoefficient(phaseIdx, compIIdx, compJIdx)!")]]
935 if (compIdx != phaseIdx)
938 DUNE_THROW(Dune::InvalidStateException,
"Diffusion coefficient called for phaseIdx = compIdx");
946 typename FluidSystem::ParameterCache paramCache;
948 return FluidSystem::binaryDiffusionCoefficient(
fluidState_, paramCache, phaseIdx, compIIdx, compJIdx);
979 const unsigned int phaseIdx)
const
990 const unsigned int phaseIdx)
const
995 a -=
fluidState.moleFraction(phaseIdx, compIdx);
Determines the fluid composition given the component fugacities and an arbitary equation of state.
Computes the composition of all phases of a N-phase, N-component fluid system assuming that all N pha...
Makes the capillary pressure-saturation relations available under the M-phase API for material laws.
Update the solid volume fractions (inert and reacitve) and set them in the solidstate.
Enumeration of the formulations accepted by the MpNc model.
MPNCVolumeVariablesImplementation< Traits, Traits::ModelTraits::enableChemicalNonEquilibrium()> MPNCVolumeVariables
Contains the quantities which are constant within a finite volume in the MpNc model.
Definition porousmediumflow/mpnc/volumevariables.hh:50
@ mostWettingFirst
Definition pressureformulation.hh:37
@ leastWettingFirst
Definition pressureformulation.hh:37
EnergyVolumeVariablesImplementation< IsothermalTraits, Impl, IsothermalTraits::ModelTraits::enableEnergyBalance()> EnergyVolumeVariables
Base class for the model specific class which provides access to all volume averaged quantities.
Definition porousmediumflow/nonisothermal/volumevariables.hh:85
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
bool CheckDefined(const T &value)
Make valgrind complain if the object occupied by an object is undefined.
Definition valgrind.hh:72
Calculates the chemical equilibrium from the component fugacities in the phase .
Definition compositionfromfugacities.hh:55
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:71
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:99
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
An adapter for mpnc to use the capillary pressure-saturation relationships.
Definition mpadapter.hh:42
Definition porousmediumflow/mpnc/volumevariables.hh:42
Scalar diffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition porousmediumflow/mpnc/volumevariables.hh:437
typename Traits::SolidState SolidState
Export type of solid state.
Definition porousmediumflow/mpnc/volumevariables.hh:83
Scalar temperature() const
Returns the temperature inside the sub-control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:332
Scalar averageMolarMass(const int phaseIdx) const
Returns the average molar mass the of the phase.
Definition porousmediumflow/mpnc/volumevariables.hh:366
FluidState fluidState_
Mass fractions of each component within each phase.
Definition porousmediumflow/mpnc/volumevariables.hh:498
Scalar saturation(int phaseIdx) const
Returns the saturation of a given phase within the control volume in .
Definition porousmediumflow/mpnc/volumevariables.hh:268
Scalar pressure(const int phaseIdx) const
Returns the effective pressure of a given phase within the control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:314
static constexpr int numFluidComps
Return number of components considered by the model.
Definition porousmediumflow/mpnc/volumevariables.hh:90
const FluidState & fluidState() const
Returns the fluid configuration at the given primary variables.
Definition porousmediumflow/mpnc/volumevariables.hh:253
Scalar fluidThermalConductivity(const int phaseIdx) const
Returns the thermal conductivity of a fluid phase in the sub-control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:354
Scalar porosity() const
Returns the average porosity within the control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:399
Scalar mobility(const unsigned int phaseIdx) const
Returns the effective mobility of a given phase within the control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:375
const SolidState & solidState() const
Returns the phase state for the control-volume.
Definition porousmediumflow/mpnc/volumevariables.hh:259
Scalar relativePermeability(const unsigned int phaseIdx) const
Returns the relative permeability of a given phase within the control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:393
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/mpnc/volumevariables.hh:278
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:102
Scalar molarity(const int phaseIdx, int compIdx) const
Returns the concentration of a component in the phase.
Definition porousmediumflow/mpnc/volumevariables.hh:297
typename Traits::ModelTraits::Indices Indices
Export the type encapsulating primary variable indices.
Definition porousmediumflow/mpnc/volumevariables.hh:77
Scalar temperature(const int phaseIdx) const
Definition porousmediumflow/mpnc/volumevariables.hh:335
const PermeabilityType & permeability() const
Returns the permeability within the control volume in .
Definition porousmediumflow/mpnc/volumevariables.hh:405
Scalar fugacity(const int compIdx) const
Returns the fugacity the of the component.
Definition porousmediumflow/mpnc/volumevariables.hh:360
Scalar enthalpy(const int phaseIdx) const
Return enthalpy the of the fluid phase.
Definition porousmediumflow/mpnc/volumevariables.hh:341
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the effective diffusion coefficients for a phase in .
Definition porousmediumflow/mpnc/volumevariables.hh:447
SolidState solidState_
Definition porousmediumflow/mpnc/volumevariables.hh:499
Scalar density(const int phaseIdx) const
Returns the density the of the fluid phase.
Definition porousmediumflow/mpnc/volumevariables.hh:322
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/mpnc/volumevariables.hh:288
std::array< Scalar, ModelTraits::numFluidPhases()> relativePermeability_
Effective relative permeability within the control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:494
typename Traits::FluidState FluidState
Export the fluid state type.
Definition porousmediumflow/mpnc/volumevariables.hh:81
DiffusionCoefficients effectiveDiffCoeff_
Definition porousmediumflow/mpnc/volumevariables.hh:502
Scalar molarDensity(const int phaseIdx) const
Returns the molar density the of the fluid phase.
Definition porousmediumflow/mpnc/volumevariables.hh:305
Scalar phaseNcp(const unsigned int phaseIdx) const
Returns the value of the NCP-function for a phase.
Definition porousmediumflow/mpnc/volumevariables.hh:455
static constexpr int numFluidPhases()
Return number of phases considered by the model.
Definition porousmediumflow/mpnc/volumevariables.hh:88
Scalar phasePresentIneq(const FluidState &fluidState, const unsigned int phaseIdx) const
Returns the value of the inequality where a phase is present.
Definition porousmediumflow/mpnc/volumevariables.hh:471
Scalar viscosity(const unsigned int phaseIdx) const
Returns the viscosity of a given phase within the control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:384
void completeFluidState(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, FluidState &fluidState, SolidState &solidState)
Sets complete fluid state.
Definition porousmediumflow/mpnc/volumevariables.hh:151
PermeabilityType permeability_
Definition porousmediumflow/mpnc/volumevariables.hh:495
Scalar internalEnergy(const int phaseIdx) const
Returns the internal energy the of the fluid phase.
Definition porousmediumflow/mpnc/volumevariables.hh:347
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition porousmediumflow/mpnc/volumevariables.hh:85
Scalar phaseNotPresentIneq(const FluidState &fluidState, const unsigned int phaseIdx) const
Returns the value of the inequality where a phase is not present.
Definition porousmediumflow/mpnc/volumevariables.hh:482
typename Traits::FluidSystem FluidSystem
Export the underlying fluid system.
Definition porousmediumflow/mpnc/volumevariables.hh:79
Scalar porosity_
Effective porosity within the control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:493
Scalar diffusionCoefficient(int phaseIdx, int compIdx) const
Returns the diffusion coefficient.
Definition porousmediumflow/mpnc/volumevariables.hh:426
bool isPhaseActive(const unsigned int phaseIdx) const
Returns true if the fluid state is in the active set for a phase,.
Definition porousmediumflow/mpnc/volumevariables.hh:414
Scalar fugacity(const int compIdx) const
Returns the fugacity the of the component.
Definition porousmediumflow/mpnc/volumevariables.hh:867
PermeabilityType permeability_
Definition porousmediumflow/mpnc/volumevariables.hh:1001
Scalar fluidThermalConductivity(const int phaseIdx) const
Returns the thermal conductivity of a fluid phase in the sub-control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:861
Scalar temperature() const
Returns the temperature inside the sub-control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:842
MiscibleMultiPhaseComposition< Scalar, FluidSystem > ConstraintSolver
Definition porousmediumflow/mpnc/volumevariables.hh:543
Scalar mobility(const unsigned int phaseIdx) const
Returns the effective mobility of a given phase within the control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:882
void updateMoleFraction(FluidState &actualFluidState, ParameterCache ¶mCache, const typename Traits::PrimaryVariables &priVars)
Updates composition of all phases in the mutable parameters from the primary variables.
Definition porousmediumflow/mpnc/volumevariables.hh:695
Scalar pressure(const int phaseIdx) const
Returns the effective pressure of a given phase within the control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:824
static constexpr int numFluidComps
Return number of components considered by the model.
Definition porousmediumflow/mpnc/volumevariables.hh:542
const SolidState & solidState() const
Returns the phase state for the control-volume.
Definition porousmediumflow/mpnc/volumevariables.hh:769
Scalar phasePresentIneq(const FluidState &fluidState, const unsigned int phaseIdx) const
Returns the value of the inequality where a phase is present.
Definition porousmediumflow/mpnc/volumevariables.hh:978
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition porousmediumflow/mpnc/volumevariables.hh:537
Scalar porosity() const
Returns the average porosity within the control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:906
typename Traits::SolidState SolidState
Export type of solid state.
Definition porousmediumflow/mpnc/volumevariables.hh:535
Scalar phaseNotPresentIneq(const FluidState &fluidState, const unsigned int phaseIdx) const
Returns the value of the inequality where a phase is not present.
Definition porousmediumflow/mpnc/volumevariables.hh:989
typename Traits::FluidState FluidState
Export the fluid state type.
Definition porousmediumflow/mpnc/volumevariables.hh:533
Scalar enthalpy(const int phaseIdx) const
Returns the enthalpy the of the fluid phase.
Definition porousmediumflow/mpnc/volumevariables.hh:848
Scalar density(const int phaseIdx) const
Returns the density the of the fluid phase.
Definition porousmediumflow/mpnc/volumevariables.hh:832
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the effective diffusion coefficients for a phase in .
Definition porousmediumflow/mpnc/volumevariables.hh:954
SolidState solidState_
Definition porousmediumflow/mpnc/volumevariables.hh:1006
typename Traits::FluidSystem FluidSystem
Export the underlying fluid system.
Definition porousmediumflow/mpnc/volumevariables.hh:531
Scalar diffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition porousmediumflow/mpnc/volumevariables.hh:944
const PermeabilityType & permeability() const
Returns the permeability within the control volume in .
Definition porousmediumflow/mpnc/volumevariables.hh:912
Scalar molarDensity(const int phaseIdx) const
Returns the molar density the of the fluid phase.
Definition porousmediumflow/mpnc/volumevariables.hh:815
Scalar viscosity(const unsigned int phaseIdx) const
Returns the viscosity of a given phase within the control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:891
Scalar internalEnergy(const int phaseIdx) const
Returns the internal energy the of the fluid phase.
Definition porousmediumflow/mpnc/volumevariables.hh:854
std::array< std::array< Scalar, numFluidComps >, numFluidPhases()> xEquil_
Definition porousmediumflow/mpnc/volumevariables.hh:1002
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/mpnc/volumevariables.hh:798
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:555
static constexpr int numFluidPhases()
Return number of phases considered by the model.
Definition porousmediumflow/mpnc/volumevariables.hh:540
Scalar saturation(int phaseIdx) const
Returns the saturation of a given phase within the control volume in .
Definition porousmediumflow/mpnc/volumevariables.hh:778
FluidState fluidState_
Mass fractions of each component within each phase.
Definition porousmediumflow/mpnc/volumevariables.hh:1005
Scalar phaseNcp(const unsigned int phaseIdx) const
Returns the value of the NCP-function for a phase.
Definition porousmediumflow/mpnc/volumevariables.hh:962
Scalar averageMolarMass(const int phaseIdx) const
Returns the average molar mass the of the phase.
Definition porousmediumflow/mpnc/volumevariables.hh:873
Scalar diffusionCoefficient(int phaseIdx, int compIdx) const
Returns the diffusion coefficient.
Definition porousmediumflow/mpnc/volumevariables.hh:933
std::array< Scalar, ModelTraits::numFluidPhases()> relativePermeability_
Effective relative permeability within the control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:1000
void completeFluidState(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, FluidState &fluidState, SolidState &solidState)
Sets complete fluid state.
Definition porousmediumflow/mpnc/volumevariables.hh:602
DiffusionCoefficients effectiveDiffCoeff_
Definition porousmediumflow/mpnc/volumevariables.hh:1009
bool isPhaseActive(const unsigned int phaseIdx) const
Returns true if the fluid state is in the active set for a phase,.
Definition porousmediumflow/mpnc/volumevariables.hh:921
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/mpnc/volumevariables.hh:788
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/mpnc/volumevariables.hh:754
Scalar relativePermeability(const unsigned int phaseIdx) const
Returns the relative permeability of a given phase within the control volume.
Definition porousmediumflow/mpnc/volumevariables.hh:900
const FluidState & fluidState() const
Returns the fluid configuration at the given primary variables.
Definition porousmediumflow/mpnc/volumevariables.hh:763
Scalar molarity(const int phaseIdx, int compIdx) const
Returns the concentration of a component in the phase.
Definition porousmediumflow/mpnc/volumevariables.hh:807
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.