Skip to content

Commit

Permalink
ConstantCompressibilityWaterPvt: replace assert
Browse files Browse the repository at this point in the history
this is user-provided data. instead throw an exception
  • Loading branch information
akva2 committed Dec 13, 2022
1 parent d059ebb commit 6c0eee4
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <config.h>
#include <opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.hpp>

#include <opm/common/ErrorMacros.hpp>

#include <opm/input/eclipse/EclipseState/EclipseState.hpp>

namespace Opm {
Expand All @@ -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);
Expand Down

0 comments on commit 6c0eee4

Please sign in to comment.