comparison src/p2_deco.c @ 602:ab88a7e3de94

2.98 release
author heinrichsweikamp
date Mon, 27 Aug 2018 09:40:31 +0200
parents 66334c6adcf6
children ca4556fb60b9
comparison
equal deleted inserted replaced
601:08a0162d3ca1 602:ab88a7e3de94
1310 O2_ppO2 = (pres_diluent - ppWater); 1310 O2_ppO2 = (pres_diluent - ppWater);
1311 1311
1312 // capture failure condition in case pres_respiration is < ppWater (should never happen...) 1312 // capture failure condition in case pres_respiration is < ppWater (should never happen...)
1313 if( O2_ppO2 < 0.0 ) O2_ppO2 = 0.0; 1313 if( O2_ppO2 < 0.0 ) O2_ppO2 = 0.0;
1314 1314
1315 // calculate ppO2 of the pure gas (diluent) 1315 // calculate ppO2 of the pure gas (OC, diluent)
1316 OC_ppO2 = O2_ppO2 * calc_O2_ratio; 1316 OC_ppO2 = O2_ppO2 * calc_O2_ratio;
1317 1317
1318 // calculate pSCR ppO2 1318 // calculate pSCR ppO2
1319 pSCR_ppO2 = OC_ppO2 - calc_pSCR_drop; 1319 pSCR_ppO2 = OC_ppO2 - calc_pSCR_drop;
1320 1320
1359 ppO2 = const_ppO2; 1359 ppO2 = const_ppO2;
1360 } 1360 }
1361 1361
1362 // adjust diluent pressure (ppN2 + ppHe) for change 1362 // adjust diluent pressure (ppN2 + ppHe) for change
1363 // in ppO2 due to setpoint (CCR) or drop (pSCR) 1363 // in ppO2 due to setpoint (CCR) or drop (pSCR)
1364 pres_diluent -= const_ppO2; 1364 pres_diluent -= ppO2;
1365 pres_diluent /= calc_N2_ratio + calc_He_ratio; 1365 pres_diluent /= calc_N2_ratio + calc_He_ratio;
1366 1366
1367 // capture all failure conditions, including div/0 1367 // capture all failure conditions, including div/0
1368 // in case diluent is pure O2 1368 // in case diluent is pure O2
1369 if( (pres_diluent < 0.0) || (calc_O2_ratio > 99.5) ) 1369 if( (pres_diluent < 0.0) || (calc_O2_ratio > 99.5) )