14#ifndef DUMUX_ENERGY_LOCAL_RESIDUAL_HH 
   15#define DUMUX_ENERGY_LOCAL_RESIDUAL_HH 
   24template<
class TypeTag, 
bool enableEneryBalance>
 
   27template<
class TypeTag>
 
   34template<
class TypeTag>
 
   42    using SubControlVolume = 
typename FVElementGeometry::SubControlVolume;
 
   46    template <
typename T = 
void>
 
   48                                  const SubControlVolume& scv,
 
   49                                  const VolumeVariables& volVars,
 
   52        static_assert(
AlwaysFalse<T>::value, 
"Deprecated interface that has been removed! Use new interface with additional argument problem instead. Will be entirely removed after release 3.10.");
 
 
   59                                  const Problem& problem,
 
   60                                  const SubControlVolume& scv,
 
   61                                  const VolumeVariables& volVars,
 
 
   73                                  const SubControlVolume& scv,
 
   74                                  const VolumeVariables& volVars)
 
 
   85                                   FluxVariables& fluxVars,
 
 
   96                                   FluxVariables& fluxVars)
 
 
  106                                   FluxVariables& fluxVars)
 
 
 
  114template<
class TypeTag>
 
  122    using SubControlVolume = 
typename FVElementGeometry::SubControlVolume;
 
  125    using Element = 
typename GridView::template Codim<0>::Entity;
 
  128    using Indices = 
typename ModelTraits::Indices;
 
  130    static constexpr int numPhases = ModelTraits::numFluidPhases();
 
  131    enum { energyEqIdx = Indices::energyEqIdx };
 
  139                                  const Problem& problem,
 
  140                                  const SubControlVolume& scv,
 
  141                                  const VolumeVariables& volVars,
 
  146        const auto& x = scv.dofPosition();
 
  147        const auto gravityPotential = x*problem.spatialParams().gravity(x);
 
  149        storage[energyEqIdx] += volVars.porosity()
 
  150                                * volVars.density(phaseIdx)
 
  151                                * volVars.saturation(phaseIdx)
 
  152                                * (volVars.internalEnergy(phaseIdx) - gravityPotential);
 
 
  155    template <
typename T = 
void>
 
  157                                  const SubControlVolume& scv,
 
  158                                  const VolumeVariables& volVars,
 
  161        static_assert(
AlwaysFalse<T>::value, 
"Deprecated interface that has been removed! Use new interface with additional argument problem instead. Will be entirely removed after release 3.10.");
 
 
  172                                  const SubControlVolume& scv,
 
  173                                  const VolumeVariables& volVars)
 
  175        storage[energyEqIdx] += volVars.temperature()
 
  176                                * volVars.solidHeatCapacity()
 
  177                                * volVars.solidDensity()
 
  178                                * (1.0 - volVars.porosity());
 
 
  189                                   FluxVariables& fluxVars,
 
  194        const auto& x = fluxVars.scvFace().ipGlobal();
 
  195        const auto gravityPotential = x*fluxVars.problem().spatialParams().gravity(x);
 
  197        auto upwindTerm = [=](
const auto& volVars){
 
  198            return volVars.density(phaseIdx)*volVars.mobility(phaseIdx)
 
  199                * (volVars.enthalpy(phaseIdx) - gravityPotential);
 
  202        flux[energyEqIdx] += fluxVars.advectiveFlux(phaseIdx, upwindTerm);
 
 
  212                                   FluxVariables& fluxVars)
 
  214        flux[energyEqIdx] += fluxVars.heatConductionFlux();
 
 
  224                                   FluxVariables& fluxVars)
 
  227        if constexpr (ModelTraits::enableThermalDispersion())
 
  229            flux[energyEqIdx] += fluxVars.thermalDispersionFlux();
 
 
  244                                    const Element& element,
 
  245                                    const FVElementGeometry& fvGeometry,
 
  246                                    const ElementVolumeVariables& elemVolVars,
 
  247                                    const SubControlVolume &scv)
 
 
 
static void fluidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars, int phaseIdx)
Definition porousmediumflow/nonisothermal/localresidual.hh:47
static void heatDispersionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The dispersive energy fluxes.
Definition porousmediumflow/nonisothermal/localresidual.hh:105
static void heatConductionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The diffusive energy fluxes.
Definition porousmediumflow/nonisothermal/localresidual.hh:95
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:58
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes.
Definition porousmediumflow/nonisothermal/localresidual.hh:84
static void solidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars)
The energy storage in the solid matrix.
Definition porousmediumflow/nonisothermal/localresidual.hh:72
static void solidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars)
The energy storage in the solid matrix.
Definition porousmediumflow/nonisothermal/localresidual.hh:171
static void heatConductionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The diffusive energy fluxes.
Definition porousmediumflow/nonisothermal/localresidual.hh:211
static void heatDispersionFlux(NumEqVector &flux, FluxVariables &fluxVars)
The dispersive energy fluxes.
Definition porousmediumflow/nonisothermal/localresidual.hh:223
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:138
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:243
static void heatConvectionFlux(NumEqVector &flux, FluxVariables &fluxVars, int phaseIdx)
The advective phase energy fluxes.
Definition porousmediumflow/nonisothermal/localresidual.hh:188
static void fluidPhaseStorage(NumEqVector &storage, const SubControlVolume &scv, const VolumeVariables &volVars, int phaseIdx)
Definition porousmediumflow/nonisothermal/localresidual.hh:156
Definition porousmediumflow/nonisothermal/localresidual.hh:25
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
EnergyLocalResidualImplementation< TypeTag, GetPropType< TypeTag, Properties::ModelTraits >::enableEnergyBalance()> EnergyLocalResidual
Definition porousmediumflow/nonisothermal/localresidual.hh:28
A helper to deduce a vector with the same size as numbers of equations.
Template which always yields a false value.
Definition common/typetraits/typetraits.hh:24