SimpleHuDuanH2O: avoid use of sstream

This commit is contained in:
Arne Morten Kvarving 2022-12-23 15:22:19 +01:00
parent f94bdfda44
commit f1ecc0c7cf
2 changed files with 16 additions and 13 deletions

View File

@ -37,7 +37,6 @@
#include <opm/material/common/MathToolbox.hpp>
#include <cmath>
#include <sstream>
namespace Opm {
@ -345,15 +344,16 @@ public:
bool extrapolate)
{
if (temperature > 570) {
std::ostringstream oss;
oss << "Viscosity of water based on Hu et al is too different from IAPWS for T above 570K and "
<< "(T = " << temperature << ")";
const std::string msg =
"Viscosity of water based on Hu et al is too "
"different from IAPWS for T above 570K and (T = " +
std::to_string(getValue(temperature)) + ")";
if (extrapolate)
{
OpmLog::warning(oss.str());
OpmLog::warning(msg);
}
else
throw NumericalProblem(oss.str());
throw NumericalProblem(msg);
}
const Evaluation rho = liquidDensity(temperature, pressure, extrapolate);
@ -376,15 +376,17 @@ private:
// systems below 647 K: Assessment of experimental data and
// thermodynamics models, Chemical Geology, 2007.
if (T > 647 || pressure > 100e6) {
std::ostringstream oss;
oss << "Density of water is only implemented for temperatures below 647K and "
<< "pressures below 100MPa. (T = " << T << ", p=" << pressure;
const std::string msg =
"Density of water is only implemented for temperatures "
"below 647K and pressures below 100MPa. (T = " +
std::to_string(getValue(T)) + ", p=" +
std::to_string(getValue(pressure)) + ")";
if (extrapolate)
{
OpmLog::warning(oss.str());
OpmLog::warning(msg);
}
else
throw NumericalProblem(oss.str());
throw NumericalProblem(msg);
}
Evaluation p = pressure / 1e6; // to MPa

View File

@ -39,6 +39,7 @@
#include <opm/material/binarycoefficients/H2O_CO2.hpp>
#include <opm/material/binarycoefficients/Brine_CO2.hpp>
#include <sstream>
#include <vector>
namespace Opm {