26 #ifndef EWOMS_BLACK_OIL_BOUNDARY_RATE_VECTOR_HH
27 #define EWOMS_BLACK_OIL_BOUNDARY_RATE_VECTOR_HH
29 #include <opm/material/common/Valgrind.hpp>
30 #include <opm/material/constraintsolvers/NcpFlash.hpp>
41 template <
class TypeTag>
44 typedef typename GET_PROP_TYPE(TypeTag, RateVector) ParentType;
45 typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
46 typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
47 typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
48 typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
53 enum { conti0EqIdx = Indices::conti0EqIdx };
79 template <
class Context,
class Flu
idState>
80 void setFreeFlow(
const Context &context,
int bfIdx,
int timeIdx,
81 const FluidState &fluidState)
83 typename FluidSystem::ParameterCache paramCache;
84 paramCache.updateAll(fluidState);
86 ExtensiveQuantities extQuants;
87 extQuants.updateBoundary(context, bfIdx, timeIdx, fluidState, paramCache);
88 const auto &insideIntQuants = context.intensiveQuantities(bfIdx, timeIdx);
94 for (
int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
95 Scalar meanMBoundary = 0;
96 for (
int compIdx = 0; compIdx < numComponents; ++compIdx)
97 meanMBoundary += fluidState.moleFraction(phaseIdx, compIdx)
98 * FluidSystem::molarMass(compIdx);
101 if (fluidState.pressure(phaseIdx) > insideIntQuants.fluidState().pressure(phaseIdx))
102 density = FluidSystem::density(fluidState, paramCache, phaseIdx);
104 density = insideIntQuants.fluidState().density(phaseIdx);
106 for (
int compIdx = 0; compIdx < numComponents; ++compIdx) {
108 if (fluidState.pressure(phaseIdx) > insideIntQuants.fluidState().pressure(phaseIdx))
110 fluidState.moleFraction(phaseIdx, compIdx)
114 molarity = insideIntQuants.fluidState().molarity(phaseIdx, compIdx);
118 (*this)[conti0EqIdx + compIdx] += extQuants.volumeFlux(phaseIdx) * molarity;
123 for (
int i = 0; i < numEq; ++i) {
124 Valgrind::CheckDefined((*
this)[i]);
126 Valgrind::CheckDefined(*
this);
133 template <
class Context,
class Flu
idState>
134 void setInFlow(
const Context &context,
int bfIdx,
int timeIdx,
135 const FluidState &fluidState)
137 this->
setFreeFlow(context, bfIdx, timeIdx, fluidState);
141 for (
int eqIdx = 0; eqIdx < numEq; ++eqIdx) {
142 Scalar &val = this->operator[](eqIdx);
143 val = std::min<Scalar>(0.0, val);
150 template <
class Context,
class Flu
idState>
151 void setOutFlow(
const Context &context,
int bfIdx,
int timeIdx,
152 const FluidState &fluidState)
154 this->
setFreeFlow(context, bfIdx, timeIdx, fluidState);
158 for (
int eqIdx = 0; eqIdx < numEq; ++eqIdx) {
159 Scalar &val = this->operator[](eqIdx);
160 val = std::max<Scalar>(0.0, val);
#define GET_PROP_VALUE(TypeTag, PropTagName)
Access the value attribute of a property for a type tag.
Definition: propertysystem.hh:468
#define GET_PROP_TYPE(TypeTag, PropTagName)
Access the type attribute of a property for a type tag.
Definition: propertysystem.hh:485
void setNoFlow()
Specify a no-flow boundary for all conserved quantities.
Definition: blackoilboundaryratevector.hh:167
BlackOilBoundaryRateVector(const BlackOilBoundaryRateVector &value)
Copy constructor.
Definition: blackoilboundaryratevector.hh:71
Implements a boundary vector for the fully implicit black-oil model.
Definition: blackoilboundaryratevector.hh:42
void setFreeFlow(const Context &context, int bfIdx, int timeIdx, const FluidState &fluidState)
Specify a free-flow boundary.
Definition: blackoilboundaryratevector.hh:80
BlackOilBoundaryRateVector(Scalar value)
Definition: blackoilboundaryratevector.hh:65
Definition: baseauxiliarymodule.hh:35
void setOutFlow(const Context &context, int bfIdx, int timeIdx, const FluidState &fluidState)
Specify an outflow boundary.
Definition: blackoilboundaryratevector.hh:151
BlackOilBoundaryRateVector()
Default constructor.
Definition: blackoilboundaryratevector.hh:59
Contains the quantities which are are constant within a finite volume in the black-oil model...
void setInFlow(const Context &context, int bfIdx, int timeIdx, const FluidState &fluidState)
Specify an inflow boundary.
Definition: blackoilboundaryratevector.hh:134