mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1171 Correct start and end of each cell contribution for pseudo-length based plot.
This commit is contained in:
parent
b58de820b8
commit
9e73fadada
@ -118,8 +118,17 @@ void RimWellFlowRateCurve::onLoadDataAndUpdate()
|
|||||||
void RimWellFlowRateCurve::updateCurveAppearance()
|
void RimWellFlowRateCurve::updateCurveAppearance()
|
||||||
{
|
{
|
||||||
RimWellLogCurve::updateCurveAppearance();
|
RimWellLogCurve::updateCurveAppearance();
|
||||||
|
|
||||||
m_qwtPlotCurve->setStyle(QwtPlotCurve::Steps);
|
// Use step-type curves if using connection numbers
|
||||||
|
{
|
||||||
|
RimWellLogPlot* wellLogPlot;
|
||||||
|
firstAncestorOrThisOfType(wellLogPlot);
|
||||||
|
if ( wellLogPlot && wellLogPlot->depthType() == RimWellLogPlot::CONNECTION_NUMBER )
|
||||||
|
{
|
||||||
|
m_qwtPlotCurve->setStyle(QwtPlotCurve::Steps);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QColor curveQColor = QColor (m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte());
|
QColor curveQColor = QColor (m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte());
|
||||||
m_qwtPlotCurve->setBrush(QBrush( curveQColor));
|
m_qwtPlotCurve->setBrush(QBrush( curveQColor));
|
||||||
|
|
||||||
|
@ -379,17 +379,32 @@ void RigAccWellFlowCalculator::calculateFlowPrPseudoLength(size_t branchIdx, dou
|
|||||||
|
|
||||||
while ( clSegIdx >= 0 )
|
while ( clSegIdx >= 0 )
|
||||||
{
|
{
|
||||||
if (previousResultPoint.isEqual(branchCells[clSegIdx])) { --clSegIdx; continue; } // Todo: Do the skipping within one cell to get the complete length span of the cell into the graph
|
int cellBottomPointIndex = -1;
|
||||||
|
int cellUpperPointIndex = -1;
|
||||||
|
int currentSegmentIndex = -1;
|
||||||
|
|
||||||
std::vector<double> flowPrTracer = calculateFlowPrTracer(branchCells, clSegIdx);
|
// Find the complete cell span
|
||||||
|
{
|
||||||
|
cellBottomPointIndex = clSegIdx + 1;
|
||||||
|
|
||||||
double pseudoLengthFromTop_lower = mdCalculator.measuredDepths()[clSegIdx + 1] + startPseudoLengthFromTop;
|
previousResultPoint = branchCells[clSegIdx];
|
||||||
|
--clSegIdx;
|
||||||
|
while ( clSegIdx >= 0 && previousResultPoint.isEqual(branchCells[clSegIdx]) ) { --clSegIdx; }
|
||||||
|
|
||||||
|
cellUpperPointIndex = clSegIdx + 1;
|
||||||
|
currentSegmentIndex = cellUpperPointIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<double> flowPrTracer = calculateFlowPrTracer(branchCells, currentSegmentIndex);
|
||||||
|
|
||||||
|
double pseudoLengthFromTop_lower = mdCalculator.measuredDepths()[cellBottomPointIndex] + startPseudoLengthFromTop;
|
||||||
|
|
||||||
// Push back the new start-of-cell flow, with the previously accumulated result into the storage
|
// Push back the new start-of-cell flow, with the previously accumulated result into the storage
|
||||||
|
|
||||||
storeFlowOnDepth(branchFlow, pseudoLengthFromTop_lower, accFlowPrTracer, flowPrTracer);
|
storeFlowOnDepth(branchFlow, pseudoLengthFromTop_lower, accFlowPrTracer, flowPrTracer);
|
||||||
|
|
||||||
// Accumulate the connection-cell's fraction flows
|
// Accumulate the connection-cell's fraction flows
|
||||||
|
|
||||||
for (size_t tIdx = 0; tIdx < flowPrTracer.size(); ++tIdx)
|
for (size_t tIdx = 0; tIdx < flowPrTracer.size(); ++tIdx)
|
||||||
{
|
{
|
||||||
accFlowPrTracer[tIdx] += flowPrTracer[tIdx];
|
accFlowPrTracer[tIdx] += flowPrTracer[tIdx];
|
||||||
@ -397,9 +412,9 @@ void RigAccWellFlowCalculator::calculateFlowPrPseudoLength(size_t branchIdx, dou
|
|||||||
|
|
||||||
// Add the total accumulated (fraction) flows from any branches connected to this cell
|
// Add the total accumulated (fraction) flows from any branches connected to this cell
|
||||||
|
|
||||||
double pseudoLengthFromTop_upper = mdCalculator.measuredDepths()[clSegIdx] + startPseudoLengthFromTop;
|
double pseudoLengthFromTop_upper = mdCalculator.measuredDepths()[cellUpperPointIndex] + startPseudoLengthFromTop;
|
||||||
|
|
||||||
std::vector<size_t> downStreamBranchIndices = findDownStreamBranchIdxs(branchCells[clSegIdx]);
|
std::vector<size_t> downStreamBranchIndices = findDownStreamBranchIdxs(branchCells[cellUpperPointIndex]);
|
||||||
for ( size_t dsBidx : downStreamBranchIndices )
|
for ( size_t dsBidx : downStreamBranchIndices )
|
||||||
{
|
{
|
||||||
BranchFlow &downStreamBranchFlow = m_pseudoLengthFlowPrBranch[dsBidx];
|
BranchFlow &downStreamBranchFlow = m_pseudoLengthFlowPrBranch[dsBidx];
|
||||||
@ -414,10 +429,6 @@ void RigAccWellFlowCalculator::calculateFlowPrPseudoLength(size_t branchIdx, dou
|
|||||||
|
|
||||||
storeFlowOnDepth(branchFlow, pseudoLengthFromTop_upper, accFlowPrTracer, flowPrTracer);
|
storeFlowOnDepth(branchFlow, pseudoLengthFromTop_upper, accFlowPrTracer, flowPrTracer);
|
||||||
|
|
||||||
previousResultPoint = branchCells[clSegIdx];
|
|
||||||
|
|
||||||
--clSegIdx;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user