RegularCartesian#

class reservoirflow.grids.RegularCartesian(nx: int, ny: int, nz: int, dx, dy, dz, kx=None, ky=None, kz=None, phi=None, z=0, comp: float = None, unit='field', dtype='double', unify=True, verbose=False)#

Bases: Grid

RegularCartesian grid class.

Returns:

Grid object.

Return type:

Grid

Create RegularCartesian Grid.

Parameters:
  • nx (int) – number of cells in x-direction (excluding boundary cells) and must be >= 1. Boundary cells are added automatically. Consequently, nx values are increased by 2 to account for the boundary cells in x-direction.

  • ny (int) – number of cells in y-direction (excluding boundary cells) and must be >= 1. Boundary cells are added automatically. Consequently, ny values are increased by 2 to account for the boundary cells in y-direction.

  • nz (int) – number of grids in z-direction (excluding boundary cells) and must be >= 1. Boundary cells are added automatically. Consequently, nz values are increased by 2 to account for the boundary cells in z-direction.

  • dx (int, float, array-like) – grid dimension in x-direction. In case of a list or an array, the length should be equal to nx+2 (including boundary cells). Values should be in natural order (i.e. from left to right).

  • dy (int, float, array-like) – grid dimension in y-direction. In case of a list or an array, the length should be equal to ny+2 (including boundary cells). Values should be in natural order (i.e. from front to back).

  • dz (int, float, array-like) – grid dimension in z-direction. In case of a list or an array, the length should be equal to nz+2 (including boundary cells). Values should be in natural order (i.e. from bottom to top).

  • kx (int, float, array-like, optional) – Permeability in x-direction. In case of a list or an array, the length should be equal to nx+2 (including boundary cells). Values should be in natural order (i.g.from left to right). These values are only relevant based on the flow direction (e.g. kx is ignored if there is no flow at x-direction).

  • ky (int, float, array-like, optional) – Permeability in y-direction. In case of a list or an array, the length should be equal to ny+2 (including boundary cells). Values should be in natural order (i.e. from front to back). These values are only relevant based on the flow direction (e.g. ky is ignored if there is no flow at y-direction).

  • kz (int, float, array-like, optional) – Permeability in z-direction. In case of a list or an array, the length should be equal to nz+2 (including boundary cells). Values should be in natural order (i.e. from bottom to top). These values are only relevant based on the flow direction (e.g. kz is ignored if there is no flow at z-direction).

  • phi (float, array-like, optional) – effective porosity (in all directions). In case of an array, the shape should be equal to grid.shape (including boundary cells). Values should be in natural order (i.e. from left to right at x-direction, from front to back at y-direction, and from bottom to top at z-direction).

  • z (int, float, array-like, optional.) –

    depth of grid tops.

    Warning

    grid tops (z) is not fully implemented in visualization.

  • comp (float, optional) – compressibility.

  • unit (str ('field', 'metric', 'lab'), optional) – unit used in input and output. Both units and factors attributes will be updated based on the selected unit and can be accessed directly from this class.

  • dtype (str or np.dtype, optional) – data type used in all arrays. Numpy dtype such as np.single or np.double can be used.

  • unify (bool, optional) – unify shape to be always tuple of 3 when set to True. When set to False, shape includes only the number of girds in flow direction as tuple. This option is only relevant in case of 1D or 2D flow. This option may be required to make 1D and 2D shapes shapes of this class more consistent with each other or with 3D shape.

  • verbose (bool, optional) – print information for debugging.

Notes

Definitions: Permeability , Porosity .

Note

Both attributes units and factors are defined based on unit argument, for more details, check Units & Factors. For definitions, check Glossary.

Todo

  • Arrays default shape:
    • flatten arrays should be the default options.

    • reshaping flatten arrays is faster than flattening reshaped arrays.

  • Complete unify feature:
    • complete unify feature to all class components.

Attributes

factors

Returns class factors.

is_anisotropic

Returns anisotropic as bool.

is_heterogeneous

Returns heterogeneity as bool.

is_homogeneous

Returns homogeneity as bool.

is_irregular

Returns irregularity as bool.

is_isotropic

Returns isotropic as bool.

is_regular

Returns regularity as bool.

name

Returns class name.

unit

Returns class unit.

units

Returns class units.

Methods

allow_synonyms()

Allow full descriptions.

extract_boundaries(in_data[, points, fmt])

Extract boundary cells from ndarrays.

get_D()

Returns the grid dimension (D) as int.

get_Vt([boundary, pyvista])

Returns total grid volume Vt.

get_boundaries([by, fmt])

Returns all boundary cells by id or coords.

get_cell_A(dir[, id, coords])

Returns cell cross-sectional area A.

get_cell_Ax([id, coords])

Returns cell cross-sectional area Ax.

get_cell_Ay([id, coords])

Returns cell cross-sectional area Ay.

get_cell_Az([id, coords])

Returns cell cross-sectional area Az.

get_cell_G([id, coords, boundary])

Returns cell geometric factor (G) with all cell neighbors.

get_cell_V([id, coords])

Returns cell volume V.

get_cell_boundaries([id, coords, fmt])

Returns cell boundaries.

get_cell_center([id, coords])

Returns cell center.

get_cell_coords(id[, boundary])

Returns cell/cells coordinates as tuple/list of tuples.

get_cell_d(dir[, id, coords])

Returns cell d.

get_cell_dx([id, coords])

Returns cell dx.

get_cell_dy([id, coords])

Returns cell dy.

get_cell_dz([id, coords])

Returns cell dz.

get_cell_icoords(coords)

Convert coords from (i,j,k) into (k,j,i).

get_cell_id([coords, boundary])

Returns cell/cells id based on natural as int/list.

get_cell_k(dir[, id, coords])

Returns cell permeability.

get_cell_kx([id, coords])

Returns cell permeability at x direction.

get_cell_ky([id, coords])

Returns cell permeability at y direction.

get_cell_kz([id, coords])

Returns cell permeability at z direction.

get_cell_neighbors([id, coords, boundary, fmt])

Returns cell neighbors.

get_cells_A(dir[, boundary, fshape])

Returns cells cross-sectional area A.

get_cells_Ax([boundary, fshape])

Returns cells cross-sectional area Ax.

get_cells_Ay([boundary, fshape])

Returns cells cross-sectional area Ay.

get_cells_Az([boundary, fshape])

Returns cells cross-sectional area Az.

get_cells_G([boundary, sparse])

Returns cells geometric factor (G) Matrix.

get_cells_G_diag_1([boundary])

get_cells_G_diag_2([boundary, diag_1])

get_cells_G_diag_3([boundary, diag_2])

get_cells_V([boundary, fshape, pyvista])

Returns cells volume V.

get_cells_center([boundary, fshape, pyvista])

Returns cells center.

get_cells_coords([boundary, fshape, fmt])

Returns all cells coords based on (i,j,k).

get_cells_d(dir[, boundary, fshape])

Returns cells dimensional meshgrid.

get_cells_dx([boundary, fshape])

Returns cells dx.

get_cells_dy([boundary, fshape])

Returns cells dy.

get_cells_dz([boundary, fshape])

Returns cells dz.

get_cells_i([boundary, fshape, fmt])

Returns range based on the number of cells.

get_cells_icoords([boundary, fshape, fmt])

Returns all cells icoords based on (k,j,i).

get_cells_id([boundary, fshape, fmt])

Returns all cells id based on natural order as ndarray.

get_cells_k(dir[, boundary, fshape, fmt])

Returns permeability values for all cells.

get_corners([boundary])

Returns corners required to create pyvista grid.

get_fdir()

Returns the flow direction (fdir) as str.

get_fshape([boundary, points])

Returns flow shape (fshape) as tuple.

get_n([boundary])

Returns the total number of grid cells as int.

get_n_max([boundary])

Returns the maximum number of grid cells (n_max) as int.

get_ones([boundary, fshape, sparse])

Returns array of ones.

get_order([type, boundary, fshape])

Returns grid order as ndarray.

get_prop(name[, boundary, fshape, fmt])

Get property values in all cells.

get_pyvista_grid([boundary])

Returns pyvista ExplicitStructuredGrid object.

get_shape([boundary])

Returns the number of grids in x, y, z as tuple of (nx, ny, nz).

get_zeros([boundary, fshape, sparse])

Returns array of zeros.

remove_boundaries(in_data[, points, remove])

Remove boundary cells from ndarray.

report([prop, showindex, ifmt])

Print class report.

set_cell_value(array, value[, id, coords])

set_comp(comp)

Set grid compressibility.

set_prop(name, value[, id, coords])

Set a property in all cells or a selected cell.

set_props([kx, ky, kz, phi, z, comp, id, coords])

Set properties for all cells or a selected cell.

set_units([unit])

Set object units.

show([label, boundary, corners, ruler, ...])

Shows pyvista grid.


Comments 💬#

Feel free to make a comment, ask a question, or share your opinion about this specific content. Please keep in mind the Commenting Guidelines ⚖.