<p dir="ltr"><br>
On 12 Oct 2015 8:23 am, "Rick Walsh" <<a href="mailto:rickmwalsh@gmail.com">rickmwalsh@gmail.com</a>> wrote:<br>
><br>
> The enough_gas function is used in recreational mode to determine that the<br>
> reserve gas is kept in reserve.  A simple comparison of end pressure => reserve<br>
> pressure should suffice.</p>
<p dir="ltr">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.<br>
That's why it is doubling the SAC on the ascent.</p>
<p dir="ltr">><br>
> The existing/previous comparison includes deco_gas_used, double-counting the gas<br>
> used in the ascent/safety stop.<br>
><br>
> Signed-off-by: Rick Walsh <<a href="mailto:rickmwalsh@gmail.com">rickmwalsh@gmail.com</a>><br>
> ---<br>
><br>
> 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.<br>
><br>
> 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.<br>
><br>
> Robert, can you please check I'm not overlooking something?<br>
><br>
><br>
>  planner.c | 2 +-<br>
>  1 file changed, 1 insertion(+), 1 deletion(-)<br>
><br>
> diff --git a/planner.c b/planner.c<br>
> index 05fd26e..26a6c44 100644<br>
> --- a/planner.c<br>
> +++ b/planner.c<br>
> @@ -946,7 +946,7 @@ bool enough_gas(int current_cylinder)<br>
>         if (!cyl->start.mbar)<br>
>                 return true;<br>
>         if (cyl->type.size.mliter)<br>
> -               return (float) (cyl->end.mbar - prefs.reserve_gas)       * cyl->type.size.mliter / 1000.0 > (float) cyl->deco_gas_used.mliter;<br>
> +               return cyl->end.mbar >= prefs.reserve_gas;<br>
>         else<br>
>                 return true;<br>
>  }<br>
> --<br>
> 2.4.3<br>
><br>
> _______________________________________________<br>
> subsurface mailing list<br>
><a href="mailto:subsurface@subsurface-divelog.org"> subsurface@subsurface-divelog.org</a><br>
><a href="http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface"> http://</a><a href="http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface">lists.subsurface-</a><a href="http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface">divelog.org</a><a href="http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface">/</a><a href="http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface">cgi-bin</a><a href="http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface">/mailman/</a><a href="http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface">listinfo</a><a href="http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface">/subsurface</a></p>
<p dir="ltr">//Jocke</p>