26#ifndef DUMUX_2P1C_LOCAL_RESIDUAL_HH
27#define DUMUX_2P1C_LOCAL_RESIDUAL_HH
37template<
class TypeTag>
48 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
49 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
51 using Element =
typename GridView::template Codim<0>::Entity;
59 using ParentType::ParentType;
63 const SubControlVolume& scv,
64 const VolumeVariables& volVars)
const
66 NumEqVector storage(0.0);
68 for (
int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
70 storage[Indices::conti0EqIdx] +=
72 * volVars.saturation(phaseIdx) * volVars.density(phaseIdx);
74 EnergyLocalResidual::fluidPhaseStorage(storage, scv, volVars, phaseIdx);
78 EnergyLocalResidual::solidPhaseStorage(storage, scv, volVars);
85 const Element& element,
86 const FVElementGeometry& fvGeometry,
87 const ElementVolumeVariables& elemVolVars,
88 const SubControlVolumeFace& scvf,
89 const ElementFluxVariablesCache& elemFluxVarsCache)
const
91 FluxVariables fluxVars;
92 fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
95 for (
int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
98 auto upwindTerm = [phaseIdx](
const auto& volVars)
99 {
return volVars.density(phaseIdx)*volVars.mobility(phaseIdx); };
101 flux[Indices::conti0EqIdx] += fluxVars.advectiveFlux(phaseIdx, upwindTerm);
104 EnergyLocalResidual::heatConvectionFlux(flux, fluxVars, phaseIdx);
108 EnergyLocalResidual::heatConductionFlux(flux, fluxVars);
A helper to deduce a vector with the same size as numbers of equations.
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 residual for the fully implicit two-phase one-component flow model.
Definition: porousmediumflow/2p1c/localresidual.hh:39
NumEqVector computeFlux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const ElementFluxVariablesCache &elemFluxVarsCache) const
Evaluate the fluxes over a face of a sub control volume.
Definition: porousmediumflow/2p1c/localresidual.hh:84
NumEqVector computeStorage(const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars) const
Evaluate the storage term within a given scv.
Definition: porousmediumflow/2p1c/localresidual.hh:62
Element-wise calculation of the residual for problems using the n-phase immiscible fully implicit mod...
Definition: porousmediumflow/immiscible/localresidual.hh:40
Element-wise calculation of the residual for problems using the n-phase immiscible fully implicit mod...