BioSTEAMDevelopmentGroup / thermosteam

BioSTEAM's Premier Thermodynamic Engine
Other
57 stars 12 forks source link

Mixed phase for mixture calculations #37

Closed dhkblaszyk closed 3 years ago

dhkblaszyk commented 3 years ago

Extending on bug #34, please consider the example mentioned below:

from thermosteam import Mixture
mixture = Mixture.from_chemicals(['Water', 'Dextrose'])
mixture.get_property('rho', 'g/L', 'l', [0.2, 0.8], 350, 101325)

When using the phase 'l', Dextrose defaults to the "wrong" density as mentioned before. How to manage this in the best way? Ideally, I would like to calculate with water 'l' and dextrose 'd'. Or is, in this case, the correlation for liquid Dextrose just at fault, and should that be fixed instead?

yoelcortes commented 3 years ago

Hi, I would suggest you keep using the 'l' phase. Dissolved substances are liquids with strong stabilizing interactions with the solvent, but still technically liquids. Using the 'l' phase has the advantage that you can also use the liquid viscosity model, which may be good models (tho you may want to validate this with data).

>>> from thermosteam import *
>>> # Use 1600 g/L as density
>>> Dextrose= Chemical('Dextrose')
>>> Dextrose.V.l.add_model(Dextrose.V('s', 298.15, 101325), top_priority=True)
>>> # Calculate mixture density 
>>> mixture = Mixture.from_chemicals(['Water', Dextrose])
>>> mixture.get_property('rho', 'kg/m3', 'l', [0.8, .2], 350, 101325) # Note that composition is given on a molar basis
1350.36
>>> # Plot viscosity models
>>> import matplotlib as plt
>>> Dextrose.mu.l.plot_models_vs_T([298.15, 400])
>>> plt.show()

Figure_1

yoelcortes commented 3 years ago

I tried evaluating the viscosity of mixture, but seems like it is underestimated... You can check page 8 for properties of glucose solutions at 20C: http://chemistry.mdma.ch/hiveboard/rhodium/pdf/chemical-data/prop_aq.pdf

In any case, due to stabilizing interaction between glucose and water, ideal mixture models may not present good values (even if you have seemingly correct values for individual components) due to non-linear relationships with composition and temperature.