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

Error while simulating Ni-Al-Cr system #9

Closed
dpttw opened this issue Sep 22, 2020 · 2 comments · Fixed by #11
Closed

Error while simulating Ni-Al-Cr system #9

dpttw opened this issue Sep 22, 2020 · 2 comments · Fixed by #11

Comments

@dpttw
Copy link

dpttw commented Sep 22, 2020

I am using a revised version of Ni-database from MatCalc. This database works with pycalphad 0.8.3. When I run scheil 0.1.1, I got error message:
ALN: Sublattice frozenset({Species('N', 'N1')}) of (frozenset({Species('AL', 'AL1')}), frozenset({Species('N', 'N1')})) has no components in {Species('AL', 'AL1')}

Any suggestion?

@dpttw dpttw changed the title Ni-Al-Cr Error while simulating Ni-Al-Cr system Sep 22, 2020
@bocklund
Copy link
Collaborator

Sorry, somehow I lost track of this issue and confused it with pycalphad/pycalphad#279.

It looks like this is caused by not the code not removing phases that cannot form for the input species. I can try to work on fixing the code and making a new release in the next few days, but a simple workaround would be to downselect these phases yourself by something like:

from pycalphad import Database, variables as v
from scheil import simulate_scheil_solidification
from pycalphad.core.utils import filter_phases, unpack_components, unpack_phases

# setup the simulation parameters
dbf = Database('mc-ni.tdb')
comps = ['AL', 'CR', 'NI', 'VA']
# only phases that can be active with the above components
phases = filter_phases(dbf, sorted(unpack_components(dbf, comps)))

liquid_phase_name = 'LIQUID'
initial_composition = {v.X('ZN'): 0.3}
start_temperature = 850

# perform the simulation
sol_res = simulate_scheil_solidification(dbf, comps, phases, initial_composition, start_temperature, step_temperature=1.0)

The key being the use of filter_phases to down-select only the phases that can exist given the set of components, comps.

@dpttw
Copy link
Author

dpttw commented Sep 29, 2020

Thanks Brandon. If I carefully select the phases, the module works well.

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 a pull request may close this issue.

2 participants