PyThermoCalcDB 🚀
PyThermoCalcDB is a thermodynamic calculation layer built on PyThermoDB and PyThermoLinkDB. It wraps curated equations and data into quick helpers for enthalpy, Gibbs energy, entropy, vapor pressure, and reaction energetics.
What you get ðŸ§
- 🔌 Uses ThermoDB pickle sources through PyThermoLinkDB
ModelSource. - 🧱 Typed inputs from
pythermodb_settings(Component,Temperature,Pressure,CustomProp). - 💧 Helper modules for pure components, mixtures, saturation/phase-change, and reactions.
Install ðŸ›
Quickstart âš¡
- 🗂 Collect ThermoDB pickle paths for the components you care about.
- 🧠Build a
ModelSourcewithpyThermoLinkDB.load_and_build_model_source. - 🎯 Call helpers from
pythermocalcdb.docs.thermoorpythermocalcdb.docs.sat.
import os
import pyThermoLinkDB as ptdblink
from pyThermoLinkDB.models import ModelSource
from pythermodb_settings.models import Component, ComponentRule, ComponentThermoDBSource, Temperature, Pressure
from pythermocalcdb.docs import thermo, sat
CO2 = Component(name="carbon dioxide", formula="CO2", state="g")
thermodb_dir = "/path/to/thermodb"
CO2_src = ComponentThermoDBSource(
component=CO2,
source=os.path.join(thermodb_dir, "carbon dioxide-g.pkl"),
)
model_source: ModelSource = ptdblink.load_and_build_model_source(
thermodb_sources=[CO2_src],
original_equation_label=False
)
T = Temperature(value=300.0, unit="K")
P = Pressure(value=101325.0, unit="Pa")
enthalpy = thermo.calc_En(
component=CO2,
model_source=model_source,
temperature=T,
)
Pvap = sat.calc_VaPr(
component=CO2,
model_source=model_source,
temperature=T,
)
Tsat = sat.calc_T_sat(
component=CO2,
model_source=model_source,
pressure=P,
temperature_guess=T,
)
print(enthalpy)
print(Pvap)
print(Tsat)
Helper modules ðŸ›
| Area | Module | Highlights |
|---|---|---|
| Thermodynamic properties | pythermocalcdb.docs.thermo |
enthalpy/Gibbs at a temperature or range, enthalpy and entropy changes, mixture enthalpy with optional departure/excess terms |
| Saturation & phase change | pythermocalcdb.docs.sat |
vapor pressure, enthalpy of vaporization, saturated temperature solving, vapor-pressure sensitivity |
| Reactions | pythermocalcdb.reactions.reactions |
standard reaction enthalpy and Gibbs free energy from stoichiometry |
Next steps 👉
- See
docs.mdfor the full method reference and signatures. - Skim
examples.mdto pick the script that matches your use case.