mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4328 Stimulation wells in 3D-view: Render well head using pipe color
If well head is a real connection, render as normal connection. If dummy connection, render as pipe color
This commit is contained in:
@@ -287,7 +287,7 @@ void RivSimWellPipesPartMgr::buildWellPipeParts(const caf::DisplayCoordTransform
|
|||||||
for (const auto& intersectionInfo : wellPathCellIntersections)
|
for (const auto& intersectionInfo : wellPathCellIntersections)
|
||||||
{
|
{
|
||||||
size_t globalCellIndex = intersectionInfo.globCellIndex;
|
size_t globalCellIndex = intersectionInfo.globCellIndex;
|
||||||
const RigWellResultPoint* wResCell = wResFrame.findResultCell(0, globalCellIndex);
|
const RigWellResultPoint* wResCell = wResFrame.findResultCellWellHeadIncluded(0, globalCellIndex);
|
||||||
|
|
||||||
if (!wResCell || !wResCell->isValid())
|
if (!wResCell || !wResCell->isValid())
|
||||||
{
|
{
|
||||||
@@ -415,7 +415,7 @@ void RivSimWellPipesPartMgr::updatePipeResultColor(size_t frameIndex)
|
|||||||
|
|
||||||
if (cellIds[wcIdx].isCell())
|
if (cellIds[wcIdx].isCell())
|
||||||
{
|
{
|
||||||
wResCell = wResFrame.findResultCell(cellIds[wcIdx].m_gridIndex, cellIds[wcIdx].m_gridCellIndex);
|
wResCell = wResFrame.findResultCellWellHeadExcluded(cellIds[wcIdx].m_gridIndex, cellIds[wcIdx].m_gridCellIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wResCell)
|
if (wResCell)
|
||||||
|
|||||||
@@ -354,7 +354,30 @@ bool RigSimWellData::isOpen(size_t resultTimeStepIndex) const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
const RigWellResultPoint* RigWellResultFrame::findResultCell(size_t gridIndex, size_t gridCellIndex) const
|
const RigWellResultPoint* RigWellResultFrame::findResultCellWellHeadIncluded(size_t gridIndex, size_t gridCellIndex) const
|
||||||
|
{
|
||||||
|
const RigWellResultPoint* wellResultPoint = findResultCellWellHeadExcluded(gridIndex, gridCellIndex);
|
||||||
|
if (wellResultPoint) return wellResultPoint;
|
||||||
|
|
||||||
|
// If we could not find the cell among the real connections, we try the wellhead.
|
||||||
|
// The wellhead does however not have a real connection state, and is rendering using pipe color
|
||||||
|
// https://github.com/OPM/ResInsight/issues/4328
|
||||||
|
|
||||||
|
// This behavior was different prior to release 2019.04 and was rendered as a closed connection (gray)
|
||||||
|
// https://github.com/OPM/ResInsight/issues/712
|
||||||
|
|
||||||
|
if (m_wellHead.m_gridCellIndex == gridCellIndex && m_wellHead.m_gridIndex == gridIndex )
|
||||||
|
{
|
||||||
|
return &m_wellHead;
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
const RigWellResultPoint* RigWellResultFrame::findResultCellWellHeadExcluded(size_t gridIndex, size_t gridCellIndex) const
|
||||||
{
|
{
|
||||||
CVF_ASSERT(gridIndex != cvf::UNDEFINED_SIZE_T && gridCellIndex != cvf::UNDEFINED_SIZE_T);
|
CVF_ASSERT(gridIndex != cvf::UNDEFINED_SIZE_T && gridCellIndex != cvf::UNDEFINED_SIZE_T);
|
||||||
|
|
||||||
@@ -362,23 +385,14 @@ const RigWellResultPoint* RigWellResultFrame::findResultCell(size_t gridIndex, s
|
|||||||
{
|
{
|
||||||
for (size_t wc = 0; wc < m_wellResultBranches[wb].m_branchResultPoints.size(); ++wc)
|
for (size_t wc = 0; wc < m_wellResultBranches[wb].m_branchResultPoints.size(); ++wc)
|
||||||
{
|
{
|
||||||
if ( m_wellResultBranches[wb].m_branchResultPoints[wc].m_gridCellIndex == gridCellIndex
|
if (m_wellResultBranches[wb].m_branchResultPoints[wc].m_gridCellIndex == gridCellIndex &&
|
||||||
&& m_wellResultBranches[wb].m_branchResultPoints[wc].m_gridIndex == gridIndex )
|
m_wellResultBranches[wb].m_branchResultPoints[wc].m_gridIndex == gridIndex)
|
||||||
{
|
{
|
||||||
return &(m_wellResultBranches[wb].m_branchResultPoints[wc]);
|
return &(m_wellResultBranches[wb].m_branchResultPoints[wc]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we could not find the cell among the real connections, we try the wellhead.
|
|
||||||
// The wellhead does however not have a real connection state, and is thereby always rendered as closed
|
|
||||||
// If we have a real connection in the wellhead, we should not end here. See Github issue #712
|
|
||||||
|
|
||||||
if (m_wellHead.m_gridCellIndex == gridCellIndex && m_wellHead.m_gridIndex == gridIndex )
|
|
||||||
{
|
|
||||||
return &m_wellHead;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,9 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
const RigWellResultPoint* findResultCell(size_t gridIndex, size_t gridCellIndex) const;
|
const RigWellResultPoint* findResultCellWellHeadIncluded(size_t gridIndex, size_t gridCellIndex) const;
|
||||||
|
const RigWellResultPoint* findResultCellWellHeadExcluded(size_t gridIndex, size_t gridCellIndex) const;
|
||||||
|
|
||||||
|
|
||||||
RigWellResultPoint wellHeadOrStartCell() const;
|
RigWellResultPoint wellHeadOrStartCell() const;
|
||||||
WellProductionType m_productionType;
|
WellProductionType m_productionType;
|
||||||
|
|||||||
@@ -833,7 +833,7 @@ QString RiuResultTextBuilder::wellResultText()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const RigWellResultFrame& wellResultFrame = singleWellResultData->wellResultFrame(m_timeStepIndex);
|
const RigWellResultFrame& wellResultFrame = singleWellResultData->wellResultFrame(m_timeStepIndex);
|
||||||
const RigWellResultPoint* wellResultCell = wellResultFrame.findResultCell(m_gridIndex, m_cellIndex);
|
const RigWellResultPoint* wellResultCell = wellResultFrame.findResultCellWellHeadIncluded(m_gridIndex, m_cellIndex);
|
||||||
if (wellResultCell)
|
if (wellResultCell)
|
||||||
{
|
{
|
||||||
text += QString("-- Well-cell connection info --\n Well Name: %1\n Branch Id: %2\n Segment Id: %3\n").arg(singleWellResultData->m_wellName).arg(wellResultCell->m_ertBranchId).arg(wellResultCell->m_ertSegmentId);
|
text += QString("-- Well-cell connection info --\n Well Name: %1\n Branch Id: %2\n Segment Id: %3\n").arg(singleWellResultData->m_wellName).arg(wellResultCell->m_ertBranchId).arg(wellResultCell->m_ertSegmentId);
|
||||||
|
|||||||
Reference in New Issue
Block a user