25#ifndef DUMUX_FREEFLOW_VOLUME_VARIABLES_HH
26#define DUMUX_FREEFLOW_VOLUME_VARIABLES_HH
33template <
class Traits,
class Impl,
bool enableEnergyBalance>
41template <
class Traits,
class Impl>
48template <
class Traits,
class Impl>
51 using Scalar =
typename Traits::PrimaryVariables::value_type;
60 static constexpr int numFluidPhases() {
return Traits::ModelTraits::numFluidPhases(); }
74 template<
class ElementSolution,
class Problem,
class Element,
class SubControlVolume>
75 void update(
const ElementSolution &elemSol,
76 const Problem &problem,
77 const Element &element,
78 const SubControlVolume& scv)
80 priVars_ = elemSol[scv.localDofIndex()];
81 extrusionFactor_ = problem.extrusionFactor(element, scv, elemSol);
94 {
return extrusionFactor_; }
102 {
return priVars_[pvIdx]; }
105 template<
class ElementSolution,
class Problem,
class Element,
class SubControlVolume>
107 const Problem& problem,
108 const Element &element,
109 const SubControlVolume &scv)
111 return problem.temperatureAtPos(scv.dofPosition());
116 template<
class Flu
idState,
class ParameterCache>
117 static Scalar
enthalpy(
const FluidState& fluidState,
118 const ParameterCache& paramCache)
124 const Impl &
asImp_()
const {
return *
static_cast<const Impl*
>(
this); }
125 Impl &
asImp_() {
return *
static_cast<Impl*
>(
this); }
134template <
class Traits,
class Impl>
139 using Scalar =
typename Traits::PrimaryVariables::value_type;
159 template<
class ElemSol,
class Problem,
class Element,
class Scv>
161 const Problem &problem,
162 const Element &element,
165 ParentType::update(elemSol, problem, element, scv);
173 {
return ParentType::asImp_().fluidState().internalEnergy(0); }
180 {
return ParentType::asImp_().fluidState().enthalpy(0); }
186 {
return FluidSystem::componentEnthalpy(ParentType::asImp_().fluidState(), 0, compIdx); }
193 {
return FluidSystem::thermalConductivity(ParentType::asImp_().fluidState(), 0); }
201 return thermalConductivity();
209 {
return FluidSystem::heatCapacity(ParentType::asImp_().fluidState(), 0); }
212 template<
class ElemSol,
class Problem,
class Element,
class Scv>
214 const Problem& problem,
215 const Element &element,
218 return elemSol[scv.localDofIndex()][Indices::temperatureIdx];
223 template<
class Flu
idState,
class ParameterCache>
224 static Scalar
enthalpy(
const FluidState& fluidState,
225 const ParameterCache& paramCache)
227 return FluidSystem::enthalpy(fluidState, paramCache, 0);
Represents all relevant thermodynamic quantities of a multi-phase fluid system assuming immiscibility...
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Property tag Indices
Definition: porousmediumflow/sequential/properties.hh:59
Definition: freeflow/volumevariables.hh:34
Volume variables for isothermal free-flow models.
Definition: freeflow/volumevariables.hh:50
static Scalar enthalpy(const FluidState &fluidState, const ParameterCache ¶mCache)
Definition: freeflow/volumevariables.hh:117
static constexpr int numFluidComponents()
return number of components considered by the model
Definition: freeflow/volumevariables.hh:62
const Impl & asImp_() const
Definition: freeflow/volumevariables.hh:124
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:106
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:75
Impl & asImp_()
Definition: freeflow/volumevariables.hh:125
Scalar extrusionFactor_
Definition: freeflow/volumevariables.hh:127
Scalar priVar(const int pvIdx) const
Return a component of primary variable vector.
Definition: freeflow/volumevariables.hh:101
Scalar extrusionFactor() const
Return how much the sub-control volume is extruded.
Definition: freeflow/volumevariables.hh:93
typename Traits::ModelTraits::Indices Indices
export the type encapsulating primary variable indices
Definition: freeflow/volumevariables.hh:57
static constexpr int numFluidPhases()
return number of phases considered by the model
Definition: freeflow/volumevariables.hh:60
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition: freeflow/volumevariables.hh:55
PrimaryVariables priVars_
Definition: freeflow/volumevariables.hh:126
Scalar heatCapacity() const
Return the specific isobaric heat capacity in the sub-control volume.
Definition: freeflow/volumevariables.hh:208
static Scalar enthalpy(const FluidState &fluidState, const ParameterCache ¶mCache)
Definition: freeflow/volumevariables.hh:224
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:160
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:213
Scalar thermalConductivity() const
Returns the thermal conductivity of the fluid phase in the sub-control volume.
Definition: freeflow/volumevariables.hh:192
Scalar internalEnergy(int phaseIdx=0) const
Returns the total internal energy of a phase in the sub-control volume.
Definition: freeflow/volumevariables.hh:172
Scalar enthalpy(int phaseIdx=0) const
Returns the total enthalpy of a phase in the sub-control volume.
Definition: freeflow/volumevariables.hh:179
Scalar componentEnthalpy(unsigned int compIdx) const
Returns the component enthalpy in the sub-control volume.
Definition: freeflow/volumevariables.hh:185
typename Traits::FluidSystem FluidSystem
export the underlying fluid system
Definition: freeflow/volumevariables.hh:145
Scalar effectiveThermalConductivity() const
Returns the effective thermal conductivity of the fluid-flow in the sub-control volume.
Definition: freeflow/volumevariables.hh:199