CalebBell / thermo

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

Exteding the UNIFAC method to work with solid-liquid interactions? #18

Closed cinquemb closed 5 years ago

cinquemb commented 5 years ago

Sorry if this sounds wonky, but I've found interaction parameters and r's and q's for cation anion interactions with themselves and Dortmund (https://www.sciencedirect.com/science/article/pii/S0378381212004426), and added them locally to work with some of the compounds i'm trying to explore for possible eutectic points (mostly ionic halides) and I was wondering if I would also need to modify the underlying equations to account for this because from what I read around, i'm not quite sure from what I see around the web (and my formal background doesn't extend much past E&M, some organic chem, and matsci)? I guess that what I'm asking amounts to what would the error bars would look like by excluding the middle range and long range interaction components used LIFAC?

Thank you

CalebBell commented 5 years ago

Hi Cinque,

I always hate to be the bearer of bad news, but just adding 'rs' and 'qs' for electrolytes is only part of the problem. They are used in the LIFAC model; and LIFAC adds quite a bit of complexity and other terms, requiring solute-solvent interactions as well as solute-solute and solvent-solvent interactions. It would not be straight forward to add to thermo; there is no electrolyte flash in thermo at the moment either, which would be required to determine eutectic points.

What systems are you evaluating? You may be able to find literature data. I think the predictive ability of electrolyte models is quite a bit less than plain UNIFAC as well.

Sincerely, Caleb

cinquemb commented 5 years ago

HI Caleb,

Thanks for the reply. To be clear, I also added the interaction parameters (a_ij,a_ji,b_ij, c_ij) for the structural group interactions with the ions and cation-anion interactions. I think I can add the LR and MR components using the equations in the paper (assuming I can find the relevant constants for what I'm trying to explore).

Right now I'm looking at CaCl2 and MgCl2 mixtures from the solid phase to the liquid phase. When you talk about electrolyte models, are you referring to LIFAC (or LIFAC* in the paper) or other models in general?

Thanks again, Cinque

CalebBell commented 5 years ago

Hi again Cinque,

I was indeed referring to LIFAC/LIFAC*. If you can find the constants, and figure out the equations for the activity coefficients, I can try to help you find the eutectic points. I guess you're talking about a system of just those two compounds? I'm not sure why I assumed an aqueous system.

Cheers, Caleb

cinquemb commented 5 years ago

Yes, just those two compounds for now, but I may experiment with more. And I will avoid introducing any H or O into the system (in reality, i'd probably need to replace the atmosphere with Cl and use ceramics for containment).

I think I've calculated the approximate eutectic point from solid to liquid with the mix (where chemical potential of the pure + residual components are near zero for both at the same T), but it only considers the SR (since LIFAC uses the same SR as UNIFAC), and I naively was thinking that I wouldn't be too far off by excluding the MR and LR equations. If you think that adding the MR and LR equations could significantly change the results, then I'll work on writing the code going off of how things seem to be referenced in unifac.py and post it on a gist to see if it makes sense to you.

My only confusion that is blocking for me for now is that MR and LR terms require the ion components and the solvents to be computed differently, and since what I'm working on is with solids, should I only consider the ionic equations or will I need to consider both if the Tm of any of the individual solids has been hit (in which I may need to add a way to pass in the chemical compound objects so I can reference and set some of the data if needed in the calculations)?

cinquemb commented 5 years ago

I implemented the MR contribution with only considering the ion interactions, and I saw no real difference in the eutectic point with it, so I'll close this. Thank you for clearing up some things for me.