Skip to content

Commit

Permalink
Updates for 2024.12.2
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Jan 13, 2025
1 parent faf2713 commit 9c094a7
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 59 deletions.
18 changes: 15 additions & 3 deletions docs/rips/PythonExamples/import_fractures_on_well.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,25 @@
eclipse_case=case,
)

# Update the orientation of the fracture
# Call update() to propagate changes from the Python object back to ResInsight
# Update the orientation of the fracture. All fracture parameters are displayed, most with default values.
fracture_template.orientation = "Azimuth"
fracture_template.azimuth_angle = 60.0
fracture_template.user_defined_perforation_length = True
fracture_template.beta_factor_type = "UserDefinedBetaFactor"
fracture_template.conductivity_type = "InfiniteConductivity"
fracture_template.effective_permeability = 0
fracture_template.fracture_width = 0.01
fracture_template.fracture_width_type = "FractureWidth"
fracture_template.gas_viscosity = 0.02
fracture_template.height_scale_factor = 1
fracture_template.inertial_coefficient = 0.00608324
fracture_template.non_darcy_flow_type = "None"
fracture_template.perforation_length = 12.3
fracture_template.permeability_type = "FractureConductivity"
fracture_template.relative_gas_density = 0.8
fracture_template.relative_permeability = 1
fracture_template.user_defined_d_factor = 1
fracture_template.user_defined_perforation_length = True
fracture_template.width_scale_factor = 1
fracture_template.update()

# Scale the template
Expand Down
12 changes: 12 additions & 0 deletions docs/rips/PythonExamples/modeled_well_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@
completions_settings.well_type_for_export = "GAS"
completions_settings.update() # Commit updates back to ResInsight

# Optionally update the MSW settings
msw_settings = well_path.msw_settings()
msw_settings.custom_values_for_lateral = False
msw_settings.enforce_max_segment_length = False
msw_settings.liner_diameter = 0.152
msw_settings.max_segment_length = 200
msw_settings.pressure_drop = "HF-"
msw_settings.reference_md_type = "GridEntryPoint"
msw_settings.roughness_factor = 1e-05
msw_settings.user_defined_reference_md = 0
msw_settings.update()

# export completions
cases = resinsight.project.cases()

Expand Down
2 changes: 1 addition & 1 deletion docs/rips/generated/RiaVersionInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

RESINSIGHT_MAJOR_VERSION : str = "2024"
RESINSIGHT_MINOR_VERSION : str = "12"
RESINSIGHT_PATCH_VERSION : str = "0"
RESINSIGHT_PATCH_VERSION : str = "2"

PYTHON_GRPC_PROTOC_VERSION : str = "libprotoc 23.4"
42 changes: 32 additions & 10 deletions docs/rips/generated/generated_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1374,12 +1374,23 @@ class FractureTemplate(PdmObjectBase):
"""
Attributes:
azimuth_angle (float): Azimuth Angle
beta_factor_type (str): One of [UserDefinedBetaFactor, FractureBetaFactor]
conductivity_factor (float): Conductivity
conductivity_type (str): One of [InfiniteConductivity, FiniteConductivity, FiniteConductivityInfiniteWellPI]
d_factor_scale_factor (float): D-factor
effective_permeability (float): Effective Permeability (Ke) [mD]
fracture_width (float): Fracture Width (h)
fracture_width_type (str): One of [UserDefinedWidth, FractureWidth]
gas_viscosity (float): <html>Gas Viscosity (&mu;)</html> [cP]
height_scale_factor (float): Height
inertial_coefficient (float): <html>Inertial Coefficient (&beta;)</html> [Forch. unit]
non_darcy_flow_type (str): One of [None, Computed, UserDefined]
orientation (str): One of [Azimuth, Longitudinal, Transverse]
perforation_length (float): Perforation Length
permeability_type (str): One of [UserDefinedPermeability, FractureConductivity]
relative_gas_density (float): <html>Relative Gas Density (&gamma;)</html>
relative_permeability (float): Relative Permeability
user_defined_d_factor (float): D Factor
user_defined_perforation_length (bool): User-defined Perforation Length
user_description (str): Name
width_scale_factor (float): Half Length
Expand All @@ -1388,12 +1399,23 @@ class FractureTemplate(PdmObjectBase):

def __init__(self, pb2_object: Optional[PdmObject_pb2.PdmObject]=None, channel: Optional[grpc.Channel]=None) -> None:
self.azimuth_angle: float = 0
self.beta_factor_type: str = "UserDefinedBetaFactor"
self.conductivity_factor: float = 1
self.conductivity_type: str = "FiniteConductivity"
self.d_factor_scale_factor: float = 1
self.effective_permeability: float = 0
self.fracture_width: float = 0.01
self.fracture_width_type: str = "FractureWidth"
self.gas_viscosity: float = 0.02
self.height_scale_factor: float = 1
self.inertial_coefficient: float = 0.00608324
self.non_darcy_flow_type: str = "None"
self.orientation: str = "Transverse"
self.perforation_length: float = 1
self.permeability_type: str = "FractureConductivity"
self.relative_gas_density: float = 0.8
self.relative_permeability: float = 1
self.user_defined_d_factor: float = 1
self.user_defined_perforation_length: bool = False
self.user_description: str = "Fracture Template"
self.width_scale_factor: float = 1
Expand Down Expand Up @@ -1970,16 +1992,16 @@ class WbsParameters(PdmObjectBase):
df_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
fg_multiplier (float): SH Multiplier for FG in Shale
fg_shale_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
k0_fg_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
k0_sh_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
obg0_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
kfg_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
ksh_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
obg_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
poission_ratio_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
pore_pressure_non_reservoir_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
pore_pressure_reservoir_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
ucs_source (str): One of [GRID, LAS_FILE, ELEMENT_PROPERTY_TABLE, USER_DEFINED, HYDROSTATIC, DERIVED_FROM_K0FG, PROPORTIONAL_TO_SH, UNDEFINED]
user_df (float): User Defined DF
user_k0_fg (float): User Defined K0_FG
user_k0_sh (float): User Defined K0_SH
user_kfg (float): User Defined K0_FG
user_ksh (float): User Defined K0_SH
user_poisson_ratio (float): User Defined Poisson Ratio
user_pp_non_reservoir (float): Multiplier of hydrostatic PP
user_ucs (float): User Defined UCS [bar]
Expand All @@ -1991,16 +2013,16 @@ def __init__(self, pb2_object: Optional[PdmObject_pb2.PdmObject]=None, channel:
self.df_source: str = "LAS_FILE"
self.fg_multiplier: float = 1.05
self.fg_shale_source: str = "DERIVED_FROM_K0FG"
self.k0_fg_source: str = "LAS_FILE"
self.k0_sh_source: str = "LAS_FILE"
self.obg0_source: str = "GRID"
self.kfg_source: str = "LAS_FILE"
self.ksh_source: str = "LAS_FILE"
self.obg_source: str = "GRID"
self.poission_ratio_source: str = "LAS_FILE"
self.pore_pressure_non_reservoir_source: str = "LAS_FILE"
self.pore_pressure_reservoir_source: str = "GRID"
self.ucs_source: str = "LAS_FILE"
self.user_df: float = 0.7
self.user_k0_fg: float = 0.75
self.user_k0_sh: float = 0.65
self.user_kfg: float = 0.75
self.user_ksh: float = 0.65
self.user_poisson_ratio: float = 0.35
self.user_pp_non_reservoir: float = 1
self.user_ucs: float = 100
Expand Down
45 changes: 0 additions & 45 deletions docs/rips/tests/test_create_well_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,48 +64,3 @@ def test_add_well_path_targets(rips_instance, initialize_test):
assert target.use_fixed_azimuth == False
assert target.azimuth == 0.0
assert target.inclination == 25.6


def test_add_well_path_completions(rips_instance, initialize_test):
well_path_coll = rips_instance.project.descendants(rips.WellPathCollection)[0]

well_path = well_path_coll.add_new_object(rips.ModeledWellPath)
well_path.name = "test"
well_path.update()

# Update the completion settings
completions_settings = well_path.completion_settings()
completions_settings.msw_roughness = 12.34
completions_settings.msw_liner_diameter = 0.2123
completions_settings.well_name_for_export = "file name"
completions_settings.group_name_for_export = "msj"
completions_settings.well_type_for_export = "GAS"
completions_settings.update() # Commit updates back to ResInsight

completions_settings_updated = well_path.completion_settings()
assert completions_settings_updated.msw_roughness == 12.34
assert completions_settings_updated.msw_liner_diameter == 0.2123
assert completions_settings_updated.well_name_for_export == "file name"
assert completions_settings_updated.group_name_for_export == "msj"
assert completions_settings_updated.well_type_for_export == "GAS"

msw_settings = well_path.msw_settings()
msw_settings.custom_values_for_lateral = True
msw_settings.enforce_max_segment_length = True
msw_settings.liner_diameter = 20.0
msw_settings.max_segment_length = 123.05
msw_settings.pressure_drop = "HFA"
msw_settings.reference_md_type = "UserDefined"
msw_settings.roughness_factor = 1.3
msw_settings.user_defined_reference_md = 1234.56
msw_settings.update()

msw_settings_updated = well_path.msw_settings()
assert msw_settings_updated.custom_values_for_lateral == True
assert msw_settings_updated.enforce_max_segment_length == True
assert msw_settings_updated.liner_diameter == 20.0
assert msw_settings_updated.max_segment_length == 123.05
assert msw_settings_updated.pressure_drop == "HFA"
assert msw_settings_updated.reference_md_type == "UserDefined"
assert msw_settings_updated.roughness_factor == 1.3
assert msw_settings_updated.user_defined_reference_md == 1234.56
13 changes: 13 additions & 0 deletions docs/rips/tests/test_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@


def launch_resinsight(sec=1):
resinsight_executable_from_env = os.environ.get("RESINSIGHT_EXECUTABLE")
if resinsight_executable_from_env is None:
print("RESINSIGHT_EXECUTABLE environment variable is not set")
return
instance = rips.Instance.launch(console=True, launch_port=0)
print(instance.location)

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


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


def test_launch_parallell(rips_instance, initialize_test):
resinsight_executable_from_env = os.environ.get("RESINSIGHT_EXECUTABLE")
if resinsight_executable_from_env is None:
print("RESINSIGHT_EXECUTABLE environment variable is not set")
return

process_list = []

instance_count = 10
Expand Down
118 changes: 118 additions & 0 deletions docs/rips/tests/test_wells_path_completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,121 @@ def test_10k(rips_instance, initialize_test):
well_path_names=["Well-1"],
file_split="UNIFIED_FILE",
)


def test_add_well_path_completions(rips_instance, initialize_test):
well_path_coll = rips_instance.project.descendants(rips.WellPathCollection)[0]

well_path = well_path_coll.add_new_object(rips.ModeledWellPath)
well_path.name = "test"
well_path.update()

# Update the completion settings
completions_settings = well_path.completion_settings()
completions_settings.allow_well_cross_flow = True
completions_settings.auto_well_shut_in = "STOP"
completions_settings.drainage_radius_for_pi = 1.56
completions_settings.fluid_in_place_region = 99
completions_settings.gas_inflow_eq = "R-G"
completions_settings.group_name_for_export = "TestGroup"
completions_settings.hydrostatic_density = "AVG"
completions_settings.msw_liner_diameter = 0.12
completions_settings.msw_roughness = 4.66
completions_settings.reference_depth_for_export = 1234
completions_settings.well_bore_fluid_pvt_table = 33
completions_settings.well_name_for_export = "TestWellName"
completions_settings.well_type_for_export = "LIQUID"
completions_settings.update() # Commit updates back to ResInsight

completions_settings_updated = well_path.completion_settings()
assert completions_settings_updated.allow_well_cross_flow == True
assert completions_settings_updated.auto_well_shut_in == "STOP"
assert completions_settings_updated.drainage_radius_for_pi == "1.56"
assert completions_settings_updated.fluid_in_place_region == 99
assert completions_settings_updated.gas_inflow_eq == "R-G"
assert completions_settings_updated.group_name_for_export == "TestGroup"
assert completions_settings_updated.hydrostatic_density == "AVG"
assert completions_settings_updated.msw_liner_diameter == 0.12
assert completions_settings_updated.msw_roughness == 4.66
assert completions_settings_updated.reference_depth_for_export == "1234"
assert completions_settings_updated.well_bore_fluid_pvt_table == 33
assert completions_settings_updated.well_name_for_export == "TestWellName"
assert completions_settings_updated.well_type_for_export == "LIQUID"

msw_settings = well_path.msw_settings()
msw_settings.custom_values_for_lateral = True
msw_settings.enforce_max_segment_length = True
msw_settings.liner_diameter = 20.0
msw_settings.max_segment_length = 123.05
msw_settings.pressure_drop = "HFA"
msw_settings.reference_md_type = "UserDefined"
msw_settings.roughness_factor = 1.3
msw_settings.user_defined_reference_md = 1234.56
msw_settings.update()

msw_settings_updated = well_path.msw_settings()
assert msw_settings_updated.custom_values_for_lateral == True
assert msw_settings_updated.enforce_max_segment_length == True
assert msw_settings_updated.liner_diameter == 20.0
assert msw_settings_updated.max_segment_length == 123.05
assert msw_settings_updated.pressure_drop == "HFA"
assert msw_settings_updated.reference_md_type == "UserDefined"
assert msw_settings_updated.roughness_factor == 1.3
assert msw_settings_updated.user_defined_reference_md == 1234.56


def test_add_well_path_fracture_template(rips_instance, initialize_test):

# Add test for all properties
# Some properties depend on availablility of other data and is not tested, these tests are commented out

fracture_template = rips_instance.project.descendants(rips.FractureTemplate)[0]
fracture_template.azimuth_angle = 23.0
# fracture_template.beta_factor_type = "FractureBetaFactor"
fracture_template.conductivity_factor = 12.5
fracture_template.conductivity_type = "FiniteConductivity"
fracture_template.d_factor_scale_factor = 1.2
fracture_template.effective_permeability = 55
fracture_template.fracture_width = 0.5
fracture_template.fracture_width_type = "UserDefinedWidth"
fracture_template.gas_viscosity = 0.1
fracture_template.height_scale_factor = 1.2
fracture_template.height_scale_factor = 4
fracture_template.inertial_coefficient = 0.7
fracture_template.non_darcy_flow_type = "Computed"
fracture_template.orientation = "Azimuth"
fracture_template.perforation_length = 5
fracture_template.permeability_type = "UserDefinedPermeability"
fracture_template.relative_gas_density = 0.1
fracture_template.relative_permeability = 0.2
fracture_template.user_defined_d_factor = 14
fracture_template.user_defined_perforation_length = True
fracture_template.user_description = "my frac name"
fracture_template.width_scale_factor = 7

fracture_template.update()

fracture_template_updated = rips_instance.project.descendants(
rips.FractureTemplate
)[0]
assert fracture_template_updated.azimuth_angle == 23.0
# assert fracture_template_updated.beta_factor_type == "FractureBetaFactor"
assert fracture_template_updated.conductivity_factor == 12.5
assert fracture_template_updated.conductivity_type == "FiniteConductivity"
assert fracture_template_updated.d_factor_scale_factor == 1.2
assert fracture_template_updated.effective_permeability == 55
assert fracture_template_updated.fracture_width == 0.5
assert fracture_template_updated.fracture_width_type == "UserDefinedWidth"
assert fracture_template_updated.gas_viscosity == 0.1
assert fracture_template_updated.height_scale_factor == 4
assert fracture_template_updated.inertial_coefficient == 0.7
assert fracture_template_updated.non_darcy_flow_type == "Computed"
assert fracture_template_updated.orientation == "Azimuth"
assert fracture_template_updated.perforation_length == 5
assert fracture_template_updated.permeability_type == "UserDefinedPermeability"
assert fracture_template_updated.relative_gas_density == 0.1
assert fracture_template_updated.relative_permeability == 0.2
assert fracture_template_updated.user_defined_d_factor == 14
assert fracture_template_updated.user_defined_perforation_length == True
assert fracture_template_updated.user_description == "my frac name"
assert fracture_template_updated.width_scale_factor == 7

0 comments on commit 9c094a7

Please sign in to comment.