#1345 Fixed. Injector TOF results ended up with a double unit conversion, because tracers with no cells were wrongfully added to the flow diag solver solution.

This commit is contained in:
Jacob Støren
2017-03-22 14:04:13 +01:00
parent 5142c5685a
commit c39462d19a
3 changed files with 10 additions and 2 deletions

View File

@@ -181,10 +181,10 @@ std::map<std::string, std::vector<int> > RimFlowDiagSolution::allTracerActiveCel
bool isInjectorWell = ( wellResFrame.m_productionType != RigWellResultFrame::PRODUCER
&& wellResFrame.m_productionType != RigWellResultFrame::UNDEFINED_PRODUCTION_TYPE);
std::string wellname = wellResults[wIdx]->m_wellName.toStdString();
std::string wellName = wellResults[wIdx]->m_wellName.toStdString();
std::string wellNameXf = addCrossFlowEnding(wellResults[wIdx]->m_wellName).toStdString();
std::vector<int>& tracerCells = tracersWithCells[wellname];
std::vector<int>& tracerCells = tracersWithCells[wellName];
std::vector<int>& tracerCellsCrossFlow = tracersWithCells[wellNameXf];
for (const RigWellResultBranch& wBr: wellResFrame.m_wellResultBranches)
@@ -210,6 +210,9 @@ std::map<std::string, std::vector<int> > RimFlowDiagSolution::allTracerActiveCel
}
}
}
if (tracerCells.empty()) tracersWithCells.erase(wellName);
if (tracerCellsCrossFlow.empty()) tracersWithCells.erase(wellNameXf);
}
}

View File

@@ -316,6 +316,8 @@ std::vector<double>* RigFlowDiagResults::calculateTracerWithMaxFractionResult(co
{
const std::vector<double> * fr = fractions[frIdx].second;
if (!fr) continue;
for ( size_t acIdx = 0 ; acIdx < activeCellCount; ++acIdx )
{
if ( (*fr)[acIdx] == HUGE_VAL ) continue;

View File

@@ -92,6 +92,9 @@ void RigFlowDiagTimeStepResult::setInjProdWellPairFlux(const std::string& inject
void RigFlowDiagTimeStepResult::addResult(const RigFlowDiagResultAddress& resAddr, const std::map<int, double>& cellValues)
{
std::vector<double>& activeCellValues = m_nativeResults[resAddr];
CVF_ASSERT(activeCellValues.empty());
activeCellValues.resize(m_activeCellCount, HUGE_VAL);
for (const auto& pairIt : cellValues)