mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 07:03:25 -06:00
#1304 Absolute simplest fix to make things run. Remove tracer on connection cells iif well flow for cell has inconsistent direction with the with the sum of well fluxes in the same cell.
This commit is contained in:
parent
b60139c558
commit
5d0df1c86f
@ -64,7 +64,10 @@ namespace RigFlowDiagInterfaceTools {
|
||||
const auto& ijk = completion.ijk;
|
||||
const int cell_index = G.activeCell(ijk, grid_index);
|
||||
if (cell_index >= 0) {
|
||||
inflow.emplace(cell_index, completion.reservoir_inflow_rate);
|
||||
auto iterIsInsertedPair = inflow.emplace(cell_index, completion.reservoir_inflow_rate);
|
||||
if (!iterIsInsertedPair.second){ // Not inserted, We had something there already
|
||||
iterIsInsertedPair.first->second += completion.reservoir_inflow_rate; // Accumulate the flow at this connection
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -225,7 +225,40 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
const std::vector<Opm::ECLWellSolution::WellData> well_fluxes =
|
||||
wsol.solution(m_opmFldData->eclGraph.rawResultData(), m_opmFldData->eclGraph.numGrids());
|
||||
|
||||
m_opmFldData->fldToolbox->assignInflowFlux(RigFlowDiagInterfaceTools::extractWellFlows(m_opmFldData->eclGraph, well_fluxes));
|
||||
Opm::FlowDiagnostics::CellSetValues sumWellFluxPrCell = RigFlowDiagInterfaceTools::extractWellFlows(m_opmFldData->eclGraph, well_fluxes);
|
||||
|
||||
m_opmFldData->fldToolbox->assignInflowFlux(sumWellFluxPrCell);
|
||||
|
||||
for ( auto& tracerCellIdxsPair: injectorTracers )
|
||||
{
|
||||
std::vector<int> filteredCellIndices;
|
||||
|
||||
for (int activeCellIdx : tracerCellIdxsPair.second)
|
||||
{
|
||||
auto activeCellIdxFluxPair = sumWellFluxPrCell.find(activeCellIdx);
|
||||
if (activeCellIdxFluxPair->second > 0 )
|
||||
{
|
||||
filteredCellIndices.push_back(activeCellIdx);
|
||||
}
|
||||
}
|
||||
|
||||
if (tracerCellIdxsPair.second.size() != filteredCellIndices.size()) tracerCellIdxsPair.second = filteredCellIndices;
|
||||
}
|
||||
|
||||
for ( auto& tracerCellIdxsPair: producerTracers )
|
||||
{
|
||||
std::vector<int> filteredCellIndices;
|
||||
|
||||
for (int activeCellIdx : tracerCellIdxsPair.second)
|
||||
{
|
||||
auto activeCellIdxFluxPair = sumWellFluxPrCell.find(activeCellIdx);
|
||||
if (activeCellIdxFluxPair->second < 0 )
|
||||
{
|
||||
filteredCellIndices.push_back(activeCellIdx);
|
||||
}
|
||||
}
|
||||
if (tracerCellIdxsPair.second.size() != filteredCellIndices.size()) tracerCellIdxsPair.second = filteredCellIndices;
|
||||
}
|
||||
}
|
||||
|
||||
progressInfo.incrementProgress();
|
||||
@ -252,7 +285,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
result.setTracerFraction(tracerId.to_string(), fracVals);
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
CVF_ASSERT(false);
|
||||
}
|
||||
@ -281,7 +314,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
result.setTracerFraction(tracerId.to_string(), fracVals);
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
CVF_ASSERT(false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user