Main rips classes¶
rips.case module¶
Module containing the Case class
ResInsight Case class
Operate on a ResInsight case specified by a Case Id integer. Not meant to be constructed separately but created by one of the following methods in Project: loadCase, case, allCases, selectedCases
Result Definition¶
When working with grid case results, the following two argumenst are used in many functions to identify a result
Result Definition enums:
property_type | | porosity_model
(str enum) | | (str enum)
----------------------- | ----- | --------------
DYNAMIC_NATIVE | | MATRIX_MODEL
STATIC_NATIVE | | FRACTURE_MODEL
SOURSIMRL | |
GENERATED | |
INPUT_PROPERTY | |
FORMATION_NAMES | |
FLOW_DIAGNOSTICS | |
INJECTION_FLOODING | |
-
rips.case.
id
¶ Case Id corresponding to case Id in ResInsight project.
Type: int
-
rips.case.
name
¶ Case name
Type: str
-
rips.case.
group_id
¶ Case Group id
Type: int
-
rips.case.
chunkSize
¶ The size of each chunk during value streaming. A good chunk size is 64KiB = 65536B. Meaning the ideal number of doubles would be 8192. However we need overhead space, so the default is 8160. This leaves 256B for overhead.
Type: int
-
rips.case.
active_cell_centers
(self, porosity_model='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
-
rips.case.
active_cell_centers_async
(self, porosity_model='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.
-
rips.case.
active_cell_corners
(self, porosity_model='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
-
rips.case.
active_cell_corners_async
(self, porosity_model='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.
-
rips.case.
active_cell_property
(self, property_type, property_name, time_step, porosity_model='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.
-
rips.case.
active_cell_property_async
(self, property_type, property_name, time_step, porosity_model='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.
-
rips.case.
available_nnc_properties
(self)¶ 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
-
rips.case.
available_properties
(self, property_type, porosity_model='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'.
-
rips.case.
cell_count
(self, porosity_model='MATRIX_MODEL')¶ 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
-
rips.case.
cell_info_for_active_cells
(self, porosity_model='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
-
rips.case.
cell_info_for_active_cells_async
(self, porosity_model='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.
-
rips.case.
coarsening_info
(self)¶ 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.
-
rips.case.
create_lgr_for_completion
(self, 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
-
rips.case.
create_multiple_fractures
(self, 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
-
rips.case.
create_saturation_pressure_plots
(self)¶ Create saturation pressure plots for the current case
-
rips.case.
create_view
(self)¶ Create a new view in the current case
Returns: rips.generated.resinsight_classes.View
-
rips.case.
create_well_bore_stability_plot
(self, 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.case.
days_since_start
(self)¶ Get a list of decimal values representing days since the start of the simulation
-
rips.case.
export_flow_characteristics
(self, 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
-
rips.case.
export_msw
(self, well_path)¶ Export Eclipse Multi-segment-well model to file
Parameters: well_path (str) -- Well path name
-
rips.case.
export_property
(self, 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
-
rips.case.
export_snapshots_of_all_views
(self, 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
-
rips.case.
export_well_path_completions
(self, 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 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
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
-
rips.case.
grid
(self, index)¶ Get Grid of a given index
Parameters: index (int) -- The grid index Returns: rips.grid.Grid
-
rips.case.
grid_property
(self, property_type, property_name, time_step, grid_index=0, porosity_model='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
-
rips.case.
grid_property_async
(self, property_type, property_name, time_step, grid_index=0, porosity_model='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.
-
rips.case.
grids
(self)¶ Get a list of all rips Grid objects in the case
Returns: List of rips.grid.Grid
-
rips.case.
import_formation_names
(self, formation_files=None)¶ Import formation names into project and apply it to the current case
Parameters: formation_files (list) -- list of files to import
-
rips.case.
nnc_connections
(self)¶ Get the NNC connection. Synchronous, so returns a list.
Returns: A list of NNCConnection objects.
-
rips.case.
nnc_connections_async
(self)¶ 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.
-
rips.case.
nnc_connections_dynamic_values
(self, 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.
-
rips.case.
nnc_connections_dynamic_values_async
(self, 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.
-
rips.case.
nnc_connections_generated_values
(self, 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.
-
rips.case.
nnc_connections_generated_values_async
(self, 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.
-
rips.case.
nnc_connections_static_values
(self, 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.
-
rips.case.
nnc_connections_static_values_async
(self, 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.
-
rips.case.
replace
(self, new_grid_file)¶ Replace the current case grid with a new grid loaded from file
Parameters: new_egrid_file (str) -- Path to EGRID file
-
rips.case.
reservoir_boundingbox
(self)¶ 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
-
rips.case.
reservoir_depth_range
(self)¶ Get the reservoir depth range
Returns: A tuple with two members. The first is the minimum depth, the second is the maximum depth
-
rips.case.
selected_cell_property
(self, property_type, property_name, time_step, porosity_model='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.
-
rips.case.
selected_cell_property_async
(self, property_type, property_name, time_step, porosity_model='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.
-
rips.case.
selected_cells
(self)¶ Get the selected cells. Synchronous, so returns a list.
Returns: A list of Cells.
-
rips.case.
selected_cells_async
(self)¶ 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.
-
rips.case.
set_active_cell_property
(self, values, property_type, property_name, time_step, porosity_model='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
-
rips.case.
set_active_cell_property_async
(self, values_iterator, property_type, property_name, time_step, porosity_model='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
-
rips.case.
set_grid_property
(self, values, property_type, property_name, time_step, grid_index=0, porosity_model='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
-
rips.case.
set_nnc_connections_values
(self, values, property_name, time_step, porosity_model='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()
-
rips.case.
simulation_wells
(self)¶ Get a list of all simulation wells for a case
Returns: rips.generated.resinsight_classes.SimulationWell
-
rips.case.
time_steps
(self)¶ 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
-
rips.case.
view
(self, view_id)¶ Get a particular view belonging to a case by providing view id
Parameters: view_id (int) -- view id Returns: rips.generated.resinsight_classes.View
rips.contour_map module¶
ResInsight 3d contour map module
-
rips.contour_map.
export_to_text
(self, export_file_name='', export_local_coordinates=False, undefined_value_label='NaN', exclude_undefined_values=False)¶ Export snapshot for the current view
Parameters: - export_file_name (str) -- The file location to store results in.
- export_local_coordinates (bool) -- Should we export local coordinates, or UTM.
- undefined_value_label (str) -- Replace undefined values with this label.
- exclude_undefined_values (bool) -- Skip undefined values.
rips.grid module¶
Module containing the Grid class, containing information about Case grids.
-
class
rips.grid.
Grid
(index, case, channel)¶ Bases:
object
Grid Information. Created by methods in Case
rips.case.grid()
rips.case.grids()
-
cell_centers
()¶ The cell center for all cells in given grid
Returns: class with double attributes x, y, x giving cell centers Return type: List of Vec3d
-
cell_centers_async
()¶ The cells center for all cells in given grid async.
Returns: class with double attributes x, y, x giving cell centers Return type: Iterator to a list of Vec3d
-
cell_corners
()¶ The cell corners for all cells in given grid
Returns: a class with Vec3d for each corner (c0, c1.., c7) Return type: list of CellCorners
-
cell_corners_async
()¶ The cell corners for all cells in given grid, async.
Returns: a class with Vec3d for each corner (c0, c1.., c7) Return type: iterator to a list of CellCorners
-
dimensions
()¶ The dimensions in i, j, k direction
Returns: class with integer attributes i, j, k giving extent in all three dimensions. Return type: Vec3i
-
rips.gridcasegroup module¶
Grid Case Group statistics module
-
rips.gridcasegroup.
compute_statistics
(self, case_ids=None)¶ Compute statistics for the given case ids
Parameters: case_ids (list of integers) -- List of case ids. If this is None all cases in group are included
-
rips.gridcasegroup.
create_statistics_case
(self)¶ Create a Statistics case in the Grid Case Group
Returns: rips.generated.resinsight_classes.EclipseCase
-
rips.gridcasegroup.
statistics_cases
(self)¶ Get a list of all statistics cases in the Grid Case Group
Returns: List of rips.generated.resinsight_classes.EclipseCase
-
rips.gridcasegroup.
view
(self, view_id)¶ Get a particular view belonging to a case group by providing view id :param id: view id :type id: int
Returns: List of rips.generated.resinsight_classes.EclipseView
-
rips.gridcasegroup.
views
(self)¶ Get a list of views belonging to a grid case group
Returns: List of rips.generated.resinsight_classes.EclipseView
rips.instance module¶
The main entry point for ResInsight connections The Instance class contained have static methods launch and find for creating connections to ResInsight
-
class
rips.instance.
Instance
(port=50051, launched=False)¶ Bases:
object
The ResInsight Instance class. Use to launch or find existing ResInsight instances
-
launched
¶ Tells us whether the application was launched as a new process. If the application was launched we may need to close it when exiting the script.
Type: bool
-
commands
¶ Command executor. Set when creating an instance.
Type: Commands
-
project
¶ Current project in ResInsight. Set when creating an instance and updated when opening/closing projects.
Type: Project
-
client_version_string
()¶ Get a full version string, i.e. 2019.04.01
-
exit
()¶ Tell ResInsight instance to quit
-
static
find
(start_port=50051, end_port=50071)¶ Search for an existing Instance of ResInsight by testing ports.
By default we search from port 50051 to 50071 or if the environment variable RESINSIGHT_GRPC_PORT is set we search RESINSIGHT_GRPC_PORT to RESINSIGHT_GRPC_PORT+20
Parameters: - start_port (int) -- start searching from this port
- end_port (int) -- search up to but not including this port
-
is_console
()¶ Returns true if the connected ResInsight instance is a console app
-
is_gui
()¶ Returns true if the connected ResInsight instance is a GUI app
-
static
launch
(resinsight_executable='', console=False, launch_port=-1, command_line_parameters=None)¶ Launch a new Instance of ResInsight. This requires the environment variable RESINSIGHT_EXECUTABLE to be set or the parameter resinsight_executable to be provided. The RESINSIGHT_GRPC_PORT environment variable can be set to an alternative port number.
Parameters: - resinsight_executable (str) -- Path to a valid ResInsight executable. If set will take precedence over what is provided in the RESINSIGHT_EXECUTABLE environment variable.
- console (bool) -- If True, launch as console application, without GUI.
- launch_port (int) -- If -1 will use the default port 50051 or RESINSIGHT_GRPC_PORT if anything else, ResInsight will try to launch with this port
- command_line_parameters (list) -- Additional parameters as string entries in the list.
Returns: an instance object if it worked. None if not.
Return type:
-
major_version
()¶ Get an integer with the major version number
-
minor_version
()¶ Get an integer with the minor version number
-
patch_version
()¶ Get an integer with the patch version number
-
set_export_folder
(export_type, path, create_folder=False)¶ Set the export folder used for all export functions
Parameters:
Parameter | Description | Type ---------------- | -------------------------------------------- | ----- export_type | String specifying what to export | String path | Path to folder | String create_folder | Create folder if it doesn't exist? | Boolean
Enum export_type:
Option | Description --------------- | ------------ "COMPLETIONS" | "SNAPSHOTS" | "PROPERTIES" | "STATISTICS" |
-
set_main_window_size
(width, height)¶ Set the main window size in pixels
Parameters:
Parameter | Description | Type --------- | ---------------- | ----- width | Width in pixels | Integer height | Height in pixels | Integer
-
set_plot_window_size
(width, height)¶ Set the plot window size in pixels
Parameters:
Parameter | Description | Type --------- | ---------------- | ----- width | Width in pixels | Integer height | Height in pixels | Integer
-
set_start_dir
(path)¶ Set current start directory
Parameters: path (str) -- path to directory
-
version_string
()¶ Get a full version string, i.e. 2019.04.01
-
rips.pdmobject module¶
ResInsight caf::PdmObject connection module
-
class
rips.pdmobject.
PdmObjectBase
(pb2_object, channel)¶ Bases:
object
The ResInsight base class for the Project Data Model
-
address
()¶ Get the unique address of the PdmObject
Returns: A 64-bit unsigned integer address
-
ancestor
(class_definition)¶ Find the first ancestor that matches the provided class_keyword :param class_definition[class]: A class definition matching the type of class wanted
-
channel
()¶ Private method
-
children
(child_field, class_definition)¶ Get a list of all direct project tree children inside the provided child_field :param child_field[str]: A field name
Returns: A list of PdmObjects inside the child_field
-
copy_from
(object)¶ Copy attribute values from object to self
-
descendants
(class_definition)¶ Get a list of all project tree descendants matching the class keyword :param class_definition[class]: A class definition matching the type of class wanted
Returns: A list of PdmObjects matching the class_definition
-
has_warnings
()¶
-
pb2_object
()¶ Private method
-
print_object_info
()¶ Print the structure and data content of the PdmObject
-
set_value
(snake_keyword, value)¶ Set the value associated with the provided keyword and updates ResInsight :param keyword: A string containing the parameter keyword :type keyword: str :param value: A value matching the type of the parameter.
See keyword documentation and/or print_object_info() to find the correct data type.
-
set_visible
(visible)¶ Set the visibility of the object in the ResInsight project tree
-
update
()¶ Sync all fields from the Python Object to ResInsight
-
visible
()¶ Get the visibility of the object in the ResInsight project tree
-
warnings
()¶
-
-
rips.pdmobject.
add_method
(cls)¶
-
rips.pdmobject.
add_static_method
(cls)¶
-
rips.pdmobject.
camel_to_snake
(name)¶
-
rips.pdmobject.
snake_to_camel
(name)¶
rips.plot module¶
ResInsight 2d plot module
-
rips.plot.
export_snapshot
(self, export_folder='', file_prefix='', output_format='PNG')¶ Export snapshot for the current plot
Parameters: - export_folder (str) -- The path to export to. By default will use the global export folder
- prefix (str) -- Exported file name prefix
- output_format (str) -- Enum string. Can be 'PNG' or 'PDF'.
rips.project module¶
The ResInsight project module
-
rips.project.
case
(self, case_id)¶ Get a specific grid case from the provided case Id
Parameters: id (int) -- case id Returns: rips.generated.resinsight_classes.Case
-
rips.project.
cases
(self)¶ Get a list of all grid cases in the project
Returns: A list of rips.generated.resinsight_classes.Case
-
rips.project.
close
(self)¶ Close the current project (and open new blank project)
-
rips.project.
create
(channel)¶
-
rips.project.
create_grid_case_group
(self, case_paths)¶ Create a Grid Case Group from a list of cases
Parameters: case_paths (list) -- list of file path strings Returns: rips.generated.resinsight_classes.GridCaseGroup
-
rips.project.
export_multi_case_snapshots
(self, grid_list_file)¶ Export snapshots for a set of cases
Parameters: grid_list_file (str) -- Path to a file containing a list of grids to export snapshot for
-
rips.project.
export_snapshots
(self, snapshot_type='ALL', prefix='', plot_format='PNG')¶ Export all snapshots of a given type
Parameters: - snapshot_type (str) -- Enum string ('ALL', 'VIEWS' or 'PLOTS')
- prefix (str) -- Exported file name prefix
- plot_format (str) -- Enum string, 'PNG' or 'PDF'
-
rips.project.
export_well_paths
(self, well_paths=None, md_step_size=5.0)¶ Export a set of well paths
Parameters: - well_paths (list) -- List of strings of well paths. If none, export all.
- md_step_size (double) -- resolution of the exported well path
-
rips.project.
grid_case_group
(self, group_id)¶ Get a particular grid case group belonging to a project
Parameters: groupId (int) -- group id Returns: rips.generated.resinsight_classes.GridCaseGroup
-
rips.project.
grid_case_groups
(self)¶ Get a list of all grid case groups in the project
Returns: List of rips.generated.resinsight_classes.GridCaseGroup
-
rips.project.
import_formation_names
(self, formation_files=None)¶ Import formation names into project
Parameters: formation_files (list) -- list of files to import
-
rips.project.
import_well_log_files
(self, well_log_files=None, well_log_folder='')¶ Import well log files into project
Parameters: - well_log_files (list) -- List of file paths to import
- well_log_folder (str) -- A folder path containing files to import
Returns: A list of well path names (strings) that had logs imported
-
rips.project.
import_well_paths
(self, well_path_files=None, well_path_folder='')¶ Import well paths into project
Parameters: - well_path_files (list) -- List of file paths to import
- well_path_folder (str) -- A folder path containing files to import
Returns:
-
rips.project.
load_case
(self, path)¶ Load a new grid case from the given file path
Parameters: path (str) -- file path to case Returns: rips.generated.resinsight_classes.Case
-
rips.project.
open
(self, path)¶ Open a new project from the given path
Parameters: path (str) -- path to project file
-
rips.project.
plot
(self, view_id)¶ Get a particular plot by providing view id
Parameters: view_id (int) -- view id Returns: rips.generated.resinsight_classes.Plot
-
rips.project.
plots
(self)¶ Get a list of all plots belonging to a project
Returns: List of rips.generated.resinsight_classes.Plot
-
rips.project.
replace_source_cases
(self, grid_list_file, case_group_id=0)¶ Replace all source grid cases within a case group
Parameters: - grid_list_file (str) -- path to file containing a list of cases
- case_group_id (int) -- id of the case group to replace
-
rips.project.
save
(self, path='')¶ Save the project to the existing project file, or to a new file
Parameters: path (str) -- File path to the file to save the project to. If empty, saves to the active project file
-
rips.project.
scale_fracture_template
(self, template_id, half_length, height, d_factor, conductivity)¶ Scale fracture template parameters
Parameters: - template_id (int) -- ID of fracture template
- half_length (double) -- Half Length scale factor
- height (double) -- Height scale factor
- d_factor (double) -- D-factor scale factor
- conductivity (double) -- Conductivity scale factor
-
rips.project.
selected_cases
(self)¶ Get a list of all grid cases selected in the project tree
Returns: A list of rips.generated.resinsight_classes.Case
-
rips.project.
set_fracture_containment
(self, template_id, top_layer, base_layer)¶ Set fracture template containment parameters
Parameters: - template_id (int) -- ID of fracture template
- top_layer (int) -- Top layer containment
- base_layer (int) -- Base layer containment
-
rips.project.
summary_cases
(self)¶ Get a list of all summary cases in the Project
Returns: A list of
rips.generated.resinsight_classes.SummaryCase
-
rips.project.
view
(self, view_id)¶ Get a particular view belonging to a case by providing view id
Parameters: view_id (int) -- view id Returns: rips.generated.resinsight_classes.View
-
rips.project.
views
(self)¶ Get a list of views belonging to a project
-
rips.project.
well_path_by_name
(self, well_path_name)¶ Get a specific well path by name from the project
Returns: rips.generated.resinsight_classes.WellPath
-
rips.project.
well_paths
(self)¶ Get a list of all well paths in the project
Returns: List of rips.generated.resinsight_classes.WellPath
rips.simulation_well module¶
ResInsight SimulationWell
-
rips.simulation_well.
case
(self)¶
-
rips.simulation_well.
cells
(self, timestep)¶ Get reservoir cells the simulation well is defined for
SimulationWellCellInfo class description:
Parameter | Description | Type ----------- | --------------------------------------------------------- | ----- ijk | Cell IJK location | Vec3i grid_index | Grid index | int is_open | True if connection to is open at the specified time step | bool branch_id | | int segment_id | | int
Parameters: timestep (int) -- Time step index Returns: List of SimulationWellCellInfo
-
rips.simulation_well.
status
(self, timestep)¶ Get simulation well status
SimulationWellStatus class description:
Parameter | Description | Type ----------- | ------------------------------------------------------------- | ----- well_type | Well type as string | string is_open | True if simulation well is open at the specified time step | bool
Parameters: timestep (int) -- Time step index
rips.view module¶
ResInsight 3d view module
-
rips.view.
apply_cell_result
(self, result_type, result_variable)¶ Apply a regular cell result
Parameters: - result_type (str) --
- String representing the result category. The valid values are::
- DYNAMIC_NATIVE
- STATIC_NATIVE
- SOURSIMRL
- GENERATED
- INPUT_PROPERTY
- FORMATION_NAMES
- FLOW_DIAGNOSTICS
- INJECTION_FLOODING
- result_variable (str) -- String representing the result variable.
- result_type (str) --
-
rips.view.
apply_flow_diagnostics_cell_result
(self, result_variable='TOF', selection_mode='FLOW_TR_BY_SELECTION', injectors=None, producers=None)¶ Apply a flow diagnostics cell result
Parameters:
Parameter | Description | Type ------------------- | ------------------------------------------------------ | ----- result_variable | String representing the result value | String selection_mode | String specifying which tracers to select | String injectors | List of injector names, used by 'FLOW_TR_BY_SELECTION' | String List producers | List of injector names, used by 'FLOW_TR_BY_SELECTION' | String List
Enum compdat_export:
Option | Description ------------------------| ------------ "TOF" | Time of flight "Fraction" | Fraction "MaxFractionTracer" | Max Fraction Tracer "Communication" | Communication
-
rips.view.
case
(self)¶ Get the case the view belongs to
-
rips.view.
clone
(self)¶ Clone the current view
-
rips.view.
export_property
(self, undefined_value=0.0)¶ Export the current Eclipse property from the view
Parameters: undefined_value (double) -- Value to use for undefined values. Defaults to 0.0
-
rips.view.
export_sim_well_fracture_completions
(self, time_step, simulation_well_names, file_split, compdat_export)¶ Export fracture completions for simulation wells
Parameters:
Parameter | Description | Type ----------------------------| ------------------------------------------------ | ----- time_step | Time step to export for | Integer simulation_well_names | List of simulation well names | List file_split | Controls how export data is split into files | String enum compdat_export | Compdat export type | String enum
Enum file_split:
Option | Description ----------------------------------- | ------------ "UNIFIED_FILE" <b>Default Option</b>| A single file with all transmissibilities "SPLIT_ON_WELL" | One file for each well transmissibilities "SPLIT_ON_WELL_AND_COMPLETION_TYPE" | One file for each completion type for each well
Enum compdat_export:
Option | Description -----------------------------------------| ------------ "TRANSMISSIBILITIES"<b>Default Option</b>| Direct export of transmissibilities "WPIMULT_AND_DEFAULT_CONNECTION_FACTORS" | Include export of WPIMULT
-
rips.view.
export_snapshot
(self, prefix='', export_folder='')¶ Export snapshot for the current view
Parameters: - prefix (str) -- Exported file name prefix
- export_folder (str) -- The path to export to. By default will use the global export folder
-
rips.view.
export_visible_cells
(self, export_keyword='FLUXNUM', visible_active_cells_value=1, hidden_active_cells_value=0, inactive_cells_value=0)¶ Export special properties for all visible cells.
Parameters: - export_keyword (string) -- The keyword to export.
- Choices -- 'FLUXNUM' or 'MULTNUM'. Default: 'FLUXNUM'
- visible_active_cells_value (int) -- Value to export forvisible active cells. Default: 1
- hidden_active_cells_value (int) -- Value to export for hidden active cells. Default: 0
- inactive_cells_value (int) -- Value to export for inactive cells. Default: 0
-
rips.view.
set_time_step
(self, time_step)¶ Set the time step for current view
rips.well_log_plot module¶
ResInsight Well Log Plot plot module
-
rips.well_log_plot.
export_data_as_ascii
(self, export_folder, file_prefix='', capitalize_file_names=False)¶ Export LAS file(s) for the current plot
Parameters: - export_folder (str) -- The path to export to. By default will use the global export folder
- file_prefix (str) -- Exported file name prefix
- capitalize_file_names (bool) -- Make all file names upper case
Returns: A list of files exported
-
rips.well_log_plot.
export_data_as_las
(self, export_folder, file_prefix='', export_tvdrkb=False, capitalize_file_names=False, resample_interval=0.0, convert_to_standard_units=False)¶ Export LAS file(s) for the current plot
Parameters: - export_folder (str) -- The path to export to. By default will use the global export folder
- file_prefix (str) -- Exported file name prefix
- export_tvdrkb (bool) -- Export in TVD-RKB format
- capitalize_file_names (bool) -- Make all file names upper case
- resample_interval (double) -- if > 0.0 the files will be resampled
Returns: A list of files exported