blackoilextbomodules.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
32#ifndef EWOMS_BLACK_OIL_EXTBO_MODULE_HH
33#define EWOMS_BLACK_OIL_EXTBO_MODULE_HH
34
35#include <dune/common/fvector.hh>
36
37#include <opm/common/utility/gpuDecorators.hpp>
38
41
43
45
46//#include <opm/models/io/vtkBlackOilExtboModule.hh> //TODO: Missing ...
47
48#include <cassert>
49#include <cmath>
50#include <istream>
51#include <ostream>
52#include <stdexcept>
53#include <string>
54
55namespace Opm {
56
62template <class TypeTag, bool enableExtboV = getPropValue<TypeTag, Properties::EnableExtbo>()>
64{
76
77 using Toolbox = MathToolbox<Evaluation>;
78
79 static constexpr unsigned zFractionIdx = Indices::zFractionIdx;
80 static constexpr unsigned contiZfracEqIdx = Indices::contiZfracEqIdx;
81 static constexpr unsigned enableExtbo = enableExtboV;
82 static constexpr unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
83 static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx;
84 static constexpr unsigned oilPhaseIdx = FluidSystem::oilPhaseIdx;
85 static constexpr bool blackoilConserveSurfaceVolume = getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>();
86
87public:
90 {
91 params_ = params;
92 }
93
97 static void registerParameters()
98 {}
99
103 static void registerOutputModules(Model&,
104 Simulator&)
105 {}
106
107 static bool primaryVarApplies(unsigned pvIdx)
108 {
109 if constexpr (enableExtbo) {
110 return pvIdx == zFractionIdx;
111 }
112 else {
113 return false;
114 }
115 }
116
117 static std::string primaryVarName([[maybe_unused]] unsigned pvIdx)
118 {
119 assert(primaryVarApplies(pvIdx));
120
121 return "z_fraction";
122 }
123
124 static Scalar primaryVarWeight([[maybe_unused]] unsigned pvIdx)
125 {
126 assert(primaryVarApplies(pvIdx));
127
128 // TODO: it may be beneficial to chose this differently.
129 return static_cast<Scalar>(1.0);
130 }
131
132 static bool eqApplies(unsigned eqIdx)
133 {
134 if constexpr (enableExtbo) {
135 return eqIdx == contiZfracEqIdx;
136 }
137 else {
138 return false;
139 }
140 }
141
142 static std::string eqName([[maybe_unused]] unsigned eqIdx)
143 {
144 assert(eqApplies(eqIdx));
145
146 return "conti^solvent";
147 }
148
149 static Scalar eqWeight([[maybe_unused]] unsigned eqIdx)
150 {
151 assert(eqApplies(eqIdx));
152
153 // TODO: it may be beneficial to chose this differently.
154 return static_cast<Scalar>(1.0);
155 }
156
157 template <class StorageType>
158 OPM_HOST_DEVICE static void addStorage(StorageType& storage,
159 const IntensiveQuantities& intQuants)
160 {
161 using LhsEval = typename StorageType::value_type;
162
163 if constexpr (enableExtbo) {
164 if constexpr (blackoilConserveSurfaceVolume) {
165 storage[contiZfracEqIdx] =
166 Toolbox::template decay<LhsEval>(intQuants.porosity()) *
167 Toolbox::template decay<LhsEval>(intQuants.yVolume()) *
168 Toolbox::template decay<LhsEval>(intQuants.fluidState().saturation(gasPhaseIdx)) *
169 Toolbox::template decay<LhsEval>(intQuants.fluidState().invB(gasPhaseIdx));
170 if (FluidSystem::enableDissolvedGas()) { // account for dissolved z in oil phase
171 storage[contiZfracEqIdx] +=
172 Toolbox::template decay<LhsEval>(intQuants.porosity()) *
173 Toolbox::template decay<LhsEval>(intQuants.xVolume()) *
174 Toolbox::template decay<LhsEval>(intQuants.fluidState().Rs()) *
175 Toolbox::template decay<LhsEval>(intQuants.fluidState().saturation(oilPhaseIdx)) *
176 Toolbox::template decay<LhsEval>(intQuants.fluidState().invB(oilPhaseIdx));
177 }
178 // Reg. terms: Preliminary attempt to avoid singular behaviour when solvent is invading a pure water
179 // region. Results seems insensitive to the weighting factor.
180 // TODO: Further investigations ...
181 const Scalar regWghtFactor = 1.0e-6;
182 storage[contiZfracEqIdx] +=
183 regWghtFactor* (1.0 - Toolbox::template decay<LhsEval>(intQuants.zFraction())) +
184 regWghtFactor*Toolbox::template decay<LhsEval>(intQuants.porosity()) *
185 Toolbox::template decay<LhsEval>(intQuants.fluidState().saturation(gasPhaseIdx)) *
186 Toolbox::template decay<LhsEval>(intQuants.fluidState().invB(gasPhaseIdx));
187 storage[contiZfracEqIdx - 1] += regWghtFactor*Toolbox::template decay<LhsEval>(intQuants.zFraction());
188 }
189 else {
190 throw std::runtime_error("Only component conservation in terms of surface volumes is implemented. ");
191 }
192 }
193 }
194
195 static void computeFlux([[maybe_unused]] RateVector& flux,
196 [[maybe_unused]] const ElementContext& elemCtx,
197 [[maybe_unused]] unsigned scvfIdx,
198 [[maybe_unused]] unsigned timeIdx)
199 {
200 if constexpr (enableExtbo) {
201 const auto& extQuants = elemCtx.extensiveQuantities(scvfIdx, timeIdx);
202
203 if constexpr (blackoilConserveSurfaceVolume) {
204 const unsigned inIdx = extQuants.interiorIndex();
205
206 const unsigned upIdxGas = static_cast<unsigned>(extQuants.upstreamIndex(gasPhaseIdx));
207 const auto& upGas = elemCtx.intensiveQuantities(upIdxGas, timeIdx);
208 const auto& fsGas = upGas.fluidState();
209 if (upIdxGas == inIdx) {
210 flux[contiZfracEqIdx] =
211 extQuants.volumeFlux(gasPhaseIdx) *
212 upGas.yVolume() *
213 fsGas.invB(gasPhaseIdx);
214 }
215 else {
216 flux[contiZfracEqIdx] =
217 extQuants.volumeFlux(gasPhaseIdx) *
218 decay<Scalar>(upGas.yVolume()) *
219 decay<Scalar>(fsGas.invB(gasPhaseIdx));
220 }
221 if (FluidSystem::enableDissolvedGas()) { // account for dissolved z in oil phase
222 const unsigned upIdxOil = static_cast<unsigned>(extQuants.upstreamIndex(oilPhaseIdx));
223 const auto& upOil = elemCtx.intensiveQuantities(upIdxOil, timeIdx);
224 const auto& fsOil = upOil.fluidState();
225 if (upIdxOil == inIdx) {
226 flux[contiZfracEqIdx] +=
227 extQuants.volumeFlux(oilPhaseIdx) *
228 upOil.xVolume() *
229 fsOil.Rs() *
230 fsOil.invB(oilPhaseIdx);
231 }
232 else {
233 flux[contiZfracEqIdx] +=
234 extQuants.volumeFlux(oilPhaseIdx) *
235 decay<Scalar>(upOil.xVolume()) *
236 decay<Scalar>(fsOil.Rs()) *
237 decay<Scalar>(fsOil.invB(oilPhaseIdx));
238 }
239 }
240 }
241 else {
242 throw std::runtime_error("Only component conservation in terms of surface volumes is implemented. ");
243 }
244 }
245 }
246
250 static void assignPrimaryVars(PrimaryVariables& priVars,
251 Scalar zFraction)
252 {
253 if constexpr (enableExtbo) {
254 priVars[zFractionIdx] = zFraction;
255 }
256 }
257
261 static void updatePrimaryVars(PrimaryVariables& newPv,
262 const PrimaryVariables& oldPv,
263 const EqVector& delta)
264 {
265 if constexpr (enableExtbo) {
266 // do a plain unchopped Newton update
267 newPv[zFractionIdx] = oldPv[zFractionIdx] - delta[zFractionIdx];
268 }
269 }
270
274 static Scalar computeUpdateError(const PrimaryVariables&,
275 const EqVector&)
276 {
277 // do not consider consider the cange of solvent primary variables for
278 // convergence
279 // TODO: maybe this should be changed
280 return static_cast<Scalar>(0.0);
281 }
282
286 static Scalar computeResidualError(const EqVector& resid)
287 {
288 // do not weight the residual of solvents when it comes to convergence
289 return std::abs(Toolbox::scalarValue(resid[contiZfracEqIdx]));
290 }
291
292 template <class DofEntity>
293 static void serializeEntity(const Model& model, std::ostream& outstream, const DofEntity& dof)
294 {
295 if constexpr (enableExtbo) {
296 const unsigned dofIdx = model.dofMapper().index(dof);
297
298 const PrimaryVariables& priVars = model.solution(/*timeIdx=*/0)[dofIdx];
299 outstream << priVars[zFractionIdx];
300 }
301 }
302
303 template <class DofEntity>
304 static void deserializeEntity(Model& model, std::istream& instream, const DofEntity& dof)
305 {
306 if constexpr (enableExtbo) {
307 const unsigned dofIdx = model.dofMapper().index(dof);
308
309 PrimaryVariables& priVars0 = model.solution(/*timeIdx=*/0)[dofIdx];
310 PrimaryVariables& priVars1 = model.solution(/*timeIdx=*/1)[dofIdx];
311
312 instream >> priVars0[zFractionIdx];
313
314 // set the primary variables for the beginning of the current time step.
315 priVars1 = priVars0[zFractionIdx];
316 }
317 }
318
319 template <typename Value>
320 static Value xVolume(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
321 { return params_.X_[pvtRegionIdx].eval(z, pressure, true); }
322
323 template <typename Value>
324 static Value yVolume(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
325 { return params_.Y_[pvtRegionIdx].eval(z, pressure, true); }
326
327 template <typename Value>
328 static Value pbubRs(unsigned pvtRegionIdx, const Value& z, const Value& rs)
329 { return params_.PBUB_RS_[pvtRegionIdx].eval(z, rs, true); }
330
331 template <typename Value>
332 static Value pbubRv(unsigned pvtRegionIdx, const Value& z, const Value& rv)
333 { return params_.PBUB_RV_[pvtRegionIdx].eval(z, rv, true); }
334
335 template <typename Value>
336 static Value oilViscosity(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
337 { return params_.VISCO_[pvtRegionIdx].eval(z, pressure, true); }
338
339 template <typename Value>
340 static Value gasViscosity(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
341 { return params_.VISCG_[pvtRegionIdx].eval(z, pressure, true); }
342
343 template <typename Value>
344 static Value bo(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
345 { return params_.BO_[pvtRegionIdx].eval(z, pressure, true); }
346
347 template <typename Value>
348 static Value bg(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
349 { return params_.BG_[pvtRegionIdx].eval(z, pressure, true); }
350
351 template <typename Value>
352 static Value rs(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
353 { return params_.RS_[pvtRegionIdx].eval(z, pressure, true); }
354
355 template <typename Value>
356 static Value rv(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
357 { return params_.RV_[pvtRegionIdx].eval(z, pressure, true); }
358
359 static Scalar referenceDensity(unsigned regionIdx)
360 { return params_.zReferenceDensity_[regionIdx]; }
361
362 static Scalar zLim(unsigned regionIdx)
363 { return params_.zLim_[regionIdx]; }
364
365 template <typename Value>
366 static Value oilCmp(unsigned pvtRegionIdx, const Value& z)
367 { return params_.oilCmp_[pvtRegionIdx].eval(z, true); }
368
369 template <typename Value>
370 static Value gasCmp(unsigned pvtRegionIdx, const Value& z)
371 { return params_.gasCmp_[pvtRegionIdx].eval(z, true); }
372
373private:
374 static BlackOilExtboParams<Scalar> params_;
375};
376
377template <class TypeTag, bool enableExtboV>
378BlackOilExtboParams<typename BlackOilExtboModule<TypeTag, enableExtboV>::Scalar>
379BlackOilExtboModule<TypeTag, enableExtboV>::params_;
380
381template <class TypeTag, bool enableExtboV>
383
391template <class TypeTag>
392class BlackOilExtboIntensiveQuantities<TypeTag, /*enableExtboV=*/true>
393{
395
402
404
405 static constexpr int zFractionIdx = Indices::zFractionIdx;
406 static constexpr int oilPhaseIdx = FluidSystem::oilPhaseIdx;
407 static constexpr int gasPhaseIdx = FluidSystem::gasPhaseIdx;
408
409public:
415 void zFractionUpdate_(const ElementContext& elemCtx,
416 unsigned dofIdx,
417 unsigned timeIdx)
418 {
419 zFractionUpdate_(elemCtx.primaryVars(dofIdx, timeIdx), timeIdx);
420 }
421
427 void zFractionUpdate_(const PrimaryVariables& priVars,
428 unsigned timeIdx)
429 {
430 const unsigned pvtRegionIdx = priVars.pvtRegionIndex();
431 const auto& fs = asImp_().fluidState_;
432
433 zFraction_ = priVars.makeEvaluation(zFractionIdx, timeIdx);
434
435 oilViscosity_ = ExtboModule::oilViscosity(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_);
436 gasViscosity_ = ExtboModule::gasViscosity(pvtRegionIdx, fs.pressure(gasPhaseIdx), zFraction_);
437
438 bo_ = ExtboModule::bo(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_);
439 bg_ = ExtboModule::bg(pvtRegionIdx, fs.pressure(gasPhaseIdx), zFraction_);
440
441 bz_ = ExtboModule::bg(pvtRegionIdx, fs.pressure(oilPhaseIdx), Evaluation{0.99});
442
443 if (FluidSystem::enableDissolvedGas()) {
444 rs_ = ExtboModule::rs(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_);
445 }
446 else {
447 rs_ = 0.0;
448 }
449
450 if (FluidSystem::enableVaporizedOil()) {
451 rv_ = ExtboModule::rv(pvtRegionIdx, fs.pressure(gasPhaseIdx), zFraction_);
452 }
453 else {
454 rv_ = 0.0;
455 }
456
457 xVolume_ = ExtboModule::xVolume(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_);
458 yVolume_ = ExtboModule::yVolume(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_);
459
460 Evaluation pbub = fs.pressure(oilPhaseIdx);
461
462 if (priVars.primaryVarsMeaningWater() == PrimaryVariables::WaterMeaning::Sw) {
463 static const Scalar thresholdWaterFilledCell = 1.0 - 1e-6;
464 Scalar sw = priVars.makeEvaluation(Indices::waterSwitchIdx, timeIdx).value();
465 if (sw >= thresholdWaterFilledCell) {
466 rs_ = 0.0; // water only, zero rs_ ...
467 }
468 }
469
470 if (priVars.primaryVarsMeaningGas() == PrimaryVariables::GasMeaning::Rs) {
471 rs_ = priVars.makeEvaluation(Indices::compositionSwitchIdx, timeIdx);
472 const Evaluation zLim = ExtboModule::zLim(pvtRegionIdx);
473 if (zFraction_ > zLim) {
474 pbub = ExtboModule::pbubRs(pvtRegionIdx, zLim, rs_);
475 } else {
476 pbub = ExtboModule::pbubRs(pvtRegionIdx, zFraction_, rs_);
477 }
478 bo_ = ExtboModule::bo(pvtRegionIdx, pbub, zFraction_) +
479 ExtboModule::oilCmp(pvtRegionIdx, zFraction_) * (fs.pressure(oilPhaseIdx) - pbub);
480
481 xVolume_ = ExtboModule::xVolume(pvtRegionIdx, pbub, zFraction_);
482 }
483
484 if (priVars.primaryVarsMeaningGas() == PrimaryVariables::GasMeaning::Rv) {
485 rv_ = priVars.makeEvaluation(Indices::compositionSwitchIdx, timeIdx);
486 const Evaluation rvsat = ExtboModule::rv(pvtRegionIdx, pbub, zFraction_);
487 bg_ = ExtboModule::bg(pvtRegionIdx, pbub, zFraction_) +
488 ExtboModule::gasCmp(pvtRegionIdx, zFraction_) * (rv_ - rvsat);
489
490 yVolume_ = ExtboModule::yVolume(pvtRegionIdx, pbub, zFraction_);
491 }
492 }
493
500 {
501 const auto& iq = asImp_();
502 auto& fs = asImp_().fluidState_;
503
504 const unsigned pvtRegionIdx = iq.pvtRegionIndex();
505 zRefDensity_ = ExtboModule::referenceDensity(pvtRegionIdx);
506
507 fs.setInvB(oilPhaseIdx, 1.0 / bo_);
508 fs.setInvB(gasPhaseIdx, 1.0 / bg_);
509
510 fs.setDensity(oilPhaseIdx,
511 fs.invB(oilPhaseIdx) *
512 (FluidSystem::referenceDensity(oilPhaseIdx, pvtRegionIdx) +
513 (1.0 - xVolume_) * fs.Rs() * FluidSystem::referenceDensity(gasPhaseIdx, pvtRegionIdx) +
514 xVolume_ * fs.Rs() * zRefDensity_));
515 fs.setDensity(gasPhaseIdx,
516 fs.invB(gasPhaseIdx) *
517 (FluidSystem::referenceDensity(gasPhaseIdx, pvtRegionIdx) *
518 (1.0 - yVolume_) + yVolume_* zRefDensity_ +
519 FluidSystem::referenceDensity(oilPhaseIdx, pvtRegionIdx) * fs.Rv()));
520 }
521
522 const Evaluation& zFraction() const
523 { return zFraction_; }
524
525 const Evaluation& xVolume() const
526 { return xVolume_; }
527
528 const Evaluation& yVolume() const
529 { return yVolume_; }
530
531 const Evaluation& oilViscosity() const
532 { return oilViscosity_; }
533
534 const Evaluation& gasViscosity() const
535 { return gasViscosity_; }
536
537 const Evaluation& bo() const
538 { return bo_; }
539
540 const Evaluation& bg() const
541 { return bg_; }
542
543 const Evaluation& rs() const
544 { return rs_; }
545
546 const Evaluation& rv() const
547 { return rv_; }
548
549 const Evaluation zPureInvFormationVolumeFactor() const
550 { return 1.0 / bz_; }
551
552 Scalar zRefDensity() const
553 { return zRefDensity_; }
554
555protected:
556 Implementation& asImp_()
557 { return *static_cast<Implementation*>(this); }
558
559 // Abstract "mass fraction" accounting for the solvent component. The relation between this
560 // quantity and the actual mass fraction of solvent, is implicitly defined from the specific
561 // pvt measurements as provided by kw PVTSOL.
562 Evaluation zFraction_;
563
564 // The solvent component is assumed gas at surface conditions
565 Evaluation xVolume_; // Solvent volume fraction of Rs
566 Evaluation yVolume_; // Solvent volume fraction of Sg/Bg
567
568 // Standard black oil parameters modified for presence of solvent
569 Evaluation oilViscosity_;
570 Evaluation gasViscosity_;
571 Evaluation bo_;
572 Evaluation bg_;
573 Evaluation rs_;
574 Evaluation rv_;
575
576 // Properties of pure solvent
577 Evaluation bz_;
579};
580
581template <class TypeTag>
583{
587
588public:
590 {}
591
592 void zFractionUpdate_(const ElementContext&,
593 unsigned,
594 unsigned)
595 {}
596
597 const Evaluation& xVolume() const
598 { throw std::runtime_error("xVolume() called but extbo is disabled"); }
599
600 const Evaluation& yVolume() const
601 { throw std::runtime_error("yVolume() called but extbo is disabled"); }
602
603 const Evaluation& oilViscosity() const
604 { throw std::runtime_error("oilViscosity() called but extbo is disabled"); }
605
606 const Evaluation& gasViscosity() const
607 { throw std::runtime_error("gasViscosity() called but extbo is disabled"); }
608
609 const Evaluation& rs() const
610 { throw std::runtime_error("rs() called but extbo is disabled"); }
611
612 const Evaluation& rv() const
613 { throw std::runtime_error("rv() called but extbo is disabled"); }
614
615 const Evaluation& zPureInvFormationVolumeFactor() const
616 { throw std::runtime_error("zPureInvFormationVolumeFactor() called but extbo is disabled"); }
617
618 const Evaluation& zFraction() const
619 { throw std::runtime_error("zFraction() called but extbo is disabled"); }
620
621 const Evaluation& zInverseFormationVolumeFactor() const
622 { throw std::runtime_error("zInverseFormationVolumeFactor() called but extbo is disabled"); }
623
624 Scalar zRefDensity() const
625 { throw std::runtime_error("zRefDensity() called but extbo is disabled"); }
626};
627
635template <class TypeTag, bool enableExtboV = getPropValue<TypeTag, Properties::EnableExtbo>()>
637{
639
640 Implementation& asImp_()
641 { return *static_cast<Implementation*>(this); }
642};
643
644template <class TypeTag>
646{
647};
648
649} // namespace Opm
650
651#endif
Defines a type tags and some fundamental properties all models.
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:637
const Evaluation & xVolume() const
Definition: blackoilextbomodules.hh:597
const Evaluation & rs() const
Definition: blackoilextbomodules.hh:609
const Evaluation & zInverseFormationVolumeFactor() const
Definition: blackoilextbomodules.hh:621
const Evaluation & zPureInvFormationVolumeFactor() const
Definition: blackoilextbomodules.hh:615
const Evaluation & oilViscosity() const
Definition: blackoilextbomodules.hh:603
void zFractionUpdate_(const ElementContext &, unsigned, unsigned)
Definition: blackoilextbomodules.hh:592
const Evaluation & zFraction() const
Definition: blackoilextbomodules.hh:618
void zPvtUpdate_()
Definition: blackoilextbomodules.hh:589
const Evaluation & rv() const
Definition: blackoilextbomodules.hh:612
const Evaluation & gasViscosity() const
Definition: blackoilextbomodules.hh:606
const Evaluation & yVolume() const
Definition: blackoilextbomodules.hh:600
Scalar zRefDensity() const
Definition: blackoilextbomodules.hh:624
void zFractionUpdate_(const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx)
Compute extended pvt properties from table lookups.
Definition: blackoilextbomodules.hh:415
Evaluation xVolume_
Definition: blackoilextbomodules.hh:565
Evaluation bo_
Definition: blackoilextbomodules.hh:571
void zPvtUpdate_()
Re-compute face densities to account for zFraction dependency.
Definition: blackoilextbomodules.hh:499
const Evaluation & oilViscosity() const
Definition: blackoilextbomodules.hh:531
const Evaluation & xVolume() const
Definition: blackoilextbomodules.hh:525
const Evaluation & zFraction() const
Definition: blackoilextbomodules.hh:522
Scalar zRefDensity_
Definition: blackoilextbomodules.hh:578
void zFractionUpdate_(const PrimaryVariables &priVars, unsigned timeIdx)
Compute extended pvt properties from table lookups.
Definition: blackoilextbomodules.hh:427
const Evaluation & gasViscosity() const
Definition: blackoilextbomodules.hh:534
const Evaluation & yVolume() const
Definition: blackoilextbomodules.hh:528
Evaluation oilViscosity_
Definition: blackoilextbomodules.hh:569
const Evaluation & rv() const
Definition: blackoilextbomodules.hh:546
Evaluation bg_
Definition: blackoilextbomodules.hh:572
Evaluation bz_
Definition: blackoilextbomodules.hh:577
const Evaluation & bg() const
Definition: blackoilextbomodules.hh:540
Evaluation yVolume_
Definition: blackoilextbomodules.hh:566
Evaluation gasViscosity_
Definition: blackoilextbomodules.hh:570
Scalar zRefDensity() const
Definition: blackoilextbomodules.hh:552
const Evaluation & rs() const
Definition: blackoilextbomodules.hh:543
const Evaluation zPureInvFormationVolumeFactor() const
Definition: blackoilextbomodules.hh:549
Evaluation rs_
Definition: blackoilextbomodules.hh:573
const Evaluation & bo() const
Definition: blackoilextbomodules.hh:537
Implementation & asImp_()
Definition: blackoilextbomodules.hh:556
Evaluation rv_
Definition: blackoilextbomodules.hh:574
Evaluation zFraction_
Definition: blackoilextbomodules.hh:562
Provides the volumetric quantities required for the equations needed by the solvents extension of the...
Definition: blackoilextbomodules.hh:382
Contains the high level supplements required to extend the black oil model.
Definition: blackoilextbomodules.hh:64
static bool primaryVarApplies(unsigned pvIdx)
Definition: blackoilextbomodules.hh:107
static Scalar zLim(unsigned regionIdx)
Definition: blackoilextbomodules.hh:362
static Scalar computeResidualError(const EqVector &resid)
Return how much a residual is considered an error.
Definition: blackoilextbomodules.hh:286
static Value yVolume(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:324
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:261
static Value gasViscosity(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:340
static std::string eqName(unsigned eqIdx)
Definition: blackoilextbomodules.hh:142
static bool eqApplies(unsigned eqIdx)
Definition: blackoilextbomodules.hh:132
static Value pbubRv(unsigned pvtRegionIdx, const Value &z, const Value &rv)
Definition: blackoilextbomodules.hh:332
static Scalar primaryVarWeight(unsigned pvIdx)
Definition: blackoilextbomodules.hh:124
static Value rs(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:352
static void registerOutputModules(Model &, Simulator &)
Register all solvent specific VTK and ECL output modules.
Definition: blackoilextbomodules.hh:103
static Scalar computeUpdateError(const PrimaryVariables &, const EqVector &)
Return how much a Newton-Raphson update is considered an error.
Definition: blackoilextbomodules.hh:274
static Value xVolume(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:320
static void serializeEntity(const Model &model, std::ostream &outstream, const DofEntity &dof)
Definition: blackoilextbomodules.hh:293
static void computeFlux(RateVector &flux, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
Definition: blackoilextbomodules.hh:195
static void registerParameters()
Register all run-time parameters for the black-oil solvent module.
Definition: blackoilextbomodules.hh:97
static void deserializeEntity(Model &model, std::istream &instream, const DofEntity &dof)
Definition: blackoilextbomodules.hh:304
static std::string primaryVarName(unsigned pvIdx)
Definition: blackoilextbomodules.hh:117
static Value rv(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:356
static void setParams(BlackOilExtboParams< Scalar > &&params)
Set parameters.
Definition: blackoilextbomodules.hh:89
static Value pbubRs(unsigned pvtRegionIdx, const Value &z, const Value &rs)
Definition: blackoilextbomodules.hh:328
static Value oilCmp(unsigned pvtRegionIdx, const Value &z)
Definition: blackoilextbomodules.hh:366
static Scalar referenceDensity(unsigned regionIdx)
Definition: blackoilextbomodules.hh:359
static OPM_HOST_DEVICE void addStorage(StorageType &storage, const IntensiveQuantities &intQuants)
Definition: blackoilextbomodules.hh:158
static Value bg(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:348
static Value oilViscosity(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:336
static void assignPrimaryVars(PrimaryVariables &priVars, Scalar zFraction)
Assign the solvent specific primary variables to a PrimaryVariables object.
Definition: blackoilextbomodules.hh:250
static Scalar eqWeight(unsigned eqIdx)
Definition: blackoilextbomodules.hh:149
static Value bo(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:344
static Value gasCmp(unsigned pvtRegionIdx, const Value &z)
Definition: blackoilextbomodules.hh:370
Declare the properties used by the infrastructure code of the finite volume discretizations.
Definition: blackoilbioeffectsmodules.hh:45
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
Struct holding the parameters for the BlackoilExtboModule class.
Definition: blackoilextboparams.hpp:47