Skip to content

Commit 9c094a7

Browse files
committed
Updates for 2024.12.2
1 parent faf2713 commit 9c094a7

File tree

7 files changed

+191
-59
lines changed

7 files changed

+191
-59
lines changed

docs/rips/PythonExamples/import_fractures_on_well.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,25 @@
4141
eclipse_case=case,
4242
)
4343

44-
# Update the orientation of the fracture
45-
# Call update() to propagate changes from the Python object back to ResInsight
44+
# Update the orientation of the fracture. All fracture parameters are displayed, most with default values.
4645
fracture_template.orientation = "Azimuth"
4746
fracture_template.azimuth_angle = 60.0
48-
fracture_template.user_defined_perforation_length = True
47+
fracture_template.beta_factor_type = "UserDefinedBetaFactor"
4948
fracture_template.conductivity_type = "InfiniteConductivity"
49+
fracture_template.effective_permeability = 0
50+
fracture_template.fracture_width = 0.01
51+
fracture_template.fracture_width_type = "FractureWidth"
52+
fracture_template.gas_viscosity = 0.02
53+
fracture_template.height_scale_factor = 1
54+
fracture_template.inertial_coefficient = 0.00608324
55+
fracture_template.non_darcy_flow_type = "None"
5056
fracture_template.perforation_length = 12.3
57+
fracture_template.permeability_type = "FractureConductivity"
58+
fracture_template.relative_gas_density = 0.8
59+
fracture_template.relative_permeability = 1
60+
fracture_template.user_defined_d_factor = 1
61+
fracture_template.user_defined_perforation_length = True
62+
fracture_template.width_scale_factor = 1
5163
fracture_template.update()
5264

5365
# Scale the template

docs/rips/PythonExamples/modeled_well_path.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@
5555
completions_settings.well_type_for_export = "GAS"
5656
completions_settings.update() # Commit updates back to ResInsight
5757

58+
# Optionally update the MSW settings
59+
msw_settings = well_path.msw_settings()
60+
msw_settings.custom_values_for_lateral = False
61+
msw_settings.enforce_max_segment_length = False
62+
msw_settings.liner_diameter = 0.152
63+
msw_settings.max_segment_length = 200
64+
msw_settings.pressure_drop = "HF-"
65+
msw_settings.reference_md_type = "GridEntryPoint"
66+
msw_settings.roughness_factor = 1e-05
67+
msw_settings.user_defined_reference_md = 0
68+
msw_settings.update()
69+
5870
# export completions
5971
cases = resinsight.project.cases()
6072

docs/rips/generated/RiaVersionInfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818

1919
RESINSIGHT_MAJOR_VERSION : str = "2024"
2020
RESINSIGHT_MINOR_VERSION : str = "12"
21-
RESINSIGHT_PATCH_VERSION : str = "0"
21+
RESINSIGHT_PATCH_VERSION : str = "2"
2222

2323
PYTHON_GRPC_PROTOC_VERSION : str = "libprotoc 23.4"

docs/rips/generated/generated_classes.py

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,12 +1374,23 @@ class FractureTemplate(PdmObjectBase):
13741374
"""
13751375
Attributes:
13761376
azimuth_angle (float): Azimuth Angle
1377+
beta_factor_type (str): One of [UserDefinedBetaFactor, FractureBetaFactor]
13771378
conductivity_factor (float): Conductivity
13781379
conductivity_type (str): One of [InfiniteConductivity, FiniteConductivity, FiniteConductivityInfiniteWellPI]
13791380
d_factor_scale_factor (float): D-factor
1381+
effective_permeability (float): Effective Permeability (Ke) [mD]
1382+
fracture_width (float): Fracture Width (h)
1383+
fracture_width_type (str): One of [UserDefinedWidth, FractureWidth]
1384+
gas_viscosity (float): <html>Gas Viscosity (&mu;)</html> [cP]
13801385
height_scale_factor (float): Height
1386+
inertial_coefficient (float): <html>Inertial Coefficient (&beta;)</html> [Forch. unit]
1387+
non_darcy_flow_type (str): One of [None, Computed, UserDefined]
13811388
orientation (str): One of [Azimuth, Longitudinal, Transverse]
13821389
perforation_length (float): Perforation Length
1390+
permeability_type (str): One of [UserDefinedPermeability, FractureConductivity]
1391+
relative_gas_density (float): <html>Relative Gas Density (&gamma;)</html>
1392+
relative_permeability (float): Relative Permeability
1393+
user_defined_d_factor (float): D Factor
13831394
user_defined_perforation_length (bool): User-defined Perforation Length
13841395
user_description (str): Name
13851396
width_scale_factor (float): Half Length
@@ -1388,12 +1399,23 @@ class FractureTemplate(PdmObjectBase):
13881399

13891400
def __init__(self, pb2_object: Optional[PdmObject_pb2.PdmObject]=None, channel: Optional[grpc.Channel]=None) -> None:
13901401
self.azimuth_angle: float = 0
1402+
self.beta_factor_type: str = "UserDefinedBetaFactor"
13911403
self.conductivity_factor: float = 1
13921404
self.conductivity_type: str = "FiniteConductivity"
13931405
self.d_factor_scale_factor: float = 1
1406+
self.effective_permeability: float = 0
1407+
self.fracture_width: float = 0.01
1408+
self.fracture_width_type: str = "FractureWidth"
1409+
self.gas_viscosity: float = 0.02
13941410
self.height_scale_factor: float = 1
1411+
self.inertial_coefficient: float = 0.00608324
1412+
self.non_darcy_flow_type: str = "None"
13951413
self.orientation: str = "Transverse"
13961414
self.perforation_length: float = 1
1415+
self.permeability_type: str = "FractureConductivity"
1416+
self.relative_gas_density: float = 0.8
1417+
self.relative_permeability: float = 1
1418+
self.user_defined_d_factor: float = 1
13971419
self.user_defined_perforation_length: bool = False
13981420
self.user_description: str = "Fracture Template"
13991421
self.width_scale_factor: float = 1
@@ -1970,16 +1992,16 @@ class WbsParameters(PdmObjectBase):
19701992
df_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
19711993
fg_multiplier (float): SH Multiplier for FG in Shale
19721994
fg_shale_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
1973-
k0_fg_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
1974-
k0_sh_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
1975-
obg0_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
1995+
kfg_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
1996+
ksh_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
1997+
obg_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
19761998
poission_ratio_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
19771999
pore_pressure_non_reservoir_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
19782000
pore_pressure_reservoir_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
19792001
ucs_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
19802002
user_df (float): User Defined DF
1981-
user_k0_fg (float): User Defined K0_FG
1982-
user_k0_sh (float): User Defined K0_SH
2003+
user_kfg (float): User Defined K0_FG
2004+
user_ksh (float): User Defined K0_SH
19832005
user_poisson_ratio (float): User Defined Poisson Ratio
19842006
user_pp_non_reservoir (float): Multiplier of hydrostatic PP
19852007
user_ucs (float): User Defined UCS [bar]
@@ -1991,16 +2013,16 @@ def __init__(self, pb2_object: Optional[PdmObject_pb2.PdmObject]=None, channel:
19912013
self.df_source: str = "LAS_FILE"
19922014
self.fg_multiplier: float = 1.05
19932015
self.fg_shale_source: str = "DERIVED_FROM_K0FG"
1994-
self.k0_fg_source: str = "LAS_FILE"
1995-
self.k0_sh_source: str = "LAS_FILE"
1996-
self.obg0_source: str = "GRID"
2016+
self.kfg_source: str = "LAS_FILE"
2017+
self.ksh_source: str = "LAS_FILE"
2018+
self.obg_source: str = "GRID"
19972019
self.poission_ratio_source: str = "LAS_FILE"
19982020
self.pore_pressure_non_reservoir_source: str = "LAS_FILE"
19992021
self.pore_pressure_reservoir_source: str = "GRID"
20002022
self.ucs_source: str = "LAS_FILE"
20012023
self.user_df: float = 0.7
2002-
self.user_k0_fg: float = 0.75
2003-
self.user_k0_sh: float = 0.65
2024+
self.user_kfg: float = 0.75
2025+
self.user_ksh: float = 0.65
20042026
self.user_poisson_ratio: float = 0.35
20052027
self.user_pp_non_reservoir: float = 1
20062028
self.user_ucs: float = 100

docs/rips/tests/test_create_well_path.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -64,48 +64,3 @@ def test_add_well_path_targets(rips_instance, initialize_test):
6464
assert target.use_fixed_azimuth == False
6565
assert target.azimuth == 0.0
6666
assert target.inclination == 25.6
67-
68-
69-
def test_add_well_path_completions(rips_instance, initialize_test):
70-
well_path_coll = rips_instance.project.descendants(rips.WellPathCollection)[0]
71-
72-
well_path = well_path_coll.add_new_object(rips.ModeledWellPath)
73-
well_path.name = "test"
74-
well_path.update()
75-
76-
# Update the completion settings
77-
completions_settings = well_path.completion_settings()
78-
completions_settings.msw_roughness = 12.34
79-
completions_settings.msw_liner_diameter = 0.2123
80-
completions_settings.well_name_for_export = "file name"
81-
completions_settings.group_name_for_export = "msj"
82-
completions_settings.well_type_for_export = "GAS"
83-
completions_settings.update() # Commit updates back to ResInsight
84-
85-
completions_settings_updated = well_path.completion_settings()
86-
assert completions_settings_updated.msw_roughness == 12.34
87-
assert completions_settings_updated.msw_liner_diameter == 0.2123
88-
assert completions_settings_updated.well_name_for_export == "file name"
89-
assert completions_settings_updated.group_name_for_export == "msj"
90-
assert completions_settings_updated.well_type_for_export == "GAS"
91-
92-
msw_settings = well_path.msw_settings()
93-
msw_settings.custom_values_for_lateral = True
94-
msw_settings.enforce_max_segment_length = True
95-
msw_settings.liner_diameter = 20.0
96-
msw_settings.max_segment_length = 123.05
97-
msw_settings.pressure_drop = "HFA"
98-
msw_settings.reference_md_type = "UserDefined"
99-
msw_settings.roughness_factor = 1.3
100-
msw_settings.user_defined_reference_md = 1234.56
101-
msw_settings.update()
102-
103-
msw_settings_updated = well_path.msw_settings()
104-
assert msw_settings_updated.custom_values_for_lateral == True
105-
assert msw_settings_updated.enforce_max_segment_length == True
106-
assert msw_settings_updated.liner_diameter == 20.0
107-
assert msw_settings_updated.max_segment_length == 123.05
108-
assert msw_settings_updated.pressure_drop == "HFA"
109-
assert msw_settings_updated.reference_md_type == "UserDefined"
110-
assert msw_settings_updated.roughness_factor == 1.3
111-
assert msw_settings_updated.user_defined_reference_md == 1234.56

docs/rips/tests/test_launch.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515

1616
def launch_resinsight(sec=1):
17+
resinsight_executable_from_env = os.environ.get("RESINSIGHT_EXECUTABLE")
18+
if resinsight_executable_from_env is None:
19+
print("RESINSIGHT_EXECUTABLE environment variable is not set")
20+
return
1721
instance = rips.Instance.launch(console=True, launch_port=0)
1822
print(instance.location)
1923

@@ -25,6 +29,10 @@ def launch_resinsight(sec=1):
2529

2630

2731
def test_launch_sequential(rips_instance, initialize_test):
32+
resinsight_executable_from_env = os.environ.get("RESINSIGHT_EXECUTABLE")
33+
if resinsight_executable_from_env is None:
34+
print("RESINSIGHT_EXECUTABLE environment variable is not set")
35+
return
2836
instance_list = []
2937
for i in range(4):
3038
rips_instance = rips.Instance.launch(console=True)
@@ -36,6 +44,11 @@ def test_launch_sequential(rips_instance, initialize_test):
3644

3745

3846
def test_launch_parallell(rips_instance, initialize_test):
47+
resinsight_executable_from_env = os.environ.get("RESINSIGHT_EXECUTABLE")
48+
if resinsight_executable_from_env is None:
49+
print("RESINSIGHT_EXECUTABLE environment variable is not set")
50+
return
51+
3952
process_list = []
4053

4154
instance_count = 10

docs/rips/tests/test_wells_path_completions.py

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,121 @@ def test_10k(rips_instance, initialize_test):
2323
well_path_names=["Well-1"],
2424
file_split="UNIFIED_FILE",
2525
)
26+
27+
28+
def test_add_well_path_completions(rips_instance, initialize_test):
29+
well_path_coll = rips_instance.project.descendants(rips.WellPathCollection)[0]
30+
31+
well_path = well_path_coll.add_new_object(rips.ModeledWellPath)
32+
well_path.name = "test"
33+
well_path.update()
34+
35+
# Update the completion settings
36+
completions_settings = well_path.completion_settings()
37+
completions_settings.allow_well_cross_flow = True
38+
completions_settings.auto_well_shut_in = "STOP"
39+
completions_settings.drainage_radius_for_pi = 1.56
40+
completions_settings.fluid_in_place_region = 99
41+
completions_settings.gas_inflow_eq = "R-G"
42+
completions_settings.group_name_for_export = "TestGroup"
43+
completions_settings.hydrostatic_density = "AVG"
44+
completions_settings.msw_liner_diameter = 0.12
45+
completions_settings.msw_roughness = 4.66
46+
completions_settings.reference_depth_for_export = 1234
47+
completions_settings.well_bore_fluid_pvt_table = 33
48+
completions_settings.well_name_for_export = "TestWellName"
49+
completions_settings.well_type_for_export = "LIQUID"
50+
completions_settings.update() # Commit updates back to ResInsight
51+
52+
completions_settings_updated = well_path.completion_settings()
53+
assert completions_settings_updated.allow_well_cross_flow == True
54+
assert completions_settings_updated.auto_well_shut_in == "STOP"
55+
assert completions_settings_updated.drainage_radius_for_pi == "1.56"
56+
assert completions_settings_updated.fluid_in_place_region == 99
57+
assert completions_settings_updated.gas_inflow_eq == "R-G"
58+
assert completions_settings_updated.group_name_for_export == "TestGroup"
59+
assert completions_settings_updated.hydrostatic_density == "AVG"
60+
assert completions_settings_updated.msw_liner_diameter == 0.12
61+
assert completions_settings_updated.msw_roughness == 4.66
62+
assert completions_settings_updated.reference_depth_for_export == "1234"
63+
assert completions_settings_updated.well_bore_fluid_pvt_table == 33
64+
assert completions_settings_updated.well_name_for_export == "TestWellName"
65+
assert completions_settings_updated.well_type_for_export == "LIQUID"
66+
67+
msw_settings = well_path.msw_settings()
68+
msw_settings.custom_values_for_lateral = True
69+
msw_settings.enforce_max_segment_length = True
70+
msw_settings.liner_diameter = 20.0
71+
msw_settings.max_segment_length = 123.05
72+
msw_settings.pressure_drop = "HFA"
73+
msw_settings.reference_md_type = "UserDefined"
74+
msw_settings.roughness_factor = 1.3
75+
msw_settings.user_defined_reference_md = 1234.56
76+
msw_settings.update()
77+
78+
msw_settings_updated = well_path.msw_settings()
79+
assert msw_settings_updated.custom_values_for_lateral == True
80+
assert msw_settings_updated.enforce_max_segment_length == True
81+
assert msw_settings_updated.liner_diameter == 20.0
82+
assert msw_settings_updated.max_segment_length == 123.05
83+
assert msw_settings_updated.pressure_drop == "HFA"
84+
assert msw_settings_updated.reference_md_type == "UserDefined"
85+
assert msw_settings_updated.roughness_factor == 1.3
86+
assert msw_settings_updated.user_defined_reference_md == 1234.56
87+
88+
89+
def test_add_well_path_fracture_template(rips_instance, initialize_test):
90+
91+
# Add test for all properties
92+
# Some properties depend on availablility of other data and is not tested, these tests are commented out
93+
94+
fracture_template = rips_instance.project.descendants(rips.FractureTemplate)[0]
95+
fracture_template.azimuth_angle = 23.0
96+
# fracture_template.beta_factor_type = "FractureBetaFactor"
97+
fracture_template.conductivity_factor = 12.5
98+
fracture_template.conductivity_type = "FiniteConductivity"
99+
fracture_template.d_factor_scale_factor = 1.2
100+
fracture_template.effective_permeability = 55
101+
fracture_template.fracture_width = 0.5
102+
fracture_template.fracture_width_type = "UserDefinedWidth"
103+
fracture_template.gas_viscosity = 0.1
104+
fracture_template.height_scale_factor = 1.2
105+
fracture_template.height_scale_factor = 4
106+
fracture_template.inertial_coefficient = 0.7
107+
fracture_template.non_darcy_flow_type = "Computed"
108+
fracture_template.orientation = "Azimuth"
109+
fracture_template.perforation_length = 5
110+
fracture_template.permeability_type = "UserDefinedPermeability"
111+
fracture_template.relative_gas_density = 0.1
112+
fracture_template.relative_permeability = 0.2
113+
fracture_template.user_defined_d_factor = 14
114+
fracture_template.user_defined_perforation_length = True
115+
fracture_template.user_description = "my frac name"
116+
fracture_template.width_scale_factor = 7
117+
118+
fracture_template.update()
119+
120+
fracture_template_updated = rips_instance.project.descendants(
121+
rips.FractureTemplate
122+
)[0]
123+
assert fracture_template_updated.azimuth_angle == 23.0
124+
# assert fracture_template_updated.beta_factor_type == "FractureBetaFactor"
125+
assert fracture_template_updated.conductivity_factor == 12.5
126+
assert fracture_template_updated.conductivity_type == "FiniteConductivity"
127+
assert fracture_template_updated.d_factor_scale_factor == 1.2
128+
assert fracture_template_updated.effective_permeability == 55
129+
assert fracture_template_updated.fracture_width == 0.5
130+
assert fracture_template_updated.fracture_width_type == "UserDefinedWidth"
131+
assert fracture_template_updated.gas_viscosity == 0.1
132+
assert fracture_template_updated.height_scale_factor == 4
133+
assert fracture_template_updated.inertial_coefficient == 0.7
134+
assert fracture_template_updated.non_darcy_flow_type == "Computed"
135+
assert fracture_template_updated.orientation == "Azimuth"
136+
assert fracture_template_updated.perforation_length == 5
137+
assert fracture_template_updated.permeability_type == "UserDefinedPermeability"
138+
assert fracture_template_updated.relative_gas_density == 0.1
139+
assert fracture_template_updated.relative_permeability == 0.2
140+
assert fracture_template_updated.user_defined_d_factor == 14
141+
assert fracture_template_updated.user_defined_perforation_length == True
142+
assert fracture_template_updated.user_description == "my frac name"
143+
assert fracture_template_updated.width_scale_factor == 7

0 commit comments

Comments
 (0)