Is it possible to analytically solve for a particular phase region of a CALPHAD database? (instead of guessing and checking)

As I understand it, a given CALPHAD database is essentially just a set of equations that model the Gibbs free energy of each phase within a given alloy system (set of elements). Typically, the main way ThermoCalc, or any other CALPHAD implementation, works is that the user inputs the thermodynamic conditions (e.g. elements and their fractions and temperature), ThermoCalc then numerically solves for the convex hull defined by the database equations mentioned above, and then returns the equilibrium phases and phase fractions.

This usually works well. However, sometimes you may only be interested in materials with a certain phase, or combination of phases (e.g. only BCC and FCC in equilibrium, or a single phase region of only HCP, etc.). In this case the method described above is very annoying because you essentially have to guess and check different compositions until you find one with the desired phases. This can be very slow, so I want to know if there is a way to use CALPHAD in the reverse way.

Specifically, my question is: if you had access to the database equations for a given alloy system, could you analytically solve (and thus solve quickly) for the conditions (i.e. temperatures and compositions) that would produce the phase combination that you desire? Bonus points if you can point me to a paper where this was demonstrated!

I am aware that getting access to these equations is not feasible for most databases because the equations are essentially the intellectual property, and database creators would be stupid to give that out to users. However, I just want to know if this is theoretically possible, because I am developing algorithms to approximate a phase region of interest using the guess and check method, but I want to know if my algos are actually necessary.

• The commercial vendors like Thermo-Calc, Computherm, CRCT/GTT do have an incentive to not share their databases, but there are many thermodynamic databases are published in the literature. The TDBDB aims to index them. Apr 23 at 19:17

if you had access to the database equations for a given alloy system, could you analytically solve (and thus solve quickly) for the conditions (i.e., temperatures and compositions) that would produce the phase combination that you desire?

Generally, the answer to this question is no. If we knew how to predict which phases were stable analytically without minimizing the Gibbs energy, we wouldn't need to do the Gibbs energy minimization.

That being said, it may be possible for the existing software tools to help you do what you want.

Thermo-Calc and OpenCalphad are very flexible in the conditions you can write. If you can express what you want using thermodynamic conditions, these tools are a great choice and are very powerful. For example, you can fix the amount of a phase, e.g. set the phase amount of HCP to 0, and fix the pressure and number of moles and step over temperatures and compositions to determine the HCP zero phase fraction line. This is actually how phase diagram mapping is implemented in those software tools. I'm pretty some of the other software packages support these conditions as well, Thermo-Calc and OpenCalphad are just the ones I have experience with.

However, it sounds like you are more interested in screening particular regions of phase stability or perhaps a property of interest. To my knowledge, this is not easy in the software that I previously mentioned. In pycalphad it is relatively easy, but there's no getting around actually doing the calculations.

Here's an example I put together (using pycalphad version 0.8.4) for finding the regions in Al-Zn where FCC and HCP are stable. I have a Jupyter Notebook rendered in a GitHub gist, but the code is here for archival purposes.

import matplotlib.pyplot as plt
from pycalphad import Database, binplot, equilibrium
import pycalphad.variables as v

# Load database and choose the phases that will be considered
dbf = Database('alzn_mey.tdb')
components = ['AL', 'ZN', 'VA']
phases = ['LIQUID', 'FCC_A1', 'HCP_A3']
conditions = {v.X('ZN'):(0,1,0.02), v.T: (300, 1000, 10), v.P:101325, v.N: 1}

# Compute the phase diagram
binplot(dbf, components, phases, conditions)
plt.show()

# Perform an equilibrim calculation in a multi-dimensional grid over all the conditions
eq_result = equilibrium(dbf, components, phases, conditions)

mask_cond = (eq_result.Phase.isin('FCC_A1').sum(dim='vertex') == 1) & (eq_result.Phase.isin('HCP_A3').sum(dim='vertex') == 1)
plt.scatter(X_ZN, T, c='blue', s=2)

plt.title('Two-phase FCC and HCP')
plt.xlabel('X(ZN)')
plt.ylabel('Temperature (K)')

plt.xlim(0, 1)
plt.ylim(conditions[v.T][0], conditions[v.T][1])
plt.show()


This produces the following plots of the phase diagram and the points where FCC and HCP are stable:

pycalphad returns results from equilibrium in xarray Dataset objects. xarray is very powerful and can do very advanced masking and indexing operations. We have documented how pycalphad structures the Dataset objects here, which includes some of the data you get from default from a pycalphad calculation.

Full disclosure: I am a developer of pycalphad.

• +1. Beautiful! There's code, figures, external links, and one cannot do much better than to get an answer by a developer of a software tagged in the question! Apr 23 at 21:01
• Thanks for the very thorough response! You said that "there's no getting around actually doing the calculations". So, would be correct to say that the code you included is simply calculating the phase data at a grid of points and then filtering that data until you're left with only the ones that have FCC and HCP phases in eq? Apr 24 at 4:05
• That’s exactly right. The call to equilibrium is performing calculations over a 2D grid of temperatures and compositions and then filtering it in different ways. Apr 24 at 13:01