Changeset 52b92ee in subsurface


Ignore:
Timestamp:
Jan 28, 2015, 7:51:32 AM (3 years ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
Mtest, android_test, dcDownload, foratdotde, gitMerge, gitdebug, gitpictures, ios, master, mergeKirigamiPort, pictimeshift, resolutionIndependence, spinner, testTomaz, testing, v4.4-branch, v4.5-branch
Children:
64ef4c2
Parents:
991531d8
git-author:
Robert C. Helling <helling@…> (01/28/15 02:35:15)
git-committer:
Dirk Hohndel <dirk@…> (01/28/15 07:51:32)
Message:

Don't let the oxygen partial pressure drop below 0.

No oxygen at all is not quite enough for the average diver but this prevents
inifintie loops/extremely long deco when subsurface is used in pscr mode
with unrealistic values for pscr preferences.

Signed-off-by: Robert C. Helling <helling@…>
Signed-off-by: Dirk Hohndel <dirk@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dive.c

    rbbef887 r52b92ee  
    16841684                if (divemode == PSCR) { /* The steady state approximation should be good enough */
    16851685                        pressures->o2 = get_o2(mix) / 1000.0 * amb_pressure - (1.0 - get_o2(mix) / 1000.0) * prefs.o2consumption / (prefs.bottomsac * prefs.pscr_ratio / 1000.0);
     1686                        if (pressures->o2 < 0) // He's dead, Jim.
     1687                                pressures->o2 = 0;
    16861688                        if (get_o2(mix) != 1000) {
    16871689                                pressures->he = (amb_pressure - pressures->o2) * get_he(mix) / (1000.0 - get_o2(mix));
Note: See TracChangeset for help on using the changeset viewer.