12#ifndef DUMUX_ONEP_VARIABLES_HH
13#define DUMUX_ONEP_VARIABLES_HH
15#include <dumux/common/concepts/ipdata_.hh>
30 using Scalar =
typename Traits::PrimaryVariables::value_type;
31 using ModelTraits =
typename Traits::ModelTraits;
33 static_assert(!ModelTraits::enableEnergyBalance(),
34 "The energy balance is currently not implemented for variables defined per local dof");
40 using Indices =
typename ModelTraits::Indices;
49 static constexpr int numFluidPhases() {
return ModelTraits::numFluidPhases(); }
61 template<
class ElementSolution,
class Problem,
class ElementDiscretization, Concept::LocalDofIpData IpData>
62 void update(
const ElementSolution& elemSol,
64 const ElementDiscretization& elemDisc,
67 priVars_ = elemSol[ipData.localDofIndex()];
69 const auto& spatialParams = problem.spatialParams();
70 extrusionFactor_ = spatialParams.extrusionFactor(elemDisc, ipData, elemSol);
71 porosity_ = spatialParams.porosity(elemDisc, ipData, elemSol);
72 permeability_ = spatialParams.permeability(elemDisc, ipData, elemSol);
86 template<
class ElementSolution,
class Problem,
class ElementDiscretization, Concept::LocalDofIpData IpData>
89 const ElementDiscretization& elemDisc,
93 fluidState.setTemperature(0, problem.spatialParams().temperature(elemDisc, ipData, elemSol));
94 fluidState.setPressure(0, elemSol[ipData.localDofIndex()][Indices::pressureIdx]);
100 typename FluidSystem::ParameterCache paramCache;
103 Scalar value = FluidSystem::density(
fluidState, paramCache, 0);
106 value = FluidSystem::viscosity(
fluidState, paramCache, 0);
117 {
return extrusionFactor_; }
123 {
return porosity_; }
129 {
return permeability_; }
135 {
return fluidState_.pressure(phaseIdx); }
147 {
return fluidState_.density(phaseIdx); }
153 {
return fluidState_.molarDensity(phaseIdx); }
159 {
return fluidState_.viscosity(phaseIdx); }
165 {
return 1.0/fluidState_.viscosity(phaseIdx); }
171 {
return fluidState_.temperature(); }
177 {
return fluidState_; }
184 {
return priVars_[pvIdx]; }
193 PrimaryVariables priVars_;
196 Scalar extrusionFactor_;
Variables for the single-phase porous medium flow model.
Definition porousmediumflow/1p/variables.hh:29
typename ModelTraits::Indices Indices
export the indices type
Definition porousmediumflow/1p/variables.hh:40
Scalar saturation(int phaseIdx=0) const
Returns the saturation, which is always one for a single phase.
Definition porousmediumflow/1p/variables.hh:140
Scalar density(int phaseIdx=0) const
Returns the mass density of a given phase.
Definition porousmediumflow/1p/variables.hh:146
static constexpr int numFluidComponents()
return number of components considered by the model
Definition porousmediumflow/1p/variables.hh:51
Scalar viscosity(int phaseIdx=0) const
Returns the dynamic viscosity of the fluid.
Definition porousmediumflow/1p/variables.hh:158
const PermeabilityType & permeability() const
Returns the intrinsic permeability .
Definition porousmediumflow/1p/variables.hh:128
typename Traits::FluidState FluidState
export the fluid state type
Definition porousmediumflow/1p/variables.hh:44
typename Traits::FluidSystem FluidSystem
export the underlying fluid system
Definition porousmediumflow/1p/variables.hh:42
Scalar temperature() const
Returns the temperature .
Definition porousmediumflow/1p/variables.hh:170
Scalar pressure(int phaseIdx=0) const
Returns the effective pressure of a given phase.
Definition porousmediumflow/1p/variables.hh:134
const FluidState & fluidState() const
Returns the fluid state.
Definition porousmediumflow/1p/variables.hh:176
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition porousmediumflow/1p/variables.hh:38
const PrimaryVariables & priVars() const
Return the primary variable vector.
Definition porousmediumflow/1p/variables.hh:189
static constexpr int numFluidPhases()
return number of phases considered by the model
Definition porousmediumflow/1p/variables.hh:49
Scalar molarDensity(int phaseIdx=0) const
Returns the molar density of a given phase.
Definition porousmediumflow/1p/variables.hh:152
Scalar porosity() const
Returns the porosity .
Definition porousmediumflow/1p/variables.hh:122
Scalar priVar(const int pvIdx) const
Return a component of the primary variable vector.
Definition porousmediumflow/1p/variables.hh:183
Scalar mobility(int phaseIdx=0) const
Returns the mobility of a given phase.
Definition porousmediumflow/1p/variables.hh:164
void update(const ElementSolution &elemSol, const Problem &problem, const ElementDiscretization &elemDisc, const IpData &ipData)
Update all quantities for a local dof.
Definition porousmediumflow/1p/variables.hh:62
Scalar extrusionFactor() const
Return how much the local dof is extruded.
Definition porousmediumflow/1p/variables.hh:116
void completeFluidState(const ElementSolution &elemSol, const Problem &problem, const ElementDiscretization &elemDisc, const IpData &ipData, FluidState &fluidState) const
Sets the complete fluid state.
Definition porousmediumflow/1p/variables.hh:87
typename Traits::PermeabilityType PermeabilityType
export the type of the intrinsic permeability
Definition porousmediumflow/1p/variables.hh:46
Base class for all standard finite volume or finite element problems.
Definition common/problem.hh:39
Definition assembly/assembler.hh:44