mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fixed crash when creating well alloc plot
This commit is contained in:
parent
cde71ef07a
commit
fd23ec242e
@ -358,7 +358,7 @@ std::map<QString, const std::vector<double> *> RimWellAllocationPlot::findReleva
|
||||
{
|
||||
RigFlowDiagResultAddress resAddr(RIG_FLD_CELL_FRACTION_RESNAME, tracerName.toStdString());
|
||||
const std::vector<double>* tracerCellFractions = m_flowDiagSolution->flowDiagResults()->resultValues(resAddr, m_timeStep);
|
||||
tracerCellFractionValues[tracerName] = tracerCellFractions;
|
||||
if (tracerCellFractions) tracerCellFractionValues[tracerName] = tracerCellFractions;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -650,15 +650,19 @@ std::vector<double> RigAccWellFlowCalculator::calculateWellCellFlowPrTracer(cons
|
||||
wellCell.m_gridCellIndex);
|
||||
size_t tracerIdx = 0;
|
||||
double totalTracerFractionInCell = 0.0;
|
||||
for ( const auto & tracerFractionIt: (*m_tracerCellFractionValues) )
|
||||
for ( const auto & tracerFractionValsPair: (*m_tracerCellFractionValues) )
|
||||
{
|
||||
double cellTracerFraction = (*tracerFractionIt.second)[resCellIndex];
|
||||
if ( cellTracerFraction != HUGE_VAL && cellTracerFraction == cellTracerFraction )
|
||||
const std::vector<double>* fractionVals = tracerFractionValsPair.second ;
|
||||
if ( fractionVals )
|
||||
{
|
||||
double tracerFlow = cellTracerFraction * wellCell.flowRate();
|
||||
flowPrTracer[tracerIdx] = tracerFlow;
|
||||
double cellTracerFraction = (*fractionVals)[resCellIndex];
|
||||
if ( cellTracerFraction != HUGE_VAL && cellTracerFraction == cellTracerFraction )
|
||||
{
|
||||
double tracerFlow = cellTracerFraction * wellCell.flowRate();
|
||||
flowPrTracer[tracerIdx] = tracerFlow;
|
||||
|
||||
totalTracerFractionInCell += cellTracerFraction;
|
||||
totalTracerFractionInCell += cellTracerFraction;
|
||||
}
|
||||
}
|
||||
tracerIdx++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user