gascompressibility.pseudocritical.Piper#

class Piper[source]#

Bases: object

Class object to calculate pseudo-critical properties based on Piper’s method.

The model uses Piper’s model (1993) [1] to correlate specific gravity (\(\gamma_g\)) to pseudo-critical pressure (\(P_{pc}\)) and pseudo-critical temperature (\(T_{pc}\)). It supports corrections for acid gas fractions (\(H_2S\), \(CO_2\), and \(N2\))

Basic Usage#

Piper class object uses instance method that requires instantiation. This means you first have to initiate the object like this:

>>> from gascompressibility.pseudocritical import Piper
>>>
>>> obj = Piper()
>>> obj
<gascompressibility.pseudocritical.Piper> class object with the following calculated attributes:
{
   Tpc: None
   Ppc: None
   J: None
   K: None
   Tr: None
   Pr: None
}

Once a class instance is instantiated, you can run methods from the instantiated object:

>>> obj.calc_Pr(sg=0.7, P=2010)
3.0646766226921294

Running a method from the instantiated object updates the associated variables computed during the calculation process:

>>> obj
<gascompressibility.pseudocritical.Piper> class object with the following calculated attributes:
{
   Tpc: 371.4335560823552
   Ppc: 660.6569792741872
   J: 0.56221847
   K: 14.450840999999999
   Tr: None
   Pr: 3.0646766226921294
}

You can access the computed variables in a form of class attributes:

>>> obj.Ppc
660.6569792741872
>>> obj.Pr
3.0646766226921294

Examples#


Import

>>> from gascompressibility.pseudocritical import Piper

Direct calculation

>>> Piper().calc_Pr(sg=0.7, P=2000, H2S=0.07, CO2=0.1, N2=0.05)
2.7143160585360255

Instantiaing an object and retrieving its attribute

>>> obj = Piper()
>>> _ = obj.calc_Pr(sg=0.7, P=2000, H2S=0.07, CO2=0.1, N2=0.05)
>>> obj.Pr
2.7143160585360255

.ps_props attribute to retrieve all associated calculated pseudo-critical properties

>>> obj = Piper()
>>> _ = obj.calc_Pr(sg=0.7, P=2000, H2S=0.07, CO2=0.1, N2=0.05)
>>> obj.ps_props
{'Tpc': 359.4649612886111,
 'Ppc': 742.249596786689,
 'J': 0.48429121800104624,
 'K': 13.194154915384328,
 'Tr': None,
 'Pr': 2.7143160585360255}

More examples

>>> # pseudo-critical pressure, Ppc (psia)
>>> Piper().calc_Ppc(sg=0.7, N2=0.05, H2S=0.05, CO2=0.1)
730.6830493485268
>>> # pseudo-critical temperature, Tpc (°R)
>>> Piper().calc_Tpc(sg=0.7, N2=0.05, H2S=0.05, CO2=0.1)
357.31032650971184
>>> # Stewart-Burkhardt-VOO parameter J, (°R/psia)
>>> Piper().calc_J(sg=0.7, N2=0.05, H2S=0.05, CO2=0.1)
0.48900864311590075
>>> # Stewart-Burkhardt-VOO parameter K, (°R/psia^0.5)
>>> Piper().calc_K(sg=0.7, N2=0.05, H2S=0.05, CO2=0.1)
13.218465793646919
>>> # reduced pseudo-critical pressure, Pr (dimensionless)
>>> Piper().calc_Pr(P=2010, sg=0.7, N2=0.05, H2S=0.05, CO2=0.1)
2.770968892470151
>>> # reduced pseudo-critical temperature, Tr (dimensionless)
>>> Piper().calc_Tr(T=75, sg=0.7, N2=0.05, H2S=0.05, CO2=0.1)
1.496374328788025

Methods#


calc_J

Calculates the Stewart-Burkhardt-VOO parameter J, (°R/psia)

calc_K

Calculates the Stewart-Burkhardt-VOO parameter K, (°R/psia^0.5)

calc_Tpc

Calculates pseudo-critical temperature, Tpc (°R)

calc_Ppc

Calculates pseudo-critical pressure, Ppc (psia)

calc_Tr

Calculates pseudo-reduced temperature, Tr (dimensionless)

calc_Pr

Calculates pseudo-reduced pressure, Pr (dimensionless)

Attributes#


Attributes

sg

specific gravity (dimensionless)

T_f

temperature (°F)

T

temperature (°R)

P_g

pressure (psig)

P

pressure (psia)

H2S

mole fraction of H2S (dimensionless)

CO2

mole fraction of CO2 (dimensionless)

N2

mole fraction of N2 (dimensionless)

Tpc

pseudo-critical temperature, Tpc (°R)

Ppc

pseudo-critical pressure, Ppc (psia)

J

Stewart-Burkhardt-VOO parameter J, (°R/psia)

K

Stewart-Burkhardt-VOO parameter K, (°R/psia^0.5)

Tr

pseudo-reduced temperature, Tr (dimensionless)

Pr

pseudo-reduced pressure, Pr (dimensionless)

ps_props

dictionary of pseudo-critical properties.

References#