Add optional IJK to ResultPoint for easier debugging

This commit is contained in:
Magne Sjaastad
2023-11-13 10:21:20 +01:00
parent 9e65eb3be9
commit 0f56eaed6b
4 changed files with 47 additions and 10 deletions

View File

@@ -1243,6 +1243,12 @@ RigWellResultPoint RifReaderEclipseOutput::createWellResultPoint( const RigGridB
resultPoint.setFlowData( volumeRate, oilRate, adjustedGasRate, waterRate );
resultPoint.setConnectionFactor( connectionFactor );
auto ijkOneBased = grid->ijkFromCellIndexOneBased( gridCellIndex );
if ( ijkOneBased )
{
resultPoint.setIjk( *ijkOneBased );
}
}
return resultPoint;

View File

@@ -220,19 +220,26 @@ void RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineForTimeSt
bool isMultiSegmentWell = wellResults->isMultiSegmentWell();
#if 0 // Fancy branch splitting, but with artifacts. Needs a bit more work to be better overall than the one we have.
RigWellResultFrame splittedWellFrame;
if (!isMultiSegmentWell && isAutoDetectBranches)
{
splittedWellFrame = splitIntoBranches(*wellFramePtr, eclipseCaseData);
wellFramePtr = &splittedWellFrame;
isMultiSegmentWell = true;
}
#endif
const RigWellResultFrame& wellFrame = *wellFramePtr;
const std::vector<RigWellResultBranch> resBranches = wellFrame.wellResultBranches();
const bool debugOutput = false;
if ( debugOutput )
{
for ( const auto& branch : resBranches )
{
QString branchTxt;
for ( const auto& resultPoint : branch.branchResultPoints() )
{
if ( resultPoint.cellIjk().has_value() )
{
branchTxt += QString( " %1 \n" ).arg( QString::fromStdString( ( *resultPoint.cellIjk() ).toString() ) );
}
}
RiaLogging::debug( branchTxt );
}
}
// Well head
// Match this position with well head position in RivWellHeadPartMgr::buildWellHeadParts()

View File

@@ -301,3 +301,19 @@ cvf::Vec3d RigWellResultPoint::bottomPosition() const
{
return m_bottomPosition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::optional<caf::VecIjk> RigWellResultPoint::cellIjk() const
{
return m_cellIjk;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigWellResultPoint::setIjk( caf::VecIjk cellIJK )
{
m_cellIjk = cellIJK;
}

View File

@@ -22,8 +22,11 @@
#include "cvfVector3.h"
#include "cafVecIjk.h"
#include <QDateTime>
#include <optional>
#include <vector>
//==================================================================================================
@@ -70,6 +73,9 @@ struct RigWellResultPoint
cvf::Vec3d bottomPosition() const;
std::optional<caf::VecIjk> cellIjk() const;
void setIjk( caf::VecIjk cellIJK );
private:
size_t m_gridIndex;
size_t m_cellIndex; //< Index to cell which is included in the well
@@ -89,4 +95,6 @@ private:
double m_connectionFactor;
bool m_isConnectedToValve;
std::optional<caf::VecIjk> m_cellIjk;
};