Chemical Constants and Correlations (thermo.chemical_package)¶
This module contains classes for storing data and objects which are necessary for doing thermodynamic calculations. The intention for these classes is to serve as an in-memory storage layer between the disk and methods which do full thermodynamic calculations.
For reporting bugs, adding feature requests, or submitting pull requests, please use the GitHub issue tracker.
Chemical Constants Class¶
- class thermo.chemical_package.ChemicalConstantsPackage(CASs=None, names=None, MWs=None, Tms=None, Tbs=None, Tcs=None, Pcs=None, Vcs=None, omegas=None, Zcs=None, rhocs=None, rhocs_mass=None, Hfus_Tms=None, Hfus_Tms_mass=None, Hvap_Tbs=None, Hvap_Tbs_mass=None, Vml_STPs=None, rhol_STPs=None, rhol_STPs_mass=None, Vml_60Fs=None, rhol_60Fs=None, rhol_60Fs_mass=None, Vmg_STPs=None, rhog_STPs=None, rhog_STPs_mass=None, Hfgs=None, Hfgs_mass=None, Gfgs=None, Gfgs_mass=None, Sfgs=None, Sfgs_mass=None, S0gs=None, S0gs_mass=None, Hf_STPs=None, Hf_STPs_mass=None, Tts=None, Pts=None, Hsub_Tts=None, Hsub_Tts_mass=None, Hcs=None, Hcs_mass=None, Hcs_lower=None, Hcs_lower_mass=None, Tflashs=None, Tautoignitions=None, LFLs=None, UFLs=None, TWAs=None, STELs=None, Ceilings=None, Skins=None, Carcinogens=None, legal_statuses=None, economic_statuses=None, GWPs=None, ODPs=None, logPs=None, Psat_298s=None, Hvap_298s=None, Hvap_298s_mass=None, Vml_Tms=None, rhos_Tms=None, Vms_Tms=None, rhos_Tms_mass=None, sigma_STPs=None, sigma_Tbs=None, sigma_Tms=None, RIs=None, RI_Ts=None, conductivities=None, conductivity_Ts=None, charges=None, dipoles=None, Stockmayers=None, molecular_diameters=None, Van_der_Waals_volumes=None, Van_der_Waals_areas=None, Parachors=None, StielPolars=None, atomss=None, atom_fractions=None, similarity_variables=None, phase_STPs=None, solubility_parameters=None, PubChems=None, formulas=None, smiless=None, InChIs=None, InChI_Keys=None, aliases=None, UNIFAC_groups=None, UNIFAC_Dortmund_groups=None, PSRK_groups=None, UNIFAC_Rs=None, UNIFAC_Qs=None)[source]¶
Class for storing efficiently chemical constants for a group of components. This is intended as a base object from which a set of thermodynamic methods can access miscellaneous for purposes such as phase identification or initialization.
- Parameters
- N
int
Number of components in the package, [-].
- cmps
range
Iterator over all components, [-].
- atom_fractions
list
[dict
] Breakdown of each component into its elemental fractions, as a dict, [-].
- atomss
list
[dict
] Breakdown of each component into its elements and their counts, as a dict, [-].
- Carcinogens
list
[dict
] Status of each component in cancer causing registries, [-].
- CASs
list
[str
] CAS registration numbers for each component, [-].
- Ceilings
list
[tuple
[(float
,str
)]] Ceiling exposure limits to chemicals (and their units; ppm or mg/m^3), [various].
- charges
list
[float
] Charge number (valence) for each component, [-].
- conductivities
list
[float
] Electrical conductivities for each component, [S/m].
- conductivity_Ts
list
[float
] Temperatures at which the electrical conductivities for each component were measured, [K].
- dipoles
list
[float
] Dipole moments for each component, [debye].
- economic_statuses
list
[dict
] Status of each component in in relation to import and export from various regions, [-].
- formulas
list
[str
] Formulas of each component, [-].
- Gfgs
list
[float
] Ideal gas standard molar Gibbs free energy of formation for each component, [J/mol].
- Gfgs_mass
list
[float
] Ideal gas standard Gibbs free energy of formation for each component, [J/kg].
- GWPs
list
[float
] Global Warming Potentials for each component (impact/mass chemical)/(impact/mass CO2), [-].
- Hcs
list
[float
] Higher standard molar heats of combustion for each component, [J/mol].
- Hcs_mass
list
[float
] Higher standard heats of combustion for each component, [J/kg].
- Hcs_lower
list
[float
] Lower standard molar heats of combustion for each component, [J/mol].
- Hcs_lower_mass
list
[float
] Lower standard heats of combustion for each component, [J/kg].
- Hfgs
list
[float
] Ideal gas standard molar enthalpies of formation for each component, [J/mol].
- Hfgs_mass
list
[float
] Ideal gas standard enthalpies of formation for each component, [J/kg].
- Hfus_Tms
list
[float
] Molar heats of fusion for each component at their respective melting points, [J/mol].
- Hfus_Tms_mass
list
[float
] Heats of fusion for each component at their respective melting points, [J/kg].
- Hsub_Tts
list
[float
] Heats of sublimation for each component at their respective triple points, [J/mol].
- Hsub_Tts_mass
list
[float
] Heats of sublimation for each component at their respective triple points, [J/kg].
- Hvap_298s
list
[float
] Molar heats of vaporization for each component at 298.15 K, [J/mol].
- Hvap_298s_mass
list
[float
] Heats of vaporization for each component at 298.15 K, [J/kg].
- Hvap_Tbs
list
[float
] Molar heats of vaporization for each component at their respective normal boiling points, [J/mol].
- Hvap_Tbs_mass
list
[float
] Heats of vaporization for each component at their respective normal boiling points, [J/kg].
- InChI_Keys
list
[str
] InChI Keys for each component, [-].
- InChIs
list
[str
] InChI strings for each component, [-].
- legal_statuses
list
[dict
] Status of each component in in relation to import and export rules from various regions, [-].
- LFLs
list
[float
] Lower flammability limits for each component, [-].
- logPs
list
[float
] Octanol-water partition coefficients for each component, [-].
- molecular_diameters
list
[float
] Lennard-Jones molecular diameters for each component, [angstrom].
- MWs
list
[float
] Molecular weights for each component, [g/mol].
- names
list
[str
] Names for each component, [-].
- aliases
list
[str
] Aliases for each component, [-].
- ODPs
list
[float
] Ozone Depletion Potentials for each component (impact/mass chemical)/(impact/mass CFC-11), [-].
- omegas
list
[float
] Acentric factors for each component, [-].
- Parachors
list
[float
] Parachors for each component, [N^0.25*m^2.75/mol].
- Pcs
list
[float
] Critical pressures for each component, [Pa].
- phase_STPs
list
[str
] Standard states (‘g’, ‘l’, or ‘s’) for each component, [-].
- Psat_298s
list
[float
] Vapor pressures for each component at 298.15 K, [Pa].
- PSRK_groups
list
[dict
] PSRK subgroup: count groups for each component, [-].
- Pts
list
[float
] Triple point pressures for each component, [Pa].
- PubChems
list
[int
] Pubchem IDs for each component, [-].
- rhocs
list
[float
] Molar densities at the critical point for each component, [mol/m^3].
- rhocs_mass
list
[float
] Densities at the critical point for each component, [kg/m^3].
- rhol_STPs
list
[float
] Molar liquid densities at STP for each component, [mol/m^3].
- rhol_STPs_mass
list
[float
] Liquid densities at STP for each component, [kg/m^3].
- RIs
list
[float
] Refractive indexes for each component, [-].
- RI_Ts
list
[float
] Temperatures at which the refractive indexes were reported for each component, [K].
- S0gs
list
[float
] Ideal gas absolute molar entropies at 298.15 K at 1 atm for each component, [J/(mol*K)].
- S0gs_mass
list
[float
] Ideal gas absolute entropies at 298.15 K at 1 atm for each component, [J/(kg*K)].
- Sfgs
list
[float
] Ideal gas standard molar entropies of formation for each component, [J/(mol*K)].
- Sfgs_mass
list
[float
] Ideal gas standard entropies of formation for each component, [J/(kg*K)].
- solubility_parameters
list
[float
] Solubility parameters for each component at 298.15 K, [Pa^0.5].
- similarity_variables
list
[float
] Similarity variables for each component, [mol/g].
- Skins
list
[bool] Whether each compound can be absorbed through the skin or not, [-].
- smiless
list
[str
] SMILES identifiers for each component, [-].
- STELs
list
[tuple
[(float
,str
)]] Short term exposure limits to chemicals (and their units; ppm or mg/m^3), [various].
- StielPolars
list
[float
] Stiel polar factors for each component, [-].
- Stockmayers
list
[float
] Lennard-Jones Stockmayer parameters (depth of potential-energy minimum over k) for each component, [K].
- Tautoignitions
list
[float
] Autoignition temperatures for each component, [K].
- Tbs
list
[float
] Boiling temperatures for each component, [K].
- Tcs
list
[float
] Critical temperatures for each component, [K].
- Tms
list
[float
] Melting temperatures for each component, [K].
- Tflashs
list
[float
] Flash point temperatures for each component, [K].
- Tts
list
[float
] Triple point temperatures for each component, [K].
- TWAs
list
[tuple
[(float
,str
)]] Time-weighted average exposure limits to chemicals (and their units; ppm or mg/m^3), [various].
- UFLs
list
[float
] Upper flammability limits for each component, [-].
- UNIFAC_Dortmund_groups
list
[dict
] UNIFAC_Dortmund_group: count groups for each component, [-].
- UNIFAC_groups
list
[dict
] UNIFAC_group: count groups for each component, [-].
- UNIFAC_Rs
list
[float
] UNIFAC R parameters for each component, [-].
- UNIFAC_Qs
list
[float
] UNIFAC Q parameters for each component, [-].
- Van_der_Waals_areas
list
[float
] Unnormalized Van der Waals areas for each component, [m^2/mol].
- Van_der_Waals_volumes
list
[float
] Unnormalized Van der Waals volumes for each component, [m^3/mol].
- Vcs
list
[float
] Critical molar volumes for each component, [m^3/mol].
- Vml_STPs
list
[float
] Liquid molar volumes for each component at STP, [m^3/mol].
- Vml_Tms
list
[float
] Liquid molar volumes for each component at their respective melting points, [m^3/mol].
- Vms_Tms
list
[float
] Solid molar volumes for each component at their respective melting points, [m^3/mol].
- Vml_60Fs
list
[float
] Liquid molar volumes for each component at 60 °F, [m^3/mol].
- rhos_Tms
list
[float
] Solid molar densities for each component at their respective melting points, [mol/m^3].
- rhol_60Fs
list
[float
] Liquid molar densities for each component at 60 °F, [mol/m^3].
- rhol_60Fs_mass
list
[float
] Liquid mass densities for each component at 60 °F, [kg/m^3].
- rhos_Tms_mass
list
[float
] Solid mass densities for each component at their melting point, [kg/m^3].
- Zcs
list
[float
] Critical compressibilities for each component, [-].
- n_atoms
int
Number of total atoms in a collection of 1 molecule of each species, [-].
- water_index
int
Index of water in the package, [-].
- Vmg_STPs
list
[float
] Gas molar volumes for each component at STP; metastable if normally another state, [m^3/mol].
- rhog_STPs
list
[float
] Molar gas densities at STP for each component; metastable if normally another state, [mol/m^3].
- rhog_STPs_mass
list
[float
] Gas densities at STP for each component; metastable if normally another state, [kg/m^3].
- sigma_STPs
list
[float
] Liquid-air surface tensions at 298.15 K and the higher of 101325 Pa or the saturation pressure, [N/m].
- sigma_Tms
list
[float
] Liquid-air surface tensions at the melting point and 101325 Pa, [N/m].
- sigma_Tbs
list
[float
] Liquid-air surface tensions at the normal boiling point and 101325 Pa, [N/m].
- Hf_STPs
list
[float
] Standard state molar enthalpies of formation for each component, [J/mol].
- Hf_STPs_mass
list
[float
] Standard state mass enthalpies of formation for each component, [J/kg].
- N
Notes
All parameters are also attributes.
Examples
Create a package with water and the xylenes, suitable for use with equations of state:
>>> ChemicalConstantsPackage(MWs=[18.01528, 106.165, 106.165, 106.165], names=['water', 'o-xylene', 'p-xylene', 'm-xylene'], omegas=[0.344, 0.3118, 0.324, 0.331], Pcs=[22048320.0, 3732000.0, 3511000.0, 3541000.0], Tcs=[647.14, 630.3, 616.2, 617.0]) ChemicalConstantsPackage(MWs=[18.01528, 106.165, 106.165, 106.165], names=['water', 'o-xylene', 'p-xylene', 'm-xylene'], omegas=[0.344, 0.3118, 0.324, 0.331], Pcs=[22048320.0, 3732000.0, 3511000.0, 3541000.0], Tcs=[647.14, 630.3, 616.2, 617.0])
Methods
as_json
([cache, option])Method to create a JSON friendly serialization of the chemical constants package which can be stored, and reloaded later.
constants_from_IDs
(IDs)Method to construct a new ChemicalConstantsPackage with loaded parameters from the chemicals library, using whatever default methods and values happen to be in that library.
Method to construct a new PropertyCorrelationsPackage with loaded parameters from the chemicals library, using whatever default methods and values happen to be in that library.
from_IDs
(IDs)Method to construct a new ChemicalConstantsPackage and PropertyCorrelationsPackage with loaded parameters from the chemicals library, using whatever default methods and values happen to be in that library.
from_json
(json_repr[, cache])Method to create a ChemicalConstantsPackage from a JSON serialization of another ChemicalConstantsPackage.
subset
([idxs, properties])Method to construct a new ChemicalConstantsPackage that removes all components not specified in the idxs argument.
with_new_constants
(**kwargs)Method to construct a new ChemicalConstantsPackage that replaces or adds one or more properties for all components.
- __add__(b)[source]¶
Method to create a new
ChemicalConstantsPackage
object from two otherChemicalConstantsPackage
objects.- Returns
- new
ChemicalConstantsPackage
New object, [-]
- new
Examples
>>> a = ChemicalConstantsPackage.constants_from_IDs(IDs=['water', 'hexane']) >>> b = ChemicalConstantsPackage.constants_from_IDs(IDs=['toluene']) >>> c = a + b
- as_json(cache=None, option=0)[source]¶
Method to create a JSON friendly serialization of the chemical constants package which can be stored, and reloaded later.
- Returns
- json_repr
dict
Json friendly representation, [-]
- json_repr
Examples
>>> import json >>> constants = ChemicalConstantsPackage(MWs=[18.01528, 106.165], names=['water', 'm-xylene']) >>> string = json.dumps(constants.as_json())
- static constants_from_IDs(IDs)[source]¶
Method to construct a new ChemicalConstantsPackage with loaded parameters from the chemicals library, using whatever default methods and values happen to be in that library. Expect values to change over time.
- Parameters
- IDs
list
[str
] Identifying strings for each compound; most identifiers are accepted and all inputs are documented in
chemicals.identifiers.search_chemical
, [-]
- IDs
- Returns
- constants
ChemicalConstantsPackage
New ChemicalConstantsPackage with loaded values, [-]
- constants
Notes
Warning
chemicals is a project with a focus on collecting data and correlations from various sources. In no way is it a project to critically evaluate these and provide recommendations. You are strongly encouraged to check values from it and modify them if you want different values. If you believe there is a value which has a typographical error please report it to the chemicals project. If data is missing or not as accuracte as you would like, and you know of a better method or source, new methods and sources can be added to chemicals fairly easily once the data entry is complete.
Examples
>>> constants = ChemicalConstantsPackage.constants_from_IDs(IDs=['water', 'hexane'])
- static correlations_from_IDs(IDs)[source]¶
Method to construct a new PropertyCorrelationsPackage with loaded parameters from the chemicals library, using whatever default methods and values happen to be in that library. Expect values to change over time.
- Parameters
- IDs
list
[str
] Identifying strings for each compound; most identifiers are accepted and all inputs are documented in
chemicals.identifiers.search_chemical
, [-]
- IDs
- Returns
- correlations
PropertyCorrelationsPackage
New PropertyCorrelationsPackage with loaded values, [-]
- correlations
Notes
Warning
chemicals is a project with a focus on collecting data and correlations from various sources. In no way is it a project to critically evaluate these and provide recommendations. You are strongly encouraged to check values from it and modify them if you want different values. If you believe there is a value which has a typographical error please report it to the chemicals project. If data is missing or not as accuracte as you would like, and you know of a better method or source, new methods and sources can be added to chemicals fairly easily once the data entry is complete.
Examples
>>> correlations = ChemicalConstantsPackage.constants_from_IDs(IDs=['ethanol', 'methanol'])
- static from_IDs(IDs)[source]¶
Method to construct a new ChemicalConstantsPackage and PropertyCorrelationsPackage with loaded parameters from the chemicals library, using whatever default methods and values happen to be in that library. Expect values to change over time.
- Parameters
- IDs
list
[str
] Identifying strings for each compound; most identifiers are accepted and all inputs are documented in
chemicals.identifiers.search_chemical
, [-]
- IDs
- Returns
- constants
PropertyCorrelationsPackage
New PropertyCorrelationsPackage with loaded values, [-]
- correlations
PropertyCorrelationsPackage
New PropertyCorrelationsPackage with loaded values, [-]
- constants
Notes
Warning
chemicals is a project with a focus on collecting data and correlations from various sources. In no way is it a project to critically evaluate these and provide recommendations. You are strongly encouraged to check values from it and modify them if you want different values. If you believe there is a value which has a typographical error please report it to the chemicals project. If data is missing or not as accuracte as you would like, and you know of a better method or source, new methods and sources can be added to chemicals fairly easily once the data entry is complete.
Examples
>>> constants, correlations = ChemicalConstantsPackage.from_IDs(IDs=['water', 'decane'])
- classmethod from_json(json_repr, cache=None)[source]¶
Method to create a ChemicalConstantsPackage from a JSON serialization of another ChemicalConstantsPackage.
- Parameters
- json_repr
dict
Json representation, [-]
- json_repr
- Returns
- constants
ChemicalConstantsPackage
Newly created object from the json serialization, [-]
- constants
Notes
It is important that the input be in the same format as that created by
ChemicalConstantsPackage.as_json
.Examples
>>> import json >>> constants = ChemicalConstantsPackage(MWs=[18.01528, 106.165], names=['water', 'm-xylene']) >>> string = json.dumps(constants.as_json()) >>> new_constants = ChemicalConstantsPackage.from_json(json.loads(string)) >>> assert hash(new_constants) == hash(constants)
- properties = ('atom_fractions', 'atomss', 'Carcinogens', 'CASs', 'Ceilings', 'charges', 'conductivities', 'dipoles', 'economic_statuses', 'formulas', 'Gfgs', 'Gfgs_mass', 'GWPs', 'Hcs', 'Hcs_lower', 'Hcs_lower_mass', 'Hcs_mass', 'Hfgs', 'Hfgs_mass', 'Hfus_Tms', 'Hfus_Tms_mass', 'Hsub_Tts', 'Hsub_Tts_mass', 'Hvap_298s', 'Hvap_298s_mass', 'Hvap_Tbs', 'Hvap_Tbs_mass', 'InChI_Keys', 'InChIs', 'legal_statuses', 'LFLs', 'logPs', 'molecular_diameters', 'MWs', 'names', 'aliases', 'ODPs', 'omegas', 'Parachors', 'Pcs', 'phase_STPs', 'Psat_298s', 'PSRK_groups', 'Pts', 'PubChems', 'rhocs', 'rhocs_mass', 'rhol_STPs', 'rhol_STPs_mass', 'RIs', 'S0gs', 'S0gs_mass', 'Sfgs', 'Sfgs_mass', 'similarity_variables', 'Skins', 'smiless', 'STELs', 'StielPolars', 'Stockmayers', 'Tautoignitions', 'Tbs', 'Tcs', 'Tflashs', 'Tms', 'Tts', 'TWAs', 'UFLs', 'UNIFAC_Dortmund_groups', 'UNIFAC_groups', 'Van_der_Waals_areas', 'Van_der_Waals_volumes', 'Vcs', 'Vml_STPs', 'Vml_Tms', 'Zcs', 'UNIFAC_Rs', 'UNIFAC_Qs', 'rhos_Tms', 'Vms_Tms', 'rhos_Tms_mass', 'solubility_parameters', 'Vml_60Fs', 'rhol_60Fs', 'rhol_60Fs_mass', 'conductivity_Ts', 'RI_Ts', 'Vmg_STPs', 'rhog_STPs', 'rhog_STPs_mass', 'sigma_STPs', 'sigma_Tms', 'sigma_Tbs', 'Hf_STPs', 'Hf_STPs_mass')¶
Tuple of all properties that can be held by this object.
- subset(idxs=None, properties=None)[source]¶
Method to construct a new ChemicalConstantsPackage that removes all components not specified in the idxs argument. Although this class has a great many attributes, it is often sufficient to work with a subset of those properties; and if a list of properties is provided, only those properties will be added to the new object as well.
- Parameters
- Returns
- subset_consts
ChemicalConstantsPackage
Object with reduced properties and or components, [-]
- subset_consts
Notes
It is not intended for properties to be edited in this object! One optimization is that all entirely empty properties use the same list-of-Nones.
All properties should have been specified before constructing the first ChemicalConstantsPackage.
Examples
>>> base = ChemicalConstantsPackage(MWs=[18.01528, 106.165, 106.165, 106.165], names=['water', 'o-xylene', 'p-xylene', 'm-xylene'], omegas=[0.344, 0.3118, 0.324, 0.331], Pcs=[22048320.0, 3732000.0, 3511000.0, 3541000.0], Tcs=[647.14, 630.3, 616.2, 617.0]) >>> base.subset([0]) ChemicalConstantsPackage(MWs=[18.01528], names=['water'], omegas=[0.344], Pcs=[22048320.0], Tcs=[647.14]) >>> base.subset(slice(1,4)) ChemicalConstantsPackage(MWs=[106.165, 106.165, 106.165], names=['o-xylene', 'p-xylene', 'm-xylene'], omegas=[0.3118, 0.324, 0.331], Pcs=[3732000.0, 3511000.0, 3541000.0], Tcs=[630.3, 616.2, 617.0]) >>> base.subset(idxs=[0, 3], properties=('names', 'MWs')) ChemicalConstantsPackage(MWs=[18.01528, 106.165], names=['water', 'm-xylene'])
- with_new_constants(**kwargs)[source]¶
Method to construct a new ChemicalConstantsPackage that replaces or adds one or more properties for all components.
- Parameters
- Returns
- new_constants
ChemicalConstantsPackage
Object with new and/or replaced properties, [-]
- new_constants
Examples
>>> base = ChemicalConstantsPackage(MWs=[18.01528, 106.165, 106.165, 106.165], names=['water', 'o-xylene', 'p-xylene', 'm-xylene'], omegas=[0.344, 0.3118, 0.324, 0.331], Pcs=[22048320.0, 3732000.0, 3511000.0, 3541000.0], Tcs=[647.14, 630.3, 616.2, 617.0]) >>> base.with_new_constants(Tms=[40.0, 20.0, 10.0, 30.0], omegas=[0.0, 0.1, 0.2, 0.3]) ChemicalConstantsPackage(MWs=[18.01528, 106.165, 106.165, 106.165], names=['water', 'o-xylene', 'p-xylene', 'm-xylene'], omegas=[0.0, 0.1, 0.2, 0.3], Pcs=[22048320.0, 3732000.0, 3511000.0, 3541000.0], Tcs=[647.14, 630.3, 616.2, 617.0], Tms=[40.0, 20.0, 10.0, 30.0])
Chemical Correlations Class¶
- class thermo.chemical_package.PropertyCorrelationsPackage(constants, VaporPressures=None, SublimationPressures=None, VolumeGases=None, VolumeLiquids=None, VolumeSolids=None, HeatCapacityGases=None, HeatCapacityLiquids=None, HeatCapacitySolids=None, ViscosityGases=None, ViscosityLiquids=None, ThermalConductivityGases=None, ThermalConductivityLiquids=None, ThermalConductivitySolids=None, EnthalpyVaporizations=None, EnthalpySublimations=None, SurfaceTensions=None, PermittivityLiquids=None, VolumeGasMixtureObj=None, VolumeLiquidMixtureObj=None, VolumeSolidMixtureObj=None, HeatCapacityGasMixtureObj=None, HeatCapacityLiquidMixtureObj=None, HeatCapacitySolidMixtureObj=None, ViscosityGasMixtureObj=None, ViscosityLiquidMixtureObj=None, ThermalConductivityGasMixtureObj=None, ThermalConductivityLiquidMixtureObj=None, SurfaceTensionMixtureObj=None, skip_missing=False)[source]¶
Class for creating and storing T and P and zs dependent chemical property objects. All parameters are also attributes.
This object can be used either to hold already-created property objects; or to create new ones and hold them.
- Parameters
- constants
ChemicalConstantsPackage
Object holding all constant properties, [-]
- VaporPressures
list
[thermo.vapor_pressure.VaporPressure
],optional
Objects holding vapor pressure data and methods, [-]
- SublimationPressures
list
[thermo.vapor_pressure.SublimationPressure
],optional
Objects holding sublimation pressure data and methods, [-]
- VolumeGases
list
[thermo.volume.VolumeGas
],optional
Objects holding gas volume data and methods, [-]
- VolumeLiquids
list
[thermo.volume.VolumeLiquid
],optional
Objects holding liquid volume data and methods, [-]
- VolumeSolids
list
[thermo.volume.VolumeSolid
],optional
Objects holding solid volume data and methods, [-]
- HeatCapacityGases
list
[thermo.heat_capacity.HeatCapacityGas
],optional
Objects holding gas heat capacity data and methods, [-]
- HeatCapacityLiquids
list
[thermo.heat_capacity.HeatCapacityLiquid
],optional
Objects holding liquid heat capacity data and methods, [-]
- HeatCapacitySolids
list
[thermo.heat_capacity.HeatCapacitySolid
],optional
Objects holding solid heat capacity data and methods, [-]
- ViscosityGases
list
[thermo.viscosity.ViscosityGas
],optional
Objects holding gas viscosity data and methods, [-]
- ViscosityLiquids
list
[thermo.viscosity.ViscosityLiquid
],optional
Objects holding liquid viscosity data and methods, [-]
- ThermalConductivityGases
list
[thermo.thermal_conductivity.ThermalConductivityGas
],optional
Objects holding gas thermal conductivity data and methods, [-]
- ThermalConductivityLiquids
list
[thermo.thermal_conductivity.ThermalConductivityLiquid
],optional
Objects holding liquid thermal conductivity data and methods, [-]
- ThermalConductivitySolids
list
[thermo.thermal_conductivity.ThermalConductivitySolid
],optional
Objects holding solid thermal conductivity data and methods, [-]
- EnthalpyVaporizations
list
[thermo.phase_change.EnthalpyVaporization
],optional
Objects holding enthalpy of vaporization data and methods, [-]
- EnthalpySublimations
list
[thermo.phase_change.EnthalpySublimation
],optional
Objects holding enthalpy of sublimation data and methods, [-]
- SurfaceTensions
list
[thermo.interface.SurfaceTension
],optional
Objects holding surface tension data and methods, [-]
- PermittivityLiquids
list
[thermo.permittivity.PermittivityLiquid
],optional
Objects holding permittivity data and methods, [-]
- skip_missingbool,
optional
If False, any properties not provided will have objects created; if True, no extra objects will be created.
- VolumeSolidMixture
thermo.volume.VolumeSolidMixture
,optional
Predictor object for the volume of solid mixtures, [-]
- VolumeLiquidMixture
thermo.volume.VolumeLiquidMixture
,optional
Predictor object for the volume of liquid mixtures, [-]
- VolumeGasMixture
thermo.volume.VolumeGasMixture
,optional
Predictor object for the volume of gas mixtures, [-]
- HeatCapacityLiquidMixture
thermo.heat_capacity.HeatCapacityLiquidMixture
,optional
Predictor object for the heat capacity of liquid mixtures, [-]
- HeatCapacityGasMixture
thermo.heat_capacity.HeatCapacityGasMixture
,optional
Predictor object for the heat capacity of gas mixtures, [-]
- HeatCapacitySolidMixture
thermo.heat_capacity.HeatCapacitySolidMixture
,optional
Predictor object for the heat capacity of solid mixtures, [-]
- ViscosityLiquidMixture
thermo.viscosity.ViscosityLiquidMixture
,optional
Predictor object for the viscosity of liquid mixtures, [-]
- ViscosityGasMixture
thermo.viscosity.ViscosityGasMixture
,optional
Predictor object for the viscosity of gas mixtures, [-]
- ThermalConductivityLiquidMixture
thermo.thermal_conductivity.ThermalConductivityLiquidMixture
,optional
Predictor object for the thermal conductivity of liquid mixtures, [-]
- ThermalConductivityGasMixture
thermo.thermal_conductivity.ThermalConductivityGasMixture
,optional
Predictor object for the thermal conductivity of gas mixtures, [-]
- SurfaceTensionMixture
thermo.interface.SurfaceTensionMixture
,optional
Predictor object for the surface tension of liquid mixtures, [-]
- constants
Examples
Create a package from CO2 and n-hexane, with ideal-gas heat capacities provided while excluding all other properties:
>>> constants = ChemicalConstantsPackage(CASs=['124-38-9', '110-54-3'], MWs=[44.0095, 86.17536], names=['carbon dioxide', 'hexane'], omegas=[0.2252, 0.2975], Pcs=[7376460.0, 3025000.0], Tbs=[194.67, 341.87], Tcs=[304.2, 507.6], Tms=[216.65, 178.075]) >>> correlations = PropertyCorrelationsPackage(constants=constants, skip_missing=True, HeatCapacityGases=[HeatCapacityGas(poly_fit=(50.0, 1000.0, [-3.1115474168865828e-21, 1.39156078498805e-17, -2.5430881416264243e-14, 2.4175307893014295e-11, -1.2437314771044867e-08, 3.1251954264658904e-06, -0.00021220221928610925, 0.000884685506352987, 29.266811602924644])), HeatCapacityGas(poly_fit=(200.0, 1000.0, [1.3740654453881647e-21, -8.344496203280677e-18, 2.2354782954548568e-14, -3.4659555330048226e-11, 3.410703030634579e-08, -2.1693611029230923e-05, 0.008373280796376588, -1.356180511425385, 175.67091124888998]))])
Create a package from various data files, creating all property objects:
>>> correlations = PropertyCorrelationsPackage(constants=constants, skip_missing=False)
Methods
subset
(idxs)Method to construct a new PropertyCorrelationsPackage that removes all components not specified in the idxs argument.
- __add__(b)[source]¶
Method to create a new
PropertyCorrelationsPackage
object from two otherPropertyCorrelationsPackage
objects.- Returns
- new
PropertyCorrelationsPackage
New object, [-]
- new
Examples
>>> a = ChemicalConstantsPackage.correlations_from_IDs(IDs=['water', 'hexane']) >>> b = ChemicalConstantsPackage.correlations_from_IDs(IDs=['toluene']) >>> c = a + b
- subset(idxs)[source]¶
Method to construct a new PropertyCorrelationsPackage that removes all components not specified in the idxs argument.
- Parameters
- Returns
- subset_correlations
PropertyCorrelationsPackage
Object with components, [-]
- subset_correlations
Sample Constants and Correlations¶
- thermo.chemical_package.iapws_constants = ChemicalConstantsPackage(atomss=[{'H': 2, 'O': 1}], CASs=['7732-18-5'], Gfgs=[-228554.325], Hfgs=[-241822.0], MWs=[18.015268], names=['water'], omegas=[0.344], Pcs=[22064000.0], Pts=[611.654771008], Sfgs=[-44.5], Tcs=[647.096], Tts=[273.16])¶
ChemicalConstantsPackage
: Object intended to hold the IAPWS-95 water constants for use with thethermo.phases.IAPWS95
phase object.
- thermo.chemical_package.iapws_correlations = PropertyCorrelationsPackage(HeatCapacityGases=[HeatCapacityGas(extrapolation="linear", method="POLY_FIT", poly_fit=(50.0, 1000.0, [5.543665000518528e-22, -2.403756749600872e-18, 4.2166477594350336e-15, -3.7965208514613565e-12, 1.823547122838406e-09, -4.3747690853614695e-07, 5.437938301211039e-05, -0.003220061088723078, 33.32731489750759]))], SublimationPressures=[SublimationPressure(CASRN="7732-18-5", extrapolation="Arrhenius", method="IAPWS")], SurfaceTensions=[SurfaceTension(Tc=647.14, extrapolation="DIPPR106_AB", method="EXP_POLY_FIT_LN_TAU", exp_poly_fit_ln_tau=(248.14999999999998, 643.9043, 647.14, [-2.8494246663280267e-05, -0.0007642770215779117, -0.0087879657158058, -0.056840919106152674, -0.22915223013722677, -0.607083777358256, -1.0946692428934923, -0.08982641235684152, -2.383855224250596]))], constants=ChemicalConstantsPackage(atomss=[{'H': 2, 'O': 1}], CASs=['7732-18-5'], Gfgs=[-228554.325], Hfgs=[-241822.0], MWs=[18.015268], names=['water'], omegas=[0.344], Pcs=[22064000.0], Pts=[611.654771008], Sfgs=[-44.5], Tcs=[647.096], Tts=[273.16]), skip_missing=True)¶
PropertyCorrelationsPackage
: IAPWS correlations and properties, [-]
- thermo.chemical_package.lemmon2000_constants = ChemicalConstantsPackage(CASs=['132259-10-0'], MWs=[28.9586], omegas=[0.0335], Pcs=[3785020.0], Tcs=[132.6312])¶
ChemicalConstantsPackage
: Object intended to hold the Lemmon (2000) air constants for use with thethermo.phases.DryAirLemmon
phase object.
- thermo.chemical_package.lemmon2000_correlations = PropertyCorrelationsPackage(HeatCapacityGases=[HeatCapacityGas(extrapolation="linear", method="POLY_FIT", poly_fit=(132.6313, 2000.0, [-6.626125905505976e-57, 1.3834500819751098e-52, -1.33739947283832e-48, 7.939514061796618e-45, -3.2364291450043207e-41, 9.594346367764268e-38, -2.13653752371752e-34, 3.6389955418840433e-31, -4.779579487030328e-28, 4.842352128842408e-25, -3.7575972075674665e-22, 2.2015407920080106e-19, -9.545492841183412e-17, 3.0147537523176223e-14, -7.116946884523906e-12, 1.4112957512038422e-09, -2.416177742609162e-07, 3.041947869442721e-05, -0.0022420811935852042, 29.099089803167224]))], constants=ChemicalConstantsPackage(CASs=['132259-10-0'], MWs=[28.9586], omegas=[0.0335], Pcs=[3785020.0], Tcs=[132.6312]), skip_missing=True)¶
PropertyCorrelationsPackage
: Lemmon (2000) air correlations and properties, [-]