All Classes Namespaces Files Functions Variables Typedefs Enumerator Pages
Opm::BlackoilPropsAdFromDeck Class Reference

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
 
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...
 
rsSat (const V &po, const Cells &cells) const
 Bubble point curve for Rs as function of oil pressure. More...
 
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< ADBrelperm (const ADB &sw, const ADB &so, const ADB &sg, const Cells &cells) const
 Relative permeabilities for all phases. More...
 
std::vector< ADBcapPress (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...
 
scaledCriticalOilinGasSaturations (const Cells &cells) const
 Obtain the scaled critical oil in gas saturation values. More...
 
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
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
deckThe unprocessed ECL deck from opm-parser
eclStateThe processed ECL deck from opm-parser
materialLawManagerThe container for the material law parameter objects
gridThe grid upon which the simulation is run on.
init_rockIf 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.

Parameters
deckThe unprocessed ECL deck from opm-parser
eclStateThe processed ECL deck from opm-parser
gridThe grid upon which the simulation is run on.
init_rockIf 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.

Parameters
propsThe property object to copy from.
materialLawManagerThe container for the material law parameter objects. Initialized only for the subgrid
number_of_cellsThe number of cells of the subgrid.

Member Function Documentation

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.

Parameters
[in]pgArray of n gas pressure values.
[in]TArray of n temperature values.
[in]rvArray of n vapor oil/gas ratio
[in]condArray of n objects, each specifying which phases are present with non-zero saturation in a cell.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n formation volume factor 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.

Parameters
[in]poArray of n oil pressure values.
[in]TArray of n temperature values.
[in]rsArray of n gas solution factor values.
[in]condArray of n objects, each specifying which phases are present with non-zero saturation in a cell.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n formation volume factor values.
Parameters
[in]poArray of n oil pressure values.
[in]TArray of n temperature values.
[in]rsArray of n gas solution factor values.
[in]condArray of n taxonomies classifying fluid condition.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n formation volume factor 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.

ADB Opm::BlackoilPropsAdFromDeck::bWat ( const ADB pw,
const ADB T,
const Cells &  cells 
) const

Water formation volume factor.

Parameters
[in]pwArray of n water pressure values.
[in]TArray of n temperature values.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n formation volume factor 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.

Parameters
[in]swArray of n water saturation values.
[in]soArray of n oil saturation values.
[in]sgArray of n gas saturation values.
[in]cellsArray of n cell indices to be associated with the saturation values.
Returns
An std::vector with 3 elements, each an array of n capillary pressure values, containing the offsets for each p_g, p_o, p_w. The capillary pressure between two arbitrary phases alpha and beta is then given as p_alpha - p_beta.
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.

Parameters
[in]pcswmdcVector of hysteresis parameters (
See Also
EclHysteresisTwoPhaseLawParams::pcSwMdc(...))
Parameters
[in]krnswdcVector of hysteresis parameters (
See Also
EclHysteresisTwoPhaseLawParams::krnSwMdc(...))
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.

Parameters
[in]pcswmdcVector of hysteresis parameters (
See Also
EclHysteresisTwoPhaseLawParams::pcSwMdc(...))
Parameters
[in]krnswdcVector of hysteresis parameters (
See Also
EclHysteresisTwoPhaseLawParams::krnSwMdc(...))
ADB Opm::BlackoilPropsAdFromDeck::muGas ( const ADB pg,
const ADB T,
const ADB rv,
const std::vector< PhasePresence > &  cond,
const Cells &  cells 
) const

Gas viscosity.

Parameters
[in]pgArray of n gas pressure values.
[in]TArray of n temperature values.
[in]rvArray of n vapor oil/gas ratios.
[in]condArray of n objects, each specifying which phases are present with non-zero saturation in a cell.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n viscosity values.
Parameters
[in]pgArray of n gas pressure values.
[in]TArray of n temperature values.
[in]rvArray of n vapor oil/gas ratio
[in]condArray of n taxonomies classifying fluid condition.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n viscosity 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.

Parameters
[in]poArray of n oil pressure values.
[in]TArray of n temperature values.
[in]rsArray of n gas solution factor values.
[in]condArray of n objects, each specifying which phases are present with non-zero saturation in a cell.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n viscosity values.
Parameters
[in]poArray of n oil pressure values.
[in]TArray of n temperature values.
[in]rsArray of n gas solution factor values.
[in]condArray of n taxonomies classifying fluid condition.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n viscosity values.
ADB Opm::BlackoilPropsAdFromDeck::muWat ( const ADB pw,
const ADB T,
const Cells &  cells 
) const

Water viscosity.

Parameters
[in]pwArray of n water pressure values.
[in]TArray of n temperature values.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n viscosity values.
int Opm::BlackoilPropsAdFromDeck::numCells ( ) const
Returns
N, the number of cells.
int Opm::BlackoilPropsAdFromDeck::numDimensions ( ) const
Returns
D, the number of spatial dimensions.
int Opm::BlackoilPropsAdFromDeck::numPhases ( ) const
Returns
Number of active phases (also the number of components).
const double * Opm::BlackoilPropsAdFromDeck::permeability ( ) const
Returns
Array of ND^2 permeability values. The D^2 permeability values for a cell are organized as a matrix, which is symmetric (so ordering does not matter).
PhaseUsage Opm::BlackoilPropsAdFromDeck::phaseUsage ( ) const
Returns
Object describing the active phases.
const double * Opm::BlackoilPropsAdFromDeck::porosity ( ) const
Returns
Array of N porosity values.
std::vector< ADB > Opm::BlackoilPropsAdFromDeck::relperm ( const ADB sw,
const ADB so,
const ADB sg,
const Cells &  cells 
) const

Relative permeabilities for all phases.

Parameters
[in]swArray of n water saturation values.
[in]soArray of n oil saturation values.
[in]sgArray of n gas saturation values.
[in]cellsArray of n cell indices to be associated with the saturation values.
Returns
An std::vector with 3 elements, each an array of n relperm values, containing krw, kro, krg. Use PhaseIndex for indexing into the result.
V Opm::BlackoilPropsAdFromDeck::rsSat ( const V &  po,
const Cells &  cells 
) const

Bubble point curve for Rs as function of oil pressure.

Parameters
[in]poArray of n oil pressure values.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n bubble point values for Rs.
V Opm::BlackoilPropsAdFromDeck::rsSat ( const V &  po,
const V &  so,
const Cells &  cells 
) const

Bubble point curve for Rs as function of oil pressure.

Parameters
[in]poArray of n oil pressure values.
[in]soArray of n oil saturation values.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n bubble point values for Rs.
ADB Opm::BlackoilPropsAdFromDeck::rsSat ( const ADB po,
const Cells &  cells 
) const

Bubble point curve for Rs as function of oil pressure.

Parameters
[in]poArray of n oil pressure values.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n bubble point values for Rs.
ADB Opm::BlackoilPropsAdFromDeck::rsSat ( const ADB po,
const ADB so,
const Cells &  cells 
) const

Bubble point curve for Rs as function of oil pressure.

Parameters
[in]poArray of n oil pressure values.
[in]soArray of n oil saturation values.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n bubble point values for Rs.
ADB Opm::BlackoilPropsAdFromDeck::rvSat ( const ADB pg,
const Cells &  cells 
) const

Condensation curve for Rv as function of oil pressure.

Parameters
[in]poArray of n oil pressure values.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n condensation point values for Rv.
Parameters
[in]pgArray of n gas pressure values.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n condensation point values for Rv.
ADB Opm::BlackoilPropsAdFromDeck::rvSat ( const ADB po,
const ADB so,
const Cells &  cells 
) const

Condensation curve for Rv as function of oil pressure.

Parameters
[in]poArray of n oil pressure values.
[in]soArray of n oil saturation values.
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n condensation point values for Rv.
V Opm::BlackoilPropsAdFromDeck::scaledCriticalGasSaturations ( const Cells &  cells) const

Obtain the scaled critical gas saturation values.

Parameters
[in]cellsArray of cell indices.
Returns
Array of scaled critical gas saturaion values.
V Opm::BlackoilPropsAdFromDeck::scaledCriticalOilinGasSaturations ( const Cells &  cells) const

Obtain the scaled critical oil in gas saturation values.

Parameters
[in]cellsArray of cell indices.
Returns
Array of critical oil in gas saturaion values.
void Opm::BlackoilPropsAdFromDeck::setGasOilHystParams ( const std::vector< double > &  pcswmdc,
const std::vector< double > &  krnswdc,
const std::vector< int > &  cells 
)

Set gas-oil hysteresis parameters.

Parameters
[in]pcswmdcVector of hysteresis parameters (
See Also
EclHysteresisTwoPhaseLawParams::pcSwMdc(...))
Parameters
[in]krnswdcVector of hysteresis parameters (
See Also
EclHysteresisTwoPhaseLawParams::krnSwMdc(...))
void Opm::BlackoilPropsAdFromDeck::setOilWaterHystParams ( const std::vector< double > &  pcswmdc,
const std::vector< double > &  krnswdc,
const std::vector< int > &  cells 
)

Set oil-water hysteresis parameters.

Parameters
[in]pcswmdcVector of hysteresis parameters (
See Also
EclHysteresisTwoPhaseLawParams::pcSwMdc(...))
Parameters
[in]krnswdcVector of hysteresis parameters (
See Also
EclHysteresisTwoPhaseLawParams::krnSwMdc(...))
void Opm::BlackoilPropsAdFromDeck::setSatOilMax ( const std::vector< double > &  max_sat)

Force set max oil saturation (used for restarting)

Parameters
[in]max_satMax oil saturations. Note that this is a vector of only oil saturations (no other phases)
See Also
The similar function updateSatOilMax(const std::vector<double>& saturation)
satOilMax()
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.

Parameters
[in]saturationArray of n*numPhases saturation values.
[in]pcArray of n*numPhases capillary pressure values.
V Opm::BlackoilPropsAdFromDeck::surfaceDensity ( const int  phaseIdx,
const Cells &  cells 
) const

Densities of stock components at surface conditions.

Parameters
[in]phaseIdx
[in]cellsArray of n cell indices to be associated with the pressure values.
Returns
Array of n density values for phase given by phaseIdx.
void Opm::BlackoilPropsAdFromDeck::updateSatHyst ( const std::vector< double > &  saturation,
const std::vector< int > &  cells 
)

Saturation update for hysteresis behavior.

Parameters
[in]cellsArray 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.

Parameters
[in]saturationSaturations for all phases

The documentation for this class was generated from the following files: