14#ifndef DUMUX_2P_VOLUME_VARIABLES_HH
15#define DUMUX_2P_VOLUME_VARIABLES_HH
29template <
class Traits>
36 using PermeabilityType =
typename Traits::PermeabilityType;
37 using ModelTraits =
typename Traits::ModelTraits;
38 using Idx =
typename ModelTraits::Indices;
39 using Scalar =
typename Traits::PrimaryVariables::value_type;
40 using FS =
typename Traits::FluidSystem;
44 pressureIdx = Idx::pressureIdx,
45 saturationIdx = Idx::saturationIdx,
47 phase0Idx = FS::phase0Idx,
48 phase1Idx = FS::phase1Idx
51 static constexpr auto formulation = ModelTraits::priVarFormulation();
59 using Indices =
typename ModelTraits::Indices;
74 template<
class ElemSol,
class Problem,
class Element,
class Scv>
76 const Problem &problem,
77 const Element &element,
84 const auto& spatialParams = problem.spatialParams();
85 const auto fluidMatrixInteraction = spatialParams.fluidMatrixInteraction(element, scv, elemSol);
88 const int nPhaseIdx = 1 - wPhaseIdx;
90 mobility_[wPhaseIdx] =
91 fluidMatrixInteraction.krw(
fluidState_.saturation(wPhaseIdx))
94 mobility_[nPhaseIdx] =
95 fluidMatrixInteraction.krn(
fluidState_.saturation(wPhaseIdx))
100 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv,
solidState_);
101 permeability_ = spatialParams.permeability(element, scv, elemSol);
102 EnergyVolVars::updateEffectiveThermalConductivity();
117 template<
class ElemSol,
class Problem,
class Element,
class Scv>
119 const Problem& problem,
120 const Element& element,
127 const auto& spatialParams = problem.spatialParams();
128 const auto fluidMatrixInteraction = spatialParams.fluidMatrixInteraction(element, scv, elemSol);
130 const auto&
priVars = elemSol[scv.localDofIndex()];
132 const auto wPhaseIdx = spatialParams.template wettingPhase<FluidSystem>(element, scv, elemSol);
141 pc_ = fluidMatrixInteraction.pc(
fluidState.saturation(wPhaseIdx));
146 const auto Sn = Traits::SaturationReconstruction::reconstructSn(spatialParams, element,
147 scv, elemSol,
priVars[saturationIdx]);
150 pc_ = fluidMatrixInteraction.pc(
fluidState.saturation(wPhaseIdx));
157 if (wPhaseIdx == phase1Idx)
159 const auto Sn = Traits::SaturationReconstruction::reconstructSn(spatialParams, element,
160 scv, elemSol,
priVars[saturationIdx]);
163 pc_ = fluidMatrixInteraction.pc(
fluidState.saturation(wPhaseIdx));
170 pc_ = fluidMatrixInteraction.pc(
fluidState.saturation(wPhaseIdx));
175 typename FluidSystem::ParameterCache paramCache;
178 for (
int phaseIdx = 0; phaseIdx < ModelTraits::numFluidPhases(); ++phaseIdx) {
180 Scalar mu = FluidSystem::viscosity(
fluidState, paramCache, phaseIdx);
184 Scalar rho = FluidSystem::density(
fluidState, paramCache, phaseIdx);
188 Scalar h = EnergyVolVars::enthalpy(
fluidState, paramCache, phaseIdx);
266 {
return mobility_[phaseIdx]; }
278 {
return permeability_; }
293 PermeabilityType permeability_;
294 Scalar mobility_[ModelTraits::numFluidPhases()];
Definition porousmediumflow/nonisothermal/volumevariables.hh:63
The isothermal base class.
Definition porousmediumflow/volumevariables.hh:28
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition porousmediumflow/volumevariables.hh:40
const PrimaryVariables & priVars() const
Returns the vector of primary variables.
Definition porousmediumflow/volumevariables.hh:64
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition porousmediumflow/volumevariables.hh:52
Contains the quantities which are are constant within a finite volume in the two-phase model.
Definition porousmediumflow/2p/volumevariables.hh:33
typename ModelTraits::Indices Indices
Export the indices.
Definition porousmediumflow/2p/volumevariables.hh:59
Scalar mobility(int phaseIdx) const
Returns the effective mobility of a given phase within the control volume in .
Definition porousmediumflow/2p/volumevariables.hh:265
Scalar density(int phaseIdx) const
Returns the mass density of a given phase within the control volume in .
Definition porousmediumflow/2p/volumevariables.hh:220
int wettingPhase() const
Returns the wetting phase index.
Definition porousmediumflow/2p/volumevariables.hh:283
typename Traits::FluidSystem FluidSystem
Export type of fluid system.
Definition porousmediumflow/2p/volumevariables.hh:55
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition porousmediumflow/2p/volumevariables.hh:75
Scalar capillaryPressure() const
Returns the capillary pressure within the control volume in .
Definition porousmediumflow/2p/volumevariables.hh:236
Scalar viscosity(int phaseIdx) const
Returns the dynamic viscosity of the fluid within the control volume in .
Definition porousmediumflow/2p/volumevariables.hh:256
void completeFluidState(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, FluidState &fluidState, SolidState &solidState)
Sets complete fluid state.
Definition porousmediumflow/2p/volumevariables.hh:118
FluidState fluidState_
Definition porousmediumflow/2p/volumevariables.hh:287
Scalar porosity() const
Returns the average porosity within the control volume in .
Definition porousmediumflow/2p/volumevariables.hh:271
SolidState solidState_
Definition porousmediumflow/2p/volumevariables.hh:288
typename Traits::SolidState SolidState
Export type of solid state.
Definition porousmediumflow/2p/volumevariables.hh:61
Scalar pressure(int phaseIdx) const
Returns the effective pressure of a given phase within the control volume in .
Definition porousmediumflow/2p/volumevariables.hh:229
const PermeabilityType & permeability() const
Returns the permeability within the control volume in .
Definition porousmediumflow/2p/volumevariables.hh:277
Scalar saturation(int phaseIdx) const
Returns the saturation of a given phase within the control volume in .
Definition porousmediumflow/2p/volumevariables.hh:211
const SolidState & solidState() const
Returns the phase state for the control volume.
Definition porousmediumflow/2p/volumevariables.hh:202
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition porousmediumflow/2p/volumevariables.hh:63
typename Traits::FluidState FluidState
Export type of fluid state.
Definition porousmediumflow/2p/volumevariables.hh:57
const FluidState & fluidState() const
Returns the phase state for the control volume.
Definition porousmediumflow/2p/volumevariables.hh:196
Scalar temperature() const
Returns temperature inside the sub-control volume in .
Definition porousmediumflow/2p/volumevariables.hh:247
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:24
@ p1s0
first phase saturation and second phase pressure as primary variables
@ p0s1
first phase pressure and second phase saturation as primary variables
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.
Update the solid volume fractions (inert and reacitve) and set them in the solidstate.