14#ifndef DUMUX_RICHARDSEXTENDED_LOCAL_RESIDUAL_HH
15#define DUMUX_RICHARDSEXTENDED_LOCAL_RESIDUAL_HH
32template<
class TypeTag>
44 using FVElementGeometry =
typename GridGeometry::LocalView;
45 using SubControlVolume =
typename GridGeometry::SubControlVolume;
46 using SubControlVolumeFace =
typename GridGeometry::SubControlVolumeFace;
47 using GridView =
typename GridGeometry::GridView;
48 using Element =
typename GridView::template Codim<0>::Entity;
53 enum { conti0EqIdx = Indices::conti0EqIdx };
56 static constexpr auto liquidPhaseIdx = FluidSystem::phase0Idx;
57 static constexpr auto gasPhaseIdx = FluidSystem::phase1Idx;
58 static constexpr auto liquidCompIdx = FluidSystem::comp0Idx;
61 using ParentType::ParentType;
72 const SubControlVolume& scv,
73 const VolumeVariables& volVars)
const
77 storage[conti0EqIdx] += volVars.porosity()
78 * volVars.molarDensity(gasPhaseIdx)
79 * volVars.moleFraction(gasPhaseIdx, liquidCompIdx)
80 * FluidSystem::molarMass(liquidCompIdx)
81 * volVars.saturation(gasPhaseIdx);
98 const Element& element,
99 const FVElementGeometry& fvGeometry,
100 const ElementVolumeVariables& elemVolVars,
101 const SubControlVolumeFace& scvf,
102 const ElementFluxVariablesCache& elemFluxVarsCache)
const
104 FluxVariables fluxVars;
105 fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
106 NumEqVector flux =
ParentType::computeFlux(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
111 flux[conti0EqIdx] += fluxVars.molecularDiffusionFlux(gasPhaseIdx)[liquidCompIdx];
113 flux[conti0EqIdx] += fluxVars.molecularDiffusionFlux(gasPhaseIdx)[liquidCompIdx]*FluidSystem::molarMass(liquidCompIdx);
Element-wise calculation of the Jacobian matrix for problems using the extended Richards fully implic...
Definition: porousmediumflow/richardsextended/localresidual.hh:34
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:71
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:97
Element-wise calculation of the Jacobian matrix for problems using the Richards fully implicit models...
Definition: porousmediumflow/richards/localresidual.hh:48
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/richards/localresidual.hh:100
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/richards/localresidual.hh:129
Defines all properties used 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:34
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
The available discretization methods in Dumux.
A helper to deduce a vector with the same size as numbers of equations.
Element-wise calculation of the Jacobian matrix for problems using the Richards fully implicit models...