12#ifndef DUMUX_NAVIERSTOKES_MASS_ONEP_VARIABLES_HH
13#define DUMUX_NAVIERSTOKES_MASS_ONEP_VARIABLES_HH
15#include <dumux/common/concepts/ipdata_.hh>
26template <
class Traits>
29 using Scalar =
typename Traits::PrimaryVariables::value_type;
31 static_assert(!Traits::ModelTraits::enableEnergyBalance(),
32 "The energy balance is currently not implemented for variables defined per local dof");
38 using Indices =
typename Traits::ModelTraits::Indices;
45 static constexpr int numFluidPhases() {
return Traits::ModelTraits::numFluidPhases(); }
58 template<
class ElementSolution,
class Problem,
class ElementDiscretization, Concept::LocalDofIpData IpData>
59 void update(
const ElementSolution& elemSol,
60 const Problem& problem,
61 const ElementDiscretization& elemDisc,
64 priVars_ = elemSol[ipData.localDofIndex()];
65 extrusionFactor_ = problem.spatialParams().extrusionFactor(elemDisc, ipData, elemSol);
80 template<
class ElementSolution,
class Problem,
class ElementDiscretization, Concept::LocalDofIpData IpData>
82 const Problem& problem,
83 const ElementDiscretization& elemDisc,
87 fluidState.setTemperature(0, problem.spatialParams().temperature(elemDisc, ipData, elemSol));
88 fluidState.setPressure(0, elemSol[ipData.localDofIndex()][Indices::pressureIdx]);
94 typename FluidSystem::ParameterCache paramCache;
97 Scalar value = FluidSystem::density(
fluidState, paramCache, 0);
100 value = FluidSystem::viscosity(
fluidState, paramCache, 0);
111 {
return extrusionFactor_; }
118 {
return fluidState_.pressure(phaseIdx); }
130 {
return fluidState_.density(phaseIdx); }
136 {
return fluidState_.molarDensity(phaseIdx); }
142 {
return fluidState_.viscosity(phaseIdx); }
148 {
return fluidState_.temperature(); }
154 {
return fluidState_; }
161 {
return priVars_[pvIdx]; }
170 PrimaryVariables priVars_;
172 Scalar extrusionFactor_;
Variables for the single-phase Navier-Stokes mass model.
Definition freeflow/navierstokes/mass/1p/variables.hh:28
Scalar viscosity(int phaseIdx=0) const
Returns the dynamic viscosity of the fluid.
Definition freeflow/navierstokes/mass/1p/variables.hh:141
typename Traits::ModelTraits::Indices Indices
export the indices type
Definition freeflow/navierstokes/mass/1p/variables.hh:38
typename Traits::FluidSystem FluidSystem
Export the underlying fluid system.
Definition freeflow/navierstokes/mass/1p/variables.hh:40
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition freeflow/navierstokes/mass/1p/variables.hh:47
Scalar extrusionFactor() const
Return how much the localDof is extruded.
Definition freeflow/navierstokes/mass/1p/variables.hh:110
Scalar temperature() const
Returns the temperature inside the control volume.
Definition freeflow/navierstokes/mass/1p/variables.hh:147
static constexpr int numFluidPhases()
Return number of phases considered by the model.
Definition freeflow/navierstokes/mass/1p/variables.hh:45
void update(const ElementSolution &elemSol, const Problem &problem, const ElementDiscretization &elemDisc, const IpData &ipData)
Update all quantities for a local dof.
Definition freeflow/navierstokes/mass/1p/variables.hh:59
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition freeflow/navierstokes/mass/1p/variables.hh:36
typename Traits::FluidState FluidState
Export the fluid state type.
Definition freeflow/navierstokes/mass/1p/variables.hh:42
Scalar molarDensity(int phaseIdx=0) const
Returns the molar density of a given phase.
Definition freeflow/navierstokes/mass/1p/variables.hh:135
const FluidState & fluidState() const
Returns the fluid state of the control volume.
Definition freeflow/navierstokes/mass/1p/variables.hh:153
Scalar priVar(const int pvIdx) const
Return a component of the primary variable vector.
Definition freeflow/navierstokes/mass/1p/variables.hh:160
void completeFluidState(const ElementSolution &elemSol, const Problem &problem, const ElementDiscretization &elemDisc, const IpData &ipData, FluidState &fluidState) const
Sets the complete fluid state.
Definition freeflow/navierstokes/mass/1p/variables.hh:81
Scalar saturation(int phaseIdx=0) const
Returns the saturation.
Definition freeflow/navierstokes/mass/1p/variables.hh:123
Scalar pressure(int phaseIdx=0) const
Returns the effective pressure of a given phase within the control volume.
Definition freeflow/navierstokes/mass/1p/variables.hh:117
Scalar density(int phaseIdx=0) const
Returns the mass density of a given phase.
Definition freeflow/navierstokes/mass/1p/variables.hh:129
const PrimaryVariables & priVars() const
Return the primary variable vector.
Definition freeflow/navierstokes/mass/1p/variables.hh:166