Improved simulation well visualization

* Move members to private in RigWellResultPoint
* Create simulation well path geometry using well topology
* Add separate MSW well pipe centerline computations
* Review comments

---------

Co-authored-by: magnesj <magnesj@users.noreply.github.com>
This commit is contained in:
Magne Sjaastad
2023-02-28 16:06:37 +01:00
committed by GitHub
parent 9b12885c23
commit d2f435c00a
28 changed files with 976 additions and 241 deletions

View File

@@ -191,11 +191,11 @@ std::map<std::string, std::vector<int>> RimFlowDiagSolution::allTracerActiveCell
{
for ( const RigWellResultPoint& wrp : wBr.m_branchResultPoints )
{
if ( wrp.isValid() && wrp.m_isOpen &&
if ( wrp.isValid() && wrp.isOpen() &&
( ( useInjectors && wrp.flowRate() < 0.0 ) || ( !useInjectors && wrp.flowRate() > 0.0 ) ) )
{
RigGridBase* grid = mainGrid->gridByIndex( wrp.m_gridIndex );
size_t reservoirCellIndex = grid->reservoirCellIndex( wrp.m_gridCellIndex );
RigGridBase* grid = mainGrid->gridByIndex( wrp.gridIndex() );
size_t reservoirCellIndex = grid->reservoirCellIndex( wrp.cellIndex() );
int cellActiveIndex = static_cast<int>( activeCellInfo->cellResultIndex( reservoirCellIndex ) );

View File

@@ -454,18 +454,16 @@ RimWellAllocationOverTimeCollection RimWellAllocationOverTimePlot::createWellAll
continue;
}
std::vector<std::vector<cvf::Vec3d>> pipeBranchesCLCoords;
std::vector<std::vector<RigWellResultPoint>> pipeBranchesCellIds;
std::map<QString, const std::vector<double>*> tracerFractionCellValues =
RimWellAllocationTools::findOrCreateRelevantTracerCellFractions( simWellData, m_flowDiagSolution, i );
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellFrame( m_case->eclipseCaseData(),
simWellData,
i,
branchDetection,
true,
pipeBranchesCLCoords,
pipeBranchesCellIds );
auto simWellBranches = RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineForTimeStep( m_case->eclipseCaseData(),
simWellData,
i,
branchDetection,
true );
const auto& [pipeBranchesCLCoords, pipeBranchesCellIds] = RigSimulationWellCenterLineCalculator::extractBranchData( simWellBranches );
if ( tracerFractionCellValues.size() )
{

View File

@@ -246,16 +246,12 @@ void RimWellAllocationPlot::updateFromWell()
if ( !simWellData ) return;
// Set up the Accumulated Well Flow Calculator
std::vector<std::vector<cvf::Vec3d>> pipeBranchesCLCoords;
std::vector<std::vector<RigWellResultPoint>> pipeBranchesCellIds;
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellFrame( m_case->eclipseCaseData(),
simWellData,
m_timeStep,
m_branchDetection,
true,
pipeBranchesCLCoords,
pipeBranchesCellIds );
const auto simWellBranches = RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineForTimeStep( m_case->eclipseCaseData(),
simWellData,
m_timeStep,
m_branchDetection,
true );
const auto& [pipeBranchesCLCoords, pipeBranchesCellIds] = RigSimulationWellCenterLineCalculator::extractBranchData( simWellBranches );
std::map<QString, const std::vector<double>*> tracerFractionCellValues =
RimWellAllocationTools::findOrCreateRelevantTracerCellFractions( simWellData, m_flowDiagSolution, m_timeStep );

View File

@@ -353,15 +353,14 @@ public:
m_pipeBranchMeasuredDepths.push_back( intersections[wpExIdx].endMD );
RigWellResultPoint resPoint;
resPoint.m_isOpen = true;
resPoint.m_gridIndex = 0; // Always main grid
resPoint.m_gridCellIndex = globCellIdx; // Shortcut, since we only have
// main grid results from RFT
resPoint.setIsOpen( true );
resPoint.setGridIndex( 0 ); // Always main grid
resPoint.setGridCellIndex( globCellIdx ); // Shortcut, since we only have
// main grid results from RFT
resPoint.m_gasRate = RiaEclipseUnitTools::convertSurfaceGasFlowRateToOilEquivalents( eclCase->eclipseCaseData()->unitsType(),
gasRates[it->second] );
resPoint.m_oilRate = oilRates[it->second];
resPoint.m_waterRate = watRates[it->second];
const double adjustedGasRate =
RiaEclipseUnitTools::convertSurfaceGasFlowRateToOilEquivalents( eclCase->eclipseCaseData()->unitsType(), gasRates[it->second] );
resPoint.setFlowData( -1.0, oilRates[it->second], adjustedGasRate, watRates[it->second] );
m_pipeBranchWellResultPoints.push_back( resPoint );
@@ -415,8 +414,8 @@ public:
const std::vector<RigWellResultPoint>& branchResPoints = resFrame->m_wellResultBranches[brIdx].m_branchResultPoints;
for ( size_t wrpIdx = 0; wrpIdx < branchResPoints.size(); wrpIdx++ )
{
const RigGridBase* grid = mainGrid->gridByIndex( branchResPoints[wrpIdx].m_gridIndex );
size_t globalCellIndex = grid->reservoirCellIndex( branchResPoints[wrpIdx].m_gridCellIndex );
const RigGridBase* grid = mainGrid->gridByIndex( branchResPoints[wrpIdx].gridIndex() );
size_t globalCellIndex = grid->reservoirCellIndex( branchResPoints[wrpIdx].cellIndex() );
globCellIdxToIdxInSimWellBranch[globalCellIndex] = std::make_pair( brIdx, wrpIdx );
}