mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Show correct gas density in CCR mode
When collecting the data for the infobox, we have already computed the current partial pressures of the breathing gas taking into accoutn the divemode. Use those rather than fractions (which for CCR mode are those of diluent) to compute the gas density. Reported-by: Pietro Tranquillini <p.tranquillini@gmail.com> Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
46365b3199
commit
741099bdbb
6 changed files with 31162 additions and 31166 deletions
|
@ -83,12 +83,3 @@ double isothermal_pressure(struct gasmix gas, double p1, int volume1, int volume
|
|||
|
||||
return p_ideal * gas_compressibility_factor(gas, p_ideal);
|
||||
}
|
||||
|
||||
double gas_density(struct gasmix gas, int pressure)
|
||||
{
|
||||
int fo2 = get_o2(gas);
|
||||
int fhe = get_he(gas);
|
||||
int density = fhe * HE_DENSITY + fo2 * O2_DENSITY + (1000 - fhe - fo2) * N2_DENSITY;
|
||||
|
||||
return density * (double) pressure / gas_compressibility_factor(gas, pressure / 1000.0) / SURFACE_PRESSURE / 1000000.0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue