Presentation 3

advertisement
Computational Thermodynamics
3
Outline

Compound energy formalism, part 2

Associated liquid solution

Interpolation to ternary systems

Introduction to optimization
Compound energy formalism, part 2
The green surface is represented by eq:
surf
0
0
0
0
Gmref = yA yCGAC
+ yB yCGBC
+ yA yDGAD
+ yB yDGAD
Compound energy formalism, part 2
The method for describing the Gibbs excess energy can, again, be best shown by using
a two-sublattice system (A, B)1(C,D)1 before generalizing to a multi-component system.
In this alloy A-C, A-D, B-C and B-D interactions are controlled by the Gibbs energy of the
compounds AC, BC, AD and BD. Mixing on the sublattices controls A-B and C-D
interactions and the simplest form of interaction is a regular solution format such that
G =y y L
xs
m
1 1 0
A B A,B:*
+y y L
2 2 0
C D *:C,D
where L0 A, B:* and L0 *:C,D denote regular solution parameters for mixing on the
sublattices irrespective of site occupation of the other sublattice.
Compound energy formalism, part 2
A sub-regular model can be introduced by making the interactions compositionally
dependent on the site occupation in the other sublattice.
G =y y y L
xs
m
1 1 2 0
A B C A,B:C
+y y y L
1 2 2 0
A C D A:C,D
+y y y L
1 1 2 0
A B D A,B:D
+y y y L
1 2 2 0
B C D B:C,D
Compound energy formalism, part 2
Finally some site fraction dependence to these parameters can be added such that
LA,B:C = å LA,B:C ( y - y
n
1
A
)
1 n
B
n
LA,B:D = å LA,B:D ( y - y
)
LA:C,D = å LA:C,D ( y - y
2 n
D
LB:C,D = å LB:C,D ( y - y
)
n
1
A
1 n
B
n
n
2
C
n
n
n
2
C
2
D
)
n
Compound energy formalism, part 2
Interstitial phases. These are predominant in steels and ferrous-based
alloys, where elements such as C and N occupy the interstitial sites of the ferrite
and austenite lattices. In this case the structure of the phase can be considered as
consisting of two sublattices, one occupied by substitutional elements, such as Fe,
Cr, Ni, Mn, etc., and the other occupied by the interstitial elements, such as C or N,
and interstitial vacancies (Va). As the concentration of C, N,..., etc., increases the
interstitial vacancies are filled until there is complete occupation. The occupation of
the sublattices is shown below as
(Fe, Cr, Ni, Mn… )u (Va, C, N...)v
Compound energy formalism, part 2
In the case of an FCC_A1 structure, with u = v = 1, the state of complete occupation of
interstitial carbon corresponds to a MC carbide with the NaCI lattice.
For the HCP_A3 structure, with u = 1 and v = 0.5, complete occupation of the interstitial
sites by carbon gives the M2C carbide with a hexagonal Fe2N-type structure.
1
2
0
2
0
1
0
0
Gm = yCr
yVa
GCr:Va
+ y1Fe yVa
GFe:Va
+ yCr
yC2 GCr:C
+ y1Fe yC2 GFe:C
(
1
1
2
2
+RT 1( yCr
ln+ yCr
+ y1Fe ln+ y1Fe ) +1( yC2 ln+ yC2 + yVa
ln+ yVa
)
)
æ
ö 1 1 2æ
ö
n
1
1 n
n
1
1 n
+y y y ç å LCr,Fe:Va ( yCr - yFe ) ÷ + yCr yFe yC ç å LCr,Fe:C ( yCr - yFe ) ÷
èn
ø
èn
ø
æ
ö 1 2 2 æ
ö
1
2 2
n
2
2 n
n
2
2 n
+yCr yC yVa çå LCr:C,Va ( yC - yVa ) ÷ + yFe yC yVa çå LFe:C,Va ( yC - yVa ) ÷
èn
ø
èn
ø
1 1
2
Cr Fe Va
Compound energy formalism, part 2
For the case of the FCC_A1, austenite phase in Cr-Fe-C, the Gibbs energy of the phase
is represented by the formula (Cr, Fe)1 (C, Va)1 and its Gibbs energy given by the
following equation
1
2
0
2
0
1
0
0
Gm = yCr
yVa
GCr:Va
+ y1Fe yVa
GFe:Va
+ yCr
yC2 GCr:C
+ y1Fe yC2 GFe:C
(
1
1
2
2
+RT 1( yCr
ln yCr
+ y1Fe ln y1Fe ) +1( yC2 ln yC2 + yVa
ln yVa
)
)
æ
ö 1 1 2æ
ö
n
1
1 n
n
1
1 n
+y y y ç å LCr,Fe:Va ( yCr - yFe ) ÷ + yCr yFe yC ç å LCr,Fe:C ( yCr - yFe ) ÷
èn
ø
èn
ø
æ
ö 1 2 2 æ
ö
1
2 2
n
2
2 n
n
2
2 n
+yCr yC yVa çå LCr:C,Va ( yC - yVa ) ÷ + yFe yC yVa çå LFe:C,Va ( yC - yVa ) ÷
èn
ø
èn
ø
1 1
2
Cr Fe Va
Compound energy formalism, part 2
The database
PHASE SBSN % 2 .5 .5 !
CONSTITUENT SBSN :SB,SN : SB,SN : !
PARAMETER G(SBSN,SB:SB;0) 2.98150E+02 +GHSERSB#+3243.7917; 3.00000E+03
N REF0 !
PARA G(SBSN,SN:SB;0) 298.15 0; 6000 N !
PARAMETER G(SBSN,SB:SN;0) 2.98150E+02 +.5*GHSERSN#+.5*GHSERSB# -2951.1569.52608471*T; 6.00000E+03 N REF0 !
PARAMETER G(SBSN,SN:SN;0) 2.98150E+02 +GHSERSN#+4000-.043093938*T;
6.00000E+03 N REF0 !
PARAMETER G(SBSN,SB,SN:SB;0) 2.98150E+02 0.0 ; 3.00000E+03 N REF0 !
PARAMETER G(SBSN,SB:SB,SN;0) 2.98150E+02 0.0 ; 3.00000E+03 N REF0 !
PARAMETER G(SBSN,SN:SB,SN;0) 2.98150E+02 -573.04832; 3.00000E+03 N REF0 !
PARAMETER G(SBSN,SB,SN:SN;0) 2.98150E+02 -573.04832; 3.00000E+03 N REF0 !
Associated liquid solution
In the systems with short range ordering (SRO), unlike atoms tend to stay together for
a shorter or longer length of time. The term associate was introduced to denote an
association between unlike atoms when the attractive forces between the atoms are
not strong enough to form a stable chemical molecule.
Fictitious constituents can be used in the same form of that equation for the surface
Gibbs energy and thus creates additional degree of freedom.
n
srf
Gm = å yiGi0
i=1
n
srf
Sm = -Rå yi lnyi
i=1
Associated liquid solution
The Gibbs energy of excess usually describes inteactions between an associate and
pure elements.
xs
æ
æ
nö
nö
n
n
Gm = yA yAB çå LA,AB ( yA - yAB ) ÷ + yAB yB çå LAB,B ( yAB - yB ) ÷
èn
ø
èn
ø
Associated liquid solution
SPECIES PBTE_L
PB1TE1!
PHASE LIQUID % 1 1.0 !
CONSTITUENT LIQUID :PB,PBTE_L,TE : !
PARAMETER G(LIQUID,PB;0) 2.98150E+02 -2977.961+93.949561*T
-24.5242231*T*LN(T)-.00365895*T**2-2.4395E-07*T**3-6.019E-19*T**7;
6.00610E+02 Y
-5677.958+146.176046*T-32.4913959*T*LN(T)+.00154613*T**2; 1.20000E+03 Y
+9010.753+45.071937*T-18.9640637*T*LN(T)-.002882943*T**2+9.8144E-08*T**3
-2696755*T**(-1); 2.10000E+03 N REF0 !
PARAMETER G(LIQUID,PBTE_L;0) 2.98150E+02 -4.2572284E+04 -1.7419984E+00*T+GHSERPB#+GHSERTE#;
3.00000E+03 N REF0 !
PARAMETER G(LIQUID,TE;0) 2.98150E+02 -17554.731+685.877639*T
-126.318*T*LN(T)+.2219435*T**2-9.42075E-05*T**3+827930*T**(-1); 6.26490E+02 Y
-3165763.48+46756.357*T-7196.41*T*LN(T)+7.09775*T**2-.00130692833*T**3
+2.58051E+08*T**(-1); 7.22660E+02 Y
+180326.959-1500.57909*T+202.743*T*LN(T)-.142016*T**2+1.6129733E-05*T**3
-24238450*T**(-1); 1.15000E+03 Y
+6328.687+148.708299*T-32.5596*T*LN(T); 1.60000E+03 N REF0 !
Associated liquid solution
PARAMETER G(LIQUID,PB,PBTE_L;0) 2.98150E+02 2.2173103E+04 -1.0995062E+01*T;
3.00000E+03 N REF0 !
PARAMETER G(LIQUID,PB,PBTE_L;1) 2.98150E+02 1.3818301E+03; 3.00000E+03 N
REF0 !
PARAMETER G(LIQUID,PBTE_L,TE;0) 2.98150E+02 -4.2749684E+03+4.1391182E+00*T;
3.00000E+03 N
REF0 !
Ternary systems
The predominant method at the present time uses the equation developed by
Muggianu. In this circumstance the excess energy in a multicomponent system, as
given by the Equation:
xs
æ
æ
æ
nö
nö
nö
n
n
n
Gm = xA xB çå LA,B ( x A - xB ) ÷ + x A xC çå LA,C ( x A - xC ) ÷ + xB xC çå LB,C ( xB - xC ) ÷
èn
ø
èn
ø
èn
ø
Besides that, there are also: Kohler and Toop interpolations.
Ternary systems
Ternary systems
The ternary interaction parameter can be added:
n-2 n-1
xs
Gm = å å
n
åxx x L
i
j k
ijk
i=1 j=i+1 k= j+1
Higher-ordered interaction parameter can be also added:
n-3 n-2 n-1
xs
Gm = å å
n
å åxx x xL
i=1 j=i+1 k= j+1 l=k+1
i
j k l
ijkl
Ternary systems
Database
PARAMETER G(LIQUID,CU,SB,SN;0) 2.98150E+02 1.31473890E+05
-1.12335674E+01*T+0*T*LN(T) ; 3.00000E+03 N REF0 !
PARAMETER G(LIQUID,CU,SB,SN;1) 2.98150E+02 -1.72286975E+04
-2.00146866E+01*T+0*T*LN(T); 3.00000E+03 N REF0 !
PARAMETER G(LIQUID,CU,SB,SN;2) 2.98150E+02 -1.22041192E+04
-4.63210745E+01*T+0*T*LN(T) ; 3.00000E+03 N REF0 !
Ternary systems
Let’s perform some calculation of ternary system.
Ternary systems
Ternary systems
Ternary systems
Ternary systems
Try to change the picture
by yourself
Ternary systems
Ternary systems
Isothermal section at 500K.
Ternary systems
Ternary systems
Isoplethal section Al05Mg05-Zn. This is not a phase diagram. Why?
Introduction to optimization
Next slides are based on Pandat User Guide available on
www.computherm.com
Introduction to optimization
PanOptimizer Functions
The major functions included in the PanOptimizer menu are shown in Figure
Introduction to optimization
Rough Search
To perform the rough search, we should follow the steps as follow
1. Prepare the thermodynamic database file (.TDB)
In order to do the optimization, we must first define the model parameters to be
optimized in the thermodynamic database (.tdb). The model parameters to be
optimized can be defined in Pandat workspace where all the built-in keywords are
automatically highlighted. It can also be done through outside text editor such as
“Notepad”. Each model parameter that needs to be optimized is defined by the
keyword “OPTIMIZATION”. The format of defining a model parameter is:
Optimization [parameter name][low bound][initial value][high bound] N !
Introduction to optimization
A definition sample for liquid phase in binary Al-Zn system is given as follows
Introduction to optimization
2. Prepare the experimental file (.POP)
Keyword CREATE_ROUGH_EQUILIBRIUM is used to define phase equilibrium for rough
search. When creating an equilibrium data set for rough search, the status of phases in
equilibrium can only be FIXED. The keyword PHASE_POINT is used to define the state
space of the phases in equilibrium including temperature, pressure and composition.
No thermodynamic property is allowed to be optimized for multiple-phase equilibria.
However, a special case is the single-phase equilibrium. The thermodynamic property
data of the single-phase equilibrium can be used as experimental data to optimize the
model parameters. Taking the binary Al-Zn system as an example, we will define a
rough equilibrium between Fcc_A1 and Hcp_A3 at 500K.
Note: For a phase described by a sublattice model, the initial value of an element or
species should be specified using SET_START_VALUE.
Introduction to optimization
Introduction to optimization
A complete POP file for rough search can be found at the Pandat installation directory
Introduction to optimization
3. Load/compile experimental file
4. Rough Search
There are four control areas in the control panel for rough search as shown in Figure
Introduction to optimization
Introduction to optimization
There are two types of built-in optimization algorithms for Rough Search and they are
Global Search and Local Search, as shown in area C. Global Search is to search a set of
good initial values of the model parameters within the whole searching domain, while
Local Search leads to a quick convergence to an optimal solution based on the given
initial values of model parameters. The user can set the maximum number of function
calls for both algorithms.
Introduction to optimization
Let’s again take the binary Al-Zn system as an example. The phase boundary and
invariant reaction information as shown in Figure is used for the rough search and the
result of rough search is also shown in the same Figure
Introduction to optimization
The calculated phase boundary compared with the experimental data after the
rough search with Global Optimization
Introduction to optimization
By setting the maximum number of function evaluations to be 1000 and clicking Global
Search, the program finally stops at the sum of squares of 2.91. Figure in previous slide
shows the calculated phase boundaries after a global search with 1000 function
evaluations. It can be seen that the optimized parameters give a very similar topology
with the known Al-Zn phase diagram.
By clicking Local Search, the sum of squares decreases from 2.91 to 0.059, which
reproduces the phase diagram in better agreement with the experimental one as can
be seen in Figure in next slide.
Introduction to optimization
The calculated phase boundary compared with the experimental data after the
rough search with Local Optimization
Introduction to optimization
During rough search, user can check model parameters through Parameters. In
addition, chemical potential differences between any two phases in equilibrium can be
accessed by Experimental Data. They are reflected by the values in column “(Wtd.
Residual)^2” as shown in the dialog window in Figure in next slide. Similarly, the weight
factor of the equilibrium can be adjusted as needed during optimization procedure.
The chemical potential values of each phase in equilibrium can be accessed by clicking
the buttons in the first column.
Introduction to optimization
Introduction to optimization
5. Save/Open Optimization Results
During optimization, the user may save and load optimization file through Save
Optimization Results and Open Optimization Results. The optimization results file has
the extension name of POR that can only be read by PanOptimizer. Intermediate
optimization results can be saved and restored through these two operations. These
functions are very useful especially when a user is optimizing model parameters for a
complicated system. The user can always go back to a certain middle stage and restart
from there. This will save user’s time by avoiding some repeated work.
Introduction to optimization
Introduction to optimization
Normal Optimization
In general, user should follow a few steps below to perform the model parameter
optimization.
1. Prepare the thermodynamic database file (.TDB)
Preparation of the fileis exactly the same as in case o rough optimization
2. Prepare the experimental file (.POP)
Users need to provide their own experimental data file for optimization of model
parameters. The most widely accepted format for experimental data file in the
CALPHAD society is a POP file.
Introduction to optimization
PanOptimizer accepts most of the keywords in the POP format and adds a few special
keywords. In a POP file, a phase can have four statuses: ENTERED, FIXED, DORMANT,
and SUSPEND. The first two statuses were used most frequently. When phases are in
the ENTERED status, PanOptimizer does not require user to input any initial values for
calculation since the truly stable phase equilibria will be found automatically in this
case with the built-in global optimization algorithm. On the other hand, for those
phases in FIXED or DORMANT status, the initial values should be provided by the user.
Example POP files are provided in the installation dictionary of Pandat.
Introduction to optimization
3. Load thermodynamic database file
4. Load and compile experimental file
Introduction to optimization
5. Perform Optimization
Once the TDB file and the experimental POP file are loaded, user is ready to do the
optimization. In the current version of PanOptimizer, the optimization is controlled
through the optimization control panel as shown in Figure
Introduction to optimization
Histogram (A)
Histogram is for displaying and tracing the history of the discrepancy between modelcalculated values and experimental data, which is characterized by the Sum of Squares
displayed during the whole optimization procedure. The histogram plots the sum of
squares vs. the number of function calls. The exact value of the sum of squares in the
current step can be found at the up-right corner of this area.
Introduction to optimization
Free Bound/Unbound Variables (B)
The user can choose the model parameters to be optimized in either the bounded or
the unbounded mode. In the bounded mode, the low and high bounds defined in a
TDB file will take into effects.
Optimization (C)
The goal of the optimization process is to obtain an optimal set of model parameters so
that the model calculated results can best fit the given experimental measurements.
The optimization process can be controlled by choosing 1 Iteration or Run. With 1
Iteration, the maximum number of function calls is set to be 2(N+2), where N is the
number of model parameters to be optimized. The user can click Run mode several
times until the optimal solution is found or the designated maximum number of
function calls is reached.
Introduction to optimization
Optimization Results (D)
During optimization, user can check model parameters through the Parameters button
as shown in Figure. For each model parameter, user can change its low bound, upper
bound and initial value in the dialog window as shown in Figure. User can Include or
Exclude a certain parameter in the optimization through the “check box” in front of the
parameter. If a set of optimized parameters is satisfactory, user can save this set of
values as default ones through Set Default shown in Figure. Otherwise, user can reject
this set of values and go back to previous default values through Get Default. User also
can save the TDB file with the optimized model parameters through Save TDB. The
standard deviation and relative standard deviation (RSD) of each parameter are
computed during optimization. The parameter evolution during the last 100 iterations
can be tracked by clicking the parameter name in the table as indicated in Figure. It
should be noted that any changes on model parameters made by user will take into
effect only after the “Apply” button is clicked.
Introduction to optimization
Here we take the binary Al-Zn system as an optimization example. The TDB and POP
files are available at the installing directory of Pandat
“/Pandat_Examples/PanOptimizer/”. In this example, there are totally 11 parameters to
be optimized and all the initial values are set to be zero. The available experimental
data include:
Introduction to optimization
Before the optimization, user may want to check the calculated results using the initial
set of model parameters without optimization. Phase diagram calculation can be done
through 2-D section calculation, and enthalpy calculation can be done through the 1-D
line calculation. The parameters before optimization result in large discrepancies
between the calculated values and the experimental measurements. Optimization of
these model parameters (initially set as zero) is needed.
Introduction to optimization
The Figure shows the calculated Al-Zn phase diagram and enthalpy of mixing for liquid
phase at 953K along with the given experimental data, respectively.
Introduction to optimization
By clicking Run twice (two rounds), and each run performs 50 function calls, the sum of
squares decreases from 904896 to 3061 as shown in left Figure. After another two
rounds of Run, the sum of squares decreases from 3061 to 2.8 as shown in a right
Figure. Now, we can do the real time calculation using the instantly obtained optimized
parameters.
Introduction to optimization
The two comparisons in Figure show excellent agreements between the calculated
results and the measured data.
Introduction to optimization
Optimization Results (D)
During optimization, user can check model parameters through the Parameters button
as shown in Figure. For each model parameter, user can change its low bound, upper
bound and initial value in the dialog window as shown in Figure. User can Include or
Exclude a certain parameter in the optimization through the “check box” in front of the
parameter. If a set of optimized parameters is satisfactory, user can save this set of
values as default ones through Set Default shown in Figure. Otherwise, user can reject
this set of values and go back to previous default values through Get Default. User also
can save the TDB file with the optimized model parameters through Save TDB. The
standard deviation and relative standard deviation (RSD) of each parameter are
computed during optimization. The parameter evolution during the last 100 iterations
can be tracked by clicking the parameter name in the table as indicated in Figure. It
should be noted that any changes on model parameters made by user will take into
effect only after the “Apply” button is clicked.
Introduction to optimization
Introduction to optimization
Introduction to optimization
6. Save/Open Optimization Results
During optimization, the user may save and load optimization file through Save
Optimization Results and Open Optimization Results. The optimization results file has
the extension name of POR that can only be read by PanOptimizer. Intermediate
optimization results can be saved and restored through these two operations. These
functions are very useful especially when a user is optimizing model parameters for a
complicated system. The user can always go back to a certain middle stage and restart
from there. This will save user’s time by avoiding some repeated work.
Introduction to optimization
Download