summaryrefslogtreecommitdiffstats
path: root/deco.c
diff options
context:
space:
mode:
authorGravatar Jan Darowski <jan.darowski@gmail.com>2015-07-03 23:24:20 +0200
committerGravatar Jan Darowski <jan.darowski@gmail.com>2015-07-03 23:24:20 +0200
commite7aa686f1658e689d215397d4493859829965646 (patch)
tree61e23882a641700d9eefdc9a9a6c149d82eb2be0 /deco.c
parentfad592e43a26343fdef9cd3e0703be10d9069b20 (diff)
downloadsubsurface-e7aa686f1658e689d215397d4493859829965646.tar.gz
VPM-B: add vpm-b based deco checking.
Check during the trial_ascent() if existing pressure gradient is smaller than previously calculated max gradient. If not, ascent is impossible from the vpm-b's point of view. Signed-off-by: Jan Darowski <jan.darowski@gmail.com>
Diffstat (limited to 'deco.c')
-rw-r--r--deco.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/deco.c b/deco.c
index ada13fbb0..47b752ee8 100644
--- a/deco.c
+++ b/deco.c
@@ -210,6 +210,21 @@ double he_factor(int period_in_seconds, int ci)
return cache[ci].last_factor;
}
+bool is_vpmb_ok(double pressure)
+{
+ int ci;
+ double gradient;
+ double gas_tension;
+
+ for (ci = 0; ci < 16; ++ci) {
+ gas_tension = tissue_n2_sat[ci] + tissue_he_sat[ci] + vpmb_config.other_gases_pressure;
+ gradient = gas_tension - pressure;
+ if (gradient > total_gradient[ci])
+ return false;
+ }
+ return true;
+}
+
void vpmb_start_gradient()
{
int ci;