mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 22:50:25 -05:00
#14804: Address review comments on segment placement, ISEG gRPC, min/max validation
This commit is contained in:
1 parent
d8f346e9ab
commit
97d132685b
8 files changed
+49
-16
No files matched your search
+6
-4
@@ -199,7 +199,7 @@ std::optional<RigMswCellIntersection>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double segmentMidpointMD( const std::vector<CellSegmentEntry>& cellSegMap, int segmentNumber )
|
||||
double segmentNodeMD( const std::vector<CellSegmentEntry>& cellSegMap, int segmentNumber )
|
||||
{
|
||||
for ( const auto& entry : cellSegMap )
|
||||
{
|
||||
@@ -487,7 +487,8 @@ RigMswBranch buildMainBoreBranch( const RimWellPath*
|
||||
std::vector<double> nodes = RicMswTableDataTools::placeSegmentNodes( heelMD,
|
||||
candidateNodes,
|
||||
segmentationSettings.intervals,
|
||||
cellPieces.empty() ? heelMD : cellPieces.back().second );
|
||||
cellPieces.empty() ? heelMD : cellPieces.back().second,
|
||||
cellPieces.empty() ? heelMD : cellPieces.front().first );
|
||||
|
||||
if ( !cellPieces.empty() && !perforationIntervals.empty() &&
|
||||
( segmentationSettings.singleSegmentBeforeFirstPerforation || segmentationSettings.singleSegmentAfterLastPerforation ) )
|
||||
@@ -496,6 +497,7 @@ RigMswBranch buildMainBoreBranch( const RimWellPath*
|
||||
double lastPerforationMD = -std::numeric_limits<double>::infinity();
|
||||
for ( const auto* perf : perforationIntervals )
|
||||
{
|
||||
if ( exportDate && !perf->isActiveOnDate( *exportDate ) ) continue;
|
||||
firstPerforationMD = std::min( firstPerforationMD, perf->startMD() );
|
||||
lastPerforationMD = std::max( lastPerforationMD, perf->endMD() );
|
||||
}
|
||||
@@ -686,7 +688,7 @@ std::vector<RigMswBranch> buildValveBranches( const RimWellPath*
|
||||
{
|
||||
const int cellBranch = ++branchNumber;
|
||||
const int outletSeg = findContainingSegmentForMD( cellSegMap, entry.ci.distanceStart );
|
||||
const double valveMD = segmentMidpointMD( cellSegMap, outletSeg );
|
||||
const double valveMD = segmentNodeMD( cellSegMap, outletSeg );
|
||||
const double valveEndMD = valveMD + RicMswTableDataTools::valveSegmentLength;
|
||||
const double startTVD = RicMswTableDataTools::tvdFromMeasuredDepth( wellPath, valveMD );
|
||||
const double endTVD = RicMswTableDataTools::tvdFromMeasuredDepth( wellPath, valveEndMD );
|
||||
@@ -770,7 +772,7 @@ std::vector<RigMswBranch> buildValveBranches( const RimWellPath*
|
||||
{
|
||||
const int cellBranch = ++branchNumber;
|
||||
const int outletSeg = findContainingSegmentForMD( cellSegMap, entry.ci.distanceStart );
|
||||
const double valveMD = segmentMidpointMD( cellSegMap, outletSeg );
|
||||
const double valveMD = segmentNodeMD( cellSegMap, outletSeg );
|
||||
const double valveEndMD = valveMD + RicMswTableDataTools::valveSegmentLength;
|
||||
const double startTVD = RicMswTableDataTools::tvdFromMeasuredDepth( wellPath, valveMD );
|
||||
const double endTVD = RicMswTableDataTools::tvdFromMeasuredDepth( wellPath, valveEndMD );
|
||||
|
||||
@@ -188,7 +188,8 @@ const RicMswTableDataTools::SegmentationInterval* intervalAtMD( const std::vecto
|
||||
std::vector<double> RicMswTableDataTools::placeSegmentNodes( double outletMD,
|
||||
const std::vector<double>& allCandidateNodes,
|
||||
const std::vector<SegmentationInterval>& intervals,
|
||||
double lastMD )
|
||||
double lastMD,
|
||||
double firstMD )
|
||||
{
|
||||
if ( intervals.empty() ) return allCandidateNodes;
|
||||
|
||||
@@ -209,7 +210,7 @@ std::vector<double> RicMswTableDataTools::placeSegmentNodes( double
|
||||
const double endMD = std::min( interval.endMD, lastMD );
|
||||
for ( int k = 0;; ++k )
|
||||
{
|
||||
const double segmentStart = std::max( interval.startMD + k * length, outletMD );
|
||||
const double segmentStart = std::max( { interval.startMD + k * length, outletMD, firstMD } );
|
||||
const double segmentEnd = std::min( interval.startMD + ( k + 1 ) * length, endMD );
|
||||
if ( interval.startMD + k * length >= endMD - tolerance ) break;
|
||||
if ( segmentEnd - segmentStart > tolerance ) candidateNodes.push_back( 0.5 * ( segmentStart + segmentEnd ) );
|
||||
@@ -260,15 +261,16 @@ std::vector<double> RicMswTableDataTools::placeSegmentNodes( double
|
||||
const auto* interval = intervalAtMD( intervals, nodeMD );
|
||||
if ( interval && interval->maxLength.has_value() )
|
||||
{
|
||||
const double maxLength = *interval->maxLength;
|
||||
const double gap = nodeMD - previousMD;
|
||||
const double maxLength = *interval->maxLength;
|
||||
const double splitStart = std::max( previousMD, interval->startMD );
|
||||
const double gap = nodeMD - splitStart;
|
||||
if ( gap > maxLength + tolerance )
|
||||
{
|
||||
const int segmentCount = static_cast<int>( std::ceil( ( gap - tolerance ) / maxLength ) );
|
||||
const double spacing = gap / segmentCount;
|
||||
for ( int k = 1; k < segmentCount; ++k )
|
||||
{
|
||||
nodes.push_back( previousMD + k * spacing );
|
||||
nodes.push_back( splitStart + k * spacing );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,15 +71,16 @@ SegmentationSettings segmentationSettings( const RimSegmentCollection* segmentCo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Place the segment nodes of a branch. Candidate nodes are the cell (piece) centres in MD order.
|
||||
/// Inside a fixed length interval, the candidates are replaced by nodes at the centre of segments of
|
||||
/// the fixed length, starting at the interval start and limited to [outletMD, lastMD]. Inside a min
|
||||
/// length interval, candidates closer than the min length to the previous node are dropped. Inside a
|
||||
/// max length interval, evenly spaced nodes are inserted until no spacing exceeds the max length.
|
||||
/// The spacing of the first node is measured from the outlet node.
|
||||
/// the fixed length, starting at the interval start and limited to [max(outletMD, firstMD), lastMD].
|
||||
/// Inside a min length interval, candidates closer than the min length to the previous node are
|
||||
/// dropped. Inside a max length interval, evenly spaced nodes are inserted until no spacing exceeds
|
||||
/// the max length; the spacing is measured from the previous node, but never from before the interval start.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> placeSegmentNodes( double outletMD,
|
||||
const std::vector<double>& candidateNodes,
|
||||
const std::vector<SegmentationInterval>& intervals,
|
||||
double lastMD = std::numeric_limits<double>::infinity() );
|
||||
double lastMD = std::numeric_limits<double>::infinity(),
|
||||
double firstMD = -std::numeric_limits<double>::infinity() );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Replace the nodes in [regionStartMD, firstPerforationMD) and/or (lastPerforationMD, regionEndMD]
|
||||
|
||||
Reference in new issue
Block a user