Fix errors when Scalar = float

This commit is contained in:
Svenn Tveit
2023-09-26 12:56:34 +02:00
parent 6d300b8d13
commit 4769fa7bd6
4 changed files with 4 additions and 4 deletions

View File

@@ -83,7 +83,7 @@ public:
: salinity_(salinity)
{
// Throw an error if reference state is not (T, p) = (15.56 C, 1 atm) = (288.71 K, 1.01325e5 Pa)
if (T_ref != 288.71 || P_ref != 1.01325e5) {
if (T_ref != Scalar(288.71) || P_ref != Scalar(1.01325e5)) {
OPM_THROW(std::runtime_error,
"BrineCo2Pvt class can only be used with default reference state (T, P) = (288.71 K, 1.01325e5 Pa)!");
}

View File

@@ -69,7 +69,7 @@ public:
: salinity_(salinity)
{
// Throw an error if reference state is not (T, p) = (15.56 C, 1 atm) = (288.71 K, 1.01325e5 Pa)
if (T_ref != 288.71 || P_ref != 1.01325e5) {
if (T_ref != Scalar(288.71) || P_ref != Scalar(1.01325e5)) {
OPM_THROW(std::runtime_error,
"BrineCo2Pvt class can only be used with default reference state (T, P) = (288.71 K, 1.01325e5 Pa)!");
}

View File

@@ -65,7 +65,7 @@ initFromState(const EclipseState& eclState, const Schedule&)
Scalar P_ref = eclState.getTableManager().stCond().pressure;
// Throw an error if STCOND is not (T, p) = (15.56 C, 1 atm) = (288.71 K, 1.01325e5 Pa)
if (T_ref != 288.71 || P_ref != 1.01325e5) {
if (T_ref != Scalar(288.71) || P_ref != Scalar(1.01325e5)) {
OPM_THROW(std::runtime_error, "CO2STORE can only be used with default values for STCOND!");
}

View File

@@ -60,7 +60,7 @@ initFromState(const EclipseState& eclState, const Schedule&)
Scalar P_ref = eclState.getTableManager().stCond().pressure;
// Throw an error if STCOND is not (T, p) = (15.56 C, 1 atm) = (288.71 K, 1.01325e5 Pa)
if (T_ref != 288.71 || P_ref != 1.01325e5) {
if (T_ref != Scalar(288.71) || P_ref != Scalar(1.01325e5)) {
OPM_THROW(std::runtime_error, "CO2STORE can only be used with default values for STCOND!");
}