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;
43 using PrimaryVariables =
typename Traits::PrimaryVariables;
45 using Indices =
typename Traits::ModelTraits::Indices;
48 static constexpr int numFluidPhases() {
return Traits::ModelTraits::numFluidPhases(); }
50 static constexpr int numFluidComponents() {
return Traits::ModelTraits::numFluidComponents(); }
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);
80 Scalar extrusionFactor()
const
81 {
return extrusionFactor_; }
88 Scalar priVar(
const int pvIdx)
const
89 {
return priVars_[pvIdx]; }
92 template<
class ElementSolution,
class Problem,
class Element,
class SubControlVolume>
93 static Scalar temperature(
const ElementSolution &elemSol,
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); }
113 PrimaryVariables priVars_;
114 Scalar extrusionFactor_;
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); }
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);
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
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition freeflow/volumevariables.hh:130
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
typename Traits::ModelTraits::Indices Indices
export the type encapsulating primary variable indices
Definition freeflow/volumevariables.hh:134
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
FreeFlowVolumeVariablesImplementation< Traits, Impl, Traits::ModelTraits::enableEnergyBalance()> FreeFlowVolumeVariables
Volume variables for free-flow models. The class is specialized for isothermal and non-isothermal mod...
Definition freeflow/volumevariables.hh:30
Represents all relevant thermodynamic quantities of a multi-phase fluid system assuming immiscibility...