sandlerprops.compound module

class Compound[source]

Bases: object

Chemical compound with thermophysical properties.

No: int = 0

Unique compound number

Formula: str = ''

Empirical formula

Name: str = ''

Unique compound name

Molwt: Quantity

Molecular weight

Tfp: Quantity

Triple point temperature

Tb: Quantity

Boiling point temperature

Tc: Quantity

Critical temperature

Pc: Quantity

Critical pressure

Vc: Quantity

Critical volume

Zc: float = 0.0

Critical compressibility

Omega: float = 0.0

Acentric factor

Dipm: Quantity

Dipole moment

CpA: float = 0.0

Ideal gas heat capacity coeff (J/(mol*K))

CpB: float = 0.0

Ideal gas heat capacity coeff (J/(mol*K^2))

CpC: float = 0.0

Ideal gas heat capacity coeff (J/(mol*K^3))

CpD: float = 0.0

Ideal gas heat capacity coeff (J/(mol*K^4))

dHf: Quantity

Ideal gas enthalpy of formation at 298.15 K

dGf: Quantity

Ideal gas Gibbs energy of formation at 298.15 K

Eq: int = 0

Vapor pressure equation type number

VpA: float = 0.0

Vapor pressure coeff 1

VpB: float = 0.0

Vapor pressure coeff 2

VpC: float = 0.0

Vapor pressure coeff 3

VpD: float = 0.0

Vapor pressure coeff 4

__init__(No=0, Formula='', Name='', Molwt=<factory>, Tfp=<factory>, Tb=<factory>, Tc=<factory>, Pc=<factory>, Vc=<factory>, Zc=0.0, Omega=0.0, Dipm=<factory>, CpA=0.0, CpB=0.0, CpC=0.0, CpD=0.0, dHf=<factory>, dGf=<factory>, Eq=0, VpA=0.0, VpB=0.0, VpC=0.0, VpD=0.0, Tmin=<factory>, Tmax=<factory>, Lden=0.0, Tden=<factory>, charge=0, atomset=<factory>, atomdict=<factory>, metadata=<factory>)
Parameters:
Return type:

None

Tmin: Quantity

Vapor pressure temperature range min

Tmax: Quantity

Vapor pressure temperature range max

Lden: float = 0.0

Liquid density at Tden

Tden: Quantity

Temperature at which liquid density is measured

charge: int = 0

Net charge of the compound (not in input properties set unless encoded in Formula)

atomset: set

Set of unique atom names in empirical formula

atomdict: dict

count items representing empirical formula

Type:

Dictionary of atomname

metadata: dict

Dictionary for storing any additional metadata passed from the database

get_Cp_coeffs()[source]

Get ideal gas heat capacity coefficients as dict.

Returns coefficients for: Cp = a + b*T + c*T^2 + d*T^3 where Cp is in J/(mol*K) and T is in K (dimensionless values).

Return type:

dict[str, float]

__post_init__()[source]

dictionary of atomname:count items representing empirical formula

property Cp

Returns ideal gas heat capacity coefficients as a numpy array

Cp_ideal_gas(T)[source]

Calculate ideal gas heat capacity at temperature T.

Parameters:

T (Quantity) – Temperature

Returns:

Heat capacity in J/(mol-K)

Return type:

Quantity

Cp_mean(T1, T2)[source]

Calculate mean ideal gas heat capacity between temperatures T1 and T2.

Parameters:
  • T1 (Quantity) – Lower temperature limit

  • T2 (Quantity) – Upper temperature limit

Returns:

Mean heat capacity in J/(mol-K)

Return type:

Quantity

property Pvap_est: Quantity
bankblock(B, b)[source]

bank a block into the list of blocks if it is non-empty (source: https://stackoverflow.com/users/5079316/olivier-melan%c3%a7on)

Parameters:
  • B (list) – list of blocks

  • b (list) – block to bank

blockify(bl)[source]

parse the byte_levels returned from the byte-wise de-nester into blocks, where a block is a two-element list, where first element is a block and second is an integer subscript >= 1. A “primitive” block is one in which the first element is not a list, but instead a string that indentifies a chemical element. (source: https://stackoverflow.com/users/5079316/olivier-melan%c3%a7on)

Parameters:

bl (list) – byte_levels list to parse

Returns:

list of blocks

Return type:

list

flattify(B)[source]

recursively flatten nested blocks in place (source: https://stackoverflow.com/users/5079316/olivier-melan%c3%a7on)

Parameters:

B (list) – list of blocks to flattify

Return type:

None

my_flatten(L, size=2)[source]

recursively flatten a nested list of blocks into a flat list of element:number pairs (source: https://stackoverflow.com/users/5079316/olivier-melan%c3%a7on)

Parameters:
  • L (list) – nested list of blocks to flatten

  • size (tuple, optional) – size of the element:number pairs, by default (2)

Returns:

flat list of element:number pairs

Return type:

list

reduce(L)[source]

reduce a flat list of element:number pairs into a dictionary of element:number items (source: https://stackoverflow.com/users/5079316/olivier-melan%c3%a7on)

Parameters:

L (list) – flat list of element:number pairs

Returns:

dictionary of element:number items

Return type:

dict

parse_empirical_formula(ef)[source]

parse an empirical formula into a dictionary of element:number items (source: https://stackoverflow.com/users/5079316/olivier-melan%c3%a7on)

Parameters:

ef (str) – empirical formula string

Returns:

dictionary of element:number items

Return type:

dict