Intro OC6
Intro OC6
OpenCalphad version 6
summary of new and old features
Bo Sundman March 29, 2020
Bo Sundman, [email protected]
1
Contents
1 Background 4
1.1 Long term goals for the OC software . . . . . . . . . . . . . . . . . . . . . . 4
5 Software updates 8
5.1 New features in version 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5.2 New features in version 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.3 New features in version 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.4 New features in version 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.5 New features in version 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.6 New features in version 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
6 A general description 11
6.1 Thermodynamic models and data . . . . . . . . . . . . . . . . . . . . . . . . 11
6.2 Symbols and TP functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
6.3 Equilibrium calculations and conditions . . . . . . . . . . . . . . . . . . . . . 12
2
6.3.1 Parallelization of equilibrium calculation . . . . . . . . . . . . . . . . 12
6.3.2 Calculation of partial derivatives . . . . . . . . . . . . . . . . . . . . 12
6.3.3 Calculation of the Darken stability matrix and diffusion coefficients. . 13
6.4 Calculation and plotting of diagrams . . . . . . . . . . . . . . . . . . . . . . 14
6.5 Saving results on a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6.6 The beginning of an assessment procedure . . . . . . . . . . . . . . . . . . . 15
6.7 Modeling other properties that depend on T, P and phase composition . . . 15
6.8 Application software interface . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.8.1 The phase tuple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.9 Multiple equilibria and parallelization . . . . . . . . . . . . . . . . . . . . . . 17
6.10 Known bugs, problems and missing features . . . . . . . . . . . . . . . . . . 17
8 Bibliography 32
3
1 Background
The Open Calphad (OC) initiative started in 2011 when a group of scientists decided that
there was a need of a high quality open source software to gain wider acceptance of computa-
tional thermodynamics (CT) as a useful tool in materials science. The use of thermodynamic
calculations in many applications is severely restricted by the cost as well as the hardware
and software limitations imposed by most proprietary thermodynamic software. Providing
a free software would simplify such implementations and open a much larger market also for
the high quality databases provided by the commercial vendors.
Another aim was to support the scientific interest in new thermodynamic models and im-
proved algorithms for multicomponent thermodynamic calculations and a better software for
thermodynamic assessments as described in the book by Lukas et al.[07Luk]. At present such
developments can only be done by scientists who are affiliated to the commercial software
companies.
The last stable version of the OC software is available on [http://www.opencalphad.org].
The last development version, with more features but maybe less stable, is available on a
repository called opencalphad at [http://github.com].
The OC software in its present state is mainly of interest for researchers, scientists and
students with programming skills. It is probably less stable than equivalent commercial
software but it is already used in demanding commercial applications and it can be used for
teaching computational thermodynamics and development of software using CT. There are
three papers describing OC [15Sun1, 15Sun2, 16Sun].
This summary includes also the essential parts of the features of the previous versions.
• A model package open for the implementation of new thermodynamic and kinetic
models.
4
All of this in an open software free for non-commercial applications. But there are still
many bugs and features missing or not fully implemented.
The aim of OC is to open a rich field for testing new thermodynamic models and applica-
tions for any interested researcher, even if he does not have any economic support. It will
also be useful for testing different minimizers, optimizers and to improve the graphics.
5
To install and run OC on other OS than Windows you need:
• For fast numerics versions of the LAPACK/BLAS libraries adapted to your hardware
are recommended but default versions are provided with OC.
If you need help to handle the installation please ask a local guru, the OC team provides
the software for free and have no resources to help with installations.
At present there are no databases provided with OC except those used for the macro files
to test the software. A user must develop or search for a database for his system, most
commercial databases are encrypted and cannot be used by OC. To develop and maintain a
high quality multi-component database is a very demanding task and there is now way such
databases can be free but the hope is that one can collect a number of high quality assessed
binary systems, or some with 3-4 elements, using good models which can be free and used
as a basis for many different databases.
• OC needs numeric routines for inverting a matrix and solving a system of linear equa-
tions and calculate eigenvectors of the Darken stability matrix. LAPACK and BLAS
are used for this and if you have a LAPACK library adapted to your hardware please
use that rather than the small subset provided with OC.
• The LMDIF1 package for least square fitting of model parameters and the HYBRD
package to solve systems of non-linear equations are free software developed at Argonne
National Lab (1980).
6
present the Compound Energy Formalism (CEF) and the partially Ionic two-sublattice liq-
uid model (I2SL) are implemented. For more information on thermodynamic models see
Lukas et al.[07Luk].
For describing the T and P dependence there is a TP function package for storing and
calculating functions, including first and second derivatives of T and P .
7
4.8 Application Software Interface
The OC Software Application Interface (OCASI) to make it possible to integrate OC in
general application software for various simulations. This has now been equipped with an
iso-C binding which makes the data structures defined in the Fortran package available to
programs in C++, java, python and other software languages. There is a paper describing
this [16Sun].
4.9 Documentation
A fairly extensive documentation of the code, a user guide and additional examples as macro
files including graphics is provided with the software. The user guide exists as PDF or as
an HTML file used when running OC on-line. The PDF version of the user guide as well as
the subroutine documentation is available only when downloading the source code.
There are also a number of publications describing OC or using it, a few of them are listed
below.
5 Software updates
The main features in OC is summarized below in a historical order.
8
5.2 New features in version 2
The most important facilities added was generating property and phase diagrams. However,
these and many of the other features are still incomplete and fragile and may not work
properly in some cases. Feedback from users (providing the data and a macro file reproducing
the problem) is the best way to obtain a more stable and error free software.
9
taking into account the symmetry. For ionic crystal like the spinel phase there is also a
special grid minimizer to generate gridpoints that are uncharged.
The interest in the development of new models for magnetism and heat capacity at low
temperature has added some new features to OC.
Because there are many ongoing developments the documentation of the source code is not
completely updated and there are several features that have incomplete or no description.
10
It is now possible to set a difference in costitution fractions as a condition. This is necessary
to calculate 2nd order transition lines.
OC has now implemented a calculation of the correlation and covariance matrix for model
paraters in the assessment procedure. These are impoprtant to estimate the uncertainty for
extrapolations into multicomponent system. But how they can be integrated in the database
file is a big problem.
A file browser to open files for read and write has been incorporated in OC, the “tinyfile-
dialogs” provided free by Guillaume Vareille. If the file name is not given on the same line
as the command a new window is opened and the user can browse the directories to find
the file. In a macro file one must prefix the file to be opened name by “./” if the file is in
the same directory as the macro file. The use of this popup window can be turned off or on
with a SET ADVANCED command.
The GNUPLOT software has been a pleasant experience to use in OC. It is extremely rich
and OC use only a small part of all facilities. To obtain really nice diagrams the ocgnu.plt
file generated by OC can be edited with a text editor.
6 A general description
11
they maybe calculated millions of times together with their first and second derivatives with
respect to T and P.
The other type of symbols are user defined functions of the general thermodynamic proper-
ties like Gibbs energy, denoted G, entropy, enthalpy, mole fractions etc. The values of these
can be obtained after an equilibrium calculation. A user defined symbol can also refer to an
already existing symbol or it can be a “dot derivative” of one state variable with respect to
another. Currently the only such derivative implemented is H.T which represent the heat
capacity (provided the conditions are T, P and the mass balance).
Parallelization is possible on several levels in OC. For example one can calculate several
equilibria with different sets of conditions in parallel using the OpenMP library. This is
particularly important when OC is used for simulations, for example in a phase field software
as the calculation time is divided by the number of CPU’s available.
OC calculates all second derivatives with respect to T, P and all constituents of all phases.
This improves stability during equilibrium calculation and makes it possible to calculate for
example the stability function as part of an equilibrium calculation.
It also makes it possible to implement The “dot derivative” method to calculate derivatives
12
of state variables has been implemented. This allows calculation of properties like the heat
capacity without resorting to numerical derivation.
!
∂H
CP = (1)
∂T P,Ni
The calculation makes use of the analytical first and second derivatives of the Gibbs energy
for T, P and all constituent fractions calculated in the model package.
The matrix of all second derivatives of the Gibbs energy for a phase is often known as Darken
stability matrix. For a binary substitutional system this matrix is simply:
∂Gα ∂Gα
A A
∂xA ∂xB
Mα =
∂Gα ∂Gα
B B
∂xA ∂xB
and for a binary substitutional phase the chemical potential GαA is:
is negative the composition of the phase is inside a spinodal and the phase would like to
separate into two different composition, i.e. a miscibility gap.
For larger systems the determinant may be more complicated but as the model package
calculates all second derivatives analytically the software provides a command to calculate
the matrix of the derivatives of all chemical potentials with respect to all components
and also the eigenvalues of this matrix. If there is a negative eigenvalue it means the phase
is inside a spinodal. The derivation of eq. 4 can be found in the HMS documentation. It is
interesting to note that eq. 4 is symmetrical, ∂G
∂NB
A ∂GB
= ∂N A
.
This matrix is also important to convert the mobilities of the components to diffusion
coefficients.
13
6.4 Calculation and plotting of diagrams
The STEP procedure can calculate property diagram with a single axis variable and the user
can plot how various state variables or model properties depend on this axis variable. In the
plotting any two state variables can be used.
There is also a “step separate” option for Gibbs energy curves and similar things when
each phase is calculated separately along the axis variable.
The MAP procedure for phase diagrams requires two independent axis variables and it
calculates lines where the set of stable phases changes for different values of the axis variables.
At present only two axis are allowed.
For examples of the graphics in OC please look at the documentation of the macro exam-
ples.
The mapping has been improved but it is very dependent on selecting a good equilibrium
as a start point. If some lines are missing one may try to start at another equilibrium inside
the diagram and merge the plots. The AMEND LINE command makes it possible to remove
lines that are wrong.
Mapping of binary systems has been significantly improved in version 5 and mapping of
multicomponent system is also reasonable. But there is still a missing feature in detecting exit
lines from invariant equilibria for an isopleth. Additionally the present version of mapping
will not discover miscibility gaps that occurs during mapping but it will check the global
equilibrium at each node point and suspend lines that ends in a metastable equilibrium.
things will improve gradually. Feedback from users are welcome.
During both MAP and STEP all calculated equilibria are saved and it is possible to plot
many different properties. All node points are saved as equilibria which can be inspected
individually and it is also possible to copy equilibria along a line to a current equilibria and
extract values.
The results from a STEP or MAP command can only be saved graphically or as a GNU-
PLOT file. It is not possible to save the results on a file for later use by the OC software
but we are working on that. The user can always create MACRO files for calculations he
would like to repeat.
GNUPLOT version 5.2 or later is needed to generate the graphics. In the user interface of
OC some additional graphics options, like a title and ranges of the x and y axis, has been
added. It is also possible to edit the output files from OC to take advantage of the extensive
graphics facilities of GNUPLOT.
With version 5 the possibility to plot so called Gibbs triangle diagrams for isothermal
sections of thernary diagrams has been added. For such diagrams it is also possible to plot
tie-lines, i.e. a line between the composition of the phases in equilibrium in a two-phase
region. Note that tie-lines can be useful also when plotting binary phase diagrams with two
extensiove variables on the axis as shown in the map1 macro.
14
6.5 Saving results on a file
It is possible to save the current state of a calculation or assessment on an UNFORMATTED
Fortran file. This will save all equilibria created but not results from a STEP or MAP
command. The unformatted file can be read back into the program and used for future
calculations. This means that the current state of an assessment can always be saved.
However, the unformatted file may not be readable in a later version of OC so save also
macro files and other documentation.
The reason step and map results are not saved is that sometimes they will exceed the
available memory. For such cases one need to have a random access or DIRECT file which
has not yet been implemented. The problem is to detect that the memory is exhausted and
to stop the ongoing step or map procedure while saving the calculated equilibria to free up
the memory.
15
6.8 Application software interface
For use in application software there is an OC Software Application interface, OCASI. This
follows the TQ standard[95Eri]. There are some examples to use this interface provided with
the software, both for Fortran and C++ and a recent paper [16Sun].
A full Fortran/C++ application software interface including the use of compatible data
structures has been implemented using the isoC binding. This means that software written
in C++ as well as Fortran can directly access results form an OC calculation without using
calls to subroutines.
In the OCASI interface a new method was introduced in version 4 to identify phases called
“phase tuples”. Initially each phase has a single “composition set” representing its constitu-
tion. Phases with miscibility gaps will have two or more “composition sets” representing the
two different constitution. However, using a separate index for the phase and another for the
composition set is rather clumsy. Thus OC has a variable called “phase tuple” as a Fortran
95 structure (TYPE). The array of phase tuples have a unique index for each combination
of phase and composition set and the phase tuples for the second compostion set of a phase
follow after those for the first composition set. This feature was introduced in version 3 of
OC and was slightly changed in version 4. The phase tuple has 5 integer indices:
The phase tuple is an array provided by OC to the application software and updated inter-
nally whenever there is a change. The user interface of OC sometimes displays the phase
tuple index when listing phases and composition sets.
When a phase is entered it has one composition set with index 1 and a phase tuple is
created with the same index as the phase and the composition set index equal to 1. When
a new composition set is entered for a phase, either by the user or by the software itself
(for example by the grid minimizer) the phase tuple index for the new composition set
will be higher than any of the existing phases and have as values the phase number and a
composition set number 2 or higher. Redundant phase tuples created by the grid minimizer
are normally removed automatically after a calculation.
16
6.9 Multiple equilibria and parallelization
The user can enter several equilibria from the application software (as well as interactively)
for the same system and have different conditions in each and calculate them separately and
in parallel and transfer data between them.
This facility is used also for storing node points during step/map results and when OC
is used to assess model parameters from experimental data. Each equilibrium representing
an experiment is independent and they be calculated in parallel if OC is compiled with
OpenMP.
• There is a problem with the STEP procedure in a binary system using a composition as
axis. The STEP will stop at a phase boundary as it does not understand that nothing
changes in a two-phase region except the amount of the phases.
• There is no check on miscibility gaps during a step or map command except at node
points.
• Saving results from step and map on a file is not possible except graphically with
GNUPLOT (and the coordinates on the ocgnu.plt file).
• The mapping is very fragile, lines are sometimes missing or metastable lines plotted.
• The Scheil-Gulliver solidification model is not implemented in OC but there is an
application software written in C++ that can do this. T-zero lines and para equilibria
are also on the list to be implemented.
• The data structure now fairly stable but it may be changed in future releases.
• The complete OCASI subroutine set have not been designed yet. The earlier OC-TQ
application software interface has been revised to use phase tuples.
17
7.1 All top level commands
ABOUT EXIT MAP SELECT
AMEND FIN NEW SET
BACK HELP OPTIMIZE SHOW
CALCULATE HPCALC PLOT STEP
DEBUG INFORMATION QUIT
DELETE LIST READ
ENTER MACRO SAVE
One restriction I have applied to commands and subcommands is that one should not need
to type more than 3 characters to have a unique abbreviation.
Directly after the top level command the user can give some options preceded by a slash
like /output=filename or /append=filename. The output that would normally appear on
the screen will instead be listed on this file with extension DAT. The output option will
delete any previous content on the file but the append will add the new output at the end
of the file. The output is reset to the screen after the command.
A frequent Thermo-Calc user must disable his tendency to put hyphens or underscore
characters between the command and subcommand.
• HELP gives explanations about a (few) commands from the user guide
• MACRO asks for name of macro file and executes it. A macro file can call another
macro five levels deep.
• MAP a phase diagram with 2 or more independent axis. If the user already given a
MAP command he is asked if he wants to keep the previous results.
18
• OPTIMIZE asks for the maximum number of iterations and then use a least square
routine to obtain the best fit to experimental data by varying the set of model param-
eters specified by the user.
• SHOW a property value for a state variable like T, M U (C), G or a user defined symbol
or a model parameter identifier (always with a phase specification!).
7.3.1 AMEND
Amend should change something already entered or set. But sometimes it creates something
so one should be careful if a subcommand should be changed to ENTER or SET command.
• ALL OPTIM COEFF means you can rescale or recover previous set of the optimizing
coefficients.
• CONSTITUTION asks for a phase and the user can amend the amount and current
constitution of a phase. I have put this here and not as part of AMEND PHASE to
avoid confusion with adding a composition set.
• GENERAL can name of current equilibrium, the user can specify if he is a beginner (the
software can provide more help (not implemented)), or expert, if global gridminimizer
should be used and if it can merge composition sets, if composition sets can be created
automatically and if redundant composition set can be deleted after an equilibrium
calculation. The latter questions are mainly interesting for debugging.
• LINE make it possible to remove or add a line calculated for a STEP or MAP command.
A part of the line can be removed by editing the GNUPLOT file.
19
• PHASE (default) asks for phase name and amends data for this phase. Many of the
things that formerly were part of “set bit phase” have been moved here because they
represent permanent modification which are never “reset”.
20
• QUIT you did not want to amend anything.
• SYMBOL the user can specify if the symbol can only be calculated when explicitly
named (usually all symbols are evaluated when any symbol is evaluated as they can
depend on each other). This is needed for symbols used as conditions. The user can
also specify that a symbol should be local to a specific equilibrium. In this way one
can store the value of a symbol from one equilibrium and calculate differences with
respect to other equilibria.
7.3.2 CALCULATE
• ALL EQUILIBRIA all equilibria within the range set for experimental equilibria with
non-zero weight are calculated. This is useful for testing if there are any problems
before optimizing.
If you are running the version compiled with OpenMP the equilibria will be calculated
in parallel. Additional experimental or other symbols and properties can be calculated.
• GLOBAL GRIDMIN Only the grid minimizer is called to find the gridpoints that
represent the lowest Gibbs energy. These are normally used by the iterative minimizer
to find the real equilibrium. If followed by COMPUTE NO GLOBAL one will have
the same result as COMPUTE EQUILIBRIUM.
• NO GLOBAL calculates the equilibrium for the current set of conditions starting from
the current set of stable phases and their constitutions. No grid minimizer called.
• PHASE ask for phase name, amount and constitution and at current T and P calculates
either:
– ONLY G Gibbs energy and first and second derivatives with respect to T and P .
– G AND DGDY calculates also all first derivatives with respect to the phase con-
stituents.
– ALL DERIVATIVES Also all second derivatives with respect to the phase con-
stituents.
21
– CONSTITUTION ADJust You will be asked to enter a new composition (default
is current) of the phase and this command will then calculate G and all chemical
potentials after adjusting the constitution of the phase to have the minimum
Gibbs energy for the given overall composition. It is interesting when one or
more components are parts of several constituents for example in a gas or phases
with order/disorder transitions.
– DIFFUSION COEFF You will be asked to enter a new composition (default is
current) of the phase and this command will then calculate the Darken stability
matrix
∂GA
∂NB
for all components (see eq. 4) and also all mobility values (if there are any).
• SYMBOL Calculate the value of one or all symbols at the current equilibrium.
• TPFUN SYMBOLS all TP functions values and their first and second derivatives with
respect to T and P (6 values).
• TRANSITION asks for a phase to be stable with zero amount and a condition to be
released to calculates the equilibrium. The phase must not have the FIX status. After
the calculation the phase is set to be entered and the released condition set to the
calculated value. If calculation fails the status is not reset (sorry I have not had time
to do all). No grid minimizer called.
• TZERO-POINT the T and composition when two phases have the same Gibbs energy.
• WITH CHECK AFTER calculates the equilibrium using the current compositions and
checks afterwards with the grid minimizer if it has found a glocal equilibrium. Mainly
for testing.
7.3.3 DEBUG
7.3.4 DELETE
Only composition sets and equilibria can be deleted. To delete a parameter you can amend
its expression to be zero.
22
• ELEMENTS not allowed
• COMPOSITION SET The highest set is deleted (one cannot delete the first). Must
be used with great care.
7.3.5 ENTER
ENTER is the main command to enter data interactively. Note that in most cases data are
read from a TDB file.
• COMMENT enter a text that is saved and listed with the equilibrium.
• COPY OF EQUILIB the current equilibrium is coped to a new one with a name spec-
ified by the user.
• EQUILIBRIUM an equilibrium record with the specified name is created. Each equi-
librium record has an independent set of conditions. Will be used for assessments and
is already used to store node points during step and map.
• EXPERIMENT data for assessments. These are a state variable of symbol followed by
an equal sign, =, larger than, ¿ or lesser than,¡ and a value and uncertainty separated
by a colon. For example:
experiment T¿1200:1 X(liq,mo)=.2:.01 HM(fcc)=-30000:5000
• GNUPLOT TERMINAL allows the user to change or add the terminal used for plot-
ting.
• MANY EQUILIBRIA allows the user to enter a table with conditions for many equi-
libria with similar conditions. It is intended for assessments but can be used also to
calculate various properties that for a range of conditions not suitable for a STEP cal-
culation. The user must give a general “head” of the table specifying phase status and
all conditions including some that are different in the different equilibria. For those
familiar with Thermo-Calc it replaces the POP file in assessments but is more flexible.
23
• MATERIAL the user can specify a database and a composition and temperature to
calculate an equilibrium. If there are already data the user can enter a new composition
for calculation.
• OPTIMIZE COEFF the coefficients for use in assessments are entered. They have the
symbols A00 to A99. If the user wants fewer than 100 coefficients he can specify a
number.
• PHASE a phase with sublattices, site ratios and constituents. The parameters are
entered individually with ENTER PARAMETER.
• PLOT DATA the user can add data to be plotted for the cirrent equilibrium. Used for
equilibria with experimental data for assessments.
• SPECIES a species with name and stoichiometry. Its name must be unique but one
can have several species with the same stoichiometry.
• TPFUN SYMBOL The name and expression of a function of T and P that can be
used in parameters.
7.3.6 LIST
– SCREEN (default) Writes all parameters for all phases on the screen including
the bibliographic information.
– TDB Writes all parameters on file in TDB format.
– MACRO Writes all parameters on file as a macro file (not implemented).
24
– LATEX Writes all parameters on file as a LaTeX file (not implemented).
• EQUILIBRIA lists all entered equilibria with name and number (use LIST RESULTS
to list the results).
• ERROR MESSAGE lists the error message associated with an error code.
• LINE EQUILIBRIA lists all equilibria stored during STEP or MAP. With the SET
ADVANCED command one can copy one of these to the current equilibrium.
• MODEL PARAM ID lists all implemented model parameter identifiers like G, TC,
BMAGN, elastic constants etc. that can depend on T, P and constitution of a phase.
The use of such parameters require implementation of the model in the software.
• MODEL PARAM VAL lists the calculated value of a model parameter identifier for a
phase.
• OPTIMIZATION the result of an optimization is listed.
• PARAMETER lists the expression for a single parameter.
• PHASE asks for phase name and then lists for option
– CONSTITUTION (DEFAULT) lists constitution for this phase.
– DATA lists parameter for this phase (no bibliography).
– MODEL lists some model information for this phase.
• QUIT You do not want to list anything.
• RESULTS (default) from an equilibrium calculation. the program asks for a number
how to format the phase information.
1. stable phases with mole fractions in value order
2. stable phases with mole fractions and constitution in value order
3. stable phases with mole fractions and constitution in alphabetical order.
4. stable phases with mass fractions in value order
5. stable phases with mass fractions in alphabetical order.
6. stable phases with mass fractions and constitution in value order
7. all phases with mass fractions in value order
8. all phases with mole fractions and constitutions in alphabetical order
9. all phases with mole fractions and constitution in value order
The conditions are listed first, then some global properties, then some data for each
component and then the stable phases with amount and composition and possibly
constitution.
25
• SHORT
• STATE VARIABLES asks for state variable symbol and lists it value. replaced by
the SHOW command
• SYMBOLS lists all entered state variable symbols (same in all equilibria). To list the
values of symbols use calculate symbol or show.
• TPFUN SYMBOLS lists one or all TP function symbols and expressions (same in all
equilibria).
7.3.7 PLOT
PLOT asks for state variables or symbols for x and y axis and after that the user can plot
directly or change anything in the submenu below.
OC generates a command file for GNUPLOT and a data file with the values to plot and
then executes this in a separate shell. The user can edit the command file to add options
and execute it again inside gnuplot. But beware not to overwrite the files you want to edit.
There are 10 colors for the lines to plot. If more than 10 lines to plot the colors are repeated
cyclically.
OC keeps the previous values set of all options set until you make a new STEP or MAP
command. This means you can plot several times adding or modifying the plot until you are
satisfied.
To keep a complex plot you should rename the ocgnu.plt file as it will be overwritten by
the next plot command or copy it to another file.
• APPEND you can add a GNUPLOT file that will be added to the current plot.
26
– LINE-TYPE for dashed or symbols on a line
– LOGSCALE the X or Y axis or both can have logarithmic scaling.
– LOWER-LEFT-TEXT add a short text at lower left corner.
– MANIPULATE-LINES to select color order for some lines.
– NO-HEADING the text on the top is removed. The plot is slightly larger.
– PAUSE-OPTION does not work
– QUIT do not select any extra option
– RATIOS-XY the ratios of X and Y axis can be set.
– SPAWN you can plot and keep it and continue calculate or plot
– TIE-LINE index for isothermal sections, 1 means all, 2 every second, 3 every
third, 0 means none.
• FONT you can select the font for the whle plot. Note you can only use those provided
by GNUPLOT.
• GRAPHICS FORMAT set type of terminal. See enter gnuplot-terminal for possible
terminals. Note if you plot on SCREEN you can also write the plot on a file in the
GNUPLOT window.
• POSITION OF KEYS select position of the labels (identification) of the lines in the
plot. The labels can be placed inside/outside of the plot, to the left/center/right and
top/bottom. See the explanation of “set key” in GNUPLOT.
• TEXT LABELS allows adding a text in the plot at a specific point and for phase
diagrams also to calculate the set of stable phases at that point.
7.3.8 READ
• TDB (default) an unencrypted TDB file can be read. Many TYPE DEFS are not
handled correctly and warning are given. For partitioned phases you may have to edit
the TDB file. The user can select which elements he wants to read from the file.
27
• PDB Is a new format developed for data interchange.
• UNFORMATTED an unformatted file with model parameters and results for a single
equilibrium calculation. Beware that an unformatted file may be unreadable in a future
version.
• DIRECT will save results from STEP and MAP on a random access file (not imple-
mented).
7.3.9 SAVE
• DIRECT not implemented yet (intended for STEP and MAP results).
• UNFORMATTED (default) A file is written with unformatted data for all thermody-
namic data and conditions and results for a single equilibrium. There is no guarantee
an unformatted file will be readable in a later version of OC.
7.3.10 SELECT
• EQUILIBRIUM (default) change the current equilibrium to the selected one (number
or name or next or previous).
28
7.3.11 SET
SET can be used for many things. The most important is conditions.
• AS START EQUILIB use current equilibrium as start for step or map. Not necessary
if there is only one start equilibrium.
• BIT can affect GLOBAL, EQUILIBRIUM and PHASE records. The bit is toggled,
i.e. if already set it will be cleared. See the user guide for more information.
• CONDITION (default) the state variable and value of a condition. Normally set a
state variable equal to a value. Only a few expressions are allowed for mole fractions
and amounts of moles.
• ECHO echo of the input from macro files on the screen. There is no way to turn off
echo.
29
• INITIAL-T-AND-P is NOT to set conditions but just change local values used for
example in calculate phase.
• INPUT AMOUNTS amount of species in moles. These will be added together and
used for conditions of the components.
• INTERACTIVE at the end of macro files.
• LOG FILE the name of a file with a copy of all input and defaults. Useful for docu-
menting errors!
• NUMERIC OPTIONS maximum number of iterations (default 500) and convergence
limit (default 10−6 ).
• OPTIMIZING COND depending on the optimizer used for assessment some conditions
can be set.
• PHASE the user must specify a phase name and can then ...
– STATUS (default) the status of a single phase, or all using an asterisk “*”, can be
set. See also SET STATUS PHASE with a more flexible way to specify phases.
– DEFAULT CONSTITU the default constitution of the phase can be set. Same
as AMEND PHASE name DEFAULT CONSTITU.
– AMOUNT the amount of the phase (redundant).
– QUIT nothing is set for the phase.
– BITS some special bits for a phase can be toggled.
∗ QUIT (default) no bit is changed.
∗ EXTRA DENSE GRID to have more gridpoints in this phase
∗ NO AUTO COMP SET to prevent automatic creations of composition sets
for this phase. One can forbid creating automatic composition sets (by the
grid minimizer) for all phases with the AMEND GENERAL or SET BIT
GLOBAL commands.
– QUIT nothing is set.
• RANGE EXP EQUIL is needed for the CALCULATE ALL command. The first and
last equilibrium included in an assessment or a CALCULATE ALL command must be
specified. The first (default) equilibrium, number 1, cannot be included.
• REFERENCE STATE the reference state of a component. The phase, T and P must
be specified. The phase must exist with the component as its only component. When
the phase can exist with the component in different ways, like O in a gas can be O, O2
or O3 the most stable molecule at current T is selected.
• SCALED COEFF can be used to set a coefficient to be optimized with a specified
scaling factor and possibly a min and max value.
30
• STATUS
– PHASE (default) one or more phases can be set as suspended, dormant, entered
or fixed. You can use * to mean all phases, *S for all suspended, *D for all
dormant and *E for all entered and *U for all entered and unstable. The list of
phases is terminated by an equal sign “=” or an empty line.
If the new status is not already given after the equal sign it is asked for. If the
new status is entered or fixed the amount is asked for.
– ELEMENT an element can be entered or suspended.
– SPECIES a species can be entered or suspended.
– CONSTITUENT not implemented.
• UNITS like energy Joule/cal or mass kg/lb ... but not implemented yet.
7.3.12 STEP
• QUIT do nothing.
• CONDITIONAL follow the axis variable and update s symbol after each step (to be
used for Scheil-Gulliver simulations, not yet implemented).
31
8 Bibliography
References
[95Eri] G Eriksson, P Spenser and H Sippola, 2nd Colloquium on Process Simulations, pp
115-126, June 1995, HUT, Espoo, Finland.
[15Sun2] B Sundman, X-G Lu, H Ohtani, Comp Mat. Sci 101(2015) 127
[20Sun] Bo Sundman, Ursula R. Kattner, Mats Hillert, Malin Selleby, John Ågren, Sedigheh
Bigdeli, Qing Chen, Alan Dinsdale, Bengt Hallstedt, Alexandra Khvan, Huahai Mao
and Richard Otis, A method for handling the extrpolation of solid crystalline phases
to temperatures far above their melting point, Calphad 68 (2020) 101737
32