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();
71 using ComponentVector = Dune::FieldVector<Scalar, ModelTraits::numFluidComponents()>;
85 static constexpr int numFluidPhases() {
return ModelTraits::numFluidPhases(); }
87 static constexpr int numFluidComps = ParentType::numFluidComponents();
98 template<
class ElemSol,
class Problem,
class Element,
class Scv>
100 const Problem& problem,
101 const Element& element,
104 ParentType::update(elemSol, problem, element, scv);
106 completeFluidState(elemSol, problem, element, scv, fluidState_, solidState_);
109 const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
110 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
112 using MaterialLaw =
typename Problem::SpatialParams::MaterialLaw;
114 MPAdapter::relativePermeabilities(relativePermeability_, materialParams, fluidState_, wPhaseIdx);
116 typename FluidSystem::ParameterCache paramCache;
117 paramCache.updateAll(fluidState_);
121 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx)
123 int compIIdx = phaseIdx;
124 for (
unsigned int compJIdx = 0; compJIdx < numFluidComps; ++compJIdx)
127 if(compIIdx!= compJIdx)
129 setDiffusionCoefficient_(phaseIdx, compJIdx,
130 FluidSystem::binaryDiffusionCoefficient(fluidState_,
141 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv, solidState_);
142 permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
157 template<
class ElemSol,
class Problem,
class Element,
class Scv>
159 const Problem& problem,
160 const Element& element,
169 EnergyVolVars::updateTemperature(elemSol, problem, element, scv, fluidState, solidState);
174 auto&& priVars = elemSol[scv.localDofIndex()];
176 for (
int phaseIdx = 0; phaseIdx < numFluidPhases() - 1; ++phaseIdx) {
177 sumSat += priVars[Indices::s0Idx + phaseIdx];
178 fluidState.setSaturation(phaseIdx, priVars[Indices::s0Idx + phaseIdx]);
181 fluidState.setSaturation(numFluidPhases() - 1, 1.0 - sumSat);
187 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
188 fluidState.setWettingPhase(wPhaseIdx);
189 const auto& materialParams =
190 problem.spatialParams().materialLawParams(element, scv, elemSol);
192 std::vector<Scalar> capPress(numFluidPhases());
193 using MaterialLaw =
typename Problem::SpatialParams::MaterialLaw;
195 MPAdapter::capillaryPressures(capPress, materialParams, fluidState, wPhaseIdx);
202 const Scalar pw = priVars[Indices::p0Idx];
203 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx)
204 fluidState.setPressure(phaseIdx, pw - capPress[0] + capPress[phaseIdx]);
209 const Scalar pn = priVars[Indices::p0Idx];
210 for (
int phaseIdx = numFluidPhases()-1; phaseIdx >= 0; --phaseIdx)
211 fluidState.setPressure(phaseIdx, pn - capPress[numFluidPhases()-1] + capPress[phaseIdx]);
214 DUNE_THROW(Dune::InvalidStateException,
"MPNCVolumeVariables do not support the chosen pressure formulation");
219 typename FluidSystem::ParameterCache paramCache;
220 paramCache.updateAll(fluidState);
224 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
225 fug[compIdx] = priVars[Indices::fug0Idx + compIdx];
228 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) {
230 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx) {
231 Scalar x_ij = 1.0/numFluidComps;
234 fluidState.setMoleFraction(phaseIdx,
245 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) {
248 fluidState.setViscosity(phaseIdx, mu);
251 Scalar h = FluidSystem::enthalpy(fluidState, paramCache, phaseIdx);
252 fluidState.setEnthalpy(phaseIdx, h);
261 {
return fluidState_; }
267 {
return solidState_; }
276 {
return fluidState_.saturation(phaseIdx); }
286 {
return fluidState_.massFraction(phaseIdx, compIdx); }
296 {
return fluidState_.moleFraction(phaseIdx, compIdx); }
304 Scalar
molarity(
const int phaseIdx,
int compIdx)
const
305 {
return fluidState_.molarity(phaseIdx, compIdx); }
313 {
return fluidState_.molarDensity(phaseIdx);}
322 {
return fluidState_.pressure(phaseIdx); }
330 {
return fluidState_.density(phaseIdx); }
340 {
return fluidState_.temperature(0); }
343 {
return fluidState_.temperature(phaseIdx); }
349 {
return fluidState_.enthalpy(phaseIdx); }
355 {
return fluidState_.internalEnergy(phaseIdx); }
362 {
return FluidSystem::thermalConductivity(fluidState_, phaseIdx); }
368 {
return fluidState_.fugacity(compIdx); }
374 {
return fluidState_.averageMolarMass(phaseIdx); }
392 {
return fluidState_.viscosity(phaseIdx); }
401 {
return relativePermeability_[phaseIdx]; }
407 {
return solidState_.porosity(); }
413 {
return permeability_; }
424 phasePresentIneq(fluidState(), phaseIdx) -
425 phaseNotPresentIneq(fluidState(), phaseIdx)
434 if (compIdx < phaseIdx)
435 return diffCoefficient_[phaseIdx][compIdx];
436 else if (compIdx > phaseIdx)
437 return diffCoefficient_[phaseIdx][compIdx-1];
439 DUNE_THROW(Dune::InvalidStateException,
"Diffusion coeffiecient called for phaseIdx = compIdx");
449 Scalar aEval = phaseNotPresentIneq(fluidState(), phaseIdx);
450 Scalar bEval = phasePresentIneq(fluidState(), phaseIdx);
452 return phasePresentIneq(fluidState(), phaseIdx);
453 return phaseNotPresentIneq(fluidState(), phaseIdx);
464 const unsigned int phaseIdx)
const
465 {
return fluidState.saturation(phaseIdx); }
475 const unsigned int phaseIdx)
const
479 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
480 a -= fluidState.moleFraction(phaseIdx, compIdx);
488 if (compIdx < phaseIdx)
489 diffCoefficient_[phaseIdx][compIdx] = std::move(d);
490 else if (compIdx > phaseIdx)
491 diffCoefficient_[phaseIdx][compIdx-1] = std::move(d);
493 DUNE_THROW(Dune::InvalidStateException,
"Diffusion coeffiecient for phaseIdx = compIdx doesn't exist");
507template <
class Traits>
514 using Scalar =
typename Traits::PrimaryVariables::value_type;
515 using PermeabilityType =
typename Traits::PermeabilityType;
517 using ModelTraits =
typename Traits::ModelTraits;
518 static constexpr auto pressureFormulation = ModelTraits::pressureFormulation();
520 static constexpr bool enableThermalNonEquilibrium = ModelTraits::enableThermalNonEquilibrium();
521 static constexpr bool enableChemicalNonEquilibrium = ModelTraits::enableChemicalNonEquilibrium();
522 static constexpr bool enableDiffusion = ModelTraits::enableMolecularDiffusion();
525 using ComponentVector = Dune::FieldVector<Scalar, ModelTraits::numFluidComponents()>;
528 using ParameterCache =
typename Traits::FluidSystem::ParameterCache;
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_);
576 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx)
578 int compIIdx = phaseIdx;
579 for (
unsigned int compJIdx = 0; compJIdx < numFluidComps; ++compJIdx)
582 if(compIIdx!= compJIdx)
584 setDiffusionCoefficient_(phaseIdx, compJIdx,
585 FluidSystem::binaryDiffusionCoefficient(fluidState_,
596 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv, solidState_);
597 permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
612 template<
class ElemSol,
class Problem,
class Element,
class Scv>
614 const Problem& problem,
615 const Element& element,
623 EnergyVolVars::updateTemperature(elemSol, problem, element, scv, fluidState, solidState);
627 auto&& priVars = elemSol[scv.localDofIndex()];
629 for (
int phaseIdx = 0; phaseIdx < numFluidPhases() - 1; ++phaseIdx) {
630 sumSat += priVars[Indices::s0Idx + phaseIdx];
631 fluidState.setSaturation(phaseIdx, priVars[Indices::s0Idx + phaseIdx]);
634 fluidState.setSaturation(numFluidPhases() - 1, 1.0 - sumSat);
640 const auto& materialParams =
641 problem.spatialParams().materialLawParams(element, scv, elemSol);
642 const int wPhaseIdx = problem.spatialParams().template wettingPhase<FluidSystem>(element, scv, elemSol);
643 fluidState.setWettingPhase(wPhaseIdx);
645 std::vector<Scalar> capPress(numFluidPhases());
646 using MaterialLaw =
typename Problem::SpatialParams::MaterialLaw;
648 MPAdapter::capillaryPressures(capPress, materialParams, fluidState, wPhaseIdx);
655 const Scalar pw = priVars[Indices::p0Idx];
656 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx)
657 fluidState.setPressure(phaseIdx, pw - capPress[0] + capPress[phaseIdx]);
662 const Scalar pn = priVars[Indices::p0Idx];
663 for (
int phaseIdx = numFluidPhases()-1; phaseIdx >= 0; --phaseIdx)
664 fluidState.setPressure(phaseIdx, pn - capPress[numFluidPhases()-1] + capPress[phaseIdx]);
667 DUNE_THROW(Dune::InvalidStateException,
"MPNCVolumeVariables do not support the chosen pressure formulation");
673 typename FluidSystem::ParameterCache paramCache;
674 paramCache.updateAll(fluidState);
678 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
679 fug[compIdx] = priVars[Indices::fug0Idx + compIdx];
681 updateMoleFraction(fluidState,
687 for (
int phaseIdx = 0; phaseIdx < numFluidPhases(); ++phaseIdx) {
690 fluidState.setViscosity(phaseIdx, mu);
693 Scalar h = FluidSystem::enthalpy(fluidState, paramCache, phaseIdx);
694 fluidState.setEnthalpy(phaseIdx, h);
707 ParameterCache & paramCache,
708 const typename Traits::PrimaryVariables& priVars)
711 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx)
714 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx) {
715 actualFluidState.setMoleFraction(phaseIdx,
717 priVars[Indices::moleFrac00Idx +
718 phaseIdx*numFluidComps +
725 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx)
726 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx) {
727 const Scalar phi = FluidSystem::fugacityCoefficient(actualFluidState,
731 actualFluidState.setFugacityCoefficient(phaseIdx,
737 equilFluidState.assign(actualFluidState) ;
738 ConstraintSolver::solve(equilFluidState,
742 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx){
743 for (
int compIdx=0; compIdx< numFluidComps; ++ compIdx){
744 xEquil_[phaseIdx][compIdx] = equilFluidState.moleFraction(phaseIdx, compIdx);
749 for(
int phaseIdx=0; phaseIdx<numFluidPhases(); ++phaseIdx){
751 actualFluidState.setDensity(phaseIdx, rho);
753 actualFluidState.setMolarDensity(phaseIdx, rhoMolar);
765 const Scalar
xEquil(
const unsigned int phaseIdx,
const unsigned int compIdx)
const
767 return xEquil_[phaseIdx][compIdx] ;
775 {
return fluidState_; }
781 {
return solidState_; }
790 {
return fluidState_.saturation(phaseIdx); }
800 {
return fluidState_.massFraction(phaseIdx, compIdx); }
810 {
return fluidState_.moleFraction(phaseIdx, compIdx); }
818 Scalar
molarity(
const int phaseIdx,
int compIdx)
const
819 {
return fluidState_.molarity(phaseIdx, compIdx); }
827 {
return fluidState_.molarDensity(phaseIdx);}
836 {
return fluidState_.pressure(phaseIdx); }
844 {
return fluidState_.density(phaseIdx); }
854 {
return fluidState_.temperature(0); }
860 {
return fluidState_.enthalpy(phaseIdx); }
866 {
return fluidState_.internalEnergy(phaseIdx); }
873 {
return FluidSystem::thermalConductivity(fluidState_, phaseIdx); }
879 {
return fluidState_.fugacity(compIdx); }
885 {
return fluidState_.averageMolarMass(phaseIdx); }
903 {
return fluidState_.viscosity(phaseIdx); }
912 {
return relativePermeability_[phaseIdx]; }
918 {
return solidState_.porosity(); }
924 {
return permeability_; }
935 phasePresentIneq(fluidState(), phaseIdx) -
936 phaseNotPresentIneq(fluidState(), phaseIdx)
945 if (compIdx < phaseIdx)
946 return diffCoefficient_[phaseIdx][compIdx];
947 else if (compIdx > phaseIdx)
948 return diffCoefficient_[phaseIdx][compIdx-1];
950 DUNE_THROW(Dune::InvalidStateException,
"Diffusion coeffiecient called for phaseIdx = compIdx");
960 Scalar aEval = phaseNotPresentIneq(fluidState(), phaseIdx);
961 Scalar bEval = phasePresentIneq(fluidState(), phaseIdx);
963 return phasePresentIneq(fluidState(), phaseIdx);
964 return phaseNotPresentIneq(fluidState(), phaseIdx);
975 const unsigned int phaseIdx)
const
976 {
return fluidState.saturation(phaseIdx); }
986 const unsigned int phaseIdx)
const
990 for (
int compIdx = 0; compIdx < numFluidComps; ++compIdx)
991 a -= fluidState.moleFraction(phaseIdx, compIdx);
999 if (compIdx < phaseIdx)
1000 diffCoefficient_[phaseIdx][compIdx] = std::move(d);
1001 else if (compIdx > phaseIdx)
1002 diffCoefficient_[phaseIdx][compIdx-1] = std::move(d);
1004 DUNE_THROW(Dune::InvalidStateException,
"Diffusion coeffiecient for phaseIdx = compIdx doesn't exist");
1010 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...
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
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Property tag Indices
Definition: porousmediumflow/sequential/properties.hh:59
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
typename Traits::SolidState SolidState
Export type of solid state.
Definition: porousmediumflow/mpnc/volumevariables.hh:80
Scalar temperature() const
Returns the temperature inside the sub-control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:339
Scalar averageMolarMass(const int phaseIdx) const
Returns the average molar mass the of the phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:373
FluidState fluidState_
Mass fractions of each component within each phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:502
Scalar saturation(int phaseIdx) const
Returns the saturation of a given phase within the control volume in .
Definition: porousmediumflow/mpnc/volumevariables.hh:275
Scalar pressure(const int phaseIdx) const
Returns the effective pressure of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:321
const FluidState & fluidState() const
Returns the fluid configuration at the given primary variables.
Definition: porousmediumflow/mpnc/volumevariables.hh:260
Scalar fluidThermalConductivity(const int phaseIdx) const
Returns the thermal conductivity of a fluid phase in the sub-control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:361
Scalar porosity() const
Returns the average porosity within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:406
Scalar mobility(const unsigned int phaseIdx) const
Returns the effective mobility of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:382
const SolidState & solidState() const
Returns the phase state for the control-volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:266
Scalar relativePermeability(const unsigned int phaseIdx) const
Returns the relative permeability of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:400
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:285
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:99
Scalar molarity(const int phaseIdx, int compIdx) const
Returns the concentration of a component in the phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:304
Scalar temperature(const int phaseIdx) const
Definition: porousmediumflow/mpnc/volumevariables.hh:342
const PermeabilityType & permeability() const
Returns the permeability within the control volume in .
Definition: porousmediumflow/mpnc/volumevariables.hh:412
Scalar fugacity(const int compIdx) const
Returns the fugacity the of the component.
Definition: porousmediumflow/mpnc/volumevariables.hh:367
Scalar enthalpy(const int phaseIdx) const
Return enthalpy the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:348
SolidState solidState_
Definition: porousmediumflow/mpnc/volumevariables.hh:503
Scalar density(const int phaseIdx) const
Returns the density the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:329
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:295
std::array< Scalar, ModelTraits::numFluidPhases()> relativePermeability_
Effective relative permeability within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:498
typename Traits::FluidState FluidState
Export the fluid state type.
Definition: porousmediumflow/mpnc/volumevariables.hh:78
Scalar molarDensity(const int phaseIdx) const
Returns the molar density the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:312
Scalar phaseNcp(const unsigned int phaseIdx) const
Returns the value of the NCP-function for a phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:447
static constexpr int numFluidPhases()
Return number of phases considered by the model.
Definition: porousmediumflow/mpnc/volumevariables.hh:85
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:463
Scalar viscosity(const unsigned int phaseIdx) const
Returns the viscosity of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:391
void setDiffusionCoefficient_(int phaseIdx, int compIdx, Scalar d)
Definition: porousmediumflow/mpnc/volumevariables.hh:486
std::array< std::array< Scalar, numFluidComps-1 >, numFluidPhases()> diffCoefficient_
Definition: porousmediumflow/mpnc/volumevariables.hh:496
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:158
PermeabilityType permeability_
Definition: porousmediumflow/mpnc/volumevariables.hh:499
Scalar internalEnergy(const int phaseIdx) const
Returns the internal energy the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:354
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition: porousmediumflow/mpnc/volumevariables.hh:82
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:474
typename Traits::FluidSystem FluidSystem
Export the underlying fluid system.
Definition: porousmediumflow/mpnc/volumevariables.hh:76
Scalar porosity_
Effective porosity within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:497
Scalar diffusionCoefficient(int phaseIdx, int compIdx) const
Returns the diffusion coefficient.
Definition: porousmediumflow/mpnc/volumevariables.hh:432
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:421
Scalar fugacity(const int compIdx) const
Returns the fugacity the of the component.
Definition: porousmediumflow/mpnc/volumevariables.hh:878
void setDiffusionCoefficient_(int phaseIdx, int compIdx, Scalar d)
Definition: porousmediumflow/mpnc/volumevariables.hh:997
PermeabilityType permeability_
Definition: porousmediumflow/mpnc/volumevariables.hh:1009
Scalar fluidThermalConductivity(const int phaseIdx) const
Returns the thermal conductivity of a fluid phase in the sub-control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:872
Scalar temperature() const
Returns the temperature inside the sub-control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:853
Scalar mobility(const unsigned int phaseIdx) const
Returns the effective mobility of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:893
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:706
Scalar pressure(const int phaseIdx) const
Returns the effective pressure of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:835
const SolidState & solidState() const
Returns the phase state for the control-volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:780
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:974
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:917
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:985
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:859
Scalar density(const int phaseIdx) const
Returns the density the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:843
SolidState solidState_
Definition: porousmediumflow/mpnc/volumevariables.hh:1014
typename Traits::FluidSystem FluidSystem
Export the underlying fluid system.
Definition: porousmediumflow/mpnc/volumevariables.hh:531
const PermeabilityType & permeability() const
Returns the permeability within the control volume in .
Definition: porousmediumflow/mpnc/volumevariables.hh:923
Scalar molarDensity(const int phaseIdx) const
Returns the molar density the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:826
Scalar viscosity(const unsigned int phaseIdx) const
Returns the viscosity of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:902
Scalar internalEnergy(const int phaseIdx) const
Returns the internal energy the of the fluid phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:865
std::array< std::array< Scalar, numFluidComps >, numFluidPhases()> xEquil_
Definition: porousmediumflow/mpnc/volumevariables.hh:1010
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:809
std::array< std::array< Scalar, numFluidComps-1 >, numFluidPhases()> diffCoefficient_
Definition: porousmediumflow/mpnc/volumevariables.hh:1007
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:789
FluidState fluidState_
Mass fractions of each component within each phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:1013
Scalar phaseNcp(const unsigned int phaseIdx) const
Returns the value of the NCP-function for a phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:958
Scalar averageMolarMass(const int phaseIdx) const
Returns the average molar mass the of the phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:884
Scalar diffusionCoefficient(int phaseIdx, int compIdx) const
Returns the diffusion coefficient.
Definition: porousmediumflow/mpnc/volumevariables.hh:943
std::array< Scalar, ModelTraits::numFluidPhases()> relativePermeability_
Effective relative permeability within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:1008
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:613
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:932
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:799
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:765
Scalar relativePermeability(const unsigned int phaseIdx) const
Returns the relative permeability of a given phase within the control volume.
Definition: porousmediumflow/mpnc/volumevariables.hh:911
const FluidState & fluidState() const
Returns the fluid configuration at the given primary variables.
Definition: porousmediumflow/mpnc/volumevariables.hh:774
Scalar molarity(const int phaseIdx, int compIdx) const
Returns the concentration of a component in the phase.
Definition: porousmediumflow/mpnc/volumevariables.hh:818
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.