Hi,

Am 13.09.2016 um 11:50 schrieb Rick Walsh <[email protected]>:

Yes, I noticed the same.  It's completely wrong for vpm.  To get it to work, we need to calculate Buhlmann "percentage" values, which isn't done for vpm at the moment.  Adding it shouldn't be too difficult.


It seems to me the attached patch does this.

Best
Robert

From 254bb2638ddd3e27b6947c23b3d5db8ce23b7e13 Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <[email protected]>
Date: Tue, 13 Sep 2016 21:29:39 +0200
Subject: [PATCH] Compute total tissue saturation for all deco models
To: [email protected]

... and not just for Buehlmann. This makes the saturation
graphs meaningful for VPM-B.

Signed-off-by: Robert C. Helling <[email protected]>
---
 core/deco.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/core/deco.c b/core/deco.c
index b86376c..6c3d6dd 100644
--- a/core/deco.c
+++ b/core/deco.c
@@ -247,7 +247,6 @@ double tissue_tolerance_calc(const struct dive *dive, 
double pressure)
 
        if (prefs.deco_mode != VPMB) {
                for (ci = 0; ci < 16; ci++) {
-                       tissue_inertgas_saturation[ci] = tissue_n2_sat[ci] + 
tissue_he_sat[ci];
                        buehlmann_inertgas_a[ci] = ((buehlmann_N2_a[ci] * 
tissue_n2_sat[ci]) + (buehlmann_He_a[ci] * tissue_he_sat[ci])) / 
tissue_inertgas_saturation[ci];
                        buehlmann_inertgas_b[ci] = ((buehlmann_N2_b[ci] * 
tissue_n2_sat[ci]) + (buehlmann_He_b[ci] * tissue_he_sat[ci])) / 
tissue_inertgas_saturation[ci];
 
@@ -512,6 +511,8 @@ void add_segment(double pressure, const struct gasmix 
*gasmix, int period_in_sec
 
                tissue_n2_sat[ci] += n2_satmult * pn2_oversat * n2_f;
                tissue_he_sat[ci] += he_satmult * phe_oversat * he_f;
+               tissue_inertgas_saturation[ci] = tissue_n2_sat[ci] + 
tissue_he_sat[ci];
+
        }
        if(prefs.deco_mode == VPMB)
                calc_crushing_pressure(pressure);
-- 
2.7.4 (Apple Git-66)

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to