mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
gas pressures: do not use gas compressibility for cylinder naming
This actually didn't make a difference for the common case, since our simplified gas compressibility model had a compressibility factor of 1.0 up to 200 bar, and increased smoothly from there. As a result, the common 2400 and 3000 psi workpressures didn't really see an effect from this. Not taking compressibility into account does kind of make sense for cylinder naming, since the cylinder may be used for different gases with very different compressibility characteristics. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
82c003c914
commit
7ebc31c1ec
1 changed files with 11 additions and 4 deletions
|
@ -973,10 +973,15 @@ void sanitize_gasmix(struct gasmix *mix)
|
|||
/*
|
||||
* See if the size/workingpressure looks like some standard cylinder
|
||||
* size, eg "AL80".
|
||||
*
|
||||
* NOTE! We don't take compressibility into account when naming
|
||||
* cylinders. That makes a certain amount of sense, since the
|
||||
* cylinder name is independent from the gasmix, and different
|
||||
* gasmixes have different compressibility.
|
||||
*/
|
||||
static void match_standard_cylinder(cylinder_type_t *type)
|
||||
{
|
||||
double cuft;
|
||||
double cuft, bar;
|
||||
int psi, len;
|
||||
const char *fmt;
|
||||
char buffer[40], *p;
|
||||
|
@ -985,8 +990,9 @@ static void match_standard_cylinder(cylinder_type_t *type)
|
|||
if (type->description)
|
||||
return;
|
||||
|
||||
bar = type->workingpressure.mbar / 1000.0;
|
||||
cuft = ml_to_cuft(type->size.mliter);
|
||||
cuft *= surface_volume_multiplier(type->workingpressure);
|
||||
cuft *= bar_to_atm(bar);
|
||||
psi = to_PSI(type->workingpressure);
|
||||
|
||||
switch (psi) {
|
||||
|
@ -1040,10 +1046,11 @@ static void sanitize_cylinder_type(cylinder_type_t *type)
|
|||
return;
|
||||
|
||||
if (xml_parsing_units.volume == CUFT) {
|
||||
double bar = type->workingpressure.mbar / 1000.0;
|
||||
/* confusing - we don't really start from ml but millicuft !*/
|
||||
volume_of_air = cuft_to_l(type->size.mliter);
|
||||
/* milliliters at 1 atm: "true size" */
|
||||
volume = volume_of_air / surface_volume_multiplier(type->workingpressure);
|
||||
/* milliliters at 1 atm: not corrected for compressibility! */
|
||||
volume = volume_of_air / bar_to_atm(bar);
|
||||
type->size.mliter = rint(volume);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue