mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#9323 Thermal Fracture: add python methods for importing fracture template.
Fixes #9323.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
# Load ResInsight Processing Server Client Library
|
||||
import rips
|
||||
import tempfile
|
||||
from os.path import expanduser
|
||||
from pathlib import Path
|
||||
|
||||
# Connect to ResInsight instance
|
||||
resinsight = rips.Instance.find()
|
||||
project = resinsight.project
|
||||
|
||||
# Look for input files in the home directory of the user
|
||||
home_dir = expanduser("~")
|
||||
fracture_file_path = (Path(home_dir) / "fracture.csv").as_posix()
|
||||
print("Thermal fracture file path:", fracture_file_path)
|
||||
|
||||
# Find a case
|
||||
cases = resinsight.project.cases()
|
||||
case = cases[0]
|
||||
|
||||
# Create thermal template
|
||||
fmt_collection = project.descendants(rips.FractureTemplateCollection)[0]
|
||||
fracture_template = fmt_collection.append_thermal_fracture_template(
|
||||
file_path=fracture_file_path
|
||||
)
|
||||
|
||||
well_name = "F-1 H"
|
||||
|
||||
# Find a well
|
||||
well_path = project.well_path_by_name(well_name)
|
||||
print("Well path:", well_path.name)
|
||||
|
||||
# Create fracture and place it using data from the fracture template
|
||||
fracture = well_path.add_thermal_fracture(
|
||||
fracture_template=fracture_template,
|
||||
place_using_template_data=True,
|
||||
)
|
Reference in New Issue
Block a user