Skip to content

🚀 PyThermoCalcDB v0.2.0 Release Notes

Choose a tag to compare

@sinagilassi sinagilassi released this 19 Dec 20:07
· 525 commits to main since this release

✨ 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.