On 12 Oct 2015 8:23 am, "Rick Walsh" <[email protected]> wrote: > > The enough_gas function is used in recreational mode to determine that the > reserve gas is kept in reserve. A simple comparison of end pressure => reserve > pressure should suffice.
Reserve gas is calculated as the minimum amount left in the tank at the surface _IF_ you have to do the ascent with your buddy breathing of your tank. That's why it is doubling the SAC on the ascent. > > The existing/previous comparison includes deco_gas_used, double-counting the gas > used in the ascent/safety stop. > > Signed-off-by: Rick Walsh <[email protected]> > --- > > As an example to check this, plan a dive to 15 m with EAN32 in a 12 l tank with working pressure 232 bar. Set reserve gas to 50 bar. SAC of 20 l/min. NDL is ~135 minutes with GF 60/80, so gas consumption will govern. Bottom time is 38 min, giving a total dive of 43 min including a 3 minute safety stop and ascent at 9 m/min. End cylinder pressure is 63 bar. 2033 l is used (169 bar), including 149 l (12 bar) on ascent. > > With this simple patch, for this example the bottom time is extended an extra 3 minutes, and the ending pressure is 50 bar. 2183 l (182 bar) is used, including 149 l (12 bar) on ascent. > > Robert, can you please check I'm not overlooking something? > > > planner.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/planner.c b/planner.c > index 05fd26e..26a6c44 100644 > --- a/planner.c > +++ b/planner.c > @@ -946,7 +946,7 @@ bool enough_gas(int current_cylinder) > if (!cyl->start.mbar) > return true; > if (cyl->type.size.mliter) > - return (float) (cyl->end.mbar - prefs.reserve_gas) * cyl->type.size.mliter / 1000.0 > (float) cyl->deco_gas_used.mliter; > + return cyl->end.mbar >= prefs.reserve_gas; > else > return true; > } > -- > 2.4.3 > > _______________________________________________ > subsurface mailing list > [email protected] > http:// <http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface> lists.subsurface- <http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface> divelog.org <http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface>/ <http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface> cgi-bin <http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface> /mailman/ <http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface> listinfo <http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface> /subsurface <http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface> //Jocke
_______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
