From d3fedd029b156d16e10e690c4b72964e3b6eb04f Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <dmitri.naumov@ufz.de> Date: Fri, 30 Aug 2024 15:23:36 +0200 Subject: [PATCH] [MPL] Few assertions to avoid incorrect usage --- MaterialLib/MPL/Properties/Density/WaterVapourDensity.cpp | 4 ++++ MaterialLib/MPL/Properties/Density/WaterVapourDensity.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/MaterialLib/MPL/Properties/Density/WaterVapourDensity.cpp b/MaterialLib/MPL/Properties/Density/WaterVapourDensity.cpp index a2c535db6f7..682d208767b 100644 --- a/MaterialLib/MPL/Properties/Density/WaterVapourDensity.cpp +++ b/MaterialLib/MPL/Properties/Density/WaterVapourDensity.cpp @@ -46,7 +46,9 @@ PropertyDataType WaterVapourDensity::value( { double const p = variable_array.liquid_phase_pressure; double const T = variable_array.temperature; + assert(T >= 273.); double const water_density = variable_array.density; + assert(water_density > 0.); return humidity(T, p, water_density) * saturatedVaporDensity(T); } @@ -58,7 +60,9 @@ PropertyDataType WaterVapourDensity::dValue( { double const p = variable_array.liquid_phase_pressure; double const T = variable_array.temperature; + assert(T >= 273.); double const water_density = variable_array.density; + assert(water_density > 0.); if (variable == Variable::temperature) { diff --git a/MaterialLib/MPL/Properties/Density/WaterVapourDensity.h b/MaterialLib/MPL/Properties/Density/WaterVapourDensity.h index e545b5b423c..953033a1f2a 100644 --- a/MaterialLib/MPL/Properties/Density/WaterVapourDensity.h +++ b/MaterialLib/MPL/Properties/Density/WaterVapourDensity.h @@ -49,6 +49,9 @@ class Phase; * equation are multiplied with \f$1-S\f$ with \f$ S \f$, the water * saturation. Therefore the application of the water vapour density model is * naturally restricted in the unsaturated zones. + * + * \note The temperature must be greater then the freezing temperature. In the + * paper the offset is 273K, not 273.15 which might cause small inconsistencies. */ class WaterVapourDensity final : public Property { -- GitLab