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)
109template<
class TypeTag>
116 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
119 using Element =
typename GridView::template Codim<0>::Entity;
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();
202 const Element& element,
203 const FVElementGeometry& fvGeometry,
204 const ElementVolumeVariables& elemVolVars,
205 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
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:150
Definition: porousmediumflow/nonisothermal/localresidual.hh:36
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: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 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:201
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:170
Declares all properties used in Dumux.