#13425 Fix WELSEGS date scoping: tubing events only appear at their event dates

Tubing event diameter/roughness values were leaking into earlier date
sections in the generated schedule. The WELSEGS collection functions
did not filter intervals by export date, unlike COMPSEGS and other
keywords which already received the exportDate parameter.

Thread exportDate through collectWelsegsData, collectWelsegsDataRecursively,
and collectWelsegsSegment. Add date-aware overloads of getDiameterAtMD and
getRoughnessAtMD that use isActiveOnDate to filter intervals. Update test
to verify tubing values only appear at their scheduled dates.
This commit is contained in:
Kristian Bendiksen committed 2026-02-12 08:15:22 +01:00
1 parent 6782d6a40e
commit 82e2dbc434
8 files changed
+186 -24

No files matched your search

@@ -90,6 +90,44 @@ double RimDiameterRoughnessIntervalCollection::getRoughnessAtMD( double md, RiaD
return RimMswCompletionParameters::defaultRoughnessFactor( unitSystem );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimDiameterRoughnessIntervalCollection::getDiameterAtMD( double md,
RiaDefines::EclipseUnitSystem unitSystem,
const QDateTime& exportDate ) const
{
for ( auto* interval : intervals() )
{
if ( interval && interval->containsMD( md ) && interval->isActiveOnDate( exportDate ) )
{
return interval->diameter( unitSystem );
}
}
// Return default if no active interval found at this date
return RimMswCompletionParameters::defaultLinerDiameter( unitSystem );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimDiameterRoughnessIntervalCollection::getRoughnessAtMD( double md,
RiaDefines::EclipseUnitSystem unitSystem,
const QDateTime& exportDate ) const
{
for ( auto* interval : intervals() )
{
if ( interval && interval->containsMD( md ) && interval->isActiveOnDate( exportDate ) )
{
return interval->roughnessFactor( unitSystem );
}
}
// Return default if no active interval found at this date
return RimMswCompletionParameters::defaultRoughnessFactor( unitSystem );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -21,6 +21,8 @@
#include "RimDiameterRoughnessInterval.h"
#include "RimIntervalCollection.h"
#include <QDateTime>
//==================================================================================================
///
/// Collection to manage diameter and roughness intervals for measured depth ranges
@@ -41,6 +43,10 @@ public:
double getDiameterAtMD( double md, RiaDefines::EclipseUnitSystem unitSystem ) const;
double getRoughnessAtMD( double md, RiaDefines::EclipseUnitSystem unitSystem ) const;
// Date-aware lookup methods (only returns values from intervals active on the given date)
double getDiameterAtMD( double md, RiaDefines::EclipseUnitSystem unitSystem, const QDateTime& exportDate ) const;
double getRoughnessAtMD( double md, RiaDefines::EclipseUnitSystem unitSystem, const QDateTime& exportDate ) const;
// Domain-specific validation
bool coversFullRange( double startMD, double endMD ) const;
@@ -295,6 +295,34 @@ double RimMswCompletionParameters::getRoughnessAtMD( double md, RiaDefines::Ecli
return roughnessFactor( unitSystem );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimMswCompletionParameters::getDiameterAtMD( double md, RiaDefines::EclipseUnitSystem unitSystem, const QDateTime& exportDate ) const
{
if ( isUsingIntervalSpecificValues() && m_diameterRoughnessIntervals() )
{
return m_diameterRoughnessIntervals()->getDiameterAtMD( md, unitSystem, exportDate );
}
// Fall back to single value
return linerDiameter( unitSystem );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimMswCompletionParameters::getRoughnessAtMD( double md, RiaDefines::EclipseUnitSystem unitSystem, const QDateTime& exportDate ) const
{
if ( isUsingIntervalSpecificValues() && m_diameterRoughnessIntervals() )
{
return m_diameterRoughnessIntervals()->getRoughnessAtMD( md, unitSystem, exportDate );
}
// Fall back to single value
return roughnessFactor( unitSystem );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -24,6 +24,8 @@
#include "cafPdmObject.h"
#include "cafPdmUiGroup.h"
#include <QDateTime>
class RimDiameterRoughnessIntervalCollection;
class RimCustomSegmentIntervalCollection;
@@ -92,6 +94,10 @@ public:
double getDiameterAtMD( double md, RiaDefines::EclipseUnitSystem unitSystem ) const;
double getRoughnessAtMD( double md, RiaDefines::EclipseUnitSystem unitSystem ) const;
// Date-aware overloads (only returns values from intervals active on the given date)
double getDiameterAtMD( double md, RiaDefines::EclipseUnitSystem unitSystem, const QDateTime& exportDate ) const;
double getRoughnessAtMD( double md, RiaDefines::EclipseUnitSystem unitSystem, const QDateTime& exportDate ) const;
RimDiameterRoughnessIntervalCollection* diameterRoughnessIntervals() const;
// Custom segment intervals