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
39
41
43
44//#include <opm/models/io/vtkBlackOilExtboModule.hh> //TODO: Missing ...
45
46#include <cassert>
47#include <cmath>
48#include <istream>
49#include <ostream>
50#include <stdexcept>
51#include <string>
52
53namespace Opm {
54
60template <class TypeTag, bool enableExtboV = getPropValue<TypeTag, Properties::EnableExtbo>()>
62{
75
76 using Toolbox = MathToolbox<Evaluation>;
77
78 using TabulatedFunction = typename BlackOilExtboParams<Scalar>::TabulatedFunction;
79 using Tabulated2DFunction = typename BlackOilExtboParams<Scalar>::Tabulated2DFunction;
80
81 static constexpr unsigned zFractionIdx = Indices::zFractionIdx;
82 static constexpr unsigned contiZfracEqIdx = Indices::contiZfracEqIdx;
83 static constexpr unsigned enableExtbo = enableExtboV;
84 static constexpr unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
85 static constexpr unsigned numPhases = FluidSystem::numPhases;
86 static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx;
87 static constexpr unsigned oilPhaseIdx = FluidSystem::oilPhaseIdx;
88 static constexpr unsigned waterPhaseIdx = FluidSystem::waterPhaseIdx;
89 static constexpr bool blackoilConserveSurfaceVolume = getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>();
90
91public:
94 {
95 params_ = params;
96 }
97
101 static void registerParameters()
102 {}
103
107 static void registerOutputModules(Model&,
108 Simulator&)
109 {}
110
111 static bool primaryVarApplies(unsigned pvIdx)
112 {
113 if constexpr (enableExtbo) {
114 return pvIdx == zFractionIdx;
115 }
116 else {
117 return false;
118 }
119 }
120
121 static std::string primaryVarName([[maybe_unused]] unsigned pvIdx)
122 {
123 assert(primaryVarApplies(pvIdx));
124
125 return "z_fraction";
126 }
127
128 static Scalar primaryVarWeight([[maybe_unused]] unsigned pvIdx)
129 {
130 assert(primaryVarApplies(pvIdx));
131
132 // TODO: it may be beneficial to chose this differently.
133 return static_cast<Scalar>(1.0);
134 }
135
136 static bool eqApplies(unsigned eqIdx)
137 {
138 if constexpr (enableExtbo) {
139 return eqIdx == contiZfracEqIdx;
140 }
141 else {
142 return false;
143 }
144 }
145
146 static std::string eqName([[maybe_unused]] unsigned eqIdx)
147 {
148 assert(eqApplies(eqIdx));
149
150 return "conti^solvent";
151 }
152
153 static Scalar eqWeight([[maybe_unused]] unsigned eqIdx)
154 {
155 assert(eqApplies(eqIdx));
156
157 // TODO: it may be beneficial to chose this differently.
158 return static_cast<Scalar>(1.0);
159 }
160
161 template <class LhsEval>
162 static void addStorage(Dune::FieldVector<LhsEval, numEq>& storage,
163 const IntensiveQuantities& intQuants)
164 {
165 if constexpr (enableExtbo) {
166 if constexpr (blackoilConserveSurfaceVolume) {
167 storage[contiZfracEqIdx] =
168 Toolbox::template decay<LhsEval>(intQuants.porosity()) *
169 Toolbox::template decay<LhsEval>(intQuants.yVolume()) *
170 Toolbox::template decay<LhsEval>(intQuants.fluidState().saturation(gasPhaseIdx)) *
171 Toolbox::template decay<LhsEval>(intQuants.fluidState().invB(gasPhaseIdx));
172 if (FluidSystem::enableDissolvedGas()) { // account for dissolved z in oil phase
173 storage[contiZfracEqIdx] +=
174 Toolbox::template decay<LhsEval>(intQuants.porosity()) *
175 Toolbox::template decay<LhsEval>(intQuants.xVolume()) *
176 Toolbox::template decay<LhsEval>(intQuants.fluidState().Rs()) *
177 Toolbox::template decay<LhsEval>(intQuants.fluidState().saturation(oilPhaseIdx)) *
178 Toolbox::template decay<LhsEval>(intQuants.fluidState().invB(oilPhaseIdx));
179 }
180 // Reg. terms: Preliminary attempt to avoid singular behaviour when solvent is invading a pure water
181 // region. Results seems insensitive to the weighting factor.
182 // TODO: Further investigations ...
183 const Scalar regWghtFactor = 1.0e-6;
184 storage[contiZfracEqIdx] +=
185 regWghtFactor* (1.0 - Toolbox::template decay<LhsEval>(intQuants.zFraction())) +
186 regWghtFactor*Toolbox::template decay<LhsEval>(intQuants.porosity()) *
187 Toolbox::template decay<LhsEval>(intQuants.fluidState().saturation(gasPhaseIdx)) *
188 Toolbox::template decay<LhsEval>(intQuants.fluidState().invB(gasPhaseIdx));
189 storage[contiZfracEqIdx - 1] += regWghtFactor*Toolbox::template decay<LhsEval>(intQuants.zFraction());
190 }
191 else {
192 throw std::runtime_error("Only component conservation in terms of surface volumes is implemented. ");
193 }
194 }
195 }
196
197 static void computeFlux([[maybe_unused]] RateVector& flux,
198 [[maybe_unused]] const ElementContext& elemCtx,
199 [[maybe_unused]] unsigned scvfIdx,
200 [[maybe_unused]] unsigned timeIdx)
201 {
202 if constexpr (enableExtbo) {
203 const auto& extQuants = elemCtx.extensiveQuantities(scvfIdx, timeIdx);
204
205 if constexpr (blackoilConserveSurfaceVolume) {
206 const unsigned inIdx = extQuants.interiorIndex();
207
208 const unsigned upIdxGas = static_cast<unsigned>(extQuants.upstreamIndex(gasPhaseIdx));
209 const auto& upGas = elemCtx.intensiveQuantities(upIdxGas, timeIdx);
210 const auto& fsGas = upGas.fluidState();
211 if (upIdxGas == inIdx) {
212 flux[contiZfracEqIdx] =
213 extQuants.volumeFlux(gasPhaseIdx) *
214 upGas.yVolume() *
215 fsGas.invB(gasPhaseIdx);
216 }
217 else {
218 flux[contiZfracEqIdx] =
219 extQuants.volumeFlux(gasPhaseIdx) *
220 decay<Scalar>(upGas.yVolume()) *
221 decay<Scalar>(fsGas.invB(gasPhaseIdx));
222 }
223 if (FluidSystem::enableDissolvedGas()) { // account for dissolved z in oil phase
224 const unsigned upIdxOil = static_cast<unsigned>(extQuants.upstreamIndex(oilPhaseIdx));
225 const auto& upOil = elemCtx.intensiveQuantities(upIdxOil, timeIdx);
226 const auto& fsOil = upOil.fluidState();
227 if (upIdxOil == inIdx) {
228 flux[contiZfracEqIdx] +=
229 extQuants.volumeFlux(oilPhaseIdx) *
230 upOil.xVolume() *
231 fsOil.Rs() *
232 fsOil.invB(oilPhaseIdx);
233 }
234 else {
235 flux[contiZfracEqIdx] +=
236 extQuants.volumeFlux(oilPhaseIdx) *
237 decay<Scalar>(upOil.xVolume()) *
238 decay<Scalar>(fsOil.Rs()) *
239 decay<Scalar>(fsOil.invB(oilPhaseIdx));
240 }
241 }
242 }
243 else {
244 throw std::runtime_error("Only component conservation in terms of surface volumes is implemented. ");
245 }
246 }
247 }
248
252 static void assignPrimaryVars(PrimaryVariables& priVars,
253 Scalar zFraction)
254 {
255 if constexpr (enableExtbo) {
256 priVars[zFractionIdx] = zFraction;
257 }
258 }
259
263 static void updatePrimaryVars(PrimaryVariables& newPv,
264 const PrimaryVariables& oldPv,
265 const EqVector& delta)
266 {
267 if constexpr (enableExtbo) {
268 // do a plain unchopped Newton update
269 newPv[zFractionIdx] = oldPv[zFractionIdx] - delta[zFractionIdx];
270 }
271 }
272
276 static Scalar computeUpdateError(const PrimaryVariables&,
277 const EqVector&)
278 {
279 // do not consider consider the cange of solvent primary variables for
280 // convergence
281 // TODO: maybe this should be changed
282 return static_cast<Scalar>(0.0);
283 }
284
288 static Scalar computeResidualError(const EqVector& resid)
289 {
290 // do not weight the residual of solvents when it comes to convergence
291 return std::abs(Toolbox::scalarValue(resid[contiZfracEqIdx]));
292 }
293
294 template <class DofEntity>
295 static void serializeEntity(const Model& model, std::ostream& outstream, const DofEntity& dof)
296 {
297 if constexpr (enableExtbo) {
298 const unsigned dofIdx = model.dofMapper().index(dof);
299
300 const PrimaryVariables& priVars = model.solution(/*timeIdx=*/0)[dofIdx];
301 outstream << priVars[zFractionIdx];
302 }
303 }
304
305 template <class DofEntity>
306 static void deserializeEntity(Model& model, std::istream& instream, const DofEntity& dof)
307 {
308 if constexpr (enableExtbo) {
309 const unsigned dofIdx = model.dofMapper().index(dof);
310
311 PrimaryVariables& priVars0 = model.solution(/*timeIdx=*/0)[dofIdx];
312 PrimaryVariables& priVars1 = model.solution(/*timeIdx=*/1)[dofIdx];
313
314 instream >> priVars0[zFractionIdx];
315
316 // set the primary variables for the beginning of the current time step.
317 priVars1 = priVars0[zFractionIdx];
318 }
319 }
320
321 template <typename Value>
322 static Value xVolume(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
323 { return params_.X_[pvtRegionIdx].eval(z, pressure, true); }
324
325 template <typename Value>
326 static Value yVolume(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
327 { return params_.Y_[pvtRegionIdx].eval(z, pressure, true); }
328
329 template <typename Value>
330 static Value pbubRs(unsigned pvtRegionIdx, const Value& z, const Value& rs)
331 { return params_.PBUB_RS_[pvtRegionIdx].eval(z, rs, true); }
332
333 template <typename Value>
334 static Value pbubRv(unsigned pvtRegionIdx, const Value& z, const Value& rv)
335 { return params_.PBUB_RV_[pvtRegionIdx].eval(z, rv, true); }
336
337 template <typename Value>
338 static Value oilViscosity(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
339 { return params_.VISCO_[pvtRegionIdx].eval(z, pressure, true); }
340
341 template <typename Value>
342 static Value gasViscosity(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
343 { return params_.VISCG_[pvtRegionIdx].eval(z, pressure, true); }
344
345 template <typename Value>
346 static Value bo(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
347 { return params_.BO_[pvtRegionIdx].eval(z, pressure, true); }
348
349 template <typename Value>
350 static Value bg(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
351 { return params_.BG_[pvtRegionIdx].eval(z, pressure, true); }
352
353 template <typename Value>
354 static Value rs(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
355 { return params_.RS_[pvtRegionIdx].eval(z, pressure, true); }
356
357 template <typename Value>
358 static Value rv(unsigned pvtRegionIdx, const Value& pressure, const Value& z)
359 { return params_.RV_[pvtRegionIdx].eval(z, pressure, true); }
360
361 static Scalar referenceDensity(unsigned regionIdx)
362 { return params_.zReferenceDensity_[regionIdx]; }
363
364 static Scalar zLim(unsigned regionIdx)
365 { return params_.zLim_[regionIdx]; }
366
367 template <typename Value>
368 static Value oilCmp(unsigned pvtRegionIdx, const Value& z)
369 { return params_.oilCmp_[pvtRegionIdx].eval(z, true); }
370
371 template <typename Value>
372 static Value gasCmp(unsigned pvtRegionIdx, const Value& z)
373 { return params_.gasCmp_[pvtRegionIdx].eval(z, true); }
374
375private:
376 static BlackOilExtboParams<Scalar> params_;
377};
378
379template <class TypeTag, bool enableExtboV>
380BlackOilExtboParams<typename BlackOilExtboModule<TypeTag, enableExtboV>::Scalar>
381BlackOilExtboModule<TypeTag, enableExtboV>::params_;
382
383template <class TypeTag, bool enableExtboV>
385
393template <class TypeTag>
394class BlackOilExtboIntensiveQuantities<TypeTag, /*enableExtboV=*/true>
395{
397
405
407
408 enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
409 static constexpr int zFractionIdx = Indices::zFractionIdx;
410 static constexpr int oilPhaseIdx = FluidSystem::oilPhaseIdx;
411 static constexpr int gasPhaseIdx = FluidSystem::gasPhaseIdx;
412 static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx;
413 static constexpr double cutOff = 1e-12;
414
415public:
421 void zFractionUpdate_(const ElementContext& elemCtx,
422 unsigned dofIdx,
423 unsigned timeIdx)
424 {
425 const PrimaryVariables& priVars = elemCtx.primaryVars(dofIdx, timeIdx);
426 const unsigned pvtRegionIdx = priVars.pvtRegionIndex();
427 const auto& fs = asImp_().fluidState_;
428
429 zFraction_ = priVars.makeEvaluation(zFractionIdx, timeIdx);
430
431 oilViscosity_ = ExtboModule::oilViscosity(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_);
432 gasViscosity_ = ExtboModule::gasViscosity(pvtRegionIdx, fs.pressure(gasPhaseIdx), zFraction_);
433
434 bo_ = ExtboModule::bo(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_);
435 bg_ = ExtboModule::bg(pvtRegionIdx, fs.pressure(gasPhaseIdx), zFraction_);
436
437 bz_ = ExtboModule::bg(pvtRegionIdx, fs.pressure(oilPhaseIdx), Evaluation{0.99});
438
439 if (FluidSystem::enableDissolvedGas()) {
440 rs_ = ExtboModule::rs(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_);
441 }
442 else {
443 rs_ = 0.0;
444 }
445
446 if (FluidSystem::enableVaporizedOil()) {
447 rv_ = ExtboModule::rv(pvtRegionIdx, fs.pressure(gasPhaseIdx), zFraction_);
448 }
449 else {
450 rv_ = 0.0;
451 }
452
453 xVolume_ = ExtboModule::xVolume(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_);
454 yVolume_ = ExtboModule::yVolume(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_);
455
456 Evaluation pbub = fs.pressure(oilPhaseIdx);
457
458 if (priVars.primaryVarsMeaningWater() == PrimaryVariables::WaterMeaning::Sw) {
459 static const Scalar thresholdWaterFilledCell = 1.0 - 1e-6;
460 Scalar sw = priVars.makeEvaluation(Indices::waterSwitchIdx, timeIdx).value();
461 if (sw >= thresholdWaterFilledCell) {
462 rs_ = 0.0; // water only, zero rs_ ...
463 }
464 }
465
466 if (priVars.primaryVarsMeaningGas() == PrimaryVariables::GasMeaning::Rs) {
467 rs_ = priVars.makeEvaluation(Indices::compositionSwitchIdx, timeIdx);
468 const Evaluation zLim = ExtboModule::zLim(pvtRegionIdx);
469 if (zFraction_ > zLim) {
470 pbub = ExtboModule::pbubRs(pvtRegionIdx, zLim, rs_);
471 } else {
472 pbub = ExtboModule::pbubRs(pvtRegionIdx, zFraction_, rs_);
473 }
474 bo_ = ExtboModule::bo(pvtRegionIdx, pbub, zFraction_) +
475 ExtboModule::oilCmp(pvtRegionIdx, zFraction_) * (fs.pressure(oilPhaseIdx) - pbub);
476
477 xVolume_ = ExtboModule::xVolume(pvtRegionIdx, pbub, zFraction_);
478 }
479
480 if (priVars.primaryVarsMeaningGas() == PrimaryVariables::GasMeaning::Rv) {
481 rv_ = priVars.makeEvaluation(Indices::compositionSwitchIdx, timeIdx);
482 const Evaluation rvsat = ExtboModule::rv(pvtRegionIdx, pbub, zFraction_);
483 bg_ = ExtboModule::bg(pvtRegionIdx, pbub, zFraction_) +
484 ExtboModule::gasCmp(pvtRegionIdx, zFraction_) * (rv_ - rvsat);
485
486 yVolume_ = ExtboModule::yVolume(pvtRegionIdx, pbub, zFraction_);
487 }
488 }
489
496 {
497 const auto& iq = asImp_();
498 auto& fs = asImp_().fluidState_;
499
500 const unsigned pvtRegionIdx = iq.pvtRegionIndex();
501 zRefDensity_ = ExtboModule::referenceDensity(pvtRegionIdx);
502
503 fs.setInvB(oilPhaseIdx, 1.0 / bo_);
504 fs.setInvB(gasPhaseIdx, 1.0 / bg_);
505
506 fs.setDensity(oilPhaseIdx,
507 fs.invB(oilPhaseIdx) *
508 (FluidSystem::referenceDensity(oilPhaseIdx, pvtRegionIdx) +
509 (1.0 - xVolume_) * fs.Rs() * FluidSystem::referenceDensity(gasPhaseIdx, pvtRegionIdx) +
510 xVolume_ * fs.Rs() * zRefDensity_));
511 fs.setDensity(gasPhaseIdx,
512 fs.invB(gasPhaseIdx) *
513 (FluidSystem::referenceDensity(gasPhaseIdx, pvtRegionIdx) *
514 (1.0 - yVolume_) + yVolume_* zRefDensity_ +
515 FluidSystem::referenceDensity(oilPhaseIdx, pvtRegionIdx) * fs.Rv()));
516 }
517
518 const Evaluation& zFraction() const
519 { return zFraction_; }
520
521 const Evaluation& xVolume() const
522 { return xVolume_; }
523
524 const Evaluation& yVolume() const
525 { return yVolume_; }
526
527 const Evaluation& oilViscosity() const
528 { return oilViscosity_; }
529
530 const Evaluation& gasViscosity() const
531 { return gasViscosity_; }
532
533 const Evaluation& bo() const
534 { return bo_; }
535
536 const Evaluation& bg() const
537 { return bg_; }
538
539 const Evaluation& rs() const
540 { return rs_; }
541
542 const Evaluation& rv() const
543 { return rv_; }
544
545 const Evaluation zPureInvFormationVolumeFactor() const
546 { return 1.0 / bz_; }
547
548 Scalar zRefDensity() const
549 { return zRefDensity_; }
550
551protected:
552 Implementation& asImp_()
553 { return *static_cast<Implementation*>(this); }
554
555 // Abstract "mass fraction" accounting for the solvent component. The relation between this
556 // quantity and the actual mass fraction of solvent, is implicitly defined from the specific
557 // pvt measurements as provided by kw PVTSOL.
558 Evaluation zFraction_;
559
560 // The solvent component is assumed gas at surface conditions
561 Evaluation xVolume_; // Solvent volume fraction of Rs
562 Evaluation yVolume_; // Solvent volume fraction of Sg/Bg
563
564 // Standard black oil parameters modified for presence of solvent
565 Evaluation oilViscosity_;
566 Evaluation gasViscosity_;
567 Evaluation bo_;
568 Evaluation bg_;
569 Evaluation rs_;
570 Evaluation rv_;
571
572 // Properties of pure solvent
573 Evaluation bz_;
575};
576
577template <class TypeTag>
579{
583
584public:
586 {}
587
588 void zFractionUpdate_(const ElementContext&,
589 unsigned,
590 unsigned)
591 {}
592
593 const Evaluation& xVolume() const
594 { throw std::runtime_error("xVolume() called but extbo is disabled"); }
595
596 const Evaluation& yVolume() const
597 { throw std::runtime_error("yVolume() called but extbo is disabled"); }
598
599 const Evaluation& oilViscosity() const
600 { throw std::runtime_error("oilViscosity() called but extbo is disabled"); }
601
602 const Evaluation& gasViscosity() const
603 { throw std::runtime_error("gasViscosity() called but extbo is disabled"); }
604
605 const Evaluation& rs() const
606 { throw std::runtime_error("rs() called but extbo is disabled"); }
607
608 const Evaluation& rv() const
609 { throw std::runtime_error("rv() called but extbo is disabled"); }
610
611 const Evaluation& zPureInvFormationVolumeFactor() const
612 { throw std::runtime_error("zPureInvFormationVolumeFactor() called but extbo is disabled"); }
613
614 const Evaluation& zFraction() const
615 { throw std::runtime_error("zFraction() called but extbo is disabled"); }
616
617 const Evaluation& zInverseFormationVolumeFactor() const
618 { throw std::runtime_error("zInverseFormationVolumeFactor() called but extbo is disabled"); }
619
620 Scalar zRefDensity() const
621 { throw std::runtime_error("zRefDensity() called but extbo is disabled"); }
622};
623
631template <class TypeTag, bool enableExtboV = getPropValue<TypeTag, Properties::EnableExtbo>()>
633{
635
643
644 using Toolbox = MathToolbox<Evaluation>;
645
646 static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx;
647 static constexpr int dimWorld = GridView::dimensionworld;
648
649 using DimVector = Dune::FieldVector<Scalar, dimWorld>;
650 using DimEvalVector = Dune::FieldVector<Evaluation, dimWorld>;
651
652 Implementation& asImp_()
653 { return *static_cast<Implementation*>(this); }
654};
655
656template <class TypeTag>
658{
661};
662
663} // namespace Opm
664
665#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:633
const Evaluation & xVolume() const
Definition: blackoilextbomodules.hh:593
const Evaluation & rs() const
Definition: blackoilextbomodules.hh:605
const Evaluation & zInverseFormationVolumeFactor() const
Definition: blackoilextbomodules.hh:617
const Evaluation & zPureInvFormationVolumeFactor() const
Definition: blackoilextbomodules.hh:611
const Evaluation & oilViscosity() const
Definition: blackoilextbomodules.hh:599
void zFractionUpdate_(const ElementContext &, unsigned, unsigned)
Definition: blackoilextbomodules.hh:588
const Evaluation & zFraction() const
Definition: blackoilextbomodules.hh:614
void zPvtUpdate_()
Definition: blackoilextbomodules.hh:585
const Evaluation & rv() const
Definition: blackoilextbomodules.hh:608
const Evaluation & gasViscosity() const
Definition: blackoilextbomodules.hh:602
const Evaluation & yVolume() const
Definition: blackoilextbomodules.hh:596
Scalar zRefDensity() const
Definition: blackoilextbomodules.hh:620
void zFractionUpdate_(const ElementContext &elemCtx, unsigned dofIdx, unsigned timeIdx)
Compute extended pvt properties from table lookups.
Definition: blackoilextbomodules.hh:421
Evaluation xVolume_
Definition: blackoilextbomodules.hh:561
Evaluation bo_
Definition: blackoilextbomodules.hh:567
void zPvtUpdate_()
Re-compute face densities to account for zFraction dependency.
Definition: blackoilextbomodules.hh:495
const Evaluation & oilViscosity() const
Definition: blackoilextbomodules.hh:527
const Evaluation & xVolume() const
Definition: blackoilextbomodules.hh:521
const Evaluation & zFraction() const
Definition: blackoilextbomodules.hh:518
Scalar zRefDensity_
Definition: blackoilextbomodules.hh:574
const Evaluation & gasViscosity() const
Definition: blackoilextbomodules.hh:530
const Evaluation & yVolume() const
Definition: blackoilextbomodules.hh:524
Evaluation oilViscosity_
Definition: blackoilextbomodules.hh:565
const Evaluation & rv() const
Definition: blackoilextbomodules.hh:542
Evaluation bg_
Definition: blackoilextbomodules.hh:568
Evaluation bz_
Definition: blackoilextbomodules.hh:573
const Evaluation & bg() const
Definition: blackoilextbomodules.hh:536
Evaluation yVolume_
Definition: blackoilextbomodules.hh:562
Evaluation gasViscosity_
Definition: blackoilextbomodules.hh:566
Scalar zRefDensity() const
Definition: blackoilextbomodules.hh:548
const Evaluation & rs() const
Definition: blackoilextbomodules.hh:539
const Evaluation zPureInvFormationVolumeFactor() const
Definition: blackoilextbomodules.hh:545
Evaluation rs_
Definition: blackoilextbomodules.hh:569
const Evaluation & bo() const
Definition: blackoilextbomodules.hh:533
Implementation & asImp_()
Definition: blackoilextbomodules.hh:552
Evaluation rv_
Definition: blackoilextbomodules.hh:570
Evaluation zFraction_
Definition: blackoilextbomodules.hh:558
Provides the volumetric quantities required for the equations needed by the solvents extension of the...
Definition: blackoilextbomodules.hh:384
Contains the high level supplements required to extend the black oil model.
Definition: blackoilextbomodules.hh:62
static void addStorage(Dune::FieldVector< LhsEval, numEq > &storage, const IntensiveQuantities &intQuants)
Definition: blackoilextbomodules.hh:162
static bool primaryVarApplies(unsigned pvIdx)
Definition: blackoilextbomodules.hh:111
static Scalar zLim(unsigned regionIdx)
Definition: blackoilextbomodules.hh:364
static Scalar computeResidualError(const EqVector &resid)
Return how much a residual is considered an error.
Definition: blackoilextbomodules.hh:288
static Value yVolume(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:326
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:263
static Value gasViscosity(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:342
static std::string eqName(unsigned eqIdx)
Definition: blackoilextbomodules.hh:146
static bool eqApplies(unsigned eqIdx)
Definition: blackoilextbomodules.hh:136
static Value pbubRv(unsigned pvtRegionIdx, const Value &z, const Value &rv)
Definition: blackoilextbomodules.hh:334
static Scalar primaryVarWeight(unsigned pvIdx)
Definition: blackoilextbomodules.hh:128
static Value rs(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:354
static void registerOutputModules(Model &, Simulator &)
Register all solvent specific VTK and ECL output modules.
Definition: blackoilextbomodules.hh:107
static Scalar computeUpdateError(const PrimaryVariables &, const EqVector &)
Return how much a Newton-Raphson update is considered an error.
Definition: blackoilextbomodules.hh:276
static Value xVolume(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:322
static void serializeEntity(const Model &model, std::ostream &outstream, const DofEntity &dof)
Definition: blackoilextbomodules.hh:295
static void computeFlux(RateVector &flux, const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
Definition: blackoilextbomodules.hh:197
static void registerParameters()
Register all run-time parameters for the black-oil solvent module.
Definition: blackoilextbomodules.hh:101
static void deserializeEntity(Model &model, std::istream &instream, const DofEntity &dof)
Definition: blackoilextbomodules.hh:306
static std::string primaryVarName(unsigned pvIdx)
Definition: blackoilextbomodules.hh:121
static Value rv(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:358
static void setParams(BlackOilExtboParams< Scalar > &&params)
Set parameters.
Definition: blackoilextbomodules.hh:93
static Value pbubRs(unsigned pvtRegionIdx, const Value &z, const Value &rs)
Definition: blackoilextbomodules.hh:330
static Value oilCmp(unsigned pvtRegionIdx, const Value &z)
Definition: blackoilextbomodules.hh:368
static Scalar referenceDensity(unsigned regionIdx)
Definition: blackoilextbomodules.hh:361
static Value bg(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:350
static Value oilViscosity(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:338
static void assignPrimaryVars(PrimaryVariables &priVars, Scalar zFraction)
Assign the solvent specific primary variables to a PrimaryVariables object.
Definition: blackoilextbomodules.hh:252
static Scalar eqWeight(unsigned eqIdx)
Definition: blackoilextbomodules.hh:153
static Value bo(unsigned pvtRegionIdx, const Value &pressure, const Value &z)
Definition: blackoilextbomodules.hh:346
static Value gasCmp(unsigned pvtRegionIdx, const Value &z)
Definition: blackoilextbomodules.hh:372
Declare the properties used by the infrastructure code of the finite volume discretizations.
Definition: blackoilboundaryratevector.hh:39
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:49
UniformXTabulated2DFunction< Scalar > Tabulated2DFunction
Definition: blackoilextboparams.hpp:51
Tabulated1DFunction< Scalar > TabulatedFunction
Definition: blackoilextboparams.hpp:50