mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Well allocation over time plot (#9655)
- Plot for showing well allocation over time. - Select time range - Option to exclude time steps in selected range - Possible value types: Flow rate, flow rate percentage, flow volume, accumulated flow volume, accumulated flow volume percentage - Group small contributors into group "Others"
This commit is contained in:
@@ -0,0 +1,131 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2023- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimPlot.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QPointer>
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
class RigAccWellFlowCalculator;
|
||||
class RimEclipseResultCase;
|
||||
class RimFlowDiagSolution;
|
||||
class RimWellAllocationOverTimeCollection;
|
||||
class RimSimWellInView;
|
||||
class RiuPlotWidget;
|
||||
class RiuQwtPlotWidget;
|
||||
|
||||
namespace cvf
|
||||
{
|
||||
class Color3f;
|
||||
}
|
||||
|
||||
class RimWellAllocationOverTimePlot : public RimPlot
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum class FlowValueType
|
||||
{
|
||||
FLOW_RATE,
|
||||
FLOW_RATE_PERCENTAGE,
|
||||
FLOW_VOLUME,
|
||||
ACCUMULATED_FLOW_VOLUME,
|
||||
ACCUMULATED_FLOW_VOLUME_PERCENTAGE,
|
||||
};
|
||||
|
||||
public:
|
||||
RimWellAllocationOverTimePlot();
|
||||
~RimWellAllocationOverTimePlot() override;
|
||||
|
||||
void setDescription( const QString& description );
|
||||
void setFromSimulationWell( RimSimWellInView* simWell );
|
||||
|
||||
// RimPlot implementations
|
||||
RiuPlotWidget* plotWidget() override;
|
||||
void setAutoScaleXEnabled( bool enabled ) override{};
|
||||
void setAutoScaleYEnabled( bool enabled ) override{};
|
||||
void updateAxes() override{};
|
||||
void updateLegend() override{};
|
||||
QString asciiDataForPlotExport() const override;
|
||||
void reattachAllCurves() override{};
|
||||
void detachAllCurves() override{};
|
||||
|
||||
// RimPlotWindow implementations
|
||||
QString description() const override;
|
||||
|
||||
// RimViewWindow implementations
|
||||
QWidget* viewWidget() override;
|
||||
QImage snapshotWindowContent() override;
|
||||
void zoomAll() override{};
|
||||
|
||||
private:
|
||||
// RimPlot implementations
|
||||
RiuPlotWidget* doCreatePlotViewWidget( QWidget* mainWindowParent ) override;
|
||||
|
||||
// RimViewWindow implementations
|
||||
void deleteViewWidget() override;
|
||||
void onLoadDataAndUpdate() override;
|
||||
|
||||
// PDM methods
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
|
||||
private:
|
||||
void updateFromWell();
|
||||
RimWellAllocationOverTimeCollection createWellAllocationOverTimeCollection() const;
|
||||
std::set<QString> findSortedWellNames();
|
||||
cvf::Color3f getTracerColor( const QString& tracerName );
|
||||
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
QString getValueTypeText() const;
|
||||
QString dateFormatString() const;
|
||||
|
||||
void setValidTimeStepRangeForCase();
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_userName;
|
||||
caf::PdmPtrField<RimEclipseResultCase*> m_case;
|
||||
caf::PdmField<QString> m_wellName;
|
||||
|
||||
caf::PdmField<QDateTime> m_selectedFromTimeStep;
|
||||
caf::PdmField<QDateTime> m_selectedToTimeStep;
|
||||
caf::PdmField<std::vector<QDateTime>> m_excludeTimeSteps;
|
||||
caf::PdmField<bool> m_applyExcludeTimeSteps;
|
||||
|
||||
caf::PdmPtrField<RimFlowDiagSolution*> m_flowDiagSolution;
|
||||
caf::PdmField<caf::AppEnum<FlowValueType>> m_flowValueType;
|
||||
caf::PdmField<bool> m_groupSmallContributions;
|
||||
caf::PdmField<double> m_smallContributionsThreshold;
|
||||
|
||||
QPointer<RiuQwtPlotWidget> m_plotWidget;
|
||||
|
||||
const int m_initialNumberOfTimeSteps = 10;
|
||||
};
|
||||
Reference in New Issue
Block a user