gems4/thermofun

ThermoFun is a universal open-source client that delivers thermodynamic properties of substances and reactions at the temperature and pressure of interest.

  • The library comes as a C++ and Python API for single or batch calculations

  • ThermoFun takes the input data for its calculations locally from JSON files or via (remote) access to the ThermoHub database.

  • ThermoFun graphical user interface is used for tabulating thermodynamic properties of substances or reactions.

  • Results passed in memory arrays to codes that call ThermoFun or are written in a CSV table file.

  • The library contains a collection of models and Equations Of State (EoS) for: solid, aqueous, gaseous, and melt –components Methods.

  • A certain model or EoS is not present? ThermoFun library is always extendable with new methods and EoS models. Taking advantage of the modular structure in which adding a new method should be straight forward.

How it works?

  • ThermoFun is initialized with a ThermoDataSet. A ThermoDataSet is a collection of records of substances and/or reactions also known in the (geo)chemical community as a thermodynamic database, e.g. SUPCRT98, PSI-Nagra, CEMDATA18.
  • ThermoFun can access any ThermoDataSet available in the ThermoHub database. In addition the user can provide substances and reactions records, or a ThermoDataSet from a local file in a human-readable JSON format.
  • Once ThermoFun is initialized (e.g. with SUPCRT98 ThermoDataSet) the library will provide the user with the standard state properties of a substance or list of substances (available in SUPCRT98) at given temperatures and pressures (in the interval of applicability of the model and ThermoDataSet used, e.g. 0-1000 C, 1-5000 bar, for SUPCRT98). The calculations are done by calling the appropriate models or Equations of State (EoS) for doing the temperature and pressure extrapolations from reference conditions T (298.15 K, 25 C) and P (1e05 Pa, 1 bar) to the specified T and P (e.g. HKF EoS in case of SUPCRT98 aqueous species substance records).

Questions that ThermoFun can answer

  • Which (internally consistent) datasets are available in the database?

  • What are the substances and reactions available in a certain dataset (e.g. PSI/Nagra or imported THEREDA database) for a given list of elements?

  • What are the values of selected thermodynamic properties (e.g. ∆Go, logK) of a substance or a reaction for given T and P ranges?

  • What are the thermodynamic functions/properties for a list of substances (GEM) or a list of reactions (LMA) at given T and P?