13#ifndef DUMUX_FREEFLOW_VOLUME_VARIABLES_HH
14#define DUMUX_FREEFLOW_VOLUME_VARIABLES_HH
21template <
class Traits,
class Impl,
bool enableEnergyBalance>
29template <
class Traits,
class Impl>
36template <
class Traits,
class Impl>
39 using Scalar =
typename Traits::PrimaryVariables::value_type;
45 using Indices =
typename Traits::ModelTraits::Indices;
48 static constexpr int numFluidPhases() {
return Traits::ModelTraits::numFluidPhases(); }
61 template<
class ElementSolution,
class Problem,
class Element,
class SubControlVolume>
62 void update(
const ElementSolution &elemSol,
63 const Problem &problem,
64 const Element &element,
65 const SubControlVolume& scv)
67 priVars_ = elemSol[scv.localDofIndex()];
68 extrusionFactor_ = problem.spatialParams().extrusionFactor(element, scv, elemSol);
81 {
return extrusionFactor_; }
89 {
return priVars_[pvIdx]; }
92 template<
class ElementSolution,
class Problem,
class Element,
class SubControlVolume>
94 const Problem& problem,
95 const Element &element,
96 const SubControlVolume &scv)
98 return problem.spatialParams().temperature(element, scv, elemSol);
103 template<
class Flu
idState,
class ParameterCache>
104 static Scalar
enthalpy(
const FluidState& fluidState,
105 const ParameterCache& paramCache)
111 const Impl &
asImp_()
const {
return *
static_cast<const Impl*
>(
this); }
112 Impl &
asImp_() {
return *
static_cast<Impl*
>(
this); }
121template <
class Traits,
class Impl>
126 using Scalar =
typename Traits::PrimaryVariables::value_type;
134 using Indices =
typename Traits::ModelTraits::Indices;
146 template<
class ElemSol,
class Problem,
class Element,
class Scv>
148 const Problem &problem,
149 const Element &element,
152 ParentType::update(elemSol, problem, element, scv);
160 {
return ParentType::asImp_().fluidState().internalEnergy(0); }
167 {
return ParentType::asImp_().fluidState().enthalpy(0); }
173 {
return FluidSystem::componentEnthalpy(ParentType::asImp_().fluidState(), 0, compIdx); }
180 {
return FluidSystem::thermalConductivity(ParentType::asImp_().fluidState(), 0); }
188 return thermalConductivity();
196 {
return FluidSystem::heatCapacity(ParentType::asImp_().fluidState(), 0); }
199 template<
class ElemSol,
class Problem,
class Element,
class Scv>
201 const Problem& problem,
202 const Element &element,
205 return elemSol[scv.localDofIndex()][Indices::temperatureIdx];
210 template<
class Flu
idState,
class ParameterCache>
211 static Scalar
enthalpy(
const FluidState& fluidState,
212 const ParameterCache& paramCache)
214 return FluidSystem::enthalpy(fluidState, paramCache, 0);
Volume variables for isothermal free-flow models.
Definition: freeflow/volumevariables.hh:38
static Scalar enthalpy(const FluidState &fluidState, const ParameterCache ¶mCache)
Definition: freeflow/volumevariables.hh:104
static constexpr int numFluidComponents()
return number of components considered by the model
Definition: freeflow/volumevariables.hh:50
const Impl & asImp_() const
Definition: freeflow/volumevariables.hh:111
static Scalar temperature(const ElementSolution &elemSol, const Problem &problem, const Element &element, const SubControlVolume &scv)
The temperature is obtained from the problem as a constant for isothermal models.
Definition: freeflow/volumevariables.hh:93
void update(const ElementSolution &elemSol, const Problem &problem, const Element &element, const SubControlVolume &scv)
Update all quantities for a given control volume.
Definition: freeflow/volumevariables.hh:62
Impl & asImp_()
Definition: freeflow/volumevariables.hh:112
Scalar extrusionFactor_
Definition: freeflow/volumevariables.hh:114
Scalar priVar(const int pvIdx) const
Return a component of primary variable vector.
Definition: freeflow/volumevariables.hh:88
Scalar extrusionFactor() const
Return how much the sub-control volume is extruded.
Definition: freeflow/volumevariables.hh:80
typename Traits::ModelTraits::Indices Indices
export the type encapsulating primary variable indices
Definition: freeflow/volumevariables.hh:45
static constexpr int numFluidPhases()
return number of phases considered by the model
Definition: freeflow/volumevariables.hh:48
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition: freeflow/volumevariables.hh:43
PrimaryVariables priVars_
Definition: freeflow/volumevariables.hh:113
Scalar heatCapacity() const
Return the specific isobaric heat capacity in the sub-control volume.
Definition: freeflow/volumevariables.hh:195
static Scalar enthalpy(const FluidState &fluidState, const ParameterCache ¶mCache)
Definition: freeflow/volumevariables.hh:211
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Update all quantities for a given control volume.
Definition: freeflow/volumevariables.hh:147
static Scalar temperature(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
The temperature is a primary variable for non-isothermal models.
Definition: freeflow/volumevariables.hh:200
Scalar thermalConductivity() const
Returns the thermal conductivity of the fluid phase in the sub-control volume.
Definition: freeflow/volumevariables.hh:179
Scalar internalEnergy(int phaseIdx=0) const
Returns the total internal energy of a phase in the sub-control volume.
Definition: freeflow/volumevariables.hh:159
Scalar enthalpy(int phaseIdx=0) const
Returns the total enthalpy of a phase in the sub-control volume.
Definition: freeflow/volumevariables.hh:166
Scalar componentEnthalpy(unsigned int compIdx) const
Returns the component enthalpy in the sub-control volume.
Definition: freeflow/volumevariables.hh:172
typename Traits::FluidSystem FluidSystem
export the underlying fluid system
Definition: freeflow/volumevariables.hh:132
Scalar effectiveThermalConductivity() const
Returns the effective thermal conductivity of the fluid-flow in the sub-control volume.
Definition: freeflow/volumevariables.hh:186
Definition: freeflow/volumevariables.hh:22
Represents all relevant thermodynamic quantities of a multi-phase fluid system assuming immiscibility...