Skip to content

馃殌 PyThermoCalcDB v0.4.0 Release Notes

Choose a tag to compare

@sinagilassi sinagilassi released this 20 Dec 01:33
· 506 commits to main since this release

馃敟 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.