2019-08-19 13:46:14 +02:00
|
|
|
###############################################################################
|
|
|
|
|
# This example will get the cell info for the active cells for the first case
|
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
|
|
# Import the ResInsight Processing Server Module
|
2019-06-03 21:11:27 +02:00
|
|
|
import rips
|
2019-05-20 13:21:02 +02:00
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# Connect to ResInsight
|
2021-01-26 20:48:01 +01:00
|
|
|
resinsight = rips.Instance.find()
|
2019-05-20 13:21:02 +02:00
|
|
|
|
2019-11-21 08:13:15 +01:00
|
|
|
# Get the first case. This will fail if you haven't loaded any cases
|
|
|
|
|
case = resinsight.project.cases()[0]
|
2019-06-03 14:33:16 +02:00
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# Get the cell count object
|
2019-09-19 15:14:01 +02:00
|
|
|
cell_counts = case.cell_count()
|
|
|
|
|
print("Number of active cells: " + str(cell_counts.active_cell_count))
|
|
|
|
|
print("Total number of reservoir cells: " + str(cell_counts.reservoir_cell_count))
|
2019-05-22 16:03:03 +02:00
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# Get information for all active cells
|
2019-09-19 15:14:01 +02:00
|
|
|
active_cell_infos = case.cell_info_for_active_cells()
|
2019-05-20 13:21:02 +02:00
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# A simple check on the size of the cell info
|
2021-01-26 20:48:01 +01:00
|
|
|
assert cell_counts.active_cell_count == len(active_cell_infos)
|
2019-05-22 16:03:03 +02:00
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# Print information for the first active cell
|
2019-05-20 13:21:02 +02:00
|
|
|
print("First active cell: ")
|
2019-09-19 15:14:01 +02:00
|
|
|
print(active_cell_infos[0])
|