aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/gas-model.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/gas-model.c b/core/gas-model.c
index 79dbd2ded..4dccdf6b3 100644
--- a/core/gas-model.c
+++ b/core/gas-model.c
@@ -47,6 +47,14 @@ double gas_compressibility_factor(struct gasmix gas, double bar)
double x1, x2, x3;
double Z;
+ /*
+ * The curve fitting range is only [0,500] bar.
+ * Anything else is way out of range for cylinder
+ * pressures.
+ */
+ if (bar < 0) bar = 0;
+ if (bar > 500) bar = 500;
+
o2 = get_o2(gas);
he = get_he(gas);