diff --git a/opm/models/discretization/common/tpfalinearizer.hh b/opm/models/discretization/common/tpfalinearizer.hh index 6c6bf4cdc..da5d2bc7d 100644 --- a/opm/models/discretization/common/tpfalinearizer.hh +++ b/opm/models/discretization/common/tpfalinearizer.hh @@ -429,7 +429,9 @@ private: bMat = 0.0; adres = 0.0; const IntensiveQuantities* intQuantsExP = model_().cachedIntensiveQuantities(globJ, /*timeIdx*/ 0); - assert(intQuantsExP); + if (intQuantsExP == nullptr) { + throw std::logic_error("Missing updated intensive quantities for cell " + std::to_string(globJ)); + } const IntensiveQuantities& intQuantsEx = *intQuantsExP; LocalResidual::computeFlux( adres, problem_(), globI, globJ, intQuantsIn, intQuantsEx, 0, nbInfo.trans, nbInfo.faceArea);