From 6c0eee48d1dcf3566b481c327a46185f087f3504 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 13 Dec 2022 11:12:44 +0100 Subject: [PATCH] ConstantCompressibilityWaterPvt: replace assert this is user-provided data. instead throw an exception --- .../blackoilpvt/ConstantCompressibilityWaterPvt.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.cpp b/src/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.cpp index 6e11c81b522..75440626211 100644 --- a/src/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.cpp +++ b/src/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.cpp @@ -24,6 +24,8 @@ #include #include +#include + #include namespace Opm { @@ -35,7 +37,11 @@ initFromState(const EclipseState& eclState, const Schedule&) const auto& pvtwTable = eclState.getTableManager().getPvtwTable(); const auto& densityTable = eclState.getTableManager().getDensityTable(); - assert(pvtwTable.size() == densityTable.size()); + if (pvtwTable.size() != densityTable.size()) { + OPM_THROW(std::runtime_error, "Table sizes mismatch. PVCDOTable: " + << pvtwTable.size() << ", DensityTable: " + << densityTable.size() << std::endl); + } size_t numRegions = pvtwTable.size(); setNumRegions(numRegions);