2019-10-09 02:21:28 -05:00
|
|
|
import os
|
2020-01-21 01:48:56 -06:00
|
|
|
import grpc
|
|
|
|
|
2019-10-09 02:21:28 -05:00
|
|
|
# Load ResInsight Processing Server Client Library
|
|
|
|
import rips
|
|
|
|
# Connect to ResInsight instance
|
|
|
|
resInsight = rips.Instance.find()
|
|
|
|
|
2020-03-03 03:43:07 -06:00
|
|
|
# Get all GeoMech cases
|
|
|
|
cases = resInsight.project.descendants(rips.GeoMechCase)
|
2019-10-09 02:21:28 -05:00
|
|
|
|
2020-03-03 03:43:07 -06:00
|
|
|
# Get all well paths
|
2020-01-21 01:48:56 -06:00
|
|
|
well_paths = resInsight.project.well_paths()
|
|
|
|
|
2020-03-03 03:43:07 -06:00
|
|
|
# Ensure there's at least one well path
|
2019-10-09 02:21:28 -05:00
|
|
|
if len(well_paths) < 1:
|
|
|
|
print("No well paths in project")
|
|
|
|
exit(1)
|
2020-01-24 03:59:37 -06:00
|
|
|
|
2020-03-03 07:58:36 -06:00
|
|
|
# Create a set of WbsParameters
|
|
|
|
params = rips.WbsParameters()
|
|
|
|
params.user_poisson_ratio = 0.23456
|
|
|
|
params.user_ucs = 123
|
|
|
|
|
2020-03-03 03:43:07 -06:00
|
|
|
# Loop through all cases
|
2019-10-09 02:21:28 -05:00
|
|
|
for case in cases:
|
2020-03-03 03:43:07 -06:00
|
|
|
assert(isinstance(case, rips.GeoMechCase))
|
|
|
|
min_res_depth, max_res_depth = case.reservoir_depth_range()
|
|
|
|
|
|
|
|
# Find a good output path
|
|
|
|
case_path = case.file_path
|
|
|
|
folder_name = os.path.dirname(case_path)
|
2019-10-09 02:21:28 -05:00
|
|
|
|
2020-03-03 03:43:07 -06:00
|
|
|
# Import formation names
|
|
|
|
case.import_formation_names(formation_files=['D:/Projects/ResInsight-regression-test/ModelData/norne/Norne_ATW2013.lyr'])
|
2019-10-09 02:21:28 -05:00
|
|
|
|
2020-03-03 03:43:07 -06:00
|
|
|
# create a folder to hold the snapshots
|
|
|
|
dirname = os.path.join(folder_name, 'snapshots')
|
|
|
|
print("Exporting to: " + dirname)
|
2020-01-21 04:08:09 -06:00
|
|
|
|
2020-03-03 03:43:07 -06:00
|
|
|
for well_path in well_paths[0:4]: # Loop through the first five well paths
|
|
|
|
# Create plot with parameters
|
2020-03-03 07:58:36 -06:00
|
|
|
wbsplot = case.create_well_bore_stability_plot(well_path=well_path.name, time_step=0, parameters=params)
|