28#ifndef OPM_PTFLASH_LOCAL_RESIDUAL_HH
29#define OPM_PTFLASH_LOCAL_RESIDUAL_HH
31#include <opm/material/common/MathToolbox.hpp>
32#include <opm/material/common/Valgrind.hpp>
45template <
class TypeTag>
46class FlashLocalResidual:
public GetPropType<TypeTag, Properties::DiscLocalResidual>
59 enum { water0Idx = Indices::water0Idx };
60 enum { conti0EqIdx = Indices::conti0EqIdx };
62 enum { waterPhaseIdx = FluidSystem::waterPhaseIdx };
70 static constexpr bool waterEnabled = Indices::waterEnabled;
78 template <
class LhsEval>
80 const ElementContext& elemCtx,
85 const IntensiveQuantities& intQuants = elemCtx.intensiveQuantities(dofIdx,
timeIdx);
86 const auto& fs = intQuants.fluidState();
89 if (waterEnabled &&
phaseIdx ==
static_cast<unsigned int>(waterPhaseIdx)) {
90 const unsigned eqIdx = conti0EqIdx + numComponents;
114 template <
class LhsEval>
116 const ElementContext& elemCtx,
125 EnergyModule::addSolidEnergyStorage(
storage, elemCtx.intensiveQuantities(dofIdx,
timeIdx));
132 const ElementContext& elemCtx,
138 Valgrind::CheckDefined(
flux);
141 Valgrind::CheckDefined(
flux);
148 const ElementContext& elemCtx,
154 const unsigned focusDofIdx = elemCtx.focusDofIndex();
158 const IntensiveQuantities&
up = elemCtx.intensiveQuantities(
upIdx,
timeIdx);
164 const Evaluation tmp =
168 if (waterEnabled &&
phaseIdx ==
static_cast<unsigned int>(waterPhaseIdx)) {
169 const unsigned eqIdx = conti0EqIdx + numComponents;
180 const Evaluation tmp =
181 Toolbox::value(
up.fluidState().density(
phaseIdx)) *
184 if (waterEnabled &&
phaseIdx ==
static_cast<unsigned int>(waterPhaseIdx)) {
185 const unsigned eqIdx = conti0EqIdx + numComponents;
204 const ElementContext& elemCtx,
216 const ElementContext& elemCtx,
220 Valgrind::SetUndefined(source);
221 elemCtx.problem().source(source, elemCtx, dofIdx,
timeIdx);
222 Valgrind::CheckDefined(source);
Provides the auxiliary methods required for consideration of the diffusion equation.
Definition diffusionmodule.hh:51
Provides the auxiliary methods required for consideration of the energy equation.
Definition energymodule.hh:54
void computeStorage(Dune::FieldVector< LhsEval, numEq > &storage, const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx) const
Evaluate the amount all conservation quantities (e.g.
Definition flashlocalresidual.hh:115
void addDiffusiveFlux(RateVector &flux, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx) const
Adds the diffusive flux at a given flux integration point.
Definition flashlocalresidual.hh:174
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 flashlocalresidual.hh:79
void computeSource(RateVector &source, const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx) const
Calculate the source term of the equation.
Definition flashlocalresidual.hh:215
void addAdvectiveFlux(RateVector &flux, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx) const
Add the advective mass flux at a given flux integration point.
Definition flashlocalresidual.hh:130
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 flashlocalresidual.hh:131
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 blackoilbioeffectsmodules.hh:43
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240
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:233