Opm Namespace Reference

Namespaces

 Details
 
 EclipseIOUtil
 
 EclipseWriterDetails
 
 Equil
 
 GridPropertyAccess
 
 ImplicitTransportDefault
 
 ImplicitTransportDetails
 
 ImplicitTransportLinAlgSupport
 
 parameter
 See ParameterGroup.hpp for how to use the parameter system.
 
 prefix
 Conversion prefix for units.
 
 spu_2p
 
 time
 
 UgGridHelpers
 
 unit
 
 utils
 

Classes

class  AdaptiveSimulatorTimer
 Simulation timer for adaptive time stepping. More...
 
class  AdaptiveTimeStepping
 
class  AnisotropicEikonal2d
 
class  BlackoilPhases
 
class  BlackoilPropertiesBasic
 
class  BlackoilPropertiesFromDeck
 
class  BlackoilPropertiesInterface
 
class  BlackoilPvtProperties
 
class  BlackoilState
 Simulator state for a blackoil simulator. More...
 
class  BlackoilStateToFluidState
 This is an light weight "impedance adaption" class with a well defined API for saturation and PVT functions. More...
 
class  CellQuadrature
 
class  CompressibleTpfa
 
struct  ContinueOnError
 
class  CornerPointChopper
 
class  DGBasisBoundedTotalDegree
 
class  DGBasisInterface
 Base class for Discontinuous Galerkin bases, intended for time-of-flight computations. More...
 
class  DGBasisMultilin
 
class  EclipseGridInspector
 A class for inspecting the contents of an eclipse file. More...
 
struct  EclipseUnits
 
class  EclipseWriter
 A class to write the reservoir state and the well state of a blackoil simulation to disk using the Eclipse binary format. More...
 
singleton  EclMaterialLawManager
 
struct  Event
 
class  ExplicitArraysFluidState
 This is a fluid state which translates global arrays and translates them to a subset of the fluid state API. More...
 
class  ExplicitArraysSatDerivativesFluidState
 This is a fluid state which translates global arrays and translates them to a subset of the fluid state API. More...
 
class  FaceQuadrature
 
class  Factory
 
class  FlowBCManager
 
class  GridManager
 
class  ImplicitAssembly
 
class  ImplicitTransport
 
class  IncompPropertiesBasic
 
class  IncompPropertiesFromDeck
 
class  IncompPropertiesInterface
 
struct  IncompPropertiesShadow
 
class  IncompPropertiesSinglePhase
 
class  IncompTpfa
 
class  IncompTpfaSinglePhase
 
struct  InjectionSpecification
 
class  LinearSolverFactory
 
class  LinearSolverInterface
 Abstract interface for linear solvers. More...
 
class  LinearSolverIstl
 Concrete class encapsulating some dune-istl linear solvers. More...
 
class  LinearSolverPetsc
 Concrete class encapsulating some Petsc linear solvers. More...
 
class  LinearSolverUmfpack
 Concrete class encapsulating the UMFPACK direct linear solver. More...
 
class  MinpvProcessor
 Transform a corner-point grid ZCORN field to account for MINPV processing. More...
 
class  MonotCubicInterpolator
 Represents one dimensional function f with single valued argument x that can be interpolated using monotone cubic interpolation. More...
 
class  NonuniformTableLinear
 This class uses linear interpolation to compute the value (and its derivative) of a function f sampled at possibly nonuniform points. If values outside the domain are sought, values will be extrapolated linearly. More...
 
class  OutputWriter
 
struct  PerfData
 
class  PhasePresence
 
struct  PhaseUsage
 
class  PIDAndIterationCountTimeStepControl
 
class  PIDTimeStepControl
 
class  PinchProcessor
 
struct  PosStruct
 
struct  ProductionSpecification
 
class  PvtConstCompr
 
class  PvtDead
 
class  PvtDeadSpline
 
class  PvtInterface
 
class  PvtLiveGas
 
class  PvtLiveOil
 
class  PvtPropertiesBasic
 
class  PvtPropertiesIncompFromDeck
 
class  RegionMapping
 
class  RegulaFalsi
 
class  ReorderSolverInterface
 
class  RockBasic
 
class  RockCompressibility
 
class  RockFromDeck
 
class  SaturationDerivativesTag
 
class  SaturationPropsBasic
 
class  SaturationPropsFromDeck
 Interface to saturation functions from deck. More...
 
class  SaturationPropsInterface
 
class  SimpleFluid2pWrappingProps
 
class  SimpleIterationCountTimeStepControl
 
class  SimulatorCompressibleTwophase
 Class collecting all necessary components for a two-phase simulation. More...
 
class  SimulatorIncompTwophase
 Class collecting all necessary components for a two-phase simulation. More...
 
struct  SimulatorOutput
 
class  SimulatorOutputBase
 
struct  SimulatorReport
 A struct for returning timing data from a simulator to its caller. More...
 
class  SimulatorState
 
class  SimulatorTimer
 
class  SimulatorTimerInterface
 Interface class for SimulatorTimer objects, to be improved. More...
 
class  SinglePointUpwindTwoPhase
 
class  SparseTable
 
class  SparseVector
 
class  ThermalGasPvtWrapper
 
class  ThermalOilPvtWrapper
 
class  ThermalWaterPvtWrapper
 
singleton  ThreePhaseMaterialTraits
 
struct  ThrowOnError
 
class  TimeStepControlInterface
 
class  TofDiscGalReorder
 
class  TofReorder
 
class  TransportSolverCompressibleTwophaseReorder
 
class  TransportSolverTwophaseImplicit
 
class  TransportSolverTwophaseInterface
 Base class for two-phase incompressible transport solvers. More...
 
class  TransportSolverTwophaseReorder
 Implements a reordering transport solver for incompressible two-phase flow. More...
 
class  TwophaseState
 Simulator state for a two-phase simulator. More...
 
class  UniformTableLinear
 This class uses linear interpolation to compute the value (and its derivative) of a function f sampled at uniform points. More...
 
struct  VAG
 
class  VelocityInterpolationConstant
 
class  VelocityInterpolationECVI
 
class  VelocityInterpolationInterface
 Abstract interface for velocity interpolation method classes. More...
 
class  WachspressCoord
 
struct  WarnAndContinueOnError
 
class  Watercut
 
class  WellCollection
 
struct  WellData
 
class  WellNode
 
struct  WellPhasesSummed
 
class  WellReport
 
class  WellsGroup
 
class  WellsGroupInterface
 
class  WellsManager
 
class  WellState
 The state of a set of wells. More...
 

Typedefs

typedef std::shared_ptr
< EclipseWriter
EclipseWriterPtr
 
typedef std::shared_ptr< const
EclipseWriter
EclipseWriterConstPtr
 
typedef std::map< std::string,
const std::vector< double > * > 
DataMap
 Intended to map strings (giving the output field names) to data. More...
 

Functions

std::pair< std::vector< double >
, std::vector< double > > 
computeFandPhi (const std::vector< double > &pv, const std::vector< double > &ftof, const std::vector< double > &rtof)
 Compute flow-capacity/storage-capacity based on time-of-flight. More...
 
double computeLorenz (const std::vector< double > &flowcap, const std::vector< double > &storagecap)
 Compute the Lorenz coefficient based on the F-Phi curve. More...
 
std::pair< std::vector< double >
, std::vector< double > > 
computeSweep (const std::vector< double > &flowcap, const std::vector< double > &storagecap)
 Compute sweep efficiency versus dimensionless time (PVI). More...
 
std::vector< std::tuple< int,
int, double > > 
computeWellPairs (const Wells &wells, const std::vector< double > &porevol, const std::vector< double > &ftracer, const std::vector< double > &btracer)
 Compute volumes associated with injector-producer pairs. More...
 
void extractColumn (const UnstructuredGrid &grid, std::vector< std::vector< int > > &columns)
 
SparseTable< int > cellNeighboursAcrossVertices (const UnstructuredGrid &grid)
 
void orderCounterClockwise (const UnstructuredGrid &grid, SparseTable< int > &nb)
 
void restoreOPM_XWELKeyword (const std::string &restart_filename, int report_step, WellState &wellState)
 restoreOPM_XWELKeyword Reading from the restart file, information stored under the OPM_XWEL keyword is in this method filled into an instance of a wellstate object. More...
 
void restoreSOLUTIONData (const std::string &restart_filename, int report_step, const EclipseState &eclipseState, const UnstructuredGrid &grid, const PhaseUsage &phaseUsage, SimulatorState &simulator_state)
 
void writeECLData (const UnstructuredGrid &grid, const DataMap &data, const int current_step, const double current_time, const boost::posix_time::ptime &current_date_time, const std::string &output_dir, const std::string &base_name)
 
void readVagGrid (std::istream &is, Opm::VAG &vag_grid)
 
void writeVagFormat (std::ostream &os, Opm::VAG &vag_grid)
 
template<typename T >
void readVector (std::istream &is, std::vector< T > &vec)
 
template<typename T >
void writeVector (std::ostream &os, std::vector< T > &vec, int n)
 
void readPosStruct (std::istream &is, int n, PosStruct &pos_struct)
 
void writePosStruct (std::ostream &os, PosStruct &pos_struct)
 
void vagToUnstructuredGrid (Opm::VAG &vag_grid, UnstructuredGrid &grid)
 
void unstructuredGridToVag (UnstructuredGrid &grid, Opm::VAG &vag_grid)
 
void writeVtkData (const std::array< int, 3 > &dims, const std::array< double, 3 > &cell_size, const DataMap &data, std::ostream &os)
 Vtk output for cartesian grids. More...
 
void writeVtkData (const UnstructuredGrid &grid, const DataMap &data, std::ostream &os)
 Vtk output for general grids. More...
 
void extractParallelGridInformationToISTL (boost::any &anyComm, const UnstructuredGrid &grid)
 Extracts the information about the data decomposition from the grid for dune-istl. More...
 
PhaseUsage phaseUsageFromDeck (Opm::EclipseStateConstPtr eclipseState)
 
PhaseUsage phaseUsageFromDeck (Opm::DeckConstPtr deck)
 
void extractPvtTableIndex (std::vector< int > &pvtTableIdx, Opm::DeckConstPtr deck, size_t numCompressed, const int *compressedToCartesianIdx)
 Helper function to create an array containing the (C-Style) PVT table index for each compressed cell from an Eclipse deck. More...
 
template<class State >
void initStateBasic (const UnstructuredGrid &grid, const IncompPropertiesInterface &props, const parameter::ParameterGroup &param, const double gravity, State &state)
 Initialize a twophase state from parameters. More...
 
template<class FaceCells , class CCI , class FCI , class State >
void initStateBasic (int number_of_cells, const int *global_cell, const int *cartdims, int number_of_faces, FaceCells face_cells, FCI begin_face_centroids, CCI begin_cell_centroids, int dimensions, const IncompPropertiesInterface &props, const parameter::ParameterGroup &param, const double gravity, State &state)
 
template<class State >
void initStateBasic (const UnstructuredGrid &grid, const BlackoilPropertiesInterface &props, const parameter::ParameterGroup &param, const double gravity, State &state)
 Initialize a blackoil state from parameters. More...
 
template<class FaceCells , class FCI , class CCI , class State >
void initStateBasic (int number_of_cells, const int *global_cell, const int *cartdims, int number_of_faces, FaceCells face_cells, FCI begin_face_centroids, CCI begin_cell_centroids, int dimensions, const BlackoilPropertiesInterface &props, const parameter::ParameterGroup &param, const double gravity, State &state)
 
template<class Props , class State >
void initStateFromDeck (const UnstructuredGrid &grid, const Props &props, Opm::DeckConstPtr deck, const double gravity, State &state)
 Initialize a state from input deck. More...
 
template<class Props , class State >
void initBlackoilStateFromDeck (const UnstructuredGrid &grid, const Props &props, Opm::DeckConstPtr deck, const double gravity, State &state)
 Initialize a blackoil state from input deck. More...
 
template<class FaceCells , class FCI , class CCI , class Props , class State >
void initBlackoilStateFromDeck (int number_of_cells, const int *global_cell, int number_of_faces, FaceCells face_cells, FCI begin_face_centroids, CCI begin_cell_centroids, int dimensions, const Props &props, Opm::DeckConstPtr deck, const double gravity, State &state)
 Initialize a blackoil state from input deck. More...
 
template<class FaceCells , class FCI , class CCI , class Props , class State >
void initStateFromDeck (int number_of_cells, const int *global_cell, int number_of_faces, FaceCells face_cells, FCI begin_face_centroids, CCI begin_cell_centroids, int dimensions, const Props &props, Opm::DeckConstPtr deck, const double gravity, State &state)
 Initialize a state from input deck. More...
 
template<class Props , class State >
void initBlackoilSurfvol (const UnstructuredGrid &grid, const Props &props, State &state)
 
template<class Props , class State >
void initBlackoilSurfvol (int number_of_cells, const Props &props, State &state)
 
template<class Props , class State >
void initBlackoilSurfvolUsingRSorRV (const UnstructuredGrid &grid, const Props &props, State &state)
 
template<class Props , class State >
void initBlackoilSurfvolUsingRSorRV (int number_of_cells, const Props &props, State &state)
 
template<class Grid >
void initStateEquil (const Grid &grid, const BlackoilPropertiesInterface &props, const Opm::DeckConstPtr deck, const Opm::EclipseStateConstPtr eclipseState, const double gravity, BlackoilState &state)
 
template<class Grid >
void initStateEquil (const Grid &grid, BlackoilPropertiesInterface &props, const Opm::DeckConstPtr deck, const Opm::EclipseStateConstPtr eclipseState, const double gravity, BlackoilState &state)
 
template<typename T >
void buildUniformMonotoneTable (const std::vector< double > &xv, const std::vector< T > &yv, const int samples, UniformTableLinear< T > &table)
 
std::vector< int > compressedToCartesian (const int num_cells, const int *global_cell)
 
int tableIndex (const std::vector< double > &table, double x)
 
double linearInterpolationDerivative (const std::vector< double > &xv, const std::vector< double > &yv, double x)
 
double linearInterpolation (const std::vector< double > &xv, const std::vector< double > &yv, double x)
 
double linearInterpolation (const std::vector< double > &xv, const std::vector< double > &yv, double x, int &ix1)
 
void computePorevolume (const UnstructuredGrid &grid, const double *porosity, std::vector< double > &porevol)
 Computes pore volume of all cells in a grid. More...
 
template<class T >
void computePorevolume (int number_of_cells, T begin_cell_volume, const double *porosity, std::vector< double > &porevol)
 Computes pore volume of all cells in a grid. More...
 
void computePorevolume (const UnstructuredGrid &grid, const double *porosity, const RockCompressibility &rock_comp, const std::vector< double > &pressure, std::vector< double > &porevol)
 Computes pore volume of all cells in a grid, with rock compressibility effects. More...
 
template<class T >
void computePorevolume (int number_of_cells, T begin_cell_volume, const double *porosity, const RockCompressibility &rock_comp, const std::vector< double > &pressure, std::vector< double > &porevol)
 Computes pore volume of all cells in a grid, with rock compressibility effects. More...
 
void computePorosity (const UnstructuredGrid &grid, const double *porosity_standard, const RockCompressibility &rock_comp, const std::vector< double > &pressure, std::vector< double > &porosity)
 Computes porosity of all cells in a grid, with rock compressibility effects. More...
 
void computeSaturatedVol (const std::vector< double > &pv, const std::vector< double > &s, double *sat_vol)
 Computes total saturated volumes over all grid cells. More...
 
void computeAverageSat (const std::vector< double > &pv, const std::vector< double > &s, double *aver_sat)
 Computes average saturations over all grid cells. More...
 
void computeInjectedProduced (const IncompPropertiesInterface &props, const std::vector< double > &s, const std::vector< double > &src, const double dt, double *injected, double *produced)
 Computes injected and produced volumes of all phases. Note 1: assumes that only the first phase is injected. Note 2: assumes that transport has been done with an implicit method, i.e. that the current state gives the mobilities used for the preceding timestep. More...
 
void computeTotalMobility (const Opm::IncompPropertiesInterface &props, const std::vector< int > &cells, const std::vector< double > &s, std::vector< double > &totmob)
 Computes total mobility for a set of saturation values. More...
 
void computeTotalMobilityOmega (const Opm::IncompPropertiesInterface &props, const std::vector< int > &cells, const std::vector< double > &s, std::vector< double > &totmob, std::vector< double > &omega)
 Computes total mobility and omega for a set of saturation values. More...
 
void computePhaseMobilities (const Opm::IncompPropertiesInterface &props, const std::vector< int > &cells, const std::vector< double > &s, std::vector< double > &pmobc)
 Computes phase mobilities for a set of saturation values. More...
 
void computeFractionalFlow (const Opm::IncompPropertiesInterface &props, const std::vector< int > &cells, const std::vector< double > &saturations, std::vector< double > &fractional_flows)
 
void computeTransportSource (const UnstructuredGrid &grid, const std::vector< double > &src, const std::vector< double > &faceflux, const double inflow_frac, const Wells *wells, const std::vector< double > &well_perfrates, std::vector< double > &transport_src)
 
void estimateCellVelocity (const UnstructuredGrid &grid, const std::vector< double > &face_flux, std::vector< double > &cell_velocity)
 Estimates a scalar cell velocity from face fluxes. More...
 
template<class CC , class FC , class FC1 , class CV >
void estimateCellVelocity (int number_of_cells, int number_of_faces, FC begin_face_centroids, FC1 face_cells, CC begin_cell_centroids, CV begin_cell_volumes, int dimension, const std::vector< double > &face_flux, std::vector< double > &cell_velocity)
 Estimates a scalar cell velocity from face fluxes. More...
 
void toWaterSat (const std::vector< double > &sboth, std::vector< double > &sw)
 
void toBothSat (const std::vector< double > &sw, std::vector< double > &sboth)
 
void wellsToSrc (const Wells &wells, const int num_cells, std::vector< double > &src)
 
void computeWDP (const Wells &wells, const UnstructuredGrid &grid, const std::vector< double > &saturations, const double *densities, const double gravity, const bool per_grid_cell, std::vector< double > &wdp)
 
template<class T >
void computeWDP (const Wells &wells, int number_of_cells, T begin_cell_centroids, const std::vector< double > &saturations, const double *densities, const double gravity, const bool per_grid_cell, std::vector< double > &wdp)
 
void computeFlowRatePerWell (const Wells &wells, const std::vector< double > &flow_rates_per_cell, std::vector< double > &flow_rates_per_well)
 
void computePhaseFlowRatesPerWell (const Wells &wells, const std::vector< double > &flow_rates_per_well_cell, const std::vector< double > &fractional_flows, std::vector< double > &phase_flow_per_well)
 
void computeInjectedProduced (const BlackoilPropertiesInterface &props, const BlackoilState &state, const std::vector< double > &transport_src, const double dt, double *injected, double *produced)
 Computes injected and produced surface volumes of all phases. Note 1: assumes that only the first phase is injected. Note 2: assumes that transport has been done with an implicit method, i.e. that the current state gives the mobilities used for the preceding timestep. Note 3: Gives surface volume values, not reservoir volumes (as the incompressible version of the function does). Also, assumes that transport_src is given in surface volumes for injector terms! More...
 
void computeTotalMobility (const Opm::BlackoilPropertiesInterface &props, const std::vector< int > &cells, const std::vector< double > &p, const std::vector< double > &z, const std::vector< double > &s, std::vector< double > &totmob)
 Computes total mobility for a set of saturation values. More...
 
void computeTotalMobilityOmega (const Opm::BlackoilPropertiesInterface &props, const std::vector< int > &cells, const std::vector< double > &p, const std::vector< double > &z, const std::vector< double > &s, std::vector< double > &totmob, std::vector< double > &omega)
 Computes total mobility and omega for a set of saturation values. More...
 
void computePhaseMobilities (const Opm::BlackoilPropertiesInterface &props, const std::vector< int > &cells, const std::vector< double > &p, const std::vector< double > &T, const std::vector< double > &z, const std::vector< double > &s, std::vector< double > &pmobc)
 Computes phase mobilities for a set of saturation values. More...
 
void computeFractionalFlow (const Opm::BlackoilPropertiesInterface &props, const std::vector< int > &cells, const std::vector< double > &p, const std::vector< double > &T, const std::vector< double > &z, const std::vector< double > &s, std::vector< double > &fractional_flows)
 
void computeSurfacevol (const int n, const int np, const double *A, const double *saturation, double *surfacevol)
 
void computeSaturation (const BlackoilPropertiesInterface &props, BlackoilState &state)
 Computes saturation from surface volume densities. More...
 
void computeTransportSource (const BlackoilPropertiesInterface &props, const Wells *wells, const WellState &well_state, std::vector< double > &transport_src)
 
template<typename FI >
bool isNondecreasing (const FI beg, const FI end)
 Detect if a sequence is nondecreasing. More...
 
template<class Functor >
void bracketZero (const Functor &f, const double x0, const double dx, double &a, double &b)
 
void no_delete (void const *)
 Custom deleter that does nothing. More...
 
template<typename T >
std::shared_ptr< T > share_obj (T &t)
 
template<class Grid >
std::vector< double > thresholdPressures (const ParseMode &parseMode, EclipseStateConstPtr eclipseState, const Grid &grid)
 Get a vector of pressure thresholds from EclipseState. This function looks at EQLOPTS, THPRES and EQLNUM to determine pressure thresholds. It does not consider the case where the threshold values are defaulted, in which case they should be determined from the initial, equilibrated simulation state. More...
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const UniformTableLinear< T > &t)
 
std::shared_ptr
< WellsGroupInterface
createWellWellsGroup (WellConstPtr well, size_t timeStep, const PhaseUsage &phase_usage)
 
std::shared_ptr
< WellsGroupInterface
createGroupWellsGroup (GroupConstPtr group, size_t timeStep, const PhaseUsage &phase_usage)
 

Variables

std::ostream & null_stream
 

Typedef Documentation

typedef std::map<std::string, const std::vector<double>*> Opm::DataMap

Intended to map strings (giving the output field names) to data.

typedef std::shared_ptr<const EclipseWriter> Opm::EclipseWriterConstPtr
typedef std::shared_ptr<EclipseWriter> Opm::EclipseWriterPtr

Function Documentation

template<class Functor >
void Opm::bracketZero ( const Functor &  f,
const double  x0,
const double  dx,
double &  a,
double &  b 
)
inline

Attempts to find an interval bracketing a zero by successive enlargement of search interval.

template<typename T >
void Opm::buildUniformMonotoneTable ( const std::vector< double > &  xv,
const std::vector< T > &  yv,
const int  samples,
UniformTableLinear< T > &  table 
)
SparseTable<int> Opm::cellNeighboursAcrossVertices ( const UnstructuredGrid grid)

For each cell, find indices of all cells sharing a vertex with it.

Parameters
[in]gridA grid object.
Returns
A table of neighbour cell-indices by cell.
std::vector<int> Opm::compressedToCartesian ( const int  num_cells,
const int *  global_cell 
)
void Opm::computeAverageSat ( const std::vector< double > &  pv,
const std::vector< double > &  s,
double *  aver_sat 
)

Computes average saturations over all grid cells.

Parameters
[in]pvthe pore volume by cell.
[in]ssaturation values (for all P phases)
[out]aver_satmust point to a valid array with P elements, where P = s.size()/pv.size(). For each phase p, we compute aver_sat_p = (sum_i s_p_i pv_i) / (sum_i pv_i).
std::pair<std::vector<double>, std::vector<double> > Opm::computeFandPhi ( const std::vector< double > &  pv,
const std::vector< double > &  ftof,
const std::vector< double > &  rtof 
)

Compute flow-capacity/storage-capacity based on time-of-flight.

The F-Phi curve is an analogue to the fractional flow curve in a 1D displacement. It can be used to compute other interesting diagnostic quantities such as the Lorenz coefficient. For a technical description see Shavali et al. (SPE 146446), Shook and Mitchell (SPE 124625).

Parameters
[in]pvpore volumes of each cell
[in]ftofforward (time from injector) time-of-flight values for each cell
[in]rtofreverse (time to producer) time-of-flight values for each cell
Returns
a pair of vectors, the first containing F (flow capacity) the second containing Phi (storage capacity).
void Opm::computeFlowRatePerWell ( const Wells wells,
const std::vector< double > &  flow_rates_per_cell,
std::vector< double > &  flow_rates_per_well 
)

Computes (sums) the flow rate for each well.

Parameters
[in]wellsThe wells for which the flow rate should be computed.
[in]flow_rates_per_cellFlow rates per well cells. Should ordered the same way as wells.
[out]flow_rates_per_wellWill contain the summed up flow_rates for each well.
void Opm::computeFractionalFlow ( const Opm::BlackoilPropertiesInterface props,
const std::vector< int > &  cells,
const std::vector< double > &  p,
const std::vector< double > &  T,
const std::vector< double > &  z,
const std::vector< double > &  s,
std::vector< double > &  fractional_flows 
)

Computes the fractional flow for each cell in the cells argument

Parameters
[in]propsrock and fluid properties
[in]cellscells with which the saturation values are associated
[in]ppressure (one value per cell)
[in]Ttemperature(one value per cell)
[in]zsurface-volume values (for all P phases)
[in]ssaturation values (for all phases)
[out]fractional_flowthe fractional flow for each phase for each cell.
void Opm::computeFractionalFlow ( const Opm::IncompPropertiesInterface props,
const std::vector< int > &  cells,
const std::vector< double > &  saturations,
std::vector< double > &  fractional_flows 
)

Computes the fractional flow for each cell in the cells argument

Parameters
[in]propsrock and fluid properties
[in]cellscells with which the saturation values are associated
[in]saturationssaturation values (for all phases)
[out]fractional_flowthe fractional flow for each phase for each cell.
void Opm::computeInjectedProduced ( const BlackoilPropertiesInterface &  props,
const BlackoilState &  state,
const std::vector< double > &  transport_src,
const double  dt,
double *  injected,
double *  produced 
)

Computes injected and produced surface volumes of all phases. Note 1: assumes that only the first phase is injected. Note 2: assumes that transport has been done with an implicit method, i.e. that the current state gives the mobilities used for the preceding timestep. Note 3: Gives surface volume values, not reservoir volumes (as the incompressible version of the function does). Also, assumes that transport_src is given in surface volumes for injector terms!

Parameters
[in]propsfluid and rock properties.
[in]statestate variables (pressure, sat, surfvol)
[in]transport_srcif < 0: total resv outflow, if > 0: first phase surfv inflow
[in]dttimestep used
[out]injectedmust point to a valid array with P elements, where P = s.size()/src.size().
[out]producedmust also point to a valid array with P elements.
void Opm::computeInjectedProduced ( const IncompPropertiesInterface &  props,
const std::vector< double > &  s,
const std::vector< double > &  src,
const double  dt,
double *  injected,
double *  produced 
)

Computes injected and produced volumes of all phases. Note 1: assumes that only the first phase is injected. Note 2: assumes that transport has been done with an implicit method, i.e. that the current state gives the mobilities used for the preceding timestep.

Parameters
[in]propsfluid and rock properties.
[in]ssaturation values (for all P phases)
[in]srcif < 0: total outflow, if > 0: first phase inflow.
[in]dttimestep used
[out]injectedmust point to a valid array with P elements, where P = s.size()/src.size().
[out]producedmust also point to a valid array with P elements.
double Opm::computeLorenz ( const std::vector< double > &  flowcap,
const std::vector< double > &  storagecap 
)

Compute the Lorenz coefficient based on the F-Phi curve.

The Lorenz coefficient is a measure of heterogeneity. It is equal to twice the area between the F-Phi curve and the F = Phi line. The coefficient can vary from zero to one. If the coefficient is zero (so the F-Phi curve is a straight line) we have perfect piston-like displacement while a coefficient of one indicates infinitely heterogenous displacement (essentially no sweep).

Note: The coefficient is analogous to the Gini coefficient of economic theory, where the name Lorenz curve is applied to what we call the F-Phi curve.

Parameters
[in]flowcapflow capacity (F) as from computeFandPhi()
[in]storagecapstorage capacity (Phi) as from computeFandPhi()
Returns
the Lorenz coefficient
void Opm::computePhaseFlowRatesPerWell ( const Wells wells,
const std::vector< double > &  flow_rates_per_well_cell,
const std::vector< double > &  fractional_flows,
std::vector< double > &  phase_flow_per_well 
)

Computes the phase flow rate per well

Parameters
[in]wellsThe wells for which the flow rate should be computed
[in]flow_rates_per_well_cellThe total flow rate for each cell (ordered the same way as the wells struct
[in]fractional_flowsthe fractional flow for each cell in each well
[out]phase_flow_per_wellWill contain the phase flow per well
void Opm::computePhaseMobilities ( const Opm::BlackoilPropertiesInterface props,
const std::vector< int > &  cells,
const std::vector< double > &  p,
const std::vector< double > &  T,
const std::vector< double > &  z,
const std::vector< double > &  s,
std::vector< double > &  pmobc 
)

Computes phase mobilities for a set of saturation values.

Parameters
[in]propsrock and fluid properties
[in]cellscells with which the saturation values are associated
[in]ppressure (one value per cell)
[in]Ttemperature (one value per cell)
[in]zsurface-volume values (for all P phases)
[in]ssaturation values (for all phases)
[out]pmobcphase mobilities (for all phases).
void Opm::computePhaseMobilities ( const Opm::IncompPropertiesInterface props,
const std::vector< int > &  cells,
const std::vector< double > &  s,
std::vector< double > &  pmobc 
)

Computes phase mobilities for a set of saturation values.

Parameters
[in]propsrock and fluid properties
[in]cellscells with which the saturation values are associated
[in]ssaturation values (for all phases)
[out]pmobcphase mobilities (for all phases).
void Opm::computePorevolume ( const UnstructuredGrid grid,
const double *  porosity,
std::vector< double > &  porevol 
)

Computes pore volume of all cells in a grid.

Parameters
[in]grida grid
[in]porosityarray of grid.number_of_cells porosity values
[out]porevolthe pore volume by cell.
template<class T >
void Opm::computePorevolume ( int  number_of_cells,
begin_cell_volume,
const double *  porosity,
std::vector< double > &  porevol 
)

Computes pore volume of all cells in a grid.

Parameters
[in]number_of_cellsThe number of cells of the grid.
[in]begin_cell_volumeIterator to the volume of the first cell.
[in]porosityarray of grid.number_of_cells porosity values
[out]porevolthe pore volume by cell.
void Opm::computePorevolume ( const UnstructuredGrid grid,
const double *  porosity,
const RockCompressibility &  rock_comp,
const std::vector< double > &  pressure,
std::vector< double > &  porevol 
)

Computes pore volume of all cells in a grid, with rock compressibility effects.

Parameters
[in]grida grid
[in]porosityarray of grid.number_of_cells porosity values (at reference pressure)
[in]rock_comprock compressibility properties
[in]pressurepressure by cell
[out]porevolthe pore volume by cell.
template<class T >
void Opm::computePorevolume ( int  number_of_cells,
begin_cell_volumes,
const double *  porosity,
const RockCompressibility &  rock_comp,
const std::vector< double > &  pressure,
std::vector< double > &  porevol 
)

Computes pore volume of all cells in a grid, with rock compressibility effects.

Parameters
[in]number_of_cellsThe number of cells of the grid.
[in]Pointerto/ Iterator at the first cell volume.
[in]porosityarray of grid.number_of_cells porosity values
[in]rock_comprock compressibility properties
[in]pressurepressure by cell
[out]porevolthe pore volume by cell.
[in]number_of_cellsThe number of cells of the grid.
[in]porosityarray of grid.number_of_cells porosity values
[in]rock_comprock compressibility properties
[in]pressurepressure by cell
[out]porevolthe pore volume by cell.

References Opm::RockCompressibility::poroMult().

void Opm::computePorosity ( const UnstructuredGrid grid,
const double *  porosity_standard,
const RockCompressibility &  rock_comp,
const std::vector< double > &  pressure,
std::vector< double > &  porosity 
)

Computes porosity of all cells in a grid, with rock compressibility effects.

Parameters
[in]grida grid
[in]porosity_standardarray of grid.number_of_cells porosity values (at reference presure)
[in]rock_comprock compressibility properties
[in]pressurepressure by cell
[out]porosityporosity (at reservoir condition)
void Opm::computeSaturatedVol ( const std::vector< double > &  pv,
const std::vector< double > &  s,
double *  sat_vol 
)

Computes total saturated volumes over all grid cells.

Parameters
[in]pvthe pore volume by cell.
[in]ssaturation values (for all P phases)
[out]sat_volmust point to a valid array with P elements, where P = s.size()/pv.size(). For each phase p, we compute sat_vol_p = sum_i s_p_i pv_i
void Opm::computeSaturation ( const BlackoilPropertiesInterface &  props,
BlackoilState &  state 
)

Computes saturation from surface volume densities.

Referenced by initBlackoilStateFromDeck().

void Opm::computeSurfacevol ( const int  n,
const int  np,
const double *  A,
const double *  saturation,
double *  surfacevol 
)

Computes the surface volume densities from saturations by the formula z = A s for a number of data points, where z is the surface volume density, s is the saturation (both as column vectors) and A is the phase-to-component relation matrix.

Parameters
[in]nnumber of data points
[in]npnumber of phases, must be 2 or 3
[in]Aarray containing n square matrices of size num_phases, in Fortran ordering, typically the output of a call to the matrix() method of a BlackoilProperties* class.
[in]saturationconcatenated saturation values (for all P phases)
[out]surfacevolconcatenated surface-volume values (for all P phases)
std::pair<std::vector<double>, std::vector<double> > Opm::computeSweep ( const std::vector< double > &  flowcap,
const std::vector< double > &  storagecap 
)

Compute sweep efficiency versus dimensionless time (PVI).

The sweep efficiency is analogue to 1D displacement using the F-Phi curve as flux function.

Parameters
[in]flowcapflow capacity (F) as from computeFandPhi()
[in]storagecapstorage capacity (Phi) as from computeFandPhi()
Returns
a pair of vectors, the first containing Ev (sweep efficiency) the second containing tD (dimensionless time).
void Opm::computeTotalMobility ( const Opm::BlackoilPropertiesInterface props,
const std::vector< int > &  cells,
const std::vector< double > &  p,
const std::vector< double > &  z,
const std::vector< double > &  s,
std::vector< double > &  totmob 
)

Computes total mobility for a set of saturation values.

Parameters
[in]propsrock and fluid properties
[in]cellscells with which the saturation values are associated
[in]ppressure (one value per cell)
[in]zsurface-volume values (for all P phases)
[in]ssaturation values (for all phases)
[out]totmobtotal mobilities.
void Opm::computeTotalMobility ( const Opm::IncompPropertiesInterface props,
const std::vector< int > &  cells,
const std::vector< double > &  s,
std::vector< double > &  totmob 
)

Computes total mobility for a set of saturation values.

Parameters
[in]propsrock and fluid properties
[in]cellscells with which the saturation values are associated
[in]ssaturation values (for all phases)
[out]totmobtotal mobilities.
void Opm::computeTotalMobilityOmega ( const Opm::BlackoilPropertiesInterface props,
const std::vector< int > &  cells,
const std::vector< double > &  p,
const std::vector< double > &  z,
const std::vector< double > &  s,
std::vector< double > &  totmob,
std::vector< double > &  omega 
)

Computes total mobility and omega for a set of saturation values.

Parameters
[in]propsrock and fluid properties
[in]cellscells with which the saturation values are associated
[in]ppressure (one value per cell)
[in]zsurface-volume values (for all P phases)
[in]ssaturation values (for all phases)
[out]totmobtotal mobility
[out]omegafractional-flow weighted fluid densities.
void Opm::computeTotalMobilityOmega ( const Opm::IncompPropertiesInterface props,
const std::vector< int > &  cells,
const std::vector< double > &  s,
std::vector< double > &  totmob,
std::vector< double > &  omega 
)

Computes total mobility and omega for a set of saturation values.

Parameters
[in]propsrock and fluid properties
[in]cellscells with which the saturation values are associated
[in]ssaturation values (for all phases)
[out]totmobtotal mobility
[out]omegafractional-flow weighted fluid densities.
void Opm::computeTransportSource ( const BlackoilPropertiesInterface &  props,
const Wells wells,
const WellState &  well_state,
std::vector< double > &  transport_src 
)

Compute two-phase transport source terms from well terms. Note: Unlike the incompressible version of this function, this version computes surface volume injection rates, production rates are still total reservoir volumes.

Parameters
[in]propsFluid and rock properties.
[in]wellsWells data structure.
[in]well_stateWell pressures and fluxes.
[out]transport_srcThe transport source terms. They are to be interpreted depending on sign: (+) positive inflow of first (water) phase (surface volume), (-) negative total outflow of both phases (reservoir volume).
void Opm::computeTransportSource ( const UnstructuredGrid grid,
const std::vector< double > &  src,
const std::vector< double > &  faceflux,
const double  inflow_frac,
const Wells wells,
const std::vector< double > &  well_perfrates,
std::vector< double > &  transport_src 
)

Compute two-phase transport source terms from face fluxes, and pressure equation source terms. This puts boundary flows into the source terms for the transport equation.

Parameters
[in]gridThe grid used.
[in]srcPressure eq. source terms. The sign convention is: (+) positive total inflow (positive velocity divergence) (-) negative total outflow
[in]facefluxSigned face fluxes, typically the result from a flow solver.
[in]inflow_fracFraction of inflow (boundary and source terms) that consists of first phase. Example: if only water is injected, inflow_frac == 1.0. Note: it is not possible (with this method) to use different fractions for different inflow sources, be they source terms of boundary flows.
[in]wellsWells data structure, or null if no wells.
[in]well_perfratesVolumetric flow rates per well perforation.
[out]transport_srcThe transport source terms. They are to be interpreted depending on sign: (+) positive inflow of first phase (water) (-) negative total outflow of both phases
void Opm::computeWDP ( const Wells wells,
const UnstructuredGrid grid,
const std::vector< double > &  saturations,
const double *  densities,
const double  gravity,
const bool  per_grid_cell,
std::vector< double > &  wdp 
)

Computes the WDP for each well.

Parameters
[in]wellsWells that need their wdp calculated.
[in]gridThe associated grid to make cell lookups.
[in]saturationsA vector of weights for each cell for each phase in the grid (or well, see per_grid_cell parameter). So for cell i, saturations[i*densities.size() + p] should give the weight of phase p in cell i.
[in]densitiesDensity for each phase.
[out]wdpWill contain, for each well, the wdp of the well.
[in]per_grid_cellWhether or not the saturations are per grid cell or per well cell.
template<class T >
void Opm::computeWDP ( const Wells wells,
int  number_of_cells,
begin_cell_centroids,
const std::vector< double > &  saturations,
const double *  densities,
const double  gravity,
const bool  per_grid_cell,
std::vector< double > &  wdp 
)

Computes the WDP for each well.

Parameters
[in]wellsWells that need their wdp calculated.
[in]number_of_cellsThe number of cells in the grid.
[in]begin_cell_centroidsPointer/Iterator to the first cell centroid.
[in]saturationsA vector of weights for each cell for each phase in the grid (or well, see per_grid_cell parameter). So for cell i, saturations[i*densities.size() + p] should give the weight of phase p in cell i.
[in]densitiesDensity for each phase.
[out]wdpWill contain, for each well, the wdp of the well.
[in]per_grid_cellWhether or not the saturations are per grid cell or per well cell.

References Wells::depth_ref, Opm::UgGridHelpers::getCoordinate(), Opm::UgGridHelpers::increment(), Wells::number_of_wells, Wells::well_cells, and Wells::well_connpos.

std::vector<std::tuple<int, int, double> > Opm::computeWellPairs ( const Wells wells,
const std::vector< double > &  porevol,
const std::vector< double > &  ftracer,
const std::vector< double > &  btracer 
)

Compute volumes associated with injector-producer pairs.

Parameters
[in]wellswells structure, containing NI injector wells and NP producer wells.
[in]porevolpore volume of each grid cell
[in]ftracerarray of forward (injector) tracer values, NI per cell
[in]btracerarray of backward (producer) tracer values, NP per cell
Returns
a vector of tuples, one tuple for each injector-producer pair, where the first and second elements are well indices for the injector and producer, and the third element is the pore volume associated with that pair.
std::shared_ptr<WellsGroupInterface> Opm::createGroupWellsGroup ( GroupConstPtr  group,
size_t  timeStep,
const PhaseUsage &  phase_usage 
)

Creates the WellsGroupInterface for the given Group

Parameters
[in]groupthe Group to construct object for
[in]timeStepthe time step in question
[in]thephase usage
std::shared_ptr<WellsGroupInterface> Opm::createWellWellsGroup ( WellConstPtr  well,
size_t  timeStep,
const PhaseUsage &  phase_usage 
)

Creates the WellsGroupInterface for the given well

Parameters
[in]wellthe Well to construct object for
[in]timeStepthe time step in question
[in]thephase usage
void Opm::estimateCellVelocity ( const UnstructuredGrid grid,
const std::vector< double > &  face_flux,
std::vector< double > &  cell_velocity 
)

Estimates a scalar cell velocity from face fluxes.

Parameters
[in]grida grid
[in]face_fluxsigned per-face fluxes
[out]cell_velocitythe estimated velocities.
template<class CC , class FC , class FC1 , class CV >
void Opm::estimateCellVelocity ( int  number_of_cells,
int  number_of_faces,
FC  begin_face_centroids,
FC1  face_cells,
CC  begin_cell_centroids,
CV  begin_cell_volumes,
int  dimension,
const std::vector< double > &  face_flux,
std::vector< double > &  cell_velocity 
)

Estimates a scalar cell velocity from face fluxes.

Parameters
[in]number_of_cellsThe number of cells of the grid
[in]number_of_facesThe number of cells of the grid
[in]begin_face_centroidsIterator pointing to first face centroid.
[in]face_cellsMapping from faces to connected cells.
[in]dimensionsThe dimensions of the grid.
[in]begin_cell_centroidsIterator pointing to first cell centroid.
[in]face_fluxsigned per-face fluxes
[out]cell_velocitythe estimated velocities.
[in]number_of_cellsThe number of cells of the grid
[in]begin_face_centroidsIterator pointing to first face centroid.
[in]face_cellsMapping from faces to connected cells.
[in]dimensionsThe dimensions of the grid.
[in]begin_cell_centroidsIterator pointing to first cell centroid.
[in]face_fluxsigned per-face fluxes
[out]cell_velocitythe estimated velocities.

References Opm::unit::perm_details::flux, Opm::UgGridHelpers::getCoordinate(), and Opm::UgGridHelpers::increment().

void Opm::extractColumn ( const UnstructuredGrid grid,
std::vector< std::vector< int > > &  columns 
)
inline

Extract each column of the grid.

Note
Assumes the pillars of the grid are all vertically aligned.
Parameters
gridThe grid from which to extract the columns.
columnswill for each (i, j) where (i, j) represents a non-empty column, contain the cell indices contained in the column centered at (i, j) in the second variable, and i+jN in the first variable.

References UnstructuredGrid::cartdims, UnstructuredGrid::global_cell, and UnstructuredGrid::number_of_cells.

void Opm::extractParallelGridInformationToISTL ( boost::any &  anyComm,
const UnstructuredGrid grid 
)
inline

Extracts the information about the data decomposition from the grid for dune-istl.

In the case that grid is a parallel grid this method will query it to get the information about the data decompoisition and convert it to the format expected by the linear algebra of dune-istl. for UnstructuredGrid this function doesn't do anything.

Parameters
anyCommThe handle to store the information in. If grid is a parallel grid then this will ecapsulate an instance of ParallelISTLInformation.
gridThe grid to inspect.
void Opm::extractPvtTableIndex ( std::vector< int > &  pvtTableIdx,
Opm::DeckConstPtr  deck,
size_t  numCompressed,
const int *  compressedToCartesianIdx 
)

Helper function to create an array containing the (C-Style) PVT table index for each compressed cell from an Eclipse deck.

This function assumes that the degrees of freedom where PVT properties need to be calculated are grid cells. The main point of this function is to avoid code duplication because the Eclipse deck only contains Fortran-style PVT table indices which start at 1 instead of 0 and – more relevantly – it uses logically cartesian cell indices to specify the table index of a cell while the classes which use the PvtInterface implementations usually use compressed cells.

template<class Props , class State >
void Opm::initBlackoilStateFromDeck ( const UnstructuredGrid grid,
const Props &  props,
Opm::DeckConstPtr  deck,
const double  gravity,
State &  state 
)

Initialize a blackoil state from input deck.

Initialize a two-phase water-oil blackoil state from input deck. If EQUIL is present:

  • saturation is set according to the water-oil contact,
  • pressure is set to hydrostatic equilibrium. Otherwise:
  • saturation is set according to SWAT,
  • pressure is set according to PRESSURE. In addition, this function sets surfacevol.

References UnstructuredGrid::cell_centroids, UnstructuredGrid::dimensions, UnstructuredGrid::face_centroids, Opm::UgGridHelpers::faceCells(), UnstructuredGrid::global_cell, UnstructuredGrid::number_of_cells, and UnstructuredGrid::number_of_faces.

template<class FaceCells , class FCI , class CCI , class Props , class State >
void Opm::initBlackoilStateFromDeck ( int  number_of_cells,
const int *  global_cell,
int  number_of_faces,
FaceCells  face_cells,
FCI  begin_face_centroids,
CCI  begin_cell_centroids,
int  dimensions,
const Props &  props,
Opm::DeckConstPtr  deck,
const double  gravity,
State &  state 
)

Initialize a blackoil state from input deck.

References computeSaturation(), initBlackoilSurfvolUsingRSorRV(), and initStateFromDeck().

template<class Props , class State >
void Opm::initBlackoilSurfvol ( const UnstructuredGrid grid,
const Props &  props,
State &  state 
)

Initialize surface volume from pressure and saturation by z = As. Here saturation is used as an intial guess for z in the computation of A.

References UnstructuredGrid::number_of_cells.

template<class Props , class State >
void Opm::initBlackoilSurfvol ( int  number_of_cells,
const Props &  props,
State &  state 
)
template<class Props , class State >
void Opm::initBlackoilSurfvolUsingRSorRV ( const UnstructuredGrid grid,
const Props &  props,
State &  state 
)

Initialize surface volume from pressure and saturation by z = As. Here the solution gas/oil ratio or vapor oil/gas ratio is used to compute an intial z for the computation of A.

References UnstructuredGrid::number_of_cells.

Referenced by initBlackoilStateFromDeck(), and initStateEquil().

template<class Props , class State >
void Opm::initBlackoilSurfvolUsingRSorRV ( int  number_of_cells,
const Props &  props,
State &  state 
)
template<class State >
void Opm::initStateBasic ( const UnstructuredGrid grid,
const IncompPropertiesInterface &  props,
const parameter::ParameterGroup &  param,
const double  gravity,
State &  state 
)

Initialize a twophase state from parameters.

Initialize a two-phase state from parameters. The following parameters are accepted (defaults):

  • convection_testcase (false) – Water in the 'left' part of the grid.
  • ref_pressure (100) – Initial pressure in bar for all cells (if convection_testcase is true), or pressure at woc depth.
  • segregation_testcase (false) – Water above the woc instead of below.
  • water_oil_contact (none) – Depth of water-oil contact (woc).
  • init_saturation (none) – Initial water saturation for all cells.

If convection_testcase is true, the saturation is initialised as indicated, and pressure is initialised to a constant value ('ref_pressure'). If segregation_testcase is true, the saturation is initialised as indicated, and pressure is initialised hydrostatically. Otherwise we have 3 cases:

  1. If 'water_oil_contact' is given, saturation is initialised accordingly.
  2. If 'water_oil_contact' is not given, but 'init_saturation' is given, water saturation is set to that value everywhere.
  3. If neither are given, water saturation is set to minimum.

In all three cases, pressure is initialised hydrostatically. In case 2) and 3), the depth of the first cell is used as reference depth.

References UnstructuredGrid::cartdims, UnstructuredGrid::cell_centroids, UnstructuredGrid::dimensions, UnstructuredGrid::face_centroids, Opm::UgGridHelpers::faceCells(), UnstructuredGrid::global_cell, UnstructuredGrid::number_of_cells, and UnstructuredGrid::number_of_faces.

Referenced by initStateBasic().

template<class FaceCells , class CCI , class FCI , class State >
void Opm::initStateBasic ( int  number_of_cells,
const int *  global_cell,
const int *  cartdims,
int  number_of_faces,
FaceCells  face_cells,
FCI  begin_face_centroids,
CCI  begin_cell_centroids,
int  dimensions,
const IncompPropertiesInterface &  props,
const parameter::ParameterGroup &  param,
const double  gravity,
State &  state 
)

Initialize a two-phase state from parameters. The following parameters are accepted (defaults):

  • convection_testcase (false) – Water in the 'left' part of the grid.
  • ref_pressure (100) – Initial pressure in bar for all cells (if convection_testcase is true), or pressure at woc depth.
  • segregation_testcase (false) – Water above the woc instead of below.
  • water_oil_contact (none) – Depth of water-oil contact (woc).
  • init_saturation (none) – Initial water saturation for all cells.

If convection_testcase is true, the saturation is initialised as indicated, and pressure is initialised to a constant value ('ref_pressure'). If segregation_testcase is true, the saturation is initialised as indicated, and pressure is initialised hydrostatically. Otherwise we have 3 cases:

  1. If 'water_oil_contact' is given, saturation is initialised accordingly.
  2. If 'water_oil_contact' is not given, but 'init_saturation' is given, water saturation is set to that value everywhere.
  3. If neither are given, water saturation is set to minimum.

In all three cases, pressure is initialised hydrostatically. In case 2) and 3), the depth of the first cell is used as reference depth.

References Opm::unit::barsa, Opm::IncompPropertiesInterface::density(), Opm::parameter::ParameterGroup::get(), Opm::UgGridHelpers::getCoordinate(), Opm::parameter::ParameterGroup::getDefault(), Opm::unit::gravity, Opm::parameter::ParameterGroup::has(), Opm::IncompPropertiesInterface::numCells(), and Opm::IncompPropertiesInterface::numPhases().

template<class State >
void Opm::initStateBasic ( const UnstructuredGrid grid,
const BlackoilPropertiesInterface &  props,
const parameter::ParameterGroup &  param,
const double  gravity,
State &  state 
)

Initialize a blackoil state from parameters.

Initialize a blackoil state from parameters. The following parameters are accepted (defaults):

  • convection_testcase (false) – Water in the 'left' part of the grid.
  • ref_pressure (100) – Initial pressure in bar for all cells (if convection_testcase is true), or pressure at woc depth.
  • water_oil_contact (none) – Depth of water-oil contact (woc). If convection_testcase is true, the saturation is initialised as indicated, and pressure is initialised to a constant value ('ref_pressure'). Otherwise we have 2 cases:

If 'water_oil_contact' is given, saturation is initialised accordingly.

  1. Water saturation is set to minimum. In both cases, pressure is initialised hydrostatically. In case 2., the depth of the first cell is used as reference depth.

References UnstructuredGrid::cartdims, UnstructuredGrid::cell_centroids, UnstructuredGrid::dimensions, UnstructuredGrid::face_centroids, Opm::UgGridHelpers::faceCells(), UnstructuredGrid::global_cell, initStateBasic(), UnstructuredGrid::number_of_cells, and UnstructuredGrid::number_of_faces.

template<class FaceCells , class FCI , class CCI , class State >
void Opm::initStateBasic ( int  number_of_cells,
const int *  global_cell,
const int *  cartdims,
int  number_of_faces,
FaceCells  face_cells,
FCI  begin_face_centroids,
CCI  begin_cell_centroids,
int  dimensions,
const BlackoilPropertiesInterface &  props,
const parameter::ParameterGroup &  param,
const double  gravity,
State &  state 
)

Initialize a blackoil state from parameters. The following parameters are accepted (defaults):

  • convection_testcase (false) – Water in the 'left' part of the grid.
  • ref_pressure (100) – Initial pressure in bar for all cells (if convection_testcase is true), or pressure at woc depth.
  • water_oil_contact (none) – Depth of water-oil contact (woc). If convection_testcase is true, the saturation is initialised as indicated, and pressure is initialised to a constant value ('ref_pressure'). Otherwise we have 2 cases:

If 'water_oil_contact' is given, saturation is initialised accordingly.

  1. Water saturation is set to minimum. In both cases, pressure is initialised hydrostatically. In case 2., the depth of the first cell is used as reference depth.

References Opm::unit::barsa, Opm::parameter::ParameterGroup::get(), Opm::UgGridHelpers::getCoordinate(), Opm::parameter::ParameterGroup::getDefault(), Opm::parameter::ParameterGroup::has(), Opm::BlackoilPropertiesInterface::numCells(), and Opm::BlackoilPropertiesInterface::numPhases().

template<class Grid >
void Opm::initStateEquil ( const Grid &  grid,
const BlackoilPropertiesInterface &  props,
const Opm::DeckConstPtr  deck,
const Opm::EclipseStateConstPtr  eclipseState,
const double  gravity,
BlackoilState &  state 
)

Compute initial state by an equilibration procedure.

The following state fields are modified: pressure(), saturation(), surfacevol(), gasoilratio(), rv().

Parameters
[in]gridGrid.
[in]propsProperty object, pvt and capillary properties are used.
[in]deckSimulation deck, used to obtain EQUIL and related data.
[in]gravityAcceleration of gravity, assumed to be in Z direction.
template<class Grid >
void Opm::initStateEquil ( const Grid &  grid,
BlackoilPropertiesInterface &  props,
const Opm::DeckConstPtr  deck,
const Opm::EclipseStateConstPtr  eclipseState,
const double  gravity,
BlackoilState &  state 
)

Compute initial state by an equilibration procedure.

The following state fields are modified: pressure(), saturation(), surfacevol(), gasoilratio(), rv().

Parameters
[in]gridGrid.
[in]propsProperty object, pvt and capillary properties are used.
[in]deckSimulation deck, used to obtain EQUIL and related data.
[in]gravityAcceleration of gravity, assumed to be in Z direction.

References Opm::BlackoilPhases::Aqua, Opm::Details::convertSats(), Opm::BlackoilState::gasoilratio(), initBlackoilSurfvolUsingRSorRV(), Opm::BlackoilPhases::Liquid, Opm::UgGridHelpers::numCells(), Opm::PhaseUsage::phase_used, Opm::BlackoilPropertiesInterface::phaseUsage(), Opm::SimulatorState::pressure(), Opm::BlackoilState::rv(), and Opm::SimulatorState::saturation().

template<class Props , class State >
void Opm::initStateFromDeck ( const UnstructuredGrid grid,
const Props &  props,
Opm::DeckConstPtr  deck,
const double  gravity,
State &  state 
)

Initialize a state from input deck.

Initialize a two-phase state from input deck. If EQUIL is present:

  • saturation is set according to the water-oil contact,
  • pressure is set to hydrostatic equilibrium. Otherwise:
  • saturation is set according to SWAT,
  • pressure is set according to PRESSURE.

References UnstructuredGrid::cell_centroids, UnstructuredGrid::dimensions, UnstructuredGrid::face_centroids, Opm::UgGridHelpers::faceCells(), UnstructuredGrid::global_cell, UnstructuredGrid::number_of_cells, and UnstructuredGrid::number_of_faces.

Referenced by initBlackoilStateFromDeck().

template<class FaceCells , class FCI , class CCI , class Props , class State >
void Opm::initStateFromDeck ( int  number_of_cells,
const int *  global_cell,
int  number_of_faces,
FaceCells  face_cells,
FCI  begin_face_centroids,
CCI  begin_cell_centroids,
int  dimensions,
const Props &  props,
Opm::DeckConstPtr  deck,
const double  gravity,
State &  state 
)
template<typename FI >
bool Opm::isNondecreasing ( const FI  beg,
const FI  end 
)

Detect if a sequence is nondecreasing.

Template Parameters
FIa forward iterator whose value type has operator< defined.
Parameters
begstart of sequence
endone-beyond-end of sequence
Returns
false if there exists two consecutive values (v1, v2) in the sequence for which v2 < v1, else returns true.

Referenced by Opm::NonuniformTableLinear< T >::inverse(), and Opm::NonuniformTableLinear< T >::NonuniformTableLinear().

double Opm::linearInterpolation ( const std::vector< double > &  xv,
const std::vector< double > &  yv,
double  x 
)
inline
double Opm::linearInterpolation ( const std::vector< double > &  xv,
const std::vector< double > &  yv,
double  x,
int &  ix1 
)
inline

References tableIndex().

double Opm::linearInterpolationDerivative ( const std::vector< double > &  xv,
const std::vector< double > &  yv,
double  x 
)
inline
void Opm::no_delete ( void const *  )
inline

Custom deleter that does nothing.

Referenced by share_obj().

template<typename T >
std::ostream& Opm::operator<< ( std::ostream &  os,
const UniformTableLinear< T > &  t 
)
inline
void Opm::orderCounterClockwise ( const UnstructuredGrid grid,
SparseTable< int > &  nb 
)

For each cell, order the (cell) neighbours counterclockwise.

Parameters
[in]gridA 2d grid object.
[in,out]nbA cell-cell neighbourhood table, such as from vertexNeighbours().
PhaseUsage Opm::phaseUsageFromDeck ( Opm::EclipseStateConstPtr  eclipseState)
inline
PhaseUsage Opm::phaseUsageFromDeck ( Opm::DeckConstPtr  deck)
inline
void Opm::readPosStruct ( std::istream &  is,
int  n,
PosStruct &  pos_struct 
)

Read pos struct type mapping from a stream

Parameters
[in]isis stream
[in]nnumber of lines to read
[out]pos_structreference to PosStruct
void Opm::readVagGrid ( std::istream &  is,
Opm::VAG vag_grid 
)

Function the vag grid format and make a vag_grid struct. This structure is intended to be converted to a grid.

Parameters
[in]isis is stream of the file.
[out]vag_gridis a reference to a vag_grid struct.
template<typename T >
void Opm::readVector ( std::istream &  is,
std::vector< T > &  vec 
)

Function to read a vector of some type from a stream.

Parameters
[in]osis is stream of the file.
[out]vag_gridis a resized and filled vector containing the quantiy read.
void Opm::restoreOPM_XWELKeyword ( const std::string &  restart_filename,
int  report_step,
WellState &  wellState 
)

restoreOPM_XWELKeyword Reading from the restart file, information stored under the OPM_XWEL keyword is in this method filled into an instance of a wellstate object.

Parameters
restart_filenameThe filename of the restart file.
reportstepThe report step to restart from.
wellstateAn instance of a WellState object, with correct size for each of the 5 contained std::vector<double> objects.
void Opm::restoreSOLUTIONData ( const std::string &  restart_filename,
int  report_step,
const EclipseState &  eclipseState,
const UnstructuredGrid grid,
const PhaseUsage &  phaseUsage,
SimulatorState &  simulator_state 
)
int Opm::tableIndex ( const std::vector< double > &  table,
double  x 
)
inline
template<class Grid >
std::vector<double> Opm::thresholdPressures ( const ParseMode &  parseMode,
EclipseStateConstPtr  eclipseState,
const Grid &  grid 
)

Get a vector of pressure thresholds from EclipseState. This function looks at EQLOPTS, THPRES and EQLNUM to determine pressure thresholds. It does not consider the case where the threshold values are defaulted, in which case they should be determined from the initial, equilibrated simulation state.

Template Parameters
GridType of grid object (UnstructuredGrid or CpGrid).
Parameters
[in]deckInput deck, EQLOPTS and THPRES are accessed from it.
[in]eclipseStateProcessed eclipse state, EQLNUM is accessed from it.
[in]gridThe grid to which the thresholds apply.
Returns
A vector of pressure thresholds, one for each face in the grid. A value of zero means no threshold for that particular face. An empty vector is returned if there is no THPRES feature used in the deck.

References Opm::UgGridHelpers::faceCells(), Opm::UgGridHelpers::globalCell(), and Opm::UgGridHelpers::numFaces().

void Opm::toBothSat ( const std::vector< double > &  sw,
std::vector< double > &  sboth 
)

Make a vector of interleaved water and oil saturations from a vector of water saturations.

void Opm::toWaterSat ( const std::vector< double > &  sboth,
std::vector< double > &  sw 
)

Extract a vector of water saturations from a vector of interleaved water and oil saturations.

void Opm::unstructuredGridToVag ( UnstructuredGrid grid,
Opm::VAG vag_grid 
)

Fill a vag_grid from UnstructuredGrid

Parameters
[out]vag_grids is a valid vag_grid struct.
[in]gridis a grid with have allocated correct size to each pointer.
void Opm::vagToUnstructuredGrid ( Opm::VAG vag_grid,
UnstructuredGrid grid 
)

Fill a UnstructuredGrid from a vag_grid.

Parameters
[out]vag_grids is a valid vag_grid struct.
[in]gridis a grid with have allocated correct size to each pointer.
void Opm::wellsToSrc ( const Wells wells,
const int  num_cells,
std::vector< double > &  src 
)

Create a src vector equivalent to a wells structure. For this to be valid, the wells must be all rate-controlled and single-perforation.

void Opm::writeECLData ( const UnstructuredGrid grid,
const DataMap &  data,
const int  current_step,
const double  current_time,
const boost::posix_time::ptime &  current_date_time,
const std::string &  output_dir,
const std::string &  base_name 
)
void Opm::writePosStruct ( std::ostream &  os,
PosStruct &  pos_struct 
)

Read pos struct type mapping from a stream

Parameters
[in]osis stream to write to
[in]pos_structto write
void Opm::writeVagFormat ( std::ostream &  os,
Opm::VAG vag_grid 
)

Function to write vag format.

Parameters
[out]isis is stream of the file.
[in]vag_gridis a reference to a vag_grid struct.
template<typename T >
void Opm::writeVector ( std::ostream &  os,
std::vector< T > &  vec,
int  n 
)

Function to write a vector of some type from a stream.

Parameters
[in]osis is stream of the file.
[out]vag_gridis a resized and filled vector containing the quantiy read.
[in]nnumber of doubles on each line.
void Opm::writeVtkData ( const std::array< int, 3 > &  dims,
const std::array< double, 3 > &  cell_size,
const DataMap &  data,
std::ostream &  os 
)

Vtk output for cartesian grids.

void Opm::writeVtkData ( const UnstructuredGrid grid,
const DataMap &  data,
std::ostream &  os 
)

Vtk output for general grids.

Variable Documentation