This class implements the AD-adapted fluid interface for three-phase black-oil. More...
#include <BlackoilPropsAdFromDeck.hpp>
Public Types | |
typedef FluidSystems::BlackOil< double > | FluidSystem |
typedef Opm::GasPvtMultiplexer< double > | GasPvt |
typedef Opm::OilPvtMultiplexer< double > | OilPvt |
typedef Opm::WaterPvtMultiplexer< double > | WaterPvt |
typedef SaturationPropsFromDeck::MaterialLawManager | MaterialLawManager |
typedef AutoDiffBlock< double > | ADB |
typedef ADB::V | V |
typedef std::vector< int > | Cells |
Public Member Functions | |
BlackoilPropsAdFromDeck (const Opm::Deck &deck, const Opm::EclipseState &eclState, std::shared_ptr< MaterialLawManager > materialLawManager, const UnstructuredGrid &grid, const bool init_rock=true) | |
Constructor to create a blackoil properties from an ECL deck. More... | |
BlackoilPropsAdFromDeck (const Opm::Deck &deck, const Opm::EclipseState &eclState, const UnstructuredGrid &grid, const bool init_rock=true) | |
Constructor to create a blackoil properties from an ECL deck. More... | |
BlackoilPropsAdFromDeck (const BlackoilPropsAdFromDeck &props, std::shared_ptr< MaterialLawManager > materialLawManager, const int number_of_cells) | |
Constructor to create properties for a subgrid. More... | |
int | numDimensions () const |
int | numCells () const |
virtual const int * | cellPvtRegionIndex () const |
Return an array containing the PVT table index for each grid cell. | |
const double * | porosity () const |
const double * | permeability () const |
int | numPhases () const |
PhaseUsage | phaseUsage () const |
V | surfaceDensity (const int phaseIdx, const Cells &cells) const |
Densities of stock components at surface conditions. More... | |
ADB | muWat (const ADB &pw, const ADB &T, const Cells &cells) const |
Water viscosity. More... | |
ADB | muOil (const ADB &po, const ADB &T, const ADB &rs, const std::vector< PhasePresence > &cond, const Cells &cells) const |
Oil viscosity. More... | |
ADB | muGas (const ADB &pg, const ADB &T, const ADB &rv, const std::vector< PhasePresence > &cond, const Cells &cells) const |
Gas viscosity. More... | |
ADB | bWat (const ADB &pw, const ADB &T, const Cells &cells) const |
Water formation volume factor. More... | |
ADB | bOil (const ADB &po, const ADB &T, const ADB &rs, const std::vector< PhasePresence > &cond, const Cells &cells) const |
Oil formation volume factor. More... | |
ADB | bGas (const ADB &pg, const ADB &T, const ADB &rv, const std::vector< PhasePresence > &cond, const Cells &cells) const |
Gas formation volume factor. More... | |
V | rsSat (const V &po, const Cells &cells) const |
Bubble point curve for Rs as function of oil pressure. More... | |
V | rsSat (const V &po, const V &so, const Cells &cells) const |
Bubble point curve for Rs as function of oil pressure. More... | |
ADB | rsSat (const ADB &po, const Cells &cells) const |
Bubble point curve for Rs as function of oil pressure. More... | |
ADB | rsSat (const ADB &po, const ADB &so, const Cells &cells) const |
Bubble point curve for Rs as function of oil pressure. More... | |
ADB | rvSat (const ADB &po, const Cells &cells) const |
Condensation curve for Rv as function of oil pressure. More... | |
ADB | rvSat (const ADB &po, const ADB &so, const Cells &cells) const |
Condensation curve for Rv as function of oil pressure. More... | |
std::vector< ADB > | relperm (const ADB &sw, const ADB &so, const ADB &sg, const Cells &cells) const |
Relative permeabilities for all phases. More... | |
std::vector< ADB > | capPress (const ADB &sw, const ADB &so, const ADB &sg, const Cells &cells) const |
Capillary pressure for all phases. More... | |
void | updateSatHyst (const std::vector< double > &saturation, const std::vector< int > &cells) |
Saturation update for hysteresis behavior. More... | |
void | setGasOilHystParams (const std::vector< double > &pcswmdc, const std::vector< double > &krnswdc, const std::vector< int > &cells) |
Set gas-oil hysteresis parameters. More... | |
void | getGasOilHystParams (std::vector< double > &pcswmdc, std::vector< double > &krnswdc, const std::vector< int > &cells) const |
Get gas-oil hysteresis parameters. More... | |
void | setOilWaterHystParams (const std::vector< double > &pcswmdc, const std::vector< double > &krnswdc, const std::vector< int > &cells) |
Set oil-water hysteresis parameters. More... | |
void | getOilWaterHystParams (std::vector< double > &pcswmdc, std::vector< double > &krnswdc, const std::vector< int > &cells) const |
Set oil-water hysteresis parameters. More... | |
void | updateSatOilMax (const std::vector< double > &saturation) |
Update for max oil saturation. More... | |
const std::vector< double > & | satOilMax () const |
Returns the max oil saturation vector. | |
void | setSatOilMax (const std::vector< double > &max_sat) |
Force set max oil saturation (used for restarting) More... | |
std::vector< double > | bubblePointPressure (const Cells &cells, const V &T, const V &rs) const |
Returns the bubble point pressures. More... | |
std::vector< double > | dewPointPressure (const Cells &cells, const V &T, const V &rv) const |
Returns the dew point pressures. More... | |
void | setSwatInitScaling (const std::vector< double > &saturation, const std::vector< double > &pc) |
Set capillary pressure scaling according to pressure diff. More... | |
V | scaledCriticalOilinGasSaturations (const Cells &cells) const |
Obtain the scaled critical oil in gas saturation values. More... | |
V | scaledCriticalGasSaturations (const Cells &cells) const |
Obtain the scaled critical gas saturation values. More... | |
const WaterPvt & | waterProps () const |
Direct access to lower-level water pvt props. | |
const OilPvt & | oilProps () const |
Direct access to lower-level oil pvt props. | |
const GasPvt & | gasProps () const |
Direct access to lower-level gas pvt props. | |
const MaterialLawManager & | materialLaws () const |
Direct access to lower-level saturation functions. | |
const std::vector< int > & | pvtRegions () const |
Friends | |
class | BlackoilPropsDataHandle |
This class implements the AD-adapted fluid interface for three-phase black-oil.
It requires an input deck from which it reads all relevant property data.
Most methods are available in two overloaded versions, one taking a constant vector and returning the same, and one taking an AD type and returning the same. Derivatives are not returned separately by any method, only implicitly with the AD version of the methods.
Opm::BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck | ( | const Opm::Deck & | deck, |
const Opm::EclipseState & | eclState, | ||
std::shared_ptr< MaterialLawManager > | materialLawManager, | ||
const UnstructuredGrid & | grid, | ||
const bool | init_rock = true |
||
) |
Constructor to create a blackoil properties from an ECL deck.
Constructor wrapping an opm-core black oil interface.
The materialLawManager parameter represents the object from opm-material which handles the creating and updating parameter objects for the capillary pressure/relperm relations for each grid cell. This object is created internally for the constructors below, but if it is already available externally some performance can be gained by creating it only once.
deck | The unprocessed ECL deck from opm-parser |
eclState | The processed ECL deck from opm-parser |
materialLawManager | The container for the material law parameter objects |
grid | The grid upon which the simulation is run on. |
init_rock | If true the rock properties (rock compressibility and reference pressure) are read from the deck |
Opm::BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck | ( | const Opm::Deck & | deck, |
const Opm::EclipseState & | eclState, | ||
const UnstructuredGrid & | grid, | ||
const bool | init_rock = true |
||
) |
Constructor to create a blackoil properties from an ECL deck.
Constructor wrapping an opm-core black oil interface.
deck | The unprocessed ECL deck from opm-parser |
eclState | The processed ECL deck from opm-parser |
grid | The grid upon which the simulation is run on. |
init_rock | If true the rock properties (rock compressibility and reference pressure) are read from the deck |
Opm::BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck | ( | const BlackoilPropsAdFromDeck & | props, |
std::shared_ptr< MaterialLawManager > | materialLawManager, | ||
const int | number_of_cells | ||
) |
Constructor to create properties for a subgrid.
Constructor for properties on a subgrid.
This copies all properties that are not dependant on the grid size from an existing properties object and the number of cells. All properties that do not depend on the grid dimension will be copied. For the rest will have the correct size but the values will be undefined.
props | The property object to copy from. |
materialLawManager | The container for the material law parameter objects. Initialized only for the subgrid |
number_of_cells | The number of cells of the subgrid. |
ADB Opm::BlackoilPropsAdFromDeck::bGas | ( | const ADB & | pg, |
const ADB & | T, | ||
const ADB & | rv, | ||
const std::vector< PhasePresence > & | cond, | ||
const Cells & | cells | ||
) | const |
Gas formation volume factor.
[in] | pg | Array of n gas pressure values. |
[in] | T | Array of n temperature values. |
[in] | rv | Array of n vapor oil/gas ratio |
[in] | cond | Array of n objects, each specifying which phases are present with non-zero saturation in a cell. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
ADB Opm::BlackoilPropsAdFromDeck::bOil | ( | const ADB & | po, |
const ADB & | T, | ||
const ADB & | rs, | ||
const std::vector< PhasePresence > & | cond, | ||
const Cells & | cells | ||
) | const |
Oil formation volume factor.
[in] | po | Array of n oil pressure values. |
[in] | T | Array of n temperature values. |
[in] | rs | Array of n gas solution factor values. |
[in] | cond | Array of n objects, each specifying which phases are present with non-zero saturation in a cell. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
[in] | po | Array of n oil pressure values. |
[in] | T | Array of n temperature values. |
[in] | rs | Array of n gas solution factor values. |
[in] | cond | Array of n taxonomies classifying fluid condition. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
std::vector< double > Opm::BlackoilPropsAdFromDeck::bubblePointPressure | ( | const Cells & | cells, |
const V & | T, | ||
const V & | rs | ||
) | const |
Returns the bubble point pressures.
Bubble point pressures.
Water formation volume factor.
[in] | pw | Array of n water pressure values. |
[in] | T | Array of n temperature values. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
std::vector< ADB > Opm::BlackoilPropsAdFromDeck::capPress | ( | const ADB & | sw, |
const ADB & | so, | ||
const ADB & | sg, | ||
const Cells & | cells | ||
) | const |
Capillary pressure for all phases.
[in] | sw | Array of n water saturation values. |
[in] | so | Array of n oil saturation values. |
[in] | sg | Array of n gas saturation values. |
[in] | cells | Array of n cell indices to be associated with the saturation values. |
std::vector< double > Opm::BlackoilPropsAdFromDeck::dewPointPressure | ( | const Cells & | cells, |
const V & | T, | ||
const V & | rv | ||
) | const |
Returns the dew point pressures.
Dew point pressures.
void Opm::BlackoilPropsAdFromDeck::getGasOilHystParams | ( | std::vector< double > & | pcswmdc, |
std::vector< double > & | krnswdc, | ||
const std::vector< int > & | cells | ||
) | const |
Get gas-oil hysteresis parameters.
[in] | pcswmdc | Vector of hysteresis parameters ( |
[in] | krnswdc | Vector of hysteresis parameters ( |
void Opm::BlackoilPropsAdFromDeck::getOilWaterHystParams | ( | std::vector< double > & | pcswmdc, |
std::vector< double > & | krnswdc, | ||
const std::vector< int > & | cells | ||
) | const |
Set oil-water hysteresis parameters.
Get oil-water hysteresis parameters.
[in] | pcswmdc | Vector of hysteresis parameters ( |
[in] | krnswdc | Vector of hysteresis parameters ( |
ADB Opm::BlackoilPropsAdFromDeck::muGas | ( | const ADB & | pg, |
const ADB & | T, | ||
const ADB & | rv, | ||
const std::vector< PhasePresence > & | cond, | ||
const Cells & | cells | ||
) | const |
Gas viscosity.
[in] | pg | Array of n gas pressure values. |
[in] | T | Array of n temperature values. |
[in] | rv | Array of n vapor oil/gas ratios. |
[in] | cond | Array of n objects, each specifying which phases are present with non-zero saturation in a cell. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
[in] | pg | Array of n gas pressure values. |
[in] | T | Array of n temperature values. |
[in] | rv | Array of n vapor oil/gas ratio |
[in] | cond | Array of n taxonomies classifying fluid condition. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
ADB Opm::BlackoilPropsAdFromDeck::muOil | ( | const ADB & | po, |
const ADB & | T, | ||
const ADB & | rs, | ||
const std::vector< PhasePresence > & | cond, | ||
const Cells & | cells | ||
) | const |
Oil viscosity.
[in] | po | Array of n oil pressure values. |
[in] | T | Array of n temperature values. |
[in] | rs | Array of n gas solution factor values. |
[in] | cond | Array of n objects, each specifying which phases are present with non-zero saturation in a cell. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
[in] | po | Array of n oil pressure values. |
[in] | T | Array of n temperature values. |
[in] | rs | Array of n gas solution factor values. |
[in] | cond | Array of n taxonomies classifying fluid condition. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
ADB Opm::BlackoilPropsAdFromDeck::muWat | ( | const ADB & | pw, |
const ADB & | T, | ||
const Cells & | cells | ||
) | const |
Water viscosity.
[in] | pw | Array of n water pressure values. |
[in] | T | Array of n temperature values. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
int Opm::BlackoilPropsAdFromDeck::numCells | ( | ) | const |
int Opm::BlackoilPropsAdFromDeck::numDimensions | ( | ) | const |
int Opm::BlackoilPropsAdFromDeck::numPhases | ( | ) | const |
const double * Opm::BlackoilPropsAdFromDeck::permeability | ( | ) | const |
PhaseUsage Opm::BlackoilPropsAdFromDeck::phaseUsage | ( | ) | const |
const double * Opm::BlackoilPropsAdFromDeck::porosity | ( | ) | const |
std::vector< ADB > Opm::BlackoilPropsAdFromDeck::relperm | ( | const ADB & | sw, |
const ADB & | so, | ||
const ADB & | sg, | ||
const Cells & | cells | ||
) | const |
Relative permeabilities for all phases.
[in] | sw | Array of n water saturation values. |
[in] | so | Array of n oil saturation values. |
[in] | sg | Array of n gas saturation values. |
[in] | cells | Array of n cell indices to be associated with the saturation values. |
V Opm::BlackoilPropsAdFromDeck::rsSat | ( | const V & | po, |
const Cells & | cells | ||
) | const |
Bubble point curve for Rs as function of oil pressure.
[in] | po | Array of n oil pressure values. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
V Opm::BlackoilPropsAdFromDeck::rsSat | ( | const V & | po, |
const V & | so, | ||
const Cells & | cells | ||
) | const |
Bubble point curve for Rs as function of oil pressure.
[in] | po | Array of n oil pressure values. |
[in] | so | Array of n oil saturation values. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
Bubble point curve for Rs as function of oil pressure.
[in] | po | Array of n oil pressure values. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
ADB Opm::BlackoilPropsAdFromDeck::rsSat | ( | const ADB & | po, |
const ADB & | so, | ||
const Cells & | cells | ||
) | const |
Bubble point curve for Rs as function of oil pressure.
[in] | po | Array of n oil pressure values. |
[in] | so | Array of n oil saturation values. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
Condensation curve for Rv as function of oil pressure.
[in] | po | Array of n oil pressure values. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
[in] | pg | Array of n gas pressure values. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
ADB Opm::BlackoilPropsAdFromDeck::rvSat | ( | const ADB & | po, |
const ADB & | so, | ||
const Cells & | cells | ||
) | const |
Condensation curve for Rv as function of oil pressure.
[in] | po | Array of n oil pressure values. |
[in] | so | Array of n oil saturation values. |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
V Opm::BlackoilPropsAdFromDeck::scaledCriticalGasSaturations | ( | const Cells & | cells | ) | const |
Obtain the scaled critical gas saturation values.
[in] | cells | Array of cell indices. |
V Opm::BlackoilPropsAdFromDeck::scaledCriticalOilinGasSaturations | ( | const Cells & | cells | ) | const |
Obtain the scaled critical oil in gas saturation values.
[in] | cells | Array of cell indices. |
void Opm::BlackoilPropsAdFromDeck::setGasOilHystParams | ( | const std::vector< double > & | pcswmdc, |
const std::vector< double > & | krnswdc, | ||
const std::vector< int > & | cells | ||
) |
Set gas-oil hysteresis parameters.
[in] | pcswmdc | Vector of hysteresis parameters ( |
[in] | krnswdc | Vector of hysteresis parameters ( |
void Opm::BlackoilPropsAdFromDeck::setOilWaterHystParams | ( | const std::vector< double > & | pcswmdc, |
const std::vector< double > & | krnswdc, | ||
const std::vector< int > & | cells | ||
) |
Set oil-water hysteresis parameters.
[in] | pcswmdc | Vector of hysteresis parameters ( |
[in] | krnswdc | Vector of hysteresis parameters ( |
void Opm::BlackoilPropsAdFromDeck::setSatOilMax | ( | const std::vector< double > & | max_sat | ) |
Force set max oil saturation (used for restarting)
[in] | max_sat | Max oil saturations. Note that this is a vector of only oil saturations (no other phases) |
void Opm::BlackoilPropsAdFromDeck::setSwatInitScaling | ( | const std::vector< double > & | saturation, |
const std::vector< double > & | pc | ||
) |
Set capillary pressure scaling according to pressure diff.
and initial water saturation.
[in] | saturation | Array of n*numPhases saturation values. |
[in] | pc | Array of n*numPhases capillary pressure values. |
V Opm::BlackoilPropsAdFromDeck::surfaceDensity | ( | const int | phaseIdx, |
const Cells & | cells | ||
) | const |
Densities of stock components at surface conditions.
[in] | phaseIdx | |
[in] | cells | Array of n cell indices to be associated with the pressure values. |
void Opm::BlackoilPropsAdFromDeck::updateSatHyst | ( | const std::vector< double > & | saturation, |
const std::vector< int > & | cells | ||
) |
Saturation update for hysteresis behavior.
[in] | cells | Array of n cell indices to be associated with the saturation values. |
void Opm::BlackoilPropsAdFromDeck::updateSatOilMax | ( | const std::vector< double > & | saturation | ) |
Update for max oil saturation.
[in] | saturation | Saturations for all phases |