OpenCAEPoro  v0.5.0
A simulator for multicomponent porous media flow
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Grid Class Reference

Public Member Functions

void InputParam (const ParamReservoir &rs_param, const ParamOutput &output_param)
 Input parameters from the internal param structure.
 
void SetupIsoT ()
 Setup for Isothermal model.
 
void SetupT ()
 Setup for thermal model.
 
void Setup ()
 Setup the grid information and calculate the properties.
 
OCP_USI GetGridNum () const
 
OCP_INT GetActIndex (const USI &I, const USI &J, const USI &K) const
 
void GetIJKGrid (USI &i, USI &j, USI &k, const OCP_USI &n) const
 
void GetIJKBulk (USI &i, USI &j, USI &k, const OCP_USI &n) const
 
OCP_BOOL IfUseVtk () const
 return if use vtk format for outputing
 
void SetHexaherdronGridOrthogonal ()
 setup polyhedronGrid for orthogonal grid
 
void SetHexaherdronGridCorner (const OCP_COORD &mycord)
 
void SetupGridTag ()
 Setup grid tag.
 
void OutputBaiscInfo () const
 Calculate and return basic informations for grid.
 
void CalNumDigutIJK ()
 only used in structured grid
 
USI GetNumDigitIJK () const
 Return numDigutIJK.
 

Protected Member Functions

void SetupOrthogonalGrid ()
 Setup orthogonal grid.
 
void CalDepthVOrthogonalGrid ()
 Calculate the depth and volume for orthogonal grid.
 
void SetupNeighborOrthogonalGrid ()
 Setup the neighboring info for an orthogonal grid.
 
void SetupCornerGrid ()
 Setup corner-point grid.
 
void SetupBasicCornerGrid (const OCP_COORD &CoTmp)
 Setup dx,dy,dz,depth, v for a corner-point grid.
 
void SetupNeighborCornerGrid (const OCP_COORD &CoTmp)
 Setup the neighboring info for a corner-point grid.
 
void CalActiveGridIsoT (const OCP_DBL &e1, const OCP_DBL &e2)
 Calculate the activity of grid cells. More...
 
void CalActiveGridT (const OCP_DBL &e1, const OCP_DBL &e2)
 Calculate the activity of grid cells for ifThermal model.
 
void SetupGridLocation ()
 Setup Grid location for Structured grid.
 

Protected Attributes

USI gridType
 Orthogonal or Corner grid.
 
OCP_USI numGrid
 Number of all cells.
 
USI nx
 Number of cells in x-direction.
 
USI ny
 Number of cells in y-direction.
 
USI nz
 Number of cells in z-direction.
 
vector< OCP_DBLcoord
 Lines of a corner-point grid.
 
vector< OCP_DBLzcorn
 ZValues of a corner-point grid.
 
vector< USIgLocation
 Top face, bottom face, side face, numGrid.
 
vector< OCP_DBLtops
 Depth of center of grid cells: numGrid.
 
vector< OCP_DBLdx
 Size of cell in x-direction: numGrid.
 
vector< OCP_DBLdy
 Size of cell in y-direction: numGrid.
 
vector< OCP_DBLdz
 Size of cell in z-direction: numGrid.
 
vector< OCP_DBLv
 Volume of cells: numGrid.
 
vector< OCP_DBLdepth
 Depth of center of grid cells: numGrid.
 
vector< OCP_DBLntg
 Net to gross ratio of cells: numGrid.
 
vector< OCP_DBLporo
 Initial porosity of rock cells: numGrid.
 
vector< OCP_DBLkx
 Absolute permeability in x-direction: numGrid.
 
vector< OCP_DBLky
 Absolute permeability in y-direction: numGrid.
 
vector< OCP_DBLkz
 Absolute permeability in z-direction: numGrid.
 
vector< OCP_DBLthconr
 Rock if Thermal conductivity: numGrid.
 
vector< USISATNUM
 Identify SAT region: numGrid.
 
vector< USIPVTNUM
 Identify PVT region for the blackoil model: numGrid.
 
vector< USIACTNUM
 
vector< USIROCKNUM
 index of rock table for each grid: numGrid
 
vector< OCP_DBLSwatInit
 Initial water saturation.
 
vector< vector< GPair > > gNeighbor
 Neighboring information of grid.
 
OCP_USI activeGridNum
 Num of active grid.
 
vector< OCP_USImap_Act2All
 Mapping from active grid to all grid: activeGridNum.
 
vector< GB_Pairmap_All2Act
 Mapping from grid to active all grid: numGrid.
 
OCP_USI fluidGridNum
 Num of fluid grids.
 
vector< GB_Pairmap_All2Flu
 Mapping from all grid to fluid grid: numGrid.
 
OCP_BOOL useVTK {OCP_FALSE}
 If output in vtk format.
 
vector< OCPpolyhedronpolyhedronGrid
 Coordinates of grid points.
 
vector< USIgridTag
 Tag of grid: dead, live(fluid), live(rock)
 
USI numDigutIJK
 number of digits of maximum nx,ny,nz
 

Friends

class Bulk
 
class BulkConn
 
class Well
 
class ScalePcow
 
class Out4RPT
 
class Out4VTK
 

Detailed Description

Definition at line 88 of file Grid.hpp.

Member Function Documentation

◆ CalActiveGridIsoT()

void Grid::CalActiveGridIsoT ( const OCP_DBL e1,
const OCP_DBL e2 
)
protected

Calculate the activity of grid cells.

If porosity or volume of the grid cell is too small, then the cell is inactive.

Definition at line 250 of file Grid.cpp.

251 {
252  map_Act2All.reserve(numGrid);
253  map_All2Act.resize(numGrid);
254  OCP_USI count = 0;
255  for (OCP_USI n = 0; n < numGrid; n++) {
256  if (ACTNUM[n] == 0 || poro[n] * ntg[n] < e1 || v[n] < e2) {
257  map_All2Act[n] = GB_Pair(OCP_FALSE, 0);
258  ACTNUM[n] = 0;
259  continue;
260  }
261  map_Act2All.push_back(n);
262  map_All2Act[n] = GB_Pair(OCP_TRUE, count);
263  count++;
264  }
265  activeGridNum = count;
266  if (numGrid > activeGridNum) {
267  cout << " Number of inactive cells is " << (numGrid - activeGridNum) << " ("
268  << (numGrid - activeGridNum) * 100.0 / numGrid << "%)" << endl;
269  }
270 
271  // fluid grid = active grid
274 }
unsigned int OCP_USI
Long unsigned integer.
Definition: OCPConst.hpp:25
Active cell indicator and its index among active cells.
Definition: Grid.hpp:32
vector< USI > ACTNUM
Definition: Grid.hpp:179
vector< OCP_DBL > v
Volume of cells: numGrid.
Definition: Grid.hpp:165
vector< OCP_USI > map_Act2All
Mapping from active grid to all grid: activeGridNum.
Definition: Grid.hpp:192
OCP_USI activeGridNum
Num of active grid.
Definition: Grid.hpp:190
OCP_USI fluidGridNum
Num of fluid grids.
Definition: Grid.hpp:195
vector< GB_Pair > map_All2Flu
Mapping from all grid to fluid grid: numGrid.
Definition: Grid.hpp:196
vector< OCP_DBL > poro
Initial porosity of rock cells: numGrid.
Definition: Grid.hpp:170
vector< GB_Pair > map_All2Act
Mapping from grid to active all grid: numGrid.
Definition: Grid.hpp:193
OCP_USI numGrid
Number of all cells.
Definition: Grid.hpp:142
vector< OCP_DBL > ntg
Net to gross ratio of cells: numGrid.
Definition: Grid.hpp:169

References ACTNUM, map_Act2All, map_All2Act, ntg, numGrid, poro, and v.

◆ SetHexaherdronGridCorner()

void Grid::SetHexaherdronGridCorner ( const OCP_COORD mycord)

setup polyhedronGrid for corner grid

Definition at line 392 of file Grid.cpp.

393 {
394  if (!useVTK) return;
395 
396  polyhedronGrid.reserve(numGrid);
397  OCPpolyhedron tmpP(8);
398 
399  for (USI k = 0; k < nz; k++) {
400  for (USI j = 0; j < ny; j++) {
401  for (USI i = 0; i < nx; i++) {
402  tmpP.Points.push_back(mycord.cornerPoints[i][j][k].p4);
403  tmpP.Points.push_back(mycord.cornerPoints[i][j][k].p5);
404  tmpP.Points.push_back(mycord.cornerPoints[i][j][k].p6);
405  tmpP.Points.push_back(mycord.cornerPoints[i][j][k].p7);
406  tmpP.Points.push_back(mycord.cornerPoints[i][j][k].p0);
407  tmpP.Points.push_back(mycord.cornerPoints[i][j][k].p1);
408  tmpP.Points.push_back(mycord.cornerPoints[i][j][k].p2);
409  tmpP.Points.push_back(mycord.cornerPoints[i][j][k].p3);
410  polyhedronGrid.push_back(tmpP);
411  tmpP.Points.clear();
412  }
413  }
414  }
415 }
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:23
OCP_BOOL useVTK
If output in vtk format.
Definition: Grid.hpp:218
USI nx
Number of cells in x-direction.
Definition: Grid.hpp:145
USI nz
Number of cells in z-direction.
Definition: Grid.hpp:147
vector< OCPpolyhedron > polyhedronGrid
Coordinates of grid points.
Definition: Grid.hpp:219
USI ny
Number of cells in y-direction.
Definition: Grid.hpp:146
Record the initial grid information, all of grids are contained.
Definition: Grid.hpp:75

References numGrid, nx, ny, nz, polyhedronGrid, and useVTK.

Member Data Documentation

◆ ACTNUM

vector<USI> Grid::ACTNUM
protected

Indicate activity of grid from input file: numGrid. 0 = inactive, 1 = active.

Definition at line 179 of file Grid.hpp.


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