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>
41 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
46 const SubControlVolume& scv,
47 const VolumeVariables& volVars,
50 static_assert(
"Deprecated interface that has been removed!");
57 const Problem& problem,
58 const SubControlVolume& scv,
59 const VolumeVariables& volVars,
71 const SubControlVolume& scv,
72 const VolumeVariables& volVars)
83 FluxVariables& fluxVars,
94 FluxVariables& fluxVars)
104 FluxVariables& fluxVars)
112template<
class TypeTag>
120 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
123 using Element =
typename GridView::template Codim<0>::Entity;
126 using Indices =
typename ModelTraits::Indices;
128 static constexpr int numPhases = ModelTraits::numFluidPhases();
129 enum { energyEqIdx = Indices::energyEqIdx };
137 const Problem& problem,
138 const SubControlVolume& scv,
139 const VolumeVariables& volVars,
144 const auto& x = scv.dofPosition();
145 const auto gravityPotential = x*problem.spatialParams().gravity(x);
147 storage[energyEqIdx] += volVars.porosity()
148 * volVars.density(phaseIdx)
149 * volVars.saturation(phaseIdx)
150 * (volVars.internalEnergy(phaseIdx) - gravityPotential);
154 const SubControlVolume& scv,
155 const VolumeVariables& volVars,
158 static_assert(
"Deprecated interface that has been removed!");
169 const SubControlVolume& scv,
170 const VolumeVariables& volVars)
172 storage[energyEqIdx] += volVars.temperature()
173 * volVars.solidHeatCapacity()
174 * volVars.solidDensity()
175 * (1.0 - volVars.porosity());
186 FluxVariables& fluxVars,
191 const auto& x = fluxVars.scvFace().ipGlobal();
192 const auto gravityPotential = x*fluxVars.problem().spatialParams().gravity(x);
194 auto upwindTerm = [=](
const auto& volVars){
195 return volVars.density(phaseIdx)*volVars.mobility(phaseIdx)
196 * (volVars.enthalpy(phaseIdx) - gravityPotential);
199 flux[energyEqIdx] += fluxVars.advectiveFlux(phaseIdx, upwindTerm);
209 FluxVariables& fluxVars)
211 flux[energyEqIdx] += fluxVars.heatConductionFlux();
221 FluxVariables& fluxVars)
224 if constexpr (ModelTraits::enableThermalDispersion())
226 flux[energyEqIdx] += fluxVars.thermalDispersionFlux();
241 const Element& element,
242 const FVElementGeometry& fvGeometry,
243 const ElementVolumeVariables& elemVolVars,
244 const SubControlVolume &scv)
static void heatDispersionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The dispersive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:103
static void heatConductionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The diffusive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:93
static void fluidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars, int phaseIdx)
Definition: porousmediumflow/nonisothermal/localresidual.hh:45
static void fluidPhaseStorage(NumEqVector &storage, const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars, int phaseIdx)
The energy storage in the fluid phase with index phaseIdx.
Definition: porousmediumflow/nonisothermal/localresidual.hh:56
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:82
static void solidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars)
The energy storage in the solid matrix.
Definition: porousmediumflow/nonisothermal/localresidual.hh:70
static void solidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars)
The energy storage in the solid matrix.
Definition: porousmediumflow/nonisothermal/localresidual.hh:168
static void fluidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars, int phaseIdx)
Definition: porousmediumflow/nonisothermal/localresidual.hh:153
static void heatConductionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The diffusive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:208
static void heatDispersionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The dispersive energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:220
static void fluidPhaseStorage(NumEqVector &storage, const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars, int phaseIdx)
The energy storage in the fluid phase with index phaseIdx.
Definition: porousmediumflow/nonisothermal/localresidual.hh:136
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:240
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes.
Definition: porousmediumflow/nonisothermal/localresidual.hh:185
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.