From 587ffe4d78f6763c4811db4a125d19a4a1061ba6 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 2 Jan 2023 08:46:32 +0100 Subject: [PATCH] BrineCO2FluidSystem: remove use of sstream --- .../fluidsystems/BrineCO2FluidSystem.hpp | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/opm/material/fluidsystems/BrineCO2FluidSystem.hpp b/opm/material/fluidsystems/BrineCO2FluidSystem.hpp index 1d6c640a7..849e1fda1 100644 --- a/opm/material/fluidsystems/BrineCO2FluidSystem.hpp +++ b/opm/material/fluidsystems/BrineCO2FluidSystem.hpp @@ -45,8 +45,6 @@ #include #include -#include - namespace Opm { /*! @@ -485,17 +483,28 @@ private: Valgrind::CheckDefined(xlH2O); Valgrind::CheckDefined(xlCO2); + auto tostring = [](const auto& val) -> std::string + { + if constexpr (DenseAd::is_evaluation::value) { + return std::to_string(getValue(val.value())); + } else { + return std::to_string(val); + } + }; + if(T < 273.15) { - std::ostringstream oss; - oss << "Liquid density for Brine and CO2 is only " - "defined above 273.15K (is "<= 2.5e8) { - std::ostringstream oss; - oss << "Liquid density for Brine and CO2 is only " - "defined below 250MPa (is "<