26#ifndef DUMUX_MPNC_VOLUME_VARIABLES_HH
27#define DUMUX_MPNC_VOLUME_VARIABLES_HH
42template <
class Traits,
bool enableChemicalNonEquilibrium>
50template <
class Traits>
53template <
class Traits>
61 using Scalar =
typename Traits::PrimaryVariables::value_type;
62 using PermeabilityType =
typename Traits::PermeabilityType;
64 using ModelTraits =
typename Traits::ModelTraits;
65 static constexpr auto pressureFormulation = ModelTraits::pressureFormulation();
67 static constexpr bool enableThermalNonEquilibrium = ModelTraits::enableThermalNonEquilibrium();
68 static constexpr bool enableChemicalNonEquilibrium = ModelTraits::enableChemicalNonEquilibrium();
69 static constexpr bool enableDiffusion = ModelTraits::enableMolecularDiffusion();
71 using ComponentVector = Dune::FieldVector<Scalar, ModelTraits::numFluidComponents()>;
73 using EffDiffModel =
typename Traits::EffectiveDiffusivityModel;
74 using DiffusionCoefficients =
typename Traits::DiffusionType::DiffusionCoefficientsContainer;
77 static constexpr auto numPhases = std::integral_constant<int, ModelTraits::numFluidPhases()>{};
81 using Indices =
typename Traits::ModelTraits::Indices;
92 static constexpr int numFluidPhases() {
return ModelTraits::numFluidPhases(); }
94 static constexpr int numFluidComps = ParentType::numFluidComponents();
105 template<
class ElemSol,
class Problem,
class Element,
class Scv>
107 const Problem& problem,
108 const Element& element,
111 ParentType::update(elemSol, problem, element, scv);
113 completeFluidState(elemSol, problem, element, scv, fluidState_, solidState_);
120 const auto fluidMatrixInteraction = Deprecated::makeMPPcKrSw(Scalar{}, problem.spatialParams(), element, scv, elemSol, numPhases);
123 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
125 const auto relPerm = fluidMatrixInteraction.relativePermeabilities(fluidState_, wPhaseIdx);
126 std::copy(relPerm.begin(), relPerm.end(), relativePermeability_.begin());
128 typename FluidSystem::ParameterCache paramCache;
129 paramCache.updateAll(fluidState_);
134 if constexpr (enableDiffusion)
136 auto getEffectiveDiffusionCoefficient = [&](
int phaseIdx,
int compIIdx,
int compJIdx)
137 {
return EffDiffModel::effectiveDiffusionCoefficient(*
this, phaseIdx, compIIdx, compJIdx); };
139 effectiveDiffCoeff_.update(getEffectiveDiffusionCoefficient);
142 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv, solidState_);
143 permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
144 EnergyVolVars::updateEffectiveThermalConductivity();
159 template<
class ElemSol,
class Problem,
class Element,
class Scv>
161 const Problem& problem,
162 const Element& element,
171 EnergyVolVars::updateTemperature(elemSol, problem, element, scv, fluidState, solidState);
176 auto&& priVars = elemSol[scv.localDofIndex()];
178 for (
int phaseIdx = 0; phaseIdx < numFluidPhases() - 1; ++phaseIdx) {
179 sumSat += priVars[Indices::s0Idx + phaseIdx];
180 fluidState.setSaturation(phaseIdx, priVars[Indices::s0Idx + phaseIdx]);
182 fluidState.setSaturation(numFluidPhases() - 1, 1.0 - sumSat);
188 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
189 fluidState.setWettingPhase(wPhaseIdx);
197 const auto fluidMatrixInteraction = Deprecated::makeMPPcKrSw(Scalar{}, problem.spatialParams(), element, scv, elemSol, numPhases);
198 const auto capPress = fluidMatrixInteraction.capillaryPressures(fluidState, wPhaseIdx);
205 const Scalar pw = priVars[Indices::p0Idx];
206 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx)
207 fluidState.setPressure(phaseIdx, pw - capPress[0] + capPress[phaseIdx]);
212 const Scalar pn = priVars[Indices::p0Idx];
213 for (
int phaseIdx = numFluidPhases()-1; phaseIdx >= 0; --phaseIdx)
214 fluidState.setPressure(phaseIdx, pn - capPress[numFluidPhases()-1] + capPress[phaseIdx]);
217 DUNE_THROW(Dune::InvalidStateException,
"MPNCVolumeVariables do not support the chosen pressure formulation");
222 typename FluidSystem::ParameterCache paramCache;
223 paramCache.updateAll(fluidState);
227 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
228 fug[compIdx] = priVars[Indices::fug0Idx + compIdx];
231 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) {
233 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx) {
234 Scalar x_ij = 1.0/numFluidComps;
237 fluidState.setMoleFraction(phaseIdx,
248 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) {
251 fluidState.setViscosity(phaseIdx, mu);
254 Scalar h = FluidSystem::enthalpy(fluidState, paramCache, phaseIdx);
255 fluidState.setEnthalpy(phaseIdx, h);
264 {
return fluidState_; }
270 {
return solidState_; }
279 {
return fluidState_.saturation(phaseIdx); }
289 {
return fluidState_.massFraction(phaseIdx, compIdx); }
299 {
return fluidState_.moleFraction(phaseIdx, compIdx); }
307 Scalar
molarity(
const int phaseIdx,
int compIdx)
const
308 {
return fluidState_.molarity(phaseIdx, compIdx); }
316 {
return fluidState_.molarDensity(phaseIdx);}
325 {
return fluidState_.pressure(phaseIdx); }
333 {
return fluidState_.density(phaseIdx); }
343 {
return fluidState_.temperature(0); }
346 {
return fluidState_.temperature(phaseIdx); }
352 {
return fluidState_.enthalpy(phaseIdx); }
358 {
return fluidState_.internalEnergy(phaseIdx); }
365 {
return FluidSystem::thermalConductivity(fluidState_, phaseIdx); }
371 {
return fluidState_.fugacity(compIdx); }
377 {
return fluidState_.averageMolarMass(phaseIdx); }
395 {
return fluidState_.viscosity(phaseIdx); }
404 {
return relativePermeability_[phaseIdx]; }
410 {
return solidState_.porosity(); }
416 {
return permeability_; }
427 phasePresentIneq(fluidState(), phaseIdx) -
428 phaseNotPresentIneq(fluidState(), phaseIdx)
437 typename FluidSystem::ParameterCache paramCache;
438 paramCache.updatePhase(fluidState_, phaseIdx);
439 return FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, phaseIdx, compIIdx, compJIdx);
446 {
return effectiveDiffCoeff_(phaseIdx, compIIdx, compJIdx); }
455 Scalar aEval = phaseNotPresentIneq(fluidState(), phaseIdx);
456 Scalar bEval = phasePresentIneq(fluidState(), phaseIdx);
458 return phasePresentIneq(fluidState(), phaseIdx);
459 return phaseNotPresentIneq(fluidState(), phaseIdx);
470 const unsigned int phaseIdx)
const
471 {
return fluidState.saturation(phaseIdx); }
481 const unsigned int phaseIdx)
const
485 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
486 a -= fluidState.moleFraction(phaseIdx, compIdx);
503template <
class Traits>
510 using Scalar =
typename Traits::PrimaryVariables::value_type;
511 using PermeabilityType =
typename Traits::PermeabilityType;
513 using ModelTraits =
typename Traits::ModelTraits;
514 static constexpr auto pressureFormulation = ModelTraits::pressureFormulation();
516 static constexpr bool enableThermalNonEquilibrium = ModelTraits::enableThermalNonEquilibrium();
517 static constexpr bool enableChemicalNonEquilibrium = ModelTraits::enableChemicalNonEquilibrium();
518 static constexpr bool enableDiffusion = ModelTraits::enableMolecularDiffusion();
520 using Indices =
typename ModelTraits::Indices;
521 using ComponentVector = Dune::FieldVector<Scalar, ModelTraits::numFluidComponents()>;
523 using ParameterCache =
typename Traits::FluidSystem::ParameterCache;
524 using EffDiffModel =
typename Traits::EffectiveDiffusivityModel;
525 using DiffusionCoefficients =
typename Traits::DiffusionType::DiffusionCoefficientsContainer;
528 static constexpr auto numPhases = std::integral_constant<int, ModelTraits::numFluidPhases()>{};
543 static constexpr int numFluidComps = ParentType::numFluidComponents();
555 template<
class ElemSol,
class Problem,
class Element,
class Scv>
557 const Problem& problem,
558 const Element& element,
561 ParentType::update(elemSol, problem, element, scv);
563 completeFluidState(elemSol, problem, element, scv, fluidState_, solidState_);
566 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
571 const auto fluidMatrixInteraction = Deprecated::makeMPPcKrSw(Scalar{}, problem.spatialParams(), element, scv, elemSol, numPhases);
573 const auto relPerm = fluidMatrixInteraction.relativePermeabilities(fluidState_, wPhaseIdx);
574 std::copy(relPerm.begin(), relPerm.end(), relativePermeability_.begin());
576 typename FluidSystem::ParameterCache paramCache;
577 paramCache.updateAll(fluidState_);
581 if constexpr (enableDiffusion)
583 auto getEffectiveDiffusionCoefficient = [&](
int phaseIdx,
int compIIdx,
int compJIdx)
584 {
return EffDiffModel::effectiveDiffusionCoefficient(*
this, phaseIdx, compIIdx, compJIdx); };
586 effectiveDiffCoeff_.update(getEffectiveDiffusionCoefficient);
589 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv, solidState_);
590 permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
591 EnergyVolVars::updateEffectiveThermalConductivity();
605 template<
class ElemSol,
class Problem,
class Element,
class Scv>
607 const Problem& problem,
608 const Element& element,
616 EnergyVolVars::updateTemperature(elemSol, problem, element, scv, fluidState, solidState);
620 auto&& priVars = elemSol[scv.localDofIndex()];
622 for (
int phaseIdx = 0; phaseIdx < numFluidPhases() - 1; ++phaseIdx) {
623 sumSat += priVars[Indices::s0Idx + phaseIdx];
624 fluidState.setSaturation(phaseIdx, priVars[Indices::s0Idx + phaseIdx]);
626 fluidState.setSaturation(numFluidPhases() - 1, 1.0 - sumSat);
632 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
633 fluidState.setWettingPhase(wPhaseIdx);
641 const auto fluidMatrixInteraction = Deprecated::makeMPPcKrSw(Scalar{}, problem.spatialParams(), element, scv, elemSol, numPhases);
642 const auto capPress = fluidMatrixInteraction.capillaryPressures(fluidState, wPhaseIdx);
649 const Scalar pw = priVars[Indices::p0Idx];
650 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx)
651 fluidState.setPressure(phaseIdx, pw - capPress[0] + capPress[phaseIdx]);
656 const Scalar pn = priVars[Indices::p0Idx];
657 for (
int phaseIdx = numFluidPhases()-1; phaseIdx >= 0; --phaseIdx)
658 fluidState.setPressure(phaseIdx, pn - capPress[numFluidPhases()-1] + capPress[phaseIdx]);
661 DUNE_THROW(Dune::InvalidStateException,
"MPNCVolumeVariables do not support the chosen pressure formulation");
667 typename FluidSystem::ParameterCache paramCache;
668 paramCache.updateAll(fluidState);
672 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
673 fug[compIdx] = priVars[Indices::fug0Idx + compIdx];
675 updateMoleFraction(fluidState,
681 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) {
684 fluidState.setViscosity(phaseIdx, mu);
687 Scalar h = FluidSystem::enthalpy(fluidState, paramCache, phaseIdx);
688 fluidState.setEnthalpy(phaseIdx, h);
701 ParameterCache & paramCache,
702 const typename Traits::PrimaryVariables& priVars)
705 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx)
708 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx) {
709 actualFluidState.setMoleFraction(phaseIdx,
711 priVars[Indices::moleFrac00Idx +
712 phaseIdx*numFluidComps +
720 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx)
721 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx) {
722 const Scalar phi = FluidSystem::fugacityCoefficient(actualFluidState,
726 actualFluidState.setFugacityCoefficient(phaseIdx,
732 equilFluidState.assign(actualFluidState) ;
733 ConstraintSolver::solve(equilFluidState,
737 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx){
738 for (
int compIdx=0; compIdx< numFluidComps; ++ compIdx){
739 xEquil_[phaseIdx][compIdx] = equilFluidState.moleFraction(phaseIdx, compIdx);
744 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx){
746 actualFluidState.setDensity(phaseIdx, rho);
748 actualFluidState.setMolarDensity(phaseIdx, rhoMolar);
760 const Scalar
xEquil(
const unsigned int phaseIdx,
const unsigned int compIdx)
const
762 return xEquil_[phaseIdx][compIdx] ;
770 {
return fluidState_; }
776 {
return solidState_; }
785 {
return fluidState_.saturation(phaseIdx); }
795 {
return fluidState_.massFraction(phaseIdx, compIdx); }
805 {
return fluidState_.moleFraction(phaseIdx, compIdx); }
813 Scalar
molarity(
const int phaseIdx,
int compIdx)
const
814 {
return fluidState_.molarity(phaseIdx, compIdx); }
822 {
return fluidState_.molarDensity(phaseIdx);}
831 {
return fluidState_.pressure(phaseIdx); }
839 {
return fluidState_.density(phaseIdx); }
849 {
return fluidState_.temperature(0); }
855 {
return fluidState_.enthalpy(phaseIdx); }
861 {
return fluidState_.internalEnergy(phaseIdx); }
868 {
return FluidSystem::thermalConductivity(fluidState_, phaseIdx); }
874 {
return fluidState_.fugacity(compIdx); }
880 {
return fluidState_.averageMolarMass(phaseIdx); }
898 {
return fluidState_.viscosity(phaseIdx); }
907 {
return relativePermeability_[phaseIdx]; }
913 {
return solidState_.porosity(); }
919 {
return permeability_; }
930 phasePresentIneq(fluidState(), phaseIdx) -
931 phaseNotPresentIneq(fluidState(), phaseIdx)
940 typename FluidSystem::ParameterCache paramCache;
941 paramCache.updatePhase(fluidState_, phaseIdx);
942 return FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, phaseIdx, compIIdx, compJIdx);
949 {
return effectiveDiffCoeff_(phaseIdx, compIIdx, compJIdx); }
958 Scalar aEval = phaseNotPresentIneq(fluidState(), phaseIdx);
959 Scalar bEval = phasePresentIneq(fluidState(), phaseIdx);
961 return phasePresentIneq(fluidState(), phaseIdx);
962 return phaseNotPresentIneq(fluidState(), phaseIdx);
973 const unsigned int phaseIdx)
const
974 {
return fluidState.saturation(phaseIdx); }
984 const unsigned int phaseIdx)
const
988 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
989 a -= fluidState.moleFraction(phaseIdx, compIdx);
996 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
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:43
Scalar diffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition: porousmediumflow/mpnc/volumevariables.hh:435
typename Traits::SolidState SolidState
Export type of solid state.
Definition: porousmediumflow/mpnc/volumevariables.hh:87
Scalar temperature() const
Returns the temperature inside the sub-control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:342
Scalar averageMolarMass(const int phaseIdx) const
Returns the average molar mass the of the phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:376
FluidState fluidState_
Mass fractions of each component within each phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:496
Scalar saturation(int phaseIdx) const
Returns the saturation of a given phase within the control volume in .
Definition: porousmediumflow/mpnc/volumevariables.hh:278
Scalar pressure(const int phaseIdx) const
Returns the effective pressure of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:324
const FluidState & fluidState() const
Returns the fluid configuration at the given primary variables.
Definition: porousmediumflow/mpnc/volumevariables.hh:263
Scalar fluidThermalConductivity(const int phaseIdx) const
Returns the thermal conductivity of a fluid phase in the sub-control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:364
Scalar porosity() const
Returns the average porosity within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:409
Scalar mobility(const unsigned int phaseIdx) const
Returns the effective mobility of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:385
const SolidState & solidState() const
Returns the phase state for the control-volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:269
Scalar relativePermeability(const unsigned int phaseIdx) const
Returns the relative permeability of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:403
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:288
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:106
Scalar molarity(const int phaseIdx, int compIdx) const
Returns the concentration of a component in the phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:307
typename Traits::ModelTraits::Indices Indices
Export the type encapsulating primary variable indices.
Definition: porousmediumflow/mpnc/volumevariables.hh:81
Scalar temperature(const int phaseIdx) const
Definition: porousmediumflow/mpnc/volumevariables.hh:345
const PermeabilityType & permeability() const
Returns the permeability within the control volume in .
Definition: porousmediumflow/mpnc/volumevariables.hh:415
Scalar fugacity(const int compIdx) const
Returns the fugacity the of the component.
Definition: porousmediumflow/mpnc/volumevariables.hh:370
Scalar enthalpy(const int phaseIdx) const
Return enthalpy the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:351
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the effective diffusion coefficients for a phase in .
Definition: porousmediumflow/mpnc/volumevariables.hh:445
SolidState solidState_
Definition: porousmediumflow/mpnc/volumevariables.hh:497
Scalar density(const int phaseIdx) const
Returns the density the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:332
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:298
std::array< Scalar, ModelTraits::numFluidPhases()> relativePermeability_
Effective relative permeability within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:492
typename Traits::FluidState FluidState
Export the fluid state type.
Definition: porousmediumflow/mpnc/volumevariables.hh:85
DiffusionCoefficients effectiveDiffCoeff_
Definition: porousmediumflow/mpnc/volumevariables.hh:500
Scalar molarDensity(const int phaseIdx) const
Returns the molar density the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:315
Scalar phaseNcp(const unsigned int phaseIdx) const
Returns the value of the NCP-function for a phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:453
static constexpr int numFluidPhases()
Return number of phases considered by the model.
Definition: porousmediumflow/mpnc/volumevariables.hh:92
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:469
Scalar viscosity(const unsigned int phaseIdx) const
Returns the viscosity of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:394
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:160
PermeabilityType permeability_
Definition: porousmediumflow/mpnc/volumevariables.hh:493
Scalar internalEnergy(const int phaseIdx) const
Returns the internal energy the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:357
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition: porousmediumflow/mpnc/volumevariables.hh:89
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:480
typename Traits::FluidSystem FluidSystem
Export the underlying fluid system.
Definition: porousmediumflow/mpnc/volumevariables.hh:83
Scalar porosity_
Effective porosity within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:491
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:424
Scalar fugacity(const int compIdx) const
Returns the fugacity the of the component.
Definition: porousmediumflow/mpnc/volumevariables.hh:873
PermeabilityType permeability_
Definition: porousmediumflow/mpnc/volumevariables.hh:995
Scalar fluidThermalConductivity(const int phaseIdx) const
Returns the thermal conductivity of a fluid phase in the sub-control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:867
Scalar temperature() const
Returns the temperature inside the sub-control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:848
Scalar mobility(const unsigned int phaseIdx) const
Returns the effective mobility of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:888
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:700
Scalar pressure(const int phaseIdx) const
Returns the effective pressure of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:830
const SolidState & solidState() const
Returns the phase state for the control-volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:775
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:972
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition: porousmediumflow/mpnc/volumevariables.hh:538
Scalar porosity() const
Returns the average porosity within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:912
typename Traits::SolidState SolidState
Export type of solid state.
Definition: porousmediumflow/mpnc/volumevariables.hh:536
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:983
typename Traits::FluidState FluidState
Export the fluid state type.
Definition: porousmediumflow/mpnc/volumevariables.hh:534
Scalar enthalpy(const int phaseIdx) const
Returns the enthalpy the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:854
Scalar density(const int phaseIdx) const
Returns the density the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:838
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the effective diffusion coefficients for a phase in .
Definition: porousmediumflow/mpnc/volumevariables.hh:948
SolidState solidState_
Definition: porousmediumflow/mpnc/volumevariables.hh:1000
typename Traits::FluidSystem FluidSystem
Export the underlying fluid system.
Definition: porousmediumflow/mpnc/volumevariables.hh:532
Scalar diffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition: porousmediumflow/mpnc/volumevariables.hh:938
const PermeabilityType & permeability() const
Returns the permeability within the control volume in .
Definition: porousmediumflow/mpnc/volumevariables.hh:918
Scalar molarDensity(const int phaseIdx) const
Returns the molar density the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:821
Scalar viscosity(const unsigned int phaseIdx) const
Returns the viscosity of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:897
Scalar internalEnergy(const int phaseIdx) const
Returns the internal energy the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:860
std::array< std::array< Scalar, numFluidComps >, numFluidPhases()> xEquil_
Definition: porousmediumflow/mpnc/volumevariables.hh:996
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:804
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:556
static constexpr int numFluidPhases()
Return number of phases considered by the model.
Definition: porousmediumflow/mpnc/volumevariables.hh:541
Scalar saturation(int phaseIdx) const
Returns the saturation of a given phase within the control volume in .
Definition: porousmediumflow/mpnc/volumevariables.hh:784
FluidState fluidState_
Mass fractions of each component within each phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:999
Scalar phaseNcp(const unsigned int phaseIdx) const
Returns the value of the NCP-function for a phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:956
Scalar averageMolarMass(const int phaseIdx) const
Returns the average molar mass the of the phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:879
std::array< Scalar, ModelTraits::numFluidPhases()> relativePermeability_
Effective relative permeability within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:994
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:606
DiffusionCoefficients effectiveDiffCoeff_
Definition: porousmediumflow/mpnc/volumevariables.hh:1003
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:927
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:794
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:760
Scalar relativePermeability(const unsigned int phaseIdx) const
Returns the relative permeability of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:906
const FluidState & fluidState() const
Returns the fluid configuration at the given primary variables.
Definition: porousmediumflow/mpnc/volumevariables.hh:769
Scalar molarity(const int phaseIdx, int compIdx) const
Returns the concentration of a component in the phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:813
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.