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?