From a2850e7f8f805e20da0a3ebd3855f08f75c789be Mon Sep 17 00:00:00 2001
From: Norbert Grunwald <Norbert.Grunwald@ufz.de>
Date: Mon, 9 Sep 2019 15:24:50 +0200
Subject: [PATCH] fatal error to prevent div by zero in relPermBrooksCorey

---
 MaterialLib/MPL/Properties/RelPermBrooksCorey.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/MaterialLib/MPL/Properties/RelPermBrooksCorey.h b/MaterialLib/MPL/Properties/RelPermBrooksCorey.h
index 010b5985e00..247a9b600ec 100644
--- a/MaterialLib/MPL/Properties/RelPermBrooksCorey.h
+++ b/MaterialLib/MPL/Properties/RelPermBrooksCorey.h
@@ -95,6 +95,10 @@ inline std::unique_ptr<RelPermBrooksCorey> createRelPermBrooksCorey(
     auto const exponent =
         //! \ogs_file_param{prj__media__medium__properties__property__RelPermBrooksCorey__lambda}
         config.getConfigParameter<double>("lambda");
+    if (exponent == 0.)
+    {
+        OGS_FATAL("Exponent 'lambda' must be positive.");
+    }
 
     return std::make_unique<RelPermBrooksCorey>(
         residual_liquid_saturation,
-- 
GitLab