I am experimenting with a Python library called thermo
. I'm interested in obtaining the thermal properties, specifically the enthalpy, of a mixture consisting of water, sucrose, calcium carbonate, and calcium hydroxide, each in different phases. I attempted to use the following code for finding the enthalpy, but it returns 'None.' Could it be because 'thermo' doesn't support solids, or am I doing something wrong?"
from thermo.chemical import Chemical
from thermo.mixture import Mixture
# Define the components of the mixture
water = Chemical('water')
calcium_carbonate = Chemical('calcium carbonate')
sucrose = Chemical('sucrose')
calcium_hydroxide = Chemical('calcium hydroxide')
# Define the mole fractions of each component
x_water = 0.4 #liquid
x_CaCO3 = 0.2 #solid
x_sucrose = 0.3 #disolved
x_CaOH = 0.1
# Define the temperature and pressure of the mixture
T = 30 # degC
P = 4.0 # bar
# Create a Mixture object and add the components
mixture = Mixture([water.formula, calcium_carbonate.formula, sucrose.formula,
calcium_hydroxide.formula],
zs=[x_water, x_CaCO3, x_sucrose, x_CaOH],T=T+273.15, P=P*101300)
# Calculate the enthalpy of the mixture
H_mix = mixture.H
print(H_mix) <-Returns None