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(); }
90 static constexpr int numFluidComps = ParentType::numFluidComponents();
101 template<
class ElemSol,
class Problem,
class Element,
class Scv>
103 const Problem& problem,
104 const Element& element,
107 ParentType::update(elemSol, problem, element, scv);
109 completeFluidState(elemSol, problem, element, scv, fluidState_, solidState_);
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;
117 MPAdapter::relativePermeabilities(relativePermeability_, materialParams, fluidState_, wPhaseIdx);
119 typename FluidSystem::ParameterCache paramCache;
120 paramCache.updateAll(fluidState_);
125 if constexpr (enableDiffusion)
127 auto getEffectiveDiffusionCoefficient = [&](
int phaseIdx,
int compIIdx,
int compJIdx)
128 {
return EffDiffModel::effectiveDiffusionCoefficient(*
this, phaseIdx, compIIdx, compJIdx); };
130 effectiveDiffCoeff_.update(getEffectiveDiffusionCoefficient);
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,
162 EnergyVolVars::updateTemperature(elemSol, problem, element, scv, fluidState, solidState);
167 auto&& priVars = elemSol[scv.localDofIndex()];
169 for (
int phaseIdx = 0; phaseIdx < numFluidPhases() - 1; ++phaseIdx) {
170 sumSat += priVars[Indices::s0Idx + phaseIdx];
171 fluidState.setSaturation(phaseIdx, priVars[Indices::s0Idx + phaseIdx]);
174 fluidState.setSaturation(numFluidPhases() - 1, 1.0 - sumSat);
180 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
181 fluidState.setWettingPhase(wPhaseIdx);
182 const auto& materialParams =
183 problem.spatialParams().materialLawParams(element, scv, elemSol);
185 std::vector<Scalar> capPress(numFluidPhases());
186 using MaterialLaw =
typename Problem::SpatialParams::MaterialLaw;
188 MPAdapter::capillaryPressures(capPress, materialParams, fluidState, wPhaseIdx);
195 const Scalar pw = priVars[Indices::p0Idx];
196 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx)
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)
204 fluidState.setPressure(phaseIdx, pn - capPress[numFluidPhases()-1] + capPress[phaseIdx]);
207 DUNE_THROW(Dune::InvalidStateException,
"MPNCVolumeVariables do not support the chosen pressure formulation");
212 typename FluidSystem::ParameterCache paramCache;
213 paramCache.updateAll(fluidState);
217 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
218 fug[compIdx] = priVars[Indices::fug0Idx + compIdx];
221 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) {
223 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx) {
224 Scalar x_ij = 1.0/numFluidComps;
227 fluidState.setMoleFraction(phaseIdx,
238 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) {
241 fluidState.setViscosity(phaseIdx, mu);
244 Scalar h = FluidSystem::enthalpy(fluidState, paramCache, phaseIdx);
245 fluidState.setEnthalpy(phaseIdx, h);
254 {
return fluidState_; }
260 {
return solidState_; }
269 {
return fluidState_.saturation(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); }
306 {
return fluidState_.molarDensity(phaseIdx);}
315 {
return fluidState_.pressure(phaseIdx); }
323 {
return fluidState_.density(phaseIdx); }
333 {
return fluidState_.temperature(0); }
336 {
return fluidState_.temperature(phaseIdx); }
342 {
return fluidState_.enthalpy(phaseIdx); }
348 {
return fluidState_.internalEnergy(phaseIdx); }
355 {
return FluidSystem::thermalConductivity(fluidState_, phaseIdx); }
361 {
return fluidState_.fugacity(compIdx); }
367 {
return fluidState_.averageMolarMass(phaseIdx); }
385 {
return fluidState_.viscosity(phaseIdx); }
394 {
return relativePermeability_[phaseIdx]; }
400 {
return solidState_.porosity(); }
406 {
return permeability_; }
417 phasePresentIneq(fluidState(), phaseIdx) -
418 phaseNotPresentIneq(fluidState(), phaseIdx)
425 [[deprecated(
"Signature deprecated. Use diffusionCoefficient(phaseIdx, compIIdx, compJIdx)!")]]
428 if (compIdx != phaseIdx)
429 return diffusionCoefficient(phaseIdx, FluidSystem::getMainComponent(phaseIdx), compIdx);
431 DUNE_THROW(Dune::InvalidStateException,
"Diffusion coefficient called for phaseIdx = compIdx");
439 typename FluidSystem::ParameterCache paramCache;
440 paramCache.updatePhase(fluidState_, phaseIdx);
441 return FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, phaseIdx, compIIdx, compJIdx);
448 {
return effectiveDiffCoeff_(phaseIdx, compIIdx, compJIdx); }
457 Scalar aEval = phaseNotPresentIneq(fluidState(), phaseIdx);
458 Scalar bEval = phasePresentIneq(fluidState(), phaseIdx);
460 return phasePresentIneq(fluidState(), phaseIdx);
461 return phaseNotPresentIneq(fluidState(), phaseIdx);
472 const unsigned int phaseIdx)
const
473 {
return fluidState.saturation(phaseIdx); }
483 const unsigned int phaseIdx)
const
487 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
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;
542 static constexpr int numFluidComps = ParentType::numFluidComponents();
554 template<
class ElemSol,
class Problem,
class Element,
class Scv>
556 const Problem& problem,
557 const Element& element,
560 ParentType::update(elemSol, problem, element, scv);
562 completeFluidState(elemSol, problem, element, scv, fluidState_, solidState_);
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;
571 MPAdapter::relativePermeabilities(relativePermeability_, materialParams, fluidState_, wPhaseIdx);
572 typename FluidSystem::ParameterCache paramCache;
573 paramCache.updateAll(fluidState_);
577 if constexpr (enableDiffusion)
579 auto getEffectiveDiffusionCoefficient = [&](
int phaseIdx,
int compIIdx,
int compJIdx)
580 {
return EffDiffModel::effectiveDiffusionCoefficient(*
this, phaseIdx, compIIdx, compJIdx); };
582 effectiveDiffCoeff_.update(getEffectiveDiffusionCoefficient);
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,
612 EnergyVolVars::updateTemperature(elemSol, problem, element, scv, fluidState, solidState);
616 auto&& priVars = elemSol[scv.localDofIndex()];
618 for (
int phaseIdx = 0; phaseIdx < numFluidPhases() - 1; ++phaseIdx) {
619 sumSat += priVars[Indices::s0Idx + phaseIdx];
620 fluidState.setSaturation(phaseIdx, priVars[Indices::s0Idx + phaseIdx]);
623 fluidState.setSaturation(numFluidPhases() - 1, 1.0 - sumSat);
629 const auto& materialParams =
630 problem.spatialParams().materialLawParams(element, scv, elemSol);
631 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
632 fluidState.setWettingPhase(wPhaseIdx);
634 std::vector<Scalar> capPress(numFluidPhases());
635 using MaterialLaw =
typename Problem::SpatialParams::MaterialLaw;
637 MPAdapter::capillaryPressures(capPress, materialParams, fluidState, wPhaseIdx);
644 const Scalar pw = priVars[Indices::p0Idx];
645 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx)
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)
653 fluidState.setPressure(phaseIdx, pn - capPress[numFluidPhases()-1] + capPress[phaseIdx]);
656 DUNE_THROW(Dune::InvalidStateException,
"MPNCVolumeVariables do not support the chosen pressure formulation");
662 typename FluidSystem::ParameterCache paramCache;
663 paramCache.updateAll(fluidState);
667 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
668 fug[compIdx] = priVars[Indices::fug0Idx + compIdx];
670 updateMoleFraction(fluidState,
676 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) {
679 fluidState.setViscosity(phaseIdx, mu);
682 Scalar h = FluidSystem::enthalpy(fluidState, paramCache, phaseIdx);
683 fluidState.setEnthalpy(phaseIdx, h);
696 ParameterCache & paramCache,
697 const typename Traits::PrimaryVariables& priVars)
700 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx)
703 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx) {
704 actualFluidState.setMoleFraction(phaseIdx,
706 priVars[Indices::moleFrac00Idx +
707 phaseIdx*numFluidComps +
714 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx)
715 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx) {
716 const Scalar phi = FluidSystem::fugacityCoefficient(actualFluidState,
720 actualFluidState.setFugacityCoefficient(phaseIdx,
726 equilFluidState.assign(actualFluidState) ;
727 ConstraintSolver::solve(equilFluidState,
731 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx){
732 for (
int compIdx=0; compIdx< numFluidComps; ++ compIdx){
733 xEquil_[phaseIdx][compIdx] = equilFluidState.moleFraction(phaseIdx, compIdx);
738 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx){
740 actualFluidState.setDensity(phaseIdx, rho);
742 actualFluidState.setMolarDensity(phaseIdx, rhoMolar);
754 const Scalar
xEquil(
const unsigned int phaseIdx,
const unsigned int compIdx)
const
756 return xEquil_[phaseIdx][compIdx] ;
764 {
return fluidState_; }
770 {
return solidState_; }
779 {
return fluidState_.saturation(phaseIdx); }
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); }
816 {
return fluidState_.molarDensity(phaseIdx);}
825 {
return fluidState_.pressure(phaseIdx); }
833 {
return fluidState_.density(phaseIdx); }
843 {
return fluidState_.temperature(0); }
849 {
return fluidState_.enthalpy(phaseIdx); }
855 {
return fluidState_.internalEnergy(phaseIdx); }
862 {
return FluidSystem::thermalConductivity(fluidState_, phaseIdx); }
868 {
return fluidState_.fugacity(compIdx); }
874 {
return fluidState_.averageMolarMass(phaseIdx); }
892 {
return fluidState_.viscosity(phaseIdx); }
901 {
return relativePermeability_[phaseIdx]; }
907 {
return solidState_.porosity(); }
913 {
return permeability_; }
924 phasePresentIneq(fluidState(), phaseIdx) -
925 phaseNotPresentIneq(fluidState(), phaseIdx)
932 [[deprecated(
"Will be removed after release 3.2. Use diffusionCoefficient(phaseIdx, compIIdx, compJIdx)!")]]
935 if (compIdx != phaseIdx)
936 return diffusionCoefficient(phaseIdx, FluidSystem::getMainComponent(phaseIdx), compIdx);
938 DUNE_THROW(Dune::InvalidStateException,
"Diffusion coefficient called for phaseIdx = compIdx");
946 typename FluidSystem::ParameterCache paramCache;
947 paramCache.updatePhase(fluidState_, phaseIdx);
948 return FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, phaseIdx, compIIdx, compJIdx);
955 {
return effectiveDiffCoeff_(phaseIdx, compIIdx, compJIdx); }
964 Scalar aEval = phaseNotPresentIneq(fluidState(), phaseIdx);
965 Scalar bEval = phasePresentIneq(fluidState(), phaseIdx);
967 return phasePresentIneq(fluidState(), phaseIdx);
968 return phaseNotPresentIneq(fluidState(), phaseIdx);
979 const unsigned int phaseIdx)
const
980 {
return fluidState.saturation(phaseIdx); }
990 const unsigned int phaseIdx)
const
994 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
995 a -= fluidState.moleFraction(phaseIdx, compIdx);
1002 std::array<std::array<Scalar, numFluidComps>, numFluidPhases()>
xEquil_;
Computes the composition of all phases of a N-phase, N-component fluid system assuming that all N pha...
Determines the fluid composition given the component fugacities and an arbitary equation of state.
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.
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
std::string relativePermeability(int phaseIdx) noexcept
I/O name of relative permeability for multiphase systems.
Definition: name.hh:92
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
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
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
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
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
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
Definition: porousmediumflow/nonisothermal/volumevariables.hh:75
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:40
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.