#14870 Schedule export: export multilateral wells once per well name

Wells sharing an export name now produce one WELSPECS/COMPORD record,
one set of MSW keywords, and no duplicate COMPDAT/COMPLUMP connections.
Events on any well in the group trigger the group's keywords.

Connections in cells shared by several well paths of a group are combined
into one record. MSW keywords are exported for the well tree of the first
group member selected for MSW export.

Fixes #14870
This commit is contained in:
Kristian Bendiksen committed 2026-10-12 18:47:03 +02:00
1 parent 164dee3f4b
commit f3d9d04281
5 files changed
+262 -48

No files matched your search

@@ -65,6 +65,7 @@
#include <QDir>
#include <algorithm>
#include <map>
#include <optional>
#include <set>
@@ -1383,6 +1384,19 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCarfinForTemporaryLgrs( c
std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::completionDataForWellPath( RimWellPath* wellPath,
RimEclipseCase* eCase,
const std::optional<QDateTime>& exportDate )
{
if ( wellPath == nullptr ) return {};
return completionDataForWellPaths( { wellPath }, eCase, exportDate );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData>
RicWellPathExportCompletionDataFeatureImpl::completionDataForWellPaths( const std::vector<RimWellPath*>& wellPaths,
RimEclipseCase* eCase,
const std::optional<QDateTime>& exportDate )
{
if ( eCase == nullptr ) return {};
@@ -1404,14 +1418,20 @@ std::vector<RigCompletionData> RicWellPathExportCompletionDataFeatureImpl::compl
std::vector<RigCompletionData> completions;
// Completions from all given well paths (and their laterals) are combined per cell, so that cells shared
// by several well paths are exported as a single connection.
std::vector<RimWellPath*> allWellPathLaterals;
if ( wellPath->unitSystem() == eCase->eclipseCaseData()->unitsType() )
for ( auto* wellPath : wellPaths )
{
allWellPathLaterals = wellPath->allWellPathLaterals();
}
else
{
return {};
if ( !wellPath || wellPath->unitSystem() != eCase->eclipseCaseData()->unitsType() ) continue;
for ( auto* lateral : wellPath->allWellPathLaterals() )
{
if ( std::find( allWellPathLaterals.begin(), allWellPathLaterals.end(), lateral ) == allWellPathLaterals.end() )
{
allWellPathLaterals.push_back( lateral );
}
}
}
std::map<size_t, std::vector<RigCompletionData>> completionsPerEclipseCellAllCompletionTypes;