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