Adsorbate#

Contains the adsorbate class.

class pygaps.core.adsorbate.Adsorbate(name: str, store: bool = False, **properties)[source]#

An unified class descriptor for an adsorbate.

Its purpose is to expose properties such as adsorbate name, and formula, as well as physical properties, such as molar mass vapour pressure, etc.

The properties can be either calculated through a wrapper over CoolProp or supplied in the initial adsorbate creation. All parameters passed are saved in a self.parameters dictionary.

Parameters:

name (str) -- The name which should be used for this adsorbate.

Other Parameters:
  • alias (list[str]) -- Other names the same adsorbate might take. Example: name=propanol, alias=['1-propanol']. pyGAPS disregards capitalisation (Propanol = propanol = PROPANOL).

  • formula (str) -- A chemical formula for the adsorbate in LaTeX form: He/N_{2}/C_{2}H_{4} etc.

  • backend_name (str) -- Used for integration with CoolProp/REFPROP. For a list of names look at the CoolProp list of fluids

  • molar_mass (float) -- Custom value for molar mass (otherwise obtained through CoolProp).

  • p_triple (float) -- Custom value for triple point pressure (otherwise obtained through CoolProp).

  • t_triple (float) -- Custom value for triple point temperature (otherwise obtained through CoolProp).

  • p_critical (float) -- Custom value for critical point pressure (otherwise obtained through CoolProp).

  • t_critical (float) -- Custom value for critical point temperature (otherwise obtained through CoolProp).

  • saturation_pressure (float) -- Custom value for saturation pressure (otherwise obtained through CoolProp).

  • surface_tension (float) -- Custom value for surface tension (otherwise obtained through CoolProp).

  • liquid_density (float) -- Custom value for liquid density (otherwise obtained through CoolProp).

  • liquid_molar_density (float) -- Custom value for liquid molar density (otherwise obtained through CoolProp).

  • gas_density (float) -- Custom value for gas density (otherwise obtained through CoolProp).

  • gas_molar_density (float) -- Custom value for gas molar density (otherwise obtained through CoolProp).

  • enthalpy_vaporisation (float) -- Custom value for enthalpy of vaporisation/liquefaction (otherwise obtained through CoolProp).

  • enthalpy_liquefaction (float) -- Custom value for enthalpy of vaporisation/liquefaction (otherwise obtained through CoolProp).

Notes

The members of the properties dictionary are left at the discretion of the user, to keep the class extensible. There are, however, some unique properties which are used by calculations in other modules listed in the other parameters section above.

These properties can be either calculated by CoolProp (if the adsorbate exists in CoolProp/REFPROP) or taken from the parameters dictionary. They are best accessed using the associated function.

Calculated:

my_adsorbate.surface_tension(77)

Value from dictionary:

my_adsorbate.surface_tension(77, calculate=False)

If available, the underlying CoolProp state object (http://www.coolprop.org/coolprop/LowLevelAPI.html) can be accessed directly through the backend variable. For example, to get the CoolProp-calculated critical pressure:

adsorbate.backend.p_critical()
properties#

Adsorbate properties

print_info()[source]#

Print a short summary of all the adsorbate parameters.

classmethod find(name: str)[source]#

Get the specified adsorbate from the master list.

Parameters:

name (str) -- The name of the adsorbate to search

Returns:

Adsorbate -- Instance of class

Raises:

ParameterError -- If it does not exist in list.

property backend#

Return the CoolProp state associated with the fluid.

property formula: str#

Return the adsorbate formula.

to_dict() dict[source]#

Return a dictionary of the adsorbate class.

Is the same dictionary that was used to create it.

Returns:

dict -- dictionary of all parameters

get_prop(prop: str)[source]#

Return a property from the 'properties' dictionary.

Parameters:

prop (str) -- property name desired

Returns:

str/float -- Value of property in the properties dict

Raises:

ParameterError -- If the the property does not exist in the class dictionary.

property backend_name: str#

Get the CoolProp interaction name of the adsorbate.

Returns:

str -- Value of backend_name in the properties dict

Raises:

ParameterError -- If the the property does not exist in the class dictionary.

molar_mass(calculate: bool = True) float[source]#

Return the molar mass of the adsorbate.

Parameters:

calculate (bool, optional) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Molar mass in g/mol.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.

p_triple(calculate: bool = True) float[source]#

Return the triple point pressure, in Pa.

Parameters:

calculate (bool, optional) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Triple point pressure in Pa.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.

t_triple(calculate: bool = True) float[source]#

Return the triple point temperature, in K.

Parameters:

calculate (bool, optional) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Triple point temperature in K.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.

p_critical(calculate: bool = True) float[source]#

Return the critical point pressure, in Pa.

Parameters:

calculate (bool, optional) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Critical point pressure in Pa.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.

t_critical(calculate: bool = True) float[source]#

Return the critical point temperature, in K.

Parameters:

calculate (bool, optional) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Critical point temperature in K.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.

pressure_saturation(temp: float, unit: str | None = None, calculate: bool = True) float[source]#

Get the saturation pressure at a particular temperature, in desired unit (default Pa).

Alias for 'saturation_pressure'

Parameters:
  • temp (float) -- Temperature at which the pressure is desired in K.

  • unit (str) -- Unit in which to return the saturation pressure. If not specifies defaults to Pascal.

  • calculate (bool, optional) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Pressure in unit requested.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.

saturation_pressure(temp: float, unit: str | None = None, calculate: bool = True) float[source]#

Get the saturation pressure at a particular temperature, in desired unit (default Pa).

Parameters:
  • temp (float) -- Temperature at which the pressure is desired in K.

  • unit (str) -- Unit in which to return the saturation pressure. If not specifies defaults to Pascal.

  • calculate (bool, optional) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Pressure in unit requested.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.

surface_tension(temp: float, calculate: bool = True) float[source]#

Get the surface tension at a particular temperature, in mN/m.

Parameters:
  • temp (float) -- Temperature at which the surface_tension is desired in K.

  • calculate (bool, optional) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Surface tension in mN/m.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.

liquid_density(temp: float, calculate: bool = True) float[source]#

Get the liquid density at a particular temperature, in g/cm3.

Parameters:
  • temp (float) -- Temperature at which the liquid density is desired in K.

  • calculate (bool, optional.) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Liquid density in g/cm3.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.

liquid_molar_density(temp: float, calculate: bool = True) float[source]#

Get the liquid molar density at a particular temperature, in mol/cm3.

Parameters:
  • temp (float) -- Temperature at which the liquid density is desired in K.

  • calculate (bool, optional.) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Molar liquid density in mol/cm3.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.

gas_density(temp: float, calculate: bool = True) float[source]#

Get the gas molar density at a particular temperature, in g/cm3.

Parameters:
  • temp (float) -- Temperature at which the gas density is desired in K.

  • calculate (bool, optional.) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Gas density in g/cm3.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.

gas_molar_density(temp: float, calculate: bool = True) float[source]#

Get the gas density at a particular temperature, in mol/cm3.

Parameters:
  • temp (float) -- Temperature at which the gas density is desired in K.

  • calculate (bool, optional.) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Molar gas density in mol/cm3.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.

enthalpy_vaporisation(temp: float | None = None, press: float | None = None, calculate: bool = True) float[source]#

Get the enthalpy of vaporisation at a particular temperature, in kJ/mol.

Parameters:
  • temp (float) -- Temperature at which the enthalpy of vaporisation is desired, in K.

  • calculate (bool, optional) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Enthalpy of vaporisation in kJ/mol.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.

enthalpy_liquefaction(temp: float | None = None, press: float | None = None, calculate: bool = True) float[source]#

Get the enthalpy of liquefaction at a particular temperature, in kJ/mol.

Parameters:
  • temp (float) -- Temperature at which the enthalpy of liquefaction is desired, in K.

  • calculate (bool, optional) -- Whether to calculate the property or look it up in the properties dictionary, default - True.

Returns:

float -- Enthalpy of liquefaction in kJ/mol.

Raises:
  • ParameterError -- If the calculation is not requested and the property does not exist in the class dictionary.

  • CalculationError -- If it cannot be calculated, due to a physical reason.