Matcalc User Manual: (Maintained by Matcalc Engineering)
Matcalc User Manual: (Maintained by Matcalc Engineering)
com
®
MatCalc User Manual
(Maintained by MatCalc Engineering)
This User Manual is aimed at demonstrating the basic handling of the MatCalc
software. It starts with typical operations using the GUI, performing simple
calculations of thermodynamic equilibrium and post-processing of the results in
graphical form. If you are a new MatCalc user, try out the tutorial sections one by
one. You will become acquainted to the basic features and functions of the software
and learn how to set up your simulation problems.
December 2017
Tutorials
CONTENTS
CONTENTS ....................................................................................................................... I
T1: INTRODUCTION TO THE MATCALC GRAPHICAL USER INTERFACE (GUI) ........................... 1
CONTENTS ............................................................................................................................ 1
TOOLBARS.......................................................................................................................................... 3
CONSOLE ........................................................................................................................................... 4
TO FINISH... ........................................................................................................................ 22
OUTPUT ........................................................................................................................................... 25
BUFFERS .......................................................................................................................................... 27
TO FINISH... ........................................................................................................................ 32
TITLE................................................................................................................................................ 39
LEGEND............................................................................................................................................ 39
AXES ................................................................................................................................................ 39
GRID ................................................................................................................................................ 41
SERIES ............................................................................................................................................. 41
II
Tutorials
TO FINISH... ........................................................................................................................ 43
VARIABLES ....................................................................................................................................... 45
- 'FAVORITES' .................................................................................................................................... 46
-'GENERAL' ....................................................................................................................................... 47
- 'COMPOSITION' ................................................................................................................................ 47
DEFAULT X-AXIS................................................................................................................................ 50
- 'REMOVE SERIES', 'REMOVE ALL SERIES', 'REMOVE ALL LOCKED SERIES' ............................................ 55
- 'DUPLICATE AND LOCK SERIES ...', 'DUPLICATE AND LOCK ALL SERIES' ................................................ 55
STEP 1: DEFINE THE THERMODYNAMIC SYSTEM (SEE ALSO TUTORIAL T2) ............................... 94
STEP 1: SETUP THE THERMODYNAMIC SYSTEM (SEE ALSO TUTORIAL T2) .............................. 107
V
Tutorials
VII
Tutorials
IX
Tutorials
X
Tutorial 1
This first tutorial provides a brief tour of MatCalc's user interface and explains how to
perform basic file operations.
CONTENTS
1
Tutorial 1
When MatCalc is first opened, the screen appears as shown below (Windows version).
The table below gives brief descriptions of the different areas of the screen.
Menu bar The main menu (see below).
Toolbar Icons giving quick access to frequently used functions (see below)
Quick
Icons giving quick access to window management options
access bar
2
Tutorial 1
Variables A list of MatCalc's built-in variables with their current values. See Tutorial 4 and
window Tutorial 5 for more about variables.
Information
Notes on the currently highlighted entry in the variables window (meaning of
on
variable, units, etc.).
variables
Nodes List of nodes used in simulation. Multiple nodes are used in the advanced
window calculations
Gives information on the current state of the system (temperature, time, etc.)
Status bar
and on the contents of graphical windows (see Tutorial 4).
MENU BAR
As with any typical GUI application, this gives access to a number of sub-menus. The 'File' and
'Help' menus are documented in this tutorial, and the contents of the other menus will be
described in more detail in subsequent tutorials.
'File': opening, saving and closing files (see 'File operations' below)
'Edit': text-editing commands such as undo, redo, cut, copy, paste
'Global': commands for setting up the system
'Calc', 'Simulation', 'Monte Carlo', 'Regions': commands for starting various types of
calculation
'Script': to run scripts (more on this in Tutorial 13)
'View': to configure the GUI and create new windows for the display of results
'Help': see 'Getting help' below
TOOLBARS
3
Tutorial 1
'Calc'
L-R: Stop current action, single equilibrium, stepped equilibrium, search phase boundary,
precipitate kinetics calculation, select calculation state, save into current calculation state,
load from current calculation state, select calculation buffer.
'View'
L-R: Wizard, hide all, console, options, variables, nodes, start, freeze all window updates, fit
windows into viewport, zoom in, zoom out, open Navigator, Display Mode
Right-clicking on the toolbar area gives a menu allowing the user to control which windows
and which icon groups are to be displayed on the screen:
CONSOLE
This window allows command-line input, as an alternative to using the graphical controls.
Commands can also be grouped into script files, for easier and more rapid execution of
repetitive or complex tasks. More on the console, command-line syntax and scripts will be
found in Tutorial 12: Using the MatCalc console and Tutorial 13: Introduction to scripting. The
4
Tutorial 1
console can be shown or hidden using View > Show console, pressing F4 key or clicking on
icon.
MatCalc 6 uses a new formalism for the command-line input. While the scripts and
commands used in the older versions are recognized by the current version, the old
command formalism is to be typed in 'MatCalc 5 console' window.
COMMAND HISTORY
The command history window can be made to appear by selecting its entry in the menu
shown on the picture above or by pressing 'Ctrl' + 'Arrow up' after clicking on the console
window. It gives a chronological list of all the commands entered in the Console.
A command can be selected using the mouse pointer or arrow keys. Right-clicking on the
command displays the following menu. On the right-hand side of the menus in MatCalc are
keyboard shortcuts for the more commonly used commands. It can be seen from the image
below that it is sufficient to press the 'Enter' key to execute the selected command.
Previously used commands can also be accessed in the Console window itself; pressing the
up-arrow key displays the most recently entered command, and pressing it repeatedly scrolls
through recent commands in reverse chronological order. The command displayed can be
edited then executed by pressing the 'Enter' key.
5
Tutorial 1
The icon groups in the toolbar can be rearranged by clicking on the double vertical lines at the
left-hand side of the group and dragging to the chosen location. They can be detached from
the toolbar area and brought into the currently empty main window area (coloured grey); in
this case, they are given title bars similar to that of the 'MatCalc console'. The Console,
Options, Variables and Command History windows can also be attached to or detached from
the left-hand column area as required.
FILE OPERATIONS
THE 'FILE' MENU
The 'workspace' is the basic file type in MatCalc. It contains all the necessary information on
the calculation or series of calculations under consideration, comprising inputs (elements,
phases, compositions, thermodynamic and mobility data) and outputs (results of calculations,
graphs, etc.). Saving the workspace preserves all this information for future use. Click on the
icon or open 'New' from the 'File' menu. The following dialogue box will appear:
6
Tutorial 1
Select 'MatCalc workspace' from the drop-box. This runs a script file called 'autonew.mcs',
which makes two additional windows appear: 'Phase details' and 'Phase summary'. When
the new workspace is first created, the 'Phase summary' and 'Phase details' windows show
messages indicating that no phases have yet been selected. The workspace is now ready for
thermodynamic or precipitation calculations to be set up and performed.
WORKING DIRECTORY
The 'working directory' is the directory opened by default when saving new files or opening
existing ones. Clicking on 'Working directory…' allows the user to designate an existing
directory as the working directory or to create a new directory for this purpose.
7
Tutorial 1
The paths of the current working directory and of recently used working directories are listed
to the right of 'Recent working dirs…', allowing any of these directories to be selected easily.
Clicking on 'Workspace info…' opens a box in which information about the current workspace
can be entered. This is useful for details of the assumptions used in the calculation, the
sources of experimental data, etc.
8
Tutorial 1
Workspaces can be saved using 'Save…' or 'Save As…' in the file menu, or the icon on the
toolbar. To close a file, choose 'Close Workspace' in the file menu or .
WARNING: Do not close the individual windows on the screen before saving, or their
contents will not be saved!
GETTING HELP
The MatCalc help files are accessible on the web site http://www.matcalc.at →
documentation. Presently, no local installation is provided.
In the Console, typing a question-mark will display a list of available commands. These will be
discussed in more detail in Tutorial 12.
9
Tutorial 2
This tutorial explains how to determine the equilibrium phases at a given temperature, and
their phase fractions and compositions.
CONTENTS
10
Tutorial 2
BEFORE STARTING...
Create a new workspace file (Tutorial 1).
In the 'Global' menu, select 'Databases'. A window will appear as shown below. The
'Equilibrium database' box initially displays the message 'database not open…'. Click on the
'open…' button; this will open the '…MatCalc/database/thermodynamic' subdirectory,
allowing the user to choose a database. A small database on iron-based materials,
'mc_fe.tdb', is provided with MatCalc for demonstration purposes. Select this database and
click 'Open'.
A list of elements will appear in the left-hand box, with FE and VA (vacancies) selected by
default. In the right-hand box is a list of the phases which can occur in a system containing
the selected elements. Click on 'C' in the elements box; this will add to the list a number of
other phases which can occur in an Fe-C system, such as graphite and several carbides. The
'show all available phases' box can be used to display all the phases available in the
database, irrespective of whether they can form in the system in question.
From the phase list, select 'LIQUID', 'BCC_A2', 'FCC_A1', 'GRAPHITE' and 'CEMENTITE'. Phases
are described using crystallographic notation: BCC_A2 represents the body-centred cubic
11
Tutorial 2
phase, which corresponds to ferrite in the iron-carbon system, and FCC_A1 is the face-
centred cubic austenite phase in Fe-C. Click 'Read & Close'.
In the 'Global' menu, select 'Composition'. This opens the 'System composition' box. The
lower part of the box gives options for the units in which the composition is to be displayed:
mole fraction, weight fraction, u-fraction or weight percent. One of the elements, usually the
one with the highest mole fraction, is designated as the 'reference element', and the amount
of this element is calculated as 1-(sum of the amounts of all other elements) for
compositions expressed in fractional form, or 100-(sum of the amounts of all other
elements) for compositions expressed as percentages.
12
Tutorial 2
Iron is set as the reference element by default in the 'mc_fe.tdb' database, as can be seen
from the 'Ref. Elem' column in the composition dialogue box. Another element can be set as
the reference by selecting the element name and clicking on the 'Set reference element'
button on the right, or by double-clicking in the 'Ref. Elem' column by the side of the element
name.
To enter a composition of 0.4 wt.% C, select 'weight percent' as the unit, then highlight
element C. Double-click in the 'Amount' column, click on the 'Change' button or press F2 to
modify the composition, then type in '0.4' and press 'Enter'.
The system is now ready to perform an equilibrium calculation.
CALCULATING AN EQUILIBRIUM
From the 'Calc' menu, select 'Set start values'. This initialises the calculation variables with
reasonable values in order to help the Gibbs free energy minimiser to find a solution which
satisfies all the boundary conditions. This command is useful if the solution algorithm seems
to be 'stuck' and unable to find an equilibrium.
Once one valid equilibrium has been found, solutions at other temperatures or boundary
conditions are much easier to obtain. From the 'Calc' menu, select 'Equilibrium', or click on
the icon in the toolbar. The following window appears:
13
Tutorial 2
Enter '700' in the temperature box and ensure that 'temperature in C' is selected. Leave the
pressure at its default value. Click on 'Go' to start the calculation.
The 'Console', 'Phase status' and 'Phase details' windows each show information on the
calculation which has just been performed. The final three lines of the console window list
the number of iterations, the calculation time, the temperature and the Gibbs energy of the
system. The '- OK -' message in the final line indicates that the calculation was successful,
with no errors reported. Also the 'start' symbol on the Quick access menu is changed to the
green check mark . If any errors do occur, the message '*** error ***' followed by a
description of the nature of the error will be displayed instead of the 'OK' message.
Moreover, the 'start' symbol in Quick Access menu will show a small warning sign . In this
case, reset the calculation with 'Set start values' and repeat it using 'Equilibrium'. It is always
advisable to check the status of the calculation in the console window or Quick Access menu
before proceeding.
The other lines visible in the console window are messages relating to the opening and
reading of the thermodynamic database.
14
Tutorial 2
Information on the phase stabilities is shown in the 'Phase summary' window. Those phases
with non-zero phase fractions are termed 'active' and are listed in the first block. Inactive
phases (those which are unstable, with negative driving forces) are listed in the second block.
The third column gives the phase fraction and the column after 'dfm:' gives the driving force
in J/mole. It can be seen that BCC_A2 (ferrite) and GRAPHITE are the stable phases at 700°C.
The 'Phase details' window provides more comprehensive information on the properties of
the phases, including the molar Gibbs free energy of the phase (the number after 'gm:') and
15
Tutorial 2
the phase compositions (expressed in mole fraction by default), as well as the information
provided in the 'Phase summary'. The phases are again grouped according to whether they
are active or inactive.
To change the units in which the composition is displayed in the 'Phase details' window, first
highlight this window and then go to the 'Options' window. (If this is not shown on the
screen, make it appear by selecting 'View > Show > Show options window' or right-clicking in
the toolbar area and selecting 'options' from the menu.)
The 'Options' window provides display options for the currently highlighted window. In the
case of the 'Phase details' window, the composition can be displayed as a mole fraction, a
weight fraction or a u-fraction, and can also be expressed as a percentage if required.
16
Tutorial 2
The calculation has shown that at 700°C, BCC_A2 (ferrite) and graphite are the equilibrium
(i.e. most thermodynamically stable) phases. However, it is observed in practice that in Fe-C
systems with relatively low carbon contents, graphite formation is extremely slow, and can be
considered not to occur over practical timescales.
Since this is the case, it is useful to calculate a metastable equilibrium, for which graphite
formation is not allowed. Go to 'Global > Phase status' and highlight 'GRAPHITE'. In the
'General' tab, the uppermost section is labelled 'Flags…'. Click to place a tick in the box next
to 'suspended' and click 'OK'.
17
Tutorial 2
Repeat the equilibrium calculation and note the difference in results in the 'Phase summary'
window:
BCC_A2 * act 9.29191-001 dfm: +0.00000e+000
GRAPHITE
Now BCC_A2 and CEMENTITE are active, FCC_A1 and LIQUID are inactive and GRAPHITE is
listed as 'suspended'. Suspending a phase causes the program to consider it as if it were not
there at all; the next most stable phase (in this case, cementite) becomes the equilibrium
phase. Alternatively, the flag can be set to 'fixed phase fraction' using the same procedure
(i.e. in the 'General' tab of the 'Phase status' window, remove the tick from 'suspended' and
place it in the 'fixed phase fraction' box for the graphite phase). Next, click on 'set amount…'
in 'Phase fractions' area and type '0' (zero) in the appearing 'Input…' window.
18
Tutorial 2
Perform an equilibrium calculation again. In this case, the phase is considered not to appear,
but its driving force is still evaluated. Also, cementite becomes active, as shown by the results
below:
BCC_A2 * act 9.82166-001 dfm: +0.00000e+000
In order to eliminate graphite completely from the system, open the 'Phase status' window,
select the 'GRAPHITE' phase and click on 'Remove' button.
19
Tutorial 2
A new window will appear in which MatCalc will ask you to confirm this wish - click on 'Yes'.
Repeat the equilibrium calculation at 700°C to obtain an equilibrium without graphite. The
driving forces obtained should be identical to those found in the previous calculation in which
graphite was suspended:
BCC_A2 * act 9.29191-001 dfm: +0.00000e+000
Adding any other phase to the system requires re-opening the thermodynamic database and
selecting the new phase next to the already highlighte ones. Re-open 'Global > Databases'
and click on GRAPHITE to select it, then click on 'Read & Close'. A warning will appear, stating
that all existing data will be deleted. Accept this by clicking on 'Yes'. A new message, with
updated information on the thermodynamic data, appears in the 'Output' window. Reading
in new data from the database erases any previous equilibrium calculation results, so perform
20
Tutorial 2
the equilibrium calculation at 700°C once again to obtain an equilibrium with graphite (if you
get an error message, click on 'Set start values' in 'Calc' menu). This time, the driving forces
obtained should be identical to those found in the previous calculation in which graphite was
present in the system:
BCC_A2 * act 9.82166-001 dfm: +0.00000e+000
CALCULATION STATES
By default, the results from a previous equilibrium calculation are overwritten when a new
calculation is carried out. However, it is sometimes useful to store the results from a
calculation for future use. The 'Calculation states' feature is provided for this purpose; it can
be found in the 'Global' menu under 'CalcStates'. In the sub-menu, click on 'Create' and type
the name in the box:
The calculation state stores all information on an equilibrium including the complete phase
status, composition and any compositional states which may apply. Calculate another
equilibrium at 600°C and store it by creating another calculation state. These states are now
both available in the calculation state drop-box on the toolbar:
21
Tutorial 2
Select a calculation state from this box and load the stored equilibrium with the button
(This can also be done using 'Global > CalcStates > Select' and then 'Load' ). Note how the
contents of the 'Phase details' and 'Phase summary' windows are immediately updated with
the results stored in the calculation state, and the temperature at which the equilibrium was
calculated is shown in the status bar towards the bottom right of the screen. The results of
the current equilibrium calculation can be saved into an existing calculation state by selecting
the name of the state in the drop-box and then clicking on the button or using 'Global >
CalcStates > Select' and then 'Save'. NB: Calculation states, like all other calculation results,
are erased when data is re-read from the database!
TO FINISH...
Save the workspace using 'File > Save as…'. Workspace files are automatically given the file
extension '.mcw'.
22
Tutorial 3
CONTENTS
23
Tutorial 3
BEFORE STARTING...
Re-open the file saved from Tutorial 2 and load the calculation state 'Equil @ 600°C'.
In phase status window, remove graphite phase. Select 'Stepped calculation…' from the 'Calc'
menu or click on the icon. The 'Step equilibrium' window will appear. Select
'Temperature' (the uppermost choice in the left-hand column).
In the 'Range' box, the default 'Start', 'Stop' and 'Step interval' values are 400, 1600 and 25
respectively. Keep these values and verify that the 'Temperatures in Celsius' option has been
selected. The step direction is unimportant, and it is not necessary to enter the interval as '-
25' if stepping in a negative direction. The contents of the 'Vary' and 'Boundary conditions'
boxes are currently greyed-out because they are not applicable to a temperature-step
calculation. Click on the 'Go' button at the bottom right of the window.
24
Tutorial 3
OUTPUT
25
Tutorial 3
26
Tutorial 3
AktStepVal: 673.160000
- OK -
BUFFERS
All the equilibria listed above are stored in a buffer. In other words, a buffer is a collection of
calculation states, with each calculation state created in a different temperature. The default
buffer is named '_default_', and its contents are overwritten when a new stepped calculation
is carried out.
To be able to keep more than one set of stepped equilibria, additional buffers must be
created. Firstly, rename the existing default buffer using 'Global > Buffers > Rename'. Type
'T=400 to 1600°C' into the 'New buffer name' box and click 'OK'. Then, create a new buffer
using 'Global > Buffers > Create'. This new buffer will contain the results from a new stepped
equilibrium calculation in which the carbon content is varied from 0 to 1.5 wt.% at 500°C, so
27
Tutorial 3
enter the name 'C=0 to 1.5 at 500°C'. Note that buffers can be selected from the drop-box in
the toolbar area or using 'Global > Buffers > Select'.
Calculate an equilibrium at 500°C. Open the 'Step equilibrium' window again, but this time
select 'Element cont..' instead of 'Temperature' in the 'Type' box. Enter '0', '1.5' and '0.05'
respectively as the start, stop and step interval values. (Note that, as shown in the image
below, MatCalc accepts either a decimal point or a comma as the decimal separator.) In the
'Boundary conditions' box, ensure that the element selected is 'C', and enter the
temperature as '500'. Ensure that in the 'vary' box, 'global comp' is selected, and that in the
'Options' column, 'Temperatures in Celsius' and 'Composition in weight percent' are both
selected, then click on 'Go'.
28
Tutorial 3
AktStepVal: 0.000000
- OK -
30
Tutorial 3
AktStepVal: 0,000000
- OK -
The 'console' window provides information on which phases are stable at a given
temperature and carbon content, but not on the phase fractions or compositions. However,
this detailed information is stored in the buffers and can be found by selecting 'Global >
Buffers > Edit buffer states'.
31
Tutorial 3
The upper part of the 'step value' area contains a drop-box for selecting a buffer, and the
lower part gives a list of the step-values at which equilibria have been evaluated. These are
either temperature or carbon content values, depending on the buffer chosen, and their units
are those specified in the 'Step equilibrium' window when setting up the calculation. The
'Tsol' or 'Xsol' values are also stored. If the 'auto load' box at the bottom left is ticked,
clicking on a step-value loads the equilibrium, and the contents of the 'Phase summary' and
'Phase details' are immediately updated with phase fraction and composition details for this
equilibrium. The next two tutorials demonstrate how to produce graphical plots of phase
fractions, compositions and many other quantities as a function of the stepped variable.
TO FINISH...
Save the workspace file - it will be needed again in Tutorial 4.
32
Tutorial 4
CONTENTS
33
Tutorial 4
BEFORE STARTING...
Open the file saved from Tutorial 3 and select the buffer named 'T=400 to 1600°C'.
PLOTTING A GRAPH
To plot numerical results, it is first necessary to create a graphical window. In the 'View'
menu, click on 'Create new window' or click on icon.
In the 'Create new window' box which appears, there is a list of a number of possible window
types. Among these are '(a5)' and '(a6)', which are the familiar 'phase summary' and 'phase
details' windows automatically placed on the screen when a new workspace file is created.
Select type '(p1) Plot core: XY-data' and click on 'OK'
34
Tutorial 4
35
Tutorial 4
An empty plot with x- and y-axes appears on the screen. Locate the 'Variables' window - if it
is not present, right-click in the toolbar area at the top of the screen and select it from the
menu, or click on icon in the 'Quick Access' menu. Expand the 'favorites' section by
clicking on the small plus-sign to its left. Then, further expand the section labelled 'F$*' to
give the list shown below.
The syntax 'F$BCC_A2' means 'the phase fraction of BCC_A2', where the dollar sign is a
separator between the variable 'F' and the phase to which it applies 'BCC_A2'. In the heading
of the list, 'F$*', the asterisk is a wild-card indicating 'all phases'. Select 'F$*', drag it to the
empty plot and drop it.
The plot should appear as shown below:
36
Tutorial 4
The 'Options' window can now be used to modify the appearance of the plot as required.
(Again, if this is not currently shown, it can be made to appear by clicking on icon in the
Quick Access menu or the right-click menu in the toolbar area.)
Firstly, note that there is a 'buffer' drop-box. By selecting one of the other buffers, the
contents of the plot can be changed. The 'default x-data' option (the second line down in the
options window) is set to StepValue, i.e. the value of the stepped variable used in the stepped
equilibrium calculation.
Thus, on selecting the 'C=0 to 1.5 at 500°C' buffer, the x-value changes to carbon content,
and the plot looks like this:
37
Tutorial 4
and the plot for the 'C=0 to 1.5 at 800°C' buffer looks like this:
Select the 'T=400 to 1600°C' buffer from the buffer drop-box. One of the first things to note is
that the x-axis data does not run from 400 to 1600; this is because the step value is expressed
by default in Kelvin rather than in Celsius. To change this, double-click on the 'default x-data'
line. A box appears, entitled 'New value for 'default x-data''. Enter 'T$C' (temperature in
Celsius) in place of 'StepValue'.
The plot can be changed from colour to black-and-white ('b/w') using the 'style sheet' drop
box.
The 'plots' section of the options menu can be expanded using the plus-sign. Below 'plot#0'
(the name of the current plot) is a list of options for this plot:
38
Tutorial 4
TITLE
This is blank by default. Double-click to enter a title, e.g. 'Phase fraction versus temperature
for Fe-0.4 wt.%C'.
LEGEND
This comprises options for the position of the legend and for the style of the box surrounding
it.
AXES
The 'axes' section expands to give options for the 'x-axis', 'y-axis', '2nd x-axis' and '2nd y-axis'
(the latter two are not used in the current plot).
39
Tutorial 4
Double-clicking on the 'title' line for x-axis will bring up a box entitled 'New value for 'title':'.
Enter 'Temperature [°C]'. In the same way, change the y-axis title to 'Phase fraction'.
The axis type can be set to either linear or logarithmic. A linear scale is more suitable for the
temperature axis, but a logarithmic y-axis enables the fractions of minor phases, such as
cementite in this example, to be seen more clearly. Change 'lin' to 'log' for the y-axis.
The automatically assigned minimum y-value on the log-scale may not be appropriate, so if
this is the case, double-click on 'scaling' and replace 'auto' with '0.01..1'. The two numbers
are the lower and upper limits respectively. If one or other of these is missed off, an
automatic value is assigned instead. (For example, using '0.01..' is sufficient to give a scale
from 0.01 to 1, since 1 is the maximum value of F$*).
The changes on the x-axis properties will be visible only when the 'use for all plots' setting at
'default x-axis' is set to 'no'. More information about the 'default x-axis' concept will be given
in the next tutorial.
40
Tutorial 4
GRID
This allows gridlines to be added to the plot, and their appearance to be modified. Change
'disabled' to 'enabled' for 'major-x' and 'major-y' to show major gridlines.
SERIES
Expanding the 'series' section gives a list of options for each data-series. The name of the
series (as it appears in the legend) can be changed using 'name'.
The 'locked' option, when set to 'yes', protects the series from any changes when the
contents of the buffer are updated. A locked series is indicated by an asterisk by the name, if
the automatic name is used.
'Derivative' can be used to display the numerically evaluated first or second derivative of a
series.
41
Tutorial 4
The 'x-data' and 'y-data' options control which data-sets are displayed on the x- and y-axes. If
the 'x-data' is set to 'auto', the default x-data, as specified above, is used.
The appearance of the plots can be modified by setting 'default style' to 'no' rather than
'yes', and then expanding 'line' and 'marker' to give a list of options for colours, styles, sizes
etc.
42
Tutorial 4
Left-click in the plot area and drag the mouse to draw a rectangular box. When the mouse
button is released, an enlarged version of the region within the box is shown on the axes.
Right-click anywhere in the plot area to return to the original scale.
When moving the mouse pointer on the plot area, a black cross appears with the y- and x-
values next to it. The coordinates of the centre of the cross are also shown on the status bar
at the bottom left of the screen. A larger, red cross can be obtained by pressing the right
mouse button.
Right-clicking in the plot window but outside the area of the plot itself gives a context menu
as shown below.
Clicking on 'Copy to clipboard' allows to export this single plot or the whole frame (i.e. all
plots in this window) in the pixmap (.bmp) or scalar vector graphics (.svg) format. Then the
exported piece can be pasted to the relevant graphical application. Additional for the plot,
there is a possibility to export the numerical data which will appear in the form of tab-
separated columns after the paste operation.
Clicking on the 'Export to file' will create the file containing the plot or the whole frame. The
possible output file formats are '.png', '.svg' and '.pdf'
TO FINISH...
Save the workspace file.
43
Tutorial 5
CONTENTS
• Adding further plots to a plot window
• Using the built-in variables
• Defining a default x-axis
• Modifying the series
• Adding a new series to a plot
• Removing a series from a plot
• Duplicating and locking series
• Editing series data
• Converting series to tables
44
Tutorial 5
BEFORE STARTING...
Re-open the file saved in Tutorial 4 and save it under a new name.
Highlight the plot window and right-click in this window outside the plot area to bring up the
plot context menu already seen in Tutorial 4. Click on 'New plot'.
VARIABLES
As well as the phase fraction variables 'F$*' encountered in the previous tutorial, MatCalc
contains many other built-in variables which are evaluated at each step-value of the stepped
equilibrium calculations. These can be found in the variables window. Information about each
variable is contained in the small window below the main variables window. Locate the
'driving forces' category and drag 'DFM$*' to the empty plot window, to give a plot as shown
below.
45
Tutorial 5
Other variable categories of particular interest for stepped equilibrium calculations are
highlighted in blue in the image below:
- 'FAVORITES'
This contains the most frequently needed variables: temperature in Kelvin ('T') and in Celsius
('T$C'), step-value, phase fractions ('F$*') and compositions expressed in mole fraction
46
Tutorial 5
('X$*$*') and in weight percent ('X$*$*$wp'). In these composition variables, the first
asterisk represents the phase, and the second, the element, for example 'X$LIQUID$C'.
-'GENERAL'
Temperature, step-value and pressure can also be found under this category. The
temperature is in Kelvin by default, but the temperature in Celsius can be obtained by
appending '$C', as has already been seen in the 'Favorites' category. This suffix is known as a
'unit qualifier'. The 'information on variables' window shows the valid unit qualifiers for the
variables:
- 'PHASE FRACTIONS'
- 'COMPOSITION'
This contains the 'X$*$*' composition variables mentioned above, and a number of other
composition-related variables, expressed either as either mole fractions (X…) or as u-
fractions (U…). (Not all of these are applicable to stepped-equilibrium calculations, e.g.
'XPR$*$*' and 'UP$*$*' are for precipitation calculations).
Compositions in weight percent are not given separately here, but it can be seen from the
'variables information' window that 'wp' is a valid unit qualifier for the variables beginning
with 'X'. This means that weight percentages can be obtained by appending '$wp' to the
names of these variables.
47
Tutorial 5
- 'SITE FRACTIONS'
The 'Y$*$*$*' variables give the site fraction of an element on a particular sublattice of a
phase. For example, BCC_A2 has the variables 'Y$BCC_A2$FE$0' (site fraction of iron on
sublattice 0) and 'Y$BCC_A2$C$1' (site fractions of carbon and vacancies on sublattice 1). The
'YX$*$*' variables represent the mole fraction of an element on a particular sublattice
position of a phase; in this case, vacancies are not considered.
- 'STATE VARIABLES'
This category consists of a number of thermodynamic variables, including molar Gibbs free
energies, entropies, enthalpies and heat capacities of the system and of each phase.
These categories include chemical potentials 'MU$*$*', activities 'AC$*$*' and activity
coefficients 'ACC$*$*'.
Further plots can be added to the same plot window using 'New plot'; they will share the
same buffer, default x-data and colour scheme. Some examples are shown below:
- Molar Gibbs free energy ('GMP$*')
48
Tutorial 5
- Molar heat capacity ('CPP$*', note the lambda-anomaly at the Curie temperature in
BCC_A2)
When there are many plots in the plot window then they will get streched so much that they
will eventually become unreadable. In order to obtain a transparency, it might be a good idea
to arrange the plots in more than one column. To place the plots in two columns, click on
'plot columns' in 'Options' window and type '2' in the appearing dialog.
49
Tutorial 5
DEFAULT X-AXIS
To give a consistent appearance to all the x-axes in the plot window, a 'default x-axis' can be
defined. This is found towards the top of the 'Options' window. Change 'no' to 'yes' in the
'use for all plots' line and define the properties of the x-axis in the same way as for a normal x-
axis.
If the plot window contains several plots, right-clicking and dragging the mouse in one of
these will display not only a cross in that plot, but a vertical line at the same x-value in all the
others. An example is shown below:
50
Tutorial 5
51
Tutorial 5
By default, the carbon content is expressed in mole fraction. To change the units to weight
percent, firstly click on the new plot to select it. This should expand the section of the
'Options' list which applies to the new plot. Click on the triangle by 'series' to open the series
options:
Double-click on 'y-data' for the first series to open the following box. Append '$wp' to the
existing expression and click 'OK'.
This will change the values plotted for the 'LIQUID' series. Repeat for the other three series.
The final appearance of the plot, with appropriate axis labels added, should be as shown
below.
52
Tutorial 5
Note: Pressing Ctrl before selecting and dragging the desired variable will result in a de-
selection. MatCalc will hence block you from dropping the variable to a plot, as nothing has
been selected in reality and an error would occur.
53
Tutorial 5
- 'NEW SERIES'
The 'New series' part of the menu expands to give the following sub-menu (provided that a
plot is selected).
Clicking on 'core buffer results' creates an empty series (given the name of 'auto' on the plot)
to contain variables evaluated from the results of a buffer. Edit the 'y-data' line in the
'Options' window for this series to enter any valid built-in or user-defined variable or an
expression.
Variables can be copied from the 'Variables' window by right-clicking on the expression
required to display a menu containing Copy, Paste and other operations.
54
Tutorial 5
- 'table/experimental data': allows the user to add a set of experimental data points to a plot.
- 'function/expression': enables an algebraic expression in (x) to be entered.
- 'REMOVE SERIES', 'R EMOVE ALL SERIES', 'REMOVE ALL LOCKED SERIES'
To remove a series from a plot, first click on the plot to select it. This will expand the part of
the Options list which applies to the plot. Select the name of the series from this list and
choose 'Remove series' from the right-click menu (shown above) or press 'Delete'. Multiple
series in the same plot can be selected at once by holding down the CTRL key while clicking on
the series names. 'Remove all series' in the right-click menu deletes all the series in the
selected plot. 'Remove all locked series' removes all the series which are locked (locking the
series is described below).
- 'DUPLICATE AND LOCK SERIES ...', 'DUPLICATE AND LOCK ALL SERIES'
This feature is available in the right-click menus of both the Options window and the plot
window. Click on 'Duplicate and lock series', select a series from the list shown and click on
'Duplicate' button. This will lock the original series and create a copy.
'Duplicate and lock all series' performs this operation for all series in the selected plot
window.
The locked series is protected from any changes when the buffer contents are updated with
new calculation results, while the copy is unlocked. This enables an easy comparison between
results obtained under different conditions.
55
Tutorial 5
This is also available in both the Options and the plot windows. Select a series in the
appearing window and click on 'Edit…' to display a table containing the numerical data used
to plot the graph.
The data can be copied using the 'Copy selection' or 'Copy all' buttons. The contents of the
rows and columns can be modified using 'Paste' (to add data copied from another source),
'Clear cell(s)', 'Insert row', 'Insert col' and 'Delete rows/cols' buttons. Use 'Write' to save the
whole dataset to a text file and 'Read' to load a dataset from a text file.
This places the data from the series into a named table, which can be accessed from the
'Global' menu.
Select the 'series' in 'Options' window, click on 'Convert series to table', select the series
name and edit the name of the table, if necessary, in the box which appears, as shown below.
56
Tutorial 5
To open and edit a table, select 'Tables and arrays' from the 'Global' menu. This will display a
list of all the available tables, which can be edited in the same way as the series data
described above.
57
Tutorial 6
CONTENTS
58
Tutorial 6
Create a second plot in the same window. Set the 'default x-data' in the Options window to
'T$C', and define a default x-axis for all plots labelled 'Temperature [°C]'.
59
Tutorial 6
60
Tutorial 6
DEFINING FUNCTIONS
CREATING A NEW FUNCTION
If the expressions such as 'X$BCC_A2$C*F$BCC_A2' are likely to be used more than once,
they can be defined as functions. Select 'Global > Variables & Functions'. This brings up a box
containing several tabs; click on 'Functions'.
Click on 'New' and type in a name for the function in the box which appears, for example,
'C_in_liquid'. In the 'Expression' box, type in 'X$LIQUID$C*F$LIQUID'. For convenience, this
can be copied from the 'y-data' line in the 'Options' window of the plot just finished. (N.B.
There is no need to put an '=' sign at the beginning of the expression.) Click on 'Set' to
register the expression. Repeat for the three other expressions plotted above.
Close the 'Functions & Variables' box to return to the main screen. Expand 'functions' in the
'Variables' window by clicking on the small plus-sign to the left of the word. This should give a
list of the new functions:
61
Tutorial 6
Make a new plot and drag and drop the functions just defined into it (To select multiple
entries, hold 'Ctrl'-key while clicking on them), together with the 'XS$C' variable, to check that
this gives the same appearance as the plot above.
NEW EXPRESSIONS USING EXISTING FUNCTIONS
The fraction of the total carbon content in the system which is in the liquid phase can be
calculated by dividing the function 'C_in_liquid' by the total carbon content XS$C. Re-open
the 'Functions' tab in 'Variables & Functions' window and create a new function named
'Fraction_C_in_liquid'. Enter 'C_in_liquid/XS$C' in the 'Expression' box and click on 'Set'.
Repeat for the other three phases.
On returning to the main screen, create a new plot and drag and drop the new
'Fraction_C_in…' functions into it. (This may necessitate clicking on the triangle sign by the
side of 'Functions' to close and re-open it with the new functions displayed.) The resulting
plot should have the same appearance as the two plots above, but a different y-scale, this
time going from 0 to 1.
The user-defined functions are saved in the workspace and can be used for all subsequent
calculations in that workspace.
Change the 'default x-data' in the Options window to 'StepValue', and the name of the
default x-axis to 'C content [wt.%]'. Make a new stepped calculation in the '_default_' buffer,
varying the carbon content from 0 to 0.5 wt.% (with 0.005 step) at 1475°C .
The phase fraction curve below shows that the carbon content has a strong influence on
phase stability at this temperature. Increasing the carbon content stabilises FCC_A1 at the
expense of BCC_A2, and then at higher carbon contents the liquid phase also becomes stable.
62
Tutorial 6
The two sets of user-defined functions appear as shown below, and in this case they provide
different ways to illustrate the results.
63
Tutorial 6
USER-DEFINED VARIABLES
The final part of this tutorial demonstrates the use of the 'Variables' tab under 'Global >
Variables & Functions'.
In the plot of C_in_liquid, C_in_bcc, etc., the curves are made up of almost straight-line
sections, so it should be possible to find analytical expressions of the form y = ax +b for these,
where 'a' is the gradient and 'b' the intercept on the y-axis.
The C_in_liquid line starting from around 0.28 wt.% C will be used as an example. To find an
equation for this line, two (x, y) values on the line are needed. For the first of these, y=0 can
be used. To find the exact x-value at which the liquid phase fraction is zero, look at the
'console' window which contains now the equilibrium phases present in the system for
various carbon contents. The line starting with 'Xsol 'LIQUID' shows the LIQUID zero-phase
boundary at 1475°C in terms of carbon content.
36, 0,00 s, 0,275, its 3, FCC_A1 - OK -
The first (x, y) pair is therefore (0.2780809, 0). Go to 'Global > Variables & Functions' and
select the 'Variables' tab. The variable 'x' is already shown in the left-hand column. This is the
StepValue, and currently has a value of 0.5.
Click on 'New' and in the box, type in 'x1'. Select it (in the 'Available items' box) and type in or
paste the first x-value (i.e. '0.2780809') in the 'Expression' box (confirmed by clicking on 'Set').
64
Tutorial 6
Add another variable 'y1'. This has a default value of zero, which does not need to be
changed. The second (x, y) pair can be obtained by finding the y-value at x=0.5. Either use edit
the buffer state for this composition ('Global > Buffers > Edit buffer state', click on '0,5' in the
'Buffer' box) or simply set the composition to 0.5 wt.% C and calculate an equilibrium. In both
cases, the value of 'C_in_liquid' at this composition can be seen in the 'Variables' window. Go
to 'View > Create New Window' and choose 'd1: List variable'. Drag and drop 'C_in_liquid'
from the 'Variables' window into the new 'List variables' window which appears.
C_in_liquid +1.536688764453e-002
The numerical value can be selected and copied from this window. Re-open the
'Functions&Variables' window and add the new variables 'x2' and 'y2', equal to 0.5 and
1.536688764453e-002 in the 'Variables' tab, respectively.
The slope a and intercept b of the straight line can now be entered; a is equal to (y2-y1)/(x2-
x1) and b to ((x2*y1)-(x1*y2))/(x2-x1). Create a new variable named 'a', type in the formula
(or try to copy it from this tutorial) and click on 'Set'. This evaluates the expression and places
the numerical value in the 'Expressions' box in the place of the formula. Do the same for 'b'.
In the 'Functions' tab, the equation of the line can now be entered. Create a new function
'Liquid_line' and type '(a*x)+b' into the 'expression' box. Click 'Close' to return to the main
screen.
Drag the new 'Liquid_line' function from the 'Variables' window to the plot of 'C_in_liquid',
etc. The resulting plot should look like this:
The 'Liquid_line' function extends to negative values, unlike the true C_in_liquid curve, which
has a value of zero for carbon contents between zero and 0.27 wt.%.
One way of removing the unwanted part of this line is to select 'Edit series data' from the
right-click menu. In the resulting table of 'Liquid_line' series, select all the rows for which the
y-value is negative and then click on 'Delete rows/cols' to remove them. Accept the warning
with 'OK'.
65
Tutorial 6
66
Tutorial 6
The plot should now look as shown in the image below (with the 'Liquid_line' series
highlighted).
67
Tutorial 7
CONTENTS
• Using “Search phase boundary” with temperature variation to determine solidus and
liquidus
• Determining austenite ↔ ferrite transformation temperatures
• Finding phase boundaries for carbide phases in terms of temperature and element
content
• Tracing a phase boundary on axes of temperature versus element content
68
Tutorial 7
It was seen in Tutorial 3 that MatCalc evaluates solubility temperatures (Tsol) or compositions
(Xsol) during the course of stepped equilibrium calculations. It is also possible to calculate
these individually using the 'Search phase boundary' function.
69
Tutorial 7
It is the following line in the database file mc_fe.tdb which causes the second FCC_A1 phase
to be created:
ADD_COMPOSITION_SET FCC_A1 :TI,NB,V:C,N: !
This creates that a new phase of type FCC_A1 with Ti, Nb or V as the major constituents on
the first sublattice and C or N as the major constituents on the second when the system
contains these elements. The 'General' tab in the 'Phase status' box ('Global > Phase status')
shows the major constituents for each phase, :FE:VA: and :NB:C: respectively for FCC_A1 and
FCC_A1#01.
70
Tutorial 7
The solidus temperature is defined by zero phase fraction of liquid. To calculate this, choose
'Search phase boundary' from the 'Calc' menu or click on the icon. The box below
appears. Select 'Temperature' in the left-hand column and 'LIQUID' in the 'Target phase'
column, then click on 'Go'.
The liquidus temperature is the dissolution temperature of the last solid phase, which in this
case is BCC_A2. Selecting 'BCC_A2' as the target phase gives the following result:
Tsol 'BCC_A2': 1433,30 C (1706,46 K) iter: 13, time used: 0,01 s
Of course, this is not a liquidus temperature, as it cannot be lower than the solidus
temperature. This result is given because MatCalc finds the zero phase fraction temperature
of BCC_A2 phase next to the temperature of the last calculation which was 1478.08°C in this
case (the liquidus temperature). Information given in 'Phase summary' window explains that
at 1433.30°C, BCC_A2 appears next to FCC_A1 phase (inactive BCC_A2 phase has the driving
force value of zero). It is recommended to look at the 'Phase summary' window in order to
check if the found phase boundary is the desired one!
The liquidus phase can be easily found if an equilibrium calculation in the liquid system is
performed first. Calculate an equlibrium at 1600°C (or any temperature in which system
71
Tutorial 7
contains only a liquid) and search again for the phase boundary of BCC_A2 phase. This time
the following result should be given:
Tsol 'BCC_A2': 1527,57 C (1800,73 K) iter: 4, time used: 0,02 s
In general, the correct phase boundaries are found if the initial equilibrium describes the
system in the neighbouring phase field which does not contain the searched phase - in the
case presented above, the liquidus temperature (which is phase boundary of 'BCC_A2') was
found from the 'LIQUID' phase field. Also, the algorithm used to search for phase boundaries
might fail to converge if the starting point is too far away from the boundary.
Low-alloy steels undergo a ferrite - austenite phase transformation between 700 and 800°C
(see, for example, Tutorial 4). To find the exact temperatures of the transformation in the Fe-
0.1wt.%C-0.3wt.%Nb system, calculate an equilibrium at 700°C and use again 'Search phase
boundary'. Select 'FCC_A1' as a target phase to identify the zero-phase boundary
temperature for austenite.
Tsol 'FCC_A1': 726.52 C (999.68 K) iter: 5, time used: 0.03 s
The zero-phase boundary of BCC_A2 for this transformation can be identified by calculating
an equilibrium at 900°C and then searching for the boundary.
Tsol 'BCC_A2': 883,61 C (1156,77 K) iter: 5, time used: 0,01 s
Note that this is the same temperature as the zero-phase boundary of FCC_A1. Niobium
carbide, by contrast, remains stable at higher temperatures. Calculate an equilibrium at
1500°C before searching for the boundary.
Tsol 'FCC_A1#01': 1434,69 C (1707,85 K) iter: 16, time used: 0,03 s
72
Tutorial 7
Phase boundaries can also be found in terms of element content at a fixed temperature. To
illustrate this, the zero-phase boundary of cementite at 700°C will be evaluated in terms of
carbon content. Calculate an equilibrium at 700°C, then open the 'Search phase boundary'
box and select 'Element content' in the left-hand column. Set the target phase to
'CEMENTITE', the element to be varied to 'C', and the temperature to '700', then click 'Go'.
The output gives the carbon content for zero phase fraction of cementite in mole fraction and
in weight percent.
iter: 2, time used: 0,03 s, GibbsEnergy: -40690,502 J
Note: After the search for the phase boundary with element content variation, the
composition of the system is changed to the found value! (check 'Global > Composition')
In the same way, the zero phase fraction boundary for niobium carbide at 1000°C can be
evaluated in terms of the niobium content. Firstly, open 'Global > Composition' and reset the
carbon content to 0.1 wt.%. Calculate an equilibrium at 1000°C, then search for the phase
boundary for 'FCC_A1#01', this time setting the element to be varied to 'Nb'.
73
Tutorial 7
The output in the console shows the Nb content above which the carbide phase is
thermodynamically stable.
iter: 7, time used: 0,02 s, GibbsEnergy: -62314,291 J
Once a point on a phase boundary has been identified using the process described above, the
boundary can be traced as a function of element content. In the following example, the effect
of the niobium content on the temperature of the FCC_A1#01 (NbC) zero-phase boundary will
be calculated.
Having established the zero phase fraction boundary for niobium carbde at 1000°C, open the
'Step equilibrium' window using 'Calc > Stepped calculation' and select 'Phase boundary'
from the left-hand column.
In the 'Boundary conditions' box, set the element to 'Nb', the target phase to 'FCC_A1#01'
and the max. T-step to '100'. (The use of this parameter will be discussed in Tutorial 8) Enter
'0.01', '0.35' and '0.01' as the start, stop and step interval values in the 'Range' box. Click on
'Go' to perform the calculation.
74
Tutorial 7
Create a new X-Y plot window (Tutorial 4) and drag and drop 'T$c' (from 'favorites' category
in variables window) into it. The plot should look like this:
75
Tutorial 7
Right-click in the plot window outside the plot area and choose 'Duplicate and lock series'
from the window (see Tutorial 5). Double-click on the name of the series to duplicate it. In the
'Options' window, change the name of the original series ('*_T$c') to '0.1 wt.%C'.
Change the carbon content of the system to 0.05 wt.% C, calculate an equilibrium at 1000°C
and search again for the same phase boundary, then make a stepped calculation using the
same conditions as before. The phase boundary for 0.05 wt.% C should follow the green curve
in the plot below, which also shows the same phase boundary for 0.01 wt.%C - as an exercise
you can try to format the plot as shown below.
76
Tutorial 8
This tutorial introduces the calculation of phase diagrams with an example featuring the well-
known Fe-C binary system.
CONTENTS
77
Tutorial 8
78
Tutorial 8
Beginning at the high-temperature end of the diagram, the uppermost phase boundary at a
composition of 0.05 wt.% C is between a single-phase liquid region and a liquid and delta-
ferrite (BCC_A2) region. The first boundary which must be found is, therefore, a BCC_A2
phase boundary.
To locate the boundary, an equilibrium must first be calculated reasonably close to the
expected boundary temperature. It can be seen that the line lies somewhere between 1538°C
(the melting temperature of pure iron) and 1500°C. Click on the icon and enter the
temperature '1530'. (If this gives an error message, select 'Calc > Set start values' then repeat
the equilibrium calculation.) Then click on to open the 'Search phase boundary' window.
Select 'Temperature' in the left-hand column and 'BCC_A2' as the target phase. The 'Output'
window should show the following message:
Tsol 'BCC_A2': 1533.98 C (1807.14 K) iter: 8, time used: 0.03 s
This shows that a point on the boundary has been found successfully. The next step is to trace
this boundary using the stepped equilibrium function to vary the carbon content. Click on
and choose 'Phase boundary' from the left-hand column. Enter the range: '0' to '5', in
intervals of '0.01'. Select 'C' as the varying element and 'BCC_A2' as the target phase. Leave
the 'Max T-step' value at its default value of '20'. In the 'Options' section of this window,
check that 'Temperature in Celsius' and 'Composition in weight percent' are both selected.
Click on 'Go' to launch the calculation.
79
Tutorial 8
Now that the first phase boundary has been calculated, drag and drop 'T$C' from the
'Variables' window (where it can be found under 'favorites') to the plot. It is useful to add
gridlines to the plot (With plot window selected, go to 'Options' window and in
'plots'>'plot#0'>'grid' select 'enabled' for 'major-x' and 'major-y'). Note that the x-axis
currently only runs from zero to just over 0.5 wt.% C. From the point identified on the phase
boundary, the calculation first proceeds in a direction of increasing carbon content. However,
the BCC_A2 phase is not stable beyond approx 0.53 wt.% C, so the calculation (which cannot
reach the stop limit of 5 wt.% C) stops and the 'Continue in other direction?' message shown
above is displayed to ask whether the user wishes to complete the rest of the calculation, in
which the carbon content is decreased from the point identified at 0.05 wt.% C to zero.
80
Tutorial 8
Right-click in the plot window outside the plot area itself, and select 'Duplicate and lock
series' from the menu displayed. Select the name of the series and click 'Duplicate' to
produce a copy of the series. In the 'options' window, rename the first series 'bcc_high_1'.
The next phase boundary encountered on decreasing the temperature is between the LIQUID
+ BCC_A2 region and the BCC_A2 single-phase region, so this is a LIQUID-phase boundary.
1500°C would appear to be a suitable temperature for the starting equilibrium to find this
line. In the 'search phase boundary' box, select 'LIQUID'. The following line of output should
appear:
Tsol 'LIQUID': 1515.43 C (1788.59 K) iter: 4, time used: 0.03 s
Then make a stepped calculation with the same start, stop and interval values and the target
phase set to 'LIQUID'. (A start-value of zero is automatically changed by the program to '1e-
12' to facilitate the calculation.) The diagram should now look like this:
81
Tutorial 8
Calculate an equilibrium at 1400°C, search for BCC_A2 (the boundary temperature should be
1429.60 C (1702.76 K)), step from 0 to 5 wt.% C with an interval of 0.01 wt.% C. Accept the
'Continue in other direction' message (the calculation could not reach 5 wt.% C limit, again)
with 'Yes'.
Calculate an equilibrium at 1500°C, search for FCC_A1, step from 0 to 5 wt.% C with an
interval of 0.01 wt.% C. The boundary temperature should be 1460.18 C (1733.34 K).
UPPER BOUNDARY OF LOW-TEMPERATURE ('ALPHA') FERRITE, BCC_A2
Calculate an equilibrium at 900°C, search for BCC_A2, step from 0 to 5 wt.% C with an interval
of 0.01 wt.% C. The boundary temperature should be 888.64 C (1161.80 K). The image below
shows how the diagram should look, with appropriate labels for the lines:
82
Tutorial 8
The most of the upper section is now done, with the exception of the phase boundary
between LIQUID and LIQUID + CEMENTITE for hypereutectic compositions. This line is
continuous with the cementite line between the FCC_A1 and FCC_A1 + CEMENTITE regions
and the horizontal line between BCC_A2 + FCC_A1 and BCC_A2 + CEMENTITE regions, so it
will appear when this line is calculated.
In the lower section, there is a very narrow alpha-ferrite single-phase region at low carbon
contents. The upper part of this region is bounded by an FCC_A1 boundary, and the lower
part of the region by a CEMENTITE boundary. Since these two boundaries are very steep, it is
necessary to modify the calculation parameters. Failure to do this can lead to incorrectly
calculated boundaries.
Calculate an equilibrium at 600°C then search for the FCC_A1 phase boundary, which should
be at 726.52°C. Step from 0 to 5, with an increment of 0.001 instead of 0.01. This reduced
increment makes the calculation rather more time-consuming; on a slow machine, it may be
better to divide it into two parts: step from 0 to 0.02 with an increment of 0.001, duplicate
and lock, step from 0.02 to 5 with an increment of 0.01.
Calculate an equilibrium at 800°C. Search for the CEMENTITE phase boundary; this also should
be at 726.52°C. Using the same settings as for the previous stepped calculation, the phase
boundary is calculated correctly, but might extend in the negative temperature direction
beyond physically reasonable values. This occurs because the calculated boundary becomes
83
Tutorial 8
Do not forget to lock the last series to be added, so that it is not modified when another
calculation is performed. Add axis labels and a title 'Fe-Fe3C phase diagram'. The subscript
can be obtained using HTML tags:
Fe-Fe<sub>3</sub>C phase diagram
The finished phase diagram should look like this; compare with the sketch below to verify that
all the lines have been calculated correctly.
84
Tutorial 8
The image below shows an expanded version of the low-C region presenting the phase
solubility of alpha-ferrite.
are given at the foot of the page. The diagram below shows how the finished diagram should
look. (Alternatively, the phase boundaries from the Fe-C calculations can be superposed on
the Fe-Fe3C phase diagram for comparison.)
- Upper boundary of high-T bcc: Equilibrium at 1550°C (Tsol 'BCC_A2': 1533.98°C); step from
0 to 5 with interval of 0.01, max T-step 20
1. Lower boundary of liquid: Equilibrium at 1500°C (Tsol 'LIQUID': 1515.43°C); step with
same parameters
2. Lower boundary of high-T bcc: Equilibrium at 1400°C (Tsol 'BCC_A2': 1429.60°C); same
parameters
3. Upper boundary of fcc: Equilibrium at 1500°C (Tsol 'FCC_A1': 1460.18°C); same
parameters
4. Upper boundary of low-T bcc: Equilibrium at 900°C (Tsol 'BCC_A2': 888.64°C); same
parameters
5. Lower boundary of fcc: Equilibrium at 700°C (Tsol 'FCC_A1': 738.02°C). For this line,
the parameters must be modified: decrease the interval to 0.001 or increase the T-
step to 200. The latter solution (an interval of 0.01 and a T-step of 200) is acceptable
because this boundary is a straight line so is correctly defined despite there being only
a few points in this region. An error message (max no of iterations reached) may
appear, but the line is calculated successfully.
6. Upper boundary of graphite: Equilibrium at 800°C (Tsol 'GRAPHITE': 738.02°C). If
problems occur, decrease the interval to 0.001 as well as increasing the T-step to 100
to obtain better resolution of the phase boundary curvature. This boundary, like the
cementite boundary discussed above, tends to 'overshoot' to very low temperature
values. This can be prevented by setting the minimum carbon content for the stepped
calculation to 0.0005 instead of 1e-12.
86
Tutorial 9
CONTENTS
87
Tutorial 9
• LIQUID: 1450°C
• FCC_A1: 1500°C (N.B. the correct value of Tsol 'FCC_A1' should be 1480.93°C.)
• BCC_A2: 1450°C
88
Tutorial 9
Next, calculate the boundary for niobium carbide (FCC_A1#01). The temperature of the
boundary depends strongly on carbon content, but an equilibrium at 1450°C gives a suitable
starting point for finding it.
Increase the maximum T-step to 100 to cope with the steepness of the curve. The boundary
may extend to very small temperature values; in this case, change the scale on the y-axis to
'500..' so that only the relevant information is shown.
The final three lines can be calculated as follows:
The finished diagram, with titles and labels added, should look like this:
interval values and under 'Boundary conditions', change the varying element to 'NB' and
'max. T-step' to '20'.
The boundaries can be calculated with the same starting equilibrium temperatures as for the
Fe-C diagram, because the basis composition used for calculating the equilibrium and finding
a point on the boundary remains the same (0.1 wt.% C, 0.3 wt.% Nb). Search for and plot all
the following boundaries:
The NbC (FCC_A1#01) boundary is slightly more complex in this example, so it will be
considered in more detail. Firstly, calculate an equilibrium at 1000°C and search for the
FCC_A1#01 phase boundary varying temperature. This is at 1434.69°C. Make a stepped
calculation from 0 to 1 wt.% Nb with 0,001 step and max. T-step value of 2. The calculation
starts as usual at the niobium content used to calculate the equilibrium (0.3 wt.%), and this is
first increased up to the 'stop' value (1 wt.%, in this case) and then decreased to the 'start'
value (0). It can be noted, however, that the calculation terminates at the 'cementite' line
during decreasing the Nb content. In order to find the phase boundary outside these limits,
additional calculations must be performed. After locking the previous curve, calculate an
equilibrium at 500°C and search for the FCC_A1#01 phase boundary at this temperature (i.e.
vary the Nb content). Due to the steep boundary, it is recommended to set the calculation
step to 0.001 and the max. T-step value to 200. Part-way through this calculation, the
following message might appear:
90
Tutorial 9
91
Tutorial 9
Calculate the following lines. The solution temperatures are given as a guide, as well as notes
on calculation settings (Accept any questions about changing the direction of calculation)).
• BCC_A2: 1531.42°C
• LIQUID: 1499.64°C. A warning message may appear; accept this with 'Yes'.
• FCC_A1: 1466.52°C. The same warning may appear.
• BCC_A2: 1422.52°C
• BCC_A2: 891.36°C. Step from 0 to 0.00399 rather than 0.004 to avoid convergence
problems.
• FCC_A1: 726.52°C. Calculation from 0 to 0.00399 with 1e-6 step.
• CEMENTITE: 726.52°C
Finally, the line for FCC_A1#01 can be calculated. Search for this line, which should be found
at 1320.29°C. The temperature of this phase boundary decreases very steeply at both
extremities of the x-axis, because the phase becomes less and less stable as either the
niobium content or the carbon content tends to zero. To obtain an idea of the shape of the
curve, set the start and stop-values as 0.0001 to 0.0039 (A maximum T-step of 20 is OK for
this calculation.) Modifications can then be made to the calculation parameters, decreasing
the start value, increasing the stop-value and increasing the maximum T-step to try to extend
the curve further towards the edges.
The finished diagram should look like this:
92
Tutorial 10
CONTENTS
93
Tutorial 10
The T0-temperature is defined as the temperature where two phases of identical chemical
composition have the same molar Gibbs free energy. This temperature is an important
quantity in the field of diffusionless phase transformations, i.e. the bainitic and martensitic
transformation. In the present example, we will discuss some thermodynamic aspects of the
austenite/martensite transformation and apply T0-temperature calculations to the evaluation
of transformation temperatures.
In the 'Phase summary' and 'Phase details' window, only the FCC_A1 phase is denoted as
active (mole fracton = 1). We can now proceed with this initial condition. For convenience,
store this (current) state in a calculation state with the name 'Start austenite' by selecting
'Global' → 'CalcStates' → 'Create…'.
94
Tutorial 10
We can now evaluate the T0-temperature for austenite and ferrite with 'Calc' → 'Search
phase boundary…' or Ctrl+Shift+T. The following, well-known, dialog box appears:
95
Tutorial 10
Select 'T0-temperature' in the type listbox, 'BCC_A2' as target phase and 'FCC_A1' as parent
phase. The check box 'Force target to parent composition' must be chosen, because the
composition of BCC_A2 wil be adjusted according to the parent composition. The energy
difference (DFM offset) can be left as default (zero). Press 'Go' to start the calculation. The
result is shown below
T0(FCC_A1/BCC_A2): 791,451 C (1064,61 K)
- OK -
It is thus clear that, at the temperature of 791,451°C, FCC_A1 and BCC_A2 of the same
composition have the same molar Gibbs free energy of gm = -46908.9 J/mole.
96
Tutorial 10
Press 'Go' to start the calculation. The result can be displayed in the well known 'XY-data'
plot. Create the plot and drag and drop the T$c variable from the variables window into the
plot. Edit the 'x-axis', 'y-axis' and 'legend' (see also Tutorial 4 or Tutorial 5) such that the
result of the stepped T0- temperature calculation looks as follows.
97
Tutorial 10
There is no need to create a new plot in order to display the graph for the T0-temperature
dependence for varying carbon content. The T0- temperature line in the figure can be simply
changed by switching from 'T0-chromium' buffer to the 'T0-carbon' buffer in the options
window.
98
Tutorial 10
Afterwards, the x- and y-axes must be rescaled and in the case of the x-axis renamed. So the
result looks as follows.
The strong dependence of the T0- temperature on the carbon content is evident. This is
reflected in the strong influence of carbon on the martensite start temperature.
new buffer as 'T0 with offset' (further calculations with various dfm-offsets will be done …)
and create a table selecting 'Global - Tables and arrays …'. Press 'New …' and call the table
'Exp. data'.
After selecting 'Edit …', enter the following measured martensite start temperatures into the
table or copy them from a file (the file is here, or here (.txt)).
0 540
0.086 510
0.1936 475
0.2409 480
0.2495 470
0.2581 440
0.3011 430
0.3226 410
0.3871 410
0.3871 400
100
Tutorial 10
0.3871 395
0.4560 405
0.4947 355
0.5054 375
0.6022 330
0.6022 320
0.7097 280
0.7312 280
0.7743 265
0.8173 240
0.8603 225
Press 'OK' twice and insert the experimental data into the plot as a new series (right-click in
'options' window and select 'New series' → 'table experimental data') and switch to 'Exp.
data' in 'connected to' box (see also Tutorial 5).
101
Tutorial 10
Edit the legend and the series names. The result looks as follows.
Apparently, the calculated T0- temperature does not fit the experimental data, however the
curve runs parallel to it with the calculated temperatures being higher. The reason is that a
certain amount of driving force is required to start the martensite transformation. This extra
energy, or extra driving force, is of the order of 1.2 to 2.5 kJ/mol (depending on the
composition of the alloy) and can be defined in the field dfm-offset. Default value for this
parameter is zero.
To evaluate how high this extra energy is as a function of carbon content, stepped
calculations with different dfm-offsets can be performed. Carry out two simulations, one as a
steped T0- temperature calculation with a dfm-offset of 1200 J/mole and one with 1700
J/mole. Before starting lock the first series (T0- dfm=0 J/mole). So the first graph will be
conserved for further comparison. Select 'Calc' → 'Stepped calculation …'and complete the
dialog box as follows:
102
Tutorial 10
Drag and drop the 'T$c' variable again into the plot and rename the series to T0 - dfm=1200
J/mole. Do the same for a dfm-offset of 1700 J/mole. Change the plot buffer to 'T0 with
offset' in the 'options' window. The plot now looks like follows.
103
Tutorial 10
A dfm-offset in the range of 1200-1700 J/mole can be used to obtain reasonable agreement
between the calculations and the experimental data.
1)
References
[1] Z. Jicheng and J. Zhanpeng, Acta met. mater. 38 (1990) 425-431.
104
Tutorial 11
CONTENTS
• Scheil calculation
• Back-Diffusion
• Composition set
• Solid-solid transformation
105
Tutorial 11
The Scheil-Gulliver method allows calculating the fraction and composition of all phases
during solidification step by step from the liquidus temperature to the temperature where
solidification of the residual liquid phase occurs 1). The particular residual fraction at final
solidification is dependent on the cooling rate. Generally, the fraction is higher, the higher the
cooling rate is. At slow cooling rates, the liquid film can become very thin and the residual
liquid enriches more than in the case of higher fraction residual liquid at solidification.
According to the Scheil-Gulliver hypothesis, illustrated in the figure below (Fig.1), a solidifying
liquid with the initial composition C0 is slightly undercooled. Consequently, a certain fraction
of solid is formed with a composition of CS,1 with the remaining liquid phase with the
composition CL,1. Both phases are in local equilibrium following the lever rule. From that
instant on, the composition of the solid phase with regard to the substitutional atoms is
frozen due to the Scheil-Gulliver assumption of very slow (and therefore negligible) diffusion
in the solid phase. The interstitial elements boron, carbon and nitrogen are assumed to be
nevertheless highly mobile in the liquid phase as well as the solid phase. Therefore, these
elements are assumed to be able to establish equilibrium between the liquid and solid phases
due to back-diffusion of enriched solute atoms from the liquid phase into the solid phase. This
process occurs repeatedly, enriching the solid phase as well as the liquid phase with solute
during cooling (Fig.1:CL,i and CS,i).
When solidification is finished, the microstructure of the solid phase shows a composition
gradient from the regions where the solidification started (centre of the dendrite) to the
106
Tutorial 11
areas where the last liquid solidified (outer shell of the dendrite). The composition of the
residual liquid at final solidification corresponds to the composition of the interdendritic
regions. It should be noted that the Scheil-Gulliver analysis yields an upper limit of
segregation since the substitutional elements also have a finite mobility and have some
potential of back-diffusion.
Scheil-type calculations in multi-component systems have proven to be a useful method to
simulate solidification processes. The present example shows how to carry out this type of
simulation with MatCalc and demonstrates the effect of carbon back-diffusion on the
solidification process. Moreover, the influence of solid-solid phase transformations, i.e. the
peritectic transformation, is analyzed.
107
Tutorial 11
Enter the system composition in weight percent as listed in the subsequent figure selecting
'Global Composition …' or pressing the F7 key.
Set initial values with 'Calc'→'Set start values' or Ctrl+Shift+F. Calculate equilibrium at
1600°C. The results in the 'Phase summary' window are
LIQUID * act 1,00000e+000 dfm: +0,00000e+000
108
Tutorial 11
Press 'Go':
Tsol 'FCC_A1': 1471,08 C (1744,24 K) iter: 4, time used: 0,03 s
The first solid phase becomes stable at 1471.08°C. So let us start with the Scheil simulation at
1500°C and go down to 1000°C in steps of 10. Open the Scheil-calculation dialog with 'Calc -
Scheil calculation …' or press Ctrl+H.
109
Tutorial 11
Press 'Go' to start the simulation. In order to be able to remove the equilibrium content of
solid phases from the system after each temperature step, MatCalc needs to create copies of
all phases except the dependent (liquid) phase. MatCalc therefore asks
Click 'Yes'. MatCalc then creates 3 new phases with the name of the original phase plus the
suffix '_S'. This suffix denotes that the corresponding phase is a 'solid' phase. The result in the
'Output' window looks as follows
Checking solid phases ... - OK -
...
110
Tutorial 11
...
...
40, 0,17 s, 1110,00 C (1383,16 K), its 11, f=0,00000000, FCC_A1 CEMENTITE
AktStepVal: 1383,160000
- OK -
The current value of the fraction liquid at each temperature step is displayed with 'f=xxx' in
each line. The final eutectic is reached at T=1110°C. When the fraction liquid comes below
0,01 (minimum liquid fraction), the dependent phase is dissolved and the calculation is
finished.
Let's now look at the result.
Create a XY-data plot that shows the fraction of residual liquid as a function of temperature.
The correct variable is F$LIQUID, you have to change the default x-data to T$C in the options
window to show °C instead of K. Rescale the x-axis from 1100°C to 1500°C. A few other
settings were made until the result looks as follows
111
Tutorial 11
112
Tutorial 11
Press 'Go' to start the simulation. After each temperature step, MatCalc sets up a
paraequilibrium calculation, where all elements without back-diffusion have fixed
composition variables and only the elements with back-diffusion are unconstrained. By that
means, carbon is always brought back into equilibrium with regard to the solid and liquid
phases after a regular Scheil simulation step is carried out.
We are going to display the Scheil curve with and without back-diffusion in one window.
Therefore, first, lock the previous Scheil calculation, which is still displayed in the diagram
window and name it 'Scheil'.
113
Tutorial 11
Then, we make sure that the just created buffer ('Scheil with BD of C') is selected as current
buffer for the plot in the options window and drag and drop the 'F$LIQUID' variable into the
plot (note that alternatively you can use the 'Lock and duplicate series' option accessible via
the right mouse button or the 'View' menu). Rename the new series to 'Scheil with BD of C'.
The new diagram looks like the following figure.
114
Tutorial 11
Create a new buffer with the name 'Equilibrium'. Open the stepped calculation dialog
(Ctrl+T). Calculate a stepped calculation with temperature as the variable between 1500°C
and 1350°C in steps of 5. Press 'Go' to start the calculation.
115
Tutorial 11
Lock the last series ('Scheil with BD of C'). Change the buffer to be used in the diagram
window to 'Equilibrium'and drag and drop the 'F$LIQUID' variable into the plot. Rename the
current series and the diagram looks like this:
116
Tutorial 11
On changing the 'y-axis' type to 'log' and scaling from 0.01, the results finally display as
From this diagram, and with the assumption that all residual liquid freezes (solidifies) when
1% residual liquid is reached, the predicted solidification temperatures using the classical
Scheil model, Scheil with back-diffusion and full thermodynamic equilibrium can be read as
1110, 1335 and 1380°C, respectively. Probably, 1335°C comes closest to the real,
experimentally observed solidification temperature for this alloy composition.
1)
References
[1] E. Kozeschnik, W. Rindler and B. Buchmayr, „Scheil-Gulliver simulation with partial redistribution of
fast diffusers and simultaneous solid-solid phase transformations“, Int. J. Mater. Res., 98 (9), 2007,
826-831.
[2] W. Rindler, E. Kozeschnik and B. Buchmayr, “Computer simulation of the brittle temperature range
(BTR) for hot cracking in steels”, Steel Res., 2000, 71 (11), 460-465.
[3] E. Kozeschnik, “A Scheil-Gulliver Model with Back-Diffusion Applied to the Micro Segregation of
Chromium in Fe-Cr-C Alloys”, Met. Mater. Trans., 2000, 31A, 1682-1684.
117
Tutorial 12
CONTENTS
118
Tutorial 12
Due to some development activities, the commands are to be typed into the 'MatCalc 5
console' window - this are the lines begining here with 'MCORE:'. The output messages are
displayed in the 'console' window, as always.
BASICS
GETTING HELP AND LISTING AVAILABLE COMMANDS
Typing '?' or 'HELP_WORKSPACE' in the 'MatCalc 5 console' window shows a list of available
commands.
MCORE: ?
-------------------------------------------------------------------------
-------------------------------------------------------------------------
? HELP_WORKSPACE HELP_MODULE
ECHO ! EXIT
EXPORT_FRAME_TO_FILE LIST_CURRENT_DIRECTORIES
SET_APPLICATION_DIRECTORY
SET_WORKING_DIRECTORY SET_LICENSE_FILEPATH
SHOW_EXPRESSION
119
Tutorial 12
LIST_SYMBOLS LIST_PARAMETERS
-------------------------------------------------------------------------
-------------------------------------------------------------------------
The commands listed above are part of the 'workspace' module of MatCalc and relate to
creating and modifying workspaces and windows within workspaces. As can be seen from the
last line of the above transcript, 'HELP_MODULE' gives access to another series of commands
relating to the current module of the program ('core'), i.e. the calculations themselves:
MCORE: help_module
-------------------------------------------------------------------------
-------------------------------------------------------------------------
SET_REFERENCE_ELEMENT ENTER_COMPOSITION
SET_TEMPERATURE_CELSIUS
SET_TEMPERATURE_KELVIN SET_PRESSURE
SET_AUTOMATIC_STARTVALUES
120
Tutorial 12
The 'mcore' module contains several subsections, given in triangular brackets below the list of
commands. These can be opened by typing in 'HELP_MODULE' again with the name of the
subsection. For example 'HELP_MODULE IO' lists the input/output commands.
MCORE: help-module io
-------------------------------------------------------------------------
-------------------------------------------------------------------------
OPEN_THERMODYN_DATABASE TEST_EXIST_TD_DATABASE
READ_THERMODYN_DATABASE
NOTES ON SYNTAX
1. Although the commands listed above contain underscores '_', the hyphen '-' can be
used interchangeably with the underscore when typing commands. Note, however,
that this is not the case in names of phases such as 'BCC_A2', which require the
underscore.
2. Commands are case-insensitive.
3. Any unambiguous abbreviations of the commands are allowed. For example,
'open_th' or even 'o_t' are acceptable abbreviations of 'open_thermodyn_database'.
Using an ambiguous abbreviation, such as 'read', gives a list of all possible commands
with that abbreviation, together with a message indicating that the command was
ambiguous:
MCORE: read
READ_WORKSPACE
READ_THERMODYN_DATABASE
READ_MOBILITY_DATABASE
READ_PHYSICAL_DATABASE
READ_BINARY_FILE
121
Tutorial 12
_mcore:
<script(0/core)> new-gui-window a6
<script(0/core)> new-gui-window a5
<script(0/core)> set-workspace-property m n
Open the thermodynamic database. This is equivalent to clicking 'Open' in the 'Global >
Databases' dialogue box.
MCORE: open_thermodyn_database
122
Tutorial 12
The console prompts the user for the name of a database. The default option is given
between slashes '/../' (By typing '*' and pressing 'enter', the content of the
…\MatCalc\database directory is shown). Type 'mc_fe.tdb' to select the improved database.
MCORE: open_thermodyn_database
Find out which elements and phases are in the database using 'list_database_contents':
MCORE: list_database_contents
(e)quilib/(d)iffusion/(p)hysical /e/:
(e)quilib/(d)iffusion/(p)hysical /e/:
# of elements in database: 25
VA, AL, B, C, CO, CR, CU, FE, H, HF, LA, MN, MO, N, NB, NI, O, P, PD, S, SI,
TI, V, W, Y
123
Tutorial 12
MOC_ETA V3C2 WC
124
Tutorial 12
M2P M3P
Select the required elements using 'select_elements c fe'. A message appears to indicate that
C has been selected, and Fe has been ignored because it was already selected by default.
MCORE: select_elements c fe
Next select the phases. Any unambiguous abbreviation is acceptable for the phase names.
Messages appear to confirm that these phases have been selected.
MCORE: select_phases liq bcc_a2 fcc cem
Read in the thermodynamic data. This is equivalent to clicking 'read' in the 'Databases'
dialogue box.
MCORE: read_thermodyn_database
125
Tutorial 12
Enter the composition. There are three available unit qualifiers: x (mole fraction), u (u-
fraction) and w (weight fraction). In addition, appending 'p' to any of these gives the unit in
percent. See the example below, in which the composition is specified in weight percent.
MCORE: enter_composition
Open 'Databases', 'Composition' and 'Phase Status' from the 'Global' menu and note that the
system setup entered using the command-line is shown in the GUI windows. Console and GUI
versions of commands can be used completely interchangeably.
Set the temperature to 700°C. Note that there are two commands for temperature,
'set_temperature_celsius' and 'set_temperature_kelvin', depending on the units of interest.
MCORE: set_temperature_celsius 700
MCORE: calculate_equilibrium
- OK -
Note the results in 'phase summary' window: the stable phases are BCC_A2 and CEMENTITE
as expected.
EVALUATING EXPRESSIONS
As well as entering commands, the console can be used to evaluate numerical expressions,
MatCalc variables and user-defined expressions and functions.
NUMERICAL EXPRESSIONS
Any numerical expression can be evaluated using the command 'SHOW_EXPRESSION' ('show'
or 'sh' are acceptable abbreviations):
MCORE: show 4/5
4/5 =
126
Tutorial 12
0.8
MCORE: show pi
pi =
3.14159265359
Note the priority rules and the use of parentheses to override these, e.g.:
MCORE: show 4/5*3
4/5*3 =
2.4
4/(5*3) =
0.266666666667
4+4*2 =
12
(4+4)*2 =
16
EXPRESSIONS IN X
Expressions in terms of the current value of the stepped variable, x, can be evaluated using
'show_expression', as shown below. (The value of x is currently zero because no stepped
calculation has so far been performed in this workspace.)
127
Tutorial 12
3*x =
function1 =
Pressing the up-arrow recalls the latest command to be entered. Further use of this up-arrow
scrolls through the command history in reverse chronological order. Commands are given
with the full names and chosen options, e.g.:
_mcore: SET_FUNCTION_EXPRESSION function1 3*x
This is the expression for x2. The syntax 'x^2' can also be used for the same purpose:
MCORE: SET_FUNCTION_EXPRESSION
The functions just defined can now be found by opening the 'Functions' tab in 'Global >
Variables & functions', and in the 'variables' window under 'functions'. They can be plotted
in a new window as follows:
Firstly, create a new window and enter the window-type code. These codes can be found
under 'View > Create new window'. The standard x-y plot is 'p1'.
MCORE: new_gui_window
128
Tutorial 12
Next, add a new series using set-plot-option and choosing the following options (press Enter,
if there is no sign behind the colon):
MCORE: set-plot-option
(t)itle/(a)xis/(l)egend/(g)rid/(h)istogram/tt(p)/(s)eries: s
deri(v)e/(c)onvert to table: n
Finally, add the other two series by recalling and editing the previously used command.
MCORE: SET_PLOT_OPTION 1 S N F function2 -10..10
129
Tutorial 12
It is also possible to define functions made up of MatCalc variables. Here, two functions
similar to those discussed in Tutorial 6 are defined. The built-in variables can be copied and
pasted from the 'variables' window to the console using the right-click menus or Ctrl+C and
Ctrl+V.
MCORE: SET_FUNCTION_EXPRESSION function4 F$BCC_A2*X$BCC_A2$C
function4 =
0,000628639871334
MCORE: sh function5
function5 =
0,0177023706434
function4+function5 =
0.0183310105147
Below, it is confirmed that, at 700°C, function4 + function5 = XS$C i.e. all the carbon in the
system is in the form of either BCC_A2 or cementite, since these are the only two phases to
be stable at this temperature.
MCORE: show XS$C-(function4+function5)
xs$C-(function4+function5) =
The next tutorial discusses the use of command-lines in scripts to facilitate repetitive or
complex tasks.
130
Tutorial 14
CONTENTS
• Purpose of scripts
• Writing a script to perform a stepped calculation and display the results
131
Tutorial 14
INTRODUCTION
UTILITY OF SCRIPTS
A script is a text file, containing a list of commands to be executed in order from top to
bottom. They are particularly useful to speed up routine or repetitive operations. Once a
script file has been created, it can easily be modified to serve a new purpose, for example by
changing the elements or phases in the system. Script files, consisting only of text, are also
much smaller in size than MatCalc workspace files, especially those resulting from
precipitation calculations.
Individual scripts can also be grouped into master-scripts; this facilitates, for example,
calculations involving multi-stage heat treatments. Some sample scripts are provided with
MatCalc. You will find them in the subdirectories of
'MatCalc/scripts/script_menu/templates'. Of course, you can also edit them in MatCalc by
clicking on 'Open template…' in 'Script' menu.
WRITING A SCRIPT
1. In MatCalc, choose 'New' from the 'File' menu and select 'Script file' from the drop-
box. Note that it is possible to have any number of script files open simultaneously
with a MatCalc workspace file. 'Save' or 'Save as' will save the script file if its window
is highlighted, otherwise the workspace will be saved. Recently used script files can be
found in a list under 'File → Recent files'.
2. Alternatively, create the new script in any text editor (which saves files as plain text),
such as notepad, emacs, vi or any of the many text editors available in different Linux
distributions.
N.B.- The MatCalc scripts have '.mcs' extension so it is important to set (or change) the
extension of the created file!
EDITING A SCRIPT
1. In MatCalc, using 'File → Open' or clicking on icon in the toolbar (keyboard shortcut
'Ctrl + O'). Select the filter to 'MatCalc script (*.mcs)' files
2. Alternatively, you can use any text editor (which saves files as plain text).
EXECUTING A SCRIPT
132
Tutorial 14
1. Using 'Script → Run script' or clicking on icon in the toolbar (keyboard shortcut
'Shift + F2')
2. Double-clicking on the '.mcs' file icon
COMMENTS
It is always advisable to comment the script extensively so as to help other users (or oneself
several months later!) to understand the aim of the calculation, assumptions, etc. Any line
prefixed with a '$'-sign will not be interpreted as a command. The '$'-sign can also be inserted
part-way through a line; the rest of the line will be treated as a comment.
$ This whole line is a comment.
Both comments and commands are shown line-by-line in the console when the script is
executed, but prefixing a comment or a command with the '@'-sign hides the line so that it
does not appear in the console output.
At the beginning of the script, enter some preliminary comments, containing such
information as: the name of the file, the current version of MatCalc (available from Help >
About), the current version of the scripting language and a brief summary of the purpose of
the script.
$ Script T13
CALCULATING AN EQUILIBRIUM
The first executable line in the script creates a new workspace (N.B.- Any previously open
workspace will be closed without warning.)
@$************************************
133
Tutorial 14
@$************************************
The next lines are to enter some workspace information to describe the ideas, assumptions
etc. used in the calculation. This information can be found in 'File > Workspace info'. The '+'-
sign continues the text on a new line.
@$************************************
@$************************************
@$************************************
open_thermodyn_database
If the line is put in as above, the script will stop at this point and prompt the user for the
name of a thermodynamic database. The output in the console window is as follows:
<script(0)> $ open the thermodynamic database
(Press 'enter' to select the default option.) Leaving out the arguments of the command in this
way allows for interactivity in scripts. If, instead, the script is intended to be fully automatic,
the argument should be put after the command on the same line. Replace the above line with
the following:
open_thermodyn_database mc_sample_fe2.tdb
The next parts of the script are to set up the system, set the temperature and calculate an
equilibrium. These commands have already been seen in Tutorial 12.
134
Tutorial 14
@$************************************
@$************************************
select_elements c fe
@$************************************
@$************************************
read_thermodyn_database
@$************************************
@$************************************
enter_composition wp c=0.4
@$************************************
@$************************************
set_temperature_celsius 700
set_automatic_startvalues
calculate_equilibrium
STEPPED CALCULATION
In the line below, the argument 'r' means range, and the numerical values are the start, end
and step interval.
@$************************************
@$************************************
step-equilibrium
135
Tutorial 14
GRAPHICAL OUTPUT
The final part of the script is concerned with graphical presentation of results. The following
line creates a new GUI window to contain the plot. As was seen in Tutorial 12, the code 'p1' is
used to open an XY-plot.
@$************************************
$ graphical output
@$************************************
new-gui-window p1
The following three lines change the default x-data from 'StepValue' to temperature in
Celsius, set a default x-axis to be used for all plots, and provide a title for this axis. The '.' in
these lines refers to the ID of the last-used window, which in this case is the p1 window which
has just been created.
set-gui-window-property . x t$c
The line below adds a title to the diagram. This first diagram is to be a plot of phase fraction
versus temperature.
set-plot-option . t Phase stability in Fe-0.4 wt.% C
The following lines label the y-axis, change the 'factor' of the y-axis from 1 to 100 to display
the calculated phase fraction directly in percent, set the axis type to logarithmic and modify
the axis scaling.
set-plot-option . a y 1 t Phase fraction [%]
set-plot-option . a y 1 f 100
The first series is inserted using 'set-plot-option . s n b f$liquid'; this is the phase fraction of
liquid. The name of the series, as it will appear on the legend, is then edited using 'set-plot-
option . s m -1 f$liquid Liquid'. This changes the name from its automatic value (f$liquid) to
'Liquid'.
set-plot-option . s n b f$liquid
136
Tutorial 14
These commands are repeated for the other phases. Note the use of the HTML markup tags
to give the subscript in 'Fe3C'.
set-plot-option . s n b f$bcc_a2
set-plot-option . s n b f$fcc_a1
set-plot-option . s n b f$cementite
The major grid lines for x- and y-axis are displayed by these commands:
set-plot-option . g m x y $ plot x-axis major grid line
The three lines below move and resize the window, update its contents and set the style-
sheet to coloured with no symbols. In the first of these lines, the first two numbers define the
position of the window, the second two define the width and height.
move_gui_window . 20 20 800 1000
update-gui-window .
The newly created plot now becomes the 'current' plot and can be referred to as '.' when it is
being modified with set_plot_option:
set_plot_option . t Composition of phases
137
Tutorial 14
set-plot-option . g m x y
set-plot-option . g m y y
The script can be concluded with the following line, which should appear in the console when
the script has been executed without any errors.
$ *** DONE ***
138
Tutorial 14
139
Tutorial 14
CONTENTS
140
Tutorial 14
The first step is to set up the thermodynamics of the system. In the new workspace, open
'Global > Databases' and select the elements Fe and C. For a precipitation calculation, it is
only necessary to include the phases which are directly involved in the precipitation, i.e. the
precipitating phase and the matrix in which it forms. This example considers the precipitation
of cementite in ferrite, so the two phases to be selected are BCC_A2 and CEMENTITE. When
the thermodynamic data have been read in, open 'Global > Composition' and enter the
carbon content of 0.2 wt.%.
B. PRECIPITATION DOMAIN
The next two steps are to define and configure the precipitating phase and the domain in
which it will form. These two steps can be done in either order, but in this example, the
precipitation domain will be set up first.
Open 'Global > Precipitation domains' and click on the 'New' button towards the bottom left.
A box will appear, prompting for a name for the new domain. Any name can be chosen here,
for example 'Ferrite' or 'Matrix' and click 'OK'.
On the 'Phases' tab, choose 'BCC_A2' from the drop-box to associate this phase with the
newly defined domain. Leave the rest of the settings as they are, and click 'OK'.
141
Tutorial 14
C. PRECIPITATE PHASE
To create the precipitate phase, open 'Global > Phase status'. In the 'Phases' list on the left-
hand side, select 'CEMENTITE' and click on 'Create'. Select 'precipitate (_Pnn)' from the drop
box which opens.
142
Tutorial 14
A new phase, CEMENTITE_P0 appears in the phase list; click on this to select it. Open the
'precipitate' tab, and enter '250' in the '# size classes' box, click on 'Initialize' and accept the
warning message. The precipitates are considered as belonging to a number of classes of
particles with the same radius and composition. Classes are created, rearranged and deleted
during the calculation, allowing simulation of the precipitate size distribution.
The choice of the number of classes represents a trade-off between calculation time and
required precision. If only average properties, such as the mean precipitate radius, are of
interest, then it is sufficient to use a small number of classes such as 10 or 20. By contrast, to
obtain the best possible simulation of size distribution, the number of classes should be
increased to a higher value, such as 250 as used here. Leave all the other settings in this tab as
they are.
143
Tutorial 14
Open the 'Nucleation' tab and select the 'Sites' sub-tab. In the 'Nucleation sites…' part of this
tab, remove the tick-mark by 'bulk (homogeneous)' and instead click in the box beside
'dislocations' . Click on 'OK' to save these settings and return to the main screen.
144
Tutorial 14
Simulations of precipitation require not only thermodynamic data (already loaded in step A)
but also mobility data, from which the diffusivities of the elements in the phases can be
calculated. Read in the mobility data by opening 'Global > Databases' and select 'Diffusion
data' on the left side. Click on 'Read…' and open 'mc_fe.ddb' database. Click on 'Close'
145
Tutorial 14
Create a new 'Plot: XY-data' window. Drag and drop 'F$CEMENTITE_P0' from the variables
window to this plot. In the 'options' window, set 'default x-axis' to 'log' type. Change the title
of 'default x-axis' to 'time [h]' and the factor to '1/3600' to convert seconds into hours. The
title of the 'plot #0' should also be changed to 'Phase fraction of cementite precipitates' and
the title of y-axis to 'Phase fraction'.
Next, create a new window 'Plot: precipitate distribution - histogram' (p5) window. Select
'CEMENTITE_P0' from the box which opens and click 'OK'. In the 'options' window, change
the number of '# size classes' for this histogram to '20'. Switch off the default x-axis (in
'default x-axis', set 'no' for 'use for all plots') and set the x-axis label to 'Precipitate radius
[nm]'. In the 'factor' line for this x-axis, enter '1e9'. This expresses the particle radii in
nanometres instead of metres, making the scale easier to read. Change the y-axis label to
'Number of precipitates'.
146
Tutorial 14
Both the histogram and the plot of phase fraction against time are updated during the
calculation, so it is possible to follow the evolution of the size distribution and the phase
fraction as the calculation takes place.
147
Tutorial 14
THE CALCULATION
As the introduced number of classes is quite large (as defined in p. 1.D.), it will be beneficial to
modify the algorithm used for the calculation. To do this the numerical limits describing the
increase of the nucleation density in the 'convergence control' field should be changed. Up to
now, this can be only modified via console commands. Type the following command-line in
the console:
set-simulation-parameter nucleation-density-increase-factor=1,05
Calculate an equilibrium at 600°C in the usual way. Open 'Calc > Precipitate kinetics' or click
on the icon (keyboard shortcut: 'Ctrl + K'). Enter '3.6e5' as the simulation end time. This is
in seconds, so is equivalent to 100 hours. Note that in the 'Temperature control' section, an
isothermal heat-treatment at 600°C has been selected by default; leave this setting as it is.
To give more frequent updates of the graphs on the screen, the 'Update output every'
number can be decreased from 100 to 50. However, this will slow down the calculation
somewhat, so it is probably not advisable on slow machines. Leave the other settings as they
are, and click on 'Go'.
148
Tutorial 14
The information in the 'Output' window gives a summary of the current system composition,
simulation time
******** isothermal,T=873.16 K (600 C) *************************************
FE +9.90768e-001(+0.00e+000) C +9.23192e-003(+0.00e+000)
———————————————————————————————————-
- First line:
1 -Number of iterations.
recs -Number of records in buffer.
dt -Last time step.
time -Absolute simulation time in [s].
T - Current temperature in [°C] (in [K]).
- Second line:
#Ferrite - Precipitation domain, BCC_A2 - matrix phase,
sv - current vacancy concentration
sve - equilibrium vacancy concentration
dcf - diffusion correction factor due to the presence of the excess vacancies
ro - current dislocation density
gsc - number of grain classes used (meaningful for multi class grain growth model)
damping feature (dt=0,-) - maximum time step allowed due to the matrix condition
- Third line:
FE +9.95367e-001(+0.00e+000) - Composition of matrix
- Fourth line:
CEMENTITE_P0: - precipitate phase
FE75C25 - composition of the most stable nuclei
nucl-site - nucleation sites
nucl-dfm - driving force for nucleation in [J/mol]
n_dot - nucleation rate
ans - available nucleation sites
- Last line:
+ nucleation of CEMENTITE_P0 started at 1.9531e-008 s, T=600 °C (873,16 K) - Additional
information: Nucleation started '+' or stopped '-' and the exact system parameters at that
time.
149
Tutorial 14
FE +9,99771e-001(+0,00e+000) C +2,28647e-004(+0,00e+000)
———————————————————————————————————-
150
Tutorial 14
When the calculation is finished, add three new plots in the same window as the plot of
F$CEMENTITE_P0 versus time. Drag and drop NUM_PREC$CEMENTITE_P0 (number of
cementite precipitates) into the first of these, NUCL_RATE$CEMENTITE_P0 (nucleation rate)
into the second. In the third, add R_MEAN$CEMENTITE_P0 (mean radius),
R_CRIT$CEMENTITE_P0 (critical radius), R_MIN$CEMENTITE_P0 (minimum radius) and
R_MAX$CEMENTITE_P0 (maximum radius). These variables can be found under 'kinetics:
precipitates' and 'kinetics: nucleation' in the 'variables' window.
1. Plot 1
- Title: 'Phase fraction of cementite precipitate'
- Y-axis title: 'Phase fraction'
2. Plot 2
- Title: 'Number of precipitates'
- Y-axis title: 'Number of precipitates [*10<sup>20</sup> m<sup>-3</sup>]'
- Y-axis factor: '1e-20'
3. Plot 3
- Title: 'Nucleation rate'
- Y-axis title: 'Nucleation rate [*10<sup>26</sup> m<sup>-3</sup>s<sup>-1</sup>]'
- Y-axis factor: '1e-26'
4. Plot 4
- Title: 'Precipitate radius'
- Y-axis title: 'Precipitate radius [<html>μ</html>m]'
- Y-axis type: 'log'
- Y-axis factor: '1e6'
5. Default x-axis
- Use for all plots: yes - Title: 'Time [h]'
- Type: 'log'
- Scaling: '1e-12..'
- Factor: '1/3600'
Note the usage of the html-tags for the text with special features:
- the text between the '<sup>' and '</sup>' tags will be displayed as superscript (e.g.
10<sup>20</sup> appears as 1020)
151
Tutorial 14
Using these plots, the different stages of nucleation, growth and coarsening can be
identified.During the nucleation stage, between 1e-11 and 1e-9 hours, the number of
precipitates increases rapidly, but since these precipitates are, as yet, extremely small, the
phase fraction of cementite also remains small. During this stage, the nucleation rate rises
initially, due to a positive driving force for nucleation, and decreases again to zero when all
the available nucleation sites are occupied.
The next stage, from approximately 1e-9 to 1e-6 hours, is the diffusion-controlled growth of
these nuclei; this continues until the equilibrium phase fraction of cementite reaches its
equilibrium value, as indicated by the plateau on the 'Phase fraction' curve. The number of
precipitates does not change during this stage, but there is an increase in radius which can
just be detected on the plot below. There follows a period in which there is little or no change
in any of the three parameters.
Finally, at just over 1e-3 hours onwards, there is the onset of coarsening, which is
characterised by a decrease in the number of precipitates accompanied by an increase in
radius. The critical radius rises and becomes larger than the smallest precipitate classes.
Therefore these classes start to dissolve and the newly available carbon is used to grow the
larger precipitates (Gibbs-Thomson effect). The minimum radius is unstable (leading to a
'noisy' appearance on the graph) as the small precipitates are shrinking (minimum radius goes
down) and dissolving (minimum radius goes up to the next smallest class present in the
system).
152
Tutorial 14
153
Tutorial 14
The plot above shows only the variation of the mean radius with time, but more detailed
information on the distribution of particle sizes can be found on the histogram. At the end of
the calculation, the final size distribution is shown on the histogram. The distribution at other
stages of the calculation can be recalled using 'Global > Buffers > Edit buffer states'. This
brings up a list of all the states saved in the memory, with details of time, temperature and
time-step. Selecting one of these records loads the corresponding particle size distribution
into the histogram if the 'auto load' box at the bottom left is ticked. Otherwise, it can be
loaded by clicking on the 'load selected' button.
154
Tutorial 14
In the final part of this tutorial, the precipitate size distribution as calculated by MatCalc will
be compared with the Lifshitz-Slyozov-Wagner (LSW) distribution given by the following
equation:
In the histogram window, create a new plot and add a new series for it (set 'CEMENTITE_P0'
for 'phase'). In the options under 'plots', select 'density' for 'scale frequency' and 'yes' for
'scale radius'. Set the scaling of the x-axis as '0..1.499' because the LSW function is only
defined between 0 and 1.5.
Enter the LSW function, either using the 'Functions and Variables' box or by using the
following command-line in the console:
155
Tutorial 14
Then add the function to the scaled plot, either using the right-click menu in the Options
window to add a new 'function/expression' series (as it was done in Tutorial 6) or by using
the following command-line:
set-plot-option . s n f LSW 0..1.5
The plot below shows a comparison between the LSW function and the histogram simulated
by MatCalc.
156
Tutorial 15
The Fe-Cr-C system forms the basis of many industrially useful alloys. The aim of this and
Tutorial 16 is to produce a simulation of the precipitation behaviour in a Fe-10Cr-0.1C (wt.%)
alloy during heat-treatment at 600°C. This involves considering several aspects, such as the
chemical compositions of nuclei, the microstructural sites on which nuclei form, and the
density of these sites in the microstructure under consideration. This first of two tutorials will
focus on modelling the formation of the metastable cementite (Fe3C) phase, and Tutorial 16
will consider the interaction between this and the more stable phase M23C6.
CONTENTS
157
Tutorial 15
EQUILIBRIUM CALCULATIONS
Create a new workspace with the elements Fe, C and Cr and the phases BCC_A2, CEMENTITE
and M23C6. Enter the composition 10 wt.% Cr, 0.1 wt.% C.
Calculate an equilibrium at 600°C and observe the contents of the 'Phase summary' window.
It can be seen that M23C6 is the stable phase at equilibrium. However, it is known from
experience that the first phase to form on heat-treatment is cementite.
Go to 'Global > Phase status', suspend the 'M23C6' phase and calculate an equilibrium once
again so as to study the metastable equilibrium between BCC_A2 and cementite. The
composition of cementite in metastable equilibrium with BCC_A2 is, in wt.%, 85 % Cr, 7 % C, 8
% Fe; this is very rich in Cr compared to the overall system composition of 10 % Cr, 0.1 % C
and 89.9 % Fe. This high amount of Cr is rather unusual for cementite, as it is expected to be
rahter Fe-rich. Hence, Fe is set as the major constituent for this carbide. However, MatCalc
detects that the Cr-content in cementite is greater than the one of the major constituent for
this phase (Fe) and a '*maj*!' warning flag appears in the 'phase summary' window.
In practice, it is found that cementite forms rapidly on heat-treatment at 600°C; this is more
consistent with a mechanism which primarily involves the diffusion of C rather than the
slower-diffusing Cr. It is therefore likely that the initial nuclei do not form with the equilibrium
composition, but are initially much richer in Fe than Cr. Part 1 of this tutorial considers how
such effects can be modelled. Re-open 'Global > Phase status' and remove the 'suspended'
flag for M23C6.
Create a precipitate phase CEMENTITE_P0, using 'Global > Phase status'. In the 'Nucleation”
tab, change the 'Nucleus composition' model from 'ortho-equilibrium' to 'para-equilibrium'
using the drop-down menu. 'Para-equilibrium' means that the nucleus is assumed to have the
same composition in terms of substitutional elements as the matrix from which it forms, and
only the carbon is partitioned between the two phases. In the 'ortho-equilibrium' model, by
contrast, the composition of the nucleus is calculated assuming full equilibrium with the
BCC_A2 matrix. In the 'Nucleation > Sites' tab, set the nucleation sites to 'Dislocations'
(remove the tick from 'bulk')
158
Tutorial 15
In 'Global > precipitation domains', create a new domain named 'ferrite' with 'BCC_A2' as its
matrix phase. Accept the changes by clicking 'OK' to close the window.
Load the mobility data as described in Tutorial 14.
Create a new XY-plot window and define a default x-axis with the following properties:
Add four new plots to the window and drag and drop the following series to the plots:
159
Tutorial 15
1. 'f<sub>CEM</sub>' (fCEM)
2. 'x<sub>Cr</sub>' (xCr)
3. 'x<sub>BCC_A2, C</sub>' (xBCC_A2, C)
4. 'N<sub>ppt</sub>[m<sup>-3</sup>]' (Nppt[m-3])
5. 'R<sub>mean</sub> [m]' (Rmean [m]); y-axis set to 'log'
CALCULATION
Select 'Calc > precipitate kinetics'. Enter the finish time of the calculation: '3.6e13' s (= 1e10
hours). The isothermal treatment temperature should be set to '600' and 'Temperature in C'
selected. Leave the other settings as they are, and click on "Go". (The calculation may take
some time, especially on slower machines, because of the long treatment time.)
After the calculation has finished, duplicate and lock all the series in the plot window. Return
to 'Global > Phase status' and set the nucleation model for CEMENTITE_P0 to 'ortho-
equilibrium' and re-open 'Calc > precipitation kinetics'. There is no need to change anything;
simply click on 'Go'. A warning appears that the contents of the current buffer will be
overwritten. As the series have been locked, this does not matter; accept the warning with
"Yes".
INTERPRETATION OF RESULTS
The onset of precipitation occurs much earlier in the para-equilibrium case, beginning around
1e-7 hours (~ 1e-3 seconds), as compared to ~1 hour for ortho-equilibrium. The para-
equilibrium cementite fraction reaches a plateau at a smaller value than for the ortho-
equilibrium case, but after a longer time at temperature, this fraction rises, eventually
reaching the same value as for ortho-equilibrium.
160
Tutorial 15
The para-equilibrium model stipulates that the Cr content of the nuclei (XNUCL,CEM, Para) be
equal to that of the matrix. This decreases towards longer times at temperature, as the matrix
becomes depleted in Cr. This depletion is caused by the Cr-enrichment of the precipitates by
diffusion; their Cr content (XCEM, Para) increases up to the equilibrium value of around 0.69
(mol. fr.).
In the ortho-equilibrium case, the cementite nucleates with its equilibrium Cr content, and
there is little or no change in the Cr content of the precipitates during the heat-treatment. It
is this requirement for full equilibrium which accounts for the long incubation time for
cementite when the ortho-equilibrium model is used; the formation of a critical nucleus with
ortho-equilibrium composition requires the (slower) diffusion of Cr.
In the plot of X$BCC_A2$C (the carbon content of the BCC matrix), it can be seen that the
depletion of the matrix in carbon exactly follows the increase in precipitate fraction for both
models.
161
Tutorial 15
The plot of the number of cementite precipitates shows that in the ortho-equilibrium case,
nucleation occurs at a later stage and the precipitates are less numerous.
Coarsening of the precipitates is more rapid in the para-equilibrium case, as can be seen from
the plot below:
162
Tutorial 15
The use of the para-equilibrium nucleation model gives better qualitative agreement with
experimental observations of the rapid precipitation of cementite at temperatures such as
600°C in alloy steels. An example in the Examples section, in which this issue is considered in
more detail, will be available shortly.
DIFFUSIVITY IN PRECIPITATES
SETUP
It was seen above that, using the para-equilibrium model, cementite precipitates formed with
a Fe-rich composition and subsequently enriched in Cr. The rate of enrichment depends on
the ease with which chromium can diffuse into existing precipitates.
Duplicate and lock all the series in the plots. Re-open 'Global > Phase status'. In the
'Nucleation' tab, set the cementite nucleation model to back to 'para-equilibrium'. Open the
'Special' tab. In the 'Diffusion in precipitate as ratio from matrix …' section, the selected
value of the 'substitutional' ratio is set to 0.01. This means that the diffusivities of all
elements within the cementite precipitate are considered to be one hundredth of their values
within the matrix. Changing this value will affect the rate of Cr-enrichment of the cementite.
To demonstrate this, change the value of the ratio to '0.25', click on 'OK' and re-run the
simulation.
163
Tutorial 15
INTERPRETATION OF RESULTS
In this case, precipitation occurs at the same rate as in the first para-equilibrium calculation,
but the Cr-enrichment of the precipitates is more rapid. Consequently, the increase in
precipitate phase fraction and the decrease in matrix carbon content occur earlier. It is also
notable that coarsening is delayed and the distribution of more numerous, relatively fine
particles is stabilised to longer times, as shown by the two plots below.
At this stage, it may be helpful to remove all the series except the original para-equilibrium
calculation results from the plots to avoid them becoming cluttered. (If required, the
numerical data from the series can first be exported in text form using 'Copy data' from the
right-click menu and then pasting these data into a spreadsheet or text editor. Alternatively,
the plots can be exported in graphical form using 'Copy pixmap'.) To remove a series from a
plot, first click on that plot and then select the name of the series in the 'Options' window.
(Failure to do this can result in series from other plots being deleted instead.) Multiple series
164
Tutorial 15
can be selected using the Ctrl button. Remove them using the Delete button or 'Remove
series' from the right-click menu.
Reset the 'consider as ratio from matrix diffusivity' value back to its default value of '0.01' in
the 'Special' tab, keep the nucleus composition model set at 'para-equilibrium' and click 'OK'
to save the changes. Open 'Global > Precipitation domains' > 'General'. It contains a few data
on the microstructure like dislocation density or grain diameter. The default values for each of
the structural parameters are shown in the image below.
The nucleation sites for CEMENTITE_P0 have been set to 'Dislocations' (see the section
'Setting_up_the_simulation' of this tutorial) so the dislocation density will determine the
number of nucleation sites. The default dislocation density, which has been used so far, is
1e12, which is typical of an annealed structure. Change this value to '1e14' and re-run the
simulation.
The following images show the phase fraction, the number of precipitates (note the log scale)
and the mean radius for dislocation densities of 1e12, 1e14 and 1e16. It can be seen that
increasing the nucleation site density accelerates the reaction kinetics and results in a larger
number of precipitates with a smaller mean radius.
165
Tutorial 15
TO FINISH...
Save the workspace file.
166
Tutorial 16
CONTENTS
167
Tutorial 16
BEFORE STARTING...
Re-open the workspace saved from Tutorial 15 and save it under a new name.
Open 'Global > Phase status' and create a precipitate phase from M23C6. In the 'Nucleation'
tab, set the nucleus composition model to 'ortho-equilibrium'. Set the nucleation sites to
'Grain boundaries' in the 'Nucl. sites' tab.
In 'Global > Precipitation domains > General', reset the dislocation density to its default value
of '1e12' m-2. The default grain diameter is '100e-6' m, and it is this which governs the density
of M23C6_P0 nucleation sites. Modify the existing five plots to contain the following series:
168
Tutorial 16
Run the kinetic simulation, with an isothermal heat treatment at 600°C as before, and an end
time of 3.6e+10 s.
INTERPRETATION OF RESULTS
Plot 1: Cementite appears rapidly and reaches a steady-state precipitate fraction. M23C6 starts
to form after around 1 hour at 600°C; this is at the expense of cementite, which redissolves.
By the end of the simulation, all the cementite has dissolved and M23C6 has reached its
equilibrium phase fraction.
Plot 2: This shows that cementite enrichment has started in the time of the cementite
dissolution.
169
Tutorial 16
Plot 3: The depletion of the matrix in carbon occurs in two stages. The first of these
corresponds to the formation of cementite, and the second to the formation of M23C6.
Plot 4: The number of M23C6 precipitates is lower than the one cementite precipitates which is
due to the lower amount of the nucleation sites - there are less sites on the grain boundaries
than on the dislocations. The reduction in the number of cementite precipitates is both due to
the coarsening and the phase dissolution stages:
170
Tutorial 16
Plot 5: There is an intermediate stage between the growth and coarsening phases for the
cementite precipitates (plateau between 10-6 - 10-3 hours). The maximal size of the cementite
precipitates is in the micrometer range.
Plot 5: There is an intermediate stage between the growth and coarsening phases for the
cementite precipitates (plateau between 10-6 - 10-3 hours). The maximal size of the cementite
precipitates is in the micrometer range.
171
Tutorial 16
RESULTS:
The onset of cementite precipitation occurs earlier with a higher dislocation density, but the
kinetics of cementite dissolution and of M23C6 precipitation are unchanged. The plot below
shows a significant increase (note log scale) in the number of cementite precipitates formed.
172
Tutorial 16
With a higher dislocation density, the cementite particles do not become so large during the
growth stage. However, coarsening begins earlier, and the curve of radius versus time for the
coarsening precipitates eventually becomes parallel with that for the lower dislocation
density.
173
Tutorial 16
RESULTS:
As might be expected, reducing the grain diameter accelerates the precipitation kinetics of
M23C6, by providing more nucleation sites. It also accelerates the dissolution of cementite,
which begins to dissolve when M23C6 starts to precipitate.
The plot below shows the effect on the number of M23C6 of reducing the grain size from 10-4
to 10-5 m. The number of M23C6 increased due to more nucleation sites available.
174
Tutorial 16
In the plot of radius against time, the maximum cementite radius attained is reduced,
because there is less time available for coarsening of this phase before dissolution sets in.
175
Tutorial 17
In this tutorial, we simulate the precipitation of NbC in the solid state during the continuous
casting of steel and the subsequent austenitization treatment. The austenite / ferrite
transformations of the matrix phases are taken into account. The continuous casting
simulation starts at 1400°C with linear cooling to room temperature. The austenitization
treatment is carried out at 1100°C for 2 hours. Heating and cooling rates are assumed to be 1
K/s. Furthermore, we assume that precipitation of NbC occurs only at austenite grain
boundaries in the austenite during continuous casting. After transformation to ferrite, we
assume that precipitation occurs at grain boundaries and dislocations.
CONTENTS
176
Tutorial 17
Create a workspace with the elements Fe, Nb and C and the phases BCC_A2 and FCC_A1.
Enter the composition 0.1 wt.% C, 0.7 wt.% Nb. Create a precipitation domain named
'austenite' with the phase FCC_A1 as its matrix, and a precipitation domain named 'ferrite'
with the phase BCC_A2 as its matrix. Create a precipitate phase FCC_A1#01_P0. Leave all the
other settings at their default values. Read in the mobility data.
SETUP GUI
In order to follow the precipitation kinetics simulation results, usually the plots for phase
fraction, precipitation number density and mean radius are in the scope of interest. In cases
of complex heat-treatments, a plot of the system temperature during the process time is also
needed. Of course, these plots can be prepared manually by user, as done in the previous
tutorials. However, due to the frequent need for these 4 plots, an automatic script preparing
those is included in MatCalc. In order to use it, go to 'View' > 'Create new window' and
switch to the 'user-defined' tab. Click on '03_kinetics_4_frames_T_f_n_r_logX' to open a
window with those four plots already set.
Use a default x-axis and set the axis type to 'log'. Scale from '10..'. The axis title is 'time / s'.
177
Tutorial 17
Firstly, create a new treatment by clicking 'New …' with the name 'sample_ht'.
Since the present steel will transform from austenite to ferrite during the cooling process, we
start with setting up a linear cooling segment from 1400°C to transformation temperature
with a cooling rate of 1 K/s. Let us assume that this transformation occurs instantaneously at
600°C. Create a new segment with the button 'New segment'. Double-click the new line in
the 'Data…' list box or highlight the line and press 'Edit'. In the following dialog, you can
define the properties of the heat treatment segment. First of all, enter 'Start temperature'
1400°C. Then, in the temperature definition mode combo box, you can select which data you
want to provide to define the segment. Since we want to cool to RT and know the cooling
rate, we select 'End temperature & Heat/Cooling rate'. 'End temperature' is 600°C and
'Cooling rate' is -1.
The next important setting is the definition of the number of states to store during the
calculation. By default, each segment stores 25 states with linear interval distances.
Optionally, you can select logarithmic. Remain with the default settings.
Finally, select the precipitation domain for the segment, in our case 'austenite'. The dialog
should now appear like this:
178
Tutorial 17
To set up the next segment, press the button. Choose 'Yes' in the dialog asking about the
creation of a new segment. The start temperature for each following segment is automatically
set to the end temperature of the previous segment, that is 600°C. Enter the new end
temperature (25°C) and select ferrite for the precipitation domain. The second segment
should look like this:
179
Tutorial 17
1. Segment from RT to 850°C with 1 K/s heating rate. Since the precipitation domain
does not change, select the 'inherit from previous segment' radio button. We assume
that the ferrite to austenite transformation occurs at 850°C.
2. Next segment from 850°C to 1100°C, however, with austenite as the precipitation
domain (heating rate 1 K/s).
3. an isothermal segment for two hours at 1100 °C. This time, the temperature definition
mode is 'Heat/Cooling Rate & Delta-Time'. Heat/Cooling rate 0°C/s and 'Delta-time' is
7200 s (you can enter 2*60*60 as well).
4. Define a cooling segment down to 600°C in austenite matrix (cooling rate 1 K/s).
5. Finish with a segment from 600°C to RT having ferrite as a matrix (cooling rate 1 K/s).
180
Tutorial 17
If you have finished entering the segments, the entire heat treatment should look like this:
The last thing that we have to take care of is the changing nucleation sites for the NbC
precipitates. According to our problem, we want to simulate NbC precipitation during cooling
from continuous casting along the austenite grain boundaries. For all other parts of the heat
treatment, we want to allow precipitation at grain boundaries and dislocations
simultaneously.
This issue can be solved easily with the use of scripting commands that can be entered at the
beginning and end of each of the heat treatment segments. Edit the first segment by double
clicking it in the list. In the edit field for the pre-segment script, enter the command just as if
you would do in the MatCalc console:
set-precipitation-parameter fcc_a1#01_p0 n s g
181
Tutorial 17
This command defines the (n)ucleation (s)ites of the NbC to be at (g)rain boundaries. Since
only grain boundaries are selected, please note that MatCalc will then use the diffusion
geometry for grain boundary precipitates, which has been introduced MatCalc version 5.14.
The following images show the two different diffusion geometries of MatCalc:
Since we want to continue with different nucleation sites after the first cooling segment, we
define a post-segment script for the first segment reading
182
Tutorial 17
set-precipitation-parameter fcc_a1#01_p0 n s dg
This command will define (d)islocations AND (g)rain boundaries as nucleation sites. MatCalc
will then automatically use the spherical diffusion geometry again as shown in the left image.
Click 'OK' to go the heat treatment editor. The existence of pre-segment and post-segment
scripts is indicated by the letter 'Y' in the heat treatment editor.
Again, click 'OK' and Save your file ('Tutorial_17.mcw').
PERFORM SIMULATION
Start the precipitation simulation with 'Calc > Precipitate kinetics …'. In this dialog, the most
important setting is the 'temperature control' selection. Select 'from heat treatment' and
'sample_ht'. It is not necessary to enter/modify the simulation end time because MatCalc will
automatically stop when reaching the end of the heat treatment segments.
183
Tutorial 17
184
Tutorial 17
185
Tutorial 17
The temperature plot on top shows the expected profile. The next plot with the NbC phase
fraction shows a strong increase of the phase fraction at around 80s, where the specimen ia
at ~1300°C on heating. Next, the phase fraction increases when the ferrite region is entered
which is due to the lower solubuility of NbC in ferrite compared to austenite. The next
increase is observed in ferrite domain when the specimen is heated from room temperature.
Later, during austenitization, the phase fraction is decreased slightly (beeter seen with the
linear scale for phase fraction) because the solubility of the Nb and C is increased. The phase
fraction remains almost constant during the rest of the process.
When looking at the plots for the mean radius and the number density of the NbC
precipitates, interpretation of the results is more difficult. First, nucleation starts and
proceeds until ~100 s. The nucleation stops because there are no more available nucleation
sites at the grain boundary. Up to approximately 800 s, the existing NbC precipitates only
grow. After switching to ferrite and adding dislocations as additional nucleation sites, the
number density quickly increases in a burst of nucleation events. At the same time, the mean
radius drops drastically, which is at first sight unexpected. However, since the plot displays
the mean radius of the precipitate population, generation of a large number of new and small
precipitates will decrease the mean value to the value of the highest number of precipitates.
Later, in two more steps, the radius increases again due to growth as well as dissolution of a
part of the small precipitates generated in the second nucleation burst.
Apparently, interpretation of this kind of simulation suffers from the fact that two different
kind of precipitate populations, namely the one on the austenite grain boundaries and the
other on the dislocations are treated as one. In the following section, a method of separation
of populations is used that can be very useful in complex simulations.
186
Tutorial 17
Note that the suffix '_P1' of the new phase indicates that the precipitate is identical to the
'_P0' in terms of its nucleus composition, however, it contains precipitate classes that can
have appeared at different stages of the heat treatment.
Let us now set up the simulation such that the _P0 phase can only nucleate in the first
segment of the heat treatment, that is cooling in the austenite, while the '_P1' population is
not allowed to form. This can be done by defining 'nucleation sites' as 'none'. For all
consecutive segments, nucleation of further '_P0' precipitates will be suppressed while the
'_P1' population can nucleate at grain boundaries and dislocations. Make the following
changes to the pre-segment and post-segment scripts of the first segment in the heat
treatment editor:
187
Tutorial 17
Run the simulation again and modify the plots (add the series relevant for the FCC_A1#01_P1
phase) to display the properties of both precipitate populations. The result should look like
this:
188
Tutorial 17
189
Tutorial 17
190
Tutorial 17
Repeat this for the 'FCC_A1#01_P1' phase, but select 'ferrite' as the precipitation domain.
Next, have a look on the nucleation sites of those phases. The content of the tab represents
the final state of the last simulation. Hence, the dislocations and the grain boundaries are
selected for the '_P1'-phase, but no nucleation sites are selected for the '_P0'-phase. Again,
select 'grain boundary' as nucleation sites for the 'FCC_A1#01_P0' phase.
191
Tutorial 17
With these settings, the pre- and post-scripts are not needed anymore. To remove those, go
to the 'Global' > 'Heat treatments' and click on the very first segment in the 'Data…' list box.
In the segment editor dialog, click on the 'Clear' button below the content of the post-
segment script. Select the 'Pre-Segment Script' tab and click on the 'Clear' button again. Close
the heat treatment editor.
Duplicate and lock all series and start the simulation. The results look virtually identical with
the previous simulation.
192
Tutorial 18
CONTENTS
193
Tutorial 18
The plot below, obtained using a stepped equilibrium calculation, shows the equilibrium
phase fraction of NbC between 900 and 1400°C:
194
Tutorial 18
The plot below illustrates the origin of the typical C-shaped curves of TTP plots. It was
obtained using 'Calc > Precipitation kinetics' to simulate an isothermal heat treatment at
925°C, plotting the series F$FCC_A1#01_P0 on a logarithmic x-axis, then duplicating and
locking this series before making further calculations in the same way at a selection of other
temperatures. At each value of temperature, the phase fraction of NbC increases with time
before reaching a plateau when the equilibrium phase fraction of NbC at that temperature is
attained. It can be seen that, between 1100 and 1200°C, the rate of reaction first increases
(characterised by a shift of the curve towards the left), goes through a maximum, then
decreases again. TTP diagrams plot the time taken to reach a particular point in a reaction at
different temperature values. It can be seen from the plot below that if, for example, the time
taken to reach 90% of the plateau value were plotted for each temperature on axes of
temperature versus time, the resulting curve would be C-shaped. The TTP diagram calculation
function of MatCalc allows automatic calculation of curves of this type.
Open 'Calc > TTP-diagram' and enter '1375' as the start temperature and '925' as the stop
temperature. The end time should be sufficient for the phase fraction to reach a plateau at all
temperatures under consideration. (This can be verified by creating an XY-plot of
F$FCC_A1#01_P0 versus time and monitoring this during the TTP diagram calculation.)
In the 'Calculation method' area, select 'isothermal' and enter a value of 25 for 'delta T'.
Calculations will now be performed every 25 degrees between 1425 and 925°C.
Note: The calculation in the whole range may take more than 30 minutes (depending on your
195
Tutorial 18
PC capacity). In case you would not spend so much time on this tutorial constrain the
temperature range (e.g. 925°C - 1225°C)
When the calculation has finished, create a new window of type '(p6) Plot: TTP-diagram'. In
the 'options' window, expand the 'plots' section and right-click in the area under 'plot#0' to
show the context menu. Select 'new series' and choose 'ttp-curve' from the sub-menu on the
right. Next, it is necessary to decide on the type of TTP contours required. The three options
are:
Select 'relative' from the 'refer to f' drop-box at the top of the 'options' window. Then
expand the 'series' section of 'options', which should look as shown in the image below.
Select the phase FCC_A1#01_P0 from the 'phase' drop-box and enter '0.05' into the 'y-data'
line.
196
Tutorial 18
Add two more series to show the contours for ratios of 0.5 and 0.95 on the same diagram.
The resulting diagram should look like this:
The following two plots are examples of the other types of TTP diagram. (TIP - to create more
than one type of TTP diagram in the same plot window, lock all the series in the first diagram,
then change the diagram type in the 'refer to f' drop-box to plot the next diagram.)
ABSOLUTE
In the plot below, the contours correspond to different values of the phase fraction
F$FCC_A1#01_P0. Note that the higher values are only attained at lower temperatures,
because the equilibrium value of F$FCC_A1#01 decreases with increasing temperature. The
maximum value of F$FCC_A1#01_P0 is around 7.8e-3.
197
Tutorial 18
RELATIVE MAX F
This diagram has a similar appearance to the 'absolute' diagram above, but the contours now
represent different ratios of F$FCC_A1#01_P0 to its maximum value.
198
Tutorial 19
The use of scripting to help ensure repeatability of calculations and to simplify repetitive
operations has been introduced for the equilibrium calculations Tutorial 13. The present
tutorial describes how scripting can be used for precipitation calculations.
CONTENTS
• Setting up precipitation domains
• Setting up precipitate phases
• Scripting a complex heat-treatment
• Modifying precipiation parameters during heat-treatment
• Plotting using scripts
The example used here uses the already familiar Fe-Nb-C system and considers a heat-
treatment of an initially well-annealed ferritic microstructure with no primary precipitates.
Cementite is initially allowed to nucleate on dislocations, and NbC on grain boundaries. The
microstructure is heated into the austenite phase stability region, held isothermally and then
cooled quickly (quenched). On quenching, a martensitic transformation occurs. This is
modelled in MatCalc by a modification of the ferrite precipitation domain to increase the
dislocation density as well as the addition of subgrains as possible nucleation sites for the NbC
phase. The system is then subjected to a tempering heat treatment consisting of heating,
isothermal hold and cooling stages.
199
Tutorial 19
use-module core
The following code can be used to check that the correct version of MatCalc is being used.
This is useful when scripts rely on functionality that is only available in newer versions of the
software. The code send-dialog-string sends a message to the user in the form of a
dialogue box, and stop-run-script prevents any further commands from being
executed.
if (matcalc_version<6000000)
stop-run-script
endif
Scripts should be well commented to ensure that they can be easily understood later.
See Tutorial 13 for a reminder of how comments are inserted.
Some information on the physical situation to be modelled and the assumptions made can be
inserted into the MatCalc workspace for future reference.
@$************************************
@$************************************
The thermodynamic setup is then carried out. Firstly, the database is chosen and the
selements and phases are selected. The database is then read.
200
Tutorial 19
open-thermodyn-database mc_fe.tdb
select-elements FE C NB VA
read-thermodyn-database
set-reference-element FE
set-temperature-celsius 1000
set-automatic-startvalues
calculate-equilibrium
create-precipitation-domain ferrite
create-precipitation-domain austenite
We must then tell MatCalc with which matrix phases to associate these domains:
Structural parameters are then defined for ferrite (note comments describing the meanings of
the commands):
201
Tutorial 19
set-precipitation-parameter ferrite T O 10
and for austenite. Note that for ferrite, parameters characterising the subgrains are included
because subgrain boundaries will be used as nucleation sites later in the calculation. In
austenite, this is not the case so the parameters for this domain are not relevant and need
not be set.
create-new-phase CEMENTITE P
create-new-phase FCC_A1#01 P
Note that this latter phase is derived from the second FCC_A1 phase, FCC_A1#01, which is
automatically generated by MatCalc, based on a command in the database, as a result of the
presence of the MX carbonitride former, Nb, in the system.
The precipitate phase are initialised with 100 size classes each.
set-precipitation-parameter CEMENTITE_P0 N S D
202
Tutorial 19
set-precipitation-parameter FCC_A1#01_P0 N S G
The nucleus composition of the iron-rich cementite precipitate phase is set to para-
equilibrium, and that of NbC is set to ortho-equilibrium.
set-precipitation-parameter CEMENTITE_P0 N C P
set-precipitation-parameter FCC_A1#01_P0 N C O
read-mobility-database mc_fe.ddb
HEAT-TREATMENT
For an isothermal precipitation simulation, we would now simply need to set the temperature
and time and start the simulation. This procedure is described briefly below. However, we will
here instead look at how to use a script to create a heat-treatment.
• heating from room temperature to the austenitisation temperature; since this heating
step involves a phase transformation from ferrite to austenite, this must be specified
in two stages - heating up to the transformation temperature with a ferrite
precipitation domain, and then heating from the transformation temperature with an
austenite precipitation domain.
• an isothermal hold at the austenitisation temperature
quenching to room temperature; again, this is separated into two stages, the first of which
has an austenite precipitation domain, and the second, a ferrite precipitation domain.
203
Tutorial 19
The tempering treatment is carried out entirely in the ferrite phase stability region, so no
change of precipitation domain is necessary.
create-heat-treatment sample_ht
• Type 1: this consists of an end temperature and a heating/cooling rate (use a negative
sign to specify cooling)
• Type 3: this consists of an end temperature and a time.
We saw in Tutorial 6 that it is possible to define our own variables. Here, we use this
functionality to define a very general script consisting of an austenitisation and a tempering
step.
append-ht-segment sample_ht
Then specify the [s]tart temperature. The notation [.] means the current segment. It is also
possible to refer to the segments by number.
204
Tutorial 19
edit-ht-segment sample_ht . S 20
The parameters for the segment are thus set; the parameter set no.[1] is chosen with end
temperature f_a_temp and heating rate rate_heat_to_aus K/s.
The precipitation [d]omain associated with this segment must now be set, as it is [n]ot
inherited from any previous
We then append a new segment to accommodate the remainder of the heating ramp to the
austenitisation temperature.
append-ht-segment sample_ht
This new segment now becomes the current segment, so we can modify its parameters using
the [.] notation. Again, the parameter set [1] is chosen with end temperature aus_temp and
the same heating rate, rate_heat_to_aus, as before.
We also need to change the precipitation [d]omain, so that it is [n]ot inherited from the
previous segment but is instead set to austenite:
append-ht-segment sample_ht
The isothermal hold is specified using parameter set type [3], with end temperature
aus_temp and hold time aus_time.
edit-ht-segment sample_ht . D Y
205
Tutorial 19
We next add two segments for cooling down from the austenitisation domain to room
temperature. Add a new segment for the austenite domain part. Set the segment type to [1]
and set the end temperature to the austenite-ferrite transformation
temperature a_f_temp and the cooling rate to rate_cool_from_aus. Set the segment
to inherit the precipitation domain (austenite).
append-ht-segment sample_ht
edit-ht-segment sample_ht . D Y
Add a further new segment for the ferrite domain part. In this case, we again use type [1]
and, this time, set the end temperature to 20 and the cooling rate, as before,
to rate_cool_from_aus. This time, the precipitation domain is not inherited, but is instead set
to ferrite.
append-ht-segment sample_ht
In addition, since this ferrite is now quenched martensite, we make some modifications to the
properties of the precipitation domain. As we saw in Tutorial 17, pre- and post-segment
scripts can be appended to segments of a thermomechanical treatment. The syntax for these
scripts is illustrated by the following line of code, which sets the equilibrium dislocation
density in the ferrite domain to 1e14:
The O here indicates a p[o]st-segment script; a p[r]e-segment script is instead indicated by the
letter R in place of the O. The +-sign means that the following piece of script is added to any
existing commands. An existing command can be removed by prepending a --sign.
Similarly, in the following line, the [n]ucleation [s]ites of FCC_A1#01_P0 are set to include
[s]ubgrains as well as [g]rains.
206
Tutorial 19
TEMPERING TREATMENT
The structure of the tempering treatment is similar to that of the austenitisation treatment,
but somewhat simpler, since no phase transformation needs to be considered.
The first part of this treatment is a heating segment with an end temperature of temp_temp
and a heating rate of rate_heat_to_temp. The precipitation domain is inherited from the
previous segment.
append-ht-segment sample_ht
edit-ht-segment sample_ht . D Y
append-ht-segment sample_ht
edit-ht-segment sample_ht . D Y
Finally, a cooling segment returns the system to room temperature with a rate
of rate_cool_from_temp. The precipitation domain is once more inherited.
append-ht-segment sample_ht
edit-ht-segment sample_ht . D Y
PLOTS
The final part of the setup before the calculation is run consists of setting up the plots. We
will create four X-Y plots in a single plot window as well as a histogram of precipitate size
distribution for each of the precipitate phases.
new-gui-window p1
Then set up the default x-axis so that it is used for all the plots in this windows, and has the
properties specified below:
207
Tutorial 19
The first plot will contain the temperature profile as determined by the heat-treatment. The
y-axis is labeelled accordingly.
The legend box is removed because it is not necessary when only one series is plotted:
set-plot-option . L N
A new plot is then created in the existing plot window [.] using the command:
create-new-plot X .
This is set up to show the phase fractions of the two precipitate phases. The syntax %s here
means that the MatCalc variables are used as-is without any modification. (See Tutorial 5)
set-plot-option . S N B F$CEMENTITE_P0 %s
set-plot-option . S N B F$FCC_A1#01_P0 %s
There are two series in this plot, so we label them. The two series here are referred to by
number. The ordering number corresponds to the order in which they appear in the plot, not
in the plot window, and begins at 0.
A further new plot is created, to plot the number density of precipitates. The series are
renamed; note that the numbering starts at 0 again because we are now in a new plot.
208
Tutorial 19
create-new-plot X .
set-plot-option . S N B NUM_PREC$CEMENTITE_P0 %s
set-plot-option . S N B NUM_PREC$FCC_A1#01_P0 %s
The final of the four plots shows the mean precipitate radius.
create-new-plot X .
set-plot-option 4 S N B R_MEAN$CEMENTITE_P0 %s
set-plot-option 4 S N B R_MEAN$FCC_A1#01_P0 %s
Major gridlines are switched on for both x- and y-axes of all plots. Here the plots are referred
to their number, starting from 1.
set-plot-option 1 G M X Y
set-plot-option 1 G M Y Y
set-plot-option 2 G M X Y
set-plot-option 2 G M Y Y
set-plot-option 3 G M X Y
set-plot-option 3 G M Y Y
set-plot-option 4 G M X Y
set-plot-option 4 G M Y Y
set-gui-window-property . N 2
209
Tutorial 19
new-gui-window p5
The default x-axis is set up, with the scaling factor used to give plotting in nanometres rather
than metres.
set-gui-window-property . S U Y
A [n]ew [s]eries showing the [p]recipitate distribution of the “cementite_p0” phase is plotted:
set-plot-option . S N P CEMENTITE_P0
new-gui-window p5
set-plot-option . S N P FCC_A1#01_P0
set-plot-option . L N
We first save the workspace setup as it before the calculation. This enables us to easily revert
to this pre-calculation state if necessary.
save-workspace Tutorial_19_setup
An isothermal calculation can be carried out as follows. This can be useful as a preliminary
calculation to check that everything is working.
Then, the temperature control of the simulation is set to be [I]sothermal and the required
temperature specified.
set-simulation-parameter T I 600
start-precipitate-simulation
When this has been successfully carried out, the line specifying isothermal temperature
control should be commented out by prepending a dollar sign so that it looks as shown:
$set-simulation-parameter T I 600
The temperature control is instead set to be governed by the [h]eat treatment “sample_ht”
with a maximum temperature step of 10:
set-simulation-parameter T H sample_ht 10
start-precipitate-simulation
save-workspace Tutorial_19
export-frame-to-file 2 N frame.png
export-frame-to-file 3 N T19_histo_cementite.png
export-plot-to-file 4 N T19_Rmean
The x-y plot window should look as follows after the calculation:
212
Tutorial 20
CONTENTS
Single-class model for grain growth
Multi-class model for grain growth
Grain growth with pinning and solute drag
213
Tutorial 20
There are two parts to the setting-up of the simulation, both in Precipitation domains. (Note
that a precipitation domain must be set up and configured for the grain growth simulation,
even if no precipitation is taking place.)
In the general tab, specify the Initial grain size. In this example we will leave this at the
default value:
Then, go the the MS Evolution tab and select the Grainstructure sub-tab. By default, the
evolution model for grain size is set to None - no evolution. This is the option that has been
used in all kinetic simulations so far; the grain size, as well as other microstructural
parameters such as dislocation density, has been taken as constant. Instead, set this to Single
214
Tutorial 20
class model (No. (1) in the diagram below). A set of options will appear as shown in the
diagram below. For the single-class model, we are only concerned with the parameters
marked with the number (2).
The model implemented in MatCalc is described in 1). The rate of change of the diameter D of
the grains as a function of time given by:
where M is the mobility of the grain boundaries and Pd and Pr are the driving force and the
retarding pressure on the grain boundaries, respectively.
The driving force Pd depends on the grain boundary energy γg and the grain diameter D:
215
Tutorial 20
and the retarding force due to pinning by a volume fraction fv of particles with diameter d is
given by:
The terms kd and kr are the constants that appear in the dialogue box above.
Using Calc > precipitation kinetics, set up an isothermal simulation with an end-time of 36000
s and a temperature of 800°C. Click on Go. The simulation will be over very rapidly compared
to precipitation simulations.
Create a plot of type p1. In the variables window, find the section entitled prec domain struct
sc (single class) and expand to show GD$*. Expand this one step further to show GD$ferrite,
and drag this to the plot window. Change the (default x-axis label to read time [h] and modify
the scaling factor to 1/3600. Change the y-axis title to Grain diameter [x10-6m] and modify
the scaling factor to 1/1e-6.
Label the existing series 800°C, duplicate and lock it and repeat the calculation for 750°C and
700°C to give curves as shown:
216
Tutorial 20
Changing k_r will not modify the results in the present case, because we have not yet set up
any mechanism to retard the grain growth. However, as would be expected from the
equations above, changing k_d to a lower value gives a smaller grain size at the same time, all
else being equal.
Experiment also with different initial grain diameters. If the initial grain diameter is reduced,
the curve moves downwards to smaller grain sizes for a given time and temperature.
1)
M. Rath & E. Kozeschnik, “Coupled grain growth and precipitation modeling in multi-phase
systems”, Materials Science Forum Vol. 753 (2013) pp 357-360
217
Tutorial 21
CONTENTS
• Effect of volumetric misfit on precipitation kinetics
• Introduction of deformation into the thermo-mechanical treatment
• Effects of the applied deformation on the precipitation kinetics
Deformation process influences the microstructure of the alloy. One of the effects is the
occurence of the strain induced precipitates. This tutorial demonstrates how the deformation
processes can be included in the simulation of the processed material. Moreover, the effects
of the deformation on the precipitation kinetics are demonstrated and discussed.
218
Tutorial 21
PHASE SOLUBILITIES
In order to have some insight into the system equilibria, perform a stepped equilibrium
calculation. In 'Stepped euilibrium ' window select the temperature range of 400-1400°C with
the step of 10°C. Click on 'OK'
The phase fractions can be plotted by calling the appropriate user-defined window.
In 'View' → 'Create new window', select the 'user defined' tab. There, select
'01_all_phase_fractions over T_celsius_logY' and click on 'OK'.
219
Tutorial 21
This will result in the plot looking like the one shown below. From this diagram it can be
concluded that NbC precipitates below 1300°C and the ferrite will form below 850°C.
220
Tutorial 21
Next, create a precipitation domain called 'austenite' in the 'Precipitation domains …'
window. Select FCC_A1 as the thermodynamic matrix phase.
Now, define the precipitate phase settings in 'Phase status' window. Select 'FCC_A1#01' and
click on 'Create' and 'precipitate (_Pnn'). In 'Nucleation' → 'Sites' set 'dislocations' as
nucleation sites (and remove the checkmark from 'bulk').
THERMO-MECHANICAL TREATMENT
The last step before the initial kinetics simulation is the definition of the thermo-mehanical
treatment. In 'Global' → 'Thermo-mech. treatments …' create a new treatment with the
name 'cooling'. Next, create a segment in which the austenite domain will be cooled
from 1300°C to 750°C with 1°C/s cooling rate.
221
Tutorial 21
222
Tutorial 21
Once the calculation is completed, use the 'user defined plots' for visualizing the phase
fraction, number density and mean radius evolution of the precipitates, as well as the
temperature profile. Click on 'View' → 'Create new window', select the 'user-defined' tab
and choose the last entry '03_kinetics_4_frames_T_f_n_r_linX'. Click on 'OK'. Set the start of
the scaling range to '1'. The analysis of the created plots reveals a somewhat unspectacular
precipitaition of NbC phase after 200 s (below 1100°C) that reaches the number density of
1e18 m-3 and stays in the nanometer range.
223
Tutorial 21
224
Tutorial 21
demonstrated how this effect can be intorduced into the simulation and what is the effect of
it.
Click on 'Global' → 'Phase status' and select 'Structure' tab. In the field 'vol. misfit
(dV/V)' type in the values of '0.1' for the precipitate phase. This represents the stress coming
from the precipitate volume differing by 10% from the matrix volume.
Next, in 'Nucleation' → 'Controls' tab put a checkmark at the 'account for coherent misfit
stress' for the precipitate phase.
226
Tutorial 21
Click on 'OK' to close the window. Create a new buffer with the name 'Vol_misfit'. With this
buffer selected, perform again the kinetic simulation. Once the simulation is completed,
duplicate and lock all series in the plots, then switch the displayed buffer to 'Vol_misfit'. As it
can be noticed, the definition of the volumetric misfit decreased amount of the precipitated
phase.
227
Tutorial 21
228
Tutorial 21
When deformation process is to be simulated, there are basically three things to be modified
in the treatment:
The deformation will change the microstructure of the alloy. Here, the change of the
dislocation density by the deformation is presented.
229
Tutorial 21
You might notice some parameters in the 'Dislocation generation and anihilation …' section
which describe the generation of the dislocations ('A'-parameter) and their anihilation during
the static ('B'-parameter) and dynamic recovery ('C'-parameter). Leave all the parameters
there on the default value.
230
Tutorial 21
In this simulation, three deformation runs will be represented. Click on 'Global' → 'Thermo-
mech. treatments' and create a new treatment with the name 'deformation'. The first
segment will have the starting temperature of 1300°C but the end temperature will be 1000°C
with the cooling rate of 1 K/s. In the next segment, change the ramp control setting
to 'Accumulated strain' and set the 'Accumulated strain' value to '0.7'.
231
Tutorial 21
Afterwards, switch to the 'MS Evolution' tab and type in the strain_rate value of '0.15'.
232
Tutorial 21
The definition of the next segments should follow the settings below:
233
Tutorial 21
As previously mentioned, some volumetric misfit might be present related to the precipitates
appearing in the grains, decreasing thus their nucleation rate. However, the stress introduced
during the applied deformation can cancel this effect. To account for this in MatCalc, clicking
on 'Global' → 'Phase status' and select the 'Nucleation' → 'Controls' tab. Put a checkmark
at 'ignore misfit stress during deformation' for both precipitate phases. Click on 'OK' to close
the window.
234
Tutorial 21
KINETIC SIMULATION
Click on 'Global' → 'Buffers' → 'Create' to create a new buffer with the name 'Deformation'.
Afterwards, click on 'Calc' → 'Precipitation kinetics' and select the deformation treatment.
Start the calculation by clicking on 'OK'. The results of the precipitation kinetics calculation
are shown now with the blue curve.
235
Tutorial 21
236
Tutorial 21
237
Tutorial 23
CONTENTS
• Activation of recrystallization model
• Kinetic simulation of recrystallization process
Deformation of the material introduces new dislocations into the microstructure. These
surplus dislocations will create the substructure by ordering themselves into the subgrain
walls during the recovery process. MatCalc includes a model describing the transformation of
the newly subgrains into the new recrystallized grains, as described at Buken et al. This
tutorial shows the procedure to activate the recrystallization model, presents the typical
result of the recrystallization kinetics simulation and discusses the output values of the
parameters obtained during the simulation.
238
Tutorial 23
Create a precipitation domain called 'matrix' in the 'Precipitation domains …' window.
Select FCC_A1 as the thermodynamic matrix phase.
In the current recrystallization model, the newly recrystallized grains form from subgrain
created during the recovery process following the material deformation. First, the subgrain
formation and size evolution will be investigated. The subgrains are generated by the ordering
of the excess dislocations introduced during the deformation process. Hence, the next thing
to do will be to activate the substructure evolution model. Switch to the 'MS Evolution' tab,
select 'Substructure' tab inside and choose '1-param - Sherstnev-Lang-Kozeschnik - 'ABC' ' as
the model for the substructure evolution.
239
Tutorial 23
In this tutorial, the default model parameters will be used for the demonstration so click
on 'OK' to close this window.
THERMO-MECHANICAL TREATMENT
Now, define the thermo-mechanical treatment which will consist of the deformation segment
and the subsequent annealing segment. For the sake of simplicity, the whole simulation will
be performed at the constant temperature of 1200°C. In 'Global' → 'Thermo-mech.
treatments …' create a new treatment with the name 'tmt'. Next, create a segment in which
the austenite domain will be deformed to the accumulated strain value of '0,1'.
In 'MSEvolution' tab, set the 'eps-dot' (strain rate) value to '1'. Back in 'General' tab,
the 'Start temperature' is to be set to '1200°C'.
240
Tutorial 23
241
Tutorial 23
In the next segment, the material will be held isothermally at 1200°C. Select “Heat/Cooling
Rate & Delta-Time” in “Ramp control” field and set the rate to '0' and the segment time
to '10000' seconds.
242
Tutorial 23
Once the calculation is completed, create a plot visualizing the dislocation density. In
menu 'View', click on 'Create new window…' and select '(p1) Plot core: XY-data' plot type.
Drag and drop 'DD_TOT$matrix' variable which is located in the 'prec_domain struct
sc' group in 'variables' window. Set the x- and y-axis to logarithmic scale and start the x-axis
scaling at 1e-5. Rename the x-axis to 'Time [s]' and the y-axis to 'Dislocation density [m-2]'.
Switch on the major grids for both axes.
243
Tutorial 23
As might be expected, the plot shows an increase of the dislocation density during the
deformation segment which lasts up to 0,1 second. Afterwards, the dislocation density falls
down to approx. 2e12 which corresponds to the recovery process during the subsequent
isothermal holding at 1200°C. In order to investigate the effect on the size of the forming
subgrains, create a new plot depicting the 'SGD$matrix”' variable which represents the
subgrain diameter. 'SGD$matrix' variable can be also found in the 'prec_domain struct
sc' group.
The subgrain diameters drops initially from about 100 micrometers down to about 7
micrometers at 0,1 seconds. Afterwards, it rises again reaching the initial value. The stage of
subgrain decrease is not to be interpreted directly, as the subgrains are formed during
recovery rather than during deformation stage. It is a consequence of the MatCalc setting
which sets the initial value of subgrain diameter equal to the initial value of the grain
diameter. Then, the subgrain size is calculated inversely to the square root of the dislocation
244
Tutorial 23
density, in accordance with the similitude principle. As the recovery process starts, it is
assumed that the subgrains are immediately formed with the predicted size of 7 micrometers.
These sugrains grow afterwards in a similar way as the grains would do - there is a model
which correlates the growth rate with the inverse of the subgrain diameter. During the
recovery step, the rising subgrain size corresponds to the falling dislocation density. After
almost 3 seconds, the subgrain size reaches the initial value of 100 micrometers and cannot
grow further as the limiting grain size remains at this value. The dislocation density decreases
further down to about 2-3e12 m-2. After reaching this value at about 35 seconds, it remains
steady till the end of the simulation.
One might ask, why the dislocation density remains at this value rather than decreasing
further to the initial value of 1e11 m-2. This happens as MatCalc proceeds with the dislocation
annihilation till the equilibrium wall dislocation density value is reached, as defined in the
substructure model setting. The last simulation was performed on the default setting which
sets this value to the one required for the presence of the subgrains with the given size, as
proposed by Read and Shockley. In the last case, the subgrains could not grow beyond 100
micrometers. It was already mentioned before, that the subgrain size is calculated from the
dislocation density on the basis of the similitude principle which relates these two
parameters. In the same manner, it is possible to calculate dislocation density which are
geometrically needed for the given subgrain size and the given misorientation angle between
the neighboring subgrains. As might be recalled from the substructure model settings, the
misorientation angle of 3 degrees was used in the last calculation. The limiting value of the
dislocation density coming from the discussed geometrical constraint is represented by the
variable 'DD_EQU_RS$austenite'. Drag and drop this this variable on the dislocation density
plot. The first observation is that the initial value for the limiting density is above the
simulated actual density value. As mentioned above, this stage is not to be directly
interpreted, as the subgrains are not forming during the deformation yet. During the recovery
period, the limit value proceeds according to the subgrain size and reaches a plateau at about
3 seconds, when the subgrains do not grow anymore. The limit density curve is joined by the
actual density one at about 35 seconds, after which nothing more happens in the system.
245
Tutorial 23
246
Tutorial 23
After the calculation is done, switch the buffer relevant to the plots to the current one. In
the 'options' window, select 'deformation&growth' in the 'core buffer' field. One can
immediately notice the difference in the curves at the recovery stage. Increasing grain
diameter allows for the further growth of the subgrains. This results in the further decrease of
the dislocation density.
247
Tutorial 23
INTRODUCING RECRYSTALLIZATION
It is time to activate the recrystallization model. In 'Precipitation domain' window, select
again the 'MS Evolution' and 'Grainstructure' tab there. In the 'Recrystallization
control…' section put a checkmark in 'Allow rexx' field.
248
Tutorial 23
In 'Global' → 'Buffers' click on 'Create' and create a new buffer named 'Recrystallization'.
Next, create three more plots in the plot window. Use the following y-axis settings for the
plots:
Additionally, add the series 'GD_DEF$matrix' and 'GD_RX$matrix' to the plot of grain
diameters.
With all these plots present, perform once again a kinetic simulation. Once it is completed, a
picture of the recrystallization progress in the system is available. Looking at the last plot of
recrystallized fraction for the matrix, one can notice that the structure is fully recrystallized.
The process seems to happen between the 0,1 and 10 seconds.
Looking on diagram showing the grain number densities, one can notice that the “old”
microstructure of the deformed grains, represented with the variable 'NG_DEF$matrix', with
the initial density of slightly above 1e12 m-3 decreases gradually and vanishes at the end of
the recrystallization process. The curve representing the number of the recrystallized grains
(variable 'NG_RX$matrix') appears already before 0,1 seconds and grows fast, showing a
249
Tutorial 23
maximum value at about 1e14 m-3 and then continues to decrease to the end of the
simulation. This analysis is supported by the plot of nucleation rates of recrystallized grains,
which shows that the nucleation phase for the recrystallized grains starts around the time of
0,05 seconds and lasts to about 1,5 seconds. The end of the nucleation phase coincides
obviously with the maximum observed for the number density of the recrystallized grains.
The total number density of grains, represented by the variable 'NG$matrix' is just a
superposition of the two previous values.
The plot representing the grain diameter (with y-axis scaling limited to 2000 micrometers)
gives some further information. The curve 'GD_DEF$matrix'representing the size of the
deformed (“old”) grains initializes at 100 micrometers. The
curve 'GD_RX$matrix' representing the size of the recrystallized (“new”) grains initializes at
some high value and decreases down to about 13 micrometers. Obviously, a physical
interpretation for the recrystallized grain size is reasonable only for the process time when
250
Tutorial 23
such grains are present at all, i.e. once the number density of recrystallized grains gets a
positive value. The mean value for the grain diameter observed in the microstructure
('GD$matrix' curve) decreases gradually from the deformed value towards the recrystallized
value. Growth process of the recrystallized grain can be observed after the deformation
process ends. On the contrary, the diameter of the deformed grain decreases a little, as these
grains are “consumed” by the newly formed structure. Of course, there is again no
interpretation possible for the deformed grain size for the simulation time with zero number
density of these grains. Once the microstructure is fully recrystallized, a grain growth is
observed. This coincides with the reduction of the nucleation density representing an
occurrence of the grain impingement.
Interestingly, the results for the subgrain size and dislocation density are similar to the ones
obtained in the simulation without grain growth. The subgrain size seems to be limited again
short below 100 micrometers and the dislocation density remains steady at the according
value. To interpret this outcome correctly, one needs to keep in mind that the subgrains are
assumed to exist only in the deformed grains in the applied single class model. The first
consequence of this fact is that the interpretation of the calculated subgrain size is relevant
only for the time periods when the deformed grain is present in the system, i.e. till the
microstructure is fully recrystallized. The other consequence is the limitation of the subgrain
size which cannot get a value greater than the size of the deformed grain. As the deformed
grain size did decrease during the simulation, the subgrain size growth also stops around 95
micrometers. The dislocation density remained also at the value corresponding to the
simulated subgrain diameter.
251
Tutorial 23
252
Tutorial 23
CONTENTS
• setting up a simulation grid
• assigning properties to cells
• setting up display of cell simulation results
• setting up simulation parameters
• boundary conditions
MatCalc can be used to carry out simulations of long-range diffusion problems, and problems
in which diffusion is coupled with precipitation, using a finite-element method with the
system divided into a number of cells. Many examples of the application of this functionality,
in different systems and with different boundary conditions, can be found in the relevant part
of the 'Examples' section. The present tutorial demonstrates a simple case for which an
analytical solution of Fick’s 2nd Law is available. The numerical and analytical solutions are
compared.
The functionality for setting up and running diffusion simulations is only available through the
scripting language and not through the GUI. This tutorial therefore also serves as a refresher
for some of the basic scripting commands that we have already encountered, as well as
introducing the new commands needed to set up and run diffusion simulations.
253
Tutorial 23
One of these is the thin-film solution, in which an very thin layer containing a finite amount of
the diffusing species is sandwiched between two semi-infinite bars of material. The boundary
conditions are that:
• initially, the concentration of the solute in the bar is zero; this is expressed
mathematically as C{x=0,t=0}=0 , where x is the distance from the midpoint marked
by the central black vertical line in the diagram below, and
• the total amount of solute is finite and constant throughout the time period
considered; this is expressed mathematically as
254
Tutorial 23
The standard solution when the boundary conditions are of this type is of Gaussian form:
In this tutorial, we will set up a cell-based numerical simulation of a situation that fulfils these
conditions to a reasonably good approximation, i.e. a thin layer of FCC iron with a relatively
high carbon content sandwiched between two bars of FCC iron with a very low carbon
content. The results of this simulation will be compared with those obtained using the
analytical solution.
The first task that the script must perform is to create a new MatCalc workspace. Type the
following command into your script window:
use-module core
This tells MatCalc to use the core module , which it selects at the begining by default
anyway; later in this tutorial we will see the use of the simulation module .
new-workspace
This creates a new workspace. If an existing unsaved workspace is open when the script is
run, you will be prompted to save it. To disable this prompt, append f to the new-
workspace command.
@$************************************
@$************************************
255
Tutorial 23
The next step is to set up the thermodynamic and kinetic data. Enter the following commands
into your script window and save the script.
open-thermodyn-database mc_fe.tdb
select-elements fe c
select-phases FCC_A1
read-thermodyn-database
read-mobility-database mc_fe.ddb
Following this, define the variables that will specify the initial carbon content in the bar
(c_comp_bar_wp) and the thin layer (c_comp_layer_wp) so that these can be used later. Note
that the carbon content of the bar is set to be very low, but for numerical reasons it is not
advisable to set this to exactly zero.
In the cell simulation, compositions must be entered in molar notation un$c. The code below
enables you to enter a composition in weight percent (wp) and then save the composition in
mole fraction as a variable for use in the cell simulation.
enter-composition wp c=c_comp_bar_wp
enter-composition wp c=c_comp_layer_wp
Then set a temperature and calculate an equilibrium to initialise the system and check that
everything is working OK.
set-temperature-celsius 1000
calculate-equilibrium
At this stage, also specify the simulation time (in seconds) for subsequent use:
256
Tutorial 23
Save the script. It is recommended to test it out at this stage to catch any typing errors before
going further.
Before setting up the cell simulation, you must define a precipitation domain , i.e. a matrix
of phase FCC_A1; this is necessary for subsequent use in the cell simulation.
create-precipitation-domain aus_domain
The next step is to set up the cell simulation. First change to the simulation module:
use-module simulation
set-variable-value num_cells_x 99
create-simulation-grid num_cells_x 1 1
The three numbers here represent the number of cells in the x-, y- and z-directions,
respectively. Define a variable representing the length of the bar:
set-grid-coordinates barlength 1 1
set-grid-geometry p
• p - planar
257
Tutorial 23
• c - cylindrical
• s - spherical
To visualise this grid, create a new window of the type g5 (Paint grid: 2D cells):
new-gui-window g5
Give this window a name so that it can be referred to easily later. The
variable active_frame_id used here is one of MatCalc's internal variables; see the section of
the Reference book on internal variables for details.
Modify the position, size and zoom level using the following two commands:
In the next section, properties will be assigned to the cells in the grid.
For the diffusion simulation, it is necessary to create a material and assign to this
the precipitation domain called aus_domain that was created above:
create-material aus_material
Then set the diffusion coefficient. Here, a user-specified value is used, instead of one
calculated using information from the database, to better facilitate comparison with the
analytical solution. The diffusion coefficient is stored in a variable for later use. The syntax
below means [d]iffusion [c]oefficient of [c]arbon, [f]unction or expression.
258
Tutorial 23
Following this, assign properties to the cells. Using the syntax below, the
material aus_material is attached to all the cells.
Set the temperature of all cells to 1000˚C, by first specifying that the temperatures should be
in ˚C:
set-simulation-parameter N Y
set-cell-property a V C C c_comp_bar
The next stage is to select the cell in the middle of the bar using its cell index. First, we note
that the first cell has the index 0, so the highest cell index in the array obtained using:
Assign the higher carbon content, c_comp_layer, to the selected cell (denoted by an asterisk).
259
Tutorial 23
set-cell-property * V C C c_comp_layer
DISPLAY
The next stage is to set up the graphical display to look at the results. Firstly, assign a property
to the existing paint window created above, paint_window_id so that the cells are coloured
according to their carbon content.
In the first line in the code above, the syntax represents s[i]mulation results, display [w]hat,
[v]ariable. In the second, the [v]ariable is specified as _cwp$c, and in the third, the [r]ange is
specified. The variable syntax _cwp$c represents the set of values of wp$c (weight percent of
carbon) in the cells. Variables of this type can be found in the variables window under cafe:
cells.
The cell array is shown schematically below, where blue represents a lower carbon content,
and yellow a higher.
In addition, make a profile plot of the carbon content. Create a window of type g1: plot grid:
1D profile.
new-gui-window g1
Assign a name to both the plot window and the plot itself:
Specify that the default x-axis should be used, and give it a title:
set-gui-window-property profile_window_id S U Y
Specify the range of cells over which the profile is to be taken. In the syntax here, the first line
gives the index of the s[t]arting cell (here 0) and the second line gives the index of the st[o]p
cell (here max_cell_index).
set-gui-window-property profile_window_id I t 0
261
Tutorial 23
We will now create a third window to display the time-dependent evolution of the carbon
concentration in selected cells. The required window type is g2: Plot grid: cell history.
Create the window and assign a name to the window and plot.
new-gui-window g2
Use the following commands to specify that the default x-axis should be used and to assign it
a title and a range.
Now add two series, firstly the composition of the middle cell, and then that of the cell
adjacent to it.
262
Tutorial 23
Give these series titles. Note that the quotation marks are needed for a multi-word title, as in
the case of the series 'next to centre'
ANALYTICAL SOLUTION
In the final stage before setting up and running the simulation, the analytical solution will be
added to the existing profile plot. Since the expression is rather complicated, it will be divided
up into simpler terms:
Bval*term_1*term_2
where Bval represents the integral giving the amount of solute in the system:
The value of the term B can be estimated by assuming that the initial concentration of carbon
in the bar is small enough to be neglected, such that initially all the carbon is in the layer in
the middle of the bar. The value of B is then simply the carbon concentration in the layer (in
the units in which the curve is to be plotted, here weight percent, c_comp_layer_wp),
multiplied by the width of the layer. The layer is one cell wide, i.e. the bar length divided by
the number of cells.
263
Tutorial 23
The cell variables (prefixed with _c) that we have seen earlier in this tutorial can be included
in variables and functions. For example, term_1 uses the cell variable _ctime to represent the
time in the cell simulation. The variable diffCoeff was defined above, and pi is a built-in
variable. (For details of the built-in variables of MatCalc, consult the section of the Reference
Book on internal variables.)
It should be noted that the term x in the mathematical formulation of the analytical
expression is measured from the centre of the range, whereas the cell variable corresponding
to the x-position of the centre of the cells, _ccenter_x, is measured from the left-hand side of
the system. We must therefore create an expression for the shifted x-coordinate:
and this series is plotted onto the existing profile plot using the command:
The 0..barlength expression in the command above represents the range over which the
function is to be evaluated; this corresponds to the length of the bar.
Note that when the analytical expression is first plotted, it looks slightly strange. This is
because the time is initially zero, leading to a value of zero in the denominator of the first
term, term_1.
The final set of commands deals with the simulation time and temperature, boundary
conditions, type of simulation and update interval.
264
Tutorial 23
It is now necessary to tell the simulation module what type of problem should be simulated,
i.e. how temperature and diffusion should be treated. In this case, we wish to simulate
a diffusion-field problem, in which the elements are allowed to diffuse through the system:
The temperature control, by contrast, is set to be isothermal and the hold temperature
specified in terms of the variable sim_temp set earlier.
The final step is to set up the default boundary conditions, i.e. the boundary conditions that
apply in the absence of any other boundary conditions being set for specific cells or groups of
cells. The type of boundary condition required is [g]eometric, and is set to [o]pen to
environment. This means that there is no periodicity or symmetry.
To run the script, click on Script > Run Script, press Shift + F2 or click on the button.
Then select the name of the script you wish to run from the drop-down menu and click on Go.
When the script has been correctly executed, select Simulation > Start simulation or
press Ctrl + J to start the simulation. Output will appear in the Console, starting with:
#####################################################################
#####################################################################
################################################################################
####################
265
Tutorial 23
microstructure simulation finished in 59.07 secs (tot 59.07 secs) on Fri, 2016-
06-10, 17:57:34
################################################################################
####################
When the simulation is finished, you can examine the profiles at different times by looking
at Global > Buffers > Edit Buffer States. You can obtain a set of profiles as shown below
by loading up selected buffer states and using ‘Duplicate and Lock all Series’ on the plot right-
click menu.
266
Tutorial 23
On the cell history plot, you should be able to see how the carbon concentration of the
central cell decreases, while that of the adjacent cell decreases, until at longer exposure
times, they converge.
267
Apendix A
APENDIX A
Related MatCalc scripts
SCRIPT TUTORIAL 2
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 20.03.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 03.08.2015 (P. Warczok, Update for 6.00, content modified - graphite got fixed fraction instead of dormant)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
close-workspace options=f $ close any open workspace. Option "f" -> "force", does not ask for saving an open
workspace
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
268
Apendix A
**************************************************************************************************$$
$$**************************************************************************************************
EQUILIBRIUM CALCULATIONS
**************************************************************************************************$$
open-thermodynamic-database file-name=mc_fe.tdb
select-elements elements=fe c va
$ This time, graphite is not selected as a phase present in the system
select-phases phases=liquid fcc_a1 bcc_a2 cementite
read-thermodynamic-database
set-reference-element element=fe
enter-composition type=weight-percent composition=c=0,4
269
Apendix A
set-temperature-celsius temperature=700
set-automatic-startvalues
calculate-equilibrium
$$**************************************************************************************************
CALCULATION STATES
**************************************************************************************************$$
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
270
Apendix A
SCRIPT TUTORIAL 3
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Database: mc_fe.tdb
Author: P. Warczok
Creation date: 20.03.2008
Last update: 14.11.2017 (P. Warczok, Update for 6.00)
This is a script for MatCalc version 6.00 (rel 1.000)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module module-name=core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
STEPPED EQUILIBRIUM CALCULATIONS
**************************************************************************************************$$
$------------- Stepped equilibrium calculation with varying carbon content - part I ---------------$
$ Selects the type of calculation: Element content variation
set-step-option type=element-content
271
Apendix A
$ Defines the range of the calculation: from 0 to 1.5 with linear step of 0.05
set-step-option range start=0 stop=1,5 scale=lin step-width=0,05
$ The temperature unit is degree Celsius, again.
set-step-option temperature-in-celsius=yes
$ Sets temperature of the calculation to 500
set-step-option temperature=500
$ Global composition is varied - [O]ption "vary [p]ara-equilibrium constraints" is set to [n]o
set-step-option vary-para-equil-constraints=no
$ Composition range is expressed in wt% - [O]ption "[e]lement content in wt%" is set to [y]es
set-step-option element-content-in-wt%=yes
$------------- Stepped equilibrium calculation with varying carbon content - part II --------------$
$$**************************************************************************************************
OPERATION ON BUFFER STATES
**************************************************************************************************$$
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
272
Apendix A
SCRIPT TUTORIAL 4
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Database: mc_fe.tdb
Author: P. Warczok
Creation date: 20.03.2008
Last update: 16.11.2017 (P. Warczok, Update for 6.00)
This is a script for MatCalc version 6.00 (rel 1.000)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module module-name=core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
PLOTTING A GRAPH
**************************************************************************************************$$
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
274
Apendix A
SCRIPT TUTORIAL 5
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Script for MatCalc built-in variables and graphical output according to Tutorial 5.
The following contents will be covered:
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 20.03.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 22.09.2011 (G. Stechauner, Update for 5.44)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
ADDING PLOTS OF DIFFERENT VARIABLES
**************************************************************************************************$$
$ Creating new [x]-y plot in GUI-window no.[2] (the number can read on the window bar)
create-new-plot X 2
$ For current plot [.] in [s]eries section [n]ew series, [b]uffer result variable "dfm$*" is plotted
set-plot-option . S N B dfm$* %s
$-------------- Examples of other plots (every plot is plotted in a separate window) --------------$
create-new-plot X . $ Creating new [x]-y plot in current GUI-window no.[.]
set-plot-option . S N B gmp$* %s $ "gmp$*" -Molar Gibbs energy of various phases
$$**************************************************************************************************
MODIFYING THE SERIES IN PLOTS
**************************************************************************************************$$
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
276
Apendix A
SCRIPT TUTORIAL 6
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 20.03.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 22.09.2011 (G. Stechauner, Update for 5.44)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
$$**************************************************************************************************
EQUILIBRIUM CALCULATIONS
**************************************************************************************************$$
$$**************************************************************************************************
CREATING PLOTS
**************************************************************************************************$$
$$**************************************************************************************************
COMBINING BUILT-IN VARIABLES IN NEW EXPRESSIONS
**************************************************************************************************$$
$ The product of carbon content in liquid and phase fraction of liquid is plotted
set-plot-option . S N B X$LIQUID$C*F$LIQUID %s
$ The product of carbon content in bcc and phase fraction of bcc is plotted
set-plot-option . S N B X$BCC_A2$C*F$BCC_A2 %s
$ The product of carbon content in fcc and phase fraction of fcc is plotted
set-plot-option . S N B X$FCC_A1$C*F$FCC_A1 %s
$ The product of carbon content in cementite and phase fraction of cementite is plotted
set-plot-option . S N B X$CEMENTITE$C*F$CEMENTITE %s
$ The carbon content in the system is plotted
set-plot-option . S N B XS$C %s
$$**************************************************************************************************
DEFINING FUNCTIONS
**************************************************************************************************$$
$----------------- Defining and plotting new expressions using existing functions -----------------$
$ Defining a function "Fraction_C_in_liquid" as C_in_liquid divided by molar fraction of carbon
set-function-expression Fraction_C_in_liquid C_in_liquid/XS$C
$ Defining a function "Fraction_C_in_bcc" as C_in_bcc divided by molar fraction of carbon
set-function-expression Fraction_C_in_bcc C_in_bcc/XS$C
$ Defining a function "Fraction_C_in_fcc" as C_in_fcc divided by molar fraction of carbon
set-function-expression Fraction_C_in_fcc C_in_fcc/XS$C
$ Defining function "Fraction_C_in_cementite" as C_in_cementite divided by molar fraction of carbon
set-function-expression Fraction_C_in_cementite C_in_cementite/XS$C
create-new-plot X .
set-plot-option . S N B Fraction_C_in_liquid %s $ Plotting "Fraction_C_in_liquid"
set-plot-option . S N B Fraction_C_in_bcc %s $ Plotting "Fraction_C_in_bcc"
set-plot-option . S N B Fraction_C_in_fcc %s $ Plotting "Fraction_C_in_fcc"
set-plot-option . S N B Fraction_C_in_cementite %s $ Plotting "Fraction_C_in_cementite"
set-plot-option . L R $ The legend box on the right side
$----------- Displaying the results of the stepped calculation varying carbon content -------------$
set-gui-window-property . X Stepvalue $ Stepvalue on x-axis
set-gui-window-property . S T C content [wt.%] $ Changing the title of x-axis
$$**************************************************************************************************
USER-DEFINED VARIABLES
**************************************************************************************************$$
$ Defining the parameters of the function approximating the amount of carbon present in liquid phase
set-variable-value a (y2-y1)/(x2-x1) $ setting a (slope)
set-variable-value b ((x2*y1)-(x1*y2))/(x2-x1) $ setting b (intersection)
set-function-expression Liquid_line (a*x)+b $ defining "Liquid_line"
set-plot-option 2 S N B Liquid_line %s $ Plotting "Liquid_line" in plot no.2
$ Cutting off negative values of "Liquid_line" by setting the curve as a function/expression plot
$ For plot no. [2], in [s]eries section, [r]emoval of the series identified by name[-1]
set-plot-option 2 S R -1 Liquid_line
$$ For plot no. [2], in [s]eries section, [n]ew series with the [f]unction/expression
result for "Liquid_line" function is plotted in the range of x1 - 0.5 $$
279
Apendix A
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_6
280
Apendix A
SCRIPT TUTORIAL 7
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
- Using Search phase boundary with temperature variation to determine solidus and liquidus
- Determining austenite - ferrite transformation temperatures
- Finding phase boundaries for carbide phases in terms of temperature and element content
- Tracing a phase boundary on axes of temperature versus element content
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 20.03.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 23.09.2011 (G. Stechauner, Update for 5.44)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
set-reference-element FE
enter-composition WP C=0,1 NB=0,3 $ Composition: 0.1 wt.% C, 0.3 wt.% Nb
set-temperature-celsius 1000
set-automatic-startvalues
calculate-equilibrium $ Initial equilibrium
$$**************************************************************************************************
CALCULATING PHASE BOUNDARIES
**************************************************************************************************$$
$ Searching a phase boundary varying [t]emperature for the liquid phase field
search-phase-boundary T LIQUID
$ Searching a phase boundary varying [t]emperature for the bcc phase field
search-phase-boundary T BCC_A2
set-temperature-celsius 1600
calculate-equilibrium
search-phase-boundary T BCC_A2 $ Finding liquidus
set-temperature-celsius 900
calculate-equilibrium
search-phase-boundary T BCC_A2 $ Phase boundary of bcc phase field
set-temperature-celsius 1200
calculate-equilibrium
search-phase-boundary T FCC_A1#01 $ Phase boundary of NbC phase field
set-plot-option . S M -1 *_T$C '0.1 wt.%C' $ Renames the series "*_T$C" to "0.1 wt.%C"
$ For current plot [.], [s]eries section, [d]uplicate and lock is performed by name [-1] on "T$C"
set-plot-option . S D -1 T$C
set-plot-option . S M -1 *_T$C '0.05 wt.%C' $ Renames the series "*_T$C" to "0.05 wt.%C"
$ For current plot [.], [s]eries section, [l]ock is performed by name [-1] on "T$C" ([y]es)
set-plot-option . S L -1 T$C Y
set-plot-option . S M -1 *_T$C '0.01 wt.%C' $ Renames the series "*_T$C" to "0.01 wt.%C"
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_7
283
Apendix A
SCRIPT TUTORIAL 8
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 10.11.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 23.09.2011 (G. Stechauner, Update for 5.44)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
set-reference-element FE
enter-composition WP C=0,05 $ Composition: 0.05 wt.% C
set-automatic-startvalues
calculate-equilibrium $ Initial equilibrium
$$**************************************************************************************************
FE-FE3C PHASE DIAGRAM
**************************************************************************************************$$
$ In the active[.] GUI-window, all unlocked series will be duplicated and [l]ocked
set-gui-window-property . L
set-plot-option . S M -1 *_T$C liquid $ Renaming series: "*_T$C" --> "liquid"
$ For current plot [.], [s]eries section, [l]ock is performed by name [-1] on "T$C" ([y]es)
set-plot-option . S L -1 T$C Y
set-plot-option . S M -1 *_T$C cementite $ Renaming series: "*_T$C" --> "cementite"
$$**************************************************************************************************
FE-C PHASE DIAGRAM
**************************************************************************************************$$
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_8
289
Apendix A
SCRIPT TUTORIAL 9
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 10.11.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 23.09.2011 (G. Stechauner, Update for 5.44)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
set-reference-element FE
enter-composition WP C=0,1 NB=0,3 $ Composition: 0.1 wt.% C, 0.3 wt.% Nb
$$**************************************************************************************************
FE-C PSEUDOBINARY WITH CONSTANT NB CONTENT
**************************************************************************************************$$
291
Apendix A
$$**************************************************************************************************
FE-NB PSEUDOBINARY WITH CONSTANT C CONTENT
**************************************************************************************************$$
new-gui-window p1 $ The new phase diagram will be plotted in the new GUI-window
293
Apendix A
295
Apendix A
$$**************************************************************************************************
NB-C PSEUDOBINARY WITH CONSTANT FE CONTENT
**************************************************************************************************$$
new-gui-window p1 $ This new phase diagram will be also plotted in the new GUI-window
set-reference-element NB $ Niobium content will be varied (Iron content will be kept fix)
$ Initial system composition in mole fractions: 0,996 Fe, 0,003 C
enter-composition X FE=0,996 C=0,003
calculate-equilibrium
search-phase-boundary T LIQUID $ Varying temperature for the phase boundary search
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_9
299
Apendix A
SCRIPT TUTORIAL 10
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
- T0-temperature calculation
- Martensite / Bainite transformation
- Variation of T0-temperature with carbon and chromium content
- Import and display of experimental data into plots
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 10.11.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 23.09.2011 (G. Stechauner, Update for 5.44)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
set-reference-element FE
enter-composition WP C=0,1 CR=1 $ Composition: 0.1 wt.% C, 1 wt.% Cr
$$**************************************************************************************************
CALCULATE THE T0-TEMPERATURE
**************************************************************************************************$$
search-phase-boundary T BCC_A2 $ Varying temperature for the bcc phase boundary search
300
Apendix A
create-calc-state Start_austenite
$$ Searching the T[0]-temperature with [bcc_a2] as a target phase and [fcc_a1] as a parent phase.
The composition of target phase is forced to the one of the parent phase (option switched to
[y]es). The dfm-offset is switched to 0 $$
search-phase-boundary 0 BCC_A2 fcc_a1 Y 0
$$**************************************************************************************************
EVALUATE T0-TEMPERATURE AS A FUNCTION OF CHROMIUM CONTENT
**************************************************************************************************$$
new-gui-window p1
set-plot-option . S N B T$C %s $ Plotting the T0-temperature
set-plot-option . A X 1 T Cr content [wt.%] $ x-axis title
set-plot-option . A Y 1 T T<sub>0</sub>-temperature [C] $ y-axis title
set-plot-option . L N $ No legend
set-plot-option . G M X Y $ Switching on the major gridlines for x-axis
set-plot-option . G M Y Y $ Switching on the major gridlines for y-axis
$$**************************************************************************************************
EVALUATE T0-TEMPERATURE AS A FUNCTION OF CARBON CONTENT
**************************************************************************************************$$
rename-current-buffer T0-chromium
create-calc-buffer T0-carbon
load-calc-state $ Loads the last calc-state - "start_austenite"
$$**************************************************************************************************
ADD SOME EXPERIMENTAL DATA ON MARTENSITE START TEMPERATURES
**************************************************************************************************$$
create-calc-buffer T0_with_offset
create-global-table Exp_data $ Creating table
301
Apendix A
add-table-entry Exp_data 0 540 $ Adding to the "Exp_data" table the pair "0", "540"
add-table-entry Exp_data 0.086 510 $ Adding to the "Exp_data" table the pair "0.086", "510"
add-table-entry Exp_data 0.1936 475 $ etc...
add-table-entry Exp_data 0.2409 480
add-table-entry Exp_data 0.2495 470
add-table-entry Exp_data 0.2581 440
add-table-entry Exp_data 0.3011 430
add-table-entry Exp_data 0.3226 410
add-table-entry Exp_data 0.3871 410
add-table-entry Exp_data 0.3871 400
add-table-entry Exp_data 0.3871 395
add-table-entry Exp_data 0.4560 405
add-table-entry Exp_data 0.4947 355
add-table-entry Exp_data 0.5054 375
add-table-entry Exp_data 0.6022 330
add-table-entry Exp_data 0.6022 320
add-table-entry Exp_data 0.7097 280
add-table-entry Exp_data 0.7312 280
add-table-entry Exp_data 0.7743 265
add-table-entry Exp_data 0.8173 240
add-table-entry Exp_data 0.8603 225
$$ For the current plot[.], in [s]eries section, [n]ew series with the [t]able/experimental
data from "Exp_data" table is plotted $$
set-plot-option . S N T exp_data
set-plot-option . L R $ Legend on the right
set-gui-window-property . L $ Locking all unlocked series (applies only to buffer result)
$ Renaming series: no.0 --> "T<sub>0</sub> - dfm = 0 J/mol"
set-plot-option . S M -1 *_T$C 'T<sub>0</sub> - dfm = 0 J/mol'
set-plot-option . S M 1 Exp_data $ Renaming series: no.1 --> "Exp_data"
set-gui-window-property . B T0_with_offset $ "T0_with_offset" buffer results are plotted
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_10
303
Apendix A
SCRIPT TUTORIAL 11
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Script for simulation of solidification of 0.7C 3Mn steel according to Tutorial 11.
The following contents will be covered:
- Scheil calculation
- Back-Diffusion
- Composition set
- Solid-solid transformation
The Scheil-Gulliver method allows calculating the fraction and composition of all phases during
solidification step by step from the liquidus temperature to the temperature where solidification
of the residual liquid phase occurs. The particular residual fraction at final solidification
is dependent on the cooling rate. Generally, the fraction is higher, the higher the cooling rate is.
At slow cooling rates, the liquid film can become very thin and the residual liquid enriches more
than in the case of higher fraction residual liquid at solidification.
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 10.11.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 26.09.2011 (G. Stechauner, Update for 5.44)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
set-reference-element FE
enter-composition WP C=0,7 MN=3 $ Composition: 0.7 wt.% C, 3 wt.% Mn
$$**************************************************************************************************
CARRY OUT A SCHEIL CALCULATION
**************************************************************************************************$$
search-phase-boundary T FCC_A1 $ Varying temperature for the fcc phase boundary search
step-equilibrium
rename-current-buffer Scheil
$$**************************************************************************************************
ADD A SCHEIL CALCULATION WITH BACK-DIFFUSION OF CARBON
**************************************************************************************************$$
create-calc-buffer Scheil_with_BD_of_C
step-equilibrium
$$**************************************************************************************************
ADD THE EQUILIBRIUM SOLIDIFICATION PATH
**************************************************************************************************$$
305
Apendix A
create-calc-buffer Equilibrium
step-equilibrium
$ In the [b]uffer section, the data from buffer "Equilibrium" are chosen for the display
set-gui-window-property . B Equilibrium
set-plot-option . S L -1 F$LIQUID Y $ Locking the series "F$LIQUID"
set-plot-option . S M -1 *_F$LIQUID Equilibrium $ Renaming series: "*_F$LIQUID" --> "Equilibrium"
$ In the [a]xis section for the [y]-axis no.[1], the scaling t[y]pe is set to [log]arithmic
set-plot-option . A Y 1 Y log
set-plot-option . A Y 1 S 0,01.. $ Scaling on the y-axis starts from 0.01
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_11
306
Apendix A
SCRIPT TUTORIAL 12
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 10.11.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 26.09.2011 (G. Stechauner, Update for 5.44)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
BASICS
**************************************************************************************************$$
$$**************************************************************************************************
EXAMPLE: CALCULATING AND EQUILIBRIUM USING THE COMMAND-LINE
**************************************************************************************************$$
$$**************************************************************************************************
EVALUATING EXPRESSIONS
**************************************************************************************************$$
new-gui-window p1
$$ For the current plot[.], in [s]eries section, [n]ew series with the [f]unction/expression
result for "function1" is plotted in the range of -10 - 10 $$
set-plot-option . S N F function1 -10..10
$ Plotting the result for "function2" is plotted in the range of -10 - 10
set-plot-option 1 S N F function2 -10..10
$ Plotting the result for "function3" is plotted in the range of -10 - 10
set-plot-option 1 S N F function3 -10..10
$$**************************************************************************************************
EXPRESSIONS USING MATCALC VARIABLES
**************************************************************************************************$$
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_12
308
Apendix A
SCRIPT TUTORIAL 13
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Script for introduction to scripting (1: Equilibrium calculations) according to Tutorial 13.
The following contents will be covered:
- Purpose of scripts
- Writing a script to perform a stepped calculation and display the results
A script is a text file, containing a list of commands to be executed in order from top to bottom.
They are particularly useful to speed up routine or repetitive operations. Once a script file has
been created, it can easily be modified to serve a new purpose, for example by changing the elements
or phases in the system. Script files, consisting only of text, are also much smaller in size than
MatCalc workspace files, especially those resulting from precipitation calculations.
Individual scripts can also be grouped into master-scripts; this facilitates, for example,
calculations involving multi-stage heat treatments. Some sample scripts are provided with MatCalc.
You will find them in the subdirectories of 'MatCalc/scripts/script_menu/templates'. Of course,
you can also edit them in MatCalc by clicking on 'Open template…' in 'Script' menu.
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 10.11.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 26.09.2011 (G. Stechauner, Update for 5.44)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
read-thermodyn-database
set-reference-element FE
enter-composition wp c=0.4 $ Composition: 0.4 wt.% C
$$**************************************************************************************************
GRAPHICAL OUTPUT
**************************************************************************************************$$
new-gui-window p1
set-gui-window-property . x t$c
set-gui-window-property . s u y $ set default x-axis to be used for all plots
set-gui-window-property . s t Temperature [C] $ title for default x-axis
set-plot-option . s n b f$liquid
set-plot-option . s m -1 f$liquid Liquid
set-plot-option . s n b f$bcc_a2
set-plot-option . s m -1 f$bcc_a2 Ferrite
set-plot-option . s n b f$fcc_a1
set-plot-option . s m -1 f$fcc_a1 Austenite
set-plot-option . s n b f$cementite
set-plot-option . s m -1 f$cementite Fe<sub>3</sub>C
create-new-plot x .
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_13
310
Apendix A
311
Apendix A
SCRIPT TUTORIAL 14
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 18.11.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 08.01.2016 (P. Warczok, Update for 6.00)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
set-reference-element FE
enter-composition WP C=0,2 $ Composition: 0.2 wt.% C
$$**************************************************************************************************
THE CALCULATION
**************************************************************************************************$$
$$ In the [c]onvergence control parameters section, [n]umerical limit for nucleation density
increase factor [b] is set to 1.05 $$
set-simulation-parameter C N B 1.05
$$**************************************************************************************************
INTERPRETING THE RESULTS
**************************************************************************************************$$
create-new-plot X 2
set-plot-option . T Number of precipitates $ Plot title
313
Apendix A
create-new-plot X 2
set-plot-option . T Nucleation rate $ Plot title
$ y-axis title
set-plot-option . A Y 1 T Nucleation rate [*10<sup>26</sup> m<sup>-3</sup>s<sup>-1</sup>]
set-plot-option . A Y 1 F 1e-26 $ Multiplication factor for y-axis
set-plot-option . L N $ No legend
$ Plotting the nucleation rate of cementite precipitate
set-plot-option . S N B NUCL_RATE$CEMENTITE_P0 %s
create-new-plot X 2
set-plot-option . T Precipitate radius $ Plot title
set-plot-option . A Y 1 T Precipitate radius [*10<sup>-6</sup> m] $ y-axis title
set-plot-option . A Y 1 Y log $ Logarithmic scale on y-axis
set-plot-option . A Y 1 F 1e6 $ Multiplication factor for y-axis
set-plot-option . L B $ Legend on the bottom
set-plot-option . S N B R_MEAN$CEMENTITE_P0 %s $ Plotting mean radius of cementite precipitate
set-plot-option . S N B R_CRIT$CEMENTITE_P0 %s $ Plotting critical radius of cementite precipitate
set-plot-option . S N B R_MIN$CEMENTITE_P0 %s $ Plotting minimal radius of cementite precipitate
set-plot-option . S N B R_MAX$CEMENTITE_P0 %s $ Plotting maximal radius of cementite precipitate
set-plot-option . S M 0 Mean $ Renaming series no. 0 to "Mean"
set-plot-option . S M 1 Critical $ Renaming series no. 1 to "Critical"
set-plot-option . S M 2 Min $ Renaming series no. 2 to "Min"
set-plot-option . S M 3 Max $ Renaming series no. 3 to "Max"
set-plot-option 1 G M X Y $ Switching on the major gridlines for x-axis for plot no. 1
set-plot-option 1 G M Y Y $ Switching on the major gridlines for y-axis for plot no. 1
set-plot-option 3 G M X Y $ Switching on the major gridlines for x-axis for plot no. 3
set-plot-option 3 G M Y Y $ Switching on the major gridlines for y-axis for plot no. 3
set-plot-option 4 G M X Y $ Switching on the major gridlines for x-axis for plot no. 4
set-plot-option 4 G M Y Y $ Switching on the major gridlines for y-axis for plot no. 4
set-plot-option 5 G M X Y $ Switching on the major gridlines for x-axis for plot no. 5
set-plot-option 5 G M Y Y $ Switching on the major gridlines for y-axis for plot no. 5
set-gui-window-property . N 2 $ Arranging plots in the columns with the [n]umber of columns of "2"
$$**************************************************************************************************
SAVING WORKSPACE
314
Apendix A
**************************************************************************************************$$
save-workspace Tutorial_14
315
Apendix A
SCRIPT TUTORIAL 15
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Script for effect of microstructure and conditions (Part 1) according to Tutorial 15.
The following contents will be covered:
The Fe-Cr-C system forms the basis of many industrially useful alloys. The aim of this and Tutorial
16 is to produce a simulation of the precipitation behaviour in a Fe-10Cr-0.1C (wt.%) alloy during
heat-treatment at 600C. This involves considering several aspects, such as the chemical
compositions of nuclei, the microstructural sites on which nuclei form, and the density of these
sites in the microstructure under consideration. This first of two tutorials will focus on modelling
the formation of the metastable cementite (Fe3C) phase, and Tutorial 16 will consider the
interaction between this and the more stable phase M23C6.
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 10.11.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 26.09.2011 (G. Stechauner, Update for 5.44)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
set-reference-element FE
enter-composition WP C=0,1 CR=10 $ Composition: 0.1 wt.% C, 10 wt.% Cr
316
Apendix A
$$**************************************************************************************************
NUCLEATION MODEL FOR CEMENTITE
**************************************************************************************************$$
create-new-plot X .
$ Plotting the chromium content in the cementite precipitate
set-plot-option . S N B X$CEMENTITE_P0$CR %s
$ Plotting the chromium content in the cementite precipitate nucleus
set-plot-option . S N B X_NUCL$CEMENTITE_P0$CR %s
set-plot-option . A Y 1 T x<sub>Cr</sub> $ y-axis title
create-new-plot X .
set-plot-option . S N B X$BCC_A2$C %s $ Plotting the carbon content in the bcc phase
set-plot-option . A Y 1 T x<sub>BCC_A2, C</sub> $ y-axis title
create-new-plot X .
$ Plotting the number of particles of cementite precipitate
set-plot-option . S N B NUM_PREC$CEMENTITE_P0 %s
$ y-axis title
set-plot-option . A Y 1 T N<sub>ppt</sub> [m<sup>-3</sup>]
create-new-plot X .
set-plot-option . S N B R_MEAN$CEMENTITE_P0 %s $ Plotting the mean radius of cementite precipitate
set-plot-option . A Y 1 T R<sub>mean</sub> [m] $ y-axis title
317
Apendix A
set-plot-option 1 G M X Y $ Switching on the major gridlines for x-axis for plot no. 1
set-plot-option 1 G M Y Y $ Switching on the major gridlines for y-axis for plot no. 1
set-plot-option 2 G M X Y $ Switching on the major gridlines for x-axis for plot no. 2
set-plot-option 2 G M Y Y $ Switching on the major gridlines for y-axis for plot no. 2
set-plot-option 3 G M X Y $ Switching on the major gridlines for x-axis for plot no. 3
set-plot-option 3 G M Y Y $ Switching on the major gridlines for y-axis for plot no. 3
set-plot-option 4 G M X Y $ Switching on the major gridlines for x-axis for plot no. 4
set-plot-option 4 G M Y Y $ Switching on the major gridlines for y-axis for plot no. 4
set-plot-option 5 G M X Y $ Switching on the major gridlines for x-axis for plot no. 5
set-plot-option 5 G M Y Y $ Switching on the major gridlines for y-axis for plot no. 5
$ Arranging plots in the columns with the [n]umber of columns of "2"
set-gui-window-property . N 2
save-workspace Tutorial_15_setup
$$**************************************************************************************************
CALCULATION
**************************************************************************************************$$
$$**************************************************************************************************
DIFFUSIVITY IN PRECIPITATES
**************************************************************************************************$$
$$**************************************************************************************************
MICROSTRUCTURAL PARAMETERS AND NUCLEATION SITES
**************************************************************************************************$$
$ [S]pecial options, [d]iffusion in prec. is calculated from matrix diffusion with [r]atio of 0.01
set-precipitation-parameter CEMENTITE_P0 S D R 0,01
$ In S[t]ructure, [d]islocations, [e]quilibrium dislocation density in ferrite domain set to 1e14
set-precipitation-parameter ferrite T D E 1e14
start-precipitate-simulation
319
Apendix A
set-gui-window-property . L
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_15
320
Apendix A
SCRIPT TUTORIAL 16
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Script for effect of microstructure and conditions (Part 2) according to Tutorial 16.
The following contents will be covered:
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 10.11.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 26.09.2011 (G. Stechauner, Update for 5.44)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
SIMULTANEOUS PRECIPITATION WITH M23C6
**************************************************************************************************$$
$$**************************************************************************************************
EFFECT OF DISLOCATION DENSITY
**************************************************************************************************$$
$$**************************************************************************************************
EFFECT OF GRAIN DIAMETER
**************************************************************************************************$$
$$**************************************************************************************************
SUBGRAINS AND ELONGATION FACTORS
**************************************************************************************************$$
$ [G]rain and [s]ubgrain boundaries are nucleation sites for M23C6 precipitate
set-precipitation-parameter M23C6_P0 N S GS
start-precipitate-simulation
$$**************************************************************************************************
324
Apendix A
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_16
325
Apendix A
SCRIPT TUTORIAL 17
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
In this tutorial, we simulate the precipitation of NbC in the solid state during the continuous
casting of steel and the subsequent austenitization treatment. The austenite / ferrite
transformations of the matrix phases are taken into account. The continuous casting simulation
starts at 1400C with linear cooling to room temperature. The austenitization treatment is carried
out at 1100C for 2 hours. Heating and cooling rates are assumed to be 1 K/s. Furthermore, we assume
that precipitation of NbC occurs only at austenite grain boundaries in the austenite during
continuous casting. After transformation to ferrite, we assume that precipitation occurs at grain
boundaries and dislocations.
Database: mc_sample_fe2.tdb
Author: P. Warczok
Creation date: 10.11.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 26.09.2011 (G. Stechauner, Update for 5.44)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
set-reference-element FE
enter-composition WP C=0,1 NB=0,7 $ Composition: 0.1 wt.% C, 0.7 wt.% Nb
set-automatic-startvalues
calculate-equilibrium $ Initial equilibrium
create-new-plot X .
set-plot-option . S N B F$FCC_A1#01_P0 %s $ Plotting the fraction of NbC precipitate phase
set-plot-option . A Y 1 T NbC phase fraction $ y-axis title
create-new-plot X .
set-plot-option . S N B R_MEAN$FCC_A1#01_P0 %s $ Plotting the mean radius of NbC precipitate phase
set-plot-option . A Y 1 T Mean radius [nm] $ y-axis title
set-plot-option . A Y 1 Y log $ Logarithmic scale on y-axis
set-plot-option . A Y 1 S 0.1.. $ Scaling range for y-axis
set-plot-option . A Y 1 F 1e9 $ Multiplication factor for y-axis
create-new-plot X .
$ Plotting the number of particles for NbC precipitate phase
set-plot-option . S N B NUM_PREC$FCC_A1#01_P0 %s
set-plot-option . A Y 1 T Number density [m<sup>-3</sup>] $ y-axis title
set-plot-option . A Y 1 Y log $ Logarithmic scale on y-axis
set-plot-option . A Y 1 S 1.. $ Scaling range for y-axis
set-plot-option 1 G M X Y $ Switching on the major gridlines for x-axis for plot no. 1
set-plot-option 1 G M Y Y $ Switching on the major gridlines for y-axis for plot no. 1
set-plot-option 2 G M X Y $ Switching on the major gridlines for x-axis for plot no. 2
set-plot-option 2 G M Y Y $ Switching on the major gridlines for y-axis for plot no. 2
set-plot-option 3 G M X Y $ Switching on the major gridlines for x-axis for plot no. 3
set-plot-option 3 G M Y Y $ Switching on the major gridlines for y-axis for plot no. 3
set-plot-option 4 G M X Y $ Switching on the major gridlines for x-axis for plot no. 4
set-plot-option 4 G M Y Y $ Switching on the major gridlines for y-axis for plot no. 4
set-gui-window-property . N 2 $ Arranging plots in 2 columns
$$**************************************************************************************************
DEFINITION OF THE HEAT TREATMENT
**************************************************************************************************$$
save-workspace Tutorial_17_init
$$**************************************************************************************************
PERFORM SIMULATION
**************************************************************************************************$$
$ Temperature profile from defined [h]eat treatment "sample_ht" with the max. temperature step of 10
set-simulation-parameter T H sample_ht 10
start-precipitate-simulation
$$**************************************************************************************************
SIMULATION WITH SEPARATION OF PRECIPITATE POPULATIONS
**************************************************************************************************$$
328
Apendix A
start-precipitate-simulation
$$**************************************************************************************************
SIMULATION WITH PRECIPITATES WITH NUCLEATION RESTRICTED TO SELECTED DOMAIN
**************************************************************************************************$$
$$ For the [n]ucleation of the FCC_A1#01_P0 precipitate, the option of the nucleation
restricted to [p]recipitate domain restricted is switched to [y]es. The domain is selected
to austenite $$
$$ For the [n]ucleation of the FCC_A1#01_P1 precipitate, the option of the nucleation
restricted to [p]recipitate domain restricted is switched to [y]es. The domain is selected
to ferrite $$
$ In the segment no.[0], the content of the p[r]e-seg script is cleared [-]
edit-ht-segment sample_ht 0 R -
$ In the segment no.[0], the content of the p[o]st-seg script is cleared [-]
edit-ht-segment sample_ht 0 O -
start-precipitate-simulation
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_17
329
Apendix A
SCRIPT TUTORIAL 18
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Database: mc_sample_fe.tdb
Author: P. Warczok
Creation date: 10.11.2008
This is a script for MatCalc version 5.44 (rel 0.008)
Last update: 26.09.2011 (G. Stechauner, Update for 5.44)
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core $ Use "core" module (MatCalc uses "core" module by default anyway)
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
set-reference-element FE
enter-composition WP C=0,1 NB=0,7 $ Composition: 0.1 wt.% C, 0.7 wt.% Nb
330
Apendix A
$$**************************************************************************************************
SETTING UP PLOTS
**************************************************************************************************$$
new-gui-window p1
set-gui-window-property . X T$C $ Temperature in Celsius set as variable on x-axis
set-plot-option . A X 1 T Temperature [C] $ x-axis title
set-plot-option . A Y 1 T Equilibrium phase fraction of NbC $ y-axis title
set-plot-option . L N $ No legend
set-plot-option . S N B F$FCC_A1#01 %s $ Plotting the fraction of NbC phase
create-precipitation-domain austenite
set-precipitation-parameter austenite X FCC_A1
create-new-phase FCC_A1#01 P
set-precipitation-parameter FCC_A1#01_P0 C 25
set-precipitation-parameter FCC_A1#01_P0 D austenite
set-precipitation-parameter FCC_A1#01_P0 N S D
read-mobility-database mc_sample_fe.ddb
$$**************************************************************************************************
PRECIPITATION CALCULATION
**************************************************************************************************$$
set-simulation-parameter E 1e5
set-simulation-parameter T I 925
start-precipitate-simulation
create-new-plot X .
set-plot-option . A X 1 T Time [s]
set-plot-option . A X 1 Y log
set-plot-option . A X 1 S 1..
set-plot-option . A Y 1 T NbC phase fraction
set-plot-option . L R
set-plot-option . S N B F$FCC_A1#01_P0 %s
set-gui-window-property . L
set-plot-option . S M -1 *_F$FCC_A1#01_P0 925C
set-simulation-parameter U 2
set-simulation-parameter E 1e5
set-simulation-parameter T I 1025
start-precipitate-simulation
set-gui-window-property . L
set-plot-option . S M -1 *_F$FCC_A1#01_P0 1025C
set-simulation-parameter E 1e5
set-simulation-parameter T I 1125
start-precipitate-simulation
331
Apendix A
set-gui-window-property . L
set-plot-option . S M -1 *_F$FCC_A1#01_P0 1125C
set-simulation-parameter U 2
set-simulation-parameter E 1e5
set-simulation-parameter T I 1175
start-precipitate-simulation
set-gui-window-property . L
set-plot-option . S M -1 *_F$FCC_A1#01_P0 1175C
set-simulation-parameter U 5
set-simulation-parameter E 1e5
set-simulation-parameter T I 1225
start-precipitate-simulation
set-plot-option . S L -1 F$FCC_A1#01_P0 Y
set-plot-option . S M -1 *_F$FCC_A1#01_P0 1225C
$$**************************************************************************************************
PLOTTING THE TTP DIAGRAMS
**************************************************************************************************$$
set-ttp-parameter E 1e5
set-ttp-parameter T 1225
set-ttp-parameter O 925
set-ttp-parameter D 25
set-ttp-parameter N 0.1
start-ttp-simulation
new-gui-window p6
set-plot-option . P R R
set-plot-option . S N D FCC_A1#01_P0 0.05
set-plot-option . S N D FCC_A1#01_P0 0.5
set-plot-option . S N D FCC_A1#01_P0 0.95
set-plot-option . S M 0 0.05
set-plot-option . S M 1 0.5
set-plot-option . S M 2 0.95
set-plot-option . A X 1 T Time [s]
set-plot-option . A Y 1 T Temperature [C]
set-plot-option . P R A
set-plot-option . S R *
set-plot-option . S N D FCC_A1#01_P0 1e-3
set-plot-option . S N D FCC_A1#01_P0 2e-3
set-plot-option . S N D FCC_A1#01_P0 3e-3
set-plot-option . S N D FCC_A1#01_P0 4e-3
set-plot-option . S N D FCC_A1#01_P0 5e-3
set-plot-option . S N D FCC_A1#01_P0 6e-3
set-plot-option . S N D FCC_A1#01_P0 7e-3
set-plot-option . S M 0 1e-3
set-plot-option . S M 1 2e-3
set-plot-option . S M 2 3e-3
set-plot-option . S M 3 4e-3
set-plot-option . S M 4 5e-3
set-plot-option . S M 5 6e-3
set-plot-option . S M 6 7e-3
set-plot-option . P R M
set-plot-option . S R *
set-plot-option . S N D FCC_A1#01_P0 0,1
set-plot-option . S N D FCC_A1#01_P0 0,2
set-plot-option . S N D FCC_A1#01_P0 0,3
set-plot-option . S N D FCC_A1#01_P0 0,4
332
Apendix A
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_18
333
Apendix A
SCRIPT TUTORIAL 19
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
The example used here uses the already familiar Fe-Nb-C system and considers a heat-treatment of an
initially well-annealed ferritic microstructure with no primary precipitates. Cementite is initially
allowed to nucleate on dislocations, and NbC on grain boundaries. The microstructure is heated into
the austenite phase stability region, held isothermally and then cooled quickly (quenched). On
quenching, a martensitic transformation occurs. This is modelled in MatCalc by a modification of the
ferrite precipitation domain to increase the dislocation density as well as the addition of subgrains
as possible nucleation sites for the NbC phase. The system is then subjected to a tempering heat
treatment consisting of heating, isothermal hold and cooling stages.
Database: mc_fe.tdb
Author: V. Yardley
Creation date: 20.02.2017
This is a script for MatCalc version 6.00 (rel 0.100)
Last update: M. Lueckl, 20.02.2017 - minor adjustments
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
use-module core
close-workspace f $ Close any open workspace without asking for save
if (matcalc_version<6000000)
send-dialog-string "MatCalc version must be 6.00.0000 or higher to run this script. Stopping."
stop-run-script
endif
@$************************************
$ enter workspace info
@$************************************
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
set-reference-element Fe
enter-composition wp c=0.1 nb=0.7
$$**************************************************************************************************
PRECIPITATION DOMAIN AND PHASES
**************************************************************************************************$$
$$**************************************************************************************************
THERMOMECHANICAL TREATMENT
**************************************************************************************************$$
create-heat-treatment sample_ht
$$**************************************************************************************************
GRAPHICAL OUTPUT
**************************************************************************************************$$
new-gui-window p1
set-gui-window-property . S U Y $ Use default x-axis
set-gui-window-property . S T Time [h] $ Default x-axis title
set-gui-window-property . S Y lin $ Linear scale
set-gui-window-property . S S 1e-10.. $ Scaling limit x-axis
336
Apendix A
create-new-plot X .
set-plot-option . A Y 1 T Phase fraction $ y-axis title
$ New series: fraction of cementite precipitate phase
set-plot-option . S N B F$CEMENTITE_P0 %s
$ New series: fraction of NbC precipitate phase
set-plot-option . S N B F$FCC_A1#01_P0 %s
set-plot-option . S M 0 Cementite $ Rename series -> "Cementite"
set-plot-option . S M 1 NbC $ Rename series -> "NbC"
create-new-plot X .
set-plot-option . A Y 1 T N<sub>ppt</sub> [m<sup>-3</sup>] $ y-axis title
set-plot-option . A Y 1 Y log $ Log scale on y-axis
set-plot-option . S N B NUM_PREC$CEMENTITE_P0 %s
set-plot-option . S N B NUM_PREC$FCC_A1#01_P0 %s
set-plot-option . S M 0 Cementite $ Rename series in plot -> "Cementite"
set-plot-option . S M 1 NbC $ Rename series in plot -> "NbC"
create-new-plot X .
$ Plotting the mean radius
set-plot-option . A Y 1 T R<sub>mean</sub> [m] $ y-axis title
set-plot-option . A Y 1 Y log $ Logarithmic scale on y-axis
set-plot-option 4 S N B R_MEAN$CEMENTITE_P0 %s
set-plot-option 4 S N B R_MEAN$FCC_A1#01_P0 %s
set-plot-option 4 S M 0 Cementite $ Rename series in plot -> "Cementite"
set-plot-option 4 S M 1 NbC $ Rename series in plot --> "NbC"
new-gui-window p5 $ Histogram
set-gui-window-property . S U Y $ Use default x-axis
set-gui-window-property . S T Precipitate radius [nm] $ x-axis title
set-gui-window-property . S F 1e9 $ Multiplication [f]actor
set-plot-option . S N P CEMENTITE_P0 $ New series
set-plot-option . H N 20 $ [n]umber of [h]istogram classes set to 20
set-plot-option . T Cementite precipitate distribution $ plot title
set-plot-option . A Y 1 T Number density of precipitates [m<sup>-3</sup>] $ y-axis title
set-plot-option . L N $ [N]o legend box
new-gui-window p5 $ Histogram
set-gui-window-property . S U Y $ Use default x-axis
set-gui-window-property . S T Precipitate radius [nm] $ x-axis title
set-gui-window-property . S F 1e9 $ Multiplication [f]actor
set-plot-option . S N P FCC_A1#01_P0 $ New series
set-plot-option . H N 20 $ number of classes
set-plot-option . T NbC precipitate distribution $ plot title
set-plot-option . A Y 1 T Number density of precipitates [m<sup>-3</sup>] $ y-axis title
set-plot-option . L N $ [N]o legend box
$$**************************************************************************************************
337
Apendix A
KINETIC CALCULATION
**************************************************************************************************$$
set-simulation-parameter T H sample_ht 10
start-precipitate-simulation
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_19
338
Apendix A
SCRIPT TUTORIAL 20
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Database: mc_fe.tdb
Author: M. Lueckl
Creation date: 16.02.2017
This is a script for MatCalc version 6.00 (rel 0.100)
Last update:
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
echo y
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
select-elements FE $ Components: Fe
select-phases BCC_A2 $ Phases: bcc
read-thermodyn-database
$$**************************************************************************************************
SETTING UP PLOTS
**************************************************************************************************$$
new-gui-window p1
set-gui-window-property . s u y $ Use default x-axis for all plots: yes
set-gui-window-property . s t Time [h] $ Default x-axis title
set-gui-window-property . s f 1/3600 $ X-axis scaling factor
set-plot-option . a y 1 t Grain diameter [µm] $ Y-axis title
set-plot-option . a y 1 s 100.. $ Y-axis scaling range
set-plot-option . a y 1 f 1e6 $ Y-axis scaling factor
set-plot-option . s n b GD$ferrite $ Add series: mean grain diameter in domain
set-plot-option . l b $ Show legend at the bottom of the figure
move-gui-window . 0 200 400 600
$$**************************************************************************************************
KINETIC CALCULATION
**************************************************************************************************$$
340
Apendix A
SCRIPT TUTORIAL 21
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Deformation process influences the microstructure of the alloy. One of the effects is the occurence
of the strain induced precipitates. This tutorial demonstrates how the deformation processes can be
included in the simulation of the processed material. Moreover, the effects of the deformation on the
precipitation kinetics are demonstrated and discussed.
Database: mc_fe.tdb
Author: M. Lueckl
Creation date: 17.02.2017
This is a script for MatCalc version 6.00 (rel 0.100)
Last update:
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
echo y
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
if (matcalc_version<6000000)
open-thermodyn-database mc_sample_fe2.tdb $ Open thermodynamic database mc_sample_fe2.tdb
else
test-exist-td-database mc_fe.tdb
if(test_result==1)
open-thermodyn-database mc_fe.tdb $ Open thermodynamic database mc_fe.tdb
341
Apendix A
else
send-dialog-string ""mc_fe.tdb"-database not found. Please, download it from MatCalc Website"
endif
endif
set-reference-element Fe
enter-composition wp c=0.2 nb=0.04
if (matcalc_version<6000000)
read-mobility-database mc_sample_fe.ddb $ Mobility (diffusion) database: mc_sample_fe.ddb
else
test-exist-mob-database mc_fe.ddb
if(test_result==1)
read-mobility-database mc_fe.ddb $ Opens thermodynamic database mc_fe.ddb
else
send-dialog-string ""mc_fe.ddb"-database not found. Please, download it from MatCalc Website"
endif
endif
$$**************************************************************************************************
STEPPED EQUILIBRIUM CALCULATIONS
**************************************************************************************************$$
$$**************************************************************************************************
GRAPHICAL OUTPUT
**************************************************************************************************$$
$$**************************************************************************************************
PRECIPITATION DOMAIN AND PHASES
**************************************************************************************************$$
$$**************************************************************************************************
THERMOMECHANICAL TREATMENT
**************************************************************************************************$$
$$**************************************************************************************************
GRAPHICAL OUTPUT
**************************************************************************************************$$
$$**************************************************************************************************
KINETIC CALCULATION
**************************************************************************************************$$
$$**************************************************************************************************
EFFECT OF VOLUMETRIC MISFIT
**************************************************************************************************$$
$$**************************************************************************************************
SIMULATION OF DEFORMATION PROCESS
**************************************************************************************************$$
$$**************************************************************************************************
SAVING WORKSPACE
**************************************************************************************************$$
save-workspace Tutorial_21
345
Apendix A
SCRIPT TUTORIAL 22
new-workspace
open-thermodynamic-database mc_fe.tdb
select-elements c
select-phases fcc_a1
read-thermodynamic-database
read-mobility-database mc_fe.ddb
set-automatic-startvalues
set-temperature-celsius 1000
calculate-equilibrium
create-precipitation-domain matrix
set-precipitation-parameter matrix thermodynamic-matrix-phase=FCC_A1
set-precipitation-parameter matrix subgrain-evolution-model=abc
create-tm-treatment tmt
append-tmt-segment tmt
edit-tmt-segment tmt . segment-start-temperature=1200
edit-tmt-segment tmt . segment-accumulated-strain=,1
edit-tmt-segment tmt . deformation-rate=1
edit-tmt-segment tmt . precipitation-domain=matrix
append-tmt-segment tmt
edit-tmt-segment tmt . T_dot+delta_t 0 1e4
edit-tmt-segment tmt . precipitation-domain=matrix
set-gui-window-property . number-of-plot-columns=auto
rename-current-buffer deformation_only
create-calc-buffer deformation&growth
set-gui-window-property . buffer-name=deformation&growth
create-calc-buffer recrystallization
set-gui-window-property . buffer-name=recrystallization
348
Apendix A
SCRIPT TUTORIAL 23
$$**************************************************************************************************
************************************** GENERAL INFORMATION *****************************************
****************************************************************************************************
Database: mc_fe.tdb
Author: V. Yardley
Creation date: 14.02.2017
This is a script for MatCalc version 6.00 (rel 0.200)
Last update: M. Lueckl, 14.02.2017 - minor adjustements
****************************************************************************************************
************************************** SETUP INFORMATION *******************************************
**************************************************************************************************$$
echo y
$$**************************************************************************************************
**************************************** SYSTEM SETUP **********************************************
**************************************************************************************************$$
$$**************************************************************************************************
DATABASES, CHEMICAL COMPOSITION, SELECTED PHASES
**************************************************************************************************$$
if (matcalc_version<6000000)
open-thermodyn-database mc_sample_fe2.tdb $ Open thermodynamic database mc_sample_fe2.tdb
else
test-exist-td-database mc_fe.tdb
if(test_result==1)
open-thermodyn-database mc_fe.tdb $ Open thermodynamic database mc_fe.tdb
349
Apendix A
else
send-dialog-string ""mc_fe.tdb"-database not found. Please, download it from MatCalc Website"
endif
endif
$ Define the variables that will specify the initial carbon content in the bar and the thin layer
set-variable-value c_comp_bar_wp 1e-10
set-variable-value c_comp_layer_wp 0.8
$ In the cell simulation, compositions must be entered in molar notation un$c
enter-composition wp c=c_comp_bar_wp $ Enter composition in weight percent
set-variable-value c_comp_bar un$c $ Save the composition in mole fraction
enter-composition wp c=c_comp_layer_wp $ Enter composition in weight percent
set-variable-value c_comp_layer un$c $ Save the composition in mole fraction
$$**************************************************************************************************
EQUILIBRIUM CALCULATIONS
**************************************************************************************************$$
$$**************************************************************************************************
PRECIPITATION DOMAIN SETUP
**************************************************************************************************$$
$$**************************************************************************************************
SIMULATION GRID
**************************************************************************************************$$
$$**************************************************************************************************
CELL PROPERTIES
350
Apendix A
**************************************************************************************************$$
$ Select the cell in the middle - note: first cell has index 0
set-variable-value max_cell_index num_cells_x-1
set-variable-value middle_cell_index max_cell_index/2
add-cell-selection E middle_cell_index $ Select the c[e]ll in the centre
$ Assign the higher carbon content, c_comp_layer, to the selected cell
set-cell-property * V C C c_comp_layer
$$**************************************************************************************************
GRAPHICAL DISPLAY
**************************************************************************************************$$
$$**************************************************************************************************
ANALYTICAL SOLUTION
**************************************************************************************************$$
$$**************************************************************************************************
SET UP AND RUN THE SIMULATION
**************************************************************************************************$$
start-cell-simulation
update-gui-window window-id=4
352