[PATCH] VPM-B: Don't break the ceiling due to ongassing on ascent

Rick Walsh rickmwalsh at gmail.com
Sat Aug 29 07:08:18 PDT 2015


Signed-off-by: Rick Walsh <rickmwalsh at gmail.com>
---
 deco.c    |  2 +-
 planner.c | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/deco.c b/deco.c
index 2175c65..c6738dc 100644
--- a/deco.c
+++ b/deco.c
@@ -116,7 +116,7 @@ const double buehlmann_He_factor_expositon_one_second[] = {
 const double conservatism_lvls[] = { 1.0, 1.05, 1.12, 1.22, 1.35 };
 
 #define WV_PRESSURE 0.0627 // water vapor pressure in bar
-#define WV_PRESSURE_SCHREINER 0.0487 // water vapor pressure in bar
+#define WV_PRESSURE_SCHREINER 0.0493 // water vapor pressure in bar
 #define DECO_STOPS_MULTIPLIER_MM 3000.0
 #define NITROGEN_FRACTION 0.79
 
diff --git a/planner.c b/planner.c
index b453199..b990a20 100644
--- a/planner.c
+++ b/planner.c
@@ -876,11 +876,11 @@ bool trial_ascent(int trial_depth, int stoplevel, int avg_depth, int bottom_time
 	bool clear_to_ascend = true;
 	char *trial_cache = NULL;
 
-	// For VPM-B it is not relevant if we would violate a ceiling during ascent to the next stop but
-	// if the next stop is below the ceiling at the start of the ascent (thus the offgasing during
-	// the ascent is ignored.
-	if (prefs.deco_mode == VPMB)
-		return (deco_allowed_depth(tissue_tolerance, surface_pressure, &displayed_dive, 1) <= stoplevel);
+	// For consistency with other VPM-B implementations, we should not start the ascent while the ceiling is
+	// deeper than the next stop (thus the offgasing during the ascent is ignored).
+	// However, we still need to make sure we don't break the ceiling due to on-gassing during ascent.
+	if (prefs.deco_mode == VPMB && (deco_allowed_depth(tissue_tolerance, surface_pressure, &displayed_dive, 1) > stoplevel))
+		return false;
 
 	cache_deco_state(tissue_tolerance, &trial_cache);
 	while (trial_depth > stoplevel) {
-- 
2.4.3



More information about the subsurface mailing list