13#ifndef DUMUX_IMMISCIBLE_LOCAL_RESIDUAL_HH 
   14#define DUMUX_IMMISCIBLE_LOCAL_RESIDUAL_HH 
   27template<
class TypeTag>
 
   41    using FVElementGeometry = 
typename GridGeometry::LocalView;
 
   42    using SubControlVolume = 
typename FVElementGeometry::SubControlVolume;
 
   43    using SubControlVolumeFace = 
typename FVElementGeometry::SubControlVolumeFace;
 
   44    using GridView = 
typename GridGeometry::GridView;
 
   45    using Element = 
typename GridView::template Codim<0>::Entity;
 
   49    static constexpr int numPhases = ModelTraits::numFluidPhases();
 
   50    static constexpr int conti0EqIdx = ModelTraits::Indices::conti0EqIdx; 
 
   53    using ParentType::ParentType;
 
   65                               const SubControlVolume& scv,
 
   66                               const VolumeVariables& volVars)
 const 
   70        for (
int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
 
   72            auto eqIdx = conti0EqIdx + phaseIdx;
 
   73            storage[eqIdx] = volVars.porosity()
 
   74                             * volVars.density(phaseIdx)
 
   75                             * volVars.saturation(phaseIdx);
 
   78            EnergyLocalResidual::fluidPhaseStorage(storage, problem, scv, volVars, phaseIdx);
 
   82        EnergyLocalResidual::solidPhaseStorage(storage, scv, volVars);
 
 
   99                            const Element& element,
 
  100                            const FVElementGeometry& fvGeometry,
 
  101                            const ElementVolumeVariables& elemVolVars,
 
  102                            const SubControlVolumeFace& scvf,
 
  103                            const ElementFluxVariablesCache& elemFluxVarsCache)
 const 
  105        FluxVariables fluxVars;
 
  106        fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
 
  109        for (
int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
 
  112            auto upwindTerm = [phaseIdx](
const auto& volVars)
 
  113                              { 
return volVars.density(phaseIdx)*volVars.mobility(phaseIdx); };
 
  115            auto eqIdx = conti0EqIdx + phaseIdx;
 
  116            flux[eqIdx] = fluxVars.advectiveFlux(phaseIdx, upwindTerm);
 
  119            EnergyLocalResidual::heatConvectionFlux(flux, fluxVars, phaseIdx);
 
  123        EnergyLocalResidual::heatConductionFlux(flux, fluxVars);
 
 
 
Element-wise calculation of the residual for problems using the n-phase immiscible fully implicit mod...
Definition porousmediumflow/immiscible/localresidual.hh:30
NumEqVector computeFlux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const ElementFluxVariablesCache &elemFluxVarsCache) const
Evaluate the mass flux over a face of a sub control volume.
Definition porousmediumflow/immiscible/localresidual.hh:98
NumEqVector computeStorage(const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars) const
Evaluate the rate of change of all conservation quantites (e.g. phase mass) within a sub-control volu...
Definition porousmediumflow/immiscible/localresidual.hh:64
Defines all properties used in Dumux.
The default local operator than can be specialized for each discretization scheme.
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
typename Detail::DiscretizationDefaultLocalOperator< TypeTag >::type DiscretizationDefaultLocalOperator
Definition defaultlocaloperator.hh:26
A helper to deduce a vector with the same size as numbers of equations.