Root Package

class +tc_toolbox.AbstractCalculation(back)

Abstract base class for calculations.

AbstractCalculation(back)

Constructs an instance of AbstractCalculation.

get_configuration_as_string()

Returns detailed information about the current state of the calculation object.

Warning

The structure of the calculator objects is an implementation detail and might change between releases without notice. Therefore do not rely on the internal object structure.

get_system_data()

Returns the content of the database for the currently loaded system. This can be used to modify the parameters and functions and to change the current system by using with_system_modifications().

Note

Parameters can only be read from unencrypted (i.e. user) databases loaded as *.tdb-file.

Returns

The system data

invalidate()

Invalidates the object and frees the disk space used by it. This is only required if the disk space occupied by the object needs to be released during the calculation. No data can be retrieved from the object afterwards.

with_system_modifications(system_modifications)

Updates the system of this calculator with the supplied system modification (containing new phase parameters and system functions).

Note

This is only possible if the system has been read from unencrypted (i.e. user) databases loaded as a *.tdb-file.

Parameters

system_modifications – The system modification to be performed

class +tc_toolbox.AbstractResult(back)

Abstract base class for results. This can be used to query for specific values .

AbstractResult(back)

Constructs an instance of AbstractResult.

invalidate()

Invalidates the object and frees the disk space used by it. This is only required if the disk space occupied by the object needs to be released during the calculation. No data can be retrieved from the object afterwards.

class +tc_toolbox.CompositionType

The type of composition.

class +tc_toolbox.CompositionUnit

The composition unit.

class +tc_toolbox.Constants
ALL_COMPONENTS = '"*"'
ALL_PHASES = '"*"'
CURRENT_TEMPERATURE = '-1.0'
MATERIAL_B_FRACTION = '"material_b_fraction"'
SER = '"SER"'
class +tc_toolbox.ConversionUnit

The composition unit used in a conversion.

class +tc_toolbox.DiffusionQuantity

Factory class providing quantities used for defining diffusion simulations and their results.

Note

In this factory class only the most common quantities are defined, you can always use the Console Mode syntax strings in the respective methods as an alternative (for example: “NPM(*)”).

static activity_of_component(component, use_ser)

Creates a quantity representing the activity of a component.

Parameters
  • component – The name of the component, use ALL_COMPONENTS to choose all components

  • use_ser – Use Stable-Element-Reference(SER). The user-defined reference state is be used if this setting is set to False.

Returns

A new ActivityOfComponent object.

static chemical_diffusion_coefficient(phase, diffusing_element, gradient_element, reference_element)

Creates a quantity representing the chemical diffusion coefficient of a phase [m^2/s].

Parameters
  • phase – The name of the phase

  • diffusing_element – The diffusing element

  • gradient_element – The gradient element

  • reference_element – The reference element (for example “Fe” in a steel)

Returns

A new ChemicalDiffusionCoefficient object.

static chemical_potential_of_component(component, use_ser)

Creates a quantity representing the chemical potential of a component [J].

Parameters
  • component – The name of the component, use ALL_COMPONENTS to choose all components

  • use_ser – Use Stable-Element-Reference(SER). The user-defined reference state is used if this setting is set to False.

Returns

A new ChemicalPotentialOfComponent object.

static distance(region)

Creates a quantity representing the distance [m].

Parameters

region – The name of the region or All to choose global.

static intrinsic_diffusion_coefficient(phase, diffusing_element, gradient_element, reference_element)

Creates a quantity representing the intrinsic diffusion coefficient of a phase [m^2/s].

Parameters
  • phase – The name of the phase

  • diffusing_element – The diffusing element

  • gradient_element – The gradient element

  • reference_element – The reference element (for example “Fe” in a steel)

Returns

A new IntrinsicDiffusionCoefficient object.

static l_bis(phase, diffusing_element, gradient_element, reference_element)

Creates a quantity representing L’’ of a phase [m^2/s].

Parameters
  • phase – The name of the phase

  • diffusing_element – The diffusing element

  • gradient_element – The gradient element

  • reference_element – The reference element (for example “Fe” in a steel)

Returns

A new Lbis object.

static mass_fraction_of_a_component(component)

Creates a quantity representing the mass fraction of a component.

Parameters

component – The name of the component or ALL_COMPONENTS to choose all components

Returns

A new MassFractionOfAComponent object.

static mass_fraction_of_a_phase(phase)

Creates a quantity representing the mass fraction of a phase.

Parameters

phase – The name of the phase or ALL_PHASES to choose all phases.

Returns

A new MassFractionOfAPhase object.

static mobility_of_component_in_phase(phase, component)

Creates a quantity representing the mobility of a component in a phase [m^2/Js].

Parameters
  • phase – The name of the phase

  • component – The name of the component

Returns

A new MobilityOfComponentInPhase object.

static mole_fraction_of_a_component(component)

Creates a quantity representing the mole fraction of a component.

Parameters

component – The name of the component or ALL_COMPONENTS to choose all components

Returns

A new MoleFractionOfAComponent object.

static mole_fraction_of_a_phase(phase)

Creates a quantity representing the mole fraction of a phase.

Parameters

phase – The name of the phase or ALL_PHASES to choose all phases

Returns

A new MoleFractionOfAPhase object.

static position_of_lower_boundary_of_region(region)

Creates a quantity representing the position of lower boundary of a region [m].

Parameters

region – The name of the region

Returns

A new PositionOfLowerBoundaryOfRegion object.

static position_of_upper_boundary_of_region(region)

Creates a quantity representing the position of upper boundary of a region [m].

Parameters

region – The name of the region

Returns

A new PositionOfUpperBoundaryOfRegion object.

static temperature()

Creates a quantity representing the temperature [K].

Returns

A new Temperature object.

static thermodynamic_factor(phase, diffusing_element, gradient_element, reference_element)

Creates a quantity representing thermodynamic factor of a phase.

Parameters
  • phase – The name of the phase

  • diffusing_element – The diffusing element

  • gradient_element – The gradient element

  • reference_element – The reference element (for example “Fe” in a steel)

Returns

A new ThermoDynamicFactor object.

static time()

Creates a quantity representing the time [s].

static total_mass_fraction_of_component(component)

Creates a quantity representing the total mass fraction of a component.

Parameters

component – The name of the component

Returns

A new TotalMassFractionOfComponent object.

static total_mass_fraction_of_component_in_phase(phase, component)

Creates a quantity representing the total mass fraction of a component in a phase.

Parameters
  • phase – The name of the phase

  • component – The name of the component

Returns

A new TotalMassFractionOfComponentInPhase object.

static total_mass_fraction_of_phase(phase)

Creates a quantity representing the total mass fraction of a phase.

Parameters

phase – The name of the phase.

Returns

A new TotalMassFractionOfPhase object.

static total_mole_fraction_of_component(component)

Creates a quantity representing the total mole fraction of a component.

Parameters

component – The name of the component

Returns

A new TotalMoleFractionOfComponent object.

static total_mole_fraction_of_component_in_phase(phase, component)

Creates a quantity representing the total mole fraction of a component in a phase.

Parameters
  • phase – The name of the phase

  • component – The name of the component

Returns

A new TotalMoleFractionOfComponentInPhase object.

static total_volume_fraction_of_phase(phase)

Creates a quantity representing the total volume fraction of a phase.

Parameters

phase – The name of the phase.

Returns

A new TotalVolumeFractionOfPhase object.

static tracer_diffusion_coefficient(phase, diffusing_element)

Creates a quantity representing tracer diffusion coefficient of a phase [m^2/s].

Parameters
  • phase – The name of the phase

  • diffusing_element – The diffusing element

Returns

A new TracerDiffusionCoefficient object.

static u_fraction_of_a_component(component)

Creates a quantity representing the u-fraction of a component.

Parameters

component – The name of the component

Returns

A new UFractionOfAComponent object.

static user_defined_function(expression)

Creates a quantity representing a user-defined function.

Parameters

expression – The function expression

Returns

A new Function object

static velocity_of_lower_boundary_of_region(region)

Creates a quantity representing the velocity of lower boundary of a region [m/s].

Parameters

region – The name of the region

Returns

A new VelocityOfLowerBoundaryOfRegion object.

static velocity_of_upper_boundary_of_region(region)

Creates a quantity representing the velocity of upper boundary of a region [m/s].

Parameters

region – The name of the region

Returns

A new VelocityOfUpperBoundaryOfRegion object.

static width_of_region(region)

Creates a quantity representing the width of a region [m].

Parameters

region – The name of the region

Returns

A new WidthOfRegion object.

class +tc_toolbox.GasAmountUnit

The amount of a gas.

class +tc_toolbox.GasCompositionUnit

The composition unit for a gas.

class +tc_toolbox.GasRateUnit

The rate of a gas flow.

class +tc_toolbox.IndependentVariable

Factory class providing quantities used for defining the independent variable in general diffusion result querying.

static distance(region)

Creates an independent variable representing the distance [m].

Returns

A new Distance object

static time()

Creates an independent variable representing the time [s].

Returns

A new Time object

class +tc_toolbox.InterfacePosition

The position of an interface relative to its region. Only used for diffusion simulations.

class +tc_toolbox.MetallurgyCalculations(back)

Provides access to the calculation objects for all Process Metallurgy calculations.

These are specialised calculations for working with metallurgical processes. Both equilibrium calculations and kinetic process simulations (Effective Equilibrium Reaction Zone model) are available.

MetallurgyCalculations(back)

Constructs an instance of MetallurgyCalculations.

with_adiabatic_equilibrium_calculation(database)

Creates an adiabatic equilibrium calculation for Process Metallurgy.

Parameters

database – The thermodynamic database used in the calculation

Returns

A new AdiabaticEquilibriumCalculation object

with_adiabatic_process_calculation(database)

Creates an adiabatic kinetic process simulation (EERZ, i.e. Effective Equilibrium Reaction Zone model).

Parameters

database – The thermodynamic database used in the calculation

Returns

A new ProcessSimulationCalculation object

with_isothermal_equilibrium_calculation(database)

Creates an isothermal equilibrium calculation for Process Metallurgy.

Parameters

database – The thermodynamic database used in the calculation

Returns

A new IsoThermalEquilibriumCalculation object

class +tc_toolbox.PhaseParameter(parameter_name)

Database phase parameter expression used by SystemModifications.set().

Parameters

parameter_name – The phase parameter name

PhaseParameter(parameter_name)

Constructs an instance of PhaseParameter.

get_intervals()

Returns the list of all defined intervals.

Returns

The defined temperature intervals

get_lower_temperature_limit()

Returns the lower temperature limit.

Returns

The lower temperature limit in K

get_name()

Returns the name of the phase parameter.

Returns

The name of the phase parameter.

remove_all_intervals()

Removes all previously defined temperature intervals.

Returns

This PhaseParameter object

remove_interval_with_upper_limit(upper_temperature_limit)

Removes a previously defined temperature interval with matching upper temperature limit.

If no such interval exists, an exception is thrown.

Returns

This PhaseParameter object

set_expression_with_upper_limit(parameter_expression, upper_temperature_limit)

Adds/overwrites a parameter expression for a temperature interval.

Default value of the upper limit of the interval: 6000 K

Note

The lower temperature limit is either defined by the lower temperature limit given with PhaseParameter.set_lower_temperature_limit() or by the upper temperature limit of the adjacent interval.

Note

If there is an existing interval with exactly the same upper_temperature_limit, that interval is overwritten, otherwise the interval is added.

Parameters
  • parameter_expression – The parameter expression, example: +V34*T*LN(T)+V35*T**2+V36*T**(-1)+V37*T**3”)

  • upper_temperature_limit – The upper temperature limit for which the expression should be used

Returns

This PhaseParameter object

set_interval(interval)

Adds/overwrites a temperature interval.

Note

The lower temperature limit is either defined by the lower temperature limit given with PhaseParameter.set_lower_temperature_limit() or by the upper temperature limit of the adjacent interval.

Note

If there is an existing interval with exactly the same upper_temperature_limit, that interval is overwritten, otherwise the interval is added.

Returns

This PhaseParameter object

set_lower_temperature_limit(lower_temperature_limit)

Sets the lower temperature limit of the phase parameter.

Default: 298.15 K

Parameters

lower_temperature_limit – The lower temperature limit in K

Returns

This PhaseParameter object

class +tc_toolbox.PhaseUnit

The units available for a phase fraction.

class +tc_toolbox.PlotCondition

Factory class providing quantities used for defining the plot condition in general diffusion result querying.

Note

In this factory class only the most common quantities are defined, you can always use the Console Mode syntax strings in the respective methods as an alternative (for example: “time last”).

static distance(distancepoint, region)

Creates a plot condition representing the distance [m].

Change in version 2019b: Mandatory parameter distancepoint added

Parameters
  • distancepoint – The distance from the lower interface of the region

  • region – The name of the region or All to choose global.

Returns

A new DistanceCondition object

static integral()

Creates an integral plot condition.

Returns

A new IntegralCondition object

static interface(region, interface_position)

Creates a plot condition representing an interface between two regions.

Parameters
  • region – The name of the region used for defining the interface

  • interface_position – The position of the interface relative to that region (lower or upper)

Returns

A new InterfaceCondition object

static time(timepoint)

Creates a plot condition representing the time [s].

Change in version 2019b: Lists of timepoints are no longer supported

Parameters

timepoint – The timepoint. Optionally “Last” can be used for the end of the simulation

Returns

A new TimeCondition object

class +tc_toolbox.ResultLoader(back)

Contains methods for loading results from previously done calculations.

ResultLoader(back)

Constructs an instance of ResultLoader.

diffusion(path)

Loads a DiffusionCalculationResult from disc.

Parameters

path – path to the folder where result was previously saved.

Returns

A new DiffusionCalculationResult object which later can be used to get specific values from the calculated result

phase_diagram(path)

Loads a PhaseDiagramResult from disc.

Parameters

path – path to the folder where result was previously saved.

Returns

A new PhaseDiagramResult object which later can be used to get specific values from the calculated result

precipitation_TTT_or_CCT(path)

Loads a PrecipitationCalculationTTTorCCTResult from disc.

Parameters

path – path to the folder where result was previously saved.

Returns

A new PrecipitationCalculationTTTorCCTResult object which later can be used to get specific values from the calculated result

precipitation_single(path)

Loads a PrecipitationCalculationSingleResult from disc.

Parameters

path – path to the folder where result was previously saved.

Returns

A new PrecipitationCalculationSingleResult object which later can be used to get specific values from the calculated result

property_diagram(path)

Loads a PropertyDiagramResult from disc.

Parameters

path – path to the folder where result was previously saved.

Returns

A new PropertyDiagramResult object which later can be used to get specific values from the calculated result

property_model(path)

Loads a PropertyModelResult from disc.

Parameters

path – path to the folder where result was previously saved.

Returns

A new PropertyModelResult object which later can be used to get specific values from the calculated result

scheil(path)

Loads a ScheilCalculationResult from disc.

Parameters

path – path to the folder where result was previously saved.

Returns

A new ScheilCalculationResult object which later can be used to get specific values from the calculated result

single_equilibrium(path)

Loads a SingleEquilibriumResult from disc.

Parameters

path – path to the folder where result was previously saved.

Returns

A new SingleEquilibriumResult object which later can be used to get specific values from the calculated result

class +tc_toolbox.ResultValueGroup(back)

A x-y-dataset representing a line data calculation result (i.e. a Thermo-Calc quantity 1 vs. quantity 2).

Warning

Depending on the calculator, the dataset might contain NaN-values to separate the data between different subsets.

Returns

list of floats representing the second quantity (“y-axis”)

ResultValueGroup(back)

Constructs an instance of ResultValueGroup.

get_label()

Accessor for the line label :return the line label

get_x()

Accessor for the x-values :return the x values

get_y()

Accessor for the y-values :return the y values

class +tc_toolbox.ScheilQuantity

Factory class providing quantities used for defining a Scheil calculation result (+tc_toolbox.scheil.ScheilCalculationResult).

static apparent_heat_capacity_per_gram()

Creates a quantity representing the apparent heat capacity [J/g/K].

Returns

A new ApparentHeatCapacityPerGram object.

static apparent_heat_capacity_per_mole()

Creates a quantity representing the apparent heat capacity [J/mol/K].

Returns

A new ApparentHeatCapacityPerMole object.

static apparent_volumetric_thermal_expansion_coefficient()

Creates a quantity representing the apparent volumetric thermal expansion coefficient of the system [1/K].

Returns

A new ApparentVolumetricThermalExpansionCoefficient object.

static composition_of_phase_as_mole_fraction(phase, component)

Creates a quantity representing the composition of a phase [mole-fraction].

Parameters
  • phase – The name of the phase, use ALL_PHASES to choose all stable phases

  • component – The name of the component, use ALL_COMPONENTS to choose all components

Returns

A new CompositionOfPhaseAsMoleFraction object.

static composition_of_phase_as_weight_fraction(phase, component)

Creates a quantity representing the composition of a phase [weight-fraction].

Parameters
  • phase – The name of the phase, use ALL_PHASES to choose all stable phases

  • component – The name of the component, use ALL_COMPONENTS to choose all components

Returns

A new CompositionOfPhaseAsWeightFraction object.

static density_of_phase(phase)

Creates a quantity representing the average density of a phase [g/cm^3].

Parameters

phase – The name of the phase or ALL_PHASES to choose all phases

Returns

A new DensityOfPhase object.

static density_of_system()

Creates a quantity representing the average density of the system [g/cm^3].

Returns

A new DensityOfSystem object.

static distribution_of_component_of_phase(phase, component)

Creates a quantity representing the (molar) fraction of the specified component being present in the specified phase compared to the overall system [-]. This corresponds to the degree of segregation to that phase.

Parameters
  • phase – The name of the phase

  • component – The name of the component

Returns

A new DistributionOfComponentOfPhase object.

static heat_per_gram()

Creates a quantity representing the total heat release from the liquidus temperature down to the current temperature [J/g].

Note

The total or apparent heat release during the solidification process consists of two parts: one is the so-called latent heat, i.e. heat due to the liquid -> solid phase transformation (latent_heat_per_mole() and latent_heat_per_gram()), and the other is the heat related to the specific heat of liquid and solid phases (heat_per_mole() and heat_per_gram()).

Returns

A new HeatPerGram object.

static heat_per_mole()

Creates a quantity representing the total heat release from the liquidus temperature down to the current temperature [J/mol].

Note

The total or apparent heat release during the solidification process consists of two parts: one is the so-called latent heat, i.e. heat due to the liquid -> solid phase transformation (latent_heat_per_mole() and latent_heat_per_gram()), and the other is the heat related to the specific heat of liquid and solid phases (heat_per_mole() and heat_per_gram()).

Returns

A new HeatPerMole object.

static latent_heat_per_gram()

Creates a quantity representing the cumulated latent heat release from the liquidus temperature down to the current temperature [J/g].

Note

The total or apparent heat release during the solidification process consists of two parts: one is the so-called latent heat, i.e. heat due to the liquid -> solid phase transformation (latent_heat_per_mole() and latent_heat_per_gram()), and the other is the heat related to the specific heat of liquid and solid phases (heat_per_mole() and heat_per_gram()).

Returns

A new LatentHeatPerGram object.

static latent_heat_per_mole()

Creates a quantity representing the cumulated latent heat release from the liquidus temperature down to the current temperature [J/mol].

Note

The total or apparent heat release during the solidification process consists of two parts: one is the so-called latent heat, i.e. heat due to the liquid -> solid phase transformation (latent_heat_per_mole() and latent_heat_per_gram()), and the other is the heat related to the specific heat of liquid and solid phases (heat_per_mole() and heat_per_gram()).

Returns

A new LatentHeatPerMole object.

static mass_fraction_of_a_solid_phase(phase)

Creates a quantity representing the mass fraction of a solid phase.

Parameters

phase – The name of the phase or ALL_PHASES to choose all solid phases

Returns

A new MassFractionOfASolidPhase object.

static mass_fraction_of_all_liquid()

Creates a quantity representing the total mass fraction of all the liquid phase.

Returns

A new MassFractionOfAllLiquid object.

static mass_fraction_of_all_solid_phases()

Creates a quantity representing the total mass fraction of all solid phases.

Returns

A new MassFractionOfAllSolidPhase object.

static molar_volume_of_phase(phase)

Creates a quantity representing the molar volume of a phase [m^3/mol].

Parameters

phase – The name of the phase or ALL_PHASES to choose all phases

Returns

A new MolarVolumeOfPhase object.

static molar_volume_of_system()

Creates a quantity representing the molar volume of the system [m^3/mol].

Returns

A new MolarVolumeOfSystem object.

static mole_fraction_of_a_solid_phase(phase)

Creates a quantity representing the molar fraction of a solid phase.

Parameters

phase – The name of the phase or ALL_PHASES to choose all solid phases

Returns

A new MoleFractionOfASolidPhase object.

static mole_fraction_of_all_liquid()

Creates a quantity representing the total molar fraction of all the liquid phase.

Returns

A new MoleFractionOfAllLiquid object.

static mole_fraction_of_all_solid_phases()

Creates a quantity representing the total molar fraction of all solid phases.

Returns

A new MoleFractionOfAllSolidPhases object.

static site_fraction_of_component_in_phase(phase, component, sub_lattice_ordinal_no)

Creates a quantity representing the site fractions [-].

Note

Detailed information about the sublattices can be obtained by getting the Phase object of a phase from the System object using +tc_toolbox.system.System.get_phase_in_system. For each phase the sublattices are obtained by using +tc_toolbox.system.Phase.get_sublattices. The order in the returned list is equivalent to the sublattice ordinal number expected, but note that the ordinal numbers start with 1.

Parameters
  • phase – The name of the phase, use ALL_PHASES to choose all stable phases

  • component – The name of the component, use ALL_COMPONENTS to choose all components

  • sub_lattice_ordinal_no – The ordinal number (i.e. 1, 2, …) of the sublattice of interest, use None to choose all sublattices

Returns

A new SiteFractionOfComponentInPhase object.

static temperature()

Creates a quantity representing the temperature [K].

Returns

A new Temperature object.

class +tc_toolbox.SystemData(back)

Provides information about the parameters and functions of a user database. The obtained objects can be used to modify the database using with_system_modifications() of all calculators.

Note

Parameters can only be read from unencrypted (i.e. user) databases loaded as *.tdb-file.

SystemData(back)

Constructs an instance of SystemData.

get_phase_parameter(parameter)

Returns a phase parameter.

Example:

system_data.get_phase_parameter(‘G(HCP_A3,FE:VA;0)’)

Note

Parameters can only be read from unencrypted (i.e. user) databases loaded as a *.tdb-file.

Note

For details about the syntax search the Thermo-Calc help for GES (the name for the Gibbs Energy System module in Console Mode).

Parameters

parameter – The name of the phase parameter (for example: “G(LIQUID,FE;0)”)

Returns

The phase parameter

get_phase_parameter_names()

Returns all phase parameters present in the current system.

Returns

The list of phase parameters

get_system_function(f)

Returns a system function.

Example:

system_data.get_system_function(‘GHSERCR’)

Note

The parameter ‘f’ was previously called ‘function’ but was renamed.

Note

Functions can only be read from unencrypted (i.e. user) databases loaded as a *.tdb-file.

Note

For details about the syntax search the Thermo-Calc help for GES (the name for the Gibbs Energy System module in Console Mode).

Parameters

f – The name of the system function (for example: “GHSERCR”)

Returns

The system function

get_system_function_names()

Returns all system functions present in the current system.

Returns

The list of system functions

class +tc_toolbox.SystemFunction(function_name)

Database function expression used by SystemModifications.set().

Parameters

function_name – The function name

SystemFunction(function_name)

Constructs an instance of SystemFunction.

get_intervals()

Returns the list of all defined intervals.

Returns

The defined temperature intervals

get_lower_temperature_limit()

Returns the lower temperature limit.

Returns

The lower temperature limit in K

get_name()

Returns the name of the system function.

Returns

The name of the system function

remove_all_intervals()

Removes all previously defined temperature intervals.

Returns

This SystemFunction object

remove_interval_with_upper_limit(upper_temperature_limit)

Removes a previously defined temperature interval with matching upper temperature limit.

If no such interval exists, an exception is thrown.

Returns

This SystemFunction object

set_expression_with_upper_limit(function_expression, upper_temperature_limit)

Adds/overwrites a function expression for a temperature interval.

Default value of the upper limit of the interval: 6000 K

Note

The lower temperature limit is either defined by the lower temperature limit given with SystemFunction.set_lower_temperature_limit() or by the upper temperature limit of the adjacent interval.

Note

If there is an existing interval with exactly the same upper_temperature_limit, that interval is overwritten, otherwise the interval is added.

Parameters
  • function_expression – The function expression, example: +V34*T*LN(T)+V35*T**2+V36*T**(-1)+V37*T**3”)

  • upper_temperature_limit – The upper temperature limit for which the expression should be used

Returns

This SystemFunction object

set_interval(interval)

Adds/overwrites a temperature interval.

Note

The lower temperature limit is either defined by the lower temperature limit given with SystemFunction.set_lower_temperature_limit() or by the upper temperature limit of the adjacent interval.

Note

If there is an existing interval with exactly the same upper_temperature_limit, that interval is overwritten, otherwise the interval is added.

Returns

This SystemFunction object

set_lower_temperature_limit(lower_temperature_limit)

Sets the lower temperature limit of the system function.

Default: 298.15 K

Parameters

lower_temperature_limit – The lower limit in K

Returns

This SystemFunction object

class +tc_toolbox.SystemModifications

Functionality to modify a user database during a calculation by changing phase parameters and system functions.

The actual changes are only applied by using +tc_toolbox.abstract_base.AbstractCalculation.with_system_modifications() on a calculator object.

SystemModifications()

Constructs an instance of SystemModifications.

run_ges_command(ges_command)

Sends a GES-command. This is actually applied when running `with_system_modifications` on a calculator object.

Example: run_ges_command(“AM-PH-DE FCC_A1 C_S 2 Fe:C”) for adding a second composition set to the FCC_A1 phase with Fe as major constituent on first sublattice and C as major constituent on second sublattice.

Note

For details about the syntax search the Thermo-Calc help for GES (the name for the Gibbs Energy System module in Console Mode).

Note

It should not be necessary for most users to use this method, try to use the corresponding method implemented in the API instead.

Warning

As this method runs raw GES-commands directly in the engine, it may hang the program in case of spelling mistakes (e.g. forgotten parenthesis, …).

Parameters

ges_command – The GES-command (for example: “AM-PH-DE FCC_A1 C_S 2 Fe:C”)

Returns

This SystemModifications object

class +tc_toolbox.TCToolbox

TCToolbox Starting point for all calculations. This class exposes methods that have no precondition, it is used for choosing databases and elements.

TCToolbox()

TCToolbox Construct an instance of this class

delete()

TCToolbox Clears all resources used by the session Shuts down the API server and deletes all temporary files. The disk usage of temporary files might be significant.

disable_caching()

A previously set cache folder is no longer used.

Note

Within the session, caching is activated and used through the default temporary directory.

Returns

This SetUp object

get_database_info(database_short_name)

Obtains the short information available for the specified database.

Parameters

database_short_name – The name of the database (i.e. “FEDEMO”, …)

Returns

The short information about the database

get_database_path_on_disk(database_short_name)

Obtains the path to the database file on disk. TCPATH is a placeholder for the root path of the used Thermo-Calc installation.

Note

Encrypted databases (*.TDC) cannot be edited.

Parameters

database_short_name – The name of the database (i.e. “FEDEMO”, …)

Returns

The path to the database on disk

get_databases()

Obtains the short names of all databases available in the used Thermo-Calc installation.

Note

Only databases with a valid license are listed.

Returns

List of the available databases

get_property_models(path_to_models)

Lists the names of all Property Models in the specified directory.

If the directory is not specified, the Property Model folder used by the normal Thermo-Calc application is used.

Parameters

path_to_models – The path where the Property Models are installed. If no value is entered, the Property Model folder used by the normal Thermo-Calc application is used.

Returns

Set containing all Property Model names

load_result_from_disk()

Loads a previously calculated result from disk.

Note

This only works for results created by calling one of the save_result() methods on a Result class created from a calculation.

Returns

A new ResultLoader object

select_database_and_elements(database_name, list_of_elements)

Selects a first thermodynamic or kinetic database and selects the elements in it.

Parameters
  • database_name – The name of the database, for example “FEDEMO”

  • list_of_elements – The list of the selected elements in that database, for example [“Fe”, “C”]

Returns

A new SystemBuilder object

select_thermodynamic_and_kinetic_databases_with_elements(thermodynamic_db_name, kinetic_db_name, list_of_elements)

Selects the thermodynamic and kinetic database at once, guarantees that the databases are added in the correct order. Further rejection or selection of phases applies to both databases.

Parameters
  • thermodynamic_db_name – The thermodynamic database name, for example “FEDEMO”

  • kinetic_db_name – The kinetic database name, for example “MFEDEMO”

  • list_of_elements – The list of the selected elements in that database, for example [“Fe”, “C”]

Returns

A new MultiDatabaseSystemBuilder object

select_user_database_and_elements(path_to_user_database, list_of_elements)

Selects a user-defined database and selects the elements in it.

Note

By using a r-literal, it is possible to use slashes on all platforms, also on Windows: select_user_database_and_elements(r”my path/user_db.tdb”, [“Fe”, “Cr”]])

Note

On Linux and Mac the path is case-sensitive, also the file ending.

Parameters
  • path_to_user_database – The path to the database file (“database”.TDB), defaults to the current working directory. Only filename is required if the database is located in the same folder as the script.

  • list_of_elements – The list of the selected elements in that database, for example [“Fe”, “C”]

Returns

A new SystemBuilder object

set_cache_folder(path, precision_for_floats)

Sets a folder where results from calculations and state of systems are saved. If at any time a calculation is run which has the exact same setting as a previous, the calculation is not re-run. The result is instead loaded from this folder.

Note

The same folder can be used in several scripts, and it can even be shared between different users. It can be a network folder.

Parameters
  • path – path to the folder where results should be stored. It can be relative or absolute.

  • precision_for_floats – The number of significant figures used when comparing if the calculation has the same setting as a previous.

Returns

This SetUp object

set_ges_version(version)

Setting the version of the Gibbs Energy System (GES).

Parameters

version – The GES-version (currently version 5 or 6)

Returns

This SetUp object

set_log_level_to_debug()

Sets log level to DEBUG

Returns

This SetUp object

set_log_level_to_info()

Sets log level to INFO

Returns

This SetUp object

with_metallurgy()

Provides access to the calculation objects for all Process Metallurgy calculations.

These are specialised calculations for working with metallurgical processes. Both equilibrium calculations and kinetic process simulations (Effective Equilibrium Reaction Zone model) are available.

class +tc_toolbox.TemperatureInterval(expression, upper_temperature_limit)

Temperature interval expression used by the classes SystemFunction and PhaseParameter.

Parameters
  • expression – The temperature function expressed in Thermo-Calc database syntax.

  • upper_temperature_limit – The upper temperature limit in K

TemperatureInterval(expression, upper_temperature_limit)

Constructs an instance of TemperatureInterval.

get_expression()

Returns the function expression of this temperature interval.

Returns

The temperature function expression

get_upper_temperature_limit()

Returns the upper limit of this temperature interval.

Returns

The upper temperature limit in K

set_expression(expression)

Sets the function expression of this temperature interval.

Parameters

expression – The temperature function expression

set_upper_temperature_limit(upper_temperature_limit)

Sets the upper limit of this temperature interval.

Parameters

upper_temperature_limit – The upper temperature limit in K

class +tc_toolbox.TemperatureProfile

Represents a time-temperature profile used by non-isothermal calculations.

Note

The total simulation time can differ from the defined temperature profile. Constant temperature is assumed for any timepoint after the end of the defined profile.

TemperatureProfile()

Constructor. Constructs an instance of TemperatureProfile.

add_time_temperature(time, temperature)

Adds a time-temperature point to the non-isothermal temperature profile.

Parameters
  • time – The time [s]

  • temperature – The temperature [K]

Returns

This TemperatureProfile object

class +tc_toolbox.ThermodynamicQuantity

Factory class providing quantities used for defining equilibrium calculations (single equilibrium, property and phase diagrams, …) and their results.

Note

In this factory class only the most common quantities are defined, you can always use the Console Mode syntax strings in the respective methods as an alternative (for example: “NPM(*)”).

static activity_of_component(component, use_ser)

Creates a quantity representing the activity of a component [-].

Parameters
  • component – The name of the component, use ALL_COMPONENTS to choose all components

  • use_ser – Use Stable-Element-Reference(SER). The user-defined reference state is used if this setting is set to False.

Returns

A new ActivityOfComponent object.

static chemical_diffusion_coefficient(phase, diffusing_element, gradient_element, reference_element)

Creates a quantity representing the chemical diffusion coefficient of a phase [m^2/s].

Parameters
  • phase – The name of the phase

  • diffusing_element – The diffusing element

  • gradient_element – The gradient element

  • reference_element – The reference element (for example “Fe” in a steel)

Returns

A new ChemicalDiffusionCoefficient object.

static chemical_potential_of_component(component, use_ser)

Creates a quantity representing the chemical potential of a component [J].

Parameters
  • component – The name of the component, use ALL_COMPONENTS to choose all components

  • use_ser – Use Stable-Element-Reference(SER). The user-defined reference state is used if this setting is set to False.

Returns

A new ChemicalPotentialOfComponent object.

static composition_of_phase_as_mole_fraction(phase, component)

Creates a quantity representing the composition of a phase [mole-fraction].

Parameters
  • phase – The name of the phase, use ALL_PHASES to choose all stable phases

  • component – The name of the component, use ALL_COMPONENTS to choose all components

Returns

A new CompositionOfPhaseAsMoleFraction object.

static composition_of_phase_as_weight_fraction(phase, component)

Creates a quantity representing the composition of a phase [weight-fraction].

Parameters
  • phase – The name of the phase, use ALL_PHASES to choose all stable phases

  • component – The name of the component, use ALL_COMPONENTS to choose all components

Returns

A new CompositionOfPhaseAsWeightFraction object.

static gibbs_energy_of_a_phase(phase, use_ser)

Creates a quantity representing the Gibbs energy of a phase [J].

Parameters
  • phase – The name of the phase or ALL_PHASES to choose all phases

  • use_ser – Use Stable-Element-Reference(SER). The user-defined reference state will be used when this setting is set to False.

Returns

A new GibbsEnergyOfAPhase object.

static mass_fraction_of_a_component(component)

Creates a quantity representing the mass fraction of a component.

Parameters

component – The name of the component or ALL_COMPONENTS to choose all components

Returns

A new MassFractionOfAComponent object.

static mass_fraction_of_a_phase(phase)

Creates a quantity representing the mass fraction of a phase.

Parameters

phase – The name of the phase or ALL_PHASES to choose all phases.

Returns

A new MassFractionOfAPhase object.

static mole_fraction_of_a_component(component)

Creates a quantity representing the mole fraction of a component.

Parameters

component – The name of the component or ALL_COMPONENTS to choose all components

Returns

A new MoleFractionOfAComponent object.

static mole_fraction_of_a_phase(phase)

Creates a quantity representing the mole fraction of a phase.

Parameters

phase – The name of the phase or ALL_PHASES to choose all phases

Returns

A new MoleFractionOfAPhase object.

static normalized_driving_force_of_a_phase(phase)

Creates a quantity representing normalized driving force of a phase [-].

Warning

A driving force calculation requires that the respective phase has been set to the state DORMANT. The parameter All is only reasonable if all phases have been set to that state.

Parameters

phase – The name of the phase or ALL_PHASES to choose all phases

Returns

A new DrivingForceOfAPhase object.

static pressure()

Creates a quantity representing the pressure [Pa].

Returns

A new Pressure object.

static system_size()

Creates a quantity representing the system size [mol].

Returns

A new SystemSize object.

static temperature()

Creates a quantity representing the temperature [K].

Returns

A new Temperature object.

static tracer_diffusion_coefficient(phase, diffusing_element)

Creates a quantity representing tracer diffusion coefficient of a phase [m^2/s].

Parameters
  • phase – The name of the phase

  • diffusing_element – The diffusing element

Returns

A new TracerDiffusionCoefficient object.

static u_fraction_of_a_component(component)

Creates a quantity representing the u-fraction of a component.

Parameters

component – The name of the component

Returns

A new UFractionOfAComponent object.

static user_defined_function(expression)

Creates a quantity representing a user-defined function.

Parameters

expression – The function expression

Returns

A new Function object

static volume_fraction_of_a_phase(phase)

Creates a quantity representing the volume fraction of a phase.

Parameters

phase – The name of the phase or ALL_PHASES to choose all phases

Returns

A new VolumeFractionOfAPhase object.