14#ifndef DUMUX_RICHARDSEXTENDED_LOCAL_RESIDUAL_HH
15#define DUMUX_RICHARDSEXTENDED_LOCAL_RESIDUAL_HH
32template<
class TypeTag>
46 using FVElementGeometry =
typename GridGeometry::LocalView;
47 using SubControlVolume =
typename GridGeometry::SubControlVolume;
48 using SubControlVolumeFace =
typename GridGeometry::SubControlVolumeFace;
49 using GridView =
typename GridGeometry::GridView;
50 using Element =
typename GridView::template Codim<0>::Entity;
55 enum { conti0EqIdx = Indices::conti0EqIdx };
58 static constexpr auto liquidPhaseIdx = FluidSystem::phase0Idx;
59 static constexpr auto gasPhaseIdx = FluidSystem::phase1Idx;
60 static constexpr auto liquidCompIdx = FluidSystem::comp0Idx;
63 using ParentType::ParentType;
74 const SubControlVolume& scv,
75 const VolumeVariables& volVars)
const
79 storage[conti0EqIdx] += volVars.porosity()
80 * volVars.molarDensity(gasPhaseIdx)
81 * volVars.moleFraction(gasPhaseIdx, liquidCompIdx)
82 * FluidSystem::molarMass(liquidCompIdx)
83 * volVars.saturation(gasPhaseIdx);
100 const Element& element,
101 const FVElementGeometry& fvGeometry,
102 const ElementVolumeVariables& elemVolVars,
103 const SubControlVolumeFace& scvf,
104 const ElementFluxVariablesCache& elemFluxVarsCache)
const
106 FluxVariables fluxVars;
107 fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
108 NumEqVector flux =
ParentType::computeFlux(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
113 flux[conti0EqIdx] += fluxVars.molecularDiffusionFlux(gasPhaseIdx)[liquidCompIdx];
115 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:73
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:99
Element-wise calculation of the Jacobian matrix for problems using the Richards fully implicit models...
Definition: porousmediumflow/richards/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/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...