#2119 Support total reservoir flow from Grid wells in PLT plot

This commit is contained in:
Jacob Støren 2017-11-09 15:19:42 +01:00
parent dfa0ade9fe
commit 1fba5e13c4
3 changed files with 51 additions and 38 deletions

View File

@ -830,11 +830,11 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
{ {
if ( resultPointCalc->pipeBranchCLCoords().size() ) if ( resultPointCalc->pipeBranchCLCoords().size() )
{ {
RigAccWellFlowCalculator wfAccumulator(resultPointCalc->pipeBranchCLCoords(), RigAccWellFlowCalculator wfAccumulator(resultPointCalc->pipeBranchCLCoords(),
resultPointCalc->pipeBranchWellResultPoints(), resultPointCalc->pipeBranchWellResultPoints(),
resultPointCalc->pipeBranchMeasuredDepths(), resultPointCalc->pipeBranchMeasuredDepths(),
0.0); false); // m_phaseSelectionMode() != FLOW_TYPE_PHASE_SPLIT); The total flow is reservoir conditions must be careful
const std::vector<double>& depthValues = wfAccumulator.pseudoLengthFromTop(0); const std::vector<double>& depthValues = wfAccumulator.pseudoLengthFromTop(0);
std::vector<QString> tracerNames = wfAccumulator.tracerNames(); std::vector<QString> tracerNames = wfAccumulator.tracerNames();
@ -847,7 +847,8 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
if ( tracerName == RIG_FLOW_OIL_NAME && selectedPhases.count(FLOW_PHASE_OIL) if ( tracerName == RIG_FLOW_OIL_NAME && selectedPhases.count(FLOW_PHASE_OIL)
|| tracerName == RIG_FLOW_GAS_NAME && selectedPhases.count(FLOW_PHASE_GAS) || tracerName == RIG_FLOW_GAS_NAME && selectedPhases.count(FLOW_PHASE_GAS)
|| tracerName == RIG_FLOW_WATER_NAME && selectedPhases.count(FLOW_PHASE_WATER) ) || tracerName == RIG_FLOW_WATER_NAME && selectedPhases.count(FLOW_PHASE_WATER)
|| tracerName == RIG_FLOW_TOTAL_NAME && selectedPhases.count(FLOW_PHASE_TOTAL) )
{ {
const std::vector<double> accFlow = wfAccumulator.accumulatedTracerFlowPrPseudoLength(tracerName, 0); const std::vector<double> accFlow = wfAccumulator.accumulatedTracerFlowPrPseudoLength(tracerName, 0);
addStackedCurve(curveName + ", " + tracerName, addStackedCurve(curveName + ", " + tracerName,

View File

@ -46,8 +46,6 @@ size_t RigEclCellIndexCalculator::resultCellIndex(size_t gridIndex, size_t gridC
/// ///
//================================================================================================== //==================================================================================================
#define USE_WELL_PHASE_RATES
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
/// The pipeBranchesWellResultPoints are describing the lines between the points, starting with the first line /// The pipeBranchesWellResultPoints are describing the lines between the points, starting with the first line
@ -64,7 +62,8 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector< std::vecto
m_tracerCellFractionValues(&tracerCellFractionValues), m_tracerCellFractionValues(&tracerCellFractionValues),
m_cellIndexCalculator(cellIndexCalculator), m_cellIndexCalculator(cellIndexCalculator),
m_smallContributionsThreshold(smallContribThreshold), m_smallContributionsThreshold(smallContribThreshold),
m_isProducer(isProducer) m_isProducer(isProducer),
m_useTotalWellPhaseRateOnly(false)
{ {
m_connectionFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size()); m_connectionFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size());
m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size()); m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size());
@ -93,24 +92,29 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector< std::vecto
m_tracerCellFractionValues(nullptr), m_tracerCellFractionValues(nullptr),
m_cellIndexCalculator(RigEclCellIndexCalculator(nullptr, nullptr)), m_cellIndexCalculator(RigEclCellIndexCalculator(nullptr, nullptr)),
m_smallContributionsThreshold(smallContribThreshold), m_smallContributionsThreshold(smallContribThreshold),
m_isProducer(true) m_isProducer(true),
m_useTotalWellPhaseRateOnly(false)
{ {
m_connectionFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size()); m_connectionFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size());
m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size()); m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size());
#ifdef USE_WELL_PHASE_RATES if ( !m_useTotalWellPhaseRateOnly )
m_tracerNames.push_back(RIG_FLOW_OIL_NAME); {
m_tracerNames.push_back(RIG_FLOW_GAS_NAME); m_tracerNames.push_back(RIG_FLOW_OIL_NAME);
m_tracerNames.push_back(RIG_FLOW_WATER_NAME); m_tracerNames.push_back(RIG_FLOW_GAS_NAME);
#else m_tracerNames.push_back(RIG_FLOW_WATER_NAME);
m_tracerNames.push_back(RIG_FLOW_TOTAL_NAME); }
#endif else
{
m_tracerNames.push_back(RIG_FLOW_TOTAL_NAME);
}
initializePipeBranchesMeasuredDepths(); initializePipeBranchesMeasuredDepths();
calculateAccumulatedFlowPrConnection(0, 1); calculateAccumulatedFlowPrConnection(0, 1);
calculateFlowPrPseudoLength(0, 0.0); calculateFlowPrPseudoLength(0, 0.0);
#ifdef USE_WELL_PHASE_RATES
sortTracers(); if ( !m_useTotalWellPhaseRateOnly ) sortTracers();
#endif
} }
@ -120,11 +124,12 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector< std::vecto
RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector<cvf::Vec3d>& pipeBranchCLCoords, RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector<cvf::Vec3d>& pipeBranchCLCoords,
const std::vector <RigWellResultPoint> & pipeBranchesWellResultPoints, const std::vector <RigWellResultPoint> & pipeBranchesWellResultPoints,
const std::vector <double> & pipeBranchMeasuredDepths, const std::vector <double> & pipeBranchMeasuredDepths,
double smallContribThreshold) bool totalFlowOnly)
: m_tracerCellFractionValues(nullptr), : m_tracerCellFractionValues(nullptr),
m_cellIndexCalculator(RigEclCellIndexCalculator(nullptr, nullptr)), m_cellIndexCalculator(RigEclCellIndexCalculator(nullptr, nullptr)),
m_smallContributionsThreshold(smallContribThreshold), m_smallContributionsThreshold(0.0),
m_isProducer(true) m_isProducer(true),
m_useTotalWellPhaseRateOnly(totalFlowOnly)
{ {
m_pipeBranchesCLCoords.push_back(pipeBranchCLCoords); m_pipeBranchesCLCoords.push_back(pipeBranchCLCoords);
m_pipeBranchesWellResultPoints.push_back(pipeBranchesWellResultPoints); m_pipeBranchesWellResultPoints.push_back(pipeBranchesWellResultPoints);
@ -134,19 +139,22 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector<cvf::Vec3d>
m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size()); m_pseudoLengthFlowPrBranch.resize(m_pipeBranchesWellResultPoints.size());
#ifdef USE_WELL_PHASE_RATES if ( !m_useTotalWellPhaseRateOnly )
m_tracerNames.push_back(RIG_FLOW_OIL_NAME); {
m_tracerNames.push_back(RIG_FLOW_GAS_NAME); m_tracerNames.push_back(RIG_FLOW_OIL_NAME);
m_tracerNames.push_back(RIG_FLOW_WATER_NAME); m_tracerNames.push_back(RIG_FLOW_GAS_NAME);
#else m_tracerNames.push_back(RIG_FLOW_WATER_NAME);
m_tracerNames.push_back(RIG_FLOW_TOTAL_NAME); }
#endif else
{
m_tracerNames.push_back(RIG_FLOW_TOTAL_NAME);
}
initializePipeBranchesMeasuredDepths(); initializePipeBranchesMeasuredDepths();
calculateAccumulatedFlowPrConnection(0, 1); calculateAccumulatedFlowPrConnection(0, 1);
calculateFlowPrPseudoLength(0, 0.0); calculateFlowPrPseudoLength(0, 0.0);
#ifdef USE_WELL_PHASE_RATES
sortTracers(); if ( !m_useTotalWellPhaseRateOnly ) sortTracers();
#endif
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -717,13 +725,16 @@ std::vector<double> RigAccWellFlowCalculator::calculateWellCellFlowPrTracer(cons
} }
else else
{ {
#ifdef USE_WELL_PHASE_RATES if ( !m_useTotalWellPhaseRateOnly )
flowPrTracer[0] = wellCell.oilRate(); {
flowPrTracer[1] = wellCell.gasRate(); flowPrTracer[0] = wellCell.oilRate();
flowPrTracer[2] = wellCell.waterRate(); flowPrTracer[1] = wellCell.gasRate();
#else flowPrTracer[2] = wellCell.waterRate();
flowPrTracer[0] = wellCell.flowRate(); }
#endif else
{
flowPrTracer[0] = wellCell.flowRate();
}
} }
return flowPrTracer; return flowPrTracer;

View File

@ -70,7 +70,7 @@ public:
RigAccWellFlowCalculator(const std::vector <cvf::Vec3d> & pipeBranchCLCoords, RigAccWellFlowCalculator(const std::vector <cvf::Vec3d> & pipeBranchCLCoords,
const std::vector <RigWellResultPoint> & pipeBranchCellIds, const std::vector <RigWellResultPoint> & pipeBranchCellIds,
const std::vector <double> & pipeBranchMeasuredDepths, const std::vector <double> & pipeBranchMeasuredDepths,
double smallContribThreshold); bool totalFlowOnly);
const std::vector<double>& connectionNumbersFromTop(size_t branchIdx) const; const std::vector<double>& connectionNumbersFromTop(size_t branchIdx) const;
const std::vector<double>& accumulatedTracerFlowPrConnection(const QString& tracerName, size_t branchIdx) const; const std::vector<double>& accumulatedTracerFlowPrConnection(const QString& tracerName, size_t branchIdx) const;
@ -123,6 +123,7 @@ private:
std::vector<QString> m_tracerNames; std::vector<QString> m_tracerNames;
double m_smallContributionsThreshold; double m_smallContributionsThreshold;
bool m_isProducer; bool m_isProducer;
bool m_useTotalWellPhaseRateOnly;
struct BranchFlow struct BranchFlow
{ {