ClapeyronThermo / Clapeyron.jl

Clapeyron provides a framework for the development and use of fluid-thermodynamic models, including SAFT, cubic, activity, multi-parameter, and COSMO-SAC.
MIT License
198 stars 51 forks source link

Error in unlike epsilon calculations - combining rules #179

Closed michelevalsecchi closed 1 year ago

michelevalsecchi commented 1 year ago

Hello,

I found that when using SAFT-gamma Mie and some unlike interaction energies are not specified the ones used by the code (found in model.params.epsilon.values) are not the correct ones given by the combining rule eps_ij = sqrt(eps_ieps_jsigma_i^3*sigma_j^3)/sigma_ij^3. See attached example with butane where epsilon_kl (CH3-CH2) is unspecified. Find also attached the zipped databank folder. I checked that the resulting calculations are off, but the errors disappear if I calculate the correct CR epsilon_ij and specify them in the databank.

What could be causing this? SAFTgammaMie.zip Screenshot 2023-05-11 210105 Thank you in advance for the help!

longemen3000 commented 1 year ago

hmm, i have to see this. the code that calculates all the non-association parameters is found in these lines (the particular parameters of interest are gc_sigma and gc_epsilon):

https://github.com/ClapeyronThermo/Clapeyron.jl/blob/2afca1c08a500699293760239ffb7c67b9e12a2a/src/models/SAFT/SAFTgammaMie/SAFTgammaMie.jl#L98-L113

pw0908 commented 1 year ago

I just double checked Haslam et al. (2008) where they formally derive the Hudson-McCoubrey combining rule and they do use the one we have implemented. Although, in the SAFT-gamma Mie paper, they use a slightly different version where they take a sqrt of the sigma terms as you have. I'd imagine that's something you'd have to check with the authors?

We'll add both implementations to Clapeyron for now.

michelevalsecchi commented 1 year ago

Thank you both for the insight! @pw0908 In Lafitte et al. (2013) the form I highlighted comes from equating the unlike VDW constant of sutherland potentials \alpha_ij to berthelot rule on \alpha_i \alpha_j. Will the correct version be default now or should I specify it?

longemen3000 commented 1 year ago

i think that we should set this as the default, what do you think @pw0908 ? we can add a SAFTgammaMieMod that uses the old behaviour

longemen3000 commented 1 year ago

Closed in Clapeyron 0.4.11