mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Take incompressibility of gas into account at higher pressures
This creates a helper function called "gas_volume()" that takes the
cylinder and a particular pressure, and returns the estimated volume of
the gas at surface pressure, including proper approximation of the
incompressibility of gas.
It very much is an approximation, but it's closer to reality than
assuming a pure ideal gas. See for example compressibility at
http://en.wikipedia.org/wiki/Compressibility_factor
Suggested-by: Jukka Lind <jukka.lind@iki.fi>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d53bedbed6
commit
308d71ec39
5 changed files with 58 additions and 36 deletions
6
dive.h
6
dive.h
|
|
@ -203,10 +203,8 @@ static inline double bar_to_atm(double bar)
|
|||
return bar / SURFACE_PRESSURE * 1000;
|
||||
}
|
||||
|
||||
static inline double to_ATM(pressure_t pressure)
|
||||
{
|
||||
return pressure.mbar / (double) SURFACE_PRESSURE;
|
||||
}
|
||||
/* Volume in mliter of a cylinder at pressure 'p' */
|
||||
extern int gas_volume(cylinder_t *cyl, pressure_t p);
|
||||
|
||||
static inline int mbar_to_PSI(int mbar)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue