From 3c5c160b9371c47ffd7477f4051acf6e1a824c79 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 18 Jun 2026 13:58:45 +0200 Subject: [PATCH] #14241 MSW: Drop redundant FromGeometry suffix from branch builders With the legacy tree-based path removed there is only one MSW branch construction approach, so the FromGeometry suffix is no longer needed. Rename buildMainBoreBranchFromGeometry, buildValveBranchesFromGeometry, buildFractureBranchesFromGeometry and buildFishbonesBranchesFromGeometry accordingly, and update the architecture diagrams. --- .../MswExport/RicMswBranchBuilder.cpp | 98 +++++----- .../MswExport/RicMswBranchBuilder.h | 98 +++++----- .../RicWellPathExportMswGeometryPath.cpp | 179 +++++++++--------- docs/diagrams/msw-export/01-overview.md | 8 +- docs/diagrams/msw-export/03-build-pipeline.md | 16 +- 5 files changed, 197 insertions(+), 202 deletions(-) diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicMswBranchBuilder.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicMswBranchBuilder.cpp index 1a2276a9d8..af73324c9a 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicMswBranchBuilder.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicMswBranchBuilder.cpp @@ -134,24 +134,24 @@ int findOutletSegmentForMD( const std::vector& cellSegMap, dou //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigMswBranch buildMainBoreBranchFromGeometry( const RimWellPath* wellPath, - const std::vector& filteredIntersections, - const RigMainGrid* mainGrid, - const RimEclipseCase* eclipseCase, - const std::vector& perforationIntervals, - const std::set& valvedIntervals, - const std::string& infoType, - double heelMD, - double heelTVD, - int branchNumber, - int& segmentNumber, - int outletSegmentNumber, - double maxSegmentLength, - const std::vector>& customSegmentIntervals, - const std::optional& exportDate, - RiaDefines::EclipseUnitSystem unitSystem, - std::vector* cellSegMap, - const RigActiveCellInfo* activeCellInfo ) +RigMswBranch buildMainBoreBranch( const RimWellPath* wellPath, + const std::vector& filteredIntersections, + const RigMainGrid* mainGrid, + const RimEclipseCase* eclipseCase, + const std::vector& perforationIntervals, + const std::set& valvedIntervals, + const std::string& infoType, + double heelMD, + double heelTVD, + int branchNumber, + int& segmentNumber, + int outletSegmentNumber, + double maxSegmentLength, + const std::vector>& customSegmentIntervals, + const std::optional& exportDate, + RiaDefines::EclipseUnitSystem unitSystem, + std::vector* cellSegMap, + const RigActiveCellInfo* activeCellInfo ) { std::vector result; @@ -297,20 +297,20 @@ RigMswBranch buildMainBoreBranchFromGeometry( const RimWellPath* //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector buildValveBranchesFromGeometry( const RimWellPath* wellPath, - const std::vector& filteredIntersections, - const RigMainGrid* mainGrid, - const RimEclipseCase* eclipseCase, - const std::vector& perforationIntervals, - const std::vector& cellSegMap, - const std::string& infoType, - const std::string& wellNameForExport, - int& segmentNumber, - int& branchNumber, - double maxSegmentLength, - const std::vector>& customSegmentIntervals, - const std::optional& exportDate, - RiaDefines::EclipseUnitSystem unitSystem ) +std::vector buildValveBranches( const RimWellPath* wellPath, + const std::vector& filteredIntersections, + const RigMainGrid* mainGrid, + const RimEclipseCase* eclipseCase, + const std::vector& perforationIntervals, + const std::vector& cellSegMap, + const std::string& infoType, + const std::string& wellNameForExport, + int& segmentNumber, + int& branchNumber, + double maxSegmentLength, + const std::vector>& customSegmentIntervals, + const std::optional& exportDate, + RiaDefines::EclipseUnitSystem unitSystem ) { std::vector result; @@ -588,13 +588,13 @@ std::vector buildValveBranchesFromGeometry( const RimWellPath* //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector buildFractureBranchesFromGeometry( RimEclipseCase* eclipseCase, - const RimWellPath* wellPath, - const RigMainGrid* mainGrid, - const std::vector& cellSegMap, - const std::string& infoType, - int& segmentNumber, - int& branchNumber ) +std::vector buildFractureBranches( RimEclipseCase* eclipseCase, + const RimWellPath* wellPath, + const RigMainGrid* mainGrid, + const std::vector& cellSegMap, + const std::string& infoType, + int& segmentNumber, + int& branchNumber ) { std::vector result; @@ -685,16 +685,16 @@ std::vector buildFractureBranchesFromGeometry( RimEclipseCase* //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector buildFishbonesBranchesFromGeometry( const RimEclipseCase* eclipseCase, - const RimWellPath* wellPath, - const RigMainGrid* mainGrid, - const std::vector& filteredIntersections, - const std::vector& cellSegMap, - const std::string& infoType, - const std::string& wellNameForExport, - int& segmentNumber, - int& branchNumber, - RiaDefines::EclipseUnitSystem unitSystem ) +std::vector buildFishbonesBranches( const RimEclipseCase* eclipseCase, + const RimWellPath* wellPath, + const RigMainGrid* mainGrid, + const std::vector& filteredIntersections, + const std::vector& cellSegMap, + const std::string& infoType, + const std::string& wellNameForExport, + int& segmentNumber, + int& branchNumber, + RiaDefines::EclipseUnitSystem unitSystem ) { std::vector result; diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicMswBranchBuilder.h b/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicMswBranchBuilder.h index 747c2a0651..95b4012bc8 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicMswBranchBuilder.h +++ b/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicMswBranchBuilder.h @@ -76,66 +76,66 @@ int findOutletSegmentForMD( const std::vector& cellSegMap, dou /// For each grid-cell intersection overlapping a bare perforation (no active valve) a COMPSEGS /// entry is embedded. Optionally fills cellSegMap for later valve outlet-segment lookups. //-------------------------------------------------------------------------------------------------- -RigMswBranch buildMainBoreBranchFromGeometry( const RimWellPath* wellPath, - const std::vector& filteredIntersections, - const RigMainGrid* mainGrid, - const RimEclipseCase* eclipseCase, - const std::vector& perforationIntervals, - const std::set& valvedIntervals, - const std::string& infoType, - double heelMD, - double heelTVD, - int branchNumber, - int& segmentNumber, - int outletSegmentNumber, - double maxSegmentLength, - const std::vector>& customSegmentIntervals, - const std::optional& exportDate, - RiaDefines::EclipseUnitSystem unitSystem, - std::vector* cellSegMap, - const RigActiveCellInfo* activeCellInfo = nullptr ); +RigMswBranch buildMainBoreBranch( const RimWellPath* wellPath, + const std::vector& filteredIntersections, + const RigMainGrid* mainGrid, + const RimEclipseCase* eclipseCase, + const std::vector& perforationIntervals, + const std::set& valvedIntervals, + const std::string& infoType, + double heelMD, + double heelTVD, + int branchNumber, + int& segmentNumber, + int outletSegmentNumber, + double maxSegmentLength, + const std::vector>& customSegmentIntervals, + const std::optional& exportDate, + RiaDefines::EclipseUnitSystem unitSystem, + std::vector* cellSegMap, + const RigActiveCellInfo* activeCellInfo = nullptr ); //-------------------------------------------------------------------------------------------------- /// Build WELSEGS + COMPSEGS segments for ICD/ICV/AICD/SICD valve completions. //-------------------------------------------------------------------------------------------------- -std::vector buildValveBranchesFromGeometry( const RimWellPath* wellPath, - const std::vector& filteredIntersections, - const RigMainGrid* mainGrid, - const RimEclipseCase* eclipseCase, - const std::vector& perforationIntervals, - const std::vector& cellSegMap, - const std::string& infoType, - const std::string& wellNameForExport, - int& segmentNumber, - int& branchNumber, - double maxSegmentLength, - const std::vector>& customSegmentIntervals, - const std::optional& exportDate, - RiaDefines::EclipseUnitSystem unitSystem ); +std::vector buildValveBranches( const RimWellPath* wellPath, + const std::vector& filteredIntersections, + const RigMainGrid* mainGrid, + const RimEclipseCase* eclipseCase, + const std::vector& perforationIntervals, + const std::vector& cellSegMap, + const std::string& infoType, + const std::string& wellNameForExport, + int& segmentNumber, + int& branchNumber, + double maxSegmentLength, + const std::vector>& customSegmentIntervals, + const std::optional& exportDate, + RiaDefines::EclipseUnitSystem unitSystem ); //-------------------------------------------------------------------------------------------------- /// Build WELSEGS + COMPSEGS segments for fracture completions. //-------------------------------------------------------------------------------------------------- -std::vector buildFractureBranchesFromGeometry( RimEclipseCase* eclipseCase, - const RimWellPath* wellPath, - const RigMainGrid* mainGrid, - const std::vector& cellSegMap, - const std::string& infoType, - int& segmentNumber, - int& branchNumber ); +std::vector buildFractureBranches( RimEclipseCase* eclipseCase, + const RimWellPath* wellPath, + const RigMainGrid* mainGrid, + const std::vector& cellSegMap, + const std::string& infoType, + int& segmentNumber, + int& branchNumber ); //-------------------------------------------------------------------------------------------------- /// Build WELSEGS + COMPSEGS + WSEGVALV segments for fishbones completions. //-------------------------------------------------------------------------------------------------- -std::vector buildFishbonesBranchesFromGeometry( const RimEclipseCase* eclipseCase, - const RimWellPath* wellPath, - const RigMainGrid* mainGrid, - const std::vector& filteredIntersections, - const std::vector& cellSegMap, - const std::string& infoType, - const std::string& wellNameForExport, - int& segmentNumber, - int& branchNumber, - RiaDefines::EclipseUnitSystem unitSystem ); +std::vector buildFishbonesBranches( const RimEclipseCase* eclipseCase, + const RimWellPath* wellPath, + const RigMainGrid* mainGrid, + const std::vector& filteredIntersections, + const std::vector& cellSegMap, + const std::string& infoType, + const std::string& wellNameForExport, + int& segmentNumber, + int& branchNumber, + RiaDefines::EclipseUnitSystem unitSystem ); } // namespace RicMswBranchBuilder diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicWellPathExportMswGeometryPath.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicWellPathExportMswGeometryPath.cpp index 831c7b8241..d40cd22e30 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicWellPathExportMswGeometryPath.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicWellPathExportMswGeometryPath.cpp @@ -155,24 +155,24 @@ std::vector buildLateralBranches( RimEclipseCase* const RigActiveCellInfo* activeCellInfo = eclipseCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL ); - auto lateralBranch = RicMswBranchBuilder::buildMainBoreBranchFromGeometry( wellPath, - filteredIntersections, - mainGrid, - eclipseCase, - perforationIntervals, - valvedIntervals, - infoType, - tieInMD, - tieInTVD, - lateralBranchNum, - segmentNumber, - childOutletSeg, - mswParameters->maxSegmentLength(), - {}, - exportDate, - unitSystem, - &childCellSegMap, - activeCellInfo ); + auto lateralBranch = RicMswBranchBuilder::buildMainBoreBranch( wellPath, + filteredIntersections, + mainGrid, + eclipseCase, + perforationIntervals, + valvedIntervals, + infoType, + tieInMD, + tieInTVD, + lateralBranchNum, + segmentNumber, + childOutletSeg, + mswParameters->maxSegmentLength(), + {}, + exportDate, + unitSystem, + &childCellSegMap, + activeCellInfo ); if ( tieInValve && !lateralBranch.segments.empty() ) lateralBranch.segments.front().description.clear(); lateralBranch.tieInValve = std::move( tieInValve ); @@ -201,46 +201,41 @@ std::vector buildLateralBranches( RimEclipseCase* result.push_back( std::move( lateralBranch ) ); - auto valveBranches = RicMswBranchBuilder::buildValveBranchesFromGeometry( wellPath, - filteredIntersections, - mainGrid, - eclipseCase, - perforationIntervals, - childCellSegMap, - infoType, - wellNameForExport, - segmentNumber, - branchNumber, - mswParameters->maxSegmentLength(), - {}, - exportDate, - unitSystem ); + auto valveBranches = RicMswBranchBuilder::buildValveBranches( wellPath, + filteredIntersections, + mainGrid, + eclipseCase, + perforationIntervals, + childCellSegMap, + infoType, + wellNameForExport, + segmentNumber, + branchNumber, + mswParameters->maxSegmentLength(), + {}, + exportDate, + unitSystem ); result.insert( result.end(), std::make_move_iterator( valveBranches.begin() ), std::make_move_iterator( valveBranches.end() ) ); if ( ( completionType & CompletionType::FRACTURES ) == CompletionType::FRACTURES ) { - auto fracBranches = RicMswBranchBuilder::buildFractureBranchesFromGeometry( eclipseCase, - wellPath, - mainGrid, - childCellSegMap, - infoType, - segmentNumber, - branchNumber ); + auto fracBranches = + RicMswBranchBuilder::buildFractureBranches( eclipseCase, wellPath, mainGrid, childCellSegMap, infoType, segmentNumber, branchNumber ); result.insert( result.end(), std::make_move_iterator( fracBranches.begin() ), std::make_move_iterator( fracBranches.end() ) ); } if ( ( completionType & CompletionType::FISHBONES ) == CompletionType::FISHBONES ) { - auto fishBranches = RicMswBranchBuilder::buildFishbonesBranchesFromGeometry( eclipseCase, - wellPath, - mainGrid, - filteredIntersections, - childCellSegMap, - infoType, - wellNameForExport, - segmentNumber, - branchNumber, - unitSystem ); + auto fishBranches = RicMswBranchBuilder::buildFishbonesBranches( eclipseCase, + wellPath, + mainGrid, + filteredIntersections, + childCellSegMap, + infoType, + wellNameForExport, + segmentNumber, + branchNumber, + unitSystem ); result.insert( result.end(), std::make_move_iterator( fishBranches.begin() ), std::make_move_iterator( fishBranches.end() ) ); } @@ -321,24 +316,24 @@ RigMswWellExportData buildMswWellExportData( RimEclipseCase* const RigActiveCellInfo* activeCellInfo = eclipseCase->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL ); - auto mainBoreBranch = RicMswBranchBuilder::buildMainBoreBranchFromGeometry( wellPath, - filteredIntersections, - mainGrid, - eclipseCase, - perforationIntervals, - valvedIntervals, - infoType, - initialMD, - initialTVD, - branchNumber, - segmentNumber, - 1, // outlet = heel (segment 1) - maxSegmentLength, - customSegmentIntervals, - exportDate, - unitSystem, - &cellSegMap, - activeCellInfo ); + auto mainBoreBranch = RicMswBranchBuilder::buildMainBoreBranch( wellPath, + filteredIntersections, + mainGrid, + eclipseCase, + perforationIntervals, + valvedIntervals, + infoType, + initialMD, + initialTVD, + branchNumber, + segmentNumber, + 1, // outlet = heel (segment 1) + maxSegmentLength, + customSegmentIntervals, + exportDate, + unitSystem, + &cellSegMap, + activeCellInfo ); const std::string wellNameForExport = wellPath->completionSettings()->wellNameForExport().toStdString(); @@ -365,43 +360,43 @@ RigMswWellExportData buildMswWellExportData( RimEclipseCase* } } - auto valveBranches = RicMswBranchBuilder::buildValveBranchesFromGeometry( wellPath, - filteredIntersections, - mainGrid, - eclipseCase, - perforationIntervals, - cellSegMap, - infoType, - wellNameForExport, - segmentNumber, - branchNumber, - maxSegmentLength, - customSegmentIntervals, - exportDate, - unitSystem ); + auto valveBranches = RicMswBranchBuilder::buildValveBranches( wellPath, + filteredIntersections, + mainGrid, + eclipseCase, + perforationIntervals, + cellSegMap, + infoType, + wellNameForExport, + segmentNumber, + branchNumber, + maxSegmentLength, + customSegmentIntervals, + exportDate, + unitSystem ); const bool includeFractures = ( completionType & CompletionType::FRACTURES ) == CompletionType::FRACTURES; std::vector fractureBranches; if ( includeFractures ) { fractureBranches = - RicMswBranchBuilder::buildFractureBranchesFromGeometry( eclipseCase, wellPath, mainGrid, cellSegMap, infoType, segmentNumber, branchNumber ); + RicMswBranchBuilder::buildFractureBranches( eclipseCase, wellPath, mainGrid, cellSegMap, infoType, segmentNumber, branchNumber ); } const bool includeFishbones = ( completionType & CompletionType::FISHBONES ) == CompletionType::FISHBONES; std::vector fishbonesBranches; if ( includeFishbones ) { - fishbonesBranches = RicMswBranchBuilder::buildFishbonesBranchesFromGeometry( eclipseCase, - wellPath, - mainGrid, - filteredIntersections, - cellSegMap, - infoType, - wellNameForExport, - segmentNumber, - branchNumber, - unitSystem ); + fishbonesBranches = RicMswBranchBuilder::buildFishbonesBranches( eclipseCase, + wellPath, + mainGrid, + filteredIntersections, + cellSegMap, + infoType, + wellNameForExport, + segmentNumber, + branchNumber, + unitSystem ); } // Tie-in child laterals (recursive) diff --git a/docs/diagrams/msw-export/01-overview.md b/docs/diagrams/msw-export/01-overview.md index 91f708004b..62ddc429c4 100644 --- a/docs/diagrams/msw-export/01-overview.md +++ b/docs/diagrams/msw-export/01-overview.md @@ -18,10 +18,10 @@ flowchart TD end subgraph BUILD["RicWellPathExportMswGeometryPath
buildMswWellExportData"] - MB["buildMainBoreBranchFromGeometry
RicMswBranchBuilder"] - VB["buildValveBranchesFromGeometry
RicMswBranchBuilder"] - FRB["buildFractureBranchesFromGeometry
RicMswBranchBuilder"] - FBB["buildFishbonesBranchesFromGeometry
RicMswBranchBuilder"] + MB["buildMainBoreBranch
RicMswBranchBuilder"] + VB["buildValveBranches
RicMswBranchBuilder"] + FRB["buildFractureBranches
RicMswBranchBuilder"] + FBB["buildFishbonesBranches
RicMswBranchBuilder"] LAT["buildLateralBranches
recursive"] end diff --git a/docs/diagrams/msw-export/03-build-pipeline.md b/docs/diagrams/msw-export/03-build-pipeline.md index 402ce8356a..306daa5d1c 100644 --- a/docs/diagrams/msw-export/03-build-pipeline.md +++ b/docs/diagrams/msw-export/03-build-pipeline.md @@ -12,16 +12,16 @@ flowchart TD FI --> HEADER["Build WelsegsHeader
(well name, topLength, topDepth,
infoType, pressureComponents)"] - FI --> MB["buildMainBoreBranchFromGeometry
-> RigMswBranch (branch 1)"] + FI --> MB["buildMainBoreBranch
-> RigMswBranch (branch 1)"] MB --> CSMAP["fills CellSegmentEntry map
(MD range -> segment number)"] CSMAP --> SVALVE["standalone valves from
RimWellPathValve (valveCollection)
-> embed WsegvalvRow on segment"] - CSMAP --> VB["buildValveBranchesFromGeometry
(ICD/ICV/AICD/SICD inside perforations)
-> vector~RigMswBranch~"] + CSMAP --> VB["buildValveBranches
(ICD/ICV/AICD/SICD inside perforations)
-> vector~RigMswBranch~"] - CSMAP --> FRB["buildFractureBranchesFromGeometry
(if FRACTURES flag set)
-> vector~RigMswBranch~"] + CSMAP --> FRB["buildFractureBranches
(if FRACTURES flag set)
-> vector~RigMswBranch~"] - CSMAP --> FBB["buildFishbonesBranchesFromGeometry
(if FISHBONES flag set)
-> vector~RigMswBranch~"] + CSMAP --> FBB["buildFishbonesBranches
(if FISHBONES flag set)
-> vector~RigMswBranch~"] CSMAP --> LAT["buildLateralBranches (recursive)
for each child RimWellPath with tie-in
-> vector~RigMswBranch~"] @@ -42,13 +42,13 @@ flowchart TD TIEINSEG & SKIP --> GCS2["generateCellSegments
filterIntersections"] - GCS2 --> MB2["buildMainBoreBranchFromGeometry
-> RigMswBranch (lateral)"] + GCS2 --> MB2["buildMainBoreBranch
-> RigMswBranch (lateral)"] MB2 --> SVALVE2["standalone valves
(valveCollection)"] MB2 --> CSMAP2["CellSegmentEntry map"] - CSMAP2 --> VB2["buildValveBranchesFromGeometry"] - CSMAP2 --> FRB2["buildFractureBranchesFromGeometry"] - CSMAP2 --> FBB2["buildFishbonesBranchesFromGeometry"] + CSMAP2 --> VB2["buildValveBranches"] + CSMAP2 --> FRB2["buildFractureBranches"] + CSMAP2 --> FBB2["buildFishbonesBranches"] CSMAP2 --> GRANDCHILD["for each grandchild wellPath
buildLateralBranches (recurse)"]