26#ifndef DUMUX_ENERGY_LOCAL_RESIDUAL_HH
27#define DUMUX_ENERGY_LOCAL_RESIDUAL_HH
35template<
class TypeTag,
bool enableEneryBalance>
38template<
class TypeTag>
45template<
class TypeTag>
52 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
65 const SubControlVolume& scv,
66 const VolumeVariables& volVars,
78 const SubControlVolume& scv,
79 const VolumeVariables& volVars)
90 FluxVariables& fluxVars,
101 FluxVariables& fluxVars)
111 FluxVariables& fluxVars)
119template<
class TypeTag>
126 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
129 using Element =
typename GridView::template Codim<0>::Entity;
132 using Indices =
typename ModelTraits::Indices;
134 static constexpr int numPhases = ModelTraits::numFluidPhases();
135 enum { energyEqIdx = Indices::energyEqIdx };
148 const SubControlVolume& scv,
149 const VolumeVariables& volVars,
152 storage[energyEqIdx] += volVars.porosity()
153 * volVars.density(phaseIdx)
154 * volVars.internalEnergy(phaseIdx)
155 * volVars.saturation(phaseIdx);
166 const SubControlVolume& scv,
167 const VolumeVariables& volVars)
169 storage[energyEqIdx] += volVars.temperature()
170 * volVars.solidHeatCapacity()
171 * volVars.solidDensity()
172 * (1.0 - volVars.porosity());
183 FluxVariables& fluxVars,
186 auto upwindTerm = [phaseIdx](
const auto& volVars)
187 {
return volVars.density(phaseIdx)*volVars.mobility(phaseIdx)*volVars.enthalpy(phaseIdx); };
189 flux[energyEqIdx] += fluxVars.advectiveFlux(phaseIdx, upwindTerm);
199 FluxVariables& fluxVars)
201 flux[energyEqIdx] += fluxVars.heatConductionFlux();
211 FluxVariables& fluxVars)
214 if constexpr (ModelTraits::enableThermalDispersion())
216 flux[energyEqIdx] += fluxVars.thermalDispersionFlux();
231 const Element& element,
232 const FVElementGeometry& fvGeometry,
233 const ElementVolumeVariables& elemVolVars,
234 const SubControlVolume &scv)
A helper to deduce a vector with the same size as numbers of equations.
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:46
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:180
Definition: porousmediumflow/nonisothermal/localresidual.hh:36
static void heatDispersionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The dispersive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:110
static void heatConductionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The diffusive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:100
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:64
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:89
static void solidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars)
The energy storage in the solid matrix.
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:165
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:147
static void heatConductionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The diffusive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:198
static void heatDispersionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The dispersive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:210
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:230
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:182
Declares all properties used in Dumux.