diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp index 59bf808cc7..ce4ff05beb 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellPltPlot.cpp @@ -933,6 +933,7 @@ public: m_pipeBranchMeasuredDepths.push_back(intersections[wpExIdx].endMD); RigWellResultPoint resPoint; + resPoint.m_isOpen = true; resPoint.m_gridIndex = 0; // Always main grod resPoint.m_gridCellIndex = globCellIdx; // Shortcut, since we only have main grid results from RFT @@ -941,7 +942,11 @@ public: resPoint.m_waterRate = watRates[it->second]; m_pipeBranchWellResultPoints.push_back(resPoint); - m_pipeBranchWellResultPoints.push_back(RigWellResultPoint()); // Invalid res point describing the "line" between the cells + + if ( wpExIdx < intersections.size() - 1 ) + { + m_pipeBranchWellResultPoints.push_back(RigWellResultPoint()); // Invalid res point describing the "line" between the cells + } } } @@ -1015,7 +1020,10 @@ public: const RigWellResultPoint& resPoint = resFrame.m_wellResultBranches[it->second.first].m_branchResultPoints[it->second.second]; m_pipeBranchWellResultPoints.push_back(resPoint); - m_pipeBranchWellResultPoints.push_back(RigWellResultPoint()); // Invalid res point describing the "line" between the cells + if ( wpExIdx < intersections.size() - 1 ) + { + m_pipeBranchWellResultPoints.push_back(RigWellResultPoint()); // Invalid res point describing the "line" between the cells + } } } }; diff --git a/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.cpp index 6fd15a7108..e6375abae1 100644 --- a/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.cpp @@ -54,20 +54,20 @@ size_t RigEclCellIndexCalculator::resultCellIndex(size_t gridIndex, size_t gridC // and is thus expected to be one less than the number of centerline points //-------------------------------------------------------------------------------------------------- RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector< std::vector >& pipeBranchesCLCoords, - const std::vector< std::vector >& pipeBranchesCellIds, + const std::vector< std::vector >& pipeBranchesWellResultPoints, const std::map* >& tracerCellFractionValues, const RigEclCellIndexCalculator& cellIndexCalculator, double smallContribThreshold, bool isProducer) : m_pipeBranchesCLCoords(pipeBranchesCLCoords), - m_pipeBranchesCellIds(pipeBranchesCellIds), + m_pipeBranchesWellResultPoints(pipeBranchesWellResultPoints), m_tracerCellFractionValues(&tracerCellFractionValues), m_cellIndexCalculator(cellIndexCalculator), m_smallContributionsThreshold(smallContribThreshold), m_isProducer(isProducer) { - m_connectionFlowPrBranch.resize(m_pipeBranchesCellIds.size()); - m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesCellIds.size()); + m_connectionFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size()); + m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size()); for ( const auto& it: (*m_tracerCellFractionValues) ) m_tracerNames.push_back(it.first); @@ -86,17 +86,17 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector< std::vecto /// //-------------------------------------------------------------------------------------------------- RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector< std::vector >& pipeBranchesCLCoords, - const std::vector< std::vector >& pipeBranchesCellIds, + const std::vector< std::vector >& pipeBranchesWellResultPoints, double smallContribThreshold) : m_pipeBranchesCLCoords(pipeBranchesCLCoords), - m_pipeBranchesCellIds(pipeBranchesCellIds), + m_pipeBranchesWellResultPoints(pipeBranchesWellResultPoints), m_tracerCellFractionValues(nullptr), m_cellIndexCalculator(RigEclCellIndexCalculator(nullptr, nullptr)), m_smallContributionsThreshold(smallContribThreshold), m_isProducer(true) { - m_connectionFlowPrBranch.resize(m_pipeBranchesCellIds.size()); - m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesCellIds.size()); + m_connectionFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size()); + m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size()); #ifdef USE_WELL_PHASE_RATES m_tracerNames.push_back(RIG_FLOW_OIL_NAME); @@ -118,7 +118,7 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector< std::vecto /// //-------------------------------------------------------------------------------------------------- RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector& pipeBranchCLCoords, - const std::vector & pipeBranchCellIds, + const std::vector & pipeBranchesWellResultPoints, const std::vector & pipeBranchMeasuredDepths, double smallContribThreshold) : m_tracerCellFractionValues(nullptr), @@ -126,12 +126,13 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector m_smallContributionsThreshold(smallContribThreshold), m_isProducer(true) { - m_connectionFlowPrBranch.resize(m_pipeBranchesCellIds.size()); - m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesCellIds.size()); - m_pipeBranchesCLCoords.push_back(pipeBranchCLCoords); - m_pipeBranchesCellIds.push_back(pipeBranchCellIds); - m_pipeBranchesMeasuredDepths.push_back(pipeBranchMeasuredDepths); + m_pipeBranchesWellResultPoints.push_back(pipeBranchesWellResultPoints); + m_pipeBranchesMeasuredDepths.push_back(pipeBranchMeasuredDepths); + + m_connectionFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size()); + m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size()); + #ifdef USE_WELL_PHASE_RATES m_tracerNames.push_back(RIG_FLOW_OIL_NAME); @@ -310,7 +311,7 @@ std::vector > RigAccWellFlowCalculator::totalTracerFr bool RigAccWellFlowCalculator::isWellFlowConsistent() const { bool isConsistent = true; - for (const std::vector & branch : m_pipeBranchesCellIds) + for (const std::vector & branch : m_pipeBranchesWellResultPoints) { for (const RigWellResultPoint& wrp : branch) { @@ -376,7 +377,7 @@ bool RigAccWellFlowCalculator::isFlowRateConsistent(double flowRate) const //-------------------------------------------------------------------------------------------------- void RigAccWellFlowCalculator::calculateAccumulatedFlowPrConnection(size_t branchIdx, size_t startConnectionNumberFromTop) { - const std::vector& branchCells = m_pipeBranchesCellIds[branchIdx]; + const std::vector& branchCells = m_pipeBranchesWellResultPoints[branchIdx]; std::vector resPointUniqueIndexFromBottom = wrpToUniqueWrpIndexFromBottom(branchCells); @@ -426,7 +427,7 @@ void RigAccWellFlowCalculator::calculateAccumulatedFlowPrConnection(size_t branc calculateAccumulatedFlowPrConnection(dsBidx, connNumFromTop); std::vector accBranchFlowPrTracer = accumulatedDsBranchFlowPrTracer(downStreamBranchFlow); addDownStreamBranchFlow(&accFlowPrTracer, accBranchFlowPrTracer); - if (m_pipeBranchesCellIds[dsBidx].size() <= 3) + if (m_pipeBranchesWellResultPoints[dsBidx].size() <= 3) { // Short branch. Will not be visible. Show branch flow as addition to this connections direct flow addDownStreamBranchFlow(&flowPrTracer, accBranchFlowPrTracer); @@ -450,7 +451,7 @@ void RigAccWellFlowCalculator::calculateAccumulatedFlowPrConnection(size_t branc //-------------------------------------------------------------------------------------------------- void RigAccWellFlowCalculator::calculateFlowPrPseudoLength(size_t branchIdx, double startPseudoLengthFromTop) { - const std::vector& branchCells = m_pipeBranchesCellIds[branchIdx]; + const std::vector& branchCells = m_pipeBranchesWellResultPoints[branchIdx]; const std::vector & branchClPoints = m_pipeBranchesCLCoords[branchIdx]; const std::vector & branchMDs = m_pipeBranchesMeasuredDepths[branchIdx]; @@ -523,7 +524,7 @@ void RigAccWellFlowCalculator::calculateFlowPrPseudoLength(size_t branchIdx, dou calculateFlowPrPseudoLength(dsBidx, pseudoLengthFromTop_upper); std::vector accBranchFlowPrTracer = accumulatedDsBranchFlowPrTracer(downStreamBranchFlow); addDownStreamBranchFlow(&accFlowPrTracer, accBranchFlowPrTracer); - if (m_pipeBranchesCellIds[dsBidx].size() <= 3) + if (m_pipeBranchesWellResultPoints[dsBidx].size() <= 3) { // Short branch. Will not be visible. Show branch flow as addition to this connections direct flow addDownStreamBranchFlow(&flowPrTracer, accBranchFlowPrTracer); @@ -785,12 +786,12 @@ std::vector RigAccWellFlowCalculator::findDownStreamBranchIdxs(const Rig { std::vector downStreamBranchIdxs; - for ( size_t bIdx = 0; bIdx < m_pipeBranchesCellIds.size(); ++bIdx ) + for ( size_t bIdx = 0; bIdx < m_pipeBranchesWellResultPoints.size(); ++bIdx ) { - if ( m_pipeBranchesCellIds[bIdx][0].m_gridIndex == connectionPoint.m_gridIndex - && m_pipeBranchesCellIds[bIdx][0].m_gridCellIndex == connectionPoint.m_gridCellIndex - && m_pipeBranchesCellIds[bIdx][0].m_ertBranchId == connectionPoint.m_ertBranchId - && m_pipeBranchesCellIds[bIdx][0].m_ertSegmentId == connectionPoint.m_ertSegmentId) + if ( m_pipeBranchesWellResultPoints[bIdx][0].m_gridIndex == connectionPoint.m_gridIndex + && m_pipeBranchesWellResultPoints[bIdx][0].m_gridCellIndex == connectionPoint.m_gridCellIndex + && m_pipeBranchesWellResultPoints[bIdx][0].m_ertBranchId == connectionPoint.m_ertBranchId + && m_pipeBranchesWellResultPoints[bIdx][0].m_ertSegmentId == connectionPoint.m_ertSegmentId) { downStreamBranchIdxs.push_back(bIdx); } diff --git a/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.h b/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.h index 4ac3879ba6..6d238309d0 100644 --- a/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.h +++ b/ApplicationCode/ReservoirDataModel/RigAccWellFlowCalculator.h @@ -115,7 +115,7 @@ private: std::vector< std::vector > m_pipeBranchesCLCoords; - std::vector< std::vector > m_pipeBranchesCellIds; + std::vector< std::vector > m_pipeBranchesWellResultPoints; std::vector< std::vector > m_pipeBranchesMeasuredDepths; const std::map* >* m_tracerCellFractionValues;