π New Feature: Component ThermoDB Builders
Two new functions have been introduced in pyThermoDB
to simplify the creation of thermodynamic databases for individual or multiple chemical components.
πΉ build_component_thermodb
Creates a ThermoDB
instance for a single component using a custom reference. This allows the user to extract and organize properties such as:
- Ideal gas heat capacity
- Vapor pressure
- General component data (e.g., critical properties, molecular weight)
Example:
thermodb = ptdb.build_component_thermodb(
component_name='carbon dioxide',
property_source={
'heat-capacity': {'databook': 'CUSTOM-REF-1', 'table': 'Ideal-Gas-Molar-Heat-Capacity'},
'vapor-pressure': {'databook': 'CUSTOM-REF-1', 'table': 'Vapor-Pressure'},
'general': {'databook': 'CUSTOM-REF-1', 'table': 'General-Data'},
},
custom_reference=ref
)
πΉ build_components_thermodb
Builds a ThermoDB for multiple components at once. This is especially useful for initializing matrix-based data like binary interaction parameters (e.g., NRTL parameters).
Example:
thermodb_multi = ptdb.build_components_thermodb(
component_names=['ethanol', 'methanol'],
property_source={
'nrtl': {'databook': 'CUSTOM-REF-1', 'table': 'NRTL Non-randomness parameters-2'}
},
custom_reference=ref
)