PyThermo

Documentation for PyThermo.

PyThermo.SpeciesType
Species(ID::String; T=298.15, P=101325)

Creates a Species object which contains basic information such as molecular weight and the structure of the species, as well as thermodynamic and transport properties as a function of temperature and pressure. If T and P are given as non-Unitful numbers, they must have units of K and Pa.

Parameters

ID : One of the following [-]:

  • Name, in IUPAC form or common form or a synonym registered in PubChem

  • InChI name, prefixed by "InChI=1S/" or "InChI=1/"

  • InChI key, prefixed by "InChIKey="

  • PubChem CID, prefixed by "PubChem="

  • SMILES (prefix with "SMILES=" to ensure smiles parsing)

  • CAS number

T : temperature of the chemical (default 298.15 K)

P : pressure of the chemical (default 101325 Pa)

Examples

julia> He = Species("He")
Species(He, 298.1 K, 1.013e+05 Pa)

julia> density(He)
0.16352343013746262 kg m^-3

julia> using Unitful

julia> He.T = 30u"K"
30 K

julia> density(He)
1.623503007493497 kg m^-3

A wide variety of unexported properties can be accessed from the underlying Python object:

julia> SF6 = Species("SF6", P=30u"psi")
Species(SF6, 298.1 K, 2.068e+05 Pa)

julia> SF6.MW
146.055419

help?> SF6.<tab>
A                                 SGs                                __init_subclass__
API                               STEL                               __le__
Am                                STEL_source                        __lt__
Bond                              STEL_sources                       __module__
Bvirial                           S_dep_Tb_P_ref_g                   __ne__
CAS                               S_dep_Tb_Pb_g                      __new__
Capillary                         S_dep_Tb_Pb_l                      __reduce__
Carcinogen                        S_dep_ref_g                        __reduce_ex__
Carcinogen_source                 S_int_Tb_to_T_ref_g                __repr__
Carcinogen_sources                S_int_l_Tm_to_Tb                   __setattr__
[...]
source
PyThermo.MixtureType
Mixture(chemnames::Vector{String}; kwargs...)
Mixture(chemnames::Vector{Pair{String, Float64}}, kwargs...)

Creates a Mixture object which contains basic information such as molecular weight and the structure of the species, as well as thermodynamic and transport properties as a function of temperature and pressure.

The components of the mixture are specified by the names of the chemicals; the composition can be specified by providing any one of the following parameters as a keyword argument:

  • Mass fractions ws
  • Mole fractions zs
  • Liquid volume fractions (based on pure component densities) Vfls
  • Gas volume fractions (based on pure component densities) Vfgs

The composition can also be specified by providing a vector of "ID" => molefrac pairs.

Examples

julia> air = Mixture(["N2" => 0.78, "O2" => 0.21, "Ar" => 0.01])
Mixture(78% nitrogen, 21% oxygen, 1% argon, 298.1 K, 1.013e+05 Pa)

julia> soundspeed(air)
346.14659461295173 m s^-1
source

Interaction with Conda

PyThermo's Python dependencies are managed by CondaPkg.jl, which registers a project's dependencies in CondaPkg.toml (similar to Julia's Project.toml). These dependencies are installed automatically in a shared Conda environment located at ~/.julia/conda_environments/Thermo when PyThermo is first loaded. If you'd like to use a different Conda environment, you can set the corresponding preference as described in the CondaPkg.jl documentation.