Computing standard thermodynamic properties of species

Computing standard thermodynamic properties of species

Written by Allan Leal (ETH Zurich) on Jan 20th, 2022

This tutorial demonstrates the use of Reaktoro for the computation of standard thermodynamic properties of chemical species such as:

  • the standard molar Gibbs energy, \(G_i^\circ\)

  • the standard molar Helmholtz energy, \(A_i^\circ\)

  • the standard molar enthalpy, \(H_i^\circ\)

  • the standard molar internal energy, \(U_i^\circ\)

  • the standard molar entropy, \(S_i^\circ\)

  • the standard molar volume, \(V_i^\circ\)

  • the standard molar heat capacity (constant pressure), \(C_{P,i}^\circ\)

  • the standard molar heat capacity (constant volume), \(C_{V,i}^\circ\)

Let’s start with the use of the SUPCRTBL database [Zimmer et al., 2016] to compute the standard thermodynamic properties of the following chemical species:

  • CO2(aq)

  • CO2(g)

  • Calcite

from reaktoro import *

db = SupcrtDatabase("supcrtbl")

CO2g    = db.species("CO2(g)")
CO2aq   = db.species("CO2(aq)")
calcite = db.species("Calcite")

We can now use method props in the Species class to compute the standard thermodynamic properties of these species at 60 °C and 100 bar:

print("STANDARD THERMODYNAMIC PROPERTIES OF CO2(G) AT 60 °C AND 100 BAR")
print(CO2g.props(60, "C", 100, "bar"))

print("STANDARD THERMODYNAMIC PROPERTIES OF CO2(AQ) AT 60 °C AND 100 BAR")
print(CO2aq.props(60, "C", 100, "bar"))

print("STANDARD THERMODYNAMIC PROPERTIES OF CALCITE AT 60 °C AND 100 BAR")
print(calcite.props(60, "C", 100, "bar"))
STANDARD THERMODYNAMIC PROPERTIES OF CO2(G) AT 60 °C AND 100 BAR
+------------------------------------------+--------------+-------------+
| Property                                 |        Value |        Unit |
+------------------------------------------+--------------+-------------+
| Temperature                              |     333.1500 |           K |
| Pressure                                 |     100.0000 |         bar |
| Standard Gibbs Energy                    | -401903.8491 |       J/mol |
| Standard Enthalpy                        | -392185.8844 |       J/mol |
| Standard Volume                          |   0.0000e+00 |      m3/mol |
| Standard Volume (Temperature Derivative) |   0.0000e+00 |  m3/(mol*K) |
| Standard Volume (Pressure Derivative)    |   0.0000e+00 | m3/(mol*Pa) |
| Standard Isobaric Heat Capacity          |      38.5567 |   J/(mol*K) |
| Standard Isochoric Heat Capacity         |      38.5567 |   J/(mol*K) |
| Standard Internal Energy                 | -392185.8844 |       J/mol |
| Standard Entropy                         |      29.1699 |   J/(mol*K) |
| Standard Helmholtz Energy                | -401903.8491 |       J/mol |
+------------------------------------------+--------------+-------------+
STANDARD THERMODYNAMIC PROPERTIES OF CO2(AQ) AT 60 °C AND 100 BAR
+------------------------------------------+--------------+-------------+
| Property                                 |        Value |        Unit |
+------------------------------------------+--------------+-------------+
| Temperature                              |     333.1500 |           K |
| Pressure                                 |     100.0000 |         bar |
| Standard Gibbs Energy                    | -390193.0956 |       J/mol |
| Standard Enthalpy                        | -405930.2842 |       J/mol |
| Standard Volume                          |   3.4348e-05 |      m3/mol |
| Standard Volume (Temperature Derivative) |   3.3100e-08 |  m3/(mol*K) |
| Standard Volume (Pressure Derivative)    |  -2.6256e-14 | m3/(mol*Pa) |
| Standard Isobaric Heat Capacity          |     203.7696 |   J/(mol*K) |
| Standard Isochoric Heat Capacity         |     189.8677 |   J/(mol*K) |
| Standard Internal Energy                 | -406273.7618 |       J/mol |
| Standard Entropy                         |     -47.2375 |   J/(mol*K) |
| Standard Helmholtz Energy                | -390536.5732 |       J/mol |
+------------------------------------------+--------------+-------------+
STANDARD THERMODYNAMIC PROPERTIES OF CALCITE AT 60 °C AND 100 BAR
+------------------------------------------+---------------+-------------+
| Property                                 |         Value |        Unit |
+------------------------------------------+---------------+-------------+
| Temperature                              |      333.1500 |           K |
| Pressure                                 |      100.0000 |         bar |
| Standard Gibbs Energy                    | -1132633.9220 |       J/mol |
| Standard Enthalpy                        | -1204550.4226 |       J/mol |
| Standard Volume                          |    3.6918e-05 |      m3/mol |
| Standard Volume (Temperature Derivative) |    0.0000e+00 |  m3/(mol*K) |
| Standard Volume (Pressure Derivative)    |    0.0000e+00 | m3/(mol*Pa) |
| Standard Isobaric Heat Capacity          |       86.9803 |   J/(mol*K) |
| Standard Isochoric Heat Capacity         |       86.9803 |   J/(mol*K) |
| Standard Internal Energy                 | -1204919.6039 |       J/mol |
| Standard Entropy                         |     -215.8682 |   J/(mol*K) |
| Standard Helmholtz Energy                | -1133003.1033 |       J/mol |
+------------------------------------------+---------------+-------------+

Now let’s calculate the standard thermodynamic properties of CO2(aq) from 25 to 300 °C along the saturation pressure of water. The code block below will build a Python dictionary containing data that we will plot later (i.e., the standard molar Gibbs energy and standard molar enthalpy of the species CO2(aq) and the temperatures used to calculate these properties):

import numpy as np

temperatures = np.linspace(25.0, 300.0, 100) + 273.15  # in K

data = { "T": [], "G0": [], "H0": [] }

for T in temperatures:
    P = waterSaturationPressureWagnerPruss(T)   # in Pa
    props = CO2aq.props(T, P)
    data["T" ].append(float(T - 273.15))        # in °C
    data["G0"].append(float(props.G0 * 0.001))  # in kJ/mol
    data["H0"].append(float(props.H0 * 0.001))  # in kJ/mol

Tip

You might also be interested in other methods for calculating the thermodynamic properties of water besides waterSaturationPressureWagnerPruss, which implements the water saturation pressure equation in Wagner and Pruss [2002]. Below are other methods available in Reaktoro:

  • waterDensityHGK

  • waterDensityWagnerPruss

  • waterLiquidDensityHGK

  • waterLiquidDensityWagnerPruss

  • waterVaporDensityHGK

  • waterVaporDensityWagnerPruss

  • waterPressureHGK

  • waterPressureWagnerPruss

  • waterSaturationPressureWagnerPruss

  • waterSaturationLiquidDensityWagnerPruss

  • waterSaturationVapourDensityWagnerPruss

  • waterThermoPropsHGK

  • waterThermoPropsWagnerPruss

Search for these method names in Reaktoro’s API Reference to learn more about how to use them.

We’ll use the bokeh plotting library next. First, we need to import it and initialize it to work with Jupyter Notebooks:

from bokeh.plotting import figure, show
from bokeh.models import HoverTool
from bokeh.io import output_notebook
output_notebook()
Loading BokehJS ...

We can now define our interactive plot:

hovertool = HoverTool()
hovertool.tooltips = [("Temperature", "@T °C"), ("G°,CO2(aq)", "@G0 kJ/mol"), ("H°,CO2(aq)", "@H0 kJ/mol")]

p = figure(
    title="STANDARD THERMODYNAMIC PROPERTIES OF CO2(AQ)\nALONG WATER SATURATION PRESSURE", 
    x_axis_label='TEMPERATURE [°C]', 
    y_axis_label=r"",
    sizing_mode="scale_width")

p.add_tools(hovertool)

p.line("T", "G0", source=data, legend_label="G°,CO2(aq)", line_width=5, line_cap="round", line_color="midnightblue")
p.line("T", "H0", source=data, legend_label="H°,CO2(aq)", line_width=5, line_cap="round", line_color="orange")

show(p)

That’s it - you can repeat the same process with any other database in Reaktoro (not just SUPCRTBL!). In the next section, we will learn how to calculate the thermodynamic properties of reactions. Keep reading!