25#ifndef DUMUX_3P_VOLUME_VARIABLES_HH
26#define DUMUX_3P_VOLUME_VARIABLES_HH
41template <
class Traits>
49 using Scalar =
typename Traits::PrimaryVariables::value_type;
50 using PermeabilityType =
typename Traits::PermeabilityType;
51 using Indices =
typename Traits::ModelTraits::Indices;
52 using FS =
typename Traits::FluidSystem;
56 wPhaseIdx = FS::wPhaseIdx,
57 gPhaseIdx = FS::gPhaseIdx,
58 nPhaseIdx = FS::nPhaseIdx,
60 swIdx = Indices::swIdx,
61 snIdx = Indices::snIdx,
62 pressureIdx = Indices::pressureIdx
84 template<
class ElemSol,
class Problem,
class Element,
class Scv>
86 const Problem &problem,
87 const Element &element,
93 using MaterialLaw =
typename Problem::SpatialParams::MaterialLaw;
94 const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
101 mobility_[phaseIdx] = MaterialLaw::kr(materialParams, phaseIdx,
111 EnergyVolVars::updateSolidEnergyParams(elemSol, problem, element, scv,
solidState_);
112 permeability_ = problem.spatialParams().permeability(element, scv, elemSol);
113 EnergyVolVars::updateEffectiveThermalConductivity();
130 template<
class ElemSol,
class Problem,
class Element,
class Scv>
132 const Problem& problem,
133 const Element& element,
140 const auto& materialParams = problem.spatialParams().materialLawParams(element, scv, elemSol);
141 const auto&
priVars = elemSol[scv.localDofIndex()];
143 const Scalar sw =
priVars[swIdx];
144 const Scalar sn =
priVars[snIdx];
145 const Scalar sg = 1.0 - sw - sn;
154 const Scalar pg =
priVars[pressureIdx];
157 using MaterialLaw =
typename Problem::SpatialParams::MaterialLaw;
158 const Scalar pcgw = MaterialLaw::pcgw(materialParams, sw);
159 const Scalar pcnw = MaterialLaw::pcnw(materialParams, sw);
160 const Scalar pcgn = MaterialLaw::pcgn(materialParams, sw + sn);
162 const Scalar pcAlpha = MaterialLaw::pcAlpha(materialParams, sn);
163 const Scalar pcNW1 = 0.0;
165 const Scalar pn = pg- pcAlpha * pcgn - (1.0 - pcAlpha)*(pcgw - pcNW1);
166 const Scalar pw = pn - pcAlpha * pcnw - (1.0 - pcAlpha)*pcNW1;
172 typename FluidSystem::ParameterCache paramCache;
186 const Scalar h = EnergyVolVars::enthalpy(
fluidState, paramCache, phaseIdx);
248 return mobility_[phaseIdx];
267 {
return permeability_; }
275 PermeabilityType permeability_;
Some templates to wrap the valgrind macros.
Represents all relevant thermodynamic quantities of a multi-phase fluid system assuming immiscibility...
Update the solid volume fractions (inert and reacitve) and set them in the solidstate.
A central place for various physical constants occuring in some equations.
void updateSolidVolumeFractions(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, SolidState &solidState, const int solidVolFracOffset)
update the solid volume fractions (inert and reacitve) and set them in the solidstate
Definition: updatesolidvolumefractions.hh:36
bool CheckDefined(const T &value)
Make valgrind complain if the object occupied by an object is undefined.
Definition: valgrind.hh:72
std::string viscosity(int phaseIdx) noexcept
I/O name of viscosity for multiphase systems.
Definition: name.hh:74
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
Contains the quantities which are constant within a finite volume in the three-phase model.
Definition: porousmediumflow/3p/volumevariables.hh:45
const SolidState & solidState() const
Returns the phase state for the control volume.
Definition: porousmediumflow/3p/volumevariables.hh:200
const PermeabilityType & permeability() const
Returns the permeability within the control volume in .
Definition: porousmediumflow/3p/volumevariables.hh:266
Scalar saturation(const int phaseIdx) const
Returns the effective saturation of a given phase within the control volume.
Definition: porousmediumflow/3p/volumevariables.hh:209
void completeFluidState(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, FluidState &fluidState, SolidState &solidState)
Sets complete fluid state.
Definition: porousmediumflow/3p/volumevariables.hh:131
typename Traits::SolidSystem SolidSystem
Export type of solid system.
Definition: porousmediumflow/3p/volumevariables.hh:73
SolidState solidState_
Definition: porousmediumflow/3p/volumevariables.hh:271
typename Traits::FluidState FluidState
Export fluid state type.
Definition: porousmediumflow/3p/volumevariables.hh:67
Scalar porosity() const
Returns the average porosity within the control volume.
Definition: porousmediumflow/3p/volumevariables.hh:260
Scalar mobility(const int phaseIdx) const
Returns the effective mobility of a given phase within the control volume.
Definition: porousmediumflow/3p/volumevariables.hh:246
typename Traits::FluidSystem FluidSystem
Export fluid system type.
Definition: porousmediumflow/3p/volumevariables.hh:69
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition: porousmediumflow/3p/volumevariables.hh:85
const FluidState & fluidState() const
Returns the phase state for the control-volume.
Definition: porousmediumflow/3p/volumevariables.hh:194
FluidState fluidState_
Definition: porousmediumflow/3p/volumevariables.hh:270
Scalar temperature() const
Returns temperature inside the sub-control volume.
Definition: porousmediumflow/3p/volumevariables.hh:237
Scalar density(const int phaseIdx) const
Returns the mass density of a given phase within the control volume.
Definition: porousmediumflow/3p/volumevariables.hh:218
typename Traits::SolidState SolidState
Export type of solid state.
Definition: porousmediumflow/3p/volumevariables.hh:71
Scalar capillaryPressure() const
Returns the effective capillary pressure within the control volume.
Definition: porousmediumflow/3p/volumevariables.hh:254
Scalar pressure(const int phaseIdx) const
Returns the effective pressure of a given phase within the control volume.
Definition: porousmediumflow/3p/volumevariables.hh:227
Definition: porousmediumflow/nonisothermal/volumevariables.hh:75
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:40
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition: porousmediumflow/volumevariables.hh:52
const PrimaryVariables & priVars() const
Returns the vector of primary variables.
Definition: porousmediumflow/volumevariables.hh:76
static constexpr int numFluidPhases()
Return number of phases considered by the model.
Definition: porousmediumflow/volumevariables.hh:50
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:64
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.