26#ifndef DUMUX_RICHARDSEXTENDED_LOCAL_RESIDUAL_HH
27#define DUMUX_RICHARDSEXTENDED_LOCAL_RESIDUAL_HH
44template<
class TypeTag>
58 using FVElementGeometry =
typename GridGeometry::LocalView;
59 using SubControlVolume =
typename GridGeometry::SubControlVolume;
60 using SubControlVolumeFace =
typename GridGeometry::SubControlVolumeFace;
61 using GridView =
typename GridGeometry::GridView;
62 using Element =
typename GridView::template Codim<0>::Entity;
67 enum { conti0EqIdx = Indices::conti0EqIdx };
70 static constexpr auto liquidPhaseIdx = FluidSystem::phase0Idx;
71 static constexpr auto gasPhaseIdx = FluidSystem::phase1Idx;
72 static constexpr auto liquidCompIdx = FluidSystem::comp0Idx;
75 using ParentType::ParentType;
86 const SubControlVolume& scv,
87 const VolumeVariables& volVars)
const
91 NumEqVector storage(0.0);
92 storage[conti0EqIdx] = volVars.porosity()
93 * volVars.density(liquidPhaseIdx)
94 * volVars.saturation(liquidPhaseIdx);
97 storage[conti0EqIdx] += volVars.porosity()
98 * volVars.molarDensity(gasPhaseIdx)
99 * volVars.moleFraction(gasPhaseIdx, liquidCompIdx)
100 * FluidSystem::molarMass(liquidCompIdx)
101 * volVars.saturation(gasPhaseIdx);
104 EnergyLocalResidual::fluidPhaseStorage(storage, scv, volVars, liquidPhaseIdx);
105 EnergyLocalResidual::fluidPhaseStorage(storage, scv, volVars, gasPhaseIdx);
106 EnergyLocalResidual::solidPhaseStorage(storage, scv, volVars);
123 const Element& element,
124 const FVElementGeometry& fvGeometry,
125 const ElementVolumeVariables& elemVolVars,
126 const SubControlVolumeFace& scvf,
127 const ElementFluxVariablesCache& elemFluxVarsCache)
const
130 FluxVariables fluxVars;
131 fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
133 NumEqVector flux(0.0);
135 auto upwindTerm = [](
const auto& volVars)
136 {
return volVars.density(liquidPhaseIdx)*volVars.mobility(liquidPhaseIdx); };
138 flux[conti0EqIdx] = fluxVars.advectiveFlux(liquidPhaseIdx, upwindTerm);
143 flux[conti0EqIdx] += fluxVars.molecularDiffusionFlux(gasPhaseIdx)[liquidCompIdx];
145 flux[conti0EqIdx] += fluxVars.molecularDiffusionFlux(gasPhaseIdx)[liquidCompIdx]*FluidSystem::molarMass(liquidCompIdx);
148 EnergyLocalResidual::heatConvectionFlux(flux, fluxVars, liquidPhaseIdx);
152 EnergyLocalResidual::heatConductionFlux(flux, fluxVars);
The reference frameworks and formulations available for splitting total fluxes into a advective and d...
A helper to deduce a vector with the same size as numbers of equations.
The available discretization methods in Dumux.
Helper classes to compute the integration elements.
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
Element-wise calculation of the Jacobian matrix for problems using the Richards fully implicit models...
Definition: porousmediumflow/richards/localresidual.hh:58
Element-wise calculation of the Jacobian matrix for problems using the extended Richards fully implic...
Definition: porousmediumflow/richardsextended/localresidual.hh:46
NumEqVector computeStorage(const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars) const
Evaluates the rate of change of all conservation quantites (e.g. phase mass) within a sub-control vol...
Definition: porousmediumflow/richardsextended/localresidual.hh:85
NumEqVector computeFlux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const ElementFluxVariablesCache &elemFluxVarsCache) const
Evaluates the mass flux over a face of a sub control volume.
Definition: porousmediumflow/richardsextended/localresidual.hh:122
Declares all properties used in Dumux.
Element-wise calculation of the Jacobian matrix for problems using the Richards fully implicit models...