#1209 Added calculation of none-accumulated flows as preparation for #1171 and #1120. Missing handling of wells with inconsistent flow.

This commit is contained in:
Jacob Støren
2017-02-17 15:48:42 +01:00
parent 492b777040
commit 070d9c893b
4 changed files with 157 additions and 71 deletions

View File

@@ -52,6 +52,19 @@ CAF_PDM_SOURCE_INIT(RimWellAllocationPlot, "WellAllocationPlot");
///
//--------------------------------------------------------------------------------------------------
namespace caf
{
template<>
void AppEnum<RimWellAllocationPlot::FlowType>::setUp()
{
addItem(RimWellAllocationPlot::ACCUMULATED, "ACCUMULATED", "Well Flow");
addItem(RimWellAllocationPlot::INFLOW, "INFLOW", "In Flow");
setDefault(RimWellAllocationPlot::ACCUMULATED);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -70,6 +83,8 @@ RimWellAllocationPlot::RimWellAllocationPlot()
CAF_PDM_InitField(&m_timeStep, "PlotTimeStep", 0, "Time Step", "", "", "");
CAF_PDM_InitField(&m_wellName, "WellName", QString("None"), "Well", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_flowDiagSolution, "FlowDiagSolution", "Flow Diag Solution", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_flowType, "FlowType", "Flow Type", "", "", "");
CAF_PDM_InitField(&m_groupSmallContributions, "GroupSmallContributions", true, "Group Small Contributions", "", "", "");
CAF_PDM_InitField(&m_smallContributionsThreshold, "SmallContributionsThreshold", 0.005, "Threshold", "", "", "");
@@ -238,13 +253,19 @@ void RimWellAllocationPlot::updateFromWell()
std::vector<QString> tracerNames = wfCalculator->tracerNames();
for (const QString& tracerName: tracerNames)
{
const std::vector<double>& accFlow = wfCalculator->accumulatedTracerFlowPrConnection(tracerName, brIdx);
const std::vector<double>& accFlow = m_flowType == ACCUMULATED ?
wfCalculator->accumulatedTracerFlowPrConnection(tracerName, brIdx):
wfCalculator->tracerFlowPrConnection(tracerName, brIdx);
addStackedCurve(tracerName, connNumbers, accFlow, plotTrack);
}
}
else
{
const std::vector<double>& accFlow = wfCalculator->accumulatedTotalFlowPrConnection(brIdx);
const std::vector<double>& accFlow = m_flowType == ACCUMULATED ?
wfCalculator->accumulatedFlowPrConnection(brIdx):
wfCalculator->flowPrConnection(brIdx);
addStackedCurve("Total", connNumbers, accFlow, plotTrack);
}
@@ -597,7 +618,8 @@ void RimWellAllocationPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedF
|| changedField == &m_timeStep
|| changedField == &m_flowDiagSolution
|| changedField == &m_groupSmallContributions
|| changedField == &m_smallContributionsThreshold )
|| changedField == &m_smallContributionsThreshold
|| changedField == &m_flowType )
{
loadDataAndUpdate();
}

View File

@@ -49,6 +49,8 @@ namespace caf {
class RimWellAllocationPlot : public RimViewWindow
{
CAF_PDM_HEADER_INIT;
public:
enum FlowType { ACCUMULATED, INFLOW};
public:
RimWellAllocationPlot();
@@ -115,6 +117,7 @@ private:
caf::PdmPtrField<RimFlowDiagSolution*> m_flowDiagSolution;
caf::PdmField<bool> m_groupSmallContributions;
caf::PdmField<double> m_smallContributionsThreshold;
caf::PdmField<caf::AppEnum<FlowType> > m_flowType;
QPointer<RiuWellAllocationPlot> m_wellAllocationPlotWidget;