#12718 Add diameter and roughness specification for MD intervals

Implements interval-based diameter and roughness configuration for MSW completions
while maintaining backward compatibility with existing single-value approach.

- Add RimDiameterRoughnessInterval class for individual MD intervals
- Add RimDiameterRoughnessIntervalCollection for managing interval collections
- Extend RimMswCompletionParameters with interval-specific mode support
- Support both metric and field unit systems
- Provide validation and overlap detection for intervals
This commit is contained in:
Kristian Bendiksen authored and Magne Sjaastad committed 2025-08-21 08:48:43 +02:00
1 parent 79c2c792f4
commit b0483172b1
18 files changed
+1742 -16

No files matched your search

@@ -68,6 +68,17 @@ completions_settings.group_name_for_export = "msj"
completions_settings.well_type_for_export = "GAS"
completions_settings.update() # Commit updates back to ResInsight
# Add diameter roughness intervals for interval-specific configuration
interval1 = completions_settings.add_diameter_roughness_interval(
start_md=3200, end_md=3300, diameter=0.18, roughness_factor=1.5e-5
)
interval2 = completions_settings.add_diameter_roughness_interval(
start_md=3300, end_md=3400, diameter=0.16, roughness_factor=2.0e-5
)
print(
f"Added diameter roughness intervals: {interval1.start_md}-{interval1.end_md}m and {interval2.start_md}-{interval2.end_md}m"
)
# Optionally update the MSW settings
msw_settings = well_path.msw_settings()
msw_settings.custom_values_for_lateral = False
@@ -0,0 +1,46 @@
import rips
def test_diameter_roughness_intervals(rips_instance, initialize_test):
"""Test the new diameter roughness intervals Python GRPC interface"""
# Create a test well
well_path_coll = rips_instance.project.well_path_collection()
well_path = well_path_coll.add_new_object(rips.ModeledWellPath)
well_path.name = "Test Well for Diameter Intervals"
completions_settings = well_path.completion_settings()
assert completions_settings is not None, "Completion settings should not be None"
# Test our new method - create first interval
interval1 = completions_settings.add_diameter_roughness_interval(
start_md=100, end_md=200, diameter=0.15, roughness_factor=1e-5
)
# Assertions to verify the first interval
assert interval1 is not None, "First interval should not be None"
assert interval1.start_md == 100
assert interval1.end_md == 200
assert interval1.diameter == 0.15
assert interval1.roughness_factor == 1e-5
# Test creating a second interval with different values
interval2 = completions_settings.add_diameter_roughness_interval(
start_md=200, end_md=300, diameter=0.12, roughness_factor=2e-5
)
# Assertions to verify the second interval
assert interval2 is not None, "Second interval should not be None"
assert interval2.start_md == 200
assert interval2.end_md == 300
assert interval2.diameter == 0.12
assert interval2.roughness_factor == 2e-5
# Test default values
interval3 = completions_settings.add_diameter_roughness_interval()
assert interval3 is not None, "Third interval with defaults should not be None"
assert interval3.start_md == 0.0
assert interval3.end_md == 100.0
assert interval3.diameter == 0.152
assert interval3.roughness_factor == 1e-5