# How to calculate t-zero temperature using Thermo-Calc- Python (TCPython) for multiple alloys?

T-zero temperature is the temperature at which the Gibbs energies of two phases are equal. Here, I wish to find the temperature at which FCC and BCC have same Gibbs energy. Thermo-Calc console mode has an in-built function to calculate t-zero. However, if I manually do the calculation in TC-Python the results are different.

import numpy as np
from tc_python import *
w_c=0.008
with TCPython() as start:
# create and configure a single equilibrium calculation
calc_result = (
start
.set_cache_folder(os.path.basename(__file__) + "_cache")
.select_database_and_elements("TCFE6", ["Fe","C"])
.get_system()
.with_single_equilibrium_calculation()
.disable_global_minimization()
.set_condition(ThermodynamicQuantity.mass_fraction_of_a_component("C"), w_c)
)
step=2000
for temp in np.linspace(500,1200,step):
calc = (
calc_result
.set_condition(ThermodynamicQuantity.temperature(),temp)
.calculate()
)

gf = abs(calc.get_value_of('GM(FCC_A1)'))
gb = abs(calc.get_value_of('GM(BCC_A2)'))
if(abs(gf-gb)<=1):
print(temp,gf,gb)
break


There was no temperature that satisfied this criteria. However, in console mode (adv-options t-zero bcc_A2 fcc_A1 )I got 784.79 K. If I use run_poly_command also, I get the set-temperature (473 K) and not t-zero temperature.

from tc_python import *
w_c=0.008
with TCPython() as start:
# create and configure a single equilibrium calculation
calc_result = (
start
.set_cache_folder(os.path.basename(__file__) + "_cache")
.select_database_and_elements("TCFE6", ["Fe","C"])
.get_system()
.with_single_equilibrium_calculation()
.disable_global_minimization()
.set_condition(ThermodynamicQuantity.mass_fraction_of_a_component("C"), w_c)
.set_condition(ThermodynamicQuantity.temperature(),473)
)
calc=calc_result.run_poly_command('adv t-zero bcc_a2 fcc_a1').calculate()
print(calc.get_value_of('T'))


What command should be used to get t-zero temperature in TC-Python?

• I think this question would profit a lot from more context, and an example input. – Martin - マーチン May 10 '20 at 12:57
• I’m voting to close this question because: The user has not responded to a request to provide more detail, and has not even signed in since asking the question on May 9th, so the user has not even checked to see if there is an answer. They might have solved the problem or lost interest. It would still be valuable to have an answer here in case someone comes across the question when searching on Google, but Martin says the question needs to be more specific anyway. We can re-open if OP comes back – Nike Dattani Jul 4 '20 at 14:05
• I have made some changes. Kindly re-open the question. – Hariharan Jul 7 '20 at 7:31
• Thanks for adding all that. I've voted to reopen and contacted Tyberius to maybe open it faster. – Nike Dattani Jul 7 '20 at 11:44
• @AloneProgrammer No I am not finding the equilibrium temperature for Austenite to ferrite transformation. Mass fraction of c=0.008. T-zero temperature will not be available in phase diagram. – Hariharan Jul 9 '20 at 6:28

## 1 Answer

I have faced a similar issue and it seems that something happens while calling calculate(). I think it may be because when you use the same single equilibrium calculation for determining the Gibbs energy it does without suspending the other phase and this might be creating the problems, but I am not sure. I would suggest trying two different single equilibrium calculations (one for FCC and another for BCC) each with only one phase entered while all others suspended and then calculate the T-zero temperature separately from the resulting Gibbs energy values by finding the temperature at which their difference is zero, like you have done in the first code.

Another simpler way, in case you want to keep the original code with a single equilibrium calculation over a range of compositions, is to use enable_step_separate_phases() with calculate(), this usually works.

• +10. It's great to have one of our longest standing unanswered questions, finally answered! Welcome to our community and we hope to see much more of you here !!!! – Nike Dattani Oct 20 '20 at 16:49