29#ifndef OPM_EQUILIBRATION_HELPERS_HPP
30#define OPM_EQUILIBRATION_HELPERS_HPP
32#include <opm/material/common/Tabulated1DFunction.hpp>
34#include <opm/input/eclipse/EclipseState/InitConfig/Equil.hpp>
94namespace Miscibility {
122 const double sat = 0.0)
const = 0;
154 const double = 0.0)
const
166template <
class Flu
idSystem>
177 RsVD(
const int pvtRegionIdx,
178 const std::vector<double>& depth,
179 const std::vector<double>& rs);
181 virtual ~RsVD() =
default;
201 const double satGas = 0.0)
const;
204 using RsVsDepthFunc = Tabulated1DFunction<double>;
206 const int pvtRegionIdx_;
207 RsVsDepthFunc rsVsDepth_;
209 double satRs(
const double press,
const double temp)
const;
218template <
class Flu
idSystem>
229 PBVD(
const int pvtRegionIdx,
230 const std::vector<double>& depth,
231 const std::vector<double>& pbub);
233 virtual ~PBVD() =
default;
250 const double cellPress,
252 const double satGas = 0.0)
const;
255 using PbubVsDepthFunc = Tabulated1DFunction<double>;
257 const int pvtRegionIdx_;
258 PbubVsDepthFunc pbubVsDepth_;
260 double satRs(
const double press,
const double temp)
const;
269template <
class Flu
idSystem>
280 PDVD(
const int pvtRegionIdx,
281 const std::vector<double>& depth,
282 const std::vector<double>& pdew);
284 virtual ~PDVD() =
default;
301 const double cellPress,
303 const double satOil = 0.0)
const;
306 using PdewVsDepthFunc = Tabulated1DFunction<double>;
308 const int pvtRegionIdx_;
309 PdewVsDepthFunc pdewVsDepth_;
311 double satRv(
const double press,
const double temp)
const;
320template <
class Flu
idSystem>
331 RvVD(
const int pvtRegionIdx,
332 const std::vector<double>& depth,
333 const std::vector<double>& rv);
353 const double satOil = 0.0)
const;
356 using RvVsDepthFunc = Tabulated1DFunction<double>;
358 const int pvtRegionIdx_;
359 RvVsDepthFunc rvVsDepth_;
361 double satRv(
const double press,
const double temp)
const;
370template <
class Flu
idSystem>
381 RvwVD(
const int pvtRegionIdx,
382 const std::vector<double>& depth,
383 const std::vector<double>& rvw);
403 const double satWat = 0.0)
const;
406 using RvwVsDepthFunc = Tabulated1DFunction<double>;
408 const int pvtRegionIdx_;
409 RvwVsDepthFunc rvwVsDepth_;
411 double satRvw(
const double press,
const double temp)
const;
429template <
class Flu
idSystem>
440 RsSatAtContact(
const int pvtRegionIdx,
const double pContact,
const double T_contact);
460 const double satGas = 0.0)
const;
463 const int pvtRegionIdx_;
464 double rsSatContact_;
466 double satRs(
const double press,
const double temp)
const;
484template <
class Flu
idSystem>
495 RvSatAtContact(
const int pvtRegionIdx,
const double pContact,
const double T_contact);
515 const double satOil = 0.0)
const;
518 const int pvtRegionIdx_;
519 double rvSatContact_;
521 double satRv(
const double press,
const double temp)
const;
538template <
class Flu
idSystem>
549 RvwSatAtContact(
const int pvtRegionIdx,
const double pContact,
const double T_contact);
569 const double satWat = 0.0)
const;
572 const int pvtRegionIdx_;
573 double rvwSatContact_;
575 double satRvw(
const double press,
const double temp)
const;
601 using TabulatedFunction = Tabulated1DFunction<double>;
614 std::shared_ptr<Miscibility::RsFunction> rs,
615 std::shared_ptr<Miscibility::RsFunction> rv,
616 std::shared_ptr<Miscibility::RsFunction> rvw,
617 const TabulatedFunction& tempVdTable,
618 const TabulatedFunction& saltVdTable,
640 double datum()
const;
698 const TabulatedFunction& saltVdTable()
const;
699 const TabulatedFunction& tempVdTable()
const;
708 std::shared_ptr<Miscibility::RsFunction> rs_;
709 std::shared_ptr<Miscibility::RsFunction> rv_;
710 std::shared_ptr<Miscibility::RsFunction> rvw_;
711 const TabulatedFunction& tempVdTable_;
712 const TabulatedFunction& saltVdTable_;
721template <
class Flu
idSystem,
class MaterialLawManager>
724 PcEq(
const MaterialLawManager& materialLawManager,
727 const double targetPc);
729 double operator()(
double s)
const;
732 const MaterialLawManager& materialLawManager_;
735 const double targetPc_;
738template <
class Flu
idSystem,
class MaterialLawManager>
739double minSaturations(
const MaterialLawManager& materialLawManager,
740 const int phase,
const int cell);
742template <
class Flu
idSystem,
class MaterialLawManager>
743double maxSaturations(
const MaterialLawManager& materialLawManager,
744 const int phase,
const int cell);
748template <
class Flu
idSystem,
class MaterialLawManager>
749double satFromPc(
const MaterialLawManager& materialLawManager,
752 const double targetPc,
753 const bool increasing =
false);
758template <
class Flu
idSystem,
class MaterialLawManager>
761 PcEqSum(
const MaterialLawManager& materialLawManager,
765 const double targetPc);
767 double operator()(
double s)
const;
770 const MaterialLawManager& materialLawManager_;
774 const double targetPc_;
780template <
class Flu
idSystem,
class MaterialLawManager>
785 const double targetPc);
788template <
class Flu
idSystem,
class MaterialLawManager>
789double satFromDepth(
const MaterialLawManager& materialLawManager,
790 const double cellDepth,
791 const double contactDepth,
794 const bool increasing =
false);
797template <
class Flu
idSystem,
class MaterialLawManager>
798bool isConstPc(
const MaterialLawManager& materialLawManager,
Aggregate information base of an equilibration region.
Definition EquilibrationHelpers.hpp:600
const CalcDissolution & dissolutionCalculator() const
Retrieve dissolved gas-oil ratio calculator of current region.
Definition EquilibrationHelpers_impl.hpp:393
double datum() const
Datum depth in current region.
Definition EquilibrationHelpers_impl.hpp:357
double pcgoGoc() const
Gas-oil capillary pressure at gas-oil contact.
Definition EquilibrationHelpers_impl.hpp:382
int equilibrationAccuracy() const
Accuracy/strategy for initial fluid-in-place calculation.
Definition EquilibrationHelpers_impl.hpp:387
double zgoc() const
Depth of gas-oil contact.
Definition EquilibrationHelpers_impl.hpp:377
const CalcWaterEvaporation & waterEvaporationCalculator() const
Retrieve vapourised water-gas ratio calculator of current region.
Definition EquilibrationHelpers_impl.hpp:405
const CalcEvaporation & evaporationCalculator() const
Retrieve vapourised oil-gas ratio calculator of current region.
Definition EquilibrationHelpers_impl.hpp:399
double pcowWoc() const
water-oil capillary pressure at water-oil contact.
Definition EquilibrationHelpers_impl.hpp:372
double zwoc() const
Depth of water-oil contact.
Definition EquilibrationHelpers_impl.hpp:367
double pressure() const
Pressure at datum depth in current region.
Definition EquilibrationHelpers_impl.hpp:362
int pvtIdx() const
Retrieve pvtIdx of the region.
Definition EquilibrationHelpers_impl.hpp:422
Type that implements "no phase mixing" policy.
Definition EquilibrationHelpers.hpp:130
double operator()(const double, const double, const double, const double=0.0) const
Function call.
Definition EquilibrationHelpers.hpp:151
Type that implements "dissolved gas-oil ratio" tabulated as a function of depth policy.
Definition EquilibrationHelpers.hpp:220
double operator()(const double depth, const double cellPress, const double temp, const double satGas=0.0) const
Function call.
Definition EquilibrationHelpers_impl.hpp:103
Type that implements "vaporized oil-gas ratio" tabulated as a function of depth policy.
Definition EquilibrationHelpers.hpp:271
double operator()(const double depth, const double cellPress, const double temp, const double satOil=0.0) const
Function call.
Definition EquilibrationHelpers_impl.hpp:138
Base class for phase mixing functions.
Definition EquilibrationHelpers.hpp:100
virtual double operator()(const double depth, const double press, const double temp, const double sat=0.0) const =0
Function call operator.
Type that implements "dissolved gas-oil ratio" tabulated as a function of depth policy.
Definition EquilibrationHelpers.hpp:168
double operator()(const double depth, const double press, const double temp, const double satGas=0.0) const
Function call.
Definition EquilibrationHelpers_impl.hpp:68
Type that implements "vaporized oil-gas ratio" tabulated as a function of depth policy.
Definition EquilibrationHelpers.hpp:322
double operator()(const double depth, const double press, const double temp, const double satOil=0.0) const
Function call.
Definition EquilibrationHelpers_impl.hpp:174
Type that implements "vaporized water-gas ratio" tabulated as a function of depth policy.
Definition EquilibrationHelpers.hpp:372
double operator()(const double depth, const double press, const double temp, const double satWat=0.0) const
Function call.
Definition EquilibrationHelpers_impl.hpp:216
double satFromDepth(const MaterialLawManager &materialLawManager, const double cellDepth, const double contactDepth, const int phase, const int cell, const bool increasing=false)
Compute saturation from depth. Used for constant capillary pressure function.
Definition EquilibrationHelpers_impl.hpp:606
double satFromSumOfPcs(const MaterialLawManager &materialLawManager, const int phase1, const int phase2, const int cell, const double targetPc)
Compute saturation of some phase corresponding to a given capillary pressure, where the capillary pre...
Definition EquilibrationHelpers_impl.hpp:577
double satFromPc(const MaterialLawManager &materialLawManager, const int phase, const int cell, const double targetPc, const bool increasing=false)
Compute saturation of some phase corresponding to a given capillary pressure.
Definition EquilibrationHelpers_impl.hpp:546
bool isConstPc(const MaterialLawManager &materialLawManager, const int phase, const int cell)
Return true if capillary pressure function is constant.
Definition EquilibrationHelpers_impl.hpp:625
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27
Functor for inverting a sum of capillary pressure functions.
Definition EquilibrationHelpers.hpp:760
Functor for inverting capillary pressure function.
Definition EquilibrationHelpers.hpp:723