26#ifndef DUMUX_2P1C_LOCAL_RESIDUAL_HH
27#define DUMUX_2P1C_LOCAL_RESIDUAL_HH
36template<
class TypeTag>
47 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
48 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
50 using Element =
typename GridView::template Codim<0>::Entity;
58 using ParentType::ParentType;
62 const SubControlVolume& scv,
63 const VolumeVariables& volVars)
const
65 NumEqVector storage(0.0);
67 for (
int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
69 storage[Indices::conti0EqIdx] +=
71 * volVars.saturation(phaseIdx) * volVars.density(phaseIdx);
73 EnergyLocalResidual::fluidPhaseStorage(storage, scv, volVars, phaseIdx);
77 EnergyLocalResidual::solidPhaseStorage(storage, scv, volVars);
84 const Element& element,
85 const FVElementGeometry& fvGeometry,
86 const ElementVolumeVariables& elemVolVars,
87 const SubControlVolumeFace& scvf,
88 const ElementFluxVariablesCache& elemFluxVarsCache)
const
90 FluxVariables fluxVars;
91 fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
94 for (
int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
97 auto upwindTerm = [phaseIdx](
const auto& volVars)
98 {
return volVars.density(phaseIdx)*volVars.mobility(phaseIdx); };
100 flux[Indices::conti0EqIdx] += fluxVars.advectiveFlux(phaseIdx, upwindTerm);
103 EnergyLocalResidual::heatConvectionFlux(flux, fluxVars, phaseIdx);
107 EnergyLocalResidual::heatConductionFlux(flux, fluxVars);
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
Element-wise calculation of the residual for the fully implicit two-phase one-component flow model.
Definition: porousmediumflow/2p1c/localresidual.hh:38
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:83
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:61
Element-wise calculation of the residual for problems using the n-phase immiscible fully implicit mod...
Definition: porousmediumflow/immiscible/localresidual.hh:39
Element-wise calculation of the residual for problems using the n-phase immiscible fully implicit mod...