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& spatialParams = problem.spatialParams();
113 const int wPhaseIdx = spatialParams.template wettingPhase<FluidSystem>(element, scv, elemSol);
114 const auto fluidMatrixInteraction = spatialParams.fluidMatrixInteraction(element, scv, elemSol);
115 const auto relPerm = fluidMatrixInteraction.relativePermeabilities(fluidState_, wPhaseIdx);
116 std::copy(relPerm.begin(), relPerm.end(), relativePermeability_.begin());
118 typename FluidSystem::ParameterCache paramCache;
119 paramCache.updateAll(fluidState_);
124 if constexpr (enableDiffusion)
126 auto getEffectiveDiffusionCoefficient = [&](
int phaseIdx,
int compIIdx,
int compJIdx)
127 {
return EffDiffModel::effectiveDiffusionCoefficient(*
this, phaseIdx, compIIdx, compJIdx); };
129 effectiveDiffCoeff_.update(getEffectiveDiffusionCoefficient);
132 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv, solidState_);
133 permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
134 EnergyVolVars::updateEffectiveThermalConductivity();
149 template<
class ElemSol,
class Problem,
class Element,
class Scv>
151 const Problem& problem,
152 const Element& element,
161 EnergyVolVars::updateTemperature(elemSol, problem, element, scv, fluidState, solidState);
166 auto&& priVars = elemSol[scv.localDofIndex()];
168 for (
int phaseIdx = 0; phaseIdx < numFluidPhases() - 1; ++phaseIdx) {
169 sumSat += priVars[Indices::s0Idx + phaseIdx];
170 fluidState.setSaturation(phaseIdx, priVars[Indices::s0Idx + phaseIdx]);
172 fluidState.setSaturation(numFluidPhases() - 1, 1.0 - sumSat);
178 const auto& spatialParams = problem.spatialParams();
179 const int wPhaseIdx = spatialParams.template wettingPhase<FluidSystem>(element, scv, elemSol);
180 fluidState.setWettingPhase(wPhaseIdx);
183 const auto fluidMatrixInteraction = spatialParams.fluidMatrixInteraction(element, scv, elemSol);
184 const auto capPress = fluidMatrixInteraction.capillaryPressures(fluidState, wPhaseIdx);
191 const Scalar pw = priVars[Indices::p0Idx];
192 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx)
193 fluidState.setPressure(phaseIdx, pw - capPress[0] + capPress[phaseIdx]);
198 const Scalar pn = priVars[Indices::p0Idx];
199 for (
int phaseIdx = numFluidPhases()-1; phaseIdx >= 0; --phaseIdx)
200 fluidState.setPressure(phaseIdx, pn - capPress[numFluidPhases()-1] + capPress[phaseIdx]);
203 DUNE_THROW(Dune::InvalidStateException,
"MPNCVolumeVariables do not support the chosen pressure formulation");
208 typename FluidSystem::ParameterCache paramCache;
209 paramCache.updateAll(fluidState);
213 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
214 fug[compIdx] = priVars[Indices::fug0Idx + compIdx];
217 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) {
219 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx) {
221 if (FluidSystem::fugacityCoefficient(fluidState, paramCache, phaseIdx, compIdx) == 0.0)
222 DUNE_THROW(
NumericalProblem,
"MPNCVolumeVariables do not support fluidsystems with fugacity coefficients of 0");
225 fluidState.setMoleFraction(phaseIdx, compIdx, 1.0/numFluidComps);
235 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) {
238 fluidState.setViscosity(phaseIdx, mu);
241 Scalar h = FluidSystem::enthalpy(fluidState, paramCache, phaseIdx);
242 fluidState.setEnthalpy(phaseIdx, h);
251 {
return fluidState_; }
257 {
return solidState_; }
266 {
return fluidState_.saturation(phaseIdx); }
276 {
return fluidState_.massFraction(phaseIdx, compIdx); }
286 {
return fluidState_.moleFraction(phaseIdx, compIdx); }
294 Scalar
molarity(
const int phaseIdx,
int compIdx)
const
295 {
return fluidState_.molarity(phaseIdx, compIdx); }
303 {
return fluidState_.molarDensity(phaseIdx);}
312 {
return fluidState_.pressure(phaseIdx); }
320 {
return fluidState_.density(phaseIdx); }
330 {
return fluidState_.temperature(0); }
333 {
return fluidState_.temperature(phaseIdx); }
339 {
return fluidState_.enthalpy(phaseIdx); }
345 {
return fluidState_.internalEnergy(phaseIdx); }
352 {
return FluidSystem::thermalConductivity(fluidState_, phaseIdx); }
358 {
return fluidState_.fugacity(compIdx); }
364 {
return fluidState_.averageMolarMass(phaseIdx); }
382 {
return fluidState_.viscosity(phaseIdx); }
391 {
return relativePermeability_[phaseIdx]; }
397 {
return solidState_.porosity(); }
403 {
return permeability_; }
414 phasePresentIneq(fluidState(), phaseIdx) -
415 phaseNotPresentIneq(fluidState(), phaseIdx)
424 typename FluidSystem::ParameterCache paramCache;
425 paramCache.updatePhase(fluidState_, phaseIdx);
426 return FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, phaseIdx, compIIdx, compJIdx);
433 {
return effectiveDiffCoeff_(phaseIdx, compIIdx, compJIdx); }
442 Scalar aEval = phaseNotPresentIneq(fluidState(), phaseIdx);
443 Scalar bEval = phasePresentIneq(fluidState(), phaseIdx);
445 return phasePresentIneq(fluidState(), phaseIdx);
446 return phaseNotPresentIneq(fluidState(), phaseIdx);
457 const unsigned int phaseIdx)
const
458 {
return fluidState.saturation(phaseIdx); }
468 const unsigned int phaseIdx)
const
472 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
473 a -= fluidState.moleFraction(phaseIdx, compIdx);
490template <
class Traits>
497 using Scalar =
typename Traits::PrimaryVariables::value_type;
498 using PermeabilityType =
typename Traits::PermeabilityType;
500 using ModelTraits =
typename Traits::ModelTraits;
501 static constexpr auto pressureFormulation = ModelTraits::pressureFormulation();
503 static constexpr bool enableThermalNonEquilibrium = ModelTraits::enableThermalNonEquilibrium();
504 static constexpr bool enableChemicalNonEquilibrium = ModelTraits::enableChemicalNonEquilibrium();
505 static constexpr bool enableDiffusion = ModelTraits::enableMolecularDiffusion();
507 using Indices =
typename ModelTraits::Indices;
508 using ComponentVector = Dune::FieldVector<Scalar, ModelTraits::numFluidComponents()>;
510 using ParameterCache =
typename Traits::FluidSystem::ParameterCache;
511 using EffDiffModel =
typename Traits::EffectiveDiffusivityModel;
512 using DiffusionCoefficients =
typename Traits::DiffusionType::DiffusionCoefficientsContainer;
527 static constexpr int numFluidComps = ParentType::numFluidComponents();
539 template<
class ElemSol,
class Problem,
class Element,
class Scv>
541 const Problem& problem,
542 const Element& element,
545 ParentType::update(elemSol, problem, element, scv);
547 completeFluidState(elemSol, problem, element, scv, fluidState_, solidState_);
550 const auto& spatialParams = problem.spatialParams();
551 const int wPhaseIdx = spatialParams.template wettingPhase<FluidSystem>(element, scv, elemSol);
552 const auto fluidMatrixInteraction = spatialParams.fluidMatrixInteraction(element, scv, elemSol);
553 const auto relPerm = fluidMatrixInteraction.relativePermeabilities(fluidState_, wPhaseIdx);
554 std::copy(relPerm.begin(), relPerm.end(), relativePermeability_.begin());
556 typename FluidSystem::ParameterCache paramCache;
557 paramCache.updateAll(fluidState_);
561 if constexpr (enableDiffusion)
563 auto getEffectiveDiffusionCoefficient = [&](
int phaseIdx,
int compIIdx,
int compJIdx)
564 {
return EffDiffModel::effectiveDiffusionCoefficient(*
this, phaseIdx, compIIdx, compJIdx); };
566 effectiveDiffCoeff_.update(getEffectiveDiffusionCoefficient);
569 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv, solidState_);
570 permeability_ = spatialParams.permeability(element, scv, elemSol);
571 EnergyVolVars::updateEffectiveThermalConductivity();
585 template<
class ElemSol,
class Problem,
class Element,
class Scv>
587 const Problem& problem,
588 const Element& element,
596 EnergyVolVars::updateTemperature(elemSol, problem, element, scv, fluidState, solidState);
600 auto&& priVars = elemSol[scv.localDofIndex()];
602 for (
int phaseIdx = 0; phaseIdx < numFluidPhases() - 1; ++phaseIdx) {
603 sumSat += priVars[Indices::s0Idx + phaseIdx];
604 fluidState.setSaturation(phaseIdx, priVars[Indices::s0Idx + phaseIdx]);
606 fluidState.setSaturation(numFluidPhases() - 1, 1.0 - sumSat);
612 const auto& spatialParams = problem.spatialParams();
613 const int wPhaseIdx = spatialParams.template wettingPhase<FluidSystem>(element, scv, elemSol);
614 fluidState.setWettingPhase(wPhaseIdx);
615 const auto fluidMatrixInteraction = spatialParams.fluidMatrixInteraction(element, scv, elemSol);
616 const auto capPress = fluidMatrixInteraction.capillaryPressures(fluidState, wPhaseIdx);
623 const Scalar pw = priVars[Indices::p0Idx];
624 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx)
625 fluidState.setPressure(phaseIdx, pw - capPress[0] + capPress[phaseIdx]);
630 const Scalar pn = priVars[Indices::p0Idx];
631 for (
int phaseIdx = numFluidPhases()-1; phaseIdx >= 0; --phaseIdx)
632 fluidState.setPressure(phaseIdx, pn - capPress[numFluidPhases()-1] + capPress[phaseIdx]);
635 DUNE_THROW(Dune::InvalidStateException,
"MPNCVolumeVariables do not support the chosen pressure formulation");
641 typename FluidSystem::ParameterCache paramCache;
642 paramCache.updateAll(fluidState);
644 updateMoleFraction(fluidState, paramCache, priVars);
647 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) {
650 fluidState.setViscosity(phaseIdx, mu);
653 Scalar h = FluidSystem::enthalpy(fluidState, paramCache, phaseIdx);
654 fluidState.setEnthalpy(phaseIdx, h);
667 ParameterCache & paramCache,
668 const typename Traits::PrimaryVariables& priVars)
671 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx)
674 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx) {
675 actualFluidState.setMoleFraction(phaseIdx,
677 priVars[Indices::moleFrac00Idx +
678 phaseIdx*numFluidComps +
684 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx)
685 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx) {
686 const Scalar phi = FluidSystem::fugacityCoefficient(actualFluidState,
690 actualFluidState.setFugacityCoefficient(phaseIdx,
696 equilFluidState.assign(actualFluidState) ;
697 ConstraintSolver::solve(equilFluidState,
701 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx){
702 for (
int compIdx=0; compIdx< numFluidComps; ++ compIdx){
703 xEquil_[phaseIdx][compIdx] = equilFluidState.moleFraction(phaseIdx, compIdx);
708 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx){
710 actualFluidState.setDensity(phaseIdx, rho);
712 actualFluidState.setMolarDensity(phaseIdx, rhoMolar);
724 const Scalar
xEquil(
const unsigned int phaseIdx,
const unsigned int compIdx)
const
726 return xEquil_[phaseIdx][compIdx] ;
734 {
return fluidState_; }
740 {
return solidState_; }
749 {
return fluidState_.saturation(phaseIdx); }
759 {
return fluidState_.massFraction(phaseIdx, compIdx); }
769 {
return fluidState_.moleFraction(phaseIdx, compIdx); }
777 Scalar
molarity(
const int phaseIdx,
int compIdx)
const
778 {
return fluidState_.molarity(phaseIdx, compIdx); }
786 {
return fluidState_.molarDensity(phaseIdx);}
795 {
return fluidState_.pressure(phaseIdx); }
803 {
return fluidState_.density(phaseIdx); }
813 {
return fluidState_.temperature(0); }
819 {
return fluidState_.enthalpy(phaseIdx); }
825 {
return fluidState_.internalEnergy(phaseIdx); }
832 {
return FluidSystem::thermalConductivity(fluidState_, phaseIdx); }
838 {
return fluidState_.fugacity(compIdx); }
844 {
return fluidState_.averageMolarMass(phaseIdx); }
862 {
return fluidState_.viscosity(phaseIdx); }
871 {
return relativePermeability_[phaseIdx]; }
877 {
return solidState_.porosity(); }
883 {
return permeability_; }
894 phasePresentIneq(fluidState(), phaseIdx) -
895 phaseNotPresentIneq(fluidState(), phaseIdx)
904 typename FluidSystem::ParameterCache paramCache;
905 paramCache.updatePhase(fluidState_, phaseIdx);
906 return FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, phaseIdx, compIIdx, compJIdx);
913 {
return effectiveDiffCoeff_(phaseIdx, compIIdx, compJIdx); }
922 Scalar aEval = phaseNotPresentIneq(fluidState(), phaseIdx);
923 Scalar bEval = phasePresentIneq(fluidState(), phaseIdx);
925 return phasePresentIneq(fluidState(), phaseIdx);
926 return phaseNotPresentIneq(fluidState(), phaseIdx);
937 const unsigned int phaseIdx)
const
938 {
return fluidState.saturation(phaseIdx); }
948 const unsigned int phaseIdx)
const
952 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
953 a -= fluidState.moleFraction(phaseIdx, compIdx);
960 std::array<std::array<Scalar, numFluidComps>, numFluidPhases()>
xEquil_;
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...
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
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
Exception thrown if a fixable numerical problem occurs.
Definition: exceptions.hh:39
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:69
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:97
Computes the composition of all phases of a N-phase, N-component fluid system assuming that all N pha...
Definition: misciblemultiphasecomposition.hh:59
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:422
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:329
Scalar averageMolarMass(const int phaseIdx) const
Returns the average molar mass the of the phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:363
FluidState fluidState_
Mass fractions of each component within each phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:483
Scalar saturation(int phaseIdx) const
Returns the saturation of a given phase within the control volume in .
Definition: porousmediumflow/mpnc/volumevariables.hh:265
Scalar pressure(const int phaseIdx) const
Returns the effective pressure of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:311
const FluidState & fluidState() const
Returns the fluid configuration at the given primary variables.
Definition: porousmediumflow/mpnc/volumevariables.hh:250
Scalar fluidThermalConductivity(const int phaseIdx) const
Returns the thermal conductivity of a fluid phase in the sub-control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:351
Scalar porosity() const
Returns the average porosity within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:396
Scalar mobility(const unsigned int phaseIdx) const
Returns the effective mobility of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:372
const SolidState & solidState() const
Returns the phase state for the control-volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:256
Scalar relativePermeability(const unsigned int phaseIdx) const
Returns the relative permeability of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:390
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:275
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:294
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:332
const PermeabilityType & permeability() const
Returns the permeability within the control volume in .
Definition: porousmediumflow/mpnc/volumevariables.hh:402
Scalar fugacity(const int compIdx) const
Returns the fugacity the of the component.
Definition: porousmediumflow/mpnc/volumevariables.hh:357
Scalar enthalpy(const int phaseIdx) const
Return enthalpy the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:338
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the effective diffusion coefficients for a phase in .
Definition: porousmediumflow/mpnc/volumevariables.hh:432
SolidState solidState_
Definition: porousmediumflow/mpnc/volumevariables.hh:484
Scalar density(const int phaseIdx) const
Returns the density the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:319
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:285
std::array< Scalar, ModelTraits::numFluidPhases()> relativePermeability_
Effective relative permeability within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:479
typename Traits::FluidState FluidState
Export the fluid state type.
Definition: porousmediumflow/mpnc/volumevariables.hh:81
DiffusionCoefficients effectiveDiffCoeff_
Definition: porousmediumflow/mpnc/volumevariables.hh:487
Scalar molarDensity(const int phaseIdx) const
Returns the molar density the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:302
Scalar phaseNcp(const unsigned int phaseIdx) const
Returns the value of the NCP-function for a phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:440
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:456
Scalar viscosity(const unsigned int phaseIdx) const
Returns the viscosity of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:381
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:150
PermeabilityType permeability_
Definition: porousmediumflow/mpnc/volumevariables.hh:480
Scalar internalEnergy(const int phaseIdx) const
Returns the internal energy the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:344
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:467
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:478
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:411
Scalar fugacity(const int compIdx) const
Returns the fugacity the of the component.
Definition: porousmediumflow/mpnc/volumevariables.hh:837
PermeabilityType permeability_
Definition: porousmediumflow/mpnc/volumevariables.hh:959
Scalar fluidThermalConductivity(const int phaseIdx) const
Returns the thermal conductivity of a fluid phase in the sub-control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:831
Scalar temperature() const
Returns the temperature inside the sub-control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:812
Scalar mobility(const unsigned int phaseIdx) const
Returns the effective mobility of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:852
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:666
Scalar pressure(const int phaseIdx) const
Returns the effective pressure of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:794
const SolidState & solidState() const
Returns the phase state for the control-volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:739
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:936
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition: porousmediumflow/mpnc/volumevariables.hh:522
Scalar porosity() const
Returns the average porosity within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:876
typename Traits::SolidState SolidState
Export type of solid state.
Definition: porousmediumflow/mpnc/volumevariables.hh:520
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:947
typename Traits::FluidState FluidState
Export the fluid state type.
Definition: porousmediumflow/mpnc/volumevariables.hh:518
Scalar enthalpy(const int phaseIdx) const
Returns the enthalpy the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:818
Scalar density(const int phaseIdx) const
Returns the density the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:802
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the effective diffusion coefficients for a phase in .
Definition: porousmediumflow/mpnc/volumevariables.hh:912
SolidState solidState_
Definition: porousmediumflow/mpnc/volumevariables.hh:964
typename Traits::FluidSystem FluidSystem
Export the underlying fluid system.
Definition: porousmediumflow/mpnc/volumevariables.hh:516
Scalar diffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition: porousmediumflow/mpnc/volumevariables.hh:902
const PermeabilityType & permeability() const
Returns the permeability within the control volume in .
Definition: porousmediumflow/mpnc/volumevariables.hh:882
Scalar molarDensity(const int phaseIdx) const
Returns the molar density the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:785
Scalar viscosity(const unsigned int phaseIdx) const
Returns the viscosity of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:861
Scalar internalEnergy(const int phaseIdx) const
Returns the internal energy the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:824
std::array< std::array< Scalar, numFluidComps >, numFluidPhases()> xEquil_
Definition: porousmediumflow/mpnc/volumevariables.hh:960
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:768
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:540
static constexpr int numFluidPhases()
Return number of phases considered by the model.
Definition: porousmediumflow/mpnc/volumevariables.hh:525
Scalar saturation(int phaseIdx) const
Returns the saturation of a given phase within the control volume in .
Definition: porousmediumflow/mpnc/volumevariables.hh:748
FluidState fluidState_
Mass fractions of each component within each phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:963
Scalar phaseNcp(const unsigned int phaseIdx) const
Returns the value of the NCP-function for a phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:920
Scalar averageMolarMass(const int phaseIdx) const
Returns the average molar mass the of the phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:843
std::array< Scalar, ModelTraits::numFluidPhases()> relativePermeability_
Effective relative permeability within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:958
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:586
DiffusionCoefficients effectiveDiffCoeff_
Definition: porousmediumflow/mpnc/volumevariables.hh:967
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:891
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:758
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:724
Scalar relativePermeability(const unsigned int phaseIdx) const
Returns the relative permeability of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:870
const FluidState & fluidState() const
Returns the fluid configuration at the given primary variables.
Definition: porousmediumflow/mpnc/volumevariables.hh:733
Scalar molarity(const int phaseIdx, int compIdx) const
Returns the concentration of a component in the phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:777
Definition: porousmediumflow/nonisothermal/volumevariables.hh:76
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:42
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.