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;
57 using Indices =
typename Traits::ModelTraits::Indices;
60 static constexpr int numFluidPhases() {
return Traits::ModelTraits::numFluidPhases(); }
73 template<
class ElementSolution,
class Problem,
class Element,
class SubControlVolume>
74 void update(
const ElementSolution &elemSol,
75 const Problem &problem,
76 const Element &element,
77 const SubControlVolume& scv)
79 priVars_ = elemSol[scv.localDofIndex()];
80 extrusionFactor_ = problem.extrusionFactor(element, scv, elemSol);
93 {
return extrusionFactor_; }
101 {
return priVars_[pvIdx]; }
104 template<
class ElementSolution,
class Problem,
class Element,
class SubControlVolume>
106 const Problem& problem,
107 const Element &element,
108 const SubControlVolume &scv)
110 return problem.temperatureAtPos(scv.dofPosition());
115 template<
class Flu
idState,
class ParameterCache>
116 static Scalar
enthalpy(
const FluidState& fluidState,
117 const ParameterCache& paramCache)
123 const Impl &
asImp_()
const {
return *
static_cast<const Impl*
>(
this); }
124 Impl &
asImp_() {
return *
static_cast<Impl*
>(
this); }
133template <
class Traits,
class Impl>
138 using Scalar =
typename Traits::PrimaryVariables::value_type;
146 using Indices =
typename Traits::ModelTraits::Indices;
158 template<
class ElemSol,
class Problem,
class Element,
class Scv>
160 const Problem &problem,
161 const Element &element,
164 ParentType::update(elemSol, problem, element, scv);
172 {
return ParentType::asImp_().fluidState().internalEnergy(0); }
179 {
return ParentType::asImp_().fluidState().enthalpy(0); }
185 {
return FluidSystem::componentEnthalpy(ParentType::asImp_().fluidState(), 0, compIdx); }
192 {
return FluidSystem::thermalConductivity(ParentType::asImp_().fluidState(), 0); }
200 return thermalConductivity();
208 {
return FluidSystem::heatCapacity(ParentType::asImp_().fluidState(), 0); }
211 template<
class ElemSol,
class Problem,
class Element,
class Scv>
213 const Problem& problem,
214 const Element &element,
217 return elemSol[scv.localDofIndex()][Indices::temperatureIdx];
222 template<
class Flu
idState,
class ParameterCache>
223 static Scalar
enthalpy(
const FluidState& fluidState,
224 const ParameterCache& paramCache)
226 return FluidSystem::enthalpy(fluidState, paramCache, 0);
Represents all relevant thermodynamic quantities of a multi-phase fluid system assuming immiscibility...
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:116
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:123
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:105
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:74
Impl & asImp_()
Definition: freeflow/volumevariables.hh:124
Scalar extrusionFactor_
Definition: freeflow/volumevariables.hh:126
Scalar priVar(const int pvIdx) const
Return a component of primary variable vector.
Definition: freeflow/volumevariables.hh:100
Scalar extrusionFactor() const
Return how much the sub-control volume is extruded.
Definition: freeflow/volumevariables.hh:92
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:125
Scalar heatCapacity() const
Return the specific isobaric heat capacity in the sub-control volume.
Definition: freeflow/volumevariables.hh:207
static Scalar enthalpy(const FluidState &fluidState, const ParameterCache ¶mCache)
Definition: freeflow/volumevariables.hh:223
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:159
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:212
Scalar thermalConductivity() const
Returns the thermal conductivity of the fluid phase in the sub-control volume.
Definition: freeflow/volumevariables.hh:191
Scalar internalEnergy(int phaseIdx=0) const
Returns the total internal energy of a phase in the sub-control volume.
Definition: freeflow/volumevariables.hh:171
Scalar enthalpy(int phaseIdx=0) const
Returns the total enthalpy of a phase in the sub-control volume.
Definition: freeflow/volumevariables.hh:178
Scalar componentEnthalpy(unsigned int compIdx) const
Returns the component enthalpy in the sub-control volume.
Definition: freeflow/volumevariables.hh:184
typename Traits::FluidSystem FluidSystem
export the underlying fluid system
Definition: freeflow/volumevariables.hh:144
Scalar effectiveThermalConductivity() const
Returns the effective thermal conductivity of the fluid-flow in the sub-control volume.
Definition: freeflow/volumevariables.hh:198