14#ifndef DUMUX_ENERGY_LOCAL_RESIDUAL_HH
15#define DUMUX_ENERGY_LOCAL_RESIDUAL_HH
23template<
class TypeTag,
bool enableEneryBalance>
26template<
class TypeTag>
33template<
class TypeTag>
40 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
53 const SubControlVolume& scv,
54 const VolumeVariables& volVars,
66 const SubControlVolume& scv,
67 const VolumeVariables& volVars)
78 FluxVariables& fluxVars,
89 FluxVariables& fluxVars)
99 FluxVariables& fluxVars)
107template<
class TypeTag>
114 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
117 using Element =
typename GridView::template Codim<0>::Entity;
120 using Indices =
typename ModelTraits::Indices;
122 static constexpr int numPhases = ModelTraits::numFluidPhases();
123 enum { energyEqIdx = Indices::energyEqIdx };
136 const SubControlVolume& scv,
137 const VolumeVariables& volVars,
140 storage[energyEqIdx] += volVars.porosity()
141 * volVars.density(phaseIdx)
142 * volVars.internalEnergy(phaseIdx)
143 * volVars.saturation(phaseIdx);
154 const SubControlVolume& scv,
155 const VolumeVariables& volVars)
157 storage[energyEqIdx] += volVars.temperature()
158 * volVars.solidHeatCapacity()
159 * volVars.solidDensity()
160 * (1.0 - volVars.porosity());
171 FluxVariables& fluxVars,
174 auto upwindTerm = [phaseIdx](
const auto& volVars)
175 {
return volVars.density(phaseIdx)*volVars.mobility(phaseIdx)*volVars.enthalpy(phaseIdx); };
177 flux[energyEqIdx] += fluxVars.advectiveFlux(phaseIdx, upwindTerm);
187 FluxVariables& fluxVars)
189 flux[energyEqIdx] += fluxVars.heatConductionFlux();
199 FluxVariables& fluxVars)
202 if constexpr (ModelTraits::enableThermalDispersion())
204 flux[energyEqIdx] += fluxVars.thermalDispersionFlux();
219 const Element& element,
220 const FVElementGeometry& fvGeometry,
221 const ElementVolumeVariables& elemVolVars,
222 const SubControlVolume &scv)
static void heatDispersionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The dispersive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:98
static void heatConductionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The diffusive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:88
static void fluidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars, int phaseIdx)
The energy storage in the fluid phase with index phaseIdx.
Definition: porousmediumflow/nonisothermal/localresidual.hh:52
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:77
static void solidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars)
The energy storage in the solid matrix.
Definition: porousmediumflow/nonisothermal/localresidual.hh:65
static void solidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars)
The energy storage in the solid matrix.
Definition: porousmediumflow/nonisothermal/localresidual.hh:153
static void fluidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars, int phaseIdx)
The energy storage in the fluid phase with index phaseIdx.
Definition: porousmediumflow/nonisothermal/localresidual.hh:135
static void heatConductionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The diffusive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:186
static void heatDispersionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The dispersive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:198
static void computeSourceEnergy(NumEqVector &source, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv)
heat transfer between the phases for nonequilibrium models
Definition: porousmediumflow/nonisothermal/localresidual.hh:218
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:170
Definition: porousmediumflow/nonisothermal/localresidual.hh:24
Defines all properties used in Dumux.
typename NumEqVectorTraits< PrimaryVariables >::type NumEqVector
A vector with the same size as numbers of equations This is the default implementation and has to be ...
Definition: numeqvector.hh:34
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
A helper to deduce a vector with the same size as numbers of equations.