Featured Post

Site Navigation is in the Left Column

Friday, October 22, 2021

Library to Calculate the State of Water

At first, this seemed pretty simple.  After a few days working on it, it has become more complex. The scope of the library has creeped a bit.  Since I was finding myself writing a lot of code to do this, I decided to expand the scope to include scientific measurements.

The library has 2 modes:  a simple mode and a complex mode.  While in simple mode, it will return a simple answer in terms of SOLID, LIQUID, or GAS.

While in complex mode, it will return all known states of water including Ice I, Ice II, Ice III, Ice IV, Ice V, Ice VI, Ice VII, Ice VIII, Ice IX, Ice X, Ice XI, Ice XII, Ice XIII, Ice XIV, Ice XV, GAS, LIQUID, SUPER CRITICAL, SUBCRITICAL GAS, SUBCRITICAL LIQUID.

Additionally, the library will return hits on all triple points and phase lines appropriately.

You simply give it a temperature and pressure and the library will tell you what phase the water is in.

I currently have about 1/3 of the state-transition diagram programmed.  I will need to research some of the more exotic Ice phases to get it complete.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.