7
$\begingroup$

I am attempting to calculate the driving force of nucleation for several different precipitate phases using TC-Python. To this I want to suspend all phases, except for the matrix phase (e.g. FCC_L12). Then I want to set the precipitate phase of interest to be dormant (so the driving force can still be calculated).

Below is an example of what my current approach looks like. The issue is that Thermo-Calc will automatically generate several FCC composition sets (e.g. "FCC_L12#2", "FCC_L12#3", etc.), but I only want one of these composition sets to be active (as the matrix). I don't know how to suspend certain composition sets and allow others. Is this possible to do in TC-Python?

with TCPython() as session:
    system=(session.disable_caching()
           .select_database_and_elements(database_name, elements)
           .get_system())
           
    calc=(system.with_single_equilibrium_calculation()
         .with_options(SingleEquilibriumOptions()
         .enable_approximate_driving_force_for_metastable_phases())
         .enable_global_minimization())
    calc.set_condition(ThermodynamicQuantity.temperature(), temp)
    for el_indx in range(len(elements)):
        calc.set_condition(ThermodynamicQuantity
             .mole_fraction_of_a_component(elements[el_indx]), comps[el_indx])

    calc.set_phase_to_suspended("*")
    calc.set_phase_to_entered("FCC_L12", 0)
    calc.set_phase_to_dormant(precip_phaseName)

    calc_result=calc.calculate()
    drivingForce = calc_result.get_value_of('DGM(' + precip_phaseName + ')')
$\endgroup$
4
  • 3
    $\begingroup$ I'm not very familiar with TC-Python, but I see that you have .enable_global_minimization() set on your system. If you remove that line and turn off global minimization, will it stop creating new composition sets? $\endgroup$ Jul 19, 2021 at 18:30
  • $\begingroup$ @BrandonBocklund That did the trick. Amazing, as always. Thanks! $\endgroup$
    – sgp45
    Jul 20, 2021 at 19:46
  • $\begingroup$ Great, I moved my comment into an answer! $\endgroup$ Jul 21, 2021 at 15:38
  • $\begingroup$ Restarting the system is also important as how the composition set is defined changes as more calculations are run on the system. This means that prior calculations actually affect subsequent calculations (even if caching is disabled) $\endgroup$
    – Hspike
    Aug 22, 2023 at 16:08

1 Answer 1

6
$\begingroup$

Thermo-Calc creates new composition sets from the global minimization process and you cannot, to my knowledge, have direct control of preventing certain composition sets from being created. Disabling global minimization (removing .enable_global_minimization()) may get you what you need, but you should be careful to ensure that the composition set of FCC_L12 that you get as your matrix corresponds to the composition set that you intend to be the matrix.

with TCPython() as session:
    system=(session.disable_caching()
           .select_database_and_elements(database_name, elements)
           .get_system())
           
    calc=(system.with_single_equilibrium_calculation()
         .with_options(SingleEquilibriumOptions()
         .enable_approximate_driving_force_for_metastable_phases()))
    calc.set_condition(ThermodynamicQuantity.temperature(), temp)
    for el_indx in range(len(elements)):
        calc.set_condition(ThermodynamicQuantity
             .mole_fraction_of_a_component(elements[el_indx]), comps[el_indx])

    calc.set_phase_to_suspended("*")
    calc.set_phase_to_entered("FCC_L12", 0)
    calc.set_phase_to_dormant(precip_phaseName)

    calc_result=calc.calculate()
    drivingForce = calc_result.get_value_of('DGM(' + precip_phaseName + ')')
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .