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

Fix the handling of association records in combination with induced association in PC-SAFT #264

Merged
merged 2 commits into from
Dec 18, 2024

Conversation

prehner
Copy link
Contributor

@prehner prehner commented Dec 17, 2024

Thanks to @bbbursik for discovering the bug

The problem

in the existing code #[serde(flatten)] would invalidate the entire association record if kappa_ab and epsilon_k_ab were not both given. This is a problem for an induced association mixture, where one component has nb!=0 but no association parameters, because those are only adjusted to pure component properties. The mixture would then not be able to describe the induced association, because the nb is essentially eliminated.

The solution

kappa_ab and epsilon_k_ab are optional, so #[serde(flatten)] will always be able to deserialize the PcSaftAssocationRecord struct. Induced association is calculated properly if binary association parameters are present. If there are no binary parameters for a certain combination of molecules, combining rules are NOT used, instead the association energy is set to 0, effectively treating the molecules as non-associating (with each other).

@prehner prehner requested a review from g-bauer December 17, 2024 16:10
@prehner prehner merged commit cf852b5 into main Dec 18, 2024
15 checks passed
@prehner prehner deleted the fix_association_records branch December 18, 2024 14:36
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

Successfully merging this pull request may close these issues.

2 participants