25#ifndef DUMUX_IMMISCIBLE_LOCAL_RESIDUAL_HH
26#define DUMUX_IMMISCIBLE_LOCAL_RESIDUAL_HH
37template<
class TypeTag>
49 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
50 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
52 using Element =
typename GridView::template Codim<0>::Entity;
56 static constexpr int numPhases = ModelTraits::numFluidPhases();
57 static constexpr int conti0EqIdx = ModelTraits::Indices::conti0EqIdx;
60 using ParentType::ParentType;
75 const SubControlVolume& scv,
76 const VolumeVariables& volVars)
const
80 for (
int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
82 auto eqIdx = conti0EqIdx + phaseIdx;
83 storage[eqIdx] = volVars.porosity()
84 * volVars.density(phaseIdx)
85 * volVars.saturation(phaseIdx);
88 EnergyLocalResidual::fluidPhaseStorage(storage, scv, volVars, phaseIdx);
92 EnergyLocalResidual::solidPhaseStorage(storage, scv, volVars);
109 const Element& element,
110 const FVElementGeometry& fvGeometry,
111 const ElementVolumeVariables& elemVolVars,
112 const SubControlVolumeFace& scvf,
113 const ElementFluxVariablesCache& elemFluxVarsCache)
const
115 FluxVariables fluxVars;
116 fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
119 for (
int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
122 auto upwindTerm = [phaseIdx](
const auto& volVars)
123 {
return volVars.density(phaseIdx)*volVars.mobility(phaseIdx); };
125 auto eqIdx = conti0EqIdx + phaseIdx;
126 flux[eqIdx] = fluxVars.advectiveFlux(phaseIdx, upwindTerm);
129 EnergyLocalResidual::heatConvectionFlux(flux, fluxVars, phaseIdx);
133 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 problems using the n-phase immiscible fully implicit mod...
Definition: porousmediumflow/immiscible/localresidual.hh:39
NumEqVector computeFlux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const ElementFluxVariablesCache &elemFluxVarsCache) const
Evaluatex the mass flux over a face of a sub control volume.
Definition: porousmediumflow/immiscible/localresidual.hh:108
NumEqVector computeStorage(const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars) const
Evaluatex the rate of change of all conservation quantites (e.g. phase mass) within a sub-control vol...
Definition: porousmediumflow/immiscible/localresidual.hh:74
Declares all properties used in Dumux.