///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2017 Statoil 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RiaDefines.h" #include "RiaRftPltCurveDefinition.h" #include "RifDataSourceForRftPltQMetaType.h" #include "RifEclipseRftAddress.h" #include "RimWellLogFile.h" #include #include #include class RimEclipseCase; class RimEclipseResultCase; class RimObservedFmuRftData; class RimSummaryCaseCollection; class RimWellLogCurve; class RimWellLogFileChannel; class RimWellLogPlot; class RimWellPath; class RimPressureDepthData; class RiuWellRftPlot; class RigEclipseCaseData; class RigEclipseResultAddress; //================================================================================================== /// //================================================================================================== enum FlowType { FLOW_TYPE_PHASE_SPLIT, FLOW_TYPE_TOTAL }; enum FlowPhase { FLOW_PHASE_NONE, FLOW_PHASE_OIL, FLOW_PHASE_GAS, FLOW_PHASE_WATER, FLOW_PHASE_TOTAL }; //================================================================================================== /// //================================================================================================== class RimWellPlotTools { public: // PLT Only static bool isOilFlowChannel( const QString& channelName ); static bool isGasFlowChannel( const QString& channelName ); static bool isWaterFlowChannel( const QString& channelName ); static bool isTotalFlowChannel( const QString& channelName ); static FlowPhase flowPhaseFromChannelName( const QString& channelName ); static std::vector wellLogFilesContainingFlow( const QString& wellName ); static RimWellPath* wellPathByWellPathNameOrSimWellName( const QString& wellPathNameOrSimwellName ); // RFT Only private: static std::pair pressureResultDataInfo( const RigEclipseCaseData* eclipseCaseData ); public: static void addTimeStepsToMap( std::map>& destMap, const std::map>& timeStepsToAdd ); static std::vector wellLogFilesContainingPressure( const QString& wellPathNameOrSimWellName ); static RimWellLogFileChannel* getPressureChannelFromWellFile( const RimWellLogFile* wellLogFile ); static RimWellPath* wellPathFromWellLogFile( const RimWellLogFile* wellLogFile ); static std::map> timeStepsMapFromGridCase( RimEclipseCase* gridCase ); static RiaRftPltCurveDefinition curveDefFromCurve( const RimWellLogCurve* curve ); // others static bool hasFlowData( const RimWellLogFile* wellLogFile ); static bool hasAssociatedWellPath( const QString& wellName ); // Both static std::vector gridCasesForWell( const QString& simWellName ); static std::vector rftCasesForWell( const QString& simWellName ); static std::vector rftEnsemblesForWell( const QString& simWellName ); static std::vector rftEnsembles(); static std::vector observedFmuRftDataForWell( const QString& simWellName ); static std::vector observedFmuRftData(); static QString simWellName( const QString& wellPathNameOrSimWellName ); static std::map> calculateRelevantTimeStepsFromCases( const QString& wellPathNameOrSimWellName, const std::vector& selSources, const std::set& interestingRFTResults ); static void calculateValueOptionsForTimeSteps( const QString& wellPathNameOrSimWellName, const std::vector& selSources, const std::set& interestingRFTResults, QList& options ); static std::set curveDefsFromTimesteps( const QString& wellPathNameOrSimWellName, const std::vector& selectedTimeStepVector, bool firstReportTimeStepIsValid, const std::vector& selectedSourcesExpanded, const std::set& interestingRFTResults ); static QString flowPlotAxisTitle( RimWellLogFile::WellFlowCondition condition, RiaDefines::EclipseUnitSystem unitSystem ); static QString flowUnitText( RimWellLogFile::WellFlowCondition condition, RiaDefines::EclipseUnitSystem unitSystem ); static QString flowVolumePlotAxisTitle( RimWellLogFile::WellFlowCondition condition, RiaDefines::EclipseUnitSystem unitSystem ); static QString flowVolumeUnitText( RimWellLogFile::WellFlowCondition condition, RiaDefines::EclipseUnitSystem unitSystem ); static QString curveUnitText( RimWellLogFile::WellFlowCondition condition, RiaDefines::EclipseUnitSystem unitSystem, FlowPhase flowPhase ); static bool hasFlowData( const RimWellPath* wellPath ); static std::vector pressureDepthData(); static std::vector pressureDepthDataForWell( const QString& simWellName ); private: friend class StaticFieldsInitializer; static const std::set PRESSURE_DATA_NAMES; static const std::set OIL_CHANNEL_NAMES; static const std::set GAS_CHANNEL_NAMES; static const std::set WATER_CHANNEL_NAMES; static const std::set TOTAL_CHANNEL_NAMES; static std::set FLOW_DATA_NAMES; static bool hasPressureData( const RimWellLogFile* wellLogFile ); static bool isPressureChannel( RimWellLogFileChannel* channel ); static bool hasPressureData( RimEclipseResultCase* gridCase ); static bool hasPressureData( RimWellPath* wellPath ); static bool hasFlowData( RimEclipseResultCase* gridCase ); static bool isFlowChannel( RimWellLogFileChannel* channel ); static bool tryMatchChannelName( const std::set& channelNames, const QString& channelNameToMatch ); static std::set findMatchingOrAdjacentTimeSteps( const std::set& baseTimeLine, const std::set& availableTimeSteps ); static std::set availableSimWellTimesteps( RimEclipseCase* eclCase, const QString& simWellName, bool addFirstReportTimeStep ); };