Move defines into separate file

This commit is contained in:
Magne Sjaastad committed 2025-10-03 08:37:24 +02:00
1 parent 336e4b65fd
commit a73999323a
31 files changed
+602 -416

No files matched your search

@@ -78,8 +78,8 @@ double RiaInterpolationTools::linear( const std::vector<double>& x, const std::v
}
// Calculate indices
int upperIndex = it - x.begin();
int lowerIndex = upperIndex - 1;
auto upperIndex = it - x.begin();
auto lowerIndex = upperIndex - 1;
double lowerX = x[lowerIndex];
double lowerY = y[lowerIndex];
@@ -222,7 +222,7 @@ bool RicNewGridTimeHistoryCurveFeature::isCommandEnabled() const
if ( eclSelectionItem && eclSelectionItem->m_resultDefinition )
{
if ( eclSelectionItem->m_resultDefinition->isFlowDiagOrInjectionFlooding() &&
eclSelectionItem->m_resultDefinition->resultVariable() != RIG_NUM_FLOODED_PV )
eclSelectionItem->m_resultDefinition->resultVariable() != RigFlowDiagDefines::numFloodedPv() )
{
return false;
}
@@ -545,11 +545,11 @@ void RimFlowCharacteristicsPlot::fieldChangedByUi( const caf::PdmFieldHandle* ch
if ( m_cellFilter() == RigFlowDiagResults::CELLS_COMMUNICATION )
{
view->cellResult()->setResultVariable( RIG_FLD_COMMUNICATION_RESNAME );
view->cellResult()->setResultVariable( RigFlowDiagDefines::communicationResultName() );
}
else
{
view->cellResult()->setResultVariable( RIG_FLD_TOF_RESNAME );
view->cellResult()->setResultVariable( RigFlowDiagDefines::tofResultName() );
}
int timeStep = 0;
@@ -660,7 +660,7 @@ void RimFlowCharacteristicsPlot::onLoadDataAndUpdate()
}
}
std::map<int, RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame> timeStepToFlowResultMap;
std::map<int, RigFlowDiagDefines::FlowCharacteristicsResultFrame> timeStepToFlowResultMap;
for ( int timeStepIdx : m_currentlyPlottedTimeSteps )
{
@@ -119,8 +119,8 @@ private:
caf::PdmField<double> m_minCommunication;
caf::PdmField<int> m_maxTof;
std::vector<int> m_currentlyPlottedTimeSteps;
std::map<int, RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame> m_timeStepToFlowResultMap;
std::vector<int> m_currentlyPlottedTimeSteps;
std::map<int, RigFlowDiagDefines::FlowCharacteristicsResultFrame> m_timeStepToFlowResultMap;
QPointer<RiuFlowCharacteristicsPlot> m_flowCharPlotWidget;
};
@@ -326,9 +326,9 @@ cvf::Color3f RimFlowDiagSolution::tracerColor( const QString& tracerName ) const
{
QString wellName = removeCrossFlowEnding( tracerName );
if ( wellName == RIG_FLOW_TOTAL_NAME ) return cvf::Color3f::LIGHT_GRAY;
if ( wellName == RIG_RESERVOIR_TRACER_NAME ) return cvf::Color3f::LIGHT_GRAY;
if ( wellName == RIG_TINY_TRACER_GROUP_NAME ) return cvf::Color3f::DARK_GRAY;
if ( wellName == RigFlowDiagDefines::flowTotalName() ) return cvf::Color3f::LIGHT_GRAY;
if ( wellName == RigFlowDiagDefines::reservoirTracerName() ) return cvf::Color3f::LIGHT_GRAY;
if ( wellName == RigFlowDiagDefines::tinyTracerGroupName() ) return cvf::Color3f::DARK_GRAY;
auto eclCase = firstAncestorOrThisOfType<RimEclipseResultCase>();
if ( eclCase )
@@ -747,9 +747,9 @@ QList<caf::PdmOptionItemInfo> RimWellAllocationOverTimePlot::calculateValueOptio
//--------------------------------------------------------------------------------------------------
cvf::Color3f RimWellAllocationOverTimePlot::getTracerColor( const QString& tracerName )
{
if ( tracerName == RIG_FLOW_OIL_NAME ) return cvf::Color3f::DARK_GREEN;
if ( tracerName == RIG_FLOW_GAS_NAME ) return cvf::Color3f::DARK_RED;
if ( tracerName == RIG_FLOW_WATER_NAME ) return cvf::Color3f::BLUE;
if ( tracerName == RigFlowDiagDefines::flowOilName() ) return cvf::Color3f::DARK_GREEN;
if ( tracerName == RigFlowDiagDefines::flowGasName() ) return cvf::Color3f::DARK_RED;
if ( tracerName == RigFlowDiagDefines::flowWaterName() ) return cvf::Color3f::BLUE;
return cvf::Color3f::DARK_GRAY;
}
@@ -923,9 +923,9 @@ QWidget* RimWellAllocationPlot::createViewWidget( QWidget* mainWindowParent )
//--------------------------------------------------------------------------------------------------
cvf::Color3f RimWellAllocationPlot::getTracerColor( const QString& tracerName )
{
if ( tracerName == RIG_FLOW_OIL_NAME ) return cvf::Color3f::DARK_GREEN;
if ( tracerName == RIG_FLOW_GAS_NAME ) return cvf::Color3f::DARK_RED;
if ( tracerName == RIG_FLOW_WATER_NAME ) return cvf::Color3f::BLUE;
if ( tracerName == RigFlowDiagDefines::flowOilName() ) return cvf::Color3f::DARK_GREEN;
if ( tracerName == RigFlowDiagDefines::flowGasName() ) return cvf::Color3f::DARK_RED;
if ( tracerName == RigFlowDiagDefines::flowWaterName() ) return cvf::Color3f::BLUE;
return cvf::Color3f::DARK_GRAY;
}
@@ -65,7 +65,9 @@ std::map<QString, const std::vector<double>*>
{
if ( flowDiagSolution->tracerStatusInTimeStep( tracerName, timeStepIndex ) == requestedTracerType )
{
RigFlowDiagResultAddress resAddr( RIG_FLD_CELL_FRACTION_RESNAME, phaseSelection, tracerName.toStdString() );
RigFlowDiagResultAddress resAddr( RigFlowDiagDefines::cellFractionResultName().toStdString(),
phaseSelection,
tracerName.toStdString() );
const std::vector<double>* tracerCellFractions = flowDiagSolution->flowDiagResults()->resultValues( resAddr, timeStepIndex );
if ( tracerCellFractions )
{
@@ -537,8 +537,9 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
QString curveUnitText = RimWellPlotTools::flowUnitText( RimWellLogLasFile::WELL_FLOW_COND_RESERVOIR, unitSet );
const std::vector<double> accFlow = wfTotalAccumulator.accumulatedTracerFlowPrPseudoLength( RIG_FLOW_TOTAL_NAME, 0 );
addStackedCurve( curveName + ", " + RIG_FLOW_TOTAL_NAME + " " + curveUnitText,
const std::vector<double> accFlow =
wfTotalAccumulator.accumulatedTracerFlowPrPseudoLength( RigFlowDiagDefines::flowTotalName(), 0 );
addStackedCurve( curveName + ", " + RigFlowDiagDefines::flowTotalName() + " " + curveUnitText,
depthValues,
accFlow,
plotTrack,
@@ -559,21 +560,24 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
std::vector<QString> tracerNames = wfPhaseAccumulator.tracerNames();
for ( const QString& tracerName : tracerNames )
{
auto color = tracerName == RIG_FLOW_OIL_NAME ? cvf::Color3f::DARK_GREEN
: tracerName == RIG_FLOW_GAS_NAME ? cvf::Color3f::DARK_RED
: tracerName == RIG_FLOW_WATER_NAME ? cvf::Color3f::BLUE
: cvf::Color3f::DARK_GRAY;
auto color = tracerName == RigFlowDiagDefines::flowOilName() ? cvf::Color3f::DARK_GREEN
: tracerName == RigFlowDiagDefines::flowGasName() ? cvf::Color3f::DARK_RED
: tracerName == RigFlowDiagDefines::flowWaterName() ? cvf::Color3f::BLUE
: cvf::Color3f::DARK_GRAY;
if ( ( tracerName == RIG_FLOW_OIL_NAME && selectedPhases.count( RimWellPlotTools::FlowPhase::FLOW_PHASE_OIL ) ) ||
( tracerName == RIG_FLOW_GAS_NAME && selectedPhases.count( RimWellPlotTools::FlowPhase::FLOW_PHASE_GAS ) ) ||
( tracerName == RIG_FLOW_WATER_NAME && selectedPhases.count( RimWellPlotTools::FlowPhase::FLOW_PHASE_WATER ) ) )
if ( ( tracerName == RigFlowDiagDefines::flowOilName() &&
selectedPhases.count( RimWellPlotTools::FlowPhase::FLOW_PHASE_OIL ) ) ||
( tracerName == RigFlowDiagDefines::flowGasName() &&
selectedPhases.count( RimWellPlotTools::FlowPhase::FLOW_PHASE_GAS ) ) ||
( tracerName == RigFlowDiagDefines::flowWaterName() &&
selectedPhases.count( RimWellPlotTools::FlowPhase::FLOW_PHASE_WATER ) ) )
{
RimWellPlotTools::FlowPhase flowPhase = RimWellPlotTools::FlowPhase::FLOW_PHASE_NONE;
if ( tracerName == RIG_FLOW_OIL_NAME )
if ( tracerName == RigFlowDiagDefines::flowOilName() )
flowPhase = RimWellPlotTools::FlowPhase::FLOW_PHASE_OIL;
else if ( tracerName == RIG_FLOW_GAS_NAME )
else if ( tracerName == RigFlowDiagDefines::flowGasName() )
flowPhase = RimWellPlotTools::FlowPhase::FLOW_PHASE_GAS;
else if ( tracerName == RIG_FLOW_WATER_NAME )
else if ( tracerName == RigFlowDiagDefines::flowWaterName() )
flowPhase = RimWellPlotTools::FlowPhase::FLOW_PHASE_WATER;
QString curveUnitText =
RimWellPlotTools::curveUnitText( RimWellLogLasFile::WELL_FLOW_COND_STANDARD, unitSet, flowPhase );
@@ -389,8 +389,8 @@ void RimEclipseResultDefinition::fieldChangedByUi( const caf::PdmFieldHandle* ch
if ( m_phaseSelection() != RigFlowDiagResultAddress::PHASE_ALL )
{
m_resultType = m_resultTypeUiField;
m_resultVariable = RIG_FLD_TOF_RESNAME;
m_resultVariableUiField = RIG_FLD_TOF_RESNAME;
m_resultVariable = RigFlowDiagDefines::tofResultName();
m_resultVariableUiField = RigFlowDiagDefines::tofResultName();
}
loadDataAndUpdate();
}
@@ -697,15 +697,15 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
options.push_back( caf::PdmOptionItemInfo( RimEclipseResultDefinitionTools::timeOfFlightString( injectorSelectionState(),
producerSelectionState(),
false ),
RIG_FLD_TOF_RESNAME ) );
RigFlowDiagDefines::tofResultName() ) );
if ( m_phaseSelection() == RigFlowDiagResultAddress::PHASE_ALL )
{
options.push_back( caf::PdmOptionItemInfo( "Tracer Cell Fraction (Sum)", RIG_FLD_CELL_FRACTION_RESNAME ) );
options.push_back( caf::PdmOptionItemInfo( "Tracer Cell Fraction (Sum)", RigFlowDiagDefines::cellFractionResultName() ) );
options.push_back( caf::PdmOptionItemInfo( RimEclipseResultDefinitionTools::maxFractionTracerString( injectorSelectionState(),
producerSelectionState(),
false ),
RIG_FLD_MAX_FRACTION_TRACER_RESNAME ) );
options.push_back( caf::PdmOptionItemInfo( "Injector Producer Communication", RIG_FLD_COMMUNICATION_RESNAME ) );
RigFlowDiagDefines::maxFractionTracerResultName() ) );
options.push_back( caf::PdmOptionItemInfo( "Injector Producer Communication", RigFlowDiagDefines::communicationResultName() ) );
}
}
else if ( fieldNeedingOptions == &m_flowSolutionUiField )
@@ -752,7 +752,7 @@ QList<caf::PdmOptionItemInfo> RimEclipseResultDefinition::calculateValueOptions(
}
else if ( fieldNeedingOptions == &m_resultVariableUiField )
{
options.push_back( caf::PdmOptionItemInfo( RIG_NUM_FLOODED_PV, RIG_NUM_FLOODED_PV ) );
options.push_back( caf::PdmOptionItemInfo( RigFlowDiagDefines::numFloodedPv(), RigFlowDiagDefines::numFloodedPv() ) );
}
}
else
@@ -1450,7 +1450,8 @@ bool RimEclipseResultDefinition::hasCategoryResult() const
if ( m_resultType() == RiaDefines::ResultCatType::DYNAMIC_NATIVE && resultVariable() == RiaResultNames::completionTypeResultName() )
return true;
if ( m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS && m_resultVariable() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME )
if ( m_resultType() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS &&
m_resultVariable() == RigFlowDiagDefines::maxFractionTracerResultName() )
return true;
if ( resultVariable() == RiaResultNames::formationAllanResultName() || resultVariable() == RiaResultNames::formationBinaryAllanResultName() )
@@ -1546,7 +1547,7 @@ void RimEclipseResultDefinition::defineUiOrdering( QString uiConfigName, caf::Pd
}
if ( m_resultTypeUiField() == RiaDefines::ResultCatType::FLOW_DIAGNOSTICS &&
m_resultVariableUiField() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME )
m_resultVariableUiField() == RigFlowDiagDefines::maxFractionTracerResultName() )
{
showOnlyVisibleCategoriesOption = true;
}
@@ -1629,11 +1630,11 @@ bool RimEclipseResultDefinition::hasDualPorFractureResult()
QString RimEclipseResultDefinition::flowDiagResUiText( bool shortLabel, int maxTracerStringLength ) const
{
QString uiText = QString::fromStdString( flowDiagResAddress().variableName );
if ( flowDiagResAddress().variableName == RIG_FLD_TOF_RESNAME )
if ( uiText == RigFlowDiagDefines::tofResultName() )
{
uiText = RimEclipseResultDefinitionTools::timeOfFlightString( injectorSelectionState(), producerSelectionState(), shortLabel );
}
else if ( flowDiagResAddress().variableName == RIG_FLD_MAX_FRACTION_TRACER_RESNAME )
else if ( uiText == RigFlowDiagDefines::maxFractionTracerResultName() )
{
uiText = RimEclipseResultDefinitionTools::maxFractionTracerString( injectorSelectionState(), producerSelectionState(), shortLabel );
}
@@ -130,10 +130,10 @@ QStringList RimEclipseResultDefinitionTools::getResultNamesForResultType( RiaDef
}
QStringList flowVars;
flowVars.push_back( RIG_FLD_TOF_RESNAME );
flowVars.push_back( RIG_FLD_CELL_FRACTION_RESNAME );
flowVars.push_back( RIG_FLD_MAX_FRACTION_TRACER_RESNAME );
flowVars.push_back( RIG_FLD_COMMUNICATION_RESNAME );
flowVars.push_back( RigFlowDiagDefines::tofResultName() );
flowVars.push_back( RigFlowDiagDefines::cellFractionResultName() );
flowVars.push_back( RigFlowDiagDefines::maxFractionTracerResultName() );
flowVars.push_back( RigFlowDiagDefines::communicationResultName() );
return flowVars;
}
@@ -38,6 +38,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagSolverInterface.h
${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagStatCalc.h
${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagVisibleCellsStatCalc.h
${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagDefines.h
${CMAKE_CURRENT_LIST_DIR}/RigFormationNames.h
${CMAKE_CURRENT_LIST_DIR}/RigFractureCell.h
${CMAKE_CURRENT_LIST_DIR}/RigFractureGrid.h
@@ -118,12 +119,14 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RigFault.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFaultReactivationModel.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFaultReactivationModelGenerator.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResultAddress.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResultFrames.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagResults.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagSolverInterface.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagStatCalc.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagVisibleCellsStatCalc.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFlowDiagDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFormationNames.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFractureCell.cpp
${CMAKE_CURRENT_LIST_DIR}/RigFractureGrid.cpp
@@ -0,0 +1,112 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- 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.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RigFlowDiagDefines.h"
namespace RigFlowDiagDefines
{
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString tofResultName()
{
return "TOF";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString cellFractionResultName()
{
return "Fraction";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString maxFractionTracerResultName()
{
return "MaxFractionTracer";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString communicationResultName()
{
return "Communication";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString numFloodedPv()
{
return "Water Flooded PV";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString flowTotalName()
{
return "Total";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString flowOilName()
{
return "Oil";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString flowGasName()
{
return "Gas";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString flowWaterName()
{
return "Water";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString reservoirTracerName()
{
return "Reservoir";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString tinyTracerGroupName()
{
return "Other";
}
} // namespace RigFlowDiagDefines
@@ -0,0 +1,103 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- 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
#include <string>
#include <vector>
#include <QString>
namespace RigFlowDiagDefines
{
struct RelPermCurve
{
enum Ident
{
KRW,
KRG,
KROW,
KROG,
PCOW,
PCOG
};
enum EpsMode
{
EPS_ON,
EPS_OFF
};
Ident ident;
std::string name;
EpsMode epsMode;
std::vector<double> saturationVals;
std::vector<double> yVals;
};
enum PvtCurveType
{
PVT_CT_FVF,
PVT_CT_VISCOSITY
};
struct PvtCurve
{
enum Phase
{
OIL,
GAS
};
enum Ident
{
Unknown,
Bo,
Bg,
Visc_o,
Visc_g
};
Ident ident;
Phase phase;
std::vector<double> pressureVals;
std::vector<double> yVals;
std::vector<double> mixRatVals;
};
struct FlowCharacteristicsResultFrame
{
using Curve = std::pair<std::vector<double>, std::vector<double>>;
Curve m_storageCapFlowCapCurve;
Curve m_dimensionlessTimeSweepEfficiencyCurve;
double m_lorenzCoefficient = HUGE_VAL;
};
QString tofResultName();
QString cellFractionResultName();
QString maxFractionTracerResultName();
QString communicationResultName();
QString numFloodedPv();
QString flowTotalName();
QString flowOilName();
QString flowGasName();
QString flowWaterName();
QString reservoirTracerName();
QString tinyTracerGroupName();
} // namespace RigFlowDiagDefines
@@ -37,7 +37,8 @@ void RigFlowDiagResultAddress::PhaseSelectionEnum::setUp()
//--------------------------------------------------------------------------------------------------
bool RigFlowDiagResultAddress::isNativeResult() const
{
return ( ( ( variableName == RIG_FLD_TOF_RESNAME ) || ( variableName == RIG_FLD_CELL_FRACTION_RESNAME ) ) &&
return ( ( ( variableName == RigFlowDiagDefines::tofResultName().toStdString() ) ||
( variableName == RigFlowDiagDefines::cellFractionResultName().toStdString() ) ) &&
selectedTracerNames.size() <= 1 );
}
@@ -17,25 +17,13 @@
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RigFlowDiagDefines.h"
#include "cafAppEnum.h"
#include <set>
#include <string>
#define RIG_FLD_TOF_RESNAME "TOF"
#define RIG_FLD_CELL_FRACTION_RESNAME "Fraction"
#define RIG_FLD_MAX_FRACTION_TRACER_RESNAME "MaxFractionTracer"
#define RIG_FLD_COMMUNICATION_RESNAME "Communication"
#define RIG_NUM_FLOODED_PV "Water Flooded PV"
#define RIG_FLOW_TOTAL_NAME "Total"
#define RIG_FLOW_OIL_NAME "Oil"
#define RIG_FLOW_GAS_NAME "Gas"
#define RIG_FLOW_WATER_NAME "Water"
#define RIG_RESERVOIR_TRACER_NAME "Reservoir"
#define RIG_TINY_TRACER_GROUP_NAME "Other"
class RigFlowDiagResultAddress
{
public:
@@ -20,7 +20,6 @@
#include "RigActiveCellInfo.h"
#include "RigEclipseCaseData.h"
#include "RigFlowDiagSolverInterface.h"
#include "RigFlowDiagStatCalc.h"
#include "RigMainGrid.h"
@@ -31,6 +30,7 @@
#include "RimEclipseResultCase.h"
#include "RimFlowDiagSolution.h"
#include "RigFlowDiagSolverInterface.h"
#include <cmath> // Needed for HUGE_VAL on Linux
namespace caf
@@ -196,23 +196,25 @@ std::vector<double>* RigFlowDiagResults::calculateDerivedResult( const RigFlowDi
{
if ( resVarAddr.isNativeResult() ) return nullptr;
if ( resVarAddr.variableName == RIG_FLD_TOF_RESNAME )
auto variableName = QString::fromStdString( resVarAddr.variableName );
if ( variableName == RigFlowDiagDefines::tofResultName() )
{
return calculateAverageTOFResult( resVarAddr, timeStepIndex );
}
else if ( resVarAddr.variableName == RIG_FLD_CELL_FRACTION_RESNAME )
else if ( variableName == RigFlowDiagDefines::cellFractionResultName() )
{
return calculateSumOfFractionsResult( resVarAddr, timeStepIndex );
}
else if ( resVarAddr.variableName == RIG_FLD_COMMUNICATION_RESNAME )
else if ( variableName == RigFlowDiagDefines::communicationResultName() )
{
return calculateCommunicationResult( resVarAddr, timeStepIndex );
}
else if ( resVarAddr.variableName == RIG_FLD_MAX_FRACTION_TRACER_RESNAME )
else if ( variableName == RigFlowDiagDefines::maxFractionTracerResultName() )
{
return calculateTracerWithMaxFractionResult( resVarAddr, timeStepIndex );
}
else if ( resVarAddr.variableName == RIG_NUM_FLOODED_PV )
else if ( variableName == RigFlowDiagDefines::numFloodedPv() )
{
calculateNumFloodedPV( resVarAddr );
return findScalarResultFrame( resVarAddr, timeStepIndex );
@@ -226,15 +228,25 @@ std::vector<double>* RigFlowDiagResults::calculateDerivedResult( const RigFlowDi
//--------------------------------------------------------------------------------------------------
std::vector<double>* RigFlowDiagResults::calculateAverageTOFResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex )
{
std::vector<const std::vector<double>*> injectorTOFs =
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_TOF_RESNAME, RimFlowDiagSolution::TracerStatusType::INJECTOR );
std::vector<const std::vector<double>*> injectorTOFs = findResultsForSelectedTracers( resVarAddr,
timeStepIndex,
RigFlowDiagDefines::tofResultName().toStdString(),
RimFlowDiagSolution::TracerStatusType::INJECTOR );
std::vector<const std::vector<double>*> injectorFractions =
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_CELL_FRACTION_RESNAME, RimFlowDiagSolution::TracerStatusType::INJECTOR );
findResultsForSelectedTracers( resVarAddr,
timeStepIndex,
RigFlowDiagDefines::cellFractionResultName().toStdString(),
RimFlowDiagSolution::TracerStatusType::INJECTOR );
std::vector<const std::vector<double>*> producerTOFs =
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_TOF_RESNAME, RimFlowDiagSolution::TracerStatusType::PRODUCER );
std::vector<const std::vector<double>*> producerTOFs = findResultsForSelectedTracers( resVarAddr,
timeStepIndex,
RigFlowDiagDefines::tofResultName().toStdString(),
RimFlowDiagSolution::TracerStatusType::PRODUCER );
std::vector<const std::vector<double>*> producerFractions =
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_CELL_FRACTION_RESNAME, RimFlowDiagSolution::TracerStatusType::PRODUCER );
findResultsForSelectedTracers( resVarAddr,
timeStepIndex,
RigFlowDiagDefines::cellFractionResultName().toStdString(),
RimFlowDiagSolution::TracerStatusType::PRODUCER );
size_t activeCellCount = activeCellInfo( resVarAddr )->reservoirActiveCellCount();
std::vector<double> injectorTotalFractions;
@@ -304,10 +316,11 @@ void RigFlowDiagResults::calculateSumOfFractionAndFractionMultTOF( size_t
//--------------------------------------------------------------------------------------------------
std::vector<double>* RigFlowDiagResults::calculateSumOfFractionsResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex )
{
std::vector<const std::vector<double>*> fractions = findResultsForSelectedTracers( resVarAddr,
timeStepIndex,
RIG_FLD_CELL_FRACTION_RESNAME,
RimFlowDiagSolution::TracerStatusType::UNDEFINED );
std::vector<const std::vector<double>*> fractions =
findResultsForSelectedTracers( resVarAddr,
timeStepIndex,
RigFlowDiagDefines::cellFractionResultName().toStdString(),
RimFlowDiagSolution::TracerStatusType::UNDEFINED );
RigFlowDiagResultFrames* sumOfFractionsFrames = createScalarResult( resVarAddr );
std::vector<double>& sumOfFractions = sumOfFractionsFrames->frameData( timeStepIndex );
@@ -327,7 +340,7 @@ std::vector<double>* RigFlowDiagResults::calculateTracerWithMaxFractionResult( c
std::vector<std::pair<std::string, const std::vector<double>*>> fractions =
findNamedResultsForSelectedTracers( resVarAddr,
timeStepIndex,
RIG_FLD_CELL_FRACTION_RESNAME,
RigFlowDiagDefines::cellFractionResultName().toStdString(),
RimFlowDiagSolution::TracerStatusType::UNDEFINED );
std::vector<int> resultTracerIdxToGlobalTracerIdx;
@@ -389,9 +402,15 @@ std::vector<double>* RigFlowDiagResults::calculateTracerWithMaxFractionResult( c
std::vector<double>* RigFlowDiagResults::calculateCommunicationResult( const RigFlowDiagResultAddress& resVarAddr, size_t timeStepIndex )
{
std::vector<const std::vector<double>*> injectorFractions =
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_CELL_FRACTION_RESNAME, RimFlowDiagSolution::TracerStatusType::INJECTOR );
findResultsForSelectedTracers( resVarAddr,
timeStepIndex,
RigFlowDiagDefines::cellFractionResultName().toStdString(),
RimFlowDiagSolution::TracerStatusType::INJECTOR );
std::vector<const std::vector<double>*> producerFractions =
findResultsForSelectedTracers( resVarAddr, timeStepIndex, RIG_FLD_CELL_FRACTION_RESNAME, RimFlowDiagSolution::TracerStatusType::PRODUCER );
findResultsForSelectedTracers( resVarAddr,
timeStepIndex,
RigFlowDiagDefines::cellFractionResultName().toStdString(),
RimFlowDiagSolution::TracerStatusType::PRODUCER );
size_t activeCellCount = activeCellInfo( resVarAddr )->reservoirActiveCellCount();
std::vector<double> sumOfInjectorFractions;
@@ -734,12 +753,12 @@ std::vector<int> RigFlowDiagResults::calculatedTimeSteps( RigFlowDiagResultAddre
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagResults::flowCharacteristicsResults( int timeStepIndex,
CellFilter cellSelection,
const std::vector<QString>& tracerNames,
double max_pv_fraction,
double minCommunication,
int maxTof )
RigFlowDiagDefines::FlowCharacteristicsResultFrame RigFlowDiagResults::flowCharacteristicsResults( int timeStepIndex,
CellFilter cellSelection,
const std::vector<QString>& tracerNames,
double max_pv_fraction,
double minCommunication,
int maxTof )
{
std::set<std::string> injectorNames;
std::set<std::string> producerNames;
@@ -757,8 +776,12 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagResults::f
}
}
RigFlowDiagResultAddress injectorAddress( RIG_FLD_TOF_RESNAME, RigFlowDiagResultAddress::PHASE_ALL, injectorNames );
RigFlowDiagResultAddress producerAddress( RIG_FLD_TOF_RESNAME, RigFlowDiagResultAddress::PHASE_ALL, producerNames );
RigFlowDiagResultAddress injectorAddress( RigFlowDiagDefines::tofResultName().toStdString(),
RigFlowDiagResultAddress::PHASE_ALL,
injectorNames );
RigFlowDiagResultAddress producerAddress( RigFlowDiagDefines::tofResultName().toStdString(),
RigFlowDiagResultAddress::PHASE_ALL,
producerNames );
const std::vector<double>* allInjectorResults = resultValues( injectorAddress, timeStepIndex );
const std::vector<double>* allProducerResults = resultValues( producerAddress, timeStepIndex );
@@ -773,7 +796,9 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagResults::f
allTracers.insert( injectorNames.begin(), injectorNames.end() );
allTracers.insert( producerNames.begin(), producerNames.end() );
RigFlowDiagResultAddress communicationAddress( RIG_FLD_COMMUNICATION_RESNAME, RigFlowDiagResultAddress::PHASE_ALL, allTracers );
RigFlowDiagResultAddress communicationAddress( RigFlowDiagDefines::communicationResultName().toStdString(),
RigFlowDiagResultAddress::PHASE_ALL,
allTracers );
const std::vector<double>* communicationResult = resultValues( communicationAddress, timeStepIndex );
for ( size_t i = 0; i < communicationResult->size(); ++i )
@@ -847,7 +872,7 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame RigFlowDiagResults::f
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
RigFlowDiagDefines::FlowCharacteristicsResultFrame
RigFlowDiagResults::flowCharacteristicsResults( int timeStepIndex, const std::vector<char>& visibleActiveCells, double max_pv_fraction )
{
std::vector<QString> tracerNames = m_flowDiagSolution->tracerNames();
@@ -868,8 +893,12 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
}
}
RigFlowDiagResultAddress injectorAddress( RIG_FLD_TOF_RESNAME, RigFlowDiagResultAddress::PHASE_ALL, injectorNames );
RigFlowDiagResultAddress producerAddress( RIG_FLD_TOF_RESNAME, RigFlowDiagResultAddress::PHASE_ALL, producerNames );
RigFlowDiagResultAddress injectorAddress( RigFlowDiagDefines::tofResultName().toStdString(),
RigFlowDiagResultAddress::PHASE_ALL,
injectorNames );
RigFlowDiagResultAddress producerAddress( RigFlowDiagDefines::tofResultName().toStdString(),
RigFlowDiagResultAddress::PHASE_ALL,
producerNames );
const std::vector<double>* allInjectorResults = resultValues( injectorAddress, timeStepIndex );
const std::vector<double>* allProducerResults = resultValues( producerAddress, timeStepIndex );
@@ -19,7 +19,7 @@
#include "RigFlowDiagResultAddress.h"
#include "RigFlowDiagSolverInterface.h"
#include "RigFlowDiagDefines.h"
#include "RimFlowDiagSolution.h"
@@ -36,6 +36,7 @@
class RigFlowDiagResultFrames;
class RigStatisticsDataCache;
class RigActiveCellInfo;
class RigFlowDiagSolverInterface;
class RigFlowDiagResults : public cvf::Object
{
@@ -85,14 +86,14 @@ public:
std::vector<int> calculatedTimeSteps( RigFlowDiagResultAddress::PhaseSelection phaseSelection );
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame flowCharacteristicsResults( int timeStepIndex,
CellFilter cellSelection,
const std::vector<QString>& tracerNames,
double max_pv_fraction,
double minCommunication,
int maxTof );
RigFlowDiagDefines::FlowCharacteristicsResultFrame flowCharacteristicsResults( int timeStepIndex,
CellFilter cellSelection,
const std::vector<QString>& tracerNames,
double max_pv_fraction,
double minCommunication,
int maxTof );
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
RigFlowDiagDefines::FlowCharacteristicsResultFrame
flowCharacteristicsResults( int timeStepIndex, const std::vector<char>& visibleActiveCells, double max_pv_fraction );
RimFlowDiagSolution* flowDiagSolution();
@@ -65,7 +65,7 @@ void RigFlowDiagTimeStepResult::setTracerTOF( const std::string&
std::set<std::string> tracers;
tracers.insert( tracerName );
RigFlowDiagResultAddress resAddr( RIG_FLD_TOF_RESNAME, phaseSelection, tracers );
RigFlowDiagResultAddress resAddr( RigFlowDiagDefines::tofResultName().toStdString(), phaseSelection, tracers );
addResult( resAddr, cellValues );
@@ -86,7 +86,7 @@ void RigFlowDiagTimeStepResult::setTracerFraction( const std::string&
std::set<std::string> tracers;
tracers.insert( tracerName );
addResult( RigFlowDiagResultAddress( RIG_FLD_CELL_FRACTION_RESNAME, phaseSelection, tracers ), cellValues );
addResult( RigFlowDiagResultAddress( RigFlowDiagDefines::cellFractionResultName().toStdString(), phaseSelection, tracers ), cellValues );
}
//--------------------------------------------------------------------------------------------------
@@ -612,14 +612,14 @@ void RigFlowDiagSolverInterface::reportPvtCurveError( const QString& message )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
RigFlowDiagDefines::FlowCharacteristicsResultFrame
RigFlowDiagSolverInterface::calculateFlowCharacteristics( const std::vector<double>* injector_tof,
const std::vector<double>* producer_tof,
const std::vector<size_t>& selected_cell_indices,
double max_pv_fraction )
{
using namespace Opm::FlowDiagnostics;
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame result;
RigFlowDiagDefines::FlowCharacteristicsResultFrame result;
if ( injector_tof == nullptr || producer_tof == nullptr )
{
@@ -656,9 +656,9 @@ RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigFlowDiagSolverInterface::RelPermCurve> RigFlowDiagSolverInterface::calculateRelPermCurves( size_t activeCellIndex )
std::vector<RigFlowDiagDefines::RelPermCurve> RigFlowDiagSolverInterface::calculateRelPermCurves( size_t activeCellIndex )
{
std::vector<RelPermCurve> retCurveArr;
std::vector<RigFlowDiagDefines::RelPermCurve> retCurveArr;
if ( !ensureStaticDataObjectInstanceCreated() )
{
@@ -692,29 +692,30 @@ std::vector<RigFlowDiagSolverInterface::RelPermCurve> RigFlowDiagSolverInterface
Opm::ECLPhaseIndex::Aqua }; // oil/water capillary pressure (Po-Pw) in
// O/W system
std::vector<std::pair<RelPermCurve::Ident, std::string>> curveIdentNameArr;
std::vector<Opm::ECLSaturationFunc::RawCurve> satFuncRequests;
curveIdentNameArr.push_back( std::make_pair( RelPermCurve::KRW, "KRW" ) );
std::vector<std::pair<RigFlowDiagDefines::RelPermCurve::Ident, std::string>> curveIdentNameArr;
std::vector<Opm::ECLSaturationFunc::RawCurve> satFuncRequests;
curveIdentNameArr.push_back( std::make_pair( RigFlowDiagDefines::RelPermCurve::KRW, "KRW" ) );
satFuncRequests.push_back( krw );
curveIdentNameArr.push_back( std::make_pair( RelPermCurve::KRG, "KRG" ) );
curveIdentNameArr.push_back( std::make_pair( RigFlowDiagDefines::RelPermCurve::KRG, "KRG" ) );
satFuncRequests.push_back( krg );
curveIdentNameArr.push_back( std::make_pair( RelPermCurve::KROW, "KROW" ) );
curveIdentNameArr.push_back( std::make_pair( RigFlowDiagDefines::RelPermCurve::KROW, "KROW" ) );
satFuncRequests.push_back( krow );
curveIdentNameArr.push_back( std::make_pair( RelPermCurve::KROG, "KROG" ) );
curveIdentNameArr.push_back( std::make_pair( RigFlowDiagDefines::RelPermCurve::KROG, "KROG" ) );
satFuncRequests.push_back( krog );
curveIdentNameArr.push_back( std::make_pair( RelPermCurve::PCOG, "PCOG" ) );
curveIdentNameArr.push_back( std::make_pair( RigFlowDiagDefines::RelPermCurve::PCOG, "PCOG" ) );
satFuncRequests.push_back( pcgo );
curveIdentNameArr.push_back( std::make_pair( RelPermCurve::PCOW, "PCOW" ) );
curveIdentNameArr.push_back( std::make_pair( RigFlowDiagDefines::RelPermCurve::PCOW, "PCOW" ) );
satFuncRequests.push_back( pcow );
try
{
// Calculate and return curves both with and without endpoint scaling and tag them accordingly
// Must use two calls to achieve this
const std::array<RelPermCurve::EpsMode, 2> epsModeArr = { { RelPermCurve::EPS_ON, RelPermCurve::EPS_OFF } };
for ( RelPermCurve::EpsMode epsMode : epsModeArr )
const std::array<RigFlowDiagDefines::RelPermCurve::EpsMode, 2> epsModeArr = {
{ RigFlowDiagDefines::RelPermCurve::EPS_ON, RigFlowDiagDefines::RelPermCurve::EPS_OFF } };
for ( RigFlowDiagDefines::RelPermCurve::EpsMode epsMode : epsModeArr )
{
const bool useEps = epsMode == RelPermCurve::EPS_ON;
const bool useEps = epsMode == RigFlowDiagDefines::RelPermCurve::EPS_ON;
Opm::ECLSaturationFunc::SatFuncScaling scaling;
if ( !useEps )
@@ -725,9 +726,9 @@ std::vector<RigFlowDiagSolverInterface::RelPermCurve> RigFlowDiagSolverInterface
m_opmFlowDiagStaticData->m_eclSaturationFunc->getSatFuncCurve( satFuncRequests, static_cast<int>( activeCellIndex ), scaling );
for ( size_t i = 0; i < graphArr.size(); i++ )
{
const RelPermCurve::Ident curveIdent = curveIdentNameArr[i].first;
const std::string curveName = curveIdentNameArr[i].second;
const Opm::FlowDiagnostics::Graph& srcGraph = graphArr[i];
const RigFlowDiagDefines::RelPermCurve::Ident curveIdent = curveIdentNameArr[i].first;
const std::string curveName = curveIdentNameArr[i].second;
const Opm::FlowDiagnostics::Graph& srcGraph = graphArr[i];
if ( !srcGraph.first.empty() )
{
const std::vector<double>& xVals = srcGraph.first;
@@ -748,9 +749,9 @@ std::vector<RigFlowDiagSolverInterface::RelPermCurve> RigFlowDiagSolverInterface
// https://github.com/OPM/ResInsight/issues/11396
bool hasKRG = false;
for ( const RelPermCurve& curve : retCurveArr )
for ( const RigFlowDiagDefines::RelPermCurve& curve : retCurveArr )
{
if ( curve.ident == RelPermCurve::KRG )
if ( curve.ident == RigFlowDiagDefines::RelPermCurve::KRG )
{
hasKRG = true;
break;
@@ -761,7 +762,8 @@ std::vector<RigFlowDiagSolverInterface::RelPermCurve> RigFlowDiagSolverInterface
{
retCurveArr.erase( std::remove_if( retCurveArr.begin(),
retCurveArr.end(),
[]( const RelPermCurve& curve ) { return curve.ident == RelPermCurve::KROG; } ),
[]( const RigFlowDiagDefines::RelPermCurve& curve )
{ return curve.ident == RigFlowDiagDefines::RelPermCurve::KROG; } ),
retCurveArr.end() );
}
@@ -771,9 +773,10 @@ std::vector<RigFlowDiagSolverInterface::RelPermCurve> RigFlowDiagSolverInterface
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigFlowDiagSolverInterface::PvtCurve> RigFlowDiagSolverInterface::calculatePvtCurves( PvtCurveType pvtCurveType, int pvtNum )
std::vector<RigFlowDiagDefines::PvtCurve> RigFlowDiagSolverInterface::calculatePvtCurves( RigFlowDiagDefines::PvtCurveType pvtCurveType,
int pvtNum )
{
std::vector<PvtCurve> retCurveArr;
std::vector<RigFlowDiagDefines::PvtCurve> retCurveArr;
try
{
@@ -789,7 +792,7 @@ std::vector<RigFlowDiagSolverInterface::PvtCurve> RigFlowDiagSolverInterface::ca
}
// Requesting FVF or Viscosity
if ( pvtCurveType == PvtCurveType::PVT_CT_FVF )
if ( pvtCurveType == RigFlowDiagDefines::PvtCurveType::PVT_CT_FVF )
{
// Bo
{
@@ -801,7 +804,8 @@ std::vector<RigFlowDiagSolverInterface::PvtCurve> RigFlowDiagSolverInterface::ca
{
if ( !srcGraph.press.empty() )
{
retCurveArr.push_back( { PvtCurve::Bo, PvtCurve::OIL, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
retCurveArr.push_back(
{ RigFlowDiagDefines::PvtCurve::Bo, RigFlowDiagDefines::PvtCurve::OIL, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
}
}
}
@@ -816,13 +820,14 @@ std::vector<RigFlowDiagSolverInterface::PvtCurve> RigFlowDiagSolverInterface::ca
{
if ( !srcGraph.press.empty() )
{
retCurveArr.push_back( { PvtCurve::Bg, PvtCurve::GAS, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
retCurveArr.push_back(
{ RigFlowDiagDefines::PvtCurve::Bg, RigFlowDiagDefines::PvtCurve::GAS, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
}
}
}
}
else if ( pvtCurveType == PvtCurveType::PVT_CT_VISCOSITY )
else if ( pvtCurveType == RigFlowDiagDefines::PvtCurveType::PVT_CT_VISCOSITY )
{
// Visc_o / mu_o
{
@@ -834,7 +839,11 @@ std::vector<RigFlowDiagSolverInterface::PvtCurve> RigFlowDiagSolverInterface::ca
{
if ( !srcGraph.press.empty() )
{
retCurveArr.push_back( { PvtCurve::Visc_o, PvtCurve::OIL, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
retCurveArr.push_back( { RigFlowDiagDefines::PvtCurve::Visc_o,
RigFlowDiagDefines::PvtCurve::OIL,
srcGraph.press,
srcGraph.value,
srcGraph.mixRat } );
}
}
}
@@ -849,7 +858,11 @@ std::vector<RigFlowDiagSolverInterface::PvtCurve> RigFlowDiagSolverInterface::ca
{
if ( !srcGraph.press.empty() )
{
retCurveArr.push_back( { PvtCurve::Visc_g, PvtCurve::GAS, srcGraph.press, srcGraph.value, srcGraph.mixRat } );
retCurveArr.push_back( { RigFlowDiagDefines::PvtCurve::Visc_g,
RigFlowDiagDefines::PvtCurve::GAS,
srcGraph.press,
srcGraph.value,
srcGraph.mixRat } );
}
}
}
@@ -1003,11 +1016,3 @@ std::wstring RigFlowDiagSolverInterface::getInitFileName() const
return initFileName.toStdWString();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigFlowDiagSolverInterface::FlowCharacteristicsResultFrame::FlowCharacteristicsResultFrame()
: m_lorenzCoefficient( HUGE_VAL )
{
}
@@ -17,6 +17,7 @@
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RigFlowDiagDefines.h"
#include "RigFlowDiagResultAddress.h"
#include "cafPdmPointer.h"
@@ -64,71 +65,6 @@ class RigOpmFlowDiagStaticData;
class RigFlowDiagSolverInterface
{
public:
struct FlowCharacteristicsResultFrame
{
FlowCharacteristicsResultFrame();
using Curve = std::pair<std::vector<double>, std::vector<double>>;
Curve m_storageCapFlowCapCurve;
Curve m_dimensionlessTimeSweepEfficiencyCurve;
double m_lorenzCoefficient;
};
struct RelPermCurve
{
enum Ident
{
KRW,
KRG,
KROW,
KROG,
PCOW,
PCOG
};
enum EpsMode
{
EPS_ON,
EPS_OFF
};
Ident ident;
std::string name;
EpsMode epsMode;
std::vector<double> saturationVals;
std::vector<double> yVals;
};
enum PvtCurveType
{
PVT_CT_FVF,
PVT_CT_VISCOSITY
};
struct PvtCurve
{
enum Phase
{
OIL,
GAS
};
enum Ident
{
Unknown,
Bo,
Bg,
Visc_o,
Visc_g
};
Ident ident;
Phase phase;
std::vector<double> pressureVals;
std::vector<double> yVals;
std::vector<double> mixRatVals;
};
public:
explicit RigFlowDiagSolverInterface( RimEclipseResultCase* eclipseCase );
virtual ~RigFlowDiagSolverInterface();
@@ -138,15 +74,15 @@ public:
std::map<std::string, std::vector<int>> injectorTracers,
std::map<std::string, std::vector<int>> producerTracers );
FlowCharacteristicsResultFrame calculateFlowCharacteristics( const std::vector<double>* injector_tof,
const std::vector<double>* producer_tof,
const std::vector<size_t>& selected_cell_indices,
double max_pv_fraction );
RigFlowDiagDefines::FlowCharacteristicsResultFrame calculateFlowCharacteristics( const std::vector<double>* injector_tof,
const std::vector<double>* producer_tof,
const std::vector<size_t>& selected_cell_indices,
double max_pv_fraction );
std::vector<RelPermCurve> calculateRelPermCurves( size_t activeCellIndex );
std::vector<RigFlowDiagDefines::RelPermCurve> calculateRelPermCurves( size_t activeCellIndex );
std::vector<PvtCurve> calculatePvtCurves( PvtCurveType pvtCurveType, int pvtNum );
bool calculatePvtDynamicPropertiesFvf( int pvtNum, double pressure, double rs, double rv, double* bo, double* bg );
std::vector<RigFlowDiagDefines::PvtCurve> calculatePvtCurves( RigFlowDiagDefines::PvtCurveType pvtCurveType, int pvtNum );
bool calculatePvtDynamicPropertiesFvf( int pvtNum, double pressure, double rs, double rv, double* bo, double* bg );
bool calculatePvtDynamicPropertiesViscosity( int pvtNum, double pressure, double rs, double rv, double* mu_o, double* mu_g );
private:
@@ -117,13 +117,13 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator( const std::vector<std::vecto
if ( !m_useTotalWellPhaseRateOnly )
{
m_tracerNames.push_back( RIG_FLOW_OIL_NAME );
m_tracerNames.push_back( RIG_FLOW_GAS_NAME );
m_tracerNames.push_back( RIG_FLOW_WATER_NAME );
m_tracerNames.push_back( RigFlowDiagDefines::flowOilName() );
m_tracerNames.push_back( RigFlowDiagDefines::flowGasName() );
m_tracerNames.push_back( RigFlowDiagDefines::flowWaterName() );
}
else
{
m_tracerNames.push_back( RIG_FLOW_TOTAL_NAME );
m_tracerNames.push_back( RigFlowDiagDefines::flowTotalName() );
}
initializePipeBranchesMeasuredDepths();
@@ -156,13 +156,13 @@ RigAccWellFlowCalculator::RigAccWellFlowCalculator( const std::vector<cvf::Vec3d
if ( !m_useTotalWellPhaseRateOnly )
{
m_tracerNames.push_back( RIG_FLOW_OIL_NAME );
m_tracerNames.push_back( RIG_FLOW_GAS_NAME );
m_tracerNames.push_back( RIG_FLOW_WATER_NAME );
m_tracerNames.push_back( RigFlowDiagDefines::flowOilName() );
m_tracerNames.push_back( RigFlowDiagDefines::flowGasName() );
m_tracerNames.push_back( RigFlowDiagDefines::flowWaterName() );
}
else
{
m_tracerNames.push_back( RIG_FLOW_TOTAL_NAME );
m_tracerNames.push_back( RigFlowDiagDefines::flowTotalName() );
}
initializePipeBranchesMeasuredDepths();
@@ -939,7 +939,7 @@ void RigAccWellFlowCalculator::groupSmallContributions()
}
m_tracerNames.swap( filteredTracernames );
m_tracerNames.push_back( RIG_TINY_TRACER_GROUP_NAME );
m_tracerNames.push_back( RigFlowDiagDefines::tinyTracerGroupName() );
}
//--------------------------------------------------------------------------------------------------
@@ -969,5 +969,5 @@ void RigAccWellFlowCalculator::groupSmallTracers( std::map<QString, std::vector<
branchFlowSet->erase( it );
}
( *branchFlowSet )[RIG_TINY_TRACER_GROUP_NAME] = groupedAccFlowValues;
( *branchFlowSet )[RigFlowDiagDefines::tinyTracerGroupName()] = groupedAccFlowValues;
}
@@ -300,15 +300,15 @@ void RigWellAllocationOverTime::groupAccumulatedFlowVolumes( std::map<QString, s
}
for ( const auto& well : groupedWells )
{
if ( groupedWellValuesMap.count( RIG_TINY_TRACER_GROUP_NAME ) == 0 )
if ( groupedWellValuesMap.count( RigFlowDiagDefines::tinyTracerGroupName() ) == 0 )
{
groupedWellValuesMap[RIG_TINY_TRACER_GROUP_NAME] = rWellValuesMap[well];
groupedWellValuesMap[RigFlowDiagDefines::tinyTracerGroupName()] = rWellValuesMap[well];
}
else
{
for ( const auto& [date, value] : rWellValuesMap[well] )
{
groupedWellValuesMap[RIG_TINY_TRACER_GROUP_NAME][date] += value;
groupedWellValuesMap[RigFlowDiagDefines::tinyTracerGroupName()][date] += value;
}
}
}
@@ -357,15 +357,15 @@ void RigWellAllocationOverTime::groupAccumulatedFlowVolumeFractionsOrPercentages
}
for ( const auto& well : groupedWells )
{
if ( groupedWellValuesMap.count( RIG_TINY_TRACER_GROUP_NAME ) == 0 )
if ( groupedWellValuesMap.count( RigFlowDiagDefines::tinyTracerGroupName() ) == 0 )
{
groupedWellValuesMap[RIG_TINY_TRACER_GROUP_NAME] = rWellValuesMap[well];
groupedWellValuesMap[RigFlowDiagDefines::tinyTracerGroupName()] = rWellValuesMap[well];
}
else
{
for ( const auto& [date, value] : rWellValuesMap[well] )
{
groupedWellValuesMap[RIG_TINY_TRACER_GROUP_NAME][date] += value;
groupedWellValuesMap[RigFlowDiagDefines::tinyTracerGroupName()][date] += value;
}
}
}
@@ -49,8 +49,8 @@ RiuPvtPlotPanel::RiuPvtPlotPanel( QWidget* parent )
{
m_phaseComboBox = new QComboBox( this );
m_phaseComboBox->setEditable( false );
m_phaseComboBox->addItem( "Oil", QVariant( RigFlowDiagSolverInterface::PvtCurve::OIL ) );
m_phaseComboBox->addItem( "Gas", QVariant( RigFlowDiagSolverInterface::PvtCurve::GAS ) );
m_phaseComboBox->addItem( "Oil", QVariant( RigFlowDiagDefines::PvtCurve::OIL ) );
m_phaseComboBox->addItem( "Gas", QVariant( RigFlowDiagDefines::PvtCurve::GAS ) );
m_titleLabel = new QLabel( "", this );
m_titleLabel->setAlignment( Qt::AlignHCenter );
@@ -96,13 +96,13 @@ RiuPvtPlotPanel::~RiuPvtPlotPanel()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPvtPlotPanel::setPlotData( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr,
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr,
const FvfDynProps& fvfDynProps,
const ViscosityDynProps& viscosityDynProps,
const CellValues& cellValues,
const QString& cellReferenceText )
void RiuPvtPlotPanel::setPlotData( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagDefines::PvtCurve>& fvfCurveArr,
const std::vector<RigFlowDiagDefines::PvtCurve>& viscosityCurveArr,
const FvfDynProps& fvfDynProps,
const ViscosityDynProps& viscosityDynProps,
const CellValues& cellValues,
const QString& cellReferenceText )
{
// cvf::Trace::show("RiuPvtPlotPanel::setPlotData()");
@@ -163,29 +163,29 @@ void RiuPvtPlotPanel::applyFontSizes( bool replot )
void RiuPvtPlotPanel::plotUiSelectedCurves()
{
// Determine which curves (phase) to actually plot based on selection in GUI
const int currComboIdx = m_phaseComboBox->currentIndex();
const RigFlowDiagSolverInterface::PvtCurve::Phase phaseToPlot =
static_cast<RigFlowDiagSolverInterface::PvtCurve::Phase>( m_phaseComboBox->itemData( currComboIdx ).toInt() );
const int currComboIdx = m_phaseComboBox->currentIndex();
const RigFlowDiagDefines::PvtCurve::Phase phaseToPlot =
static_cast<RigFlowDiagDefines::PvtCurve::Phase>( m_phaseComboBox->itemData( currComboIdx ).toInt() );
QString phaseString = "";
if ( phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::GAS )
if ( phaseToPlot == RigFlowDiagDefines::PvtCurve::GAS )
{
phaseString = "Gas ";
}
else if ( phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::OIL )
else if ( phaseToPlot == RigFlowDiagDefines::PvtCurve::OIL )
{
phaseString = "Oil ";
}
// FVF plot
{
RigFlowDiagSolverInterface::PvtCurve::Ident curveIdentToPlot = RigFlowDiagSolverInterface::PvtCurve::Unknown;
double pointMarkerFvfValue = HUGE_VAL;
QString pointMarkerLabel = "";
RigFlowDiagDefines::PvtCurve::Ident curveIdentToPlot = RigFlowDiagDefines::PvtCurve::Unknown;
double pointMarkerFvfValue = HUGE_VAL;
QString pointMarkerLabel = "";
if ( phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::GAS )
if ( phaseToPlot == RigFlowDiagDefines::PvtCurve::GAS )
{
curveIdentToPlot = RigFlowDiagSolverInterface::PvtCurve::Bg;
curveIdentToPlot = RigFlowDiagDefines::PvtCurve::Bg;
pointMarkerFvfValue = m_fvfDynProps.bg;
pointMarkerLabel = QString( "%1 (%2)" ).arg( pointMarkerFvfValue ).arg( m_cellValues.pressure );
if ( m_cellValues.rv != HUGE_VAL )
@@ -193,9 +193,9 @@ void RiuPvtPlotPanel::plotUiSelectedCurves()
pointMarkerLabel += QString( "\nRv = %1" ).arg( m_cellValues.rv );
}
}
else if ( phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::OIL )
else if ( phaseToPlot == RigFlowDiagDefines::PvtCurve::OIL )
{
curveIdentToPlot = RigFlowDiagSolverInterface::PvtCurve::Bo;
curveIdentToPlot = RigFlowDiagDefines::PvtCurve::Bo;
pointMarkerFvfValue = m_fvfDynProps.bo;
pointMarkerLabel = QString( "%1 (%2)" ).arg( pointMarkerFvfValue ).arg( m_cellValues.pressure );
if ( m_cellValues.rs != HUGE_VAL )
@@ -204,8 +204,8 @@ void RiuPvtPlotPanel::plotUiSelectedCurves()
}
}
std::vector<RigFlowDiagSolverInterface::PvtCurve> selectedFvfCurves;
for ( RigFlowDiagSolverInterface::PvtCurve curve : m_allFvfCurvesArr )
std::vector<RigFlowDiagDefines::PvtCurve> selectedFvfCurves;
for ( RigFlowDiagDefines::PvtCurve curve : m_allFvfCurvesArr )
{
if ( curve.ident == curveIdentToPlot )
{
@@ -221,13 +221,13 @@ void RiuPvtPlotPanel::plotUiSelectedCurves()
// Viscosity plot
{
RigFlowDiagSolverInterface::PvtCurve::Ident curveIdentToPlot = RigFlowDiagSolverInterface::PvtCurve::Unknown;
double pointMarkerViscosityValue = HUGE_VAL;
QString pointMarkerLabel = "";
RigFlowDiagDefines::PvtCurve::Ident curveIdentToPlot = RigFlowDiagDefines::PvtCurve::Unknown;
double pointMarkerViscosityValue = HUGE_VAL;
QString pointMarkerLabel = "";
if ( phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::GAS )
if ( phaseToPlot == RigFlowDiagDefines::PvtCurve::GAS )
{
curveIdentToPlot = RigFlowDiagSolverInterface::PvtCurve::Visc_g;
curveIdentToPlot = RigFlowDiagDefines::PvtCurve::Visc_g;
pointMarkerViscosityValue = m_viscosityDynProps.mu_g;
pointMarkerLabel = QString( "%1 (%2)" ).arg( pointMarkerViscosityValue ).arg( m_cellValues.pressure );
if ( m_cellValues.rv != HUGE_VAL )
@@ -235,9 +235,9 @@ void RiuPvtPlotPanel::plotUiSelectedCurves()
pointMarkerLabel += QString( "\nRv = %1" ).arg( m_cellValues.rv );
}
}
else if ( phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::OIL )
else if ( phaseToPlot == RigFlowDiagDefines::PvtCurve::OIL )
{
curveIdentToPlot = RigFlowDiagSolverInterface::PvtCurve::Visc_o;
curveIdentToPlot = RigFlowDiagDefines::PvtCurve::Visc_o;
pointMarkerViscosityValue = m_viscosityDynProps.mu_o;
pointMarkerLabel = QString( "%1 (%2)" ).arg( pointMarkerViscosityValue ).arg( m_cellValues.pressure );
if ( m_cellValues.rs != HUGE_VAL )
@@ -246,8 +246,8 @@ void RiuPvtPlotPanel::plotUiSelectedCurves()
}
}
std::vector<RigFlowDiagSolverInterface::PvtCurve> selectedViscosityCurves;
for ( RigFlowDiagSolverInterface::PvtCurve curve : m_allViscosityCurvesArr )
std::vector<RigFlowDiagDefines::PvtCurve> selectedViscosityCurves;
for ( RigFlowDiagDefines::PvtCurve curve : m_allViscosityCurvesArr )
{
if ( curve.ident == curveIdentToPlot )
{
@@ -280,10 +280,9 @@ void RiuPvtPlotPanel::plotUiSelectedCurves()
//--------------------------------------------------------------------------------------------------
/// Static helper to get unit labels
//--------------------------------------------------------------------------------------------------
QString RiuPvtPlotPanel::unitLabelFromCurveIdent( RiaDefines::EclipseUnitSystem unitSystem,
RigFlowDiagSolverInterface::PvtCurve::Ident curveIdent )
QString RiuPvtPlotPanel::unitLabelFromCurveIdent( RiaDefines::EclipseUnitSystem unitSystem, RigFlowDiagDefines::PvtCurve::Ident curveIdent )
{
if ( curveIdent == RigFlowDiagSolverInterface::PvtCurve::Bo )
if ( curveIdent == RigFlowDiagDefines::PvtCurve::Bo )
{
switch ( unitSystem )
{
@@ -297,7 +296,7 @@ QString RiuPvtPlotPanel::unitLabelFromCurveIdent( RiaDefines::EclipseUnitSystem
return "";
}
}
else if ( curveIdent == RigFlowDiagSolverInterface::PvtCurve::Bg )
else if ( curveIdent == RigFlowDiagDefines::PvtCurve::Bg )
{
switch ( unitSystem )
{
@@ -311,7 +310,7 @@ QString RiuPvtPlotPanel::unitLabelFromCurveIdent( RiaDefines::EclipseUnitSystem
return "";
}
}
else if ( curveIdent == RigFlowDiagSolverInterface::PvtCurve::Visc_o || curveIdent == RigFlowDiagSolverInterface::PvtCurve::Visc_g )
else if ( curveIdent == RigFlowDiagDefines::PvtCurve::Visc_o || curveIdent == RigFlowDiagDefines::PvtCurve::Visc_g )
{
switch ( unitSystem )
{
@@ -19,7 +19,8 @@
#pragma once
#include "RiaDefines.h"
#include "RigFlowDiagSolverInterface.h"
#include "RigFlowDiagDefines.h"
#include <QWidget>
@@ -65,33 +66,33 @@ public:
RiuPvtPlotPanel( QWidget* parent );
~RiuPvtPlotPanel() override;
void setPlotData( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr,
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr,
const FvfDynProps& fvfDynProps,
const ViscosityDynProps& viscosityDynProps,
const CellValues& cellValues,
const QString& cellReferenceText );
void setPlotData( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagDefines::PvtCurve>& fvfCurveArr,
const std::vector<RigFlowDiagDefines::PvtCurve>& viscosityCurveArr,
const FvfDynProps& fvfDynProps,
const ViscosityDynProps& viscosityDynProps,
const CellValues& cellValues,
const QString& cellReferenceText );
void clearPlot();
RiuPvtPlotUpdater* plotUpdater();
void applyFontSizes( bool replot );
private:
void plotUiSelectedCurves();
static QString unitLabelFromCurveIdent( RiaDefines::EclipseUnitSystem unitSystem, RigFlowDiagSolverInterface::PvtCurve::Ident curveIdent );
void plotUiSelectedCurves();
static QString unitLabelFromCurveIdent( RiaDefines::EclipseUnitSystem unitSystem, RigFlowDiagDefines::PvtCurve::Ident curveIdent );
private slots:
void slotPhaseComboCurrentIndexChanged( int );
void showEvent( QShowEvent* event ) override;
private:
RiaDefines::EclipseUnitSystem m_unitSystem;
std::vector<RigFlowDiagSolverInterface::PvtCurve> m_allFvfCurvesArr;
std::vector<RigFlowDiagSolverInterface::PvtCurve> m_allViscosityCurvesArr;
FvfDynProps m_fvfDynProps;
ViscosityDynProps m_viscosityDynProps;
CellValues m_cellValues;
QString m_cellReferenceText;
RiaDefines::EclipseUnitSystem m_unitSystem;
std::vector<RigFlowDiagDefines::PvtCurve> m_allFvfCurvesArr;
std::vector<RigFlowDiagDefines::PvtCurve> m_allViscosityCurvesArr;
FvfDynProps m_fvfDynProps;
ViscosityDynProps m_viscosityDynProps;
CellValues m_cellValues;
QString m_cellReferenceText;
QComboBox* m_phaseComboBox;
QLabel* m_titleLabel;
@@ -21,6 +21,7 @@
#include "RigCaseCellResultsData.h"
#include "RigEclipseCaseData.h"
#include "RigEclipseResultAddress.h"
#include "RigFlowDiagSolverInterface.h"
#include "RigResultAccessor.h"
#include "RigResultAccessorFactory.h"
@@ -127,10 +128,10 @@ bool RiuPvtPlotUpdater::queryDataAndUpdatePlot( const RimEclipseResultDefinition
const int cellPvtNum = ( cellPvtNumDouble != HUGE_VAL ) ? static_cast<int>( cellPvtNumDouble ) : std::numeric_limits<int>::max();
std::vector<RigFlowDiagSolverInterface::PvtCurve> fvfCurveArr =
eclipseResultCase->flowDiagSolverInterface()->calculatePvtCurves( RigFlowDiagSolverInterface::PVT_CT_FVF, cellPvtNum );
std::vector<RigFlowDiagSolverInterface::PvtCurve> viscosityCurveArr =
eclipseResultCase->flowDiagSolverInterface()->calculatePvtCurves( RigFlowDiagSolverInterface::PVT_CT_VISCOSITY, cellPvtNum );
std::vector<RigFlowDiagDefines::PvtCurve> fvfCurveArr =
eclipseResultCase->flowDiagSolverInterface()->calculatePvtCurves( RigFlowDiagDefines::PVT_CT_FVF, cellPvtNum );
std::vector<RigFlowDiagDefines::PvtCurve> viscosityCurveArr =
eclipseResultCase->flowDiagSolverInterface()->calculatePvtCurves( RigFlowDiagDefines::PVT_CT_VISCOSITY, cellPvtNum );
RiuPvtPlotPanel::FvfDynProps fvfDynProps;
eclipseResultCase->flowDiagSolverInterface()->calculatePvtDynamicPropertiesFvf( cellPvtNum,
@@ -176,13 +176,13 @@ void RiuPvtPlotWidget::setPlotDefaults( QwtPlot* plot )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuPvtPlotWidget::plotCurves( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr,
double pressure,
double pointMarkerYValue,
const QString& pointMarkerLabel,
const QString& plotTitle,
const QString& yAxisTitle )
void RiuPvtPlotWidget::plotCurves( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagDefines::PvtCurve>& curveArr,
double pressure,
double pointMarkerYValue,
const QString& pointMarkerLabel,
const QString& plotTitle,
const QString& yAxisTitle )
{
m_qwtPlot->detachItems( QwtPlotItem::Rtti_PlotCurve );
m_qwtPlot->detachItems( QwtPlotItem::Rtti_PlotMarker );
@@ -198,8 +198,8 @@ void RiuPvtPlotWidget::plotCurves( RiaDefines::EclipseUnitSystem
std::vector<double> yVals;
for ( size_t i = 0; i < curveArr.size(); i++ )
{
const RigFlowDiagSolverInterface::PvtCurve& curve = curveArr[i];
if ( curve.phase == RigFlowDiagSolverInterface::PvtCurve::OIL && !curve.pressureVals.empty() && !curve.yVals.empty() )
const RigFlowDiagDefines::PvtCurve& curve = curveArr[i];
if ( curve.phase == RigFlowDiagDefines::PvtCurve::OIL && !curve.pressureVals.empty() && !curve.yVals.empty() )
{
xVals.push_back( curve.pressureVals[0] );
yVals.push_back( curve.yVals[0] );
@@ -222,20 +222,20 @@ void RiuPvtPlotWidget::plotCurves( RiaDefines::EclipseUnitSystem
// Add the primary curves
for ( size_t i = 0; i < curveArr.size(); i++ )
{
const RigFlowDiagSolverInterface::PvtCurve& curve = curveArr[i];
QwtPlotCurve* qwtCurve = new QwtPlotCurve();
QwtSymbol* curveSymbol = new QwtSymbol( QwtSymbol::Ellipse );
const RigFlowDiagDefines::PvtCurve& curve = curveArr[i];
QwtPlotCurve* qwtCurve = new QwtPlotCurve();
QwtSymbol* curveSymbol = new QwtSymbol( QwtSymbol::Ellipse );
CVF_ASSERT( curve.pressureVals.size() == curve.yVals.size() );
qwtCurve->setSamples( curve.pressureVals.data(), curve.yVals.data(), static_cast<int>( curve.pressureVals.size() ) );
qwtCurve->setStyle( QwtPlotCurve::Lines );
if ( curve.phase == RigFlowDiagSolverInterface::PvtCurve::GAS )
if ( curve.phase == RigFlowDiagDefines::PvtCurve::GAS )
{
qwtCurve->setTitle( "Gas" );
}
else if ( curve.phase == RigFlowDiagSolverInterface::PvtCurve::OIL )
else if ( curve.phase == RigFlowDiagDefines::PvtCurve::OIL )
{
qwtCurve->setTitle( "Oil" );
}
@@ -346,13 +346,13 @@ void RiuPvtPlotWidget::updateTrackerPlotMarkerAndLabelFromPicker()
size_t curveIdx = indexOfQwtCurve( closestQwtCurve );
if ( curveIdx < m_pvtCurveArr.size() )
{
const RigFlowDiagSolverInterface::PvtCurve& pvtCurve = m_pvtCurveArr[curveIdx];
const RigFlowDiagDefines::PvtCurve& pvtCurve = m_pvtCurveArr[curveIdx];
if ( static_cast<size_t>( pointSampleIdx ) < pvtCurve.mixRatVals.size() )
{
mixRat = pvtCurve.mixRatVals[pointSampleIdx];
// The text is Rs or Rv depending on phase
mixRatioText = ( pvtCurve.phase == RigFlowDiagSolverInterface::PvtCurve::GAS ) ? "Rv" : "Rs";
mixRatioText = ( pvtCurve.phase == RigFlowDiagDefines::PvtCurve::GAS ) ? "Rv" : "Rs";
}
}
}
@@ -19,7 +19,8 @@
#pragma once
#include "RiaDefines.h"
#include "RigFlowDiagSolverInterface.h"
#include "RigFlowDiagDefines.h"
#include <QPointer>
#include <QWidget>
@@ -57,13 +58,13 @@ class RiuPvtPlotWidget : public QWidget, public RiuPvtTrackerTextProvider
public:
RiuPvtPlotWidget( RiuPvtPlotPanel* parent );
void plotCurves( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr,
double pressure,
double pointMarkerYValue,
const QString& pointMarkerLabel,
const QString& plotTitle,
const QString& yAxisTitle );
void plotCurves( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagDefines::PvtCurve>& curveArr,
double pressure,
double pointMarkerYValue,
const QString& pointMarkerLabel,
const QString& plotTitle,
const QString& yAxisTitle );
void applyFontSizes( bool replot );
private:
@@ -80,8 +81,8 @@ private slots:
private:
QPointer<RiuDockedQwtPlot> m_qwtPlot;
std::vector<RigFlowDiagSolverInterface::PvtCurve> m_pvtCurveArr; // Array of source Pvt curves currently being plotted
std::vector<const QwtPlotCurve*> m_qwtCurveArr; // Array of corresponding qwt curves used for mapping to Pvt curve
std::vector<RigFlowDiagDefines::PvtCurve> m_pvtCurveArr; // Array of source Pvt curves currently being plotted
std::vector<const QwtPlotCurve*> m_qwtCurveArr; // Array of corresponding qwt curves used for mapping to Pvt curve
// when doing tracking
QPointer<RiuPvtQwtPicker> m_qwtPicker;
@@ -108,12 +108,12 @@ RiuRelativePermeabilityPlotPanel::RiuRelativePermeabilityPlotPanel( QWidget* par
m_selectedCurvesButtonGroup = new QButtonGroup( this );
m_selectedCurvesButtonGroup->setExclusive( false );
m_selectedCurvesButtonGroup->addButton( new QCheckBox( "KRW" ), RigFlowDiagSolverInterface::RelPermCurve::KRW );
m_selectedCurvesButtonGroup->addButton( new QCheckBox( "KRG" ), RigFlowDiagSolverInterface::RelPermCurve::KRG );
m_selectedCurvesButtonGroup->addButton( new QCheckBox( "KROW" ), RigFlowDiagSolverInterface::RelPermCurve::KROW );
m_selectedCurvesButtonGroup->addButton( new QCheckBox( "KROG" ), RigFlowDiagSolverInterface::RelPermCurve::KROG );
m_selectedCurvesButtonGroup->addButton( new QCheckBox( "PCOW" ), RigFlowDiagSolverInterface::RelPermCurve::PCOW );
m_selectedCurvesButtonGroup->addButton( new QCheckBox( "PCOG" ), RigFlowDiagSolverInterface::RelPermCurve::PCOG );
m_selectedCurvesButtonGroup->addButton( new QCheckBox( "KRW" ), RigFlowDiagDefines::RelPermCurve::KRW );
m_selectedCurvesButtonGroup->addButton( new QCheckBox( "KRG" ), RigFlowDiagDefines::RelPermCurve::KRG );
m_selectedCurvesButtonGroup->addButton( new QCheckBox( "KROW" ), RigFlowDiagDefines::RelPermCurve::KROW );
m_selectedCurvesButtonGroup->addButton( new QCheckBox( "KROG" ), RigFlowDiagDefines::RelPermCurve::KROG );
m_selectedCurvesButtonGroup->addButton( new QCheckBox( "PCOW" ), RigFlowDiagDefines::RelPermCurve::PCOW );
m_selectedCurvesButtonGroup->addButton( new QCheckBox( "PCOG" ), RigFlowDiagDefines::RelPermCurve::PCOG );
m_groupBox = new QGroupBox( "Curves" );
QGridLayout* groupBoxLayout = new QGridLayout;
@@ -203,12 +203,12 @@ void RiuRelativePermeabilityPlotPanel::setPlotDefaults( QwtPlot* plot )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuRelativePermeabilityPlotPanel::setPlotData( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& relPermCurves,
double swat,
double sgas,
const QString& caseName,
const QString& cellReferenceText )
void RiuRelativePermeabilityPlotPanel::setPlotData( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagDefines::RelPermCurve>& relPermCurves,
double swat,
double sgas,
const QString& caseName,
const QString& cellReferenceText )
{
// cvf::Trace::show("Set RelPerm plot data");
@@ -265,7 +265,7 @@ void RiuRelativePermeabilityPlotPanel::applyFontSizes( bool replot /*= true*/ )
//--------------------------------------------------------------------------------------------------
void RiuRelativePermeabilityPlotPanel::plotUiSelectedCurves()
{
std::vector<RigFlowDiagSolverInterface::RelPermCurve> selectedCurves = gatherUiSelectedCurves();
std::vector<RigFlowDiagDefines::RelPermCurve> selectedCurves = gatherUiSelectedCurves();
const bool useLogScale = m_logarithmicScaleKrAxisCheckBox->isChecked();
const bool fixedXAxis = m_fixedXAxisCheckBox->isChecked();
@@ -334,18 +334,18 @@ void RiuRelativePermeabilityPlotPanel::addTransparentCurve( QwtPlot*
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& curveArr,
double swat,
double sgas,
QString cellReferenceText,
bool logScaleLeftAxis,
bool fixedXAxis,
bool fixedLeftYAxis,
QwtPlot* plot,
std::vector<QwtPlotMarker*>* myPlotMarkers,
bool showScaled,
bool showUnscaled )
void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagDefines::RelPermCurve>& curveArr,
double swat,
double sgas,
QString cellReferenceText,
bool logScaleLeftAxis,
bool fixedXAxis,
bool fixedLeftYAxis,
QwtPlot* plot,
std::vector<QwtPlotMarker*>* myPlotMarkers,
bool showScaled,
bool showUnscaled )
{
bool skipUnscaledLegends = showScaled && showUnscaled;
@@ -371,13 +371,13 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaDefines::EclipseUnitS
for ( size_t i = 0; i < curveArr.size(); i++ )
{
const RigFlowDiagSolverInterface::RelPermCurve& curve = curveArr[i];
const RigFlowDiagDefines::RelPermCurve& curve = curveArr[i];
const auto unscaledCurve = ( curve.epsMode == RigFlowDiagSolverInterface::RelPermCurve::EPS_OFF );
const auto unscaledCurve = ( curve.epsMode == RigFlowDiagDefines::RelPermCurve::EPS_OFF );
// Which axis should this curve be plotted on
WhichYAxis plotOnWhichYAxis = LEFT_YAXIS;
if ( curve.ident == RigFlowDiagSolverInterface::RelPermCurve::PCOW || curve.ident == RigFlowDiagSolverInterface::RelPermCurve::PCOG )
if ( curve.ident == RigFlowDiagDefines::RelPermCurve::PCOW || curve.ident == RigFlowDiagDefines::RelPermCurve::PCOG )
{
plotOnWhichYAxis = RIGHT_YAXIS;
}
@@ -394,23 +394,23 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaDefines::EclipseUnitS
Qt::PenStyle penStyle = Qt::SolidLine;
switch ( curve.ident )
{
case RigFlowDiagSolverInterface::RelPermCurve::KRW:
case RigFlowDiagDefines::RelPermCurve::KRW:
qwtCurve->setTitle( "KRW" );
break;
case RigFlowDiagSolverInterface::RelPermCurve::KROW:
case RigFlowDiagDefines::RelPermCurve::KROW:
qwtCurve->setTitle( "KROW" );
break;
case RigFlowDiagSolverInterface::RelPermCurve::PCOW:
case RigFlowDiagDefines::RelPermCurve::PCOW:
qwtCurve->setTitle( "PCOW" );
penStyle = Qt::DashLine;
break;
case RigFlowDiagSolverInterface::RelPermCurve::KRG:
case RigFlowDiagDefines::RelPermCurve::KRG:
qwtCurve->setTitle( "KRG" );
break;
case RigFlowDiagSolverInterface::RelPermCurve::KROG:
case RigFlowDiagDefines::RelPermCurve::KROG:
qwtCurve->setTitle( "KROG" );
break;
case RigFlowDiagSolverInterface::RelPermCurve::PCOG:
case RigFlowDiagDefines::RelPermCurve::PCOG:
qwtCurve->setTitle( "PCOG" );
penStyle = Qt::DashLine;
break;
@@ -448,16 +448,16 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaDefines::EclipseUnitS
// Note that if we're using log scale we must guard against non-positive values
if ( swat != HUGE_VAL )
{
if ( curve.ident == RigFlowDiagSolverInterface::RelPermCurve::KRW || curve.ident == RigFlowDiagSolverInterface::RelPermCurve::KROW ||
curve.ident == RigFlowDiagSolverInterface::RelPermCurve::PCOW )
if ( curve.ident == RigFlowDiagDefines::RelPermCurve::KRW || curve.ident == RigFlowDiagDefines::RelPermCurve::KROW ||
curve.ident == RigFlowDiagDefines::RelPermCurve::PCOW )
{
addCurveConstSaturationIntersectionMarker( curve, swat, waterColor, plotOnWhichYAxis, plot, myPlotMarkers, &points, &axes );
}
}
if ( sgas != HUGE_VAL )
{
if ( curve.ident == RigFlowDiagSolverInterface::RelPermCurve::KRG || curve.ident == RigFlowDiagSolverInterface::RelPermCurve::KROG ||
curve.ident == RigFlowDiagSolverInterface::RelPermCurve::PCOG )
if ( curve.ident == RigFlowDiagDefines::RelPermCurve::KRG || curve.ident == RigFlowDiagDefines::RelPermCurve::KROG ||
curve.ident == RigFlowDiagDefines::RelPermCurve::PCOG )
{
addCurveConstSaturationIntersectionMarker( curve, sgas, gasColor, plotOnWhichYAxis, plot, myPlotMarkers, &points, &axes );
}
@@ -584,32 +584,32 @@ QwtPlotCurve* RiuRelativePermeabilityPlotPanel::getLegendCurve( QString title, b
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiuRelativePermeabilityPlotPanel::determineXAxisTitleFromCurveCollection( const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& curveArr )
QString RiuRelativePermeabilityPlotPanel::determineXAxisTitleFromCurveCollection( const std::vector<RigFlowDiagDefines::RelPermCurve>& curveArr )
{
bool sawWater = false;
bool sawGas = false;
for ( RigFlowDiagSolverInterface::RelPermCurve curve : curveArr )
for ( RigFlowDiagDefines::RelPermCurve curve : curveArr )
{
switch ( curve.ident )
{
case RigFlowDiagSolverInterface::RelPermCurve::KRW:
case RigFlowDiagDefines::RelPermCurve::KRW:
sawWater = true;
break;
case RigFlowDiagSolverInterface::RelPermCurve::KROW:
case RigFlowDiagDefines::RelPermCurve::KROW:
sawWater = true;
break;
case RigFlowDiagSolverInterface::RelPermCurve::PCOW:
case RigFlowDiagDefines::RelPermCurve::PCOW:
sawWater = true;
break;
case RigFlowDiagSolverInterface::RelPermCurve::KRG:
case RigFlowDiagDefines::RelPermCurve::KRG:
sawGas = true;
break;
case RigFlowDiagSolverInterface::RelPermCurve::KROG:
case RigFlowDiagDefines::RelPermCurve::KROG:
sawGas = true;
break;
case RigFlowDiagSolverInterface::RelPermCurve::PCOG:
case RigFlowDiagDefines::RelPermCurve::PCOG:
sawGas = true;
break;
}
@@ -652,14 +652,14 @@ void RiuRelativePermeabilityPlotPanel::addVerticalSaturationMarkerLine( double
//--------------------------------------------------------------------------------------------------
/// Add a marker at the intersection of the passed curve and the constant saturation value
//--------------------------------------------------------------------------------------------------
void RiuRelativePermeabilityPlotPanel::addCurveConstSaturationIntersectionMarker( const RigFlowDiagSolverInterface::RelPermCurve& curve,
double saturationValue,
QColor markerColor,
WhichYAxis whichYAxis,
QwtPlot* plot,
std::vector<QwtPlotMarker*>* myPlotMarkers,
std::vector<QPointF>* points,
std::vector<WhichYAxis>* axes )
void RiuRelativePermeabilityPlotPanel::addCurveConstSaturationIntersectionMarker( const RigFlowDiagDefines::RelPermCurve& curve,
double saturationValue,
QColor markerColor,
WhichYAxis whichYAxis,
QwtPlot* plot,
std::vector<QwtPlotMarker*>* myPlotMarkers,
std::vector<QPointF>* points,
std::vector<WhichYAxis>* axes )
{
const double yVal = RiaInterpolationTools::linear( curve.saturationVals, curve.yVals, saturationValue );
if ( yVal != HUGE_VAL )
@@ -688,9 +688,9 @@ void RiuRelativePermeabilityPlotPanel::addCurveConstSaturationIntersectionMarker
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigFlowDiagSolverInterface::RelPermCurve> RiuRelativePermeabilityPlotPanel::gatherUiSelectedCurves() const
std::vector<RigFlowDiagDefines::RelPermCurve> RiuRelativePermeabilityPlotPanel::gatherUiSelectedCurves() const
{
std::vector<RigFlowDiagSolverInterface::RelPermCurve> selectedCurves;
std::vector<RigFlowDiagDefines::RelPermCurve> selectedCurves;
// Determine which curves to actually plot based on selection in GUI
const bool showScaled = m_showScaledCheckBox->isChecked();
@@ -698,13 +698,13 @@ std::vector<RigFlowDiagSolverInterface::RelPermCurve> RiuRelativePermeabilityPlo
for ( size_t i = 0; i < m_allCurvesArr.size(); i++ )
{
const RigFlowDiagSolverInterface::RelPermCurve::Ident curveIdent = m_allCurvesArr[i].ident;
const RigFlowDiagSolverInterface::RelPermCurve::EpsMode curveEpsMode = m_allCurvesArr[i].epsMode;
const RigFlowDiagDefines::RelPermCurve::Ident curveIdent = m_allCurvesArr[i].ident;
const RigFlowDiagDefines::RelPermCurve::EpsMode curveEpsMode = m_allCurvesArr[i].epsMode;
if ( m_selectedCurvesButtonGroup->button( curveIdent ) && m_selectedCurvesButtonGroup->button( curveIdent )->isChecked() )
{
if ( ( ( curveEpsMode == RigFlowDiagSolverInterface::RelPermCurve::EPS_ON ) && showScaled ) ||
( ( curveEpsMode == RigFlowDiagSolverInterface::RelPermCurve::EPS_OFF ) && showUnscaled ) )
if ( ( ( curveEpsMode == RigFlowDiagDefines::RelPermCurve::EPS_ON ) && showScaled ) ||
( ( curveEpsMode == RigFlowDiagDefines::RelPermCurve::EPS_OFF ) && showUnscaled ) )
{
selectedCurves.push_back( m_allCurvesArr[i] );
}
@@ -719,7 +719,7 @@ std::vector<RigFlowDiagSolverInterface::RelPermCurve> RiuRelativePermeabilityPlo
//--------------------------------------------------------------------------------------------------
QString RiuRelativePermeabilityPlotPanel::asciiDataForUiSelectedCurves() const
{
std::vector<RigFlowDiagSolverInterface::RelPermCurve> selectedCurves = gatherUiSelectedCurves();
std::vector<RigFlowDiagDefines::RelPermCurve> selectedCurves = gatherUiSelectedCurves();
QString outTxt;
@@ -731,7 +731,7 @@ QString RiuRelativePermeabilityPlotPanel::asciiDataForUiSelectedCurves() const
{
if ( icurve > 0 ) outTxt += "\t";
const RigFlowDiagSolverInterface::RelPermCurve& curve = selectedCurves[icurve];
const RigFlowDiagDefines::RelPermCurve& curve = selectedCurves[icurve];
outTxt += "Saturation";
outTxt += "\t";
outTxt += curve.name.c_str();
@@ -750,7 +750,7 @@ QString RiuRelativePermeabilityPlotPanel::asciiDataForUiSelectedCurves() const
{
if ( icurve > 0 ) lineStr += "\t";
const RigFlowDiagSolverInterface::RelPermCurve& curve = selectedCurves[icurve];
const RigFlowDiagDefines::RelPermCurve& curve = selectedCurves[icurve];
if ( sampleIndex < curve.saturationVals.size() && sampleIndex < curve.yVals.size() )
{
lineStr += QString::number( curve.saturationVals[sampleIndex], 'g', 6 );
@@ -20,7 +20,7 @@
#include "RiaDefines.h"
#include "RigFlowDiagSolverInterface.h"
#include "RigFlowDiagDefines.h"
#include <QPointer>
#include <QWidget>
@@ -50,12 +50,12 @@ public:
RiuRelativePermeabilityPlotPanel( QWidget* parent );
~RiuRelativePermeabilityPlotPanel() override;
void setPlotData( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& relPermCurves,
double swat,
double sgas,
const QString& caseName,
const QString& cellReferenceText );
void setPlotData( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagDefines::RelPermCurve>& relPermCurves,
double swat,
double sgas,
const QString& caseName,
const QString& cellReferenceText );
void clearPlot();
RiuRelativePermeabilityPlotUpdater* plotUpdater();
void applyFontSizes( bool replot );
@@ -69,22 +69,22 @@ private:
void plotUiSelectedCurves();
static void setPlotDefaults( QwtPlot* plot );
static void plotCurvesInQwt( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& curveArr,
double swat,
double sgas,
QString cellReferenceText,
bool logScaleLeftAxis,
bool fixedXAxis,
bool fixedLeftYAxis,
QwtPlot* plot,
std::vector<QwtPlotMarker*>* myPlotMarkers,
bool showScaled,
bool showUnscaled );
static void plotCurvesInQwt( RiaDefines::EclipseUnitSystem unitSystem,
const std::vector<RigFlowDiagDefines::RelPermCurve>& curveArr,
double swat,
double sgas,
QString cellReferenceText,
bool logScaleLeftAxis,
bool fixedXAxis,
bool fixedLeftYAxis,
QwtPlot* plot,
std::vector<QwtPlotMarker*>* myPlotMarkers,
bool showScaled,
bool showUnscaled );
static QwtPlotCurve* getLegendCurve( QString title, bool scaled );
static QString determineXAxisTitleFromCurveCollection( const std::vector<RigFlowDiagSolverInterface::RelPermCurve>& curveArr );
static QString determineXAxisTitleFromCurveCollection( const std::vector<RigFlowDiagDefines::RelPermCurve>& curveArr );
static void addVerticalSaturationMarkerLine( double saturationValue,
QString label,
@@ -92,20 +92,20 @@ private:
QwtPlot* plot,
std::vector<QwtPlotMarker*>* myPlotMarkers );
static void addCurveConstSaturationIntersectionMarker( const RigFlowDiagSolverInterface::RelPermCurve& curve,
double saturationValue,
QColor markerColor,
WhichYAxis whichYAxis,
QwtPlot* plot,
std::vector<QwtPlotMarker*>* myPlotMarkers,
std::vector<QPointF>* points,
std::vector<WhichYAxis>* axes );
static void addCurveConstSaturationIntersectionMarker( const RigFlowDiagDefines::RelPermCurve& curve,
double saturationValue,
QColor markerColor,
WhichYAxis whichYAxis,
QwtPlot* plot,
std::vector<QwtPlotMarker*>* myPlotMarkers,
std::vector<QPointF>* points,
std::vector<WhichYAxis>* axes );
static void
addTransparentCurve( QwtPlot* plot, const std::vector<QPointF>& points, const std::vector<WhichYAxis>& axes, bool logScaleLeftAxis );
std::vector<RigFlowDiagSolverInterface::RelPermCurve> gatherUiSelectedCurves() const;
QString asciiDataForUiSelectedCurves() const;
std::vector<RigFlowDiagDefines::RelPermCurve> gatherUiSelectedCurves() const;
QString asciiDataForUiSelectedCurves() const;
void contextMenuEvent( QContextMenuEvent* event ) override;
@@ -117,14 +117,14 @@ private slots:
void showEvent( QShowEvent* event ) override;
private:
RiaDefines::EclipseUnitSystem m_unitSystem;
std::vector<RigFlowDiagSolverInterface::RelPermCurve> m_allCurvesArr;
double m_swat;
double m_sgas;
QString m_caseName;
QString m_cellReferenceText;
QPointer<RiuDockedQwtPlot> m_qwtPlot;
std::vector<QwtPlotMarker*> m_myPlotMarkers;
RiaDefines::EclipseUnitSystem m_unitSystem;
std::vector<RigFlowDiagDefines::RelPermCurve> m_allCurvesArr;
double m_swat;
double m_sgas;
QString m_caseName;
QString m_cellReferenceText;
QPointer<RiuDockedQwtPlot> m_qwtPlot;
std::vector<QwtPlotMarker*> m_myPlotMarkers;
QGroupBox* m_groupBox;
QButtonGroup* m_selectedCurvesButtonGroup;
@@ -26,6 +26,7 @@
#include "RigCaseCellResultsData.h"
#include "RigEclipseCaseData.h"
#include "RigEclipseResultAddress.h"
#include "RigFlowDiagSolverInterface.h"
#include "RigGridBase.h"
#include "RigResultAccessor.h"
#include "RigResultAccessorFactory.h"
@@ -37,8 +38,6 @@
#include "RimEclipseView.h"
#include "RimExtrudedCurveIntersection.h"
// #include "cvfTrace.h"
#include <cmath>
//==================================================================================================
@@ -105,7 +104,7 @@ bool RiuRelativePermeabilityPlotUpdater::queryDataAndUpdatePlot( const RimEclips
{
// cvf::Trace::show("Updating RelPerm plot for active cell index: %d", static_cast<int>(activeCellIndex));
std::vector<RigFlowDiagSolverInterface::RelPermCurve> relPermCurveArr =
std::vector<RigFlowDiagDefines::RelPermCurve> relPermCurveArr =
eclipseResultCase->flowDiagSolverInterface()->calculateRelPermCurves( activeCellIndex );
// Make sure we load the results that we'll query below
@@ -159,7 +159,7 @@ void RiuSelectionChangedHandler::addResultCurveFromSelectionItem( const RiuEclip
RimEclipseResultDefinition* eclResDef = eclipseSelectionItem->m_resultDefinition;
if ( !eclResDef ) return;
if ( eclResDef->isFlowDiagOrInjectionFlooding() && eclResDef->resultVariable() != RIG_NUM_FLOODED_PV )
if ( eclResDef->isFlowDiagOrInjectionFlooding() && eclResDef->resultVariable() != RigFlowDiagDefines::numFloodedPv() )
{
// NB! Do not read out data for flow results, as this can be a time consuming operation
@@ -510,7 +510,7 @@ void RiuSelectionChangedHandler::addDepthCurveFromSelectionItem( const RiuSelect
RimEclipseResultDefinition* eclResDef = eclipseSelectionItem->m_resultDefinition;
if ( !eclResDef ) return;
if ( eclResDef->isFlowDiagOrInjectionFlooding() && eclResDef->resultVariable() != RIG_NUM_FLOODED_PV )
if ( eclResDef->isFlowDiagOrInjectionFlooding() && eclResDef->resultVariable() != RigFlowDiagDefines::numFloodedPv() )
{
// NB! Do not read out data for flow results, as this can be a time consuming operation
return;