Fixed #1188 The connection number calculation was wrong

This commit is contained in:
Jacob Støren
2017-02-07 10:50:25 +01:00
parent 7652009fe7
commit 94a90c8796

View File

@@ -200,15 +200,18 @@ std::vector<size_t> RigAccWellFlowCalculator::wrpToConnectionIndexFromBottom(con
while ( clSegIdx >= 0 )
{
if ( branchCells[clSegIdx].m_gridIndex != prevGridIdx
if ( branchCells[clSegIdx].isValid()
&& ( branchCells[clSegIdx].m_gridIndex != prevGridIdx
|| branchCells[clSegIdx].m_gridCellIndex != prevGridCellIdx
|| branchCells[clSegIdx].m_ertSegmentId != prevErtSegId
|| branchCells[clSegIdx].m_ertBranchId != prevErtBranchId)
|| branchCells[clSegIdx].m_ertBranchId != prevErtBranchId) )
{
++connIdxFromBottom;
prevGridIdx = branchCells[clSegIdx].m_gridIndex ;
prevGridCellIdx = branchCells[clSegIdx].m_gridCellIndex;
prevErtSegId = branchCells[clSegIdx].m_ertSegmentId;
prevErtBranchId = branchCells[clSegIdx].m_ertBranchId;
}
resPointToConnectionIndexFromBottom[clSegIdx] = connIdxFromBottom;
@@ -246,3 +249,4 @@ std::vector<size_t> RigAccWellFlowCalculator::findDownstreamBranchIdxs(const Rig
}
return downStreamBranchIdxs;
}