-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Dear Gustavo,
I hope you are doing great! I am trying to use your really cool package phasepy to calculate some LLEs. I have parameters for both NRTL and UNIQUAC. However, I am not able to reproduce the LLE data points from either of those models using phasepy.
For instance, I have the following info from a binary LLE:
- Compound 1: METHANE, TETRACHLORO
- r1 = 3.39
- q1 = 2.91
- Compound 2: CYCLOHEXANE, METHYL, PERFLUORO
- r2 = 7.0735
- q2 = 6.44
- a12_uniquac = 37.21 @ T=278.15
- a21_uniquac = 155.16 @ T=278.15
- T: 278.15 K
- At this conditions, the LLE compositions should be:
- x1 in phase 1 = 0.295
- x1 in phase 2 = 0.9478
Notice that the expected equilibrium compositions should match exactly the prediction from UNIQUAC because they are smoothed values from UNIQUAC predictions, and correspond to a single-solution Gibbs energy of mixing curve. I got all the data from Vol. 5 of the DECHEMA Chemistry data series. I am able to reproduce the expected equilibrium compositions with my inhouse implementation of UNIQUAC and by solving the isoactivity criterion. However, my implementation depends a lot on the initial guesses of the compositions. This is the reason why I am trying phasepy as I discovered that many of these things have been coded already by you.
I copy my current code here:
from phasepy import component, mixture, virialgamma
from phasepy.equilibrium import lle, lle_init
methane_tetrachloro = component(name='methane_tetrachloro', ri=3.39, qi=2.91)
cyclohexane_methyl_perfluoro = component(name='cyclohexane_methyl_perfluoro', ri=7.0735, qi=6.44)
mix = mixture(methane_tetrachloro, cyclohexane_methyl_perfluoro)
a0 = np.array([[0, 37.21],
[155.16, 0]])
a1 = np.array([[0, 0],
[0, 0]])
mix.uniquac(a0, a1)
phase_equilibrium_model = virialgamma(mix, virialmodel='ideal_gas', actmodel='uniquac')
T = 278.15 # K
P = 1.01325 # bar
x0_ref = np.array([0.29, .9])
x0_I, x0_II = lle_init(x0_ref, T, P, phase_equilibrium_model)
LLE = lle(x0_I, x0_II, x0_ref, T, P, phase_equilibrium_model, full_output=True)
x_I_eq, x_II_eq = LLE.X
Would you mind taking a look at my code and see whether I am doing something wrong? I hope you find sometime to help me with this problem...I am super happy to contribute back to phasepy whatever I implement.Thank you so much Gustavo!