28#ifndef EWOMS_NCP_LOCAL_RESIDUAL_HH
29#define EWOMS_NCP_LOCAL_RESIDUAL_HH
36#include <opm/material/common/Valgrind.hpp>
45template <
class TypeTag>
60 enum { ncp0EqIdx = Indices::ncp0EqIdx };
61 enum { conti0EqIdx = Indices::conti0EqIdx };
69 using EvalEqVector = Dune::FieldVector<Evaluation, numEq>;
70 using ElemEvalEqVector = Dune::BlockVector<EvalEqVector>;
77 template <
class LhsEval>
79 const ElementContext& elemCtx,
84 const IntensiveQuantities& intQuants = elemCtx.intensiveQuantities(dofIdx,
timeIdx);
85 const auto& fluidState = intQuants.fluidState();
102 template <
class LhsEval>
104 const ElementContext& elemCtx,
112 EnergyModule::addSolidEnergyStorage(
storage, elemCtx.intensiveQuantities(dofIdx,
timeIdx));
119 const ElementContext& elemCtx,
125 Opm::Valgrind::CheckDefined(
flux);
128 Opm::Valgrind::CheckDefined(
flux);
135 const ElementContext& elemCtx,
146 const IntensiveQuantities&
up = elemCtx.intensiveQuantities(
upIdx,
timeIdx);
163 Toolbox::value(
up.fluidState().molarDensity(
phaseIdx))
180 const ElementContext& elemCtx,
195 const ElementContext& elemCtx,
199 Opm::Valgrind::SetUndefined(source);
200 elemCtx.problem().source(source, elemCtx, dofIdx,
timeIdx);
201 Opm::Valgrind::CheckDefined(source);
213 template <
class LhsEval = Evaluation>
219 const auto& fluidState = elemCtx.intensiveQuantities(dofIdx,
timeIdx).fluidState();
220 using FluidState =
typename std::remove_const<
typename std::remove_reference<
decltype(fluidState)>::type>::type;
226 return LhsToolbox::min(
a,
b);
234 template <
class Flu
idState,
class LhsEval>
235 LhsEval phasePresentIneq_(
const FluidState& fluidState,
unsigned phaseIdx)
const
246 template <
class Flu
idState,
class LhsEval>
247 LhsEval phaseNotPresentIneq_(
const FluidState& fluidState,
unsigned phaseIdx)
const
253 for (
unsigned i = 0; i < numComponents; ++i)
Provides the auxiliary methods required for consideration of the diffusion equation.
Definition diffusionmodule.hh:48
Provides the auxiliary methods required for consideration of the energy equation.
Definition energymodule.hh:50
Details needed to calculate the local residual in the compositional multi-phase NCP-model .
Definition ncplocalresidual.hh:47
LhsEval phaseNcp(const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx, unsigned phaseIdx) const
Returns the value of the NCP-function for a phase.
Definition ncplocalresidual.hh:214
void addAdvectiveFlux(RateVector &flux, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx) const
Add the advective mass flux at a given flux integration point.
Definition ncplocalresidual.hh:134
void addDiffusiveFlux(RateVector &flux, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx) const
Adds the diffusive flux at a given flux integration point.
Definition ncplocalresidual.hh:179
void computeFlux(RateVector &flux, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx) const
Evaluates the total mass flux of all conservation quantities over a face of a sub-control volume.
Definition ncplocalresidual.hh:118
void addPhaseStorage(Dune::FieldVector< LhsEval, numEq > &storage, const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx, unsigned phaseIdx) const
Adds the amount all conservation quantities (e.g.
Definition ncplocalresidual.hh:78
void computeStorage(Dune::FieldVector< LhsEval, numEq > &storage, const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx) const
Evaluate the amount all conservation quantities (e.g.
Definition ncplocalresidual.hh:103
void computeSource(RateVector &source, const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx) const
Calculate the source term of the equation.
Definition ncplocalresidual.hh:194
Classes required for molecular diffusion.
Contains the classes required to consider energy as a conservation quantity in a multi-phase module.
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
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:235
Declares the properties required for the NCP compositional multi-phase model.