Opm::ReservoirPropertyCommon< dim, RPImpl, RockType > Class Template Reference

A property class for incompressible two-phase flow. More...

#include <ReservoirPropertyCommon.hpp>

Inheritance diagram for Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >:
Inheritance graph

Public Types

enum  { NumberOfPhases = 2 }
 The number of phases. More...
 
typedef ImmutableCMatrix PermTensor
 Tensor type for read-only access to permeability. More...
 
typedef OwnCMatrix MutablePermTensor
 Tensor type to be used for holding copies of permeability tensors. More...
 
typedef SharedCMatrix SharedPermTensor
 Tensor type for read and write access to permeability. More...
 

Public Member Functions

 ReservoirPropertyCommon ()
 Default constructor. More...
 
void init (Opm::DeckConstPtr deck, const std::vector< int > &global_cell, const double perm_threshold=0.0, const std::string *rock_list_filename=0, const bool use_jfunction_scaling=true, const double sigma=1.0, const double theta=0.0)
 Initialize from a grdecl file. More...
 
void init (const int num_cells, const double uniform_poro=0.2, const double uniform_perm=100.0 *Opm::prefix::milli *Opm::unit::darcy)
 Initialize a uniform reservoir. More...
 
void setViscosities (double v1, double v2)
 Set viscosities of both faces. More...
 
void setDensities (double d1, double d2)
 Set densitities of both faces. More...
 
double viscosityFirstPhase () const
 Viscosity of first (water) phase. More...
 
double viscositySecondPhase () const
 Viscosity of second (oil) phase. More...
 
double densityFirstPhase () const
 Density of first (water) phase. More...
 
double densitySecondPhase () const
 Density of second (oil) phase. More...
 
double porosity (int cell_index) const
 Read-access to porosity. More...
 
double ntg (int cell_index) const
 Read-access to ntg. More...
 
double swcr (int cell_index) const
 Read-access to swcr. More...
 
double sowcr (int cell_index) const
 Read-access to sowcr. More...
 
PermTensor permeability (int cell_index) const
 Read-access to permeability. More...
 
SharedPermTensor permeabilityModifiable (int cell_index)
 Read- and write-access to permeability. Use with caution. More...
 
template<class Vector >
void phaseDensities (int, Vector &density) const
 Densities for both phases. More...
 
double densityDifference () const
 Difference of densities. More...
 
double cflFactor () const
 A factor useful in cfl computations. More...
 
double cflFactorGravity () const
 A factor useful in gravity cfl computations. More...
 
double cflFactorCapillary () const
 A factor useful in gravity cfl computations. More...
 
double capillaryPressure (int cell_index, double saturation) const
 Capillary pressure. More...
 
double capillaryPressureDeriv (int c, double s) const
 Derivative of Capillary pressure. More...
 
double s_min (int c) const
 
double s_max (int c) const
 
double saturationFromCapillaryPressure (int cell_index, double cap_press) const
 Inverse of the capillary pressure function. More...
 
void writeSintefLegacyFormat (const std::string &grid_prefix) const
 Write permeability and porosity in the Sintef legacy format. More...
 

Protected Member Functions

void assignPorosity (Opm::DeckConstPtr deck, const std::vector< int > &global_cell)
 
void assignNTG (Opm::DeckConstPtr deck, const std::vector< int > &global_cell)
 
void assignSWCR (Opm::DeckConstPtr deck, const std::vector< int > &global_cell)
 
void assignSOWCR (Opm::DeckConstPtr deck, const std::vector< int > &global_cell)
 
void assignPermeability (Opm::DeckConstPtr deck, const std::vector< int > &global_cell, const double perm_threshold)
 
void assignRockTable (Opm::DeckConstPtr deck, const std::vector< int > &global_cell)
 
void readRocks (const std::string &rock_list_file)
 
RPImpl & asImpl ()
 

Protected Attributes

std::vector< double > porosity_
 
std::vector< double > ntg_
 
std::vector< double > swcr_
 
std::vector< double > sowcr_
 
std::vector< double > permeability_
 
std::vector< unsigned char > permfield_valid_
 
double density1_
 
double density2_
 
double viscosity1_
 
double viscosity2_
 
double cfl_factor_
 
double cfl_factor_gravity_
 
double cfl_factor_capillary_
 
std::vector< RockType > rock_
 
std::vector< int > cell_to_rock_
 
PermeabilityKind permeability_kind_
 

Detailed Description

template<int dim, class RPImpl, class RockType>
class Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >

A property class for incompressible two-phase flow.

Template Parameters
dimthe dimension of the space, used for giving permeability tensors the right size.

Member Typedef Documentation

template<int dim, class RPImpl, class RockType>
typedef OwnCMatrix Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::MutablePermTensor

Tensor type to be used for holding copies of permeability tensors.

template<int dim, class RPImpl, class RockType>
typedef ImmutableCMatrix Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::PermTensor

Tensor type for read-only access to permeability.

template<int dim, class RPImpl, class RockType>
typedef SharedCMatrix Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::SharedPermTensor

Tensor type for read and write access to permeability.

Member Enumeration Documentation

template<int dim, class RPImpl, class RockType>
anonymous enum

The number of phases.

Enumerator
NumberOfPhases 

Constructor & Destructor Documentation

template<int dim, class RPImpl , class RockType >
Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::ReservoirPropertyCommon ( )

Default constructor.

Member Function Documentation

template<int dim, class RPImpl , class RockType >
RPImpl & Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::asImpl ( )
protected
template<int dim, class RPImpl , class RockType >
void Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::assignNTG ( Opm::DeckConstPtr  deck,
const std::vector< int > &  global_cell 
)
protected
template<int dim, class RPImpl , class RockType >
void Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::assignPermeability ( Opm::DeckConstPtr  deck,
const std::vector< int > &  global_cell,
const double  perm_threshold 
)
protected

References Opm::zero().

template<int dim, class RPImpl , class RockType >
void Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::assignPorosity ( Opm::DeckConstPtr  deck,
const std::vector< int > &  global_cell 
)
protected
template<int dim, class RPImpl , class RockType >
void Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::assignRockTable ( Opm::DeckConstPtr  deck,
const std::vector< int > &  global_cell 
)
protected
template<int dim, class RPImpl , class RockType >
void Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::assignSOWCR ( Opm::DeckConstPtr  deck,
const std::vector< int > &  global_cell 
)
protected
template<int dim, class RPImpl , class RockType >
void Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::assignSWCR ( Opm::DeckConstPtr  deck,
const std::vector< int > &  global_cell 
)
protected
template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::capillaryPressure ( int  cell_index,
double  saturation 
) const

Capillary pressure.

Parameters
cell_indexindex of a grid cell.
saturationa saturation value.
Returns
capillary pressure at the given cell and saturation.

Referenced by Opm::TwophaseFluidWrapper::pc().

template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::capillaryPressureDeriv ( int  c,
double  s 
) const

Derivative of Capillary pressure.

Parameters
cell_indexindex of a grid cell.
saturationa saturation value.
Returns
capillary pressure at the given cell and saturation.

Referenced by Opm::TwophaseFluidWrapper::pc().

template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::cflFactor ( ) const

A factor useful in cfl computations.

Returns
the cfl factor.
template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::cflFactorCapillary ( ) const

A factor useful in gravity cfl computations.

Returns
the capillary cfl factor.
template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::cflFactorGravity ( ) const

A factor useful in gravity cfl computations.

Returns
the gravity cfl factor.
template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::densityDifference ( ) const

Difference of densities.

Returns
densityFirstPhase() - densitySecondPhase()
template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::densityFirstPhase ( ) const

Density of first (water) phase.

Returns
the density value.

Referenced by Opm::TwophaseFluidWrapper::density().

template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::densitySecondPhase ( ) const

Density of second (oil) phase.

Returns
the density value.

Referenced by Opm::TwophaseFluidWrapper::density().

template<int dim, class RPImpl , class RockType >
void Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::init ( Opm::DeckConstPtr  deck,
const std::vector< int > &  global_cell,
const double  perm_threshold = 0.0,
const std::string *  rock_list_filename = 0,
const bool  use_jfunction_scaling = true,
const double  sigma = 1.0,
const double  theta = 0.0 
)

Initialize from a grdecl file.

Parameters
deckthe deck holding the grdecl data.
global_cellthe mapping from cell indices to the logical cartesian indices of the grdecl file.
perm_thresholdlower threshold for permeability.
rock_list_filenameif non-null, the referred string gives the filename for the rock list.
use_jfunction_scalingif true, use j-function scaling of capillary pressure, if applicable.
sigmainterface tension for j-scaling, if applicable.
thetaangle for j-scaling, if applicable.
template<int dim, class RPImpl , class RockType >
void Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::init ( const int  num_cells,
const double  uniform_poro = 0.2,
const double  uniform_perm = 100.0*Opm::prefix::milli*Opm::unit::darcy 
)

Initialize a uniform reservoir.

Parameters
num_cellsnumber of cells in the grid.
uniform_porothe uniform porosity.
uniform_permthe uniform (scalar) permeability.
template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::ntg ( int  cell_index) const

Read-access to ntg.

Parameters
cell_indexindex of a grid cell.
Returns
ntg value of the cell.
template<int dim, class RPImpl , class RockType >
ReservoirPropertyCommon< dim, RPImpl, RockType >::PermTensor Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::permeability ( int  cell_index) const

Read-access to permeability.

Parameters
cell_indexindex of a grid cell.
Returns
permeability value of the cell.
template<int dim, class RPImpl , class RockType >
ReservoirPropertyCommon< dim, RPImpl, RockType >::SharedPermTensor Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::permeabilityModifiable ( int  cell_index)

Read- and write-access to permeability. Use with caution.

Parameters
cell_indexindex of a grid cell.
Returns
permeability value of the cell.
template<int dim, class RPImpl , class RockType >
template<class Vector >
void Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::phaseDensities ( int  ,
Vector &  density 
) const

Densities for both phases.

Template Parameters
Vectora class with size() and operator[].
Parameters
cell_indexindex of a grid cell (not used).
[out]densitythe phase densities. Expected to be of size 2 before (and after) the call.
template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::porosity ( int  cell_index) const

Read-access to porosity.

Parameters
cell_indexindex of a grid cell.
Returns
porosity value of the cell.
template<int dim, class RPImpl , class RockType >
void Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::readRocks ( const std::string &  rock_list_file)
protected
template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::s_max ( int  c) const
Parameters
cell_indexindex of a grid cell.
Returns
maximum saturation in given cell.

Referenced by Opm::TwophaseFluidWrapper::s_max().

template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::s_min ( int  c) const
Parameters
cell_indexindex of a grid cell.
Returns
minimum saturation in given cell.

Referenced by Opm::TwophaseFluidWrapper::s_min().

template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::saturationFromCapillaryPressure ( int  cell_index,
double  cap_press 
) const

Inverse of the capillary pressure function.

Parameters
cell_indexindex of a grid cell.
cap_pressa capillary pressure value.
Returns
the saturation at the given cell has the given capillary pressure.
template<int dim, class RPImpl , class RockType >
void Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::setDensities ( double  d1,
double  d2 
)

Set densitities of both faces.

Parameters
d1the densitity of the first (water) phase.
d2the densitity of the second (oil) phase.
template<int dim, class RPImpl , class RockType >
void Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::setViscosities ( double  v1,
double  v2 
)

Set viscosities of both faces.

Parameters
v1the viscosity of the first (water) phase.
v2the viscosity of the second (oil) phase.
template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::sowcr ( int  cell_index) const

Read-access to sowcr.

Parameters
cell_indexindex of a grid cell.
Returns
sowcr value of the cell.
template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::swcr ( int  cell_index) const

Read-access to swcr.

Parameters
cell_indexindex of a grid cell.
Returns
swcr value of the cell.
template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::viscosityFirstPhase ( ) const

Viscosity of first (water) phase.

Returns
the viscosity value.
template<int dim, class RPImpl , class RockType >
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::viscositySecondPhase ( ) const

Viscosity of second (oil) phase.

Returns
the viscosity value.
template<int dim, class RPImpl , class RockType >
void Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::writeSintefLegacyFormat ( const std::string &  grid_prefix) const

Write permeability and porosity in the Sintef legacy format.

Parameters
grid_prefixthe prefix of all files output by this function.

References Opm::DiagonalPerm, Opm::None, Opm::ScalarPerm, and Opm::TensorPerm.

Member Data Documentation

template<int dim, class RPImpl, class RockType>
std::vector<int> Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::cell_to_rock_
protected
template<int dim, class RPImpl, class RockType>
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::cfl_factor_
protected
template<int dim, class RPImpl, class RockType>
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::cfl_factor_capillary_
protected
template<int dim, class RPImpl, class RockType>
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::cfl_factor_gravity_
protected
template<int dim, class RPImpl, class RockType>
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::density1_
protected
template<int dim, class RPImpl, class RockType>
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::density2_
protected
template<int dim, class RPImpl, class RockType>
std::vector<double> Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::ntg_
protected
template<int dim, class RPImpl, class RockType>
std::vector<double> Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::permeability_
protected
template<int dim, class RPImpl, class RockType>
PermeabilityKind Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::permeability_kind_
protected
template<int dim, class RPImpl, class RockType>
std::vector<unsigned char> Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::permfield_valid_
protected
template<int dim, class RPImpl, class RockType>
std::vector<double> Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::porosity_
protected
template<int dim, class RPImpl, class RockType>
std::vector<RockType> Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::rock_
protected
template<int dim, class RPImpl, class RockType>
std::vector<double> Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::sowcr_
protected
template<int dim, class RPImpl, class RockType>
std::vector<double> Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::swcr_
protected
template<int dim, class RPImpl, class RockType>
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::viscosity1_
protected
template<int dim, class RPImpl, class RockType>
double Opm::ReservoirPropertyCommon< dim, RPImpl, RockType >::viscosity2_
protected

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