A new package, Thermath, for the automatic implementation of thermodynamic models was developed in the Mathematica® programming language. Starting from an excess Gibbs free energy (G(E)) model or an equation of state (EOS), Thermath can be used to derive expressions for several thermodynamic properties and to analyze the structure of these expressions, generating a code that implements them in a computer language (Fortran77 is used in this paper). Using the package, procedures that implement properties derived from commonly used G(E) models could be rapidly generated. For EOSs, two situations occurred. Properties from simple EOSs could be readily derived and implemented. For more complex EOS, lengthy expressions may result, and their analysis can be very demanding in terms of computer time. To overcome this difficulty, a strategy to split this problem in tasks of feasible computational demand is presented. Although the applications of this paper deal with the implementation of thermodynamic models, most of the procedures developed here can possibly be used to implement models in other fields of science and engineering.
- Equations of state
- Thermodynamic models
ASJC Scopus subject areas
- Chemical Engineering(all)
- Computer Science Applications