mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use real gas compressibility in planner
Modify formluas for gas use to take into account the compressibility correction for real gases. This introduces also the inverse formula to compute the pressure for a given amount of gas. Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
fedadc65db
commit
7725842383
3 changed files with 19 additions and 4 deletions
|
|
@ -62,3 +62,13 @@ double gas_compressibility_factor(struct gasmix *gas, double bar)
|
|||
*/
|
||||
return Z * 0.001 + 1.0;
|
||||
}
|
||||
|
||||
/* Compute the new pressure when compressing (expanding) volome v1 at pressure p1 bar to volume v2
|
||||
* taking into account the compressebility (to first order) */
|
||||
|
||||
double isothermal_pressure(struct gasmix *gas, double p1, int volume1, int volume2)
|
||||
{
|
||||
double p_ideal = p1 * volume1 / volume2 / gas_compressibility_factor(gas, p1);
|
||||
|
||||
return p_ideal * gas_compressibility_factor(gas, p_ideal);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue