Skip to content

FIX: Molar volume model fixes #501

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

Merged

Conversation

bocklund
Copy link
Collaborator

@bocklund bocklund commented Dec 11, 2023

  • Fix normalization of molar volume energy and properties to be per mole of atoms
  • Set molar volume properties (V0, VA, VK, VC) as attributes of Model. Not sure about VK and VC parameter normalization, but for now I'm assuming they are the same normalization VA (parameters stored per mole of atoms, rather than the usual per mole of formula)
  • Set the property name of molar volume to be VM, rather than MV, which is more consistent with commercial software and handling molar quantities
  • Replace molar volume property expressions with symbols in the database. If we don't do this, any FUNCTION TDB keywords (which become symbols) get set to zero when computing in calculate or equilibrium

- MV is renamed VM to be consistent with other properties
- Molar volume model parameters (V0, VA, VK, VC) are now set as attributes
- Molar volume model parameters are now property normalized per mole of atoms
@bocklund
Copy link
Collaborator Author

cc @mfrichtl as this might be relevant to you

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1563bc4) 90.47% compared to head (6e3aace) 90.47%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #501   +/-   ##
========================================
  Coverage    90.47%   90.47%           
========================================
  Files           50       50           
  Lines         7871     7871           
========================================
  Hits          7121     7121           
  Misses         750      750           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mfrichtl
Copy link
Contributor

@bocklund Glad to see improvements here since I'm definitely familiar enough with the nuts and bolts of pycalphad to get it right on my first try. Maybe I was just getting lucky with my testing that the site ratio normalization didn't impact me. Unfortunately I don't know more about how the other terms are defined, but I see now in one of my references that at least V0 is defined as m^3/(mole formula unit).

@bocklund
Copy link
Collaborator Author

@bocklund Glad to see improvements here since I'm definitely familiar enough with the nuts and bolts of pycalphad to get it right on my first try. Maybe I was just getting lucky with my testing that the site ratio normalization didn't impact me. Unfortunately I don't know more about how the other terms are defined, but I see now in one of my references that at least V0 is defined as m^3/(mole formula unit).

If you were looking at simple bcc/fcc/hcp phases, it's not too surprising to miss the normalization. I was able to at least confirm that V0 is per mole of formula (consistent with some refs I've seen with sigma phase molar volume modeling), and I don't have any databases for that have VA parameters for phases with more than 1 mole of formula units that I've found published, but I verified that Thermo-Calc treats VA parameters are per mole of atoms (which was surprising). My suspicion is VK/VC are the same, but I'm not sure

@mfrichtl
Copy link
Contributor

@bocklund Yes, I was only looking at BCC and FCC phases while assuming interstitials as zero volume species, so I think the site normalization would not have affected my results. I should have thought about it though since that's how CALPHAD works.

It is odd that VA parameters are given per mole of atoms. I really don't know about the other parameters either. All of my modeling to date has been at atmospheric pressure and my limited attempts to get that portion of the model working failed.

@bocklund bocklund requested a review from richardotis January 10, 2024 17:18
Copy link
Collaborator

@richardotis richardotis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new test for the symbol replacement behavior would be nice, but I think it's alright to move forward regardless, especially as how properties work will change with the Workspace API PR.

@bocklund bocklund merged commit 8fd0f06 into pycalphad:develop Jan 17, 2024
@bocklund bocklund deleted the fix-molar-volume-names-normalization branch January 17, 2024 19:28
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.

3 participants