comparison src/p2_deco.c @ 522:4d70a93b18cb

BUGFIX: Impossible fixed-ppO2 (e.g. 1,6bar in 3m) used for tissue calculations
author heinrichsweikamp
date Fri, 04 Aug 2017 16:19:50 +0200
parents 06e9370c6d75
children 015b7fdd90a7
comparison
equal deleted inserted replaced
521:06e9370c6d75 522:4d70a93b18cb
961 // Note: PPO2 and ratios are known outside the lumbs, so there is no 961 // Note: PPO2 and ratios are known outside the lumbs, so there is no
962 // ppWater in the equations below: 962 // ppWater in the equations below:
963 deco_diluent -= const_ppO2; 963 deco_diluent -= const_ppO2;
964 deco_diluent /= calc_N2_ratio + calc_He_ratio; 964 deco_diluent /= calc_N2_ratio + calc_He_ratio;
965 965
966 if (deco_diluent > temp_deco)
967 deco_diluent = temp_deco;
968 } 966 }
969 967
970 if( deco_diluent > ppWater ) 968 if( deco_diluent > ppWater )
971 { 969 {
972 ppN2 = calc_N2_ratio * (deco_diluent - ppWater); 970 ppN2 = calc_N2_ratio * (deco_diluent - ppWater);
1181 1179
1182 pres_diluent -= const_ppO2; 1180 pres_diluent -= const_ppO2;
1183 pres_diluent /= N2_ratio + He_ratio; 1181 pres_diluent /= N2_ratio + He_ratio;
1184 if( pres_diluent < 0.0 ) 1182 if( pres_diluent < 0.0 )
1185 pres_diluent = 0.0; 1183 pres_diluent = 0.0;
1186 if( pres_diluent > pres_respiration )
1187 pres_diluent = pres_respiration;
1188 1184
1189 char_O_diluent = (unsigned char)(pres_diluent/pres_respiration*100.0 + 0.5); 1185 char_O_diluent = (unsigned char)(pres_diluent/pres_respiration*100.0 + 0.5);
1190 1186
1191 if( flush_ppO2 > 2.545) flush_ppO2 = 2.55; 1187 if( flush_ppO2 > 2.545) flush_ppO2 = 2.55;
1192 if( flush_ppO2 < 0.0 ) flush_ppO2 = 0.0; 1188 if( flush_ppO2 < 0.0 ) flush_ppO2 = 0.0;