mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2215 Plt Ploit : Show units in legend
This commit is contained in:
@@ -683,6 +683,24 @@ QString RimWellPlotTools::flowPlotAxisTitle(RimWellLogFile::WellFlowCondition co
|
|||||||
return axisTitle;
|
return axisTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString flowConditionReservoirUnitText(RiaEclipseUnitTools::UnitSystem unitSystem)
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
return unitText;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -692,13 +710,7 @@ QString RimWellPlotTools::flowUnitText(RimWellLogFile::WellFlowCondition conditi
|
|||||||
|
|
||||||
if (condition == RimWellLogFile::WELL_FLOW_COND_RESERVOIR)
|
if (condition == RimWellLogFile::WELL_FLOW_COND_RESERVOIR)
|
||||||
{
|
{
|
||||||
switch (unitSystem)
|
unitText = flowConditionReservoirUnitText(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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -714,6 +726,49 @@ QString RimWellPlotTools::flowUnitText(RimWellLogFile::WellFlowCondition conditi
|
|||||||
return unitText;
|
return unitText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
QString RimWellPlotTools::curveUnitText(RimWellLogFile::WellFlowCondition condition, RiaEclipseUnitTools::UnitSystem unitSystem, FlowPhase flowPhase)
|
||||||
|
{
|
||||||
|
QString unitText;
|
||||||
|
|
||||||
|
if (condition == RimWellLogFile::WELL_FLOW_COND_RESERVOIR)
|
||||||
|
{
|
||||||
|
unitText = flowConditionReservoirUnitText(unitSystem);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (unitSystem)
|
||||||
|
{
|
||||||
|
case RiaEclipseUnitTools::UNITS_METRIC:
|
||||||
|
switch (flowPhase)
|
||||||
|
{
|
||||||
|
case FLOW_PHASE_GAS: unitText = "[kSm<sup>3</sup>/day]"; break;
|
||||||
|
case FLOW_PHASE_WATER: // Intentionally fall through, water and oil have same unit
|
||||||
|
case FLOW_PHASE_OIL: unitText = "[Sm<sup>3</sup>/day]"; break;
|
||||||
|
default: unitText = "[Liquid Sm<sup>3</sup>/day], [Gas kSm<sup>3</sup>/day]"; break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RiaEclipseUnitTools::UNITS_FIELD:
|
||||||
|
switch (flowPhase)
|
||||||
|
{
|
||||||
|
case FLOW_PHASE_GAS: unitText = "[BOE/day]"; break;
|
||||||
|
case FLOW_PHASE_WATER: // Intentionally fall through, water and oil have same unit
|
||||||
|
case FLOW_PHASE_OIL: unitText = "[BBL/day]"; break;
|
||||||
|
default: unitText = "[Liquid BBL/day], [Gas BOE/day]"; break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case RiaEclipseUnitTools::UNITS_LAB: unitText = "[cm<sup>3</sup>/hr]"; break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return unitText;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -99,6 +99,10 @@ public:
|
|||||||
|
|
||||||
static QString flowUnitText(RimWellLogFile::WellFlowCondition condition,
|
static QString flowUnitText(RimWellLogFile::WellFlowCondition condition,
|
||||||
RiaEclipseUnitTools::UnitSystem unitSystem);
|
RiaEclipseUnitTools::UnitSystem unitSystem);
|
||||||
|
|
||||||
|
static QString curveUnitText(RimWellLogFile::WellFlowCondition condition,
|
||||||
|
RiaEclipseUnitTools::UnitSystem unitSystem,
|
||||||
|
FlowPhase flowPhase);
|
||||||
private:
|
private:
|
||||||
friend class StaticFieldsInitializer;
|
friend class StaticFieldsInitializer;
|
||||||
static const std::set<QString> PRESSURE_DATA_NAMES;
|
static const std::set<QString> PRESSURE_DATA_NAMES;
|
||||||
|
|||||||
@@ -528,6 +528,7 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
|||||||
std::unique_ptr<RigResultPointCalculator> resultPointCalc;
|
std::unique_ptr<RigResultPointCalculator> resultPointCalc;
|
||||||
|
|
||||||
QString curveName;
|
QString curveName;
|
||||||
|
|
||||||
{
|
{
|
||||||
curveName += sourceDef.eclCase() ? sourceDef.eclCase()->caseUserDescription() : "";
|
curveName += sourceDef.eclCase() ? sourceDef.eclCase()->caseUserDescription() : "";
|
||||||
curveName += sourceDef.wellLogFile() ? sourceDef.wellLogFile()->name() : "";
|
curveName += sourceDef.wellLogFile() ? sourceDef.wellLogFile()->name() : "";
|
||||||
@@ -535,23 +536,32 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
|||||||
curveName += ", " + timeStep.toString(dateFormatString);
|
curveName += ", " + timeStep.toString(dateFormatString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RimEclipseResultCase* rimEclipseResultCase = dynamic_cast<RimEclipseResultCase*>(sourceDef.eclCase());
|
||||||
|
|
||||||
if ( sourceDef.sourceType() == RifDataSourceForRftPlt::RFT )
|
if ( sourceDef.sourceType() == RifDataSourceForRftPlt::RFT )
|
||||||
{
|
{
|
||||||
resultPointCalc.reset(new RigRftResultPointCalculator(m_wellPathName,
|
resultPointCalc.reset(new RigRftResultPointCalculator(m_wellPathName,
|
||||||
dynamic_cast<RimEclipseResultCase*>(sourceDef.eclCase()),
|
rimEclipseResultCase,
|
||||||
timeStep));
|
timeStep));
|
||||||
}
|
}
|
||||||
else if (sourceDef.sourceType() == RifDataSourceForRftPlt::GRID)
|
else if (sourceDef.sourceType() == RifDataSourceForRftPlt::GRID)
|
||||||
{
|
{
|
||||||
resultPointCalc.reset(new RigSimWellResultPointCalculator(m_wellPathName,
|
resultPointCalc.reset(new RigSimWellResultPointCalculator(m_wellPathName,
|
||||||
dynamic_cast<RimEclipseResultCase*>(sourceDef.eclCase()),
|
rimEclipseResultCase,
|
||||||
timeStep));
|
timeStep));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RiaEclipseUnitTools::UnitSystem unitSet = RiaEclipseUnitTools::UNITS_UNKNOWN;
|
||||||
|
if (rimEclipseResultCase)
|
||||||
|
{
|
||||||
|
unitSet = rimEclipseResultCase->eclipseCaseData()->unitsType();
|
||||||
|
}
|
||||||
|
|
||||||
if (resultPointCalc != nullptr)
|
if (resultPointCalc != nullptr)
|
||||||
{
|
{
|
||||||
if ( resultPointCalc->pipeBranchCLCoords().size() )
|
if ( resultPointCalc->pipeBranchCLCoords().size() )
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( selectedPhases.count(FLOW_PHASE_TOTAL)
|
if ( selectedPhases.count(FLOW_PHASE_TOTAL)
|
||||||
&& m_useReservoirConditionCurves()
|
&& m_useReservoirConditionCurves()
|
||||||
&& sourceDef.sourceType() == RifDataSourceForRftPlt::GRID )
|
&& sourceDef.sourceType() == RifDataSourceForRftPlt::GRID )
|
||||||
@@ -563,8 +573,10 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
|||||||
|
|
||||||
const std::vector<double>& depthValues = wfTotalAccumulator.pseudoLengthFromTop(0);
|
const std::vector<double>& depthValues = wfTotalAccumulator.pseudoLengthFromTop(0);
|
||||||
|
|
||||||
|
QString curveUnitText = RimWellPlotTools::flowUnitText(RimWellLogFile::WELL_FLOW_COND_RESERVOIR, unitSet);
|
||||||
|
|
||||||
const std::vector<double> accFlow = wfTotalAccumulator.accumulatedTracerFlowPrPseudoLength(RIG_FLOW_TOTAL_NAME, 0);
|
const std::vector<double> accFlow = wfTotalAccumulator.accumulatedTracerFlowPrPseudoLength(RIG_FLOW_TOTAL_NAME, 0);
|
||||||
addStackedCurve(curveName + ", " + RIG_FLOW_TOTAL_NAME + " [R]",
|
addStackedCurve(curveName + ", " + RIG_FLOW_TOTAL_NAME + " " + curveUnitText,
|
||||||
depthValues,
|
depthValues,
|
||||||
accFlow,
|
accFlow,
|
||||||
plotTrack,
|
plotTrack,
|
||||||
@@ -595,8 +607,14 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
|||||||
|| tracerName == RIG_FLOW_GAS_NAME && selectedPhases.count(FLOW_PHASE_GAS)
|
|| tracerName == RIG_FLOW_GAS_NAME && selectedPhases.count(FLOW_PHASE_GAS)
|
||||||
|| tracerName == RIG_FLOW_WATER_NAME && selectedPhases.count(FLOW_PHASE_WATER) )
|
|| tracerName == RIG_FLOW_WATER_NAME && selectedPhases.count(FLOW_PHASE_WATER) )
|
||||||
{
|
{
|
||||||
|
FlowPhase flowPhase = FLOW_PHASE_NONE;
|
||||||
|
if (tracerName == RIG_FLOW_OIL_NAME) flowPhase = FLOW_PHASE_OIL;
|
||||||
|
else if (tracerName == RIG_FLOW_GAS_NAME) flowPhase = FLOW_PHASE_GAS;
|
||||||
|
else if (tracerName == RIG_FLOW_WATER_NAME) flowPhase = FLOW_PHASE_WATER;
|
||||||
|
QString curveUnitText = RimWellPlotTools::curveUnitText(RimWellLogFile::WELL_FLOW_COND_STANDARD, unitSet, flowPhase);
|
||||||
|
|
||||||
const std::vector<double> accFlow = wfPhaseAccumulator.accumulatedTracerFlowPrPseudoLength(tracerName, 0);
|
const std::vector<double> accFlow = wfPhaseAccumulator.accumulatedTracerFlowPrPseudoLength(tracerName, 0);
|
||||||
addStackedCurve(curveName + ", " + tracerName + " [S]",
|
addStackedCurve(curveName + ", " + tracerName + " " + curveUnitText,
|
||||||
depthValues,
|
depthValues,
|
||||||
accFlow,
|
accFlow,
|
||||||
plotTrack,
|
plotTrack,
|
||||||
@@ -639,7 +657,14 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::vector<double> depthValues = wellLogFileData->depthValues();
|
std::vector<double> depthValues = wellLogFileData->depthValues();
|
||||||
QString conditionName = (flowCondition == RimWellLogFile::WELL_FLOW_COND_RESERVOIR) ? " [R]" : " [S]";
|
|
||||||
|
RiaEclipseUnitTools::UnitSystem unitSystem = RiaEclipseUnitTools::UNITS_UNKNOWN;
|
||||||
|
{
|
||||||
|
RiaDefines::DepthUnitType depthUnit = wellLogFileData->depthUnit();
|
||||||
|
if (depthUnit == RiaDefines::UNIT_FEET) unitSystem = RiaEclipseUnitTools::UNITS_FIELD;
|
||||||
|
if (depthUnit == RiaDefines::UNIT_METER) unitSystem = RiaEclipseUnitTools::UNITS_METRIC;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for ( const ChannelValNameIdxTuple& channelInfo: sortedChannels )
|
for ( const ChannelValNameIdxTuple& channelInfo: sortedChannels )
|
||||||
{
|
{
|
||||||
@@ -651,8 +676,14 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
|||||||
RimWellPlotTools::isWaterFlowChannel(channelName) ? cvf::Color3f::BLUE :
|
RimWellPlotTools::isWaterFlowChannel(channelName) ? cvf::Color3f::BLUE :
|
||||||
cvf::Color3f::DARK_GRAY;
|
cvf::Color3f::DARK_GRAY;
|
||||||
|
|
||||||
|
|
||||||
|
FlowPhase flowPhase = FLOW_PHASE_NONE;
|
||||||
|
if (RimWellPlotTools::isOilFlowChannel(channelName)) flowPhase = FLOW_PHASE_OIL;
|
||||||
|
else if (RimWellPlotTools::isGasFlowChannel(channelName)) flowPhase = FLOW_PHASE_GAS;
|
||||||
|
else if (RimWellPlotTools::isWaterFlowChannel(channelName)) flowPhase = FLOW_PHASE_WATER;
|
||||||
|
QString curveUnitText = RimWellPlotTools::curveUnitText(flowCondition, unitSet, flowPhase);
|
||||||
|
|
||||||
addStackedCurve(curveName + ", " + channelName + conditionName,
|
addStackedCurve(curveName + ", " + channelName + curveUnitText,
|
||||||
depthValues,
|
depthValues,
|
||||||
channelData[std::get<2>(channelInfo)],
|
channelData[std::get<2>(channelInfo)],
|
||||||
plotTrack,
|
plotTrack,
|
||||||
|
|||||||
Reference in New Issue
Block a user