comparison Common/Src/decom.c @ 129:239aa58b533d FlipDisplay

Added function to initialise structures with the actual ambient pressure
author Ideenmodellierer
date Sun, 17 Feb 2019 21:14:09 +0100
parents e941c9e49f73
children 1b995079c045
comparison
equal deleted inserted replaced
128:c78bcbd5deda 129:239aa58b533d
404 pLifeData->cns = 0; 404 pLifeData->cns = 0;
405 pLifeData->desaturation_time_minutes = 0; 405 pLifeData->desaturation_time_minutes = 0;
406 pLifeData->no_fly_time_minutes = 0; 406 pLifeData->no_fly_time_minutes = 0;
407 } 407 }
408 408
409 void decom_reset_with_ambientmbar(float ambient, SLifeData * pLifeData)
410 {
411
412 float saturation = 1.0;
413 saturation = ambient;
414 saturation -= WATER_VAPOUR_PRESSURE;
415 saturation *= FRACTION_N2_AIR;
416
417 for(int i=0;i<16;i++)
418 {
419 pLifeData->tissue_nitrogen_bar[i] = saturation;
420 pLifeData->tissue_helium_bar[i] = 0;
421 }
422 pLifeData->otu = 0;
423 pLifeData->cns = 0;
424 pLifeData->desaturation_time_minutes = 0;
425 pLifeData->no_fly_time_minutes = 0;
426 }
409 427
410 /* =============================================================================== */ 428 /* =============================================================================== */
411 /* NOTE ABOUT PRESSURE UNITS USED IN CALCULATIONS: */ 429 /* NOTE ABOUT PRESSURE UNITS USED IN CALCULATIONS: */
412 /* It is the convention in decompression calculations to compute all gas */ 430 /* It is the convention in decompression calculations to compute all gas */
413 /* loadings, absolute pressures, partial pressures, etc., in the units of */ 431 /* loadings, absolute pressures, partial pressures, etc., in the units of */