Releases: sinagilassi/PyThermoCalcDB
Release list
# 🚀 PyThermoCalcDB v0.6.0 Release Notes
Release Date: January 2, 2026
✨ New Features & Enhancements
🔥 Advanced Enthalpy & Entropy Calculations
This release introduces powerful new functions for thermodynamic property changes:
🧮 calc_enthalpy_change
-
Calculate the enthalpy change (
$\Delta H$ ) of a component between two temperatures. -
Supports flexible temperature and model source inputs.
-
Integrates with the existing component and model source structure.
-
Example Usage:
dEn_IG_res = calc_enthalpy_change( component=CO2_comp, model_source=model_source_, temperature_initial=temperature_ref, temperature_final=temperature_, mode='log' ) print(dEn_IG_res)
-
Enables direct evaluation of sensible heat effects for process and research applications.
🌡️ calc_entropy_change
-
Compute the entropy change (
$\Delta S$ ) for a component between two states (temperature and pressure). -
Handles phase specification and supports detailed logging.
-
Example Usage:
dS_IG_res = calc_entropy_change( component=CO2_comp, model_source=model_source_, temperature_initial=temperature_ref, temperature_final=temperature_, pressure_initial=pressure_ref, pressure_final=pressure_, phase='IG', mode='log' ) print(dS_IG_res)
-
Useful for energy balance, process simulation, and thermodynamic analysis.
🧪 Mixture Enthalpy Calculation Example
🧉 calc-hsg-mix.py Example
-
Demonstrates enthalpy calculation for a gas mixture (CO₂ and CO) at specified conditions.
-
Shows how to assign mole fractions and compute mixture enthalpy using the new API.
-
Key Steps:
- Define components and their mole fractions.
- Set temperature and pressure for the mixture.
- Call
calc_mixture_enthalpyto get the result.
-
Example Usage:
mixture_enthalpy_res = calc_mixture_enthalpy( components=mixture_components, model_source=model_source_, temperature=mixture_temperature, pressure=mixture_pressure, phase='IG', departure_enthalpy=None, excess_enthalpy=None, output_unit='kJ/mol', mode='log' ) print(mixture_enthalpy_res)
-
Great for process engineering, combustion, and multi-component system studies.
🛠️ Improvements
- Expanded example scripts for enthalpy and entropy change calculations.
- Improved documentation and usage notes in example files.
- Consistent API and parameter handling across new and existing functions.
🐞 Bug Fixes
- Minor corrections in example file references and comments.
- Enhanced error handling for input validation in new calculation functions.
📚 Documentation
- Updated docstrings and example scripts to illustrate new features.
- See
examples/calc-hsg.pyandexamples/calc-hsg-mix.pyfor practical usage.
🤝 Contributors
Thanks to all contributors for expanding the thermodynamic calculation suite!
Happy Calculating! 🧑🔬✨
🎉 PyThermoCalcDB v0.5.0 Release Notes
🔥 Major Features
🌡️ Enhanced Enthalpy Calculations
This release introduces comprehensive enthalpy calculation capabilities with support for multiple thermodynamic models:
🚀 NASA 9-Coefficient Polynomial Support
En_IG_NASA9_polynomial: Calculate ideal gas enthalpy at specific temperaturesEn_IG_NASA9_polynomial_range: Calculate enthalpy over temperature ranges with multiple data pointsdEn_IG_NASA9_polynomial: Calculate enthalpy changes between two temperatures- Full integration with temperature validation and unit conversion
📊 Shomate Equation Implementation
En_IG_shomate: High-accuracy enthalpy calculations using Shomate coefficientsEn_IG_shomate_range: Temperature range calculations for process modeling- Optimized for NIST thermodynamic data compatibility
🛰️ NASA 7-Coefficient Polynomial Support
En_IG_NASA7_polynomial: Standard NASA-7 polynomial enthalpy calculationsEn_IG_NASA7_polynomial_range: Multi-point temperature analysisdEn_IG_NASA7_polynomial: Sensible heat effect calculations- Perfect for aerospace and combustion applications
🔬 Advanced Heat Capacity Calculations
📈 Multiple Calculation Methods
Cp_IG_polynomial: General polynomial heat capacity calculations (A + BT + CT² + DT³ + E/T²)Cp_IG_NASA9_polynomial: NASA-9 coefficient implementation for high-precision workCp_IG_shomate: Shomate equation for temperature-dependent heat capacityCp_IG_NASA7_polynomial: NASA-7 standard polynomial support
🎯 Unified Calculation Interface
Cp_IG: Universal dispatcher function supporting all calculation methodsEn_IG: Universal enthalpy dispatcher for seamless method switching- Consistent API across all calculation types
⚡ Key Improvements
🛡️ Robust Error Handling
- Comprehensive input validation for all thermodynamic coefficients
- Temperature range validation with detailed error messages
- Graceful handling of calculation edge cases
🌍 Temperature Unit Support
- Automatic temperature unit conversion (K, °C, °F, R)
- Flexible output unit specification
- Built-in temperature range validation
📚 Enhanced Documentation
- Detailed docstrings with mathematical equations
- Parameter descriptions with units and ranges
- Usage examples and implementation notes
🔧 Technical Enhancements
🧮 Mathematical Accuracy
- High-precision floating-point calculations
- Optimized polynomial evaluation algorithms
- Proper handling of temperature-dependent terms
🏗️ Architecture Improvements
- Modular function design for easy integration
- Consistent return value structures
- Type hints and Optional parameter support
⚙️ Configuration Support
- Configurable universal gas constant
- Flexible output formatting options
- Optional message handling for calculation context
📦 API Reference
Core Enthalpy Functions
# NASA-9 Polynomial
En_IG_NASA9_polynomial(a1, a2, a3, a4, a5, a6, a7, b1, temperature, ...)
# Shomate Equation
En_IG_shomate(A, B, C, D, E, F, G, temperature, ...)
# NASA-7 Polynomial
En_IG_NASA7_polynomial(a1, a2, a3, a4, a5, a6, a7, temperature, ...)
# Universal Dispatcher
En_IG(method="NASA9|NASA7|Shomate", temperature=T, **coefficients)Core Heat Capacity Functions
# General Polynomial
Cp_IG_polynomial(A, B, C, D, E, temperature, ...)
# NASA Methods
Cp_IG_NASA9_polynomial(a1, a2, a3, a4, a5, a6, a7, temperature, ...)
Cp_IG_NASA7_polynomial(a1, a2, a3, a4, a5, temperature, ...)
# Shomate Equation
Cp_IG_shomate(A, B, C, D, E, temperature, ...)
# Universal Dispatcher
Cp_IG(method="NASA7|NASA9|SHOMATE", temperature=T, **coefficients)Happy Computing! 🔬✨
🚀 PyThermoCalcDB v0.4.0 Release Notes
🔥 Enthalpy Calculation Example
Calculate the ideal gas enthalpy using the NASA 9-coefficient polynomial equation.
Example:
from pythermodb_settings.models import Temperature
from pyThermoCalcDB.thermo.enthalpy import En_IG_NASA9_polynomial
from rich import print
# NASA polynomial coefficients for a hypothetical substance
a1 = 30.09200
a2 = 6.832514
a3 = 6.793435
a4 = -2.534480
a5 = 0.082139
a6 = -250.8810
a7 = 223.3967
b1 = -242.7400
temperature = Temperature(value=300.0, unit="K")
T_min = Temperature(value=200.0, unit="K")
T_max = Temperature(value=1000.0, unit="K")
temperature_range = (T_min, T_max)
result = En_IG_NASA9_polynomial(
a1=a1,
a2=a2,
a3=a3,
a4=a4,
a5=a5,
a6=a6,
a7=a7,
b1=b1,
temperature=temperature,
temperature_range=temperature_range,
output_unit="J/mol",
message="NASA enthalpy calculation successful"
)
print(result)Explanation:
This script demonstrates how to use the NASA 9-coefficient polynomial to compute the ideal gas enthalpy of a substance at a specified temperature. The result is printed in J/mol.
📚 Other Improvements
- Added a new example script for enthalpy calculation.
- Improved code comments and output formatting for clarity.
- Enhanced organization of examples for easier learning.
Thank you for using PyThermoCalcDB!
For more details, see the examples/ directory in the repository.
🚀 PyThermoCalcDB v0.3.0 Release Notes
🧪 Liquid Density Calculation Example
Calculate the liquid density of a substance using the Rackett equation.
Example:
from pyThermoCalcDB.thermo.density import rackett
from pythermodb_settings.models import (
Temperature,
Pressure,
CustomProp,
)
from rich import print
temperature = Temperature(value=350.0, unit="K")
critical_temperature = Temperature(value=500.0, unit="K")
critical_pressure = Pressure(value=40.0, unit="bar")
molecular_weight = CustomProp(value=44.01, unit="g/mol") # e.g., CO2
critical_compressibility = CustomProp(value=0.274, unit="dimensionless")
result = rackett(
temperature=temperature,
critical_temperature=critical_temperature,
critical_pressure=critical_pressure,
molecular_weight=molecular_weight,
critical_compressibility=critical_compressibility,
message="Rackett density calculation successful"
)
print(result)Explanation:
This script demonstrates how to use the Rackett equation to compute the liquid density of a substance (e.g., CO₂) at a specified temperature and pressure, using its molecular weight and critical properties.
🌡️ Heat Capacity Calculation Example
Calculate the ideal gas heat capacity using both a polynomial and NASA polynomial equation.
Example:
from pyThermoCalcDB.thermo.heat_capacity import Cp_IG_polynomial, Cp_IG_NASA_polynomial
from pythermodb_settings.models import Temperature
from rich import print
# Polynomial coefficients
A = 25.0
B = 1.0e-2
C = 2.0e-5
D = -1.0e-8
E = 0.0
temperature = Temperature(value=300.0, unit="K")
T_min = Temperature(value=200.0, unit="K")
T_max = Temperature(value=1000.0, unit="K")
temperature_range = (T_min, T_max)
result = Cp_IG_polynomial(
A=A,
B=B,
C=C,
D=D,
E=E,
temperature=temperature,
temperature_range=temperature_range,
output_unit="J/mol.K",
message="Calculation successful"
)
print(result)
# NASA polynomial coefficients
a1 = 30.09200
a2 = 6.832514
a3 = 6.793435
a4 = -2.534480
a5 = 0.082139
nasa_result = Cp_IG_NASA_polynomial(
a1=a1,
a2=a2,
a3=a3,
a4=a4,
a5=a5,
temperature=temperature,
temperature_range=temperature_range,
output_unit="J/mol.K",
message="NASA calculation successful"
)
print(nasa_result)Explanation:
This example shows how to calculate the ideal gas heat capacity for a substance at a given temperature using both a standard polynomial and NASA polynomial equations. The results are printed in J/mol·K.
📚 Other Improvements
- Added new example scripts for liquid density and heat capacity calculations.
- Improved code comments and output formatting for clarity.
- Enhanced organization of examples for easier learning.
Thank you for using PyThermoCalcDB!
For more details, see the examples/ directory in the repository.
🚀 PyThermoCalcDB v0.2.0 Release Notes
✨ What's New in v0.2.0
This release brings enhanced example scripts for thermodynamic property calculations, making it easier to use and understand the core features of PyThermoCalcDB. The examples now cover vapor pressure calculations using both the Antoine and Wagner equations, with clear, ready-to-run Python code.
💧 Antoine Vapor Pressure Example
Calculate the vapor pressure of water at a given temperature using the Antoine equation.
Example:
from pyThermoCalcDB.thermo.vapor_pressure import antoine
from pythermodb_settings.models import Temperature
from rich import print
A = 8.07131
B = 1730.63
C = 233.426
temperature = Temperature(value=100, unit='C') # 100 °C
result = antoine(
A=A,
B=B,
C=C,
temperature=temperature,
output_unit='kPa', base='log10',
message="Calculated vapor pressure for water at 100 °C"
)
if result:
print("Antoine Vapor Pressure Calculation Result:")
print(result.model_dump())Explanation:
This script demonstrates how to use the Antoine equation to compute the vapor pressure of water at 100°C. The result is printed in kPa.
🔥 Wagner Vapor Pressure Example
Compute the vapor pressure of propane using the Wagner equation, given its critical properties and constants.
Example:
from pyThermoCalcDB.thermo.vapor_pressure import wagner
from pythermodb_settings.models import Temperature, Pressure
from rich import print
A = -6.76368
B = 1.55481
C = -1.5872
D = -2.024
temperature = Temperature(value=300, unit='K')
critical_temperature = Temperature(value=369.85, unit='K')
critical_pressure = Pressure(value=4247, unit='kPa')
result = wagner(
A=A,
B=B,
C=C,
D=D,
temperature=temperature,
critical_temperature=critical_temperature,
critical_pressure=critical_pressure,
output_unit='kPa',
message="Calculated vapor pressure for Propane"
)
if result:
print("Wagner Vapor Pressure Calculation Result:")
print(result.model_dump())Explanation:
This example shows how to calculate the vapor pressure of propane at 300 K using the Wagner equation, with results output in kPa.
📚 Other Improvements
- Improved documentation and code comments in example scripts.
- Examples are now organized for easier navigation and learning.
Thank you for using PyThermoCalcDB!
For more details, see the examples/ directory in the repository.