#2072 Allign code for x-axis title on well flow plots. Handle combination of surface and reservoir conditions for PLT plot

This commit is contained in:
Jacob Støren 2017-11-23 16:10:39 +01:00
parent b4fd236701
commit da56696a26
4 changed files with 78 additions and 20 deletions

View File

@ -46,6 +46,8 @@
#include "RiuMainPlotWindow.h" #include "RiuMainPlotWindow.h"
#include "RiuWellAllocationPlot.h" #include "RiuWellAllocationPlot.h"
#include "RiuWellLogTrack.h" #include "RiuWellLogTrack.h"
#include "RimWellLogFile.h"
#include "RimWellPlotTools.h"
CAF_PDM_SOURCE_INIT(RimWellAllocationPlot, "WellAllocationPlot"); CAF_PDM_SOURCE_INIT(RimWellAllocationPlot, "WellAllocationPlot");
@ -368,8 +370,13 @@ std::map<QString, const std::vector<double> *> RimWellAllocationPlot::findReleva
void RimWellAllocationPlot::updateWellFlowPlotXAxisTitle(RimWellLogTrack* plotTrack) void RimWellAllocationPlot::updateWellFlowPlotXAxisTitle(RimWellLogTrack* plotTrack)
{ {
RiaEclipseUnitTools::UnitSystem unitSet = m_case->eclipseCaseData()->unitsType(); RiaEclipseUnitTools::UnitSystem unitSet = m_case->eclipseCaseData()->unitsType();
RimWellLogFile::WellFlowCondition condition = m_flowDiagSolution ? RimWellLogFile::WELL_FLOW_COND_RESERVOIR :
RimWellLogFile::WELL_FLOW_COND_STANDARD;
QString axisTitle = RimWellPlotTools::flowPlotAxisTitle(condition, unitSet);
plotTrack->setXAxisTitle(axisTitle);
#if 0
if (m_flowDiagSolution) if (m_flowDiagSolution)
{ {
QString unitText; QString unitText;
@ -410,6 +417,9 @@ void RimWellAllocationPlot::updateWellFlowPlotXAxisTitle(RimWellLogTrack* plotTr
} }
plotTrack->setXAxisTitle("Surface Flow Rate " + unitText); plotTrack->setXAxisTitle("Surface Flow Rate " + unitText);
} }
#endif
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -323,25 +323,6 @@ std::vector<RimWellLogFile*> RimWellPlotTools::wellLogFilesContainingFlow(const
return wellLogFiles; return wellLogFiles;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellLogFileChannel*> RimWellPlotTools::getFlowChannelsFromWellFile(const RimWellLogFile* wellLogFile)
{
std::vector<RimWellLogFileChannel*> channels;
if (wellLogFile != nullptr)
{
for (RimWellLogFileChannel* const channel : wellLogFile->wellLogChannels())
{
if (isFlowChannel(channel))
{
channels.push_back(channel);
}
}
}
return channels;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -678,6 +659,58 @@ std::set < RiaRftPltCurveDefinition > RimWellPlotTools::curveDefsFromTimesteps(c
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellPlotTools::flowPlotAxisTitle(RimWellLogFile::WellFlowCondition condition,
RiaEclipseUnitTools::UnitSystem unitSystem)
{
QString axisTitle;
if (condition == RimWellLogFile::WELL_FLOW_COND_RESERVOIR)
{
QString unitText;
switch ( unitSystem )
{
case RiaEclipseUnitTools::UNITS_METRIC:
unitText = "[m<sup>3</sup>/day]";
break;
case RiaEclipseUnitTools::UNITS_FIELD:
unitText = "[Brl/day]";
break;
case RiaEclipseUnitTools::UNITS_LAB:
unitText = "[cm<sup>3</sup>/hr]";
break;
default:
break;
}
axisTitle = "Reservoir Flow Rate " + unitText;
}
else
{
QString unitText;
switch ( unitSystem )
{
case RiaEclipseUnitTools::UNITS_METRIC:
unitText = "[Liquid Sm<sup>3</sup>/day], [Gas kSm<sup>3</sup>/day]";
break;
case RiaEclipseUnitTools::UNITS_FIELD:
unitText = "[Liquid BBL/day], [Gas BOE/day]";
break;
case RiaEclipseUnitTools::UNITS_LAB:
unitText = "[cm<sup>3</sup>/hr]";
break;
default:
break;
}
axisTitle = "Surface Flow Rate " + unitText;
}
return axisTitle;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -27,6 +27,8 @@
#include <map> #include <map>
#include <set> #include <set>
#include "RifEclipseRftAddress.h" #include "RifEclipseRftAddress.h"
#include "RimWellLogFile.h"
#include "RiaEclipseUnitTools.h"
class RimEclipseCase; class RimEclipseCase;
class RimEclipseResultCase; class RimEclipseResultCase;
@ -57,7 +59,6 @@ public:
static FlowPhase flowPhaseFromChannelName(const QString& channelName); static FlowPhase flowPhaseFromChannelName(const QString& channelName);
static std::vector<RimWellLogFile*> wellLogFilesContainingFlow(const QString& wellName); static std::vector<RimWellLogFile*> wellLogFilesContainingFlow(const QString& wellName);
static std::vector<RimWellLogFileChannel*> getFlowChannelsFromWellFile(const RimWellLogFile* wellLogFile);
static RimWellPath* wellPathByWellPathNameOrSimWellName(const QString& wellPathNameOrSimwellName); static RimWellPath* wellPathByWellPathNameOrSimWellName(const QString& wellPathNameOrSimwellName);
// RFT Only // RFT Only
@ -93,6 +94,8 @@ public:
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& interestingRFTResults, const std::set<RifEclipseRftAddress::RftWellLogChannelType>& interestingRFTResults,
const std::vector<RifDataSourceForRftPlt>& selectedSourcesExpanded); const std::vector<RifDataSourceForRftPlt>& selectedSourcesExpanded);
static QString flowPlotAxisTitle(RimWellLogFile::WellFlowCondition condition,
RiaEclipseUnitTools::UnitSystem unitSystem);
private: private:
friend class StaticFieldsInitializer; friend class StaticFieldsInitializer;
static const std::set<QString> PRESSURE_DATA_NAMES; static const std::set<QString> PRESSURE_DATA_NAMES;

View File

@ -191,6 +191,17 @@ void RimWellPltPlot::setPlotXAxisTitles(RimWellLogTrack* plotTrack)
if (presentUnitSystems.size() > 1) { QMessageBox::warning(nullptr, "ResInsight PLT Plot", "Inconsistent units in PLT plot");} if (presentUnitSystems.size() > 1) { QMessageBox::warning(nullptr, "ResInsight PLT Plot", "Inconsistent units in PLT plot");}
if (presentUnitSystems.size() <= 0 ) return;
RiaEclipseUnitTools::UnitSystem unitSet = *presentUnitSystems.begin();
QString axisTitle;
if (m_useReservoirConditionCurves) axisTitle += RimWellPlotTools::flowPlotAxisTitle(RimWellLogFile::WELL_FLOW_COND_RESERVOIR, unitSet);
if (m_useReservoirConditionCurves && m_useStandardConditionCurves) axisTitle += " | ";
if (m_useStandardConditionCurves) axisTitle += RimWellPlotTools::flowPlotAxisTitle(RimWellLogFile::WELL_FLOW_COND_STANDARD, unitSet);
plotTrack->setXAxisTitle(axisTitle);
#if 0
QString unitText; QString unitText;
for ( auto unitSet: presentUnitSystems ) for ( auto unitSet: presentUnitSystems )
{ {
@ -212,6 +223,7 @@ void RimWellPltPlot::setPlotXAxisTitles(RimWellLogTrack* plotTrack)
} }
plotTrack->setXAxisTitle("Surface Flow Rate " + unitText); plotTrack->setXAxisTitle("Surface Flow Rate " + unitText);
#endif
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------