From 1720805f19ba0d0ff47aa21a9761e0c970c18895 Mon Sep 17 00:00:00 2001 From: Cintia Goncalves Machado Date: Thu, 14 Apr 2022 17:21:26 +0200 Subject: [PATCH] Fix division by zero in WATDENT implementation --- opm/material/fluidsystems/blackoilpvt/WaterPvtThermal.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/opm/material/fluidsystems/blackoilpvt/WaterPvtThermal.hpp b/opm/material/fluidsystems/blackoilpvt/WaterPvtThermal.hpp index f1af7d10c..aa76d9b70 100644 --- a/opm/material/fluidsystems/blackoilpvt/WaterPvtThermal.hpp +++ b/opm/material/fluidsystems/blackoilpvt/WaterPvtThermal.hpp @@ -138,6 +138,14 @@ public: watdentCT1_[regionIdx] = record.C1; watdentCT2_[regionIdx] = record.C2; } + + const auto& pvtwTables = tables.getPvtwTable(); + + assert(pvtwTables.size() == numRegions); + for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) { + pvtwRefPress_[regionIdx] = pvtwTables[regionIdx].reference_pressure; + pvtwRefB_[regionIdx] = pvtwTables[regionIdx].volume_factor; + } } if (enableThermalViscosity_) {