mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Helper function for partial pressure calculation
This patch introduces a new structure holding partial pressures (doubles in bar) for all three gases and a helper function to compute them from gasmix (which holds fractions) and ambient pressure. Currentlty this works for OC and CCR, to be extended later to PSCR. Currently the dive_comp_type argument is unused. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ae6b0468b1
commit
d6abb739d9
8 changed files with 61 additions and 60 deletions
5
dive.h
5
dive.h
|
|
@ -115,6 +115,11 @@ static inline int get_he(const struct gasmix *mix)
|
|||
return mix->he.permille;
|
||||
}
|
||||
|
||||
struct gas_pressures {
|
||||
double o2, n2, he;
|
||||
};
|
||||
|
||||
extern void fill_pressures(struct gas_pressures *pressures, const double amb_pressure, const struct gasmix *mix, double po2, const enum dive_comp_type type);
|
||||
extern void sanitize_gasmix(struct gasmix *mix);
|
||||
extern int gasmix_distance(const struct gasmix *a, const struct gasmix *b);
|
||||
extern struct gasmix *get_gasmix_from_event(struct event *ev);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue