diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp index 4bb25dc5aa..c57388efb1 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp @@ -135,21 +135,29 @@ public: try { m_eclPvtCurveCollection.reset(new Opm::ECLPVT::ECLPvtCurveCollection(*m_eclGraph, initData)); - - // Try and set output unit system to the same system as the eclipse case system - std::unique_ptr eclUnitSystem; - if (caseUnitSystem == RiaEclipseUnitTools::UNITS_METRIC) eclUnitSystem = Opm::ECLUnits::metricUnitConventions(); - else if (caseUnitSystem == RiaEclipseUnitTools::UNITS_FIELD) eclUnitSystem = Opm::ECLUnits::fieldUnitConventions(); - else if (caseUnitSystem == RiaEclipseUnitTools::UNITS_LAB) eclUnitSystem = Opm::ECLUnits::labUnitConventions(); - if (eclUnitSystem) - { - m_eclPvtCurveCollection->setOutputUnits(eclUnitSystem->clone()); - } } catch (...) { RiaLogging::warning("Unsupported PVT table format. Could not initialize PVT plotting functionality."); } + + // Try and set output unit system to the same system as the eclipse case system + std::unique_ptr eclUnitSystem; + if (caseUnitSystem == RiaEclipseUnitTools::UNITS_METRIC) eclUnitSystem = Opm::ECLUnits::metricUnitConventions(); + else if (caseUnitSystem == RiaEclipseUnitTools::UNITS_FIELD) eclUnitSystem = Opm::ECLUnits::fieldUnitConventions(); + else if (caseUnitSystem == RiaEclipseUnitTools::UNITS_LAB) eclUnitSystem = Opm::ECLUnits::labUnitConventions(); + + if (eclUnitSystem) + { + if (m_eclSaturationFunc) + { + m_eclSaturationFunc->setOutputUnits(eclUnitSystem->clone()); + } + if (m_eclPvtCurveCollection) + { + m_eclPvtCurveCollection->setOutputUnits(eclUnitSystem->clone()); + } + } } public: