Opm::ReservoirPropertyCapillary< dim > Class Template Reference

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

#include <ReservoirPropertyCapillary.hpp>

Inheritance diagram for Opm::ReservoirPropertyCapillary< dim >:
Inheritance graph

Public Types

typedef ScalarMobility Mobility
 The (scalar) mobility type. More...
 
enum  
 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

double mobilityFirstPhase (int cell_index, double saturation) const
 Mobility of first (water) phase. More...
 
double mobilitySecondPhase (int cell_index, double saturation) const
 Mobility of second (oil) phase. More...
 
void phaseMobility (int phase_index, int cell_index, double saturation, double &phase_mob) const
 Phase mobility. More...
 
double totalMobility (int cell_index, double saturation) const
 Total mobility. More...
 
double fractionalFlow (int cell_index, double saturation) const
 Fractional flow (of the first phase). More...
 
template<class Vector >
void phaseMobilities (int cell_index, double saturation, Vector &mobility) const
 Mobilities for both phases. More...
 
template<class Vector >
void phaseMobilitiesDeriv (int c, double s, Vector &dmob) const
 
void computeCflFactors ()
 Computes cfl factors. Called from ReservoirPropertyCommon::init(). 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...
 
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)
 
ReservoirPropertyCapillary< dim > & 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< RockJfuncrock_
 
std::vector< int > cell_to_rock_
 
PermeabilityKind permeability_kind_
 

Detailed Description

template<int dim>
class Opm::ReservoirPropertyCapillary< dim >

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>
typedef ScalarMobility Opm::ReservoirPropertyCapillary< dim >::Mobility

The (scalar) mobility type.

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

Tensor type for read-only access to permeability.

Tensor type for read and write access to permeability.

Member Enumeration Documentation

anonymous enum
inherited

The number of phases.

Member Function Documentation

ReservoirPropertyCapillary< dim > & Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::asImpl ( )
protectedinherited
void Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::assignNTG ( Opm::DeckConstPtr  deck,
const std::vector< int > &  global_cell 
)
protectedinherited
void Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::assignPermeability ( Opm::DeckConstPtr  deck,
const std::vector< int > &  global_cell,
const double  perm_threshold 
)
protectedinherited
void Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::assignPorosity ( Opm::DeckConstPtr  deck,
const std::vector< int > &  global_cell 
)
protectedinherited
void Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::assignRockTable ( Opm::DeckConstPtr  deck,
const std::vector< int > &  global_cell 
)
protectedinherited
void Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::assignSOWCR ( Opm::DeckConstPtr  deck,
const std::vector< int > &  global_cell 
)
protectedinherited
void Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::assignSWCR ( Opm::DeckConstPtr  deck,
const std::vector< int > &  global_cell 
)
protectedinherited
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::capillaryPressure ( int  cell_index,
double  saturation 
) const
inherited

Capillary pressure.

Parameters
cell_indexindex of a grid cell.
saturationa saturation value.
Returns
capillary pressure at the given cell and saturation.
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::capillaryPressureDeriv ( int  c,
double  s 
) const
inherited

Derivative of Capillary pressure.

Parameters
cell_indexindex of a grid cell.
saturationa saturation value.
Returns
capillary pressure at the given cell and saturation.
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::cflFactor ( ) const
inherited

A factor useful in cfl computations.

Returns
the cfl factor.
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::cflFactorCapillary ( ) const
inherited

A factor useful in gravity cfl computations.

Returns
the capillary cfl factor.
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::cflFactorGravity ( ) const
inherited

A factor useful in gravity cfl computations.

Returns
the gravity cfl factor.
template<int dim>
void Opm::ReservoirPropertyCapillary< dim >::computeCflFactors ( )

Computes cfl factors. Called from ReservoirPropertyCommon::init().

References Opm::trace().

double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::densityDifference ( ) const
inherited

Difference of densities.

Returns
densityFirstPhase() - densitySecondPhase()
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::densityFirstPhase ( ) const
inherited

Density of first (water) phase.

Returns
the density value.
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::densitySecondPhase ( ) const
inherited

Density of second (oil) phase.

Returns
the density value.
template<int dim>
double Opm::ReservoirPropertyCapillary< dim >::fractionalFlow ( int  cell_index,
double  saturation 
) const

Fractional flow (of the first phase).

Parameters
cell_indexindex of a grid cell.
saturationa saturation value.
Returns
fractional flow value at the given cell and saturation.
void Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::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 
)
inherited

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.
void Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::init ( const int  num_cells,
const double  uniform_poro = 0.2,
const double  uniform_perm = 100.0*Opm::prefix::milli*Opm::unit::darcy 
)
inherited

Initialize a uniform reservoir.

Parameters
num_cellsnumber of cells in the grid.
uniform_porothe uniform porosity.
uniform_permthe uniform (scalar) permeability.
template<int dim>
double Opm::ReservoirPropertyCapillary< dim >::mobilityFirstPhase ( int  cell_index,
double  saturation 
) const

Mobility of first (water) phase.

Parameters
cell_indexindex of a grid cell.
saturationa saturation value.
Returns
mobility value of first phase at the given cell and saturation.
template<int dim>
double Opm::ReservoirPropertyCapillary< dim >::mobilitySecondPhase ( int  cell_index,
double  saturation 
) const

Mobility of second (oil) phase.

Parameters
cell_indexindex of a grid cell.
saturationa saturation value.
Returns
mobility value of second phase at the given cell and saturation.
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::ntg ( int  cell_index) const
inherited

Read-access to ntg.

Parameters
cell_indexindex of a grid cell.
Returns
ntg value of the cell.
PermTensor Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::permeability ( int  cell_index) const
inherited

Read-access to permeability.

Parameters
cell_indexindex of a grid cell.
Returns
permeability value of the cell.
SharedPermTensor Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::permeabilityModifiable ( int  cell_index)
inherited

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

Parameters
cell_indexindex of a grid cell.
Returns
permeability value of the cell.
void Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::phaseDensities ( int  ,
Vector &  density 
) const
inherited

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>
template<class Vector >
void Opm::ReservoirPropertyCapillary< dim >::phaseMobilities ( int  cell_index,
double  saturation,
Vector &  mobility 
) const

Mobilities for both phases.

Template Parameters
Vectora class with size() and operator[].
Parameters
cell_indexindex of a grid cell.
saturationa saturation value.
[out]mobilitythe phase mobilities at the given cell and saturation. Expected to be of size 2 before (and after) the call.

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

template<int dim>
template<class Vector >
void Opm::ReservoirPropertyCapillary< dim >::phaseMobilitiesDeriv ( int  c,
double  s,
Vector &  dmob 
) const
template<int dim>
void Opm::ReservoirPropertyCapillary< dim >::phaseMobility ( int  phase_index,
int  cell_index,
double  saturation,
double &  phase_mob 
) const

Phase mobility.

Parameters
phase_indexphase for which to compute mobility.
cell_indexindex of a grid cell.
saturationa saturation value.
[out]phase_mobphase mobility at the given cell and saturation.
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::porosity ( int  cell_index) const
inherited

Read-access to porosity.

Parameters
cell_indexindex of a grid cell.
Returns
porosity value of the cell.
void Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::readRocks ( const std::string &  rock_list_file)
protectedinherited
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::s_max ( int  c) const
inherited
Parameters
cell_indexindex of a grid cell.
Returns
maximum saturation in given cell.
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::s_min ( int  c) const
inherited
Parameters
cell_indexindex of a grid cell.
Returns
minimum saturation in given cell.
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::saturationFromCapillaryPressure ( int  cell_index,
double  cap_press 
) const
inherited

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.
void Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::setDensities ( double  d1,
double  d2 
)
inherited

Set densitities of both faces.

Parameters
d1the densitity of the first (water) phase.
d2the densitity of the second (oil) phase.
void Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::setViscosities ( double  v1,
double  v2 
)
inherited

Set viscosities of both faces.

Parameters
v1the viscosity of the first (water) phase.
v2the viscosity of the second (oil) phase.
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::sowcr ( int  cell_index) const
inherited

Read-access to sowcr.

Parameters
cell_indexindex of a grid cell.
Returns
sowcr value of the cell.
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::swcr ( int  cell_index) const
inherited

Read-access to swcr.

Parameters
cell_indexindex of a grid cell.
Returns
swcr value of the cell.
template<int dim>
double Opm::ReservoirPropertyCapillary< dim >::totalMobility ( int  cell_index,
double  saturation 
) const

Total mobility.

Parameters
cell_indexindex of a grid cell.
saturationa saturation value.
Returns
total mobility value at the given cell and saturation.
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::viscosityFirstPhase ( ) const
inherited

Viscosity of first (water) phase.

Returns
the viscosity value.
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::viscositySecondPhase ( ) const
inherited

Viscosity of second (oil) phase.

Returns
the viscosity value.
void Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::writeSintefLegacyFormat ( const std::string &  grid_prefix) const
inherited

Write permeability and porosity in the Sintef legacy format.

Parameters
grid_prefixthe prefix of all files output by this function.

Member Data Documentation

std::vector<int> Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::cell_to_rock_
protectedinherited
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::cfl_factor_
protectedinherited
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::cfl_factor_capillary_
protectedinherited
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::cfl_factor_gravity_
protectedinherited
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::density1_
protectedinherited
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::density2_
protectedinherited
std::vector<double> Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::ntg_
protectedinherited
std::vector<double> Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::permeability_
protectedinherited
PermeabilityKind Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::permeability_kind_
protectedinherited
std::vector<unsigned char> Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::permfield_valid_
protectedinherited
std::vector<double> Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::porosity_
protectedinherited
std::vector<RockJfunc > Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::rock_
protectedinherited
std::vector<double> Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::sowcr_
protectedinherited
std::vector<double> Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::swcr_
protectedinherited
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::viscosity1_
protectedinherited
double Opm::ReservoirPropertyCommon< dim, ReservoirPropertyCapillary< dim > , RockJfunc >::viscosity2_
protectedinherited

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