28 #ifndef EWOMS_MULTI_PHASE_BASE_EXTENSIVE_QUANTITIES_HH
29 #define EWOMS_MULTI_PHASE_BASE_EXTENSIVE_QUANTITIES_HH
37 #include <opm/common/Valgrind.hpp>
38 #include <opm/common/Unused.hpp>
40 #include <dune/common/fvector.hh>
49 template <
class TypeTag>
52 ,
public GET_PROP_TYPE(TypeTag, FluxModule)::FluxExtensiveQuantities
54 typedef typename GET_PROP_TYPE(TypeTag, DiscExtensiveQuantities) ParentType;
55 typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
56 typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
57 typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
61 typedef typename GET_PROP_TYPE(TypeTag, FluxModule) FluxModule;
62 typedef typename FluxModule::FluxExtensiveQuantities FluxExtensiveQuantities;
70 FluxModule::registerParameters();
81 void update(
const ElementContext& elemCtx,
unsigned scvfIdx,
unsigned timeIdx)
83 ParentType::update(elemCtx, scvfIdx, timeIdx);
86 FluxExtensiveQuantities::calculateGradients_(elemCtx, scvfIdx, timeIdx);
90 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
91 if (!elemCtx.model().phaseIsConsidered(phaseIdx)) {
92 Opm::Valgrind::SetUndefined(upstreamScvIdx_[phaseIdx]);
93 Opm::Valgrind::SetUndefined(downstreamScvIdx_[phaseIdx]);
97 upstreamScvIdx_[phaseIdx] = FluxExtensiveQuantities::upstreamIndex_(phaseIdx);
98 downstreamScvIdx_[phaseIdx] = FluxExtensiveQuantities::downstreamIndex_(phaseIdx);
101 FluxExtensiveQuantities::calculateFluxes_(elemCtx, scvfIdx, timeIdx);
115 template <
class Context,
class Flu
idState>
119 const FluidState& fluidState,
120 typename FluidSystem::template ParameterCache<typename FluidState::Scalar>& paramCache)
122 ParentType::updateBoundary(context, bfIdx, timeIdx, fluidState, paramCache);
124 FluxExtensiveQuantities::calculateBoundaryGradients_(context.elementContext(),
129 FluxExtensiveQuantities::calculateBoundaryFluxes_(context.elementContext(),
142 {
return upstreamScvIdx_[phaseIdx]; }
152 {
return downstreamScvIdx_[phaseIdx]; }
173 short upstreamScvIdx_[numPhases];
174 short downstreamScvIdx_[numPhases];
#define GET_PROP_VALUE(TypeTag, PropTagName)
Access the value attribute of a property for a type tag.
Definition: propertysystem.hh:469
Defines the common properties required by the porous medium multi-phase models.
#define GET_PROP_TYPE(TypeTag, PropTagName)
Access the type attribute of a property for a type tag.
Definition: propertysystem.hh:486
short downstreamIndex(unsigned phaseIdx) const
Return the local index of the downstream control volume for a given phase as a function of the normal...
Definition: multiphasebaseextensivequantities.hh:151
This file provides the infrastructure to retrieve run-time parameters.
void updateBoundary(const Context &context, unsigned bfIdx, unsigned timeIdx, const FluidState &fluidState, typename FluidSystem::template ParameterCache< typename FluidState::Scalar > ¶mCache)
Update the extensive quantities for a given boundary face.
Definition: multiphasebaseextensivequantities.hh:116
This method contains all callback classes for quantities that are required by some extensive quantiti...
void update(const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
Update the extensive quantities for a given sub-control-volume-face.
Definition: multiphasebaseextensivequantities.hh:81
static void registerParameters()
Register all run-time parameters for the extensive quantities.
Definition: multiphasebaseextensivequantities.hh:68
Scalar upstreamWeight(unsigned phaseIdx OPM_UNUSED) const
Return the weight of the upstream control volume for a given phase as a function of the normal flux...
Definition: multiphasebaseextensivequantities.hh:160
short upstreamIndex(unsigned phaseIdx) const
Return the local index of the upstream control volume for a given phase as a function of the normal f...
Definition: multiphasebaseextensivequantities.hh:141
This class calculates the pressure potential gradients and the filter velocities for multi-phase flow...
Definition: multiphasebaseextensivequantities.hh:50
Provide the properties at a face which make sense indepentently of the conserved quantities.
Scalar downstreamWeight(unsigned phaseIdx) const
Return the weight of the downstream control volume for a given phase as a function of the normal flux...
Definition: multiphasebaseextensivequantities.hh:169