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

Database: Issue importing tdb. file #524

Open
Tibaum31 opened this issue Apr 21, 2024 · 2 comments
Open

Database: Issue importing tdb. file #524

Tibaum31 opened this issue Apr 21, 2024 · 2 comments

Comments

@Tibaum31
Copy link

Dear pycalphad,

I am new to pycalphad and currently I am trying to import a .tdb file, to simulate a equilibrium isothermal ternary diagram of Al, Ti and Cu, and the following error occurs:

ParseException: Expected TCCommand 'ELEMENT', found ' ' (at char 1), (line:1, col:2)

I am using the aluminum database form matcalc (https://www.matcalc.at/index.php/databases/open-databases), and I am not sure how to fix the .tdb file. I greatly appreciate your help.

For the simulation/display of the ternary diagram I used the the following code:

%matplotlib inline
from pycalphad import Database, ternplot
from pycalphad import variables as v
tdb = Database('mc_al_v2036.tdb')
comps = ['AL', 'TI', 'CU', 'VA']
phases = list(tdb.phases.keys())
conds = {v.T: 1073, v.P:101325, v.X('AL'): (0,1,0.015), v.X('TI'): (0,1,0.015)}
%time ternplot(tdb, comps, phases, conds, x=v.X('AL'), y=v.X('TI'))

Thank you

Here is the .tdb-file I use:

mc_al_v2036.tdb.zip

@richardotis
Copy link
Collaborator

The Matcalc open databases do not work directly in pycalphad without modification. We have pre-modified copies available in this workshop repository: https://github.com/materialsgenomefoundation/2023-workshop-material/tree/03be5e6300feffc9350ad5094b7e9485b26f1c42/pycalphad/databases

I do notice that there are new versions available on the Matcalc website. We haven't modified the new versions yet.

@Tibaum31
Copy link
Author

Thank you very much for the fast response!
I tried the database "mc_al_v2.032.pycalphad.tdb" in the following code, using Jupyter notebook:

%matplotlib inline
from pycalphad import Database, ternplot
from pycalphad import variables as v
tdb = Database('mc_al_v2.032.pycalphad.tdb')
comps = ['AL', 'TI', 'CU', 'VA']
phases = list(tdb.phases.keys())
conds = {v.T: 1073, v.P:101325, v.X('AL'): (0,1,0.015), v.X('TI'): (0,1,0.015)}
%time ternplot(tdb, comps, phases, conds, x=v.X('AL'), y=v.X('TI'))

,but now the following Value error occurs:

ValueError: Number of interstitial sublattices for the disordered phase (1) and the ordered phase (5) do not match. Got substitutional sublattice indices of [].

Is this a known error or can you maybe help me with that?
Thank you!

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

2 participants