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: Max phases by Gibbs phase rule accommodated #184

Merged
merged 6 commits into from Aug 17, 2018

Conversation

bocklund
Copy link
Collaborator

This requires a hack in hyperplane because hyperplane constructs a C-simplex hyperplane corresponding to the chemical potentials, however the phase fraction and point index arrays are now padded to accommodate C+2 phases instead of C phases. So I set the point index to zero (which pulls in the phase, site fracs, etc. associated with that point) and the phase fraction of those points to zero. I'm not sure if this was correct or what implications there are for doing this, but the tests pass...?

@bocklund
Copy link
Collaborator Author

bocklund commented Aug 17, 2018

I'm not expecting the CI tests to pass until this is rebased on #182 that updates SymPy requirements

@richardotis
Copy link
Collaborator

Does this still work if you set the maximum number of phases to c+1 instead of c+2? I support this change, but I want to note that the current implementation already respects the Gibbs phase rule, which is c + 2 - 2 = c phases can coexist at once. We lose two degrees of freedom from fixing T and P.

The reason we want to artificially increase the maximum phases allowed is because we want to accommodate the degenerate degree of freedom at the invariant reactions. (The solution this change gives will be "correct," but the phase fractions won't be meaningful since multiple values would give the same Gibbs energy on the invariant line.)

@bocklund
Copy link
Collaborator Author

I changed C+2 to C+1 and tests pass locally.

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.

Minor comments only. Merge when ready

-----
M: number of energy points that have been sampled
N: number of components
P: N+2, max phases by gibbs phase rule
Copy link
Collaborator

Choose a reason for hiding this comment

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

Needs to be changed to N+1. Maybe choose another letter besides P to represent this quantity, so it isn't easy to confuse with a thermodynamic variable

Copy link
Collaborator

Choose a reason for hiding this comment

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

(though we do already use N, so...)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think defining them prevents confusion for overloading (but not having any labels was confusing).

result_simplex[:num_components] = best_guess_simplex
# Hack to enforce Gibbs phase rule, shape of result is comp+2, shape of hyperplane is comp
Copy link
Collaborator

Choose a reason for hiding this comment

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

comp+1 now

@bocklund bocklund merged commit 916ad73 into develop Aug 17, 2018
@bocklund bocklund deleted the fix-gibbs-phase-rule branch August 17, 2018 21:24
@bocklund bocklund added this to the 0.7.1 milestone Aug 18, 2018
bocklund added a commit to bocklund/pycalphad that referenced this pull request Aug 17, 2021
…alphad#184)

* RTD config: Switch off building `all` formats, since LaTeX builds are failing (pycalphad#167)
* Cleanup ESPEI development `|version|` information to remove the `.dirty` from the version since RTD dirties the version info
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.

Error for too many phases during equilibrium calculations
2 participants