mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 07:00:17 -05:00
Completions could interleave mainbore and lateral connections, since the final sort ordered by well name, completion type and measured depth, and each lateral has its own independent MD scale. Connections for a well's mainbore should all come before connections for its side steps. Added RicScheduleDataGenerator::sortCompletionsMainBoreFirst(), which groups completions by owning well path (via RigCompletionData::sourcePdmObject()) and emits them in the traversal order of RimWellPath::allWellPathLaterals(), mainbore first. Sibling laterals are ordered by tie-in measured depth, as allWellPathLaterals() itself is not deterministic. The sort is applied in completionDataForWellPaths() so schedule export, COMPDAT/COMPLUMP export and the gRPC/Python query all get the same ordering.