CalebBell / thermo

Thermodynamics and Phase Equilibrium component of Chemical Engineering Design Library (ChEDL)
MIT License
594 stars 114 forks source link

EOS mix fails to calculate at different temperatures #27

Closed ashish3493 closed 4 years ago

ashish3493 commented 4 years ago

I have been trying to play with the Nitrogen/ Methane example in your documentation. I see that changes in temperature lead to no result. Could you please help me in understanding the error and how it can be resolved. Below is the example code. It did work at T=115K, but did not work for T=200K.

import thermo as therm crit_T = [126.2, 304.2, 373.2, 190.6] crit_P = [3394387.5, 7376460.0, 8936865.0, 4600155.0] w = [0.04, 0.225, 0.1, 0.008] comp = [0.2, 0.0, 0.0, 0.8] kij = [[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]] eos = therm.SRKMIX(T=200, P=1E6, Tcs=crit_T, Pcs=crit_P, omegas=w, zs=comp, kijs=kij) print(eos.V_l, eos.fugacities_l) print(eos.V_g, eos.fugacities_g)

CalebBell commented 4 years ago

Hi, The difference is that at 115 K, the eos has two volume roots - one for a liquid and one for a vapor. At 200 K, the liquid volume root has disappeared. You can check what phases/roots are available with the "phase" attribute, which will be one if 'g', 'l', or 'l/g'. Sincerely, Caleb