root/trunk/matml/src/ternary/ternary.tex.in

Revision 510, 10.4 kB (checked in by powell, 2 years ago)

Nitpick: it's technically only incomplete now.

Line 
1\documentclass{article}
2\usepackage{fullpage,lmodern,cxref,url}
3\usepackage[T1]{fontenc}
4\begin{document}
5\title{{\tt Ternary}: Ternary Thermodynamics Visualization}
6\author{Adam C. Powell, IV}
7\date{Version @VERSION@ released @RELEASE_DATE@}
8\maketitle
9
10\begin{abstract}
11  {\tt Ternary} is a little code written by Adam Powell back in 2003 to
12  visualize ternary free energy functions.  In 2008-2009 he updated it to
13  calculate phase diagram isotherms.  Soon it will do a lot more.
14\end{abstract}
15
16\tableofcontents
17\newpage
18
19\section{Introduction}
20
21In 2003, Adam Powell wrote the core of this little program to visualize the
22free energy function of a polymer-solvent-nonsolvent system as used by one of
23his grad students.  In 2008-2009, he expanded it considerably:
24\begin{itemize}
25\item Removed it from the {\tt RheoPlast} package and made it a stand-alone
26  program, with considerably expanded documentation.
27\item Craig Carter used a convex hull construct to find and illustrate the
28  lowest-energy manifold of a binary free energy function or set of
29  functions.\footnote{Though others have noted the relationship between the
30    convex hull and the minimum enengy surface before ({\em e.g.}
31    \cite{Var1990,Aic2001,Aic2003,Zho2004}), Carter's Mathematica scripts are
32    the inspiration for this work.}  Based on that concept, ternary uses {\tt
33    qhull} \cite{BDH1997} to calculate that hull, and visualizes the edges of the resulting
34  triangles---which will clearly show the one- and two-phase regions, complete
35  with two-phase tie lines.
36\item Added visualization and convex hull calculation for multiple phases with
37  separate free energy functions, {\em e.g.} solid and liquid.
38\item Made binodal calculation much more accurate by a Newton refining
39  procedure at the edges.
40\item Added spinodal region boundary calculation.
41\item Added a graphical interface for setting the free energy parameters.
42\end{itemize}
43
44{\tt Ternary} is nearly complete, with the one un-implemented feature being to
45build and neatly visualize how free energy functions create a full
46temperature-composition ternary phase diagram.
47
48\section{Compiling {\tt Ternary}}
49
50To compile {\tt Ternary}, you need the qhull library and geomview program, as
51well as a C compiler.  On Debian and Ubuntu, installing the {\tt
52  build-essential}, {\tt liblapack-dev}, {\tt libqhull-dev} and {\tt geomview}
53packages satisfy this.  If you want to build the documentation as well, you
54will also need {\tt cxref} along with \LaTeX (in the {\tt texlive-latex-base}
55package) for the PDF, and either {\tt hevea} or {\tt latex2html} for HTML
56documentation.
57
58Next, unpack the {\tt .tar.gz} source archive by typing (at the command line):
59\begin{quote}
60  \tt tar xzf Ternary-[version].tar.gz
61\end{quote}
62Configure and compile it using:
63\begin{quote}
64  \tt ./configure\\
65  make
66\end{quote}
67Then you can run the {\tt ternary} and {\tt square} binary executables.  Modify
68them by changing the parameters at the top of {\tt ternary.c} and {\tt
69  square.c} and re-compiling it using {\tt make} again.
70
71\section{How it works}
72
73The files {\tt ternary.c} and {\tt square.c} (documentation in appendices
74\ref{file_ternary.c} and \ref{file_square.c}) contain sample front-ends to the
75free energy and phase diagram libraries.  They do the following:
76\begin{itemize}
77\item Call functions in {\tt book.c} (appendix \ref{file_book.c}) to create a
78  triangular or square array of points and set of triangles connecting them.
79\item Calculate the free energy function on the triangle vertices using
80  {\tt free\_energies()} in {\tt freenergy.c} (appendix
81  \ref{file_freenergy.c}).  Note that {\tt freenergy.c} is the sole source file
82  for {\tt libfreenergy}; {\tt book.c} and the others below comprise {\tt
83    libgibbs}.
84\item Display the free energy using the functions in {\tt geomview.c}
85  (appendix \ref{file_geomview.c}), which forks and controls a Geomview
86  process.
87\item Calculate the spinodal of this free energy function using {\tt
88    calc\_spinodal} in {\tt spinodal.c} (appendix \ref{file_spinodal.c}), and
89  displays it on the free energy function.
90\item Use Qhull calls in {\tt qhull.c} (appendix \ref{file_qhull.c}) to
91  calculate the convex hull of the free energy function.
92\item Refine the multi-phase triangles using Newton iteration ({\tt
93    hullRefine} in {\tt qhull.c}) to find the lowest-energy point starting at
94  each corner, smoothing the phase boundaries considerably.
95\item Add the two-phase region facet outlines to the Geomview display.
96\end{itemize}
97
98For more than one free energy function (as implemented in {\tt ternary} and
99{\tt square}), it creates a double-size (or more) array with multiple sets of
100points, and multiple sets of triangle indices connecting them.  The rest of
101this procedure is pretty much the same.
102
103The {\tt Ternary} GUI does all of these things as well each time the user
104changes the free energy function parameters or otherwise updates the display.
105
106\section{Bugs}
107
108There are several bugs in the Ternary algorithms, an incomplete implementation,
109and a problem in the GUI, as follows:
110
111\begin{itemize}
112\item Finding some phases depends on the initial discretization of the space.
113  For example, if there is a small miscibitily gap which none of the initial
114  points happens to be in, it will not show up in the phase diagram isotherm.
115
116\item The refining algorithm does not work well near a critical point.
117
118\item The edge-values test often produces two critical points and a three-phase
119  region where there should be just one critical point.
120
121\item Version 0.5.0 is releasing with an incomplete implementation of {\tt
122    hullRefine} which is fine for interior points, but does not attempt to
123  refine points on the edges, i.e. pseudobinaries.
124
125\item The function {\tt hullReturnPhaseBoundaries} returns more phases than
126  appropriate in some cases, with some of them empty.
127
128\item The {\tt Ternary} GUI is incomplete: it is missing the polynomial and
129  Gaussian free energy terms, and cannot add or remove phases.
130\end{itemize}
131
132\section{Future Goals}
133
134The 1.0 release should have the following features:
135\begin{itemize}
136\item Fixes for as many of the above bugs as possible.
137\item An XML format for the free energy parameters, and ability to load and
138  save in this format in {\tt libfreenergy}.
139\item Some ability to import and export ThermoCalc\textregistered database
140  files.
141\item Ability to click the isotherm view lower convex hull triangles to return
142  the triangle number and its corners.
143\item Function for determining the phases and their fractions for a given
144  composition in the lower convex hull isotherm.
145\item Assembly of the ternary full phase diagram isotherm traces in a separate
146  view.
147\item Stitch together ternary isotherm traces to create smooth faces.
148\item Change {\tt libfreenergy} and {\tt libgibbs} from $C2,C3$ composition
149  representation to an array, creating a multi-component API which will
150  support such calculations when the back-end is ready.
151\end{itemize}
152
153Other wishlist items include:
154\begin{itemize}
155\item ``Line compounds'' which consist of a single point, this is already
156  possible to do manually but is not in the GUI or either front end.
157\item Phases which do not cover the whole ternary space, also possible to do
158  manually but it would be nice to have some support in {\tt book.c}.
159\end{itemize}
160
161\section{Copyright}
162
163{\tt Ternary} Thermodynamics Visualization
164
165\noindent Copyright \copyright 2003, 2006, 2008, 2009 Adam C. Powell, IV
166
167This code is free software; you can redistribute it and/or modify it under
168the terms of the GNU General Public License as published by the Free Software
169Foundation; either version 3 of the License, or (at your option) any later
170version.
171
172This code is distributed in the hope that it will be useful, but WITHOUT ANY
173WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
174PARTICULAR PURPOSE.  See the GNU General Public License for more details.
175
176You should have received a copy of the GNU General Public License along with
177this code; if not, write to the Free Software Foundation, Inc., 51 Franklin
178Street, Fifth Floor Boston, MA 02110-1301 USA
179
180You may contact the author by email at {\tt apowell@opennovation.com}.
181
182\section{Version History}
183
184This is a condensed summary of new user-visible features in {\tt Ternary}.  A
185more detailed description of new features in each release is in the {\tt
186  ChangeLog} file.
187
188\subsection{{\tt Ternary} 0.1.0}
189
190First standalone release of ternary (extracted from {\tt RheoPlast}), which
191plots a ternary free energy function.  New to this release is the use of the
192Geomview {\tt COFF} format, which creates a much smoother pseudocolor plot.
193
194\subsection{{\tt Ternary} 0.2.0}
195
196This release links with the {\tt qhull} library to calculate the convex hull of
197the energy function, and displays 2- and 3-phase regions in addition to the
198free energy function.
199
200\subsection{{\tt Ternary} 0.3.0}
201
202This version introduced multiple free energy functions which intersect to
203produce complex multi-phase regions on the convex hull.  Internally, much of
204the code in {\tt main()} moved out to a new file {\tt book.c}, which will make
205it a lot easier to wrap these functions using SIDL or SWIG.
206
207\subsection{{\tt Ternary} 0.4.0}
208
209The new Newton refining code in {\tt qhull.c}, which uses new free energy
210derivative functions in {\tt freenergy.c}, gives {\tt Ternary} the ability to
211accurately predict binodal boundaries.  Another new function in {\tt
212  spinodal.c} calculates the shape of the spinodal curve.
213
214All functions can now accommodate ``rectangle'' ternary spaces, though it's not
215clear what a spinodal means in this context.  The {\tt square} front-end
216demonstrates this functionality.
217
218Finally, a major reorganization splits the bulk of the code into two libraries,
219with front-end codes {\tt ternary} and {\tt square} calling into them.  The
220library {\tt libfreenergy} calculates free energies and derivatives, and can be
221re-used in phase field codes.  The library {\tt libgibbs} calculates phase
222diagrams.  The APIs are relatively immature and bound to change.
223
224\subsection{{\tt Ternary} 0.5.0}
225
226The {\tt Ternary} GUI has landed, but is not yet complete.
227
228This version fixed major bugs in, and improved the accuracy of, the spinodal
229calculation.
230
231There are also new arbitrary polynomial terms in the free energy functions.
232And there is a new {\tt adjust\_gaussians} function to aid in the use of
233Gaussians for a single-function free energy surface with known free energies of
234certain phases.
235
236\bibliographystyle{unsrturl}
237\bibliography{ternary}
238\newpage
239
240\appendix
241
242% Begin-Of-Source-Files
243
244% End-Of-Source-Files
245\end{document}
Note: See TracBrowser for help on using the browser.