32#ifndef EWOMS_BLACK_OIL_EXTBO_MODULE_HH
33#define EWOMS_BLACK_OIL_EXTBO_MODULE_HH
42#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
43#include <opm/input/eclipse/EclipseState/Tables/SsfnTable.hpp>
44#include <opm/input/eclipse/EclipseState/Tables/Sof2Table.hpp>
45#include <opm/input/eclipse/EclipseState/Tables/MsfnTable.hpp>
46#include <opm/input/eclipse/EclipseState/Tables/PmiscTable.hpp>
47#include <opm/input/eclipse/EclipseState/Tables/MiscTable.hpp>
48#include <opm/input/eclipse/EclipseState/Tables/SorwmisTable.hpp>
49#include <opm/input/eclipse/EclipseState/Tables/SgcwmisTable.hpp>
50#include <opm/input/eclipse/EclipseState/Tables/TlpmixpaTable.hpp>
53#include <dune/common/fvector.hh>
67template <class TypeTag, bool enableExtboV = getPropValue<TypeTag, Properties::EnableExtbo>()>
83 using Toolbox = MathToolbox<Evaluation>;
88 static constexpr unsigned zFractionIdx = Indices::zFractionIdx;
89 static constexpr unsigned contiZfracEqIdx = Indices::contiZfracEqIdx;
90 static constexpr unsigned enableExtbo = enableExtboV;
91 static constexpr unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
92 static constexpr unsigned numPhases = FluidSystem::numPhases;
93 static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx;
94 static constexpr unsigned oilPhaseIdx = FluidSystem::oilPhaseIdx;
95 static constexpr unsigned waterPhaseIdx = FluidSystem::waterPhaseIdx;
96 static constexpr bool blackoilConserveSurfaceVolume = getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>();
103 static void initFromState(
const EclipseState& eclState)
107 if (enableExtbo && !eclState.runspec().phases().active(Phase::ZFRACTION))
108 throw std::runtime_error(
"Extended black oil treatment requested at compile "
109 "time, but the deck does not contain the PVTSOL keyword");
110 else if (!enableExtbo && eclState.runspec().phases().active(Phase::ZFRACTION))
111 throw std::runtime_error(
"Extended black oil treatment disabled at compile time, but the deck "
112 "contains the PVTSOL keyword");
114 if (!eclState.runspec().phases().active(Phase::ZFRACTION))
119 const auto& tableManager = eclState.getTableManager();
120 const auto& pvtsolTables = tableManager.getPvtsolTables();
122 size_t numPvtRegions = pvtsolTables.size();
124 params_.BO_.resize(numPvtRegions, Tabulated2DFunction{Tabulated2DFunction::InterpolationPolicy::LeftExtreme});
125 params_.BG_.resize(numPvtRegions, Tabulated2DFunction{Tabulated2DFunction::InterpolationPolicy::LeftExtreme});
126 params_.RS_.resize(numPvtRegions, Tabulated2DFunction{Tabulated2DFunction::InterpolationPolicy::LeftExtreme});
127 params_.RV_.resize(numPvtRegions, Tabulated2DFunction{Tabulated2DFunction::InterpolationPolicy::LeftExtreme});
128 params_.X_.resize(numPvtRegions, Tabulated2DFunction{Tabulated2DFunction::InterpolationPolicy::LeftExtreme});
129 params_.Y_.resize(numPvtRegions, Tabulated2DFunction{Tabulated2DFunction::InterpolationPolicy::LeftExtreme});
130 params_.VISCO_.resize(numPvtRegions, Tabulated2DFunction{Tabulated2DFunction::InterpolationPolicy::LeftExtreme});
131 params_.VISCG_.resize(numPvtRegions, Tabulated2DFunction{Tabulated2DFunction::InterpolationPolicy::LeftExtreme});
133 params_.PBUB_RS_.resize(numPvtRegions, Tabulated2DFunction{Tabulated2DFunction::InterpolationPolicy::LeftExtreme});
134 params_.PBUB_RV_.resize(numPvtRegions, Tabulated2DFunction{Tabulated2DFunction::InterpolationPolicy::LeftExtreme});
136 params_.zLim_.resize(numPvtRegions);
138 const bool extractCmpFromPvt =
true;
139 params_.oilCmp_.resize(numPvtRegions);
140 params_.gasCmp_.resize(numPvtRegions);
142 for (
unsigned regionIdx = 0; regionIdx < numPvtRegions; ++ regionIdx) {
143 const auto& pvtsolTable = pvtsolTables[regionIdx];
145 const auto& saturatedTable = pvtsolTable.getSaturatedTable();
146 assert(saturatedTable.numRows() > 1);
148 std::vector<Scalar>
oilCmp(saturatedTable.numRows(), -4.0e-9);
149 std::vector<Scalar>
gasCmp(saturatedTable.numRows(), -0.08);
150 params_.zLim_[regionIdx] = 0.7;
151 std::vector<Scalar> zArg(saturatedTable.numRows(), 0.0);
153 for (
unsigned outerIdx = 0; outerIdx < saturatedTable.numRows(); ++ outerIdx) {
154 Scalar ZCO2 = saturatedTable.get(
"ZCO2", outerIdx);
156 zArg[outerIdx] = ZCO2;
158 params_.BO_[regionIdx].appendXPos(ZCO2);
159 params_.BG_[regionIdx].appendXPos(ZCO2);
161 params_.RS_[regionIdx].appendXPos(ZCO2);
162 params_.RV_[regionIdx].appendXPos(ZCO2);
164 params_.X_[regionIdx].appendXPos(ZCO2);
165 params_.Y_[regionIdx].appendXPos(ZCO2);
167 params_.VISCO_[regionIdx].appendXPos(ZCO2);
168 params_.VISCG_[regionIdx].appendXPos(ZCO2);
170 params_.PBUB_RS_[regionIdx].appendXPos(ZCO2);
171 params_.PBUB_RV_[regionIdx].appendXPos(ZCO2);
173 const auto& underSaturatedTable = pvtsolTable.getUnderSaturatedTable(outerIdx);
174 size_t numRows = underSaturatedTable.numRows();
178 for (
unsigned innerIdx = 0; innerIdx < numRows; ++ innerIdx) {
179 Scalar po = underSaturatedTable.get(
"P", innerIdx);
180 Scalar
bo = underSaturatedTable.get(
"B_O", innerIdx);
181 Scalar
bg = underSaturatedTable.get(
"B_G", innerIdx);
182 Scalar
rs = underSaturatedTable.get(
"RS", innerIdx)+innerIdx*1.0e-10;
183 Scalar
rv = underSaturatedTable.get(
"RV", innerIdx)+innerIdx*1.0e-10;
184 Scalar xv = underSaturatedTable.get(
"XVOL", innerIdx);
185 Scalar yv = underSaturatedTable.get(
"YVOL", innerIdx);
186 Scalar mo = underSaturatedTable.get(
"MU_O", innerIdx);
187 Scalar mg = underSaturatedTable.get(
"MU_G", innerIdx);
191 if (extractCmpFromPvt) {
192 Scalar cmpFactor = (
bo-bo0)/(po-po0);
193 oilCmp[outerIdx] = cmpFactor;
194 params_.zLim_[regionIdx] = ZCO2;
198 }
else if (bo0 ==
bo) {
200 if (innerIdx+1 < numRows && ZCO2<1.0 && extractCmpFromPvt) {
201 Scalar rvNxt = underSaturatedTable.get(
"RV", innerIdx+1)+innerIdx*1.0e-10;
202 Scalar bgNxt = underSaturatedTable.get(
"B_G", innerIdx+1);
203 Scalar cmpFactor = (bgNxt-
bg)/(rvNxt-
rv);
204 gasCmp[outerIdx] = cmpFactor;
208 params_.BO_[regionIdx].appendSamplePoint(outerIdx,po,
bo);
209 params_.BG_[regionIdx].appendSamplePoint(outerIdx,po,
bg);
210 params_.RS_[regionIdx].appendSamplePoint(outerIdx,po,
rs);
211 params_.RV_[regionIdx].appendSamplePoint(outerIdx,po,
rv);
212 params_.X_[regionIdx].appendSamplePoint(outerIdx,po,xv);
213 params_.Y_[regionIdx].appendSamplePoint(outerIdx,po,yv);
214 params_.VISCO_[regionIdx].appendSamplePoint(outerIdx,po,mo);
215 params_.VISCG_[regionIdx].appendSamplePoint(outerIdx,po,mg);
222 params_.BO_[regionIdx].appendSamplePoint(outerIdx,po,
bo);
223 params_.BG_[regionIdx].appendSamplePoint(outerIdx,po,
bg);
225 params_.RS_[regionIdx].appendSamplePoint(outerIdx,po,
rs);
226 params_.RV_[regionIdx].appendSamplePoint(outerIdx,po,
rv);
228 params_.X_[regionIdx].appendSamplePoint(outerIdx,po,xv);
229 params_.Y_[regionIdx].appendSamplePoint(outerIdx,po,yv);
231 params_.VISCO_[regionIdx].appendSamplePoint(outerIdx,po,mo);
232 params_.VISCG_[regionIdx].appendSamplePoint(outerIdx,po,mg);
235 params_.PBUB_RS_[regionIdx].appendSamplePoint(outerIdx,
rs, po);
236 params_.PBUB_RV_[regionIdx].appendSamplePoint(outerIdx,
rv, po);
240 params_.oilCmp_[regionIdx].setXYContainers(zArg,
oilCmp,
false);
241 params_.gasCmp_[regionIdx].setXYContainers(zArg,
gasCmp,
false);
245 const auto& sdensityTables = eclState.getTableManager().getSolventDensityTables();
246 if (sdensityTables.size() == numPvtRegions) {
247 params_.zReferenceDensity_.resize(numPvtRegions);
248 for (
unsigned regionIdx = 0; regionIdx < numPvtRegions; ++ regionIdx) {
249 Scalar rhoRefS = sdensityTables[regionIdx].getSolventDensityColumn().front();
250 params_.zReferenceDensity_[regionIdx]=rhoRefS;
254 throw std::runtime_error(
"Extbo: kw SDENSITY is missing or not aligned with NTPVT\n");
275 if constexpr (enableExtbo)
276 return pvIdx == zFractionIdx;
293 return static_cast<Scalar
>(1.0);
298 if constexpr (enableExtbo)
299 return eqIdx == contiZfracEqIdx;
304 static std::string
eqName([[maybe_unused]]
unsigned eqIdx)
308 return "conti^solvent";
311 static Scalar
eqWeight([[maybe_unused]]
unsigned eqIdx)
316 return static_cast<Scalar
>(1.0);
319 template <
class LhsEval>
320 static void addStorage(Dune::FieldVector<LhsEval, numEq>& storage,
321 const IntensiveQuantities& intQuants)
323 if constexpr (enableExtbo) {
324 if constexpr (blackoilConserveSurfaceVolume) {
325 storage[contiZfracEqIdx] =
326 Toolbox::template decay<LhsEval>(intQuants.porosity())
327 * Toolbox::template decay<LhsEval>(intQuants.yVolume())
328 * Toolbox::template decay<LhsEval>(intQuants.fluidState().saturation(gasPhaseIdx))
329 * Toolbox::template decay<LhsEval>(intQuants.fluidState().invB(gasPhaseIdx));
330 if (FluidSystem::enableDissolvedGas()) {
331 storage[contiZfracEqIdx] +=
332 Toolbox::template decay<LhsEval>(intQuants.porosity())
333 * Toolbox::template decay<LhsEval>(intQuants.xVolume())
334 * Toolbox::template decay<LhsEval>(intQuants.fluidState().Rs())
335 * Toolbox::template decay<LhsEval>(intQuants.fluidState().saturation(oilPhaseIdx))
336 * Toolbox::template decay<LhsEval>(intQuants.fluidState().invB(oilPhaseIdx));
341 const Scalar regWghtFactor = 1.0e-6;
342 storage[contiZfracEqIdx] += regWghtFactor*(1.0-Toolbox::template decay<LhsEval>(intQuants.zFraction()))
343 + regWghtFactor*Toolbox::template decay<LhsEval>(intQuants.porosity())
344 * Toolbox::template decay<LhsEval>(intQuants.fluidState().saturation(gasPhaseIdx))
345 * Toolbox::template decay<LhsEval>(intQuants.fluidState().invB(gasPhaseIdx));
346 storage[contiZfracEqIdx-1] += regWghtFactor*Toolbox::template decay<LhsEval>(intQuants.zFraction());
349 throw std::runtime_error(
"Only component conservation in terms of surface volumes is implemented. ");
355 [[maybe_unused]]
const ElementContext& elemCtx,
356 [[maybe_unused]]
unsigned scvfIdx,
357 [[maybe_unused]]
unsigned timeIdx)
360 if constexpr (enableExtbo) {
361 const auto& extQuants = elemCtx.extensiveQuantities(scvfIdx, timeIdx);
363 if constexpr (blackoilConserveSurfaceVolume) {
364 unsigned inIdx = extQuants.interiorIndex();
366 unsigned upIdxGas =
static_cast<unsigned>(extQuants.upstreamIndex(gasPhaseIdx));
367 const auto& upGas = elemCtx.intensiveQuantities(upIdxGas, timeIdx);
368 const auto& fsGas = upGas.fluidState();
369 if (upIdxGas == inIdx) {
370 flux[contiZfracEqIdx] =
371 extQuants.volumeFlux(gasPhaseIdx)
373 * fsGas.invB(gasPhaseIdx);
376 flux[contiZfracEqIdx] =
377 extQuants.volumeFlux(gasPhaseIdx)
378 * (decay<Scalar>(upGas.yVolume()))
379 * decay<Scalar>(fsGas.invB(gasPhaseIdx));
381 if (FluidSystem::enableDissolvedGas()) {
382 unsigned upIdxOil =
static_cast<unsigned>(extQuants.upstreamIndex(oilPhaseIdx));
383 const auto& upOil = elemCtx.intensiveQuantities(upIdxOil, timeIdx);
384 const auto& fsOil = upOil.fluidState();
385 if (upIdxOil == inIdx) {
386 flux[contiZfracEqIdx] +=
387 extQuants.volumeFlux(oilPhaseIdx)
390 * fsOil.invB(oilPhaseIdx);
393 flux[contiZfracEqIdx] +=
394 extQuants.volumeFlux(oilPhaseIdx)
395 * decay<Scalar>(upOil.xVolume())
396 * decay<Scalar>(fsOil.Rs())
397 * decay<Scalar>(fsOil.invB(oilPhaseIdx));
402 throw std::runtime_error(
"Only component conservation in terms of surface volumes is implemented. ");
413 if constexpr (enableExtbo)
414 priVars[zFractionIdx] = zFraction;
421 const PrimaryVariables& oldPv,
422 const EqVector& delta)
424 if constexpr (enableExtbo)
426 newPv[zFractionIdx] = oldPv[zFractionIdx] - delta[zFractionIdx];
438 return static_cast<Scalar
>(0.0);
447 return std::abs(Toolbox::scalarValue(resid[contiZfracEqIdx]));
450 template <
class DofEntity>
451 static void serializeEntity(
const Model& model, std::ostream& outstream,
const DofEntity& dof)
453 if constexpr (enableExtbo) {
454 unsigned dofIdx = model.dofMapper().index(dof);
456 const PrimaryVariables& priVars = model.solution(0)[dofIdx];
457 outstream << priVars[zFractionIdx];
461 template <
class DofEntity>
464 if constexpr (enableExtbo) {
465 unsigned dofIdx = model.dofMapper().index(dof);
467 PrimaryVariables& priVars0 = model.solution(0)[dofIdx];
468 PrimaryVariables& priVars1 = model.solution(1)[dofIdx];
470 instream >> priVars0[zFractionIdx];
473 priVars1 = priVars0[zFractionIdx];
477 template <
typename Value>
478 static Value
xVolume(
unsigned pvtRegionIdx,
const Value& pressure,
const Value& z) {
479 return params_.X_[pvtRegionIdx].eval(z, pressure,
true);
482 template <
typename Value>
483 static Value
yVolume(
unsigned pvtRegionIdx,
const Value& pressure,
const Value& z) {
484 return params_.Y_[pvtRegionIdx].eval(z, pressure,
true);
487 template <
typename Value>
488 static Value
pbubRs(
unsigned pvtRegionIdx,
const Value& z,
const Value&
rs) {
489 return params_.PBUB_RS_[pvtRegionIdx].eval(z,
rs,
true);
492 template <
typename Value>
493 static Value
pbubRv(
unsigned pvtRegionIdx,
const Value& z,
const Value&
rv) {
494 return params_.PBUB_RV_[pvtRegionIdx].eval(z,
rv,
true);
497 template <
typename Value>
498 static Value
oilViscosity(
unsigned pvtRegionIdx,
const Value& pressure,
const Value& z) {
499 return params_.VISCO_[pvtRegionIdx].eval(z, pressure,
true);
502 template <
typename Value>
503 static Value
gasViscosity(
unsigned pvtRegionIdx,
const Value& pressure,
const Value& z) {
504 return params_.VISCG_[pvtRegionIdx].eval(z, pressure,
true);
507 template <
typename Value>
508 static Value
bo(
unsigned pvtRegionIdx,
const Value& pressure,
const Value& z) {
509 return params_.BO_[pvtRegionIdx].eval(z, pressure,
true);
512 template <
typename Value>
513 static Value
bg(
unsigned pvtRegionIdx,
const Value& pressure,
const Value& z) {
514 return params_.BG_[pvtRegionIdx].eval(z, pressure,
true);
517 template <
typename Value>
518 static Value
rs(
unsigned pvtRegionIdx,
const Value& pressure,
const Value& z) {
519 return params_.RS_[pvtRegionIdx].eval(z, pressure,
true);
522 template <
typename Value>
523 static Value
rv(
unsigned pvtRegionIdx,
const Value& pressure,
const Value& z) {
524 return params_.RV_[pvtRegionIdx].eval(z, pressure,
true);
528 return params_.zReferenceDensity_[regionIdx];
531 static Scalar
zLim(
unsigned regionIdx) {
532 return params_.zLim_[regionIdx];
535 template <
typename Value>
536 static Value
oilCmp(
unsigned pvtRegionIdx,
const Value& z) {
537 return params_.oilCmp_[pvtRegionIdx].eval(z,
true);
540 template <
typename Value>
541 static Value
gasCmp(
unsigned pvtRegionIdx,
const Value& z) {
542 return params_.gasCmp_[pvtRegionIdx].eval(z,
true);
549template <
class TypeTag,
bool enableExtboV>
550BlackOilExtboParams<typename BlackOilExtboModule<TypeTag, enableExtboV>::Scalar>
551BlackOilExtboModule<TypeTag, enableExtboV>::params_;
560template <class TypeTag, bool enableExtboV = getPropValue<TypeTag, Properties::EnableExtbo>()>
575 enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
576 static constexpr int zFractionIdx = Indices::zFractionIdx;
577 static constexpr int oilPhaseIdx = FluidSystem::oilPhaseIdx;
578 static constexpr int gasPhaseIdx = FluidSystem::gasPhaseIdx;
579 static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx;
580 static constexpr double cutOff = 1e-12;
593 const PrimaryVariables& priVars = elemCtx.primaryVars(dofIdx, timeIdx);
594 unsigned pvtRegionIdx = priVars.pvtRegionIndex();
595 auto& fs =
asImp_().fluidState_;
597 zFraction_ = priVars.makeEvaluation(zFractionIdx, timeIdx);
607 if (FluidSystem::enableDissolvedGas())
612 if (FluidSystem::enableVaporizedOil())
620 Evaluation pbub = fs.pressure(oilPhaseIdx);
622 if (priVars.primaryVarsMeaningWater() == PrimaryVariables::WaterMeaning::Sw) {
623 static const Scalar thresholdWaterFilledCell = 1.0 - 1e-6;
624 Scalar sw = priVars.makeEvaluation(Indices::waterSwitchIdx, timeIdx).value();
625 if (sw >= thresholdWaterFilledCell)
629 if (priVars.primaryVarsMeaningGas() == PrimaryVariables::GasMeaning::Rs) {
630 rs_ = priVars.makeEvaluation(Indices::compositionSwitchIdx, timeIdx);
642 if (priVars.primaryVarsMeaningGas() == PrimaryVariables::GasMeaning::Rv) {
643 rv_ = priVars.makeEvaluation(Indices::compositionSwitchIdx, timeIdx);
658 const auto& iq =
asImp_();
659 auto& fs =
asImp_().fluidState_;
661 unsigned pvtRegionIdx = iq.pvtRegionIndex();
664 fs.setInvB(oilPhaseIdx, 1.0/
bo_);
665 fs.setInvB(gasPhaseIdx, 1.0/
bg_);
667 fs.setDensity(oilPhaseIdx,
669 *(FluidSystem::referenceDensity(oilPhaseIdx, pvtRegionIdx)
670 + (1.0-
xVolume_)*fs.Rs()*FluidSystem::referenceDensity(gasPhaseIdx, pvtRegionIdx)
672 fs.setDensity(gasPhaseIdx,
675 + FluidSystem::referenceDensity(oilPhaseIdx, pvtRegionIdx)*fs.Rv()));
693 const Evaluation&
bo()
const
696 const Evaluation&
bg()
const
699 const Evaluation&
rs()
const
702 const Evaluation&
rv()
const
716 {
return *
static_cast<Implementation*
>(
this); }
740template <
class TypeTag>
758 {
throw std::runtime_error(
"xVolume() called but extbo is disabled"); }
761 {
throw std::runtime_error(
"yVolume() called but extbo is disabled"); }
764 {
throw std::runtime_error(
"oilViscosity() called but extbo is disabled"); }
767 {
throw std::runtime_error(
"gasViscosity() called but extbo is disabled"); }
769 const Evaluation&
rs()
const
770 {
throw std::runtime_error(
"rs() called but extbo is disabled"); }
772 const Evaluation&
rv()
const
773 {
throw std::runtime_error(
"rv() called but extbo is disabled"); }
776 {
throw std::runtime_error(
"zPureInvFormationVolumeFactor() called but extbo is disabled"); }
779 {
throw std::runtime_error(
"zFraction() called but extbo is disabled"); }
782 {
throw std::runtime_error(
"zInverseFormationVolumeFactor() called but extbo is disabled"); }
785 {
throw std::runtime_error(
"zRefDensity() called but extbo is disabled"); }
795template <class TypeTag, bool enableExtboV = getPropValue<TypeTag, Properties::EnableExtbo>()>
808 using Toolbox = MathToolbox<Evaluation>;
810 static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx;
811 static constexpr int dimWorld = GridView::dimensionworld;
813 typedef Dune::FieldVector<Scalar, dimWorld> DimVector;
814 typedef Dune::FieldVector<Evaluation, dimWorld> DimEvalVector;
819 Implementation& asImp_()
820 {
return *
static_cast<Implementation*
>(
this); }
824template <
class TypeTag>
Contains the parameters required to extend the black-oil model by solvent component....
Declares the properties required by the black oil model.
Provides the solvent specific extensive quantities to the generic black-oil module's extensive quanti...
Definition: blackoilextbomodules.hh:797
const Scalar & zRefDensity() const
Definition: blackoilextbomodules.hh:784
const Evaluation & xVolume() const
Definition: blackoilextbomodules.hh:757
const Evaluation & rs() const
Definition: blackoilextbomodules.hh:769
const Evaluation & zInverseFormationVolumeFactor() const
Definition: blackoilextbomodules.hh:781
const Evaluation & zPureInvFormationVolumeFactor() const
Definition: blackoilextbomodules.hh:775
const Evaluation & oilViscosity() const
Definition: blackoilextbomodules.hh:763
void zFractionUpdate_(const ElementContext &, unsigned, unsigned)
Definition: blackoilextbomodules.hh:752
const Evaluation & zFraction() const
Definition: blackoilextbomodules.hh:778
void zPvtUpdate_()
Definition: blackoilextbomodules.hh:749
const Evaluation & rv() const
Definition: blackoilextbomodules.hh:772
const Evaluation & gasViscosity() const
Definition: blackoilextbomodules.hh:766
const Evaluation & yVolume() const
Definition: blackoilextbomodules.hh:760
Provides the volumetric quantities required for the equations needed by the solvents extension of the...
Definition: blackoilextbomodules.hh:562
const Evaluation & rv() const
Definition: blackoilextbomodules.hh:702
Evaluation zFraction_
Definition: blackoilextbomodules.hh:721
const Evaluation & oilViscosity() const
Definition: blackoilextbomodules.hh:687
const Evaluation & zFraction() const
Definition: blackoilextbomodules.hh:678
const Evaluation & bo() const
Definition: blackoilextbomodules.hh:693
void zFractionUpdate_(const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx)
Compute extended pvt properties from table lookups.
Definition: blackoilextbomodules.hh:589
Scalar zRefDensity_
Definition: blackoilextbomodules.hh:737
void zPvtUpdate_()
Re-compute face densities to account for zFraction dependency.
Definition: blackoilextbomodules.hh:656
const Evaluation & yVolume() const
Definition: blackoilextbomodules.hh:684
Evaluation gasViscosity_
Definition: blackoilextbomodules.hh:729
Evaluation bg_
Definition: blackoilextbomodules.hh:731
Evaluation rs_
Definition: blackoilextbomodules.hh:732
const Evaluation & gasViscosity() const
Definition: blackoilextbomodules.hh:690
const Evaluation & rs() const
Definition: blackoilextbomodules.hh:699
Implementation & asImp_()
Definition: blackoilextbomodules.hh:715
Evaluation rv_
Definition: blackoilextbomodules.hh:733
const Evaluation & bg() const
Definition: blackoilextbomodules.hh:696
const Evaluation zPureInvFormationVolumeFactor() const
Definition: blackoilextbomodules.hh:705
const Scalar & zRefDensity() const
Definition: blackoilextbomodules.hh:708
Evaluation bo_
Definition: blackoilextbomodules.hh:730
Evaluation bz_
Definition: blackoilextbomodules.hh:736
Evaluation yVolume_
Definition: blackoilextbomodules.hh:725
Evaluation xVolume_
Definition: blackoilextbomodules.hh:724
Evaluation oilViscosity_
Definition: blackoilextbomodules.hh:728
const Evaluation & xVolume() const
Definition: blackoilextbomodules.hh:681
Contains the high level supplements required to extend the black oil model.
Definition: blackoilextbomodules.hh:69
static void addStorage(Dune::FieldVector< LhsEval, numEq > &storage, const IntensiveQuantities &intQuants)
Definition: blackoilextbomodules.hh:320
static bool primaryVarApplies(unsigned pvIdx)
Definition: blackoilextbomodules.hh:273
static Scalar zLim(unsigned regionIdx)
Definition: blackoilextbomodules.hh:531
static Scalar computeResidualError(const EqVector &resid)
Return how much a residual is considered an error.
Definition: blackoilextbomodules.hh:444
static Value yVolume(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:483
static void updatePrimaryVars(PrimaryVariables &newPv, const PrimaryVariables &oldPv, const EqVector &delta)
Do a Newton-Raphson update the primary variables of the solvents.
Definition: blackoilextbomodules.hh:420
static Value gasViscosity(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:503
static std::string eqName(unsigned eqIdx)
Definition: blackoilextbomodules.hh:304
static bool eqApplies(unsigned eqIdx)
Definition: blackoilextbomodules.hh:296
static Value pbubRv(unsigned pvtRegionIdx, const Value &z, const Value &rv)
Definition: blackoilextbomodules.hh:493
static Scalar primaryVarWeight(unsigned pvIdx)
Definition: blackoilextbomodules.hh:288
static Value rs(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:518
static void registerOutputModules(Model &, Simulator &)
Register all solvent specific VTK and ECL output modules.
Definition: blackoilextbomodules.hh:268
static Scalar computeUpdateError(const PrimaryVariables &, const EqVector &)
Return how much a Newton-Raphson update is considered an error.
Definition: blackoilextbomodules.hh:432
static Value xVolume(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:478
static void serializeEntity(const Model &model, std::ostream &outstream, const DofEntity &dof)
Definition: blackoilextbomodules.hh:451
static void computeFlux(RateVector &flux, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
Definition: blackoilextbomodules.hh:354
static void registerParameters()
Register all run-time parameters for the black-oil solvent module.
Definition: blackoilextbomodules.hh:261
static void deserializeEntity(Model &model, std::istream &instream, const DofEntity &dof)
Definition: blackoilextbomodules.hh:462
static std::string primaryVarName(unsigned pvIdx)
Definition: blackoilextbomodules.hh:281
static Value rv(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:523
static Value pbubRs(unsigned pvtRegionIdx, const Value &z, const Value &rs)
Definition: blackoilextbomodules.hh:488
static Value oilCmp(unsigned pvtRegionIdx, const Value &z)
Definition: blackoilextbomodules.hh:536
static Scalar referenceDensity(unsigned regionIdx)
Definition: blackoilextbomodules.hh:527
static Value bg(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:513
static Value oilViscosity(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:498
static void assignPrimaryVars(PrimaryVariables &priVars, Scalar zFraction)
Assign the solvent specific primary variables to a PrimaryVariables object.
Definition: blackoilextbomodules.hh:410
static Scalar eqWeight(unsigned eqIdx)
Definition: blackoilextbomodules.hh:311
static Value bo(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:508
static Value gasCmp(unsigned pvtRegionIdx, const Value &z)
Definition: blackoilextbomodules.hh:541
Definition: blackoilboundaryratevector.hh:37
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
Struct holding the parameters for the BlackoilExtboModule class.
Definition: blackoilextboparams.hh:44
UniformXTabulated2DFunction< Scalar > Tabulated2DFunction
Definition: blackoilextboparams.hh:46
Tabulated1DFunction< Scalar > TabulatedFunction
Definition: blackoilextboparams.hh:45