# HG changeset patch # User heinrichsweikamp # Date 1434540795 -7200 # Node ID 1620587031008aa8e6ce9b217013f279a50acda6 # Parent 4fd718965e8f39f603ebd4df35cca02c0f4d7ae1 FIX NDL prediction error with Buhlmann model: might be desaturating too fast. diff -r 4fd718965e8f -r 162058703100 code_part1/OSTC_code_c_part2/p2_deco.c --- a/code_part1/OSTC_code_c_part2/p2_deco.c Tue Jun 09 02:18:57 2015 +0200 +++ b/code_part1/OSTC_code_c_part2/p2_deco.c Wed Jun 17 13:33:15 2015 +0200 @@ -92,6 +92,7 @@ // 2013/12/21: [jDG] Fix CNS calculation in decoplan w/o marked gas switch // 2014/06/16: [jDG] Fix Helium diluant. Fix volumes with many travel mix. // 2014/06/29: [mH] Compute int_O_ceiling +// 2015/06/12: [jDG] Fix NDL prediction while desaturating with the Buhlmann model. // // TODO: // + Allow to abort MD2 calculation (have to restart next time). @@ -1515,8 +1516,13 @@ //---- Apply security margin when using the non-GF model if( char_I_deco_model == 0 ) { - dTN2 *= float_saturation_multiplier; - dTHe *= float_saturation_multiplier; + // NDL can be computed while ascending... SO we have + // to check wether we are saturating or desaturating. + if( dTN2 > 0.0 ) dTN2 *= float_saturation_multiplier; + else dTN2 *= float_desaturation_multiplier; + + if( dTHe > 0.0 ) dTHe *= float_saturation_multiplier; + else dTHe *= float_saturation_multiplier; } else // Or GF-based model M0 = GF_high * (M0 - pres_surface) + pres_surface;