Opm::BlackoilPropsAdFromDeck Class Reference

This class implements the AD-adapted fluid interface for three-phase black-oil. More...

#include <BlackoilPropsAdFromDeck.hpp>

List of all members.

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.
 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.
 BlackoilPropsAdFromDeck (const BlackoilPropsAdFromDeck &props, std::shared_ptr< MaterialLawManager > materialLawManager, const int number_of_cells)
 Constructor to create properties for a subgrid.
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.
ADB muWat (const ADB &pw, const ADB &T, const Cells &cells) const
 Water viscosity.
ADB muOil (const ADB &po, const ADB &T, const ADB &rs, const std::vector< PhasePresence > &cond, const Cells &cells) const
 Oil viscosity.
ADB muGas (const ADB &pg, const ADB &T, const ADB &rv, const std::vector< PhasePresence > &cond, const Cells &cells) const
 Gas viscosity.
ADB bWat (const ADB &pw, const ADB &T, const Cells &cells) const
 Water formation volume factor.
ADB bOil (const ADB &po, const ADB &T, const ADB &rs, const std::vector< PhasePresence > &cond, const Cells &cells) const
 Oil formation volume factor.
ADB bGas (const ADB &pg, const ADB &T, const ADB &rv, const std::vector< PhasePresence > &cond, const Cells &cells) const
 Gas formation volume factor.
rsSat (const V &po, const Cells &cells) const
 Bubble point curve for Rs as function of oil pressure.
rsSat (const V &po, const V &so, const Cells &cells) const
 Bubble point curve for Rs as function of oil pressure.
ADB rsSat (const ADB &po, const Cells &cells) const
 Bubble point curve for Rs as function of oil pressure.
ADB rsSat (const ADB &po, const ADB &so, const Cells &cells) const
 Bubble point curve for Rs as function of oil pressure.
ADB rvSat (const ADB &po, const Cells &cells) const
 Condensation curve for Rv as function of oil pressure.
ADB rvSat (const ADB &po, const ADB &so, const Cells &cells) const
 Condensation curve for Rv as function of oil pressure.
std::vector< ADBrelperm (const ADB &sw, const ADB &so, const ADB &sg, const Cells &cells) const
 Relative permeabilities for all phases.
std::vector< ADBcapPress (const ADB &sw, const ADB &so, const ADB &sg, const Cells &cells) const
 Capillary pressure for all phases.
void updateSatHyst (const std::vector< double > &saturation, const std::vector< int > &cells)
 Saturation update for hysteresis behavior.
void setGasOilHystParams (const std::vector< double > &pcswmdc, const std::vector< double > &krnswdc, const std::vector< int > &cells)
 Set gas-oil hysteresis parameters.
void getGasOilHystParams (std::vector< double > &pcswmdc, std::vector< double > &krnswdc, const std::vector< int > &cells) const
 Get gas-oil hysteresis parameters.
void setOilWaterHystParams (const std::vector< double > &pcswmdc, const std::vector< double > &krnswdc, const std::vector< int > &cells)
 Set oil-water hysteresis parameters.
void getOilWaterHystParams (std::vector< double > &pcswmdc, std::vector< double > &krnswdc, const std::vector< int > &cells) const
 Set oil-water hysteresis parameters.
void updateSatOilMax (const std::vector< double > &saturation)
 Update for max oil saturation.
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).
std::vector< double > bubblePointPressure (const Cells &cells, const V &T, const V &rs) const
 Returns the bubble point pressures.
std::vector< double > dewPointPressure (const Cells &cells, const V &T, const V &rv) const
 Returns the dew point pressures.
void setSwatInitScaling (const std::vector< double > &saturation, const std::vector< double > &pc)
 Set capillary pressure scaling according to pressure diff.
scaledCriticalOilinGasSaturations (const Cells &cells) const
 Obtain the scaled critical oil in gas saturation values.
scaledCriticalGasSaturations (const Cells &cells) const
 Obtain the scaled critical gas saturation values.
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:
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.

Parameters:
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.

Parameters:
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.

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] 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.
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] 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.
Returns:
Array of n formation volume factor values.
Parameters:
[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.
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] 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.
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] 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.
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] pcswmdc Vector of hysteresis parameters (
See also:
EclHysteresisTwoPhaseLawParams::pcSwMdc(...))
Parameters:
[in] krnswdc Vector 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] pcswmdc Vector of hysteresis parameters (
See also:
EclHysteresisTwoPhaseLawParams::pcSwMdc(...))
Parameters:
[in] krnswdc Vector 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] 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.
Returns:
Array of n viscosity values.
Parameters:
[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.
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] 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.
Returns:
Array of n viscosity values.
Parameters:
[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.
Returns:
Array of n viscosity values.
ADB Opm::BlackoilPropsAdFromDeck::muWat ( const ADB pw,
const ADB T,
const Cells &  cells 
) const

Water viscosity.

Parameters:
[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.
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] 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.
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.
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] 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.
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] po Array of n oil pressure values.
[in] cells Array 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] 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.
Returns:
Array of n bubble point values for Rs.
V Opm::BlackoilPropsAdFromDeck::rsSat ( const V &  po,
const Cells &  cells 
) const

Bubble point curve for Rs as function of oil pressure.

Parameters:
[in] po Array of n oil pressure values.
[in] cells Array 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 po,
const ADB so,
const Cells &  cells 
) const

Condensation curve for Rv as function of oil pressure.

Parameters:
[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.
Returns:
Array of n condensation point values for Rv.
ADB Opm::BlackoilPropsAdFromDeck::rvSat ( const ADB pg,
const Cells &  cells 
) const

Condensation curve for Rv as function of oil pressure.

Parameters:
[in] po Array of n oil pressure values.
[in] cells Array of n cell indices to be associated with the pressure values.
Returns:
Array of n condensation point values for Rv.
Parameters:
[in] pg Array of n gas pressure values.
[in] cells Array 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] cells Array 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] cells Array 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] pcswmdc Vector of hysteresis parameters (
See also:
EclHysteresisTwoPhaseLawParams::pcSwMdc(...))
Parameters:
[in] krnswdc Vector 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] pcswmdc Vector of hysteresis parameters (
See also:
EclHysteresisTwoPhaseLawParams::pcSwMdc(...))
Parameters:
[in] krnswdc Vector 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_sat Max 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] 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.

Parameters:
[in] phaseIdx 
[in] cells Array 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] 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.

Parameters:
[in] saturation Saturations for all phases

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

Generated on 26 Mar 2018 by  doxygen 1.6.1