2017-11-08 03:30:55 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// 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 <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-02-11 13:19:19 -06:00
|
|
|
#include "RiaEclipseUnitTools.h"
|
|
|
|
#include "RiaRftPltCurveDefinition.h"
|
2017-11-08 03:30:55 -06:00
|
|
|
|
2017-11-13 04:10:27 -06:00
|
|
|
#include "RifDataSourceForRftPltQMetaType.h"
|
2019-02-11 13:19:19 -06:00
|
|
|
#include "RifEclipseRftAddress.h"
|
|
|
|
|
|
|
|
#include "RimWellLogFile.h"
|
2017-11-08 03:30:55 -06:00
|
|
|
|
|
|
|
#include <QMetaType>
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <set>
|
|
|
|
|
|
|
|
class RimEclipseCase;
|
|
|
|
class RimEclipseResultCase;
|
|
|
|
class RimWellLogCurve;
|
|
|
|
class RimWellLogFileChannel;
|
|
|
|
class RimWellLogPlot;
|
|
|
|
class RimWellPath;
|
|
|
|
class RiuWellRftPlot;
|
|
|
|
class RigEclipseCaseData;
|
2019-02-11 13:19:19 -06:00
|
|
|
class RigEclipseResultAddress;
|
2017-11-08 03:30:55 -06:00
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
///
|
2017-11-09 03:03:32 -06:00
|
|
|
//==================================================================================================
|
2017-11-17 08:35:07 -06:00
|
|
|
enum FlowType { FLOW_TYPE_PHASE_SPLIT, FLOW_TYPE_TOTAL };
|
2017-11-09 03:03:32 -06:00
|
|
|
enum FlowPhase { FLOW_PHASE_NONE, FLOW_PHASE_OIL, FLOW_PHASE_GAS, FLOW_PHASE_WATER, FLOW_PHASE_TOTAL };
|
|
|
|
|
|
|
|
//==================================================================================================
|
2017-11-08 03:30:55 -06:00
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
class RimWellPlotTools
|
|
|
|
{
|
2017-11-15 10:07:49 -06:00
|
|
|
public:
|
|
|
|
// PLT Only
|
2017-11-09 03:03:32 -06:00
|
|
|
static bool isOilFlowChannel(const QString& channelName);
|
|
|
|
static bool isGasFlowChannel(const QString& channelName);
|
|
|
|
static bool isWaterFlowChannel(const QString& channelName);
|
2017-11-23 06:25:35 -06:00
|
|
|
static bool isTotalFlowChannel(const QString& channelName);
|
2017-11-09 03:03:32 -06:00
|
|
|
static FlowPhase flowPhaseFromChannelName(const QString& channelName);
|
2017-11-16 10:00:34 -06:00
|
|
|
|
2017-11-15 10:07:49 -06:00
|
|
|
static std::vector<RimWellLogFile*> wellLogFilesContainingFlow(const QString& wellName);
|
|
|
|
static RimWellPath* wellPathByWellPathNameOrSimWellName(const QString& wellPathNameOrSimwellName);
|
2017-11-09 03:03:32 -06:00
|
|
|
|
2017-11-15 10:07:49 -06:00
|
|
|
// RFT Only
|
2019-01-25 05:58:07 -06:00
|
|
|
private:
|
|
|
|
static std::pair<RigEclipseResultAddress, QString> pressureResultDataInfo(const RigEclipseCaseData* eclipseCaseData);
|
|
|
|
public:
|
2017-11-13 04:10:27 -06:00
|
|
|
static void addTimeStepsToMap(std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& destMap,
|
|
|
|
const std::map<QDateTime, std::set<RifDataSourceForRftPlt>>& timeStepsToAdd);
|
2017-12-21 02:39:26 -06:00
|
|
|
static std::vector<RimWellLogFile*> wellLogFilesContainingPressure(const QString& wellPathNameOrSimWellName);
|
2017-11-08 03:30:55 -06:00
|
|
|
static RimWellLogFileChannel* getPressureChannelFromWellFile(const RimWellLogFile* wellLogFile);
|
|
|
|
static RimWellPath* wellPathFromWellLogFile(const RimWellLogFile* wellLogFile);
|
2017-11-13 04:10:27 -06:00
|
|
|
static std::map<QDateTime, std::set<RifDataSourceForRftPlt>> timeStepsMapFromGridCase(RimEclipseCase* gridCase);
|
2017-11-09 01:21:36 -06:00
|
|
|
static RiaRftPltCurveDefinition curveDefFromCurve(const RimWellLogCurve* curve);
|
2017-11-16 10:00:34 -06:00
|
|
|
|
2017-11-15 10:07:49 -06:00
|
|
|
// others
|
|
|
|
static bool hasFlowData(const RimWellLogFile* wellLogFile);
|
2017-12-08 01:45:00 -06:00
|
|
|
static bool hasAssociatedWellPath(const QString& wellName);
|
2017-11-15 10:07:49 -06:00
|
|
|
|
|
|
|
// Both
|
|
|
|
static std::vector<RimEclipseResultCase*> gridCasesForWell(const QString& simWellName);
|
|
|
|
static std::vector<RimEclipseResultCase*> rftCasesForWell(const QString& simWellName);
|
2017-11-09 03:03:32 -06:00
|
|
|
static QString simWellName(const QString& wellPathNameOrSimWellName);
|
|
|
|
|
2018-05-11 07:18:13 -05:00
|
|
|
static std::map<QDateTime, std::set<RifDataSourceForRftPlt>>
|
|
|
|
calculateRelevantTimeStepsFromCases(const QString& wellPathNameOrSimWellName,
|
|
|
|
const std::vector<RifDataSourceForRftPlt>& selSources,
|
|
|
|
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& interestingRFTResults);
|
|
|
|
|
2017-11-16 09:35:55 -06:00
|
|
|
static void calculateValueOptionsForTimeSteps(const QString& wellPathNameOrSimWellName,
|
|
|
|
const std::vector<RifDataSourceForRftPlt>& selSources,
|
|
|
|
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& interestingRFTResults,
|
|
|
|
QList<caf::PdmOptionItemInfo>& options);
|
2018-05-11 07:18:13 -05:00
|
|
|
|
2017-11-16 09:35:55 -06:00
|
|
|
static std::set < RiaRftPltCurveDefinition > curveDefsFromTimesteps(const QString& simWellName,
|
|
|
|
const std::vector<QDateTime>& selectedTimeStepVector,
|
2017-12-07 09:24:28 -06:00
|
|
|
bool firstReportTimeStepIsValid,
|
2019-03-12 01:48:04 -05:00
|
|
|
const std::vector<RifDataSourceForRftPlt>& selectedSourcesExpanded,
|
|
|
|
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& interestingRFTResults);
|
2017-11-16 09:35:55 -06:00
|
|
|
|
2017-11-23 09:10:39 -06:00
|
|
|
static QString flowPlotAxisTitle(RimWellLogFile::WellFlowCondition condition,
|
|
|
|
RiaEclipseUnitTools::UnitSystem unitSystem);
|
2017-12-04 12:00:10 -06:00
|
|
|
|
|
|
|
static QString flowUnitText(RimWellLogFile::WellFlowCondition condition,
|
|
|
|
RiaEclipseUnitTools::UnitSystem unitSystem);
|
2017-12-05 02:45:41 -06:00
|
|
|
|
|
|
|
static QString curveUnitText(RimWellLogFile::WellFlowCondition condition,
|
|
|
|
RiaEclipseUnitTools::UnitSystem unitSystem,
|
|
|
|
FlowPhase flowPhase);
|
2017-12-14 04:22:44 -06:00
|
|
|
|
|
|
|
static bool hasFlowData(const RimWellPath* wellPath);
|
|
|
|
|
2017-11-23 06:25:35 -06:00
|
|
|
private:
|
2017-11-09 03:03:32 -06:00
|
|
|
friend class StaticFieldsInitializer;
|
2017-11-23 06:25:35 -06:00
|
|
|
static const std::set<QString> PRESSURE_DATA_NAMES;
|
|
|
|
|
|
|
|
static const std::set<QString> OIL_CHANNEL_NAMES;
|
|
|
|
static const std::set<QString> GAS_CHANNEL_NAMES;
|
|
|
|
static const std::set<QString> WATER_CHANNEL_NAMES;
|
|
|
|
static const std::set<QString> TOTAL_CHANNEL_NAMES;
|
|
|
|
|
|
|
|
static std::set<QString> 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<QString>& channelNames, const QString& channelNameToMatch);
|
|
|
|
static std::set<QDateTime> findMatchingOrAdjacentTimeSteps(const std::set<QDateTime>& baseTimeLine, const std::set<QDateTime>& availableTimeSteps);
|
2017-12-07 09:24:28 -06:00
|
|
|
static std::set<QDateTime> availableSimWellTimesteps(RimEclipseCase * eclCase, const QString& simWellName, bool addFirstReportTimeStep);
|
2017-11-23 06:25:35 -06:00
|
|
|
|
2017-11-08 03:30:55 -06:00
|
|
|
};
|
2017-11-09 01:21:36 -06:00
|
|
|
|