|
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 ¤t_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 ¶m, 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 ¶m, const double gravity, State &state) |
|
template<class State > |
void | initStateBasic (const UnstructuredGrid &grid, const BlackoilPropertiesInterface &props, const parameter::ParameterGroup ¶m, 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 ¶m, 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) |
|
typedef std::map<std::string, const std::vector<double>*> Opm::DataMap |
Intended to map strings (giving the output field names) to data.
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 |
|
) |
| |
For each cell, find indices of all cells sharing a vertex with it. - Parameters
-
- 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] | pv | the pore volume by cell. |
[in] | s | saturation values (for all P phases) |
[out] | aver_sat | must 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] | pv | pore volumes of each cell |
[in] | ftof | forward (time from injector) time-of-flight values for each cell |
[in] | rtof | reverse (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] | wells | The wells for which the flow rate should be computed. |
[in] | flow_rates_per_cell | Flow rates per well cells. Should ordered the same way as wells. |
[out] | flow_rates_per_well | Will 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] | props | rock and fluid properties |
[in] | cells | cells with which the saturation values are associated |
[in] | p | pressure (one value per cell) |
[in] | T | temperature(one value per cell) |
[in] | z | surface-volume values (for all P phases) |
[in] | s | saturation values (for all phases) |
[out] | fractional_flow | the 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] | props | rock and fluid properties |
[in] | cells | cells with which the saturation values are associated |
[in] | saturations | saturation values (for all phases) |
[out] | fractional_flow | the 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] | props | fluid and rock properties. |
[in] | state | state variables (pressure, sat, surfvol) |
[in] | transport_src | if < 0: total resv outflow, if > 0: first phase surfv inflow |
[in] | dt | timestep used |
[out] | injected | must point to a valid array with P elements, where P = s.size()/src.size(). |
[out] | produced | must 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] | props | fluid and rock properties. |
[in] | s | saturation values (for all P phases) |
[in] | src | if < 0: total outflow, if > 0: first phase inflow. |
[in] | dt | timestep used |
[out] | injected | must point to a valid array with P elements, where P = s.size()/src.size(). |
[out] | produced | must 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
-
- 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] | wells | The wells for which the flow rate should be computed |
[in] | flow_rates_per_well_cell | The total flow rate for each cell (ordered the same way as the wells struct |
[in] | fractional_flows | the fractional flow for each cell in each well |
[out] | phase_flow_per_well | Will 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] | props | rock and fluid properties |
[in] | cells | cells with which the saturation values are associated |
[in] | p | pressure (one value per cell) |
[in] | T | temperature (one value per cell) |
[in] | z | surface-volume values (for all P phases) |
[in] | s | saturation values (for all phases) |
[out] | pmobc | phase 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] | props | rock and fluid properties |
[in] | cells | cells with which the saturation values are associated |
[in] | s | saturation values (for all phases) |
[out] | pmobc | phase 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] | grid | a grid |
[in] | porosity | array of grid.number_of_cells porosity values |
[out] | porevol | the pore volume by cell. |
template<class T >
void Opm::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.
- Parameters
-
[in] | number_of_cells | The number of cells of the grid. |
[in] | begin_cell_volume | Iterator to the volume of the first cell. |
[in] | porosity | array of grid.number_of_cells porosity values |
[out] | porevol | the 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] | grid | a grid |
[in] | porosity | array of grid.number_of_cells porosity values (at reference pressure) |
[in] | rock_comp | rock compressibility properties |
[in] | pressure | pressure by cell |
[out] | porevol | the pore volume by cell. |
template<class T >
void Opm::computePorevolume |
( |
int |
number_of_cells, |
|
|
T |
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_cells | The number of cells of the grid. |
[in] | Pointer | to/ Iterator at the first cell volume. |
[in] | porosity | array of grid.number_of_cells porosity values |
[in] | rock_comp | rock compressibility properties |
[in] | pressure | pressure by cell |
[out] | porevol | the pore volume by cell. |
[in] | number_of_cells | The number of cells of the grid. |
[in] | porosity | array of grid.number_of_cells porosity values |
[in] | rock_comp | rock compressibility properties |
[in] | pressure | pressure by cell |
[out] | porevol | the 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] | grid | a grid |
[in] | porosity_standard | array of grid.number_of_cells porosity values (at reference presure) |
[in] | rock_comp | rock compressibility properties |
[in] | pressure | pressure by cell |
[out] | porosity | porosity (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] | pv | the pore volume by cell. |
[in] | s | saturation values (for all P phases) |
[out] | sat_vol | must 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 |
|
) |
| |
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] | n | number of data points |
[in] | np | number of phases, must be 2 or 3 |
[in] | A | array 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] | saturation | concatenated saturation values (for all P phases) |
[out] | surfacevol | concatenated 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
-
- 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] | props | rock and fluid properties |
[in] | cells | cells with which the saturation values are associated |
[in] | p | pressure (one value per cell) |
[in] | z | surface-volume values (for all P phases) |
[in] | s | saturation values (for all phases) |
[out] | totmob | total 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] | props | rock and fluid properties |
[in] | cells | cells with which the saturation values are associated |
[in] | s | saturation values (for all phases) |
[out] | totmob | total 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] | props | rock and fluid properties |
[in] | cells | cells with which the saturation values are associated |
[in] | p | pressure (one value per cell) |
[in] | z | surface-volume values (for all P phases) |
[in] | s | saturation values (for all phases) |
[out] | totmob | total mobility |
[out] | omega | fractional-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] | props | rock and fluid properties |
[in] | cells | cells with which the saturation values are associated |
[in] | s | saturation values (for all phases) |
[out] | totmob | total mobility |
[out] | omega | fractional-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] | props | Fluid and rock properties. |
[in] | wells | Wells data structure. |
[in] | well_state | Well pressures and fluxes. |
[out] | transport_src | The 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] | grid | The grid used. |
[in] | src | Pressure eq. source terms. The sign convention is: (+) positive total inflow (positive velocity divergence) (-) negative total outflow |
[in] | faceflux | Signed face fluxes, typically the result from a flow solver. |
[in] | inflow_frac | Fraction 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] | wells | Wells data structure, or null if no wells. |
[in] | well_perfrates | Volumetric flow rates per well perforation. |
[out] | transport_src | The 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] | wells | Wells that need their wdp calculated. |
[in] | grid | The associated grid to make cell lookups. |
[in] | saturations | A 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] | densities | Density for each phase. |
[out] | wdp | Will contain, for each well, the wdp of the well. |
[in] | per_grid_cell | Whether 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, |
|
|
T |
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] | wells | Wells that need their wdp calculated. |
[in] | number_of_cells | The number of cells in the grid. |
[in] | begin_cell_centroids | Pointer/Iterator to the first cell centroid. |
[in] | saturations | A 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] | densities | Density for each phase. |
[out] | wdp | Will contain, for each well, the wdp of the well. |
[in] | per_grid_cell | Whether 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] | wells | wells structure, containing NI injector wells and NP producer wells. |
[in] | porevol | pore volume of each grid cell |
[in] | ftracer | array of forward (injector) tracer values, NI per cell |
[in] | btracer | array 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] | group | the Group to construct object for |
[in] | timeStep | the time step in question |
[in] | the | phase 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] | well | the Well to construct object for |
[in] | timeStep | the time step in question |
[in] | the | phase 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] | grid | a grid |
[in] | face_flux | signed per-face fluxes |
[out] | cell_velocity | the 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_cells | The number of cells of the grid |
[in] | number_of_faces | The number of cells of the grid |
[in] | begin_face_centroids | Iterator pointing to first face centroid. |
[in] | face_cells | Mapping from faces to connected cells. |
[in] | dimensions | The dimensions of the grid. |
[in] | begin_cell_centroids | Iterator pointing to first cell centroid. |
[in] | face_flux | signed per-face fluxes |
[out] | cell_velocity | the estimated velocities. |
[in] | number_of_cells | The number of cells of the grid |
[in] | begin_face_centroids | Iterator pointing to first face centroid. |
[in] | face_cells | Mapping from faces to connected cells. |
[in] | dimensions | The dimensions of the grid. |
[in] | begin_cell_centroids | Iterator pointing to first cell centroid. |
[in] | face_flux | signed per-face fluxes |
[out] | cell_velocity | the 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
-
grid | The grid from which to extract the columns. |
columns | will 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
-
anyComm | The handle to store the information in. If grid is a parallel grid then this will ecapsulate an instance of ParallelISTLInformation. |
grid | The 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 |
|
) |
| |
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 |
|
) |
| |
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 |
|
) |
| |
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:
- If 'water_oil_contact' is given, saturation is initialised accordingly.
- If 'water_oil_contact' is not given, but 'init_saturation' is given, water saturation is set to that value everywhere.
- 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:
- If 'water_oil_contact' is given, saturation is initialised accordingly.
- If 'water_oil_contact' is not given, but 'init_saturation' is given, water saturation is set to that value everywhere.
- 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.
- 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.
- 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] | grid | Grid. |
[in] | props | Property object, pvt and capillary properties are used. |
[in] | deck | Simulation deck, used to obtain EQUIL and related data. |
[in] | gravity | Acceleration 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] | grid | Grid. |
[in] | props | Property object, pvt and capillary properties are used. |
[in] | deck | Simulation deck, used to obtain EQUIL and related data. |
[in] | gravity | Acceleration 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 |
|
) |
| |
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 |
|
) |
| |
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 |
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] | grid | A 2d grid object. |
[in,out] | nb | A cell-cell neighbourhood table, such as from vertexNeighbours(). |
PhaseUsage Opm::phaseUsageFromDeck |
( |
Opm::EclipseStateConstPtr |
eclipseState | ) |
|
|
inline |
Looks at presence of WATER, OIL and GAS keywords in state object to determine active phases.
References Opm::BlackoilPhases::Aqua, GAS, Opm::BlackoilPhases::Liquid, Opm::BlackoilPhases::MaxNumPhases, Opm::PhaseUsage::num_phases, OIL, Opm::PhaseUsage::phase_pos, Opm::PhaseUsage::phase_used, Opm::BlackoilPhases::Vapour, and WATER.
Referenced by Opm::SaturationPropsFromDeck::init(), and initStateFromDeck().
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] | is | is stream |
[in] | n | number of lines to read |
[out] | pos_struct | reference 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] | is | is is stream of the file. |
[out] | vag_grid | is 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] | os | is is stream of the file. |
[out] | vag_grid | is 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_filename | The filename of the restart file. |
reportstep | The report step to restart from. |
wellstate | An 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 |
|
) |
| |
template<typename T >
std::shared_ptr<T> Opm::share_obj |
( |
T & |
t | ) |
|
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
-
- Parameters
-
[in] | deck | Input deck, EQLOPTS and THPRES are accessed from it. |
[in] | eclipseState | Processed eclipse state, EQLNUM is accessed from it. |
[in] | grid | The 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.
Fill a vag_grid from UnstructuredGrid - Parameters
-
[out] | vag_grid | s is a valid vag_grid struct. |
[in] | grid | is a grid with have allocated correct size to each pointer. |
Fill a UnstructuredGrid from a vag_grid. - Parameters
-
[out] | vag_grid | s is a valid vag_grid struct. |
[in] | grid | is 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] | os | is stream to write to |
[in] | pos_struct | to write |
void Opm::writeVagFormat |
( |
std::ostream & |
os, |
|
|
Opm::VAG & |
vag_grid |
|
) |
| |
Function to write vag format. - Parameters
-
[out] | is | is is stream of the file. |
[in] | vag_grid | is 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] | os | is is stream of the file. |
[out] | vag_grid | is a resized and filled vector containing the quantiy read. |
[in] | n | number 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.
std::ostream& Opm::null_stream |
|