-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathxtdb-v014.tex
2833 lines (2386 loc) · 135 KB
/
xtdb-v014.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass{article}
\usepackage{graphicx} % Required for inserting images
%\usepackage{geometry}
%\geometry{margin=0.5in}
%\usepackage{cite}
%\usepackage{color}
%\title{XMLTDB01}
%\author{Bo Sundman et al. }
%\date{June 2023}
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\usepackage{graphicx,subfigure} % with figures
% sometimes needed to have pdf files
\pdfsuppresswarningpagegroup=1
\topmargin -10mm
\oddsidemargin -10mm
\evensidemargin -10mm
\textwidth 170mm
\textheight 220mm
\parskip 2mm
\parindent 3mm
%\pagestyle{empty}
\usepackage{xcolor}
\usepackage[normalem]{ulem}
% end of XML tag
\newcommand\eoxml{/\hspace{-4pt}>}
%footnote using capital letter
\renewcommand{\thefootnote}{\Alph{footnote}}
%\renewcommand{\thefootnote}{{\arabic{footnote}}
% For appendices
\usepackage[titletoc,title,header]{appendix}
\begin{document}
\begin{center}
{\Large \bf Proposal 0.1.4 of an XML format to replace TDB files}
Bo Sundman, Tachi Abe, Qing Chen, Shuanglin Chen, Nathalie Dupin,
Bengt Hallstedt, Aur{\'e}lie Jacob, Ursula R. Kattner, Lina Kjellquist,
Reza Naraghi, Richard Otis, Alexander Pisch, Erwin
Povoden-Karadeniz, Malin Selleby, Axel van de Walle, Fan Zhang and
Fabio Miani
. \today
\end{center}
I put my name first to take the blames and Fabio at the end as the
project manager.
{\bf Recent changes in Appendix~\ref{sec:changes}. The Examples are
not updated.}
For minor changes enclose new text with {\color{green} with your own
color} and delete text using \sout{deleted text}
\section{Background}
Within the Calphad community the databases with model parameters are
important and can often be used by several different software as well
as edited manually. The most frequent format for such database is
called TDB and was created by the Scientific Group Thermodata Europe
(SGTE) while working on the unary databse for 78 elements which was
published 1991~\cite{91Din}. It has been used for more than 40 years
but it has limitations, in particular when adding new new models and
features.
It is high time to change from this format and to adopt an accepted
Markup Language as XML or JSON. The XML has been selected for a new
XTDB format as it has been around for a long time and is slightly more
explicit. There are many Markup Languages but it is easy to convert
between any of them and thus the choice of XML is not very critical
except to avoid spending several years to discuss the choice.
XML is flexible and extendable and each software may add their own
flavour in a controlled way. It will be simpler to use an XTDB file
by different softwares as one can easily indicate what is software
specific rather than try to modify or extend the TDB format.
To avoid the confusing use of {\bf element} both for chemical element
and the XML element the word {\bf tag} will be used for the XML
element.
\subsection{Objectives}
The TDB format is well established and used by students assessing
model parameters as well as database managers and researches trying to
develop new materials based on thermodynamic calculations. This
proposal proposes a minimal change from the current TDB format but
will simplify future extensions. The new format, called XTDB, will be
used for:
\begin{itemize}
\item manually editing of an XTDB file should be as easy as the
current TDB format also for non-experts.
\item minimize problems when using software A to read a database
file written by software B.
\item simplify adding features and new models for different phase
dependent physical properties in the thermodynamic database.
\item provide users of a database with information about the models
and bibliographic references, even for encrypted databases.
\item improve collaboration between users and researchers dealing
with Calphad databases.
\item simplify for software developers to add tags and attributes in
software and databases. Such modifications should be discussed
between developers and users and eventually integrated in the XTDB
format.
\end{itemize}
Some software has already introduced features in the TDB file which
may not bee fully implemented in other software. Some of these are
discussed in section~\ref{sec:wildcard}.
This XTDB definition may require minor modifications in the XML format
already adoped in some software. Commercial companies providing
encrypted databases to customers can use whatever format they prefer
for such databases. But they should provide a facility to read and
write unencrypted databases in the XTDB format.
\subsection{The XTDB file and some more}
The characters used in an XTDB file are restricted to the classical
ASCII character set.
The XTDB file is divided into lines (terminated by LF (Line Feed or
newline as preferred by UNIX dialects) or CRLF (Carriage Return and
Line Feed as preferred by Windows)). For the XTDB file a line should
not exceed 2000 characters.
If you are not familiar with XML there are plenty of information
online. A brief summary here:
XML has 3 reserved charaters, ``$<'', ``>$'' and ``\&''. These must
not be used anywhere except for XML itself.
An XML file consists of ``tags'' with ``attributes'' where the
attributes contains the specific data for the tag. An example makes
it easier to explain:
\begin{verbatim}
<Element Id="AL" Refstate="FCC_A1" Mass="26.982" H298="4577.3" S298="28.322" />
\end{verbatim}
Each tag has a name preceded by the reserved character ``$<$'' followd
by a ``tagname'' and the tag ends with ``$\eoxml$'' unless the tag
contains other tags. Such nested tags are each on a new line and the
enclosing tag must be ended by ``$<$/tagname$>$'' on a separate
line. For examples see Appendix~\ref{sec:phaseexample}.
An attribute is followed by an equal sign and the the data is enclosed
by double quotes, ". {\bf If the data consists of several values they
are separated by one or more spaces}, see
Appendix~\ref{sec:phaseexample}, do not use a comma or anything else.
An attribute can occur only once within a tag but the a tag be
repeated any number of times.
All tags and their attributes proposed for XTDB are listed in
section~\ref{sec:tags} and explained for each tag. Several examples
are provided in later seactions and the Appendix~\ref{sec:complete}
has two complete XTDB files.
In this document a tag is usually written in {\bf bold} when refereced
in the text and an attribute in {\em italics}. Many tags have an {\em
Id} attribute which can be referenced to in other tags. All values
of the {\em Id} attributes are case insensitive as they are in the TDB
file. The value of an {\em Id} cannot be abbreviated when used in
other tags except for phase {\em Id}. But such an abbreviation must
be unique.
All attributes of an XTDB tag should fit within a line and only one
XML tag per line in order to be easily readable by humans. A tag with
nested tags has its attributes on the same line as the tag and each
nested tag begins on a new line. The end of a tag including nested
tags should appear on a line by itself, see for example
Appendix~\ref{sec:phaseexample}.
The attribute {\em List} of the {\bf Constituent} tag for a gas phase
in a big system may exceed 2000 characters but several {\bf
Constituent} tags can be used for a phase.
In the examples some long tags have been separated into several lines
in order to be readable.
A software reading the XTBD file should ignore XML tags and attributes
it does not support, preferably with a warning to the user.
The XML tagname and its attributes cannot be abbreviated and are case
sensitive.
Database users may be interested to add more or less temporary
comments inside the database and comments, starting with ``$<$!---''
and ending with ``---$>$'', can be added anywhere between tags in the
XML file. There must not be any "--" or forbidden characters inside
the comment.
An XML parser is convenient for reading XML files but to simplify the
life for all the the humans reading and editing the XTDB file it is
strongly recommended that the attributes to an XML tag are provided in
the order listed for each tag below. Software specific attributes can
be added to a tag but should come at the end.
\subsection{How this document can be read}
The following proposal is for a common definition of an XTDB file
format based on XML. It can hopefully become an SGTE standard
acceptable by all software groups which develop or use Calphad
databases.
In section~\ref{sec:tags} all proposed tags are listed with a short
explanation. In section~\ref{sec:attributes} a more detailed
explation are given of some tags and attributes and
section~\ref{sec:points} has a list of things to consider.
In the Appendix~\ref{sec:examples} there are several examples of tags
and attributes, in Appendix~\ref{sec:modelapp} an extensive list of
model tags and their attributes. In Appendix~\ref{sec:partags} there
aee explanations how some thermodynamic models, such as
EBEF~\ref{sec:ebef}, have been integrated in the XTDB format using
wildcard feature.
In Appendix~\ref{sec:complete} the complete XTDB file for the binary
Al-C and Al-Li are listed and finally in Appendix~\ref{sec:changes} an
attempt to document recent changes in this proposal from earlier
versions together with some unresolved issues.
A software can easily extract randomly arranged tags from an XTDB
files but for a a human reader and for manual editing the XTDB file
the recommended order is {\bf DatabaseInfo, Defaults} and any {\bf
AppendXTDB} tags followed by {\bf Element, Species} and {\bf Phases}
(with many nested tags).
The main part of the XTDB databas are the {\bf Parameter} and {\bf
TPfun} and tags, which can be ordered by the phases or by the
systems. For maintaing a database it may be convenient to keep
parameters inside {\bf BinarySystem} or {\bf TernarySystem} tags. The
{\bf TernaryXpol} tags should be together binary parameters.
The {\bf Model} tag should appear before any {\bf Phase} or {\bf
Parameter} tags and the {\bf Bibliography} at the end or both in a
separate{\bf AppendXTBD} file. The {\bf AppendXTDB} tag, which
specifices additional files of an XTDB database, allows the database to
be split on several files. The {\bf Defaults, DatabaseInfo} and {\bf
AppendXTDB} tags and all {\bf Element, Species} and {\bf Phase} tags
must be present in the primary XTDB file.
With a few exceptions a tag or attribute starts with a capital letter
and if it consists of two or more parts, such as {\em NumberOf}, the
second part is joined without hyphen or underscore but starts with a
capital letter.
\newpage
\section{The XTDB-v0.1.4 tags and attributes with short explanations}\label{sec:tags}
All proposed tags for the XTDB file are listed here. Further
explanations of the attributes can be found in
section~\ref{sec:attributes}.
Some tags are optional and many of them will appear several times in
the XTDB file to provide the data.
An exclamation marek ``!'' is indicated for the mandatory attributes of a tag.
\subsection{The system XTDB tags}\label{sec:first}
The {\bf AppendXTDB} tag makes it possible to separate a large XTDB
database on several files. There are some restrictions which types of
tags can be used in such files, for example the tags for {\bf Element,
Species, Phase} are not allowed in AppendXTDB files.
\begin{tabular}{|p{0.06\textwidth} p{0.15\textwidth} p{0.8\textwidth}|}\hline
Tagname & Attributes & Explanation\\\hline
XTDB & & Containing XML tags for an XTDB database.\\
! & Version & Version of XTDB for this file.\\
&Software & Name of software generating the database.\\
! &Date & Year/month/day the database was written or last edited\\
! &Signature & Name/email of person or organisation generating the database.\\\hline
Defaults & & Optional tag to provide default values of attributes in
different XML tags and some other things. Some software, as
specified XTDB tag, may have some ``mandatory'' defaults.\\
& LowT & Default value of low $T$ limit.\\
& HighT & Default value of high $T$ limit.\\
& Bibref & Default bibliographic reference for parameters. \\
& Elements & For example ``VA'' and/or ``/-'' (the electron).\\
& RKorder & see section~\ref{sec:rkorder} \\
& TernaryXpol & see section~\ref{sec:toop} \\
& GlobalModel & Any model applicable to the whole database,
for example EEC~\cite{21Sun}\\\hline
DatabaseInfo & & Optional tag with information about the database\\
& Info & Free text (excluding the characters $< >$ \& ).\\
& Date & Last update of the database information.\\\hline
AppendXTDB & & Optional tag with additional file for the XTDB database.
It should contain XTBD tags but some tags are forbidden,
see above.\\
& Models & The {\bf Model} tag with MPID specifications, read first.\\
& Parameters & With mainly {\bf Parameter} tags.\\
& TPfuns & With all {\bf TPfun} tags which may have to be rewinded and
read several times.\\
& Bibliography & With bibliographic tags.\\
& Miscellaneous & Whatever the database manager wishes.\\\hline
\end{tabular}
Note that in this and later tables the exclamation mark at the far
left side of some attributes means they are mandatory.
\subsection{The element and species tags}\label{sec:elements}
All constituents of the phases must be specified as {\bf Species} and
the species are aggregates of one or more {\bf Element} with fixed
stoichiometric ratios. The vacancy, denoted ``VA'', is considered an
element which must have activity 1 at equilibrium but cannot have a
fixed amount. The electron ``/-'' is considered as an element and can
be used as a fixed charge on a {\bf Species}. A phase with charged
species must have an extra internal software condition that the phase
is electrically neutral at equilibrium.
There are strong feelinga about upper and lower case for elements and
sometimes phases. But in fact the elements are only used to specify
the stoichiometry of species and that is not a very big thing. The name
of species, i.e. their {\em Id} , is case insensitive and the species
are the constituents of the phases.
Species names are important not only for listing and plotting results
because constituents, i.e. the species, can be used when setting
conditions for a equilibrium calculation. The elements are
automatically entered as species with a case insensitive {\em Id}.
An ion, for example an iron species with positive charge can have the
stoichiometry ``FE/+2''. One can create a species for an electron
using the stoichiometry ``VA/--1'', or a species for a ``hole'' with
stochiometry ``VA/+1''
\begin{tabular}{|p{0.06\textwidth} p{0.15\textwidth} p{0.8\textwidth}|}\hline
Tagname & Attributes & Explanation\\\hline
Element & & Specifies a chemical element in the database. In addition
the vacancy, denoted ``VA'', and the electron, `denoted `/-'',
are included to handle defects and ions.\\
! & Id & Chemical element symbol, one or two latters,
for example FE, H. The symbol is case insensitive,
see section~\ref{sec:lettercase}.
Fictitious element names can be used. \\
& Refstate & Name of the reference phase, for example GAS. The
database may not have any data for this phase. \\
! & Mass & Mass in g/mol\\
& H298 & Enthalpy difference between 0 and 298.15~K
in the reference state. Not used in equilibrium
calculations. \\
& S298 & Entropy difference between 0 and 298.15~K in
the reference state. Not used in equilibrium
calculations\\\hline
Species & & Specifies a chemical species used as a constituent of phases.
The elements, except the electron, are also species.\\
! & Id & Species name max 24 letters and some special
characters, see section~\ref{sec:speciesID}.\\
! & Stoichiometry & One or more element {\em Id} each followed by
an unsigned real or two integers separated by a ``/''
representing the stoichiometric ratio,
see section~\ref{sec:speciesSS}. See also
Appendix~\ref{sec:elementexample}.\\
& MQMQA & For a constituent in the MQMQA model. See
section~\ref{sec:mqmqa}.\\
& UNIQUAC & For a constituent in the UNIQUAC model. See
section~\ref{sec:uniquac}.\\\hline
\end{tabular}
\subsection{The function and temperature range tags}\label{sec:tpfun}
The thermodynamic model parameters are usually simple mathematical
expressions but many of them contain common parts refering to the same
element. In order to reduce this complexity one can enter a
mathematical expression with the {\bf TPfun} tag and use the {\em Id}
of this {\bf TPfun} inside the {\em Expr} attribute of several {\bf
Parameter}, {\bf Parameter2} tags or other {\bf Tpfun} tags,.
\begin{tabular}{|p{0.06\textwidth} p{0.15\textwidth} p{0.8\textwidth}|}\hline
Tagname & Attributes & Explanation\\\hline
TPfun & & Defines a $T, P$ expression to be used in parameters or other functions.\\
! & Id & Function name, max 16 characters, see
section~\ref{sec:lettercase}. The name is used in the
``Expr'' attribute of other functions or parameters,
see section~\ref{sec:tpfunattr}.\\
& LowT & Can be omitted if the default low $T$ limit applies.\\
! & Expr & Simple mathematical expression terminated by ;. Use the {\bf Trange} tag if several ranges. See section~\ref{sec:expr}\\
& HighT & Omitted the default high $T$ limit applies.\\\hline
Trange & & Only inside a {\bf TPfun} or {\bf Parameter} tag for an expression with several $T$ ranges.\\
! & Expr & Simple mathematical expression terminated by ;. See section~\ref{sec:expr}.\\
& HighT & Omitted if the default high $T$ limit applies.\\\hline
\end{tabular}
See section~\ref{sec:expr} for the restrictions of the mathenatical
expresson in the {\em Expr} attribute and Appendix~\ref{sec:tpfuns}
and others for examples. There is no way at present to handle several
pressure ranges in the XTDB file. For high $P$ a separate model for
the volume should be used.
The value of a function, as well as its first and second derivatives
with respect to $T$ and $P$, must be continuous across an interval of
$T$ range. Breakpoints will normally occur only for {\bf TPfun} of
pure element data and those in the unary 1991~\cite{91Din} have been
checked. Using the {\em Id} of a {\bf TPfun} tag inside another {\bf
TPfun} may create infinite loops by circular calls but is left for
the software to detect this.
%\newpage
\subsection{The phase tag and its nested tags}\label{sec:phase}\label{sec:dispart}
The phase tag has two ``compulsory subtags'' i.e. {\bf Sublattices}
and {\bf Constituents}.
\begin{tabular}{|p{0.06\textwidth} p{0.15\textwidth} p{0.8\textwidth}|}\hline
Tagname& Attributes & Explanation\\\hline
Phase & & All thermodynamic data is part of a phase.\\
! & Id & Phase name, see sections~\ref{sec:lettercase} and
\ref{sec:phaseid}. \\
! & Configuration & Model for the configurational entropy,
see section~\ref{sec:cfg}.\\
& State & G for gas phase, L for liquid phase.
Only needed for the liquid if EEC is used.\\\hline
CrystalStructure & & Optional tag inside a {\bf Phase} tag.\\
& Prototype & Prototype phase \\
& StructurBericht & For example A3, B2, C14, D0\_3 etc.\\
& PearsonSymbol & Specification.\\
& SpaceGroup & Specification.\\\hline
Sublattices & & Only once inside a {\bf Phase} tag.\\
! & NumberOf & Number of sublattices, an integer value 1 - ?. \\
! & Multiplicities & Sites on each sublattice, as many reals as
sublattices separated by a space. For an example
see Appendix~\ref{sec:phaseexample}\\\hline
Constituents & & One for each sublattice inside the {\bf Sublattices} tag.\\
& Sublattice & Omitted if only one sublattice.\\
! & List & Species {\em Id} in the sublattice,
separated by a space, see Appendix~\ref{sec:phaseexample}.\\\hline
AmendPhase & & Optional tag inside a {\bf Phase} tag to specify
for example a contribution due to a magnetic model.\\
& Model & One or more models {\em Id}s, separated by a space, for this
phase. See section~\ref{sec:models}, Appendix~\ref{sec:modelapp}
and \ref{sec:phaseexample}.\\\hline
DisorderedPart & & Optional tag inside the {\bf Phase} tag of an
ordered phase with or without order/disorder transions.
The Gibbs energies of the ordered and disordered parts
of a phase are added according to eq.~\ref{eq:nosub} or
\ref{eq:sub} below.
In order to use eq.~\ref{eq:sub} the the constituents on
the ordering sublattices must be identical and the
attribute {\em Subtract} must be included. See also
section~\ref{sec:dispart}. (with identical constituents
but different number of sublattices)
The configurational Gibbs energy is calculated for
the ordered part only. \\
& Disordered & Optional attribute with the name of the disordered phase,
see section~\ref{sec:nodis}. Some software have the parameters
for the ordered and disordered part with the same phase name.\\
! & Sum & Number of sublattices, starting from the first sublattice in the
ordered phase to be summed for the disordered phase
constitution. Optionally an extra interstitial
sublattice can be present.\\
& Subtract & Must be specified if eq.~\ref{eq:sub} should be used.
It can be assigned any value but must be present.\\\hline
\end{tabular}
\bigskip
For a phase with the {\bf DisorderedPart} tag the Gibbs energy
(excluding the configurational entropy) is calculated by one of these
equations:
\begin{eqnarray}
G_M &=& ~^{\rm dis}G_M(x) + ~^{\rm ord}G_M(y) \label{eq:nosub}\\
G_M &=& ~^{\rm dis}G_M(x) + ~^{\rm ord}G_M(y) - ~^{\rm ord}G_M(y=x) \label{eq:sub}
\end{eqnarray}
where $x$ is averaged values of $y$ for some (or all) sublattices in
the ordered phase. Eq.~\ref{eq:nosub} is mainly used for phaes with
many sublattices which never disorder for example intermetallic
phases.
In order to use eq.~\ref{eq:sub} one must specify the attribute {\em
Subtract} (with any value). This equation can be used for phases
with order/disorder transitions such as FCC, BCC and HCP. Such phases
are stable as disordered in many systems but sometimes exhitit
ordering. Using eq.~\ref{eq:sub} the model parameters as ordered and
disordered phase can be assessed separately because calculating the
Gibbs energy of the ordered phase twice, the second time using the
disordered fractions, and then subtracting means the ordered
parameters will not affect the disorderd state. For details
see~\cite{97Ans} and~\cite{07Hal}
A phase with very long list of constituents (for example the gas) can
have several {\bf Constituent} tags.
\subsection{The parameter tag}\label{sec:parametertag}
All thermodynamic data, and possibly kinetic and other physical phase
dependent properties, are defined by the parameter tags. They should
be arranged after the {\bf Phase} tags or inside a {\bf BinarySystem}
tag, see~\ref{sec:subsys}. They can have nested {\bf Trange} tags.
Examples in sections~\ref{sec:parameter2}, Appendix~\ref{sec:parameter
examples}, \ref{sec:partags} and \ref{sec:complete}.
\bigskip
\begin{tabular}{|p{0.06\textwidth} p{0.15\textwidth} p{0.8\textwidth}|}\hline
Tagname& Attributes & Explanation\\\hline
Parameter & & Specifies the $T, P$ expression of a model parameter for a set of constituents.\\
! & Id & As in a TDB files, for example G(LIQUID,A,B:VA;2). See also the {\bf Parameter2} tag. \\
& LowT & Can be omitted if the default low $T$ limit applies.\\
! & Expr & Simple mathematical expression terminated by ;. If several ranges use a {\bf Trange} tag. See section~\ref{sec:tpfun} and \ref{sec:expr}.\\
& HighT & Can be omitted if the default high $T$ limit applies.\\
! & Bibref & Bibliographic reference, unless the default bibref is set.\\\hline
\end{tabular}
The attribute {\em Id} defines the parameter as in the current TDB
file. It starts with a model parameter identifier (MPID), see
Appendix~\ref{sec:mpid}, followed within parenthesis by a phase name
(which can be abbreviated) and one or more constituents in each
sublattice of the phase in the order of the sublattices.
Constituents are given in the order of the sublattices defined by the
phase tag, separated by a colon, ``:''. Constituents in the same
sublattice, i.e. for interaction parameters, are separated by a
comma, ``,''. The order of sublattices and their constituents are as
defined by the {\bf Phase} tag, see section~\ref{sec:phase}.
After the constituents in the last sublattice a semicolon, ``;''
followed by a single digit, 0-9, can be used to indicate a degree.
This degree can have different meanings in different models but is
normally used for the power in a Redlich-Kister series, see
section~\ref{sec:rkorder}. If the digit is zero the semicolon and the
digit can be omitted.
An asterisk ``*'', also known as wildcard, see
section~\ref{sec:wildcard}. can be used as constituent in a sublattice
indicating that the parameter is independent of the constituents in
the sublattice. The wildcard is an important feature of some models,
see section~\ref{sec:ebef}.
The parameters are the essential parts of the database and more
examples can be found in Appendix~\ref{sec:partags}. They are
generated from separate assessment of experimental and theoretical
data for binary and higher order systems. One aim of this XTDB format
is also to provide a simple and unified way to publish and report such
assessments. Databases are collections of such assessment and
database managers integrate separate assessment and sometimes modify
some parameters for compatibility with other systems. In addition to
the bibliographic reference the database managers are encouraged to
add comments of such actions within the {\bf Parameter} tag in order
to pass on information to the next manager of the database.
\subsection{The elaborate parameter tag}\label{sec:parameter2}
An alternative more elaborated XML tag can be used for parameters
which may be preferred by software. It is straightforward to convert
from one to another. It must have a subtag, {\bf Constarray} with one
or more tags {\bf SublConst} for each constituent in each sublattice.
\bigskip
\begin{tabular}{|p{0.06\textwidth} p{0.15\textwidth} p{0.8\textwidth}|}\hline
Tagname& Attributes & Explanation\\\hline
Parameter2 & & A more detailed parameter tag preferred by software.\\
& Id & As in TDB file, for example G(LIQUID,A,B:VA;2). See also the {\bf Parameter} tag. \\
! & MPID & Model parameter identifier, for example G or TC.\\
! & Phase & Can be omitted inside a phase tag, otherwise the phase name.\\
& LowT & Can be omitted if the default low $T$ limit applies.\\
! & Expr & Simple mathematical expression terminated by ;. If several ranges use a {\bf Trange} tag. See section~\ref{sec:tpfun} and \ref{sec:expr}.\\
& HighT & Can be omitted if the default high $T$ limit applies.\\
! & Bibref & Bibliographic reference.\\\hline
ConstArray & & Only inside a {\bf Parameter2} tag. Encloses the
SublConst tags.\\
& Degree & Can be omitted if zero. See section~\ref{sec:degree}\\\hline
SublConst & & Only inside a {\bf ConstArray} tag. There must be at least
one tag like this for each sublattice.\\
! & Sublattice & Sublattice of constituent.\\
! & Species & A species {\em Id}. Two or more species in the same
sublattice means an excess parameter.\\\hline
\end{tabular}
\bigskip
The {\bf Parameter2} tag may be preferred by software but for
manual editing {\bf Parameter} is simpler, see the
Appendix~\ref{sec:parameter examples}. Both tags can be used in
the XTDB file and software can easily convert between them.
If the {\em Id} attribute is present in a {\bf Parameter2} tag the
software should check that this {\em Id} is identical to the long form
and report an error if not.
\subsection{Bibliography for parameters and models.}\label{sec:biblio}
For each parameter there must be a bibliographic reference. This can
be the same for all parameters from the same source. The models also
have a reference which should indicate a paper where the model is
explained, see Appendix~\ref{sec:modelex}.
It is important to inform the users that thermodynamic databases are
not not created by computers or appear from thin air.
\bigskip
\begin{tabular}{|p{0.06\textwidth} p{0.15\textwidth} p{0.8\textwidth}|}\hline
Tagname& Attributes & Explanation\\\hline
Bibliography & & Contains bibliographic references\\\hline
Bibitem & & Only inside a {\bf Bibliography} tag.\\
! & Id & Used as value in the {\em bibref} attribute for a parameter
or model, normally a paper or a comment by the database manager.\\
! & Text & Reference to a paper or comment.\\
& DOI & DOI of paper where the parameter was assesses.\\\hline
\end{tabular}
\subsection{The model tags}\label{sec:models}
The XML tags for generally accepted models can be on a separate file
and the model {\em Id} attribute is the important and used in the {\bf
AmendPhase} tag for each phase which has the model. Most models
have one or more model parameter identifiers (MPID) as attributes and
these are used in the {\bf Parameter} tag for the phases. Models must
be explained in a model tag with an appropriate bibliographic
reference. Typically the {\bf Model} tag is in an AppendXTDB file.
See Appendix~\ref{sec:modelapp}. The Model tag and Some currently
used model tags are listed here. The models normally specify one or
more model parameter identifiers (MPIDs) used in parameters needed for
the model. Additional text outside the attributes can be added
describing the model.
\bigskip
\begin{tabular}{|p{0.06\textwidth} p{0.15\textwidth} p{0.8\textwidth}|}\hline
Tagname& Attributes & Explanation\\\hline
Models & & Contains model tags usually with an {\em Id} attribute
used in {\bf AmendPhase} tags inside {\bf Phase} tahs.
The models usually specify one or more model parameter
identifiers (MPID) needed by the model. Some models,
such as {\bf DisorderedPart} must be included as tags
within the {\bf Phase} tag.\\\hline
%\end{tabular}
%
%\bigskip
%\begin{tabular}{|p{0.06\textwidth} p{0.15\textwidth} p{0.8\textwidth}|}\hline
% Tagname& Attributes & Explanation\\\hline
Magnetic & & There are several magnetic models.\\
! & Id & This is used in {\em Model} attribute of the
{\bf AmendPhase} tag. There are currently 3 variants:
IHJBCC, IHJREST and IHJQX explained
in Appendix~\ref{sec:modelapp}. \\
& Aff & The antiferromagnetic factor (-1, -3 or 0). It is
redundant but kept for compatibility with TDB file.\\
! & MPID1 & Specifies a magnetic model parameter
identifier (MPID) for parameters.\\
! & MPID2 & Specifies a magnetic model parameter
identifier (MPID) for parameters.\\
! & MPID3 & Specifies a magnetic model parameter
identifier (MPID) for parameters.\\
! & Bibref & Where the model is described.\\\hline
Permutations & & For FCC, HCP and BCC lattices a 4 sublattice tetrahedron
model, identical permutations of a parameter will be included
only once in the XTDB file. See section~\ref{sec:permut}.\\
! & Id & This is used in the {\em Model} attribute of the
{\bf AmendPhase} tag. Its can be either FCC4PERM or BCC4PERM.
There are no MPID. \\
! & Bibref & Where the model is explained.\\\hline
\end{tabular}
The permutations means that a parameter which can have permutation of
its constituents on idetical sites is stored only once in the
database. For example in an FCC ordered phase a parameter
G(FCC\_4SL,FE:AL:AL:AL:VA)
\noindent
has 3 identical permutations: G(FCC\_4SL,AL:FE:AL:AL:VA),
G(FCC\_4SL,AL:AL:FE:AL:VA) and G(FCC\_4SL,AL:AL:AL:FE:VA) which are
not included in the database but taken care of by the software. This
reduce the size of the database and avoid human errors. It requires
that the software calculates automatcally the contribution from all 4
permutations of the constituents of indentical sides. There are other
excess parameters with up to 24 permutations.
The wildcard, see section~\ref{sec:parametertag} is frequently used
for parameters of ordered phases, see Appendix~\ref{sec:wildcard},
\ref{sec:OD} and the following sections.
\subsubsection{Models tags for new unary models}
After long discussions the unary group has decided to use a single
composition dependent Einstein parameter for each phase and element in
the new unary database. An element with its heat capacity fitted
using several Einstein $\theta$ will have the additional $\theta$
described by the GEIN function in the {\em Expr} attribute in the {\bf
Parameter} or {\bf TPfun} tag, the GEIN function is defined in
eq.~\ref{eq:gein} in section~\ref{sec:expr}. For multiple $\theta$
see the Al-C example in Appendix~\ref{sec:alc}.
New {\bf Model} tags may be developed and included in the XTDB file in
order to specify new MPIDs for parameters.
\bigskip
\begin{tabular}{|p{0.06\textwidth} p{0.15\textwidth} p{0.8\textwidth}|}\hline
Tagname& Attributes & Explanation\\\hline
Volume & & Specifies the model for volume of a phase.\\
! & Id & This is used in the {\bf AmendPhase} tag.\\
! & MPID1 & Specifies a volume model parameter identifier
(MPID) for parameters.\\
! & MPID2 & Specifies volume model parameter identifier
(MPID) for parameters.\\
! & MPID3 & Specifies volume model parameter identifier
(MPID) for parameters.\\
! & Bibref & Where the model is described.\\\hline
Einstein & & The low $T$ vibrational model.\\
! & Id & This Id is used in {\bf AmendPhase} tag.\\
! & MPID1 & Specifies the Einstein model parameter identifier (MPID)
for parameters.\\
! & Bibref & Where the model is described.\\\hline
Liquid2state & & The liquid 2-state model.\\
! & Id & This Id is used in {\bf AmendPhase} tag.\\
! & MPID1 & Specifies liquid model parameter identifier (MPID)
for parameters.\\
! & MPID2 & Specifies Einstein model parameter identifier (MPID)
for parameters.\\
! & Bibref & Where the model is described.\\\hline
EEC & & Specifies that the Equi-entropy model applies to the database.
This must be implemented in the software. The liquid
{\bf Phase} tag must also have the {\em State} attribute equal to L. \\
! & Id & has the value EEC.\\
! & Bibref & Where the model is described.\\\hline
\end{tabular}
\subsubsection{Ternary extrapolation methods}\label{sec:toop}
Some models are concern a subset of the constituents of a phase and
they must be specified explicitly and cannot be included in the {\bf
AmendPhase} tag for the phase because they include additional
information. The {\bf DisorderedPart}
models are explained together with the {\bf Phase} tag.
The Toop, Kohler and Muggianu ternary extrapolation methods are most
likely specified together with the parameters for a specific ternary.
The Muggianu method is often the default ternary extrapolation model
but there are other extrapolation methods to be considered and they
must be integrated in the XTDB format.
\begin{tabular}{|p{0.06\textwidth} p{0.15\textwidth} p{0.8\textwidth}|}\hline
Tagname& Attributes & Explanation\\\hline
TernaryXpol & & A subset of 3 constituents for which do not use the default
extrapolation method of the binary compositions inside
a ternary subsystem.\\
! & Phase & Can be omitted if used inside a {\bf Phase} tag. Normally
this tag will appear close to the {\bf Parameter} for which the
extrapolation should be used.\\
! & Constituents & Specifies 3 constituents of the phase sepated by
spaces.\\
! & Xmode & See below.\\\hline
\end{tabular}
Examples:
\begin{verbatim}
<TernaryXpol Phase="Liquid" Constituents="Fe Mn Mo" Xmode="KKK" />
<TernaryXpol Phase="Liquid" Constituents="Si Fe Mn" Xmode="T1T1M" />
\end{verbatim}
Where the first ternary extrapolates use the Kohler extrapolation for
all binaries. In the second the first binary, Si-Fe, use Toop
extrapolation with Si (the first constituent) as Toop element. The
second binary, Si-Mn, has also Si (still the first constituent) as
Toop elemet and the third binary, Fe-Mn, use the Muggianu
extrapolation method. The {\em Cmode} attribute is a bit particular
and explained further in Appendix~\ref{sec:ternaryxpol}.
\subsection{Organizing the data and software specific attributes}\label{sec:subsys}\label{sec:soft}\label{sec:last}
Each parameter in the database has a bibliography attribute and
normally a software reading the database lists the relevant
bibliographic data after extracting the data from the database or it
can be listed from inside the software for calculations. The
references is an important feature to assure the user the database is
reliable and to inform the users that thermodynamic databases are not
not created by AI or appear from thin air. The number of references
for a multicomponent system with 1000 or more parameters from many
assessments is very impressive.
Additionally, the database manager often arranges the model parameter
per system to simplify updates and this habit has resulted in
introducing a new tag in the XTDB format. This arrangement in the
XTDB file has no influence on the way the software handles the
parameters.
\bigskip
\begin{tabular}{|p{0.06\textwidth} p{0.15\textwidth} p{0.8\textwidth}|}\hline
Tagname& Attributes & Explanation\\\hline
UnarySystem && Encloses a set of {\bf Parameter} tags for the unary data.
There can be parameters for the unary also outside this tag.\\
! & Elements & Constituent for the parameters in the system.\\
! & Bibref & Main bibliographic references.\\\hline
BinarySystem && Encloses a set of {\bf Parameter} tags for different
phases of a binary system.
There can be parameters for the binary outside this tag. It may
have a software dependent attribute to calculate the binary.\\
! & Species & Two constituents for the parameters
separated by spaces. \\
! & Bibref & Main bibliographic references.\\
& CalcDia & Software specific commands to calculate the binary
phase diagram. The software is specified in the
{\bf XTDB} tag.\\\hline
TernarySystem && Encloses a set of {\bf Parameters} tags for different
phases for a ternary system.
There can be parameters for the system outside this tag.\\
! & Species & Constituents for the parameters in the system
separated by spaces.\\
! & Bibref & Main bibliographic references.\\
& CalcDia & Software specific commands to calculate some particular
ternary diagram for the system.\\\hline
\end{tabular}
\bigskip
Inside a {\bf BinarySystem} tag the {\bf Parameter} tags for all
phases assessed for the constituents in the {\em Species} attribute
can be included. The parameters should have their own bibliographic
reference. The {\em Bibref} for the {\bf BinarySystem} and {\bf
TernarySystem} can be listed when reading the database informing the
user which assessed systems that are in the database.
{\begin{verbatim}
<BinarySystem Species="C Co" Bibref="88FER1 97KUS 06MAR" >
<Parameter Id="G(LIQUID,C,CO;0)" Expr=" -107940.6+24.956*T;" Bibref="87FER1" />
<Parameter Id="G(LIQUID,C,CO;1)" Expr=" -9805.5;" Bibref="87FER1" />
<Parameter Id="G2(B2_BCC,CO:C;0)" Expr=" +GHSERCO+3*GHSERCC+247373.5-33.574*T;" Bibref="88FER1" />
<Parameter Id="G(BCC_A2,CO:C;0)" Expr=" +GHSERCO+3*GHSERCC+247373.5-33.574*T;" Bibref="88FER1" />
<Parameter Id="G(CBCC_A12,CO:C;0)" Expr=" +UN_ASS;" Bibref="Default" />
<Parameter Id="G(CEMENTITE_D011,CO:C;0)" Expr=" +3*GHSERCO+GHSERCC-1567+3.963*T;" Bibref="88FER1" />
<Parameter Id="G(CR3C2_D510,CO:C;0)" Expr=" +63920+794.135*T-132.57*T*LN(+T)-2.35E-05*T**2
+1296100*T**(-1);" Bibref="14KAP" />
<Parameter Id="G(CUB_A13,CO:C;0)" Expr=" +UN_ASS;" Bibref="Default" />
<Parameter Id="G2(FCC_4SL,CO:C;0)" Expr=" +GHSERCO+GHSERCC+50463.8-6.849*T;" Bibref="89FER1" />
<Parameter Id="G(FCC_A1,CO:C;0)" Expr=" +GHSERCO+GHSERCC+50463.8-6.849*T;" Bibref="89FER1" />
<Parameter Id="G(HCP_A3,CO:C;0)" Expr=" +GHSERCO+0.5*GHSERCC+22916.5-2.855*T;" Bibref="87FER1" />
<Parameter Id="G(M23C6_D84,CO:CO:C;0)" Expr=" +GCO23C6;" Bibref="97KUS" />
<Parameter Id="G(M7C3_D101,CO:C;0)" Expr=" -5706.9+1408.9*T-249.28*T*LN(+T)+956820*T**(-1);"
Bibref="06MAR" />
</BinarySystem>
\end{verbatim}
}
In the {\em CalcDia} attribute there can be software specific
instructions how to calculate a phase diagram or some other diagram.
This tag can be used also in an encrypted database for the systems
that are assessed in the database.
\subsection{Adding new XML tags or attributes}
The XTDB tags listed above is intended to cover all the basic modeling
of thermodynamic data needed for calculations. But this set of basic
XTDB tags must not prevent the development of new models and there
will be new tags and attributes added in the future. But such
additions can, with some care, be integrated in XTDB files without
corrupting the data and information already established.
There may be a need for conditional tag in the XTDB file. Maybe this
can be implemented in a software independent way, but temporarily this
can be handled by software specific tags, for example if certain
actions should be taken depending on the user selection of elements ot
species.
\bigskip
\begin{tabular}{|p{0.06\textwidth} p{0.15\textwidth} p{0.8\textwidth}|}\hline
Tagname& Attributes & Explanation\\\hline
IfSpecies & & Depending on the species selected by user\\
! & Species & If one (or more enclosed by parenthesis) species
in this attribute have been selected\\
& AndSpecies & And one (or more) species in this attribute have
been selected\\
& OrSpecies & Or one (or more) species in this attribute have
been selected\\
! & Do & software specific way to act if this clause is true.\\\hline
\end{tabular}
This is an tentative tag which has to be elaborated.
An example of the use of this clause consider that if Fe and Ti and C
have been selected then the software should automatically create two
composition sets for the FCC phase to describe the cubic carbide
(maybe with a slightly modified name). The same may be useful to
provide for an ordered L1$_2$ phase when reading data for the Al-Ni
system from an XTDB file.
\section{Further explanation of XTDB tags and attributes}\label{sec:attributes}
Note that the XML tags and attributes are case sensitive whereas the
names i.e. {\em Id} of species, functions, phases and other identifiers
are {\bf case insensitive} as in the TDB file. For example a chemical
species written FE, Fe, fe and fE is the same element. Thus CO is
Cobalt and to specify the stoichiometry of carbonmonoxide one must use
C1O.
Presenting information and results for a user still have limitation
imposed by the size of th computer screen or peper width and it is
difficult to format nice output with very long names of functions or
species or phases. For a human it is also complicated to handle long
names, even if they may be abbreviated.
\subsection{About UPPER and lower characters, abbreviations and forbidden characters}\label{sec:lettercase}
In an TDB file UPPER and lower case letters are treated as identical.
In XML the tags and attributes are case sensitive. In this proposal
all letters A-Z of the attributes, for example the name of elements,
species and phases, the UPPER and lower case letters will be
considered as identical.
In particular the characters ``(`` and ``)'' are not allowed in the
{\em Id} attribute of {\bf Species, Phase} or {\bf TPfun} tags. This
is necessary to simplify the parsing the {\em Id} attribute of the
{\bf Parameter} tag and to simplify interpreting commands in the user
interface of the software. The allowed characters are explained the
the sections~\ref{sec:elements} and \ref{sec:phase}.
In some software using a command line user i/f one can use a command:
\vspace{-3mm}
\begin{verbatim}
set condition y(gas,co2)=0.1
\end{verbatim}
\noindent
in order to specify that the gas phase should have the constituent
fraction of CO$_2$ equal to 0.1. It could be complicated if both the
phase name and species name can contain parenthesis and be
abbreviated.
It is not allowed to abbreviate {\bf Species} {\em Id} and {\bf TPfun}
{\em Id}. Note that the species {\em Id} is normally not its
stoichiometric formula and rather short names are recommended for
complex molecules. In general ``(`` and ``)'' are not allowed in any
{\em Id} attribute except for {\bf Parameter}.
Abbreviation of {\bf Phase} {\em Id} is allowed because there may be
many variants of almost the same phase.. Phase identification can be
very complex with the attributes {\em StructurBerict,
PearsonSymbol} or {\em SpaceGroup} can be provided in separate
attributes such in the {\bf CrystalStructure} tag. But to identify
the phase in a parameter in the XTDB file the {\em Id} is used.
The rule for abbreviation of the {\em Id} is that any part of a phase
name starting with an underscore can be abbreviated separately, thus
two phases MONOCLINIC\_A and MONOCLINIC\_B can be abbreviated as M\_A
and M\_B.
\subsection{The Species and its attributes}\label{sec:speciesID}
The species are the constituents of phases. A species name (i.e. the
{\em Id} attribute) is {\bf case insensitive} and must start with
letter A-Z and can contain letters, digits and the special characters
``\_'', ``/'', ``-'' and ``+''. It must not be abbreviated when used
as constituent in tags and attributes such as {\bf Phase, Parameter}
etc.
In some software the constituents are defined for each phase
separately and have no separate identification but in other software
the species name, i.e. {\em Id} can be used for setting conditions and
used when listing and plotting. The XTDB format must not limit this