pyforfluids.models package

Module contents

Models.

Modules that contains the multiple models to estimate fluid’s properties.

Submodules

pyforfluids.models.gerg2008 module

GERG2008 EoS.

class pyforfluids.models.gerg2008.GERG2008

Bases: object

GERG2008 equation of state.

GERG2008 Equation of state described by O. Kunz and W. Wagner [1]

The components must be those of the GERG2008 model. This class use imported methods from Fortran subroutines for high speed calculation of properties.

References

1

O. Kunz and W. Wagner, “The GERG-2008 Wide-Range Equation of State for Natural Gases and Other Mixtures: An Expansion of GERG-2004”, J. Chem. Eng. Data 2012, 57, 11, 3032–3091. doi:10.1021/je300655b. https://pubs.acs.org/doi/10.1021/je300655b

Methods

validate_components:

Check if the components belong to the EOS.

validate_ranges:

Check in which range of validity are the temperature and pressure.

set_concentration:

Normalize the composition as molar fractions.

calculate_properties:

Calculate the properties.

calculate_properties(temperature, pressure, density, composition)

Calculate the thermodynamic properties of the given fluid.

Calculation of the thermodynamic properties of the fluid at it’s given temperature and density.

Parameters
temperature: float

Fluid temperature in Kelvin degrees [K]

pressure: float

Fluid pressure in Pascal [Pa]

density: float

Fluid density in mol per liter [mol/L]

composition: dict

Dictionary of the compounds concentrations as: {"methane": 0.8, "ethane":0.2} When necessary, the concentration values are normalized.

Returns
dict

Dictionary of the thermodynamic properties of the given fluid calculated with GERG2008 equation of state.

name = 'GERG2008'
set_concentration(composition)

Verify if the sum of the molar fractions of the fluid components is 1.

If not, a warninig message is sent and the composition is normalized.

Parameters
components: dict

Dictionary of the fluid compounds as keys and their molar fraction as values.

Returns
array

Array of the normalized fluid composition vector.

valid_components = {'argon', 'butane', 'carbon_dioxide', 'carbon_monoxide', 'decane', 'ethane', 'helium', 'heptane', 'hexane', 'hydrogen', 'hydrogen_sulfide', 'isobutane', 'isopentane', 'methane', 'nitrogen', 'nonane', 'octane', 'oxygen', 'pentane', 'propane', 'water'}
validate_components(components)

Validate fluid components.

Verify if the given fluid components are valid for the GERG2008 equation of state.If not, a ValueError Exception is raised.

Parameters
components: set

Set of the fluid components to be verified.

validate_ranges(temperature, pressure)

Validate fluid temperature and pressure.

Verify whether the fluid temperature and pressure values belong to the normal, extended or invalid use range of the GERG2008 equation of state. A warning menssage is sent if the temperature and pressure conditions are those of the extended or invalid range, and also if they take negative values.

Parameters
temperature: float

Fluid temperature in Kelvin degrees [K]

pressure: float

Fluid pressure in Pascal [Pa]