Case

class rips.Case(pb2_object: PdmObject | None = None, channel: Channel | None = None)

Bases: PdmObjectBase

The ResInsight base class for Cases

file_path

Case File Name

Type:

Optional[str]

id

Case ID

Type:

int

name

Case Name

Type:

str

name_setting

One of [FULL_CASE_NAME, SHORT_CASE_NAME, CUSTOM_NAME]

Type:

str

Methods Summary

active_cell_centers([porosity_model])

Get a cell centers for all active cells.

active_cell_centers_async([porosity_model])

Get a cell centers for all active cells.

active_cell_corners([porosity_model])

Get a cell corners for all active cells.

active_cell_corners_async([porosity_model])

Get a cell corners for all active cells.

active_cell_property(property_type, ...[, ...])

Get a cell property for all active cells.

active_cell_property_async(property_type, ...)

Get a cell property for all active cells.

available_nnc_properties()

Get a list of available NNC properties

available_properties(property_type[, ...])

Get a list of available properties

cell_count([porosity_model])

Get a cell count object containing number of active cells and total number of cells

cell_info_for_active_cells([porosity_model])

Get list of cell info objects for current case

cell_info_for_active_cells_async([...])

Get Stream of cell info objects for current case

coarsening_info()

Get a coarsening information for all grids in the case.

create_lgr_for_completion(time_step, ...)

Create a local grid refinement for the completions on the given well paths

create_multiple_fractures(template_id, ...)

Create Multiple Fractures in one go

create_saturation_pressure_plots()

Create saturation pressure plots for the current case

create_view()

Create a new view in the current case

create_well_bore_stability_plot(well_path, ...)

Create a new well bore stability plot

days_since_start()

Get a list of decimal values representing days since the start of the simulation

export_flow_characteristics(time_steps, ...)

Export Flow Characteristics data to text file in CSV format

export_msw(well_path)

Export Eclipse Multi-segment-well model to file

export_property(time_step, property_name[, ...])

Export an Eclipse property

export_snapshots_of_all_views([prefix, ...])

Export snapshots for all views in the case

export_well_path_completions(time_step, ...)

Export well path completions for the current case to file

grid([index])

Get Grid of a given index

grid_property(property_type, property_name, ...)

Get a cell property for all grid cells.

grid_property_async(property_type, ...[, ...])

Get a cell property for all grid cells.

grids()

Get a list of all rips Grid objects in the case

import_formation_names([formation_files])

Import formation names into project and apply it to the current case

nnc_connections()

Get the NNC connection.

nnc_connections_async()

Get the NNC connections.

nnc_connections_dynamic_values(...)

Get the dynamic NNC values.

nnc_connections_dynamic_values_async(...)

Get the dynamic NNC values.

nnc_connections_generated_values(...)

Get the generated NNC values.

nnc_connections_generated_values_async(...)

Get the generated NNC values.

nnc_connections_static_values(property_name)

Get the static NNC values.

nnc_connections_static_values_async(...)

Get the static NNC values.

replace(new_grid_file)

Replace the current case grid with a new grid loaded from file

reservoir_boundingbox()

Get the reservoir bounding box

reservoir_depth_range()

Get the reservoir depth range

selected_cell_property(property_type, ...[, ...])

Get a cell property for all selected cells.

selected_cell_property_async(property_type, ...)

Get a cell property for all selected cells.

selected_cells()

Get the selected cells.

selected_cells_async()

Get the selected cells.

set_active_cell_property(values, ...[, ...])

Set a cell property for all active cells.

set_active_cell_property_async(...[, ...])

Set cell property for all active cells Async.

set_grid_property(values, property_type, ...)

Set a cell property for all grid cells.

set_nnc_connections_values(values, ...[, ...])

Set nnc connection values for all connections..

simulation_wells()

Get a list of all simulation wells for a case

time_steps()

Get a list containing all time steps

view(view_id)

Get a particular view belonging to a case by providing view id

Methods Documentation

active_cell_centers(porosity_model: str = 'MATRIX_MODEL')

Get a cell centers for all active cells. Synchronous, so returns a list.

Parameters:

porosity_model (str) -- string enum. See available()

Returns:

A list of Vec3d

active_cell_centers_async(porosity_model: str = 'MATRIX_MODEL')

Get a cell centers for all active cells. Async, so returns an iterator

Parameters:

porosity_model (str) -- string enum. See available()

Returns:

An iterator to a chunk object containing an array of Vec3d values. Loop through the chunks and then the values within the chunk to get all values.

active_cell_corners(porosity_model: str = 'MATRIX_MODEL')

Get a cell corners for all active cells. Synchronous, so returns a list.

Arguments:

porosity_model(str): string enum. See available()

CellCorner class description:

Parameter   | Description   | Type
----------- | ------------  | -----
c0          |               | Vec3d
c1          |               | Vec3d
c2          |               | Vec3d
c3          |               | Vec3d
c4          |               | Vec3d
c5          |               | Vec3d
c6          |               | Vec3d
c7          |               | Vec3d
active_cell_corners_async(porosity_model: str = 'MATRIX_MODEL')

Get a cell corners for all active cells. Async, so returns an iterator

Parameters:

porosity_model (str) -- string enum. See available()

Returns:

An iterator to a chunk object containing an array of CellCorners (which is eight Vec3d values). Loop through the chunks and then the values within the chunk to get all values.

active_cell_property(property_type, property_name, time_step, porosity_model: str = 'MATRIX_MODEL')

Get a cell property for all active cells. Sync, so returns a list. For argument details, see Result Definition

Parameters:
  • property_type (str) -- string enum

  • property_name (str) -- name of an Eclipse property

  • time_step (int) -- the time step for which to get the property for

  • porosity_model (str) -- string enum

Returns:

A list containing double values Loop through the chunks and then the values within the chunk to get all values.

active_cell_property_async(property_type, property_name, time_step, porosity_model: str = 'MATRIX_MODEL')

Get a cell property for all active cells. Async, so returns an iterator. For argument details, see Result Definition

Parameters:
  • property_type (str) -- string enum

  • property_name (str) -- name of an Eclipse property

  • time_step (int) -- the time step for which to get the property for

  • porosity_model (str) -- string enum

Returns:

An iterator to a chunk object containing an array of double values Loop through the chunks and then the values within the chunk to get all values.

available_nnc_properties()

Get a list of available NNC properties

NNCConnection class description:

Parameter               | Description                                   | Type
------------------------| --------------------------------------------- | -----
cell_grid_index1        | Reservoir Cell Index to cell 1                | int32
cell_grid_index2        | Reservoir Cell Index to cell 2                | int32
cell1                   | Reservoir Cell IJK to cell 1                  | Vec3i
cell2                   | Reservoir Cell IJK to cell 1                  | Vec3i
available_properties(property_type, porosity_model: str = 'MATRIX_MODEL')

Get a list of available properties

For argument details, see Result Definition

Parameters:
  • property_type (str) -- string corresponding to property_type enum.

  • porosity_model (str) -- 'MATRIX_MODEL' or 'FRACTURE_MODEL'.

cell_count(porosity_model: str = 'MATRIX_MODEL') int

Get a cell count object containing number of active cells and total number of cells

Parameters:

porosity_model (str) -- String representing an enum. must be 'MATRIX_MODEL' or 'FRACTURE_MODEL'.

Returns:

active_cell_count: number of active cells reservoir_cell_count: total number of reservoir cells

Return type:

Cell Count object with the following integer attributes

CellCount class description:

Parameter               | Description               | Type
----------------------- | ------------------------- | -----
active_cell_count       | Number of active cells    | Integer
reservoir_cell_count    | Total number of cells     | Integer
cell_info_for_active_cells(porosity_model: str = 'MATRIX_MODEL')

Get list of cell info objects for current case

Parameters:

porosity_model (str) -- String representing an enum. must be 'MATRIX_MODEL' or 'FRACTURE_MODEL'.

Returns:

List of CellInfo objects

CellInfo class description:

Parameter                 | Description                                   | Type
------------------------- | --------------------------------------------- | -----
grid_index                | Index to grid                                 | Integer
parent_grid_index         | Index to parent grid                          | Integer
coarsening_box_index      | Index to coarsening box                       | Integer
local_ijk                 | Cell index in IJK directions of local grid    | Vec3i
parent_ijk                | Cell index in IJK directions of parent grid   | Vec3i

Vec3i class description:

Parameter        | Description                                  | Type
---------------- | -------------------------------------------- | -----
i                | I grid index                                 | Integer
j                | J grid index                                 | Integer
k                | K grid index                                 | Integer
cell_info_for_active_cells_async(porosity_model: str = 'MATRIX_MODEL')

Get Stream of cell info objects for current case

Parameters:

porosity_model (str) -- String representing an enum. must be 'MATRIX_MODEL' or 'FRACTURE_MODEL'.

Returns:

Stream of CellInfo objects

See rips.case.cell_info_for_active_cells() for detalis on the CellInfo class.

coarsening_info()

Get a coarsening information for all grids in the case.

Returns:

A list of CoarseningInfo objects with two Vec3i min and max objects for each entry.

create_lgr_for_completion(time_step, well_path_names, refinement_i, refinement_j, refinement_k, split_type)

Create a local grid refinement for the completions on the given well paths

Parameters:

Parameter       | Description                            | Type
--------------- | -------------------------------------- | -----
time_steps      | Time step index                        | Integer
well_path_names | List of well path names                | List of Strings
refinement_i    | Refinment in x-direction               | Integer
refinement_j    | Refinment in y-direction               | Integer
refinement_k    | Refinment in z-direction               | Integer
split_type      | Defines how to split LGRS              | String enum

Enum split_type:

Option                  | Description
------------------------| ------------
"LGR_PER_CELL"          | One LGR for each completed cell
"LGR_PER_COMPLETION"    | One LGR for each completion (fracture, perforation, ...)
"LGR_PER_WELL"          | One LGR for each well
create_multiple_fractures(template_id, well_path_names, min_dist_from_well_td, max_fractures_per_well, top_layer, base_layer, spacing, action)

Create Multiple Fractures in one go

Parameters:

Parameter              | Description                               | Type
-----------------------| ----------------------------------------- | -----
template_id            | Id of the template                        | Integer
well_path_names        | List of well path names                   | List of Strings
min_dist_from_well_td  | Minimum distance from well TD             | Double
max_fractures_per_well | Max number of fractures per well          | Integer
top_layer              | Top grid k-level for fractures            | Integer
base_layer             | Base grid k-level for fractures           | Integer
spacing                | Spacing between fractures                 | Double
action                 | 'APPEND_FRACTURES' or 'REPLACE_FRACTURES' | String enum
create_saturation_pressure_plots()

Create saturation pressure plots for the current case

create_view()

Create a new view in the current case

Returns:

rips.generated.generated_classes.View

create_well_bore_stability_plot(well_path, time_step, parameters=None)

Create a new well bore stability plot

Parameters:
  • well_path (str) -- well path name

  • time_step (int) -- time step

Returns:

rips.generated.generated_classes.WellBoreStabilityPlot

days_since_start()

Get a list of decimal values representing days since the start of the simulation

export_flow_characteristics(time_steps, injectors, producers, file_name, minimum_communication=0.0, aquifer_cell_threshold=0.1)

Export Flow Characteristics data to text file in CSV format

Parameters:

Parameter                 | Description                                   | Type
------------------------- | --------------------------------------------- | -----
time_steps                | Time step indices                             | List of Integer
injectors                 | Injector names                                | List of Strings
producers                 | Producer names                                | List of Strings
file_name                 | Export file name                              | Integer
minimum_communication     | Minimum Communication, defaults to 0.0        | Integer
aquifer_cell_threshold    | Aquifer Cell Threshold, defaults to 0.1       | Integer
export_msw(well_path)

Export Eclipse Multi-segment-well model to file

Parameters:

well_path (str) -- Well path name

export_property(time_step, property_name, eclipse_keyword=<class 'property'>, undefined_value=0.0, export_file=<class 'property'>)

Export an Eclipse property

Parameters:
  • time_step (int) -- time step index

  • property_name (str) -- property to export

  • eclipse_keyword (str) -- Keyword used in export header. Defaults: value of property

  • undefined_value (double) -- Value to use for undefined values. Defaults to 0.0

  • export_file (str) -- File name for export. Defaults to the value of property parameter

export_snapshots_of_all_views(prefix='', export_folder='')

Export snapshots for all views in the case

Parameters:
  • prefix (str) -- Exported file name prefix

  • export_folder (str) -- The path to export to. By default will use the global export folder

export_well_path_completions(time_step, well_path_names, file_split, compdat_export='TRANSMISSIBILITIES', include_perforations=True, include_fishbones=True, fishbones_exclude_main_bore=True, combination_mode='INDIVIDUALLY', export_welspec=True, export_comments=True, custom_file_name='')

Export well path completions for the current case to file

Parameters:

Parameter                   | Description                                      | Type
----------------------------| ------------------------------------------------ | -----
time_step                   | Time step to export for                          | Integer
well_path_names             | List of well path names                          | List
file_split                  | Controls how export data is split into files     | String enum
compdat_export              | Compdat export type                              | String enum
include_perforations        | Export perforations?                             | bool
include_fishbones           | Export fishbones?                                | bool
fishbones_exclude_main_bore | Exclude main bore when exporting fishbones?      | bool
combination_mode            | Settings for multiple completions in same cell   | String Enum
export_welspec              | Export WELSPEC keyword                           | bool
export_comments             | Export completion data source as comment         | bool
custom_file_name            | Custom filename when file_split is "UNIFIED_FILE"| String

Enum file_split:

Option                              | Description
----------------------------------- | ------------
"UNIFIED_FILE"                      | A single file with all combined transmissibilities
"SPLIT_ON_WELL"                     | One file for each well with combined transmissibilities
"SPLIT_ON_WELL_AND_COMPLETION_TYPE" | One file for each completion type for each well

Enum compdat_export:

Option                                      | Description
------------------------------------------- | ------------
"TRANSMISSIBILITIES"                        | Direct export of transmissibilities
"WPIMULT_AND_DEFAULT_CONNECTION_FACTORS"    | Include WPIMULT in addition to transmissibilities

Enum combination_mode:

Option              | Description
------------------- | ------------
"INDIVIDUALLY"      | Exports the different completion types into separate sections
"COMBINED"          | Export one combined transmissibility for each cell
grid(index: int = 0) Grid

Get Grid of a given index

Parameters:

index (int) -- The grid index

Returns:

rips.grid.Grid

grid_property(property_type, property_name, time_step, grid_index=0, porosity_model: str = 'MATRIX_MODEL')

Get a cell property for all grid cells. Synchronous, so returns a list. For argument details, see Result Definition

Parameters:
  • property_type (str) -- string enum

  • property_name (str) -- name of an Eclipse property

  • time_step (int) -- the time step for which to get the property for

  • grid_index (int) -- index to the grid we're getting values for

  • porosity_model (str) -- string enum

Returns:

A list of double values

grid_property_async(property_type, property_name, time_step, grid_index=0, porosity_model: str = 'MATRIX_MODEL')

Get a cell property for all grid cells. Async, so returns an iterator. For argument details, see Result Definition

Parameters:
  • property_type (str) -- string enum

  • property_name (str) -- name of an Eclipse property

  • time_step (int) -- the time step for which to get the property for

  • gridIndex (int) -- index to the grid we're getting values for

  • porosity_model (str) -- string enum

Returns:

An iterator to a chunk object containing an array of double values Loop through the chunks and then the values within the chunk to get all values.

grids() List[Grid]

Get a list of all rips Grid objects in the case

Returns:

List of rips.grid.Grid

import_formation_names(formation_files=None)

Import formation names into project and apply it to the current case

Parameters:

formation_files (list) -- list of files to import

nnc_connections()

Get the NNC connection. Synchronous, so returns a list.

Returns:

A list of NNCConnection objects.

nnc_connections_async()

Get the NNC connections. Async, so returns an iterator.

Returns:

An iterator to a chunk object containing an array NNCConnection objects. Loop through the chunks and then the connection within the chunk to get all connections.

nnc_connections_dynamic_values(property_name, time_step)

Get the dynamic NNC values.

Returns:

A list of doubles. The order of the list matches the list from nnc_connections, i.e. the nth object of nnc_connections() refers to nth value in this list.

nnc_connections_dynamic_values_async(property_name, time_step)

Get the dynamic NNC values. Async, so returns an iterator.

Returns:

An iterator to a chunk object containing an list of doubles. Loop through the chunks and then the values within the chunk to get values for all the connections. The order of the list matches the list from nnc_connections, i.e. the nth object of nnc_connections() refers to nth value in this list.

nnc_connections_generated_values(property_name, time_step)

Get the generated NNC values.

Returns:

A list of doubles. The order of the list matches the list from nnc_connections, i.e. the nth object of nnc_connections() refers to nth value in this list.

nnc_connections_generated_values_async(property_name, time_step)

Get the generated NNC values. Async, so returns an iterator.

Returns:

An iterator to a chunk object containing an list of doubles. Loop through the chunks and then the values within the chunk to get values for all the connections. The order of the list matches the list from nnc_connections, i.e. the nth object of nnc_connections() refers to nth value in this list.

nnc_connections_static_values(property_name)

Get the static NNC values.

Returns:

A list of doubles. The order of the list matches the list from nnc_connections, i.e. the nth object of nnc_connections() refers to nth value in this list.

nnc_connections_static_values_async(property_name)

Get the static NNC values. Async, so returns an iterator.

Returns:

An iterator to a chunk object containing an list of doubles. Loop through the chunks and then the values within the chunk to get values for all the connections. The order of the list matches the list from nnc_connections, i.e. the nth object of nnc_connections() refers to nth value in this list.

replace(new_grid_file)

Replace the current case grid with a new grid loaded from file

Parameters:

new_egrid_file (str) -- Path to EGRID file

reservoir_boundingbox()

Get the reservoir bounding box

Returns:

BoundingBox

BoundingBox class description:

Type      | Name
--------- | ----------
int       | min_x
int       | max_x
int       | min_y
int       | max_y
int       | min_z
int       | max_z
reservoir_depth_range() Tuple[float, float]

Get the reservoir depth range

Returns:

A tuple with two members. The first is the minimum depth, the second is the maximum depth

selected_cell_property(property_type, property_name, time_step, porosity_model: str = 'MATRIX_MODEL')

Get a cell property for all selected cells. Sync, so returns a list. For argument details, see Result Definition

Parameters:
  • property_type (str) -- string enum

  • property_name (str) -- name of an Eclipse property

  • time_step (int) -- the time step for which to get the property for

  • porosity_model (str) -- string enum

Returns:

A list containing double values Loop through the chunks and then the values within the chunk to get all values.

selected_cell_property_async(property_type, property_name, time_step, porosity_model: str = 'MATRIX_MODEL')

Get a cell property for all selected cells. Async, so returns an iterator. For argument details, see Result Definition

Parameters:
  • property_type (str) -- string enum

  • property_name (str) -- name of an Eclipse property

  • time_step (int) -- the time step for which to get the property for

  • porosity_model (str) -- string enum

Returns:

An iterator to a chunk object containing an array of double values Loop through the chunks and then the values within the chunk to get all values.

selected_cells()

Get the selected cells. Synchronous, so returns a list.

Returns:

A list of Cells.

selected_cells_async()

Get the selected cells. Async, so returns an iterator.

Returns:

An iterator to a chunk object containing an array of cells. Loop through the chunks and then the cells within the chunk to get all cells.

set_active_cell_property(values, property_type, property_name, time_step, porosity_model: str = 'MATRIX_MODEL')

Set a cell property for all active cells. For argument details, see Result Definition

Parameters:
  • values (list) -- a list of double precision floating point numbers

  • property_type (str) -- string enum

  • property_name (str) -- name of an Eclipse property

  • time_step (int) -- the time step for which to get the property for

  • porosity_model (str) -- string enum

set_active_cell_property_async(values_iterator, property_type, property_name, time_step, porosity_model: str = 'MATRIX_MODEL')

Set cell property for all active cells Async. Takes an iterator to the input values. For argument details, see Result Definition

Parameters:
  • values_iterator (iterator) -- an iterator to the properties to be set

  • property_type (str) -- string enum

  • property_name (str) -- name of an Eclipse property

  • time_step (int) -- the time step for which to get the property for

  • porosity_model (str) -- string enum

set_grid_property(values, property_type, property_name, time_step, grid_index=0, porosity_model: str = 'MATRIX_MODEL')

Set a cell property for all grid cells. For argument details, see Result Definition

Parameters:
  • values (list) -- a list of double precision floating point numbers

  • property_type (str) -- string enum

  • property_name (str) -- name of an Eclipse property

  • time_step (int) -- the time step for which to get the property for

  • grid_index (int) -- index to the grid we're setting values for

  • porosity_model (str) -- string enum

set_nnc_connections_values(values, property_name, time_step, porosity_model: str = 'MATRIX_MODEL')

Set nnc connection values for all connections..

Parameters:
  • values (list) -- a list of double precision floating point numbers

  • property_name (str) -- name of an Eclipse property

  • time_step (int) -- the time step for which to get the property for

  • porosity_model (str) -- string enum. See available()

simulation_wells()

Get a list of all simulation wells for a case

Returns:

rips.generated.generated_classes.SimulationWell

time_steps()

Get a list containing all time steps

The time steps are defined by the class TimeStepDate

TimeStepDate class description:

Type      | Name
--------- | ----------
int       | year
int       | month
int       | day
int       | hour
int       | minute
int       | second
view(view_id)

Get a particular view belonging to a case by providing view id

Parameters:

view_id (int) -- view id

Returns:

rips.generated.generated_classes.View