mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1166 Added the reservoir part of the well allocation plot
This commit is contained in:
parent
426d42935f
commit
4a3ffb9238
@ -20,7 +20,9 @@
|
|||||||
|
|
||||||
#include "RigSingleWellResultsData.h"
|
#include "RigSingleWellResultsData.h"
|
||||||
|
|
||||||
|
#define RIG_FLOW_TOTAL_NAME "Total"
|
||||||
|
#define RIG_RESERVOIR_TRACER_NAME "Reservoir"
|
||||||
|
#define RIG_TINY_TRACER_GROUP_NAME "Other"
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@ -33,6 +35,9 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector< std::vecto
|
|||||||
{
|
{
|
||||||
m_accConnectionFlowPrBranch.resize(m_pipeBranchesCellIds.size());
|
m_accConnectionFlowPrBranch.resize(m_pipeBranchesCellIds.size());
|
||||||
for ( const auto& it: (*m_tracerCellFractionValues) ) m_tracerNames.push_back(it.first);
|
for ( const auto& it: (*m_tracerCellFractionValues) ) m_tracerNames.push_back(it.first);
|
||||||
|
|
||||||
|
m_tracerNames.push_back(RIG_RESERVOIR_TRACER_NAME);
|
||||||
|
|
||||||
calculateAccumulatedFlowPrConnection(0, 1);
|
calculateAccumulatedFlowPrConnection(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +51,7 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector< std::vecto
|
|||||||
m_cellIndexCalculator(RigEclCellIndexCalculator(nullptr, nullptr))
|
m_cellIndexCalculator(RigEclCellIndexCalculator(nullptr, nullptr))
|
||||||
{
|
{
|
||||||
m_accConnectionFlowPrBranch.resize(m_pipeBranchesCellIds.size());
|
m_accConnectionFlowPrBranch.resize(m_pipeBranchesCellIds.size());
|
||||||
m_tracerNames.push_back("GrandTotalOnly");
|
m_tracerNames.push_back(RIG_FLOW_TOTAL_NAME);
|
||||||
calculateAccumulatedFlowPrConnection(0, 1);
|
calculateAccumulatedFlowPrConnection(0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,9 +60,9 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector< std::vecto
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
const std::vector<double>& RigAccWellFlowCalculator::accumulatedTotalFlowPrConnection(size_t branchIdx)
|
const std::vector<double>& RigAccWellFlowCalculator::accumulatedTotalFlowPrConnection(size_t branchIdx)
|
||||||
{
|
{
|
||||||
CVF_ASSERT(m_accConnectionFlowPrBranch[branchIdx].accConnFlowFractionsPrTracer.find("GrandTotalOnly") != m_accConnectionFlowPrBranch[branchIdx].accConnFlowFractionsPrTracer.end());
|
CVF_ASSERT(m_accConnectionFlowPrBranch[branchIdx].accConnFlowFractionsPrTracer.find(RIG_FLOW_TOTAL_NAME) != m_accConnectionFlowPrBranch[branchIdx].accConnFlowFractionsPrTracer.end());
|
||||||
|
|
||||||
return m_accConnectionFlowPrBranch[branchIdx].accConnFlowFractionsPrTracer["GrandTotalOnly"];
|
return m_accConnectionFlowPrBranch[branchIdx].accConnFlowFractionsPrTracer[RIG_FLOW_TOTAL_NAME];
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -118,15 +123,20 @@ void RigAccWellFlowCalculator::calculateAccumulatedFlowPrConnection(size_t branc
|
|||||||
size_t resCellIndex = m_cellIndexCalculator.resultCellIndex(branchCells[clSegIdx].m_gridIndex,
|
size_t resCellIndex = m_cellIndexCalculator.resultCellIndex(branchCells[clSegIdx].m_gridIndex,
|
||||||
branchCells[clSegIdx].m_gridCellIndex);
|
branchCells[clSegIdx].m_gridCellIndex);
|
||||||
size_t tracerIdx = 0;
|
size_t tracerIdx = 0;
|
||||||
|
double totalTracerFractionInCell = 0.0;
|
||||||
for ( const auto & tracerFractionIt: (*m_tracerCellFractionValues) )
|
for ( const auto & tracerFractionIt: (*m_tracerCellFractionValues) )
|
||||||
{
|
{
|
||||||
double cellTracerFraction = (*tracerFractionIt.second)[resCellIndex];
|
double cellTracerFraction = (*tracerFractionIt.second)[resCellIndex];
|
||||||
if (cellTracerFraction != HUGE_VAL && cellTracerFraction == cellTracerFraction)
|
if (cellTracerFraction != HUGE_VAL && cellTracerFraction == cellTracerFraction)
|
||||||
{
|
{
|
||||||
accFlow[tracerIdx] += (*tracerFractionIt.second)[resCellIndex] * branchCells[clSegIdx].flowRate();
|
accFlow[tracerIdx] += cellTracerFraction * branchCells[clSegIdx].flowRate();
|
||||||
|
totalTracerFractionInCell += cellTracerFraction;
|
||||||
}
|
}
|
||||||
tracerIdx++;
|
tracerIdx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double reservoirFraction = 1.0 - totalTracerFractionInCell;
|
||||||
|
accFlow[tracerIdx] += reservoirFraction * branchCells[clSegIdx].flowRate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -65,7 +65,6 @@ public:
|
|||||||
RigAccWellFlowCalculator(const std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
RigAccWellFlowCalculator(const std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
|
||||||
const std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds);
|
const std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds);
|
||||||
|
|
||||||
|
|
||||||
const std::vector<double>& accumulatedTotalFlowPrConnection( size_t branchIdx);
|
const std::vector<double>& accumulatedTotalFlowPrConnection( size_t branchIdx);
|
||||||
const std::vector<double>& accumulatedTracerFlowPrConnection(const QString& tracerName, size_t branchIdx);
|
const std::vector<double>& accumulatedTracerFlowPrConnection(const QString& tracerName, size_t branchIdx);
|
||||||
const std::vector<size_t>& connectionNumbersFromTop(size_t branchIdx);
|
const std::vector<size_t>& connectionNumbersFromTop(size_t branchIdx);
|
||||||
|
Loading…
Reference in New Issue
Block a user