Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weighting in excess properties done by ThermoML mole fractions rather than simulation mole fractions #575

Open
mrshirts opened this issue Sep 24, 2024 · 0 comments
Assignees

Comments

@mrshirts
Copy link

Describe the bug

What we seem to be observing is that when you compute an excess property, and you do the calculation (for enthalpy for example), then with H_mixing = <H_mixture>- (MF_0<H_0>-MF_1<H_1>), the MF_0 and MF_1 are taken from ThermoML mole fractions, but it is more accurate to take them from the actually simulated mole fractions.

In our case, the ThermoML mole fractions are 0.5098 and 0.4902, and the simulations ended up being done with 510 and 490 molecules, as that is what 509.8 and 490.2 get rounded to.

In this case, one sees that if the molar enthalpy of component 0 is -44.879 and of component 1 is 251.418, and you get a mixture enthalpy 98.855, then if you use the simulation MF, you get (0.510)*(-44.879) + (0.490)251.418 - 98.855 = -1.45153, whereas if you use the ThermoML MF, you get (0.5098)(-44.879) + (0.4902)251.418 - 98.855 = -1.511, which a difference almost about 2x than the uncertainty; this -1.511 number is what Evaluator actually returned. If the ThemoML MF had been, say 0.4904/0.5096, then you would have had a simulation of 1000 molecules still rounded to 490/510, and using the ThermoML MF would have been (0.5096)(-44.879) + (0.4904)*251.418 - 98.855 = -1.57.

I would argue that the most important thing is to use the mole fraction consistent with the mole fraction of the mixture solution actually simulated, as you want the ideal solution composition consistent with the mixture composition. The H_mix(x) is not going to change very much when changing by x by 0.002, but mismatches result in larger errors. More specifically, because the ideal components of the enthalpy are ~1-2 order of magnitude larger than the nonideal components, mismatching the ideal and nonideal solutions will give errors 1-2 orders of magnitude large than the changes in the nonideal contribution itself.

To Reproduce

Any calculation should should work to show this error, but ones with smaller numbers of molecules so the rounding will give a larger difference.

Output

No error in output log per se. We figured this out by reproducing the calculation of enthalpy and figuring out mole fraction is being used.

Computing environment (please complete the following information):

I don't specifically recall the version of Evaluator - within the last 6 months.

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants