aboutsummaryrefslogtreecommitdiffstats
path: root/core/gas-model.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/gas-model.c')
-rw-r--r--core/gas-model.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/gas-model.c b/core/gas-model.c
index 44c64864a..115da0356 100644
--- a/core/gas-model.c
+++ b/core/gas-model.c
@@ -86,7 +86,9 @@ double isothermal_pressure(struct gasmix gas, double p1, int volume1, int volume
double gas_density(struct gasmix gas, int pressure)
{
- int density = gas.he.permille * HE_DENSITY + gas.o2.permille * O2_DENSITY + (1000 - gas.he.permille - gas.o2.permille) * N2_DENSITY;
+ 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;
}