Module “step_or_map_diagrams”

class tc_python.step_or_map_diagrams.AbstractAxisType

Bases: object

The abstract base class for all axis types.

class tc_python.step_or_map_diagrams.AbstractPhaseDiagramCalculation(calculator)

Bases: tc_python.abstract_base.AbstractCalculation

Abstract configuration required for a property diagram calculation.

Note

This is an abstract class that cannot be used directly.

add_initial_equilibrium(initial_equilibrium: tc_python.step_or_map_diagrams.InitialEquilibrium)

Add initial equilibrium start points from which a phase diagram is calculated.

Scans along the axis variables and generates start points when the scan procedure crosses a phase boundary.

It may take a little longer to execute than using the minimum number of start points, as some lines may be calculated more than once. But the core remembers all node points and subsequently stops calculations along a line when it finds a known node point.

It is also possible to create a sequence of start points from one initial equilibria.

Parameters

initial_equilibrium – The initial equilibrium

Returns

This PhaseDiagramCalculation object

abstract calculate(keep_previous_results: bool = False, timeout_in_minutes: float = 0.0)tc_python.step_or_map_diagrams.PhaseDiagramResult
disable_global_minimization()

Disables global minimization.

Default: Enabled

Returns

This PhaseDiagramCalculation object

dont_keep_default_equilibria()

Do not keep the initial equilibria added by default.

This is only relevant in combination with add_initial_equilibrium().

This is the default behavior.

Returns

This PhaseDiagramCalculation object

enable_global_minimization()

Enables global minimization.

Default: Enabled

Returns

This PhaseDiagramCalculation object

get_components() → List[str]

Returns the names of the components in the system (including all components auto-selected by the database(s)).

Returns

The component names

get_gibbs_energy_addition_for(phase: str) → float

Used to get the additional energy term (always being a constant) of a given phase. The value given is added to the Gibbs energy of the (stoichiometric or solution) phase. It can represent a nucleation barrier, surface tension, elastic energy, etc.

It is not composition-, temperature- or pressure-dependent.

Parameters

phase – Specify the name of the (stoichiometric or solution) phase with the addition

Returns

Gibbs energy addition to G per mole formula unit.

get_system_data()tc_python.abstract_base.SystemData

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

keep_default_equilibria()

Keep the initial equilibria added by default. This is only relevant in combination with add_initial_equilibrium().

Default behavior is to not keep default equilibria.

Returns

This PhaseDiagramCalculation object

remove_all_initial_equilibria()

Removes all previously added initial equilibria.

Returns

This PhaseDiagramCalculation object

run_poly_command(command: str)

Runs a Thermo-Calc command from the Console Mode POLY module immediately in the engine.

Parameters

command – The Thermo-Calc Console Mode command

Returns

This PhaseDiagramCalculation object

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 Thermo-Calc commands directly in the engine, it may hang the program in case of spelling mistakes (e.g. forgotten equals sign).

set_gibbs_energy_addition_for(phase: str, gibbs_energy: float)

Used to specify the additional energy term (always being a constant) of a given phase. The value (gibbs_energy) given is added to the Gibbs energy of the (stoichiometric or solution) phase. It can represent a nucleation barrier, surface tension, elastic energy, etc.

It is not composition-, temperature- or pressure-dependent.

Parameters
  • phase – Specify the name of the (stoichiometric or solution) phase with the addition

  • gibbs_energy – Addition to G per mole formula unit

Returns

This PhaseDiagramCalculation object

set_phase_to_dormant(phase: str)

Sets the phase to the status DORMANT, necessary for calculating the driving force to form the specified phase.

Parameters

phase – The phase name or ALL_PHASES for all phases

Returns

This PhaseDiagramCalculation object

set_phase_to_entered(phase: str, amount: float = 1.0)

Sets the phase to the status ENTERED, that is the default state.

Parameters
  • phase – The phase name or ALL_PHASES for all phases

  • amount – The phase fraction (between 0.0 and 1.0)

Returns

This PhaseDiagramCalculation object

set_phase_to_fixed(phase: str, amount: float)

Sets the phase to the status FIXED, i.e. it is guaranteed to have the specified phase fraction after the calculation.

Parameters
  • phase – The phase name

  • amount – The fixed phase fraction (between 0.0 and 1.0)

Returns

This PhaseDiagramCalculation object

set_phase_to_suspended(phase: str)

Sets the phase to the status SUSPENDED, i.e. it is ignored in the calculation.

Parameters

phase – The phase name or ALL_PHASES for all phases

Returns

This PhaseDiagramCalculation object

with_options(options: tc_python.step_or_map_diagrams.PhaseDiagramOptions)

Sets the simulation options.

Parameters

options – The simulation options

Returns

This PhaseDiagramCalculation object

with_reference_state(component: str, phase: str = 'SER', temperature: float = - 1.0, pressure: float = 100000.0)

The reference state for a component is important when calculating activities, chemical potentials and enthalpies and is determined by the database being used. For each component the data must be referred to a selected phase, temperature and pressure, i.e. the reference state.

All data in all phases where this component dissolves must use the same reference state. However, different databases can use different reference states for the same element/component. It is important to be careful when combining data obtained from different databases.

By default, activities, chemical potentials and so forth are computed relative to the reference state used by the database. If the reference state in the database is not suitable for your purposes, use this command to set the reference state for a component using SER, i.e. the Stable Element Reference (which is usually set as default for a major component in alloys dominated by the component). In such cases, the temperature and pressure for the reference state is not needed.

For a phase to be usable as a reference for a component, the component needs to have the same composition as an end member of the phase. The reference state is an end member of a phase. The selection of the end member associated with the reference state is only performed once this command is executed.

If a component has the same composition as several end members of the chosen reference phase, then the end member that is selected at the specified temperature and pressure will have the lowest Gibbs energy.

Parameters
  • component – The name of the element must be given.

  • phase – Name of a phase used as the new reference state. Or SER for the Stable Element Reference.

  • temperature – The Temperature (in K) for the reference state. Or CURRENT_TEMPERATURE which means that the current temperature is used at the time of evaluation of the reference energy for the calculation.

  • pressure – The Pressure (in Pa) for the reference state.

Returns

This PhaseDiagramCalculation object

with_system_modifications(system_modifications: tc_python.abstract_base.SystemModifications)

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

Returns

This PhaseDiagramCalculation object

class tc_python.step_or_map_diagrams.AbstractPropertyDiagramCalculation(calculator)

Bases: tc_python.abstract_base.AbstractCalculation

Abstract configuration required for a property diagram calculation.

Note

This is an abstract class that cannot be used directly.

abstract calculate(keep_previous_results: bool = False, timeout_in_minutes: float = 0.0)
disable_global_minimization()

Disables global minimization.

Default: Enabled

Returns

This PropertyDiagramCalculation object

disable_step_separate_phases()

Disables step separate phases. This is the default setting.

Returns

This PropertyDiagramCalculation object

enable_global_minimization()

Enables global minimization.

Default: Enabled

Returns

This PropertyDiagramCalculation object

enable_step_separate_phases()

Enables step separate phases.

Default: By default separate phase stepping is disabled

Note

This is an advanced option, it is used mostly to calculate how the Gibbs energy for a number of phases varies for different compositions. This is particularly useful to calculate Gibbs energies for complex phases with miscibility gaps and for an ordered phase that is never disordered (e.g. SIGMA-phase, G-phase, MU-phase, etc.).

Returns

This PropertyDiagramCalculation object

get_components() → List[str]

Returns the names of the components in the system (including all components auto-selected by the database(s)).

Returns

The component names

get_gibbs_energy_addition_for(phase: str) → float

Used to get the additional energy term (always being a constant) of a given phase. The value given is added to the Gibbs energy of the (stoichiometric or solution) phase. It can represent a nucleation barrier, surface tension, elastic energy, etc.

It is not composition-, temperature- or pressure-dependent.

Parameters

phase – Specify the name of the (stoichiometric or solution) phase with the addition

Returns

Gibbs energy addition to G per mole formula unit.

get_system_data()tc_python.abstract_base.SystemData

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

run_poly_command(command: str)

Runs a Thermo-Calc command from the Console Mode POLY module immediately in the engine.

Parameters

command – The Thermo-Calc Console Mode command

Returns

This PropertyDiagramCalculation object

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 Thermo-Calc commands directly in the engine, it may hang the program in case of spelling mistakes (e.g. forgotten equals sign).

set_gibbs_energy_addition_for(phase: str, gibbs_energy: float)

Used to specify the additional energy term (always being a constant) of a given phase. The value (gibbs_energy) given is added to the Gibbs energy of the (stoichiometric or solution) phase. It can represent a nucleation barrier, surface tension, elastic energy, etc.

It is not composition-, temperature- or pressure-dependent.

Parameters
  • phase – Specify the name of the (stoichiometric or solution) phase with the addition

  • gibbs_energy – Addition to G per mole formula unit

Returns

This PropertyDiagramCalculation object

set_phase_to_dormant(phase: str)

Sets the phase to the status DORMANT, necessary for calculating the driving force to form the specified phase.

Parameters

phase – The phase name or ALL_PHASES for all phases

Returns

This PropertyDiagramCalculation object

set_phase_to_entered(phase: str, amount: float = 1.0)

Sets the phase to the status ENTERED, that is the default state.

Parameters
  • phase – The phase name or ALL_PHASES for all phases

  • amount – The phase fraction (between 0.0 and 1.0)

Returns

This PropertyDiagramCalculation object

set_phase_to_fixed(phase: str, amount: float)

Sets the phase to the status FIXED, i.e. it is guaranteed to have the specified phase fraction after the calculation.

Parameters
  • phase – The phase name

  • amount – The fixed phase fraction (between 0.0 and 1.0)

Returns

This PropertyDiagramCalculation object

set_phase_to_suspended(phase: str)

Sets the phase to the status SUSPENDED, i.e. it is ignored in the calculation.

Parameters

phase – The phase name or ALL_PHASES for all phases

Returns

This PropertyDiagramCalculation object

with_options(options: tc_python.step_or_map_diagrams.PropertyDiagramOptions)

Sets the simulation options.

Parameters

options – The simulation options

Returns

This PropertyDiagramCalculation object

with_reference_state(component: str, phase: str = 'SER', temperature: float = - 1.0, pressure: float = 100000.0)

The reference state for a component is important when calculating activities, chemical potentials and enthalpies and is determined by the database being used. For each component the data must be referred to a selected phase, temperature and pressure, i.e. the reference state.

All data in all phases where this component dissolves must use the same reference state. However, different databases can use different reference states for the same element/component. It is important to be careful when combining data obtained from different databases.

By default, activities, chemical potentials and so forth are computed relative to the reference state used by the database. If the reference state in the database is not suitable for your purposes, use this command to set the reference state for a component using SER, i.e. the Stable Element Reference (which is usually set as default for a major component in alloys dominated by the component). In such cases, the temperature and pressure for the reference state is not needed.

For a phase to be usable as a reference for a component, the component needs to have the same composition as an end member of the phase. The reference state is an end member of a phase. The selection of the end member associated with the reference state is only performed once this command is executed.

If a component has the same composition as several end members of the chosen reference phase, then the end member that is selected at the specified temperature and pressure will have the lowest Gibbs energy.

Parameters
  • component – The name of the element must be given.

  • phase – Name of a phase used as the new reference state. Or SER for the Stable Element Reference.

  • temperature – The Temperature (in K) for the reference state. Or CURRENT_TEMPERATURE which means that the current temperature is used at the time of evaluation of the reference energy for the calculation.

  • pressure – The Pressure (in Pa) for the reference state.

Returns

This PropertyDiagramCalculation object

with_system_modifications(system_modifications: tc_python.abstract_base.SystemModifications)

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

Returns

This PropertyDiagramCalculation object

class tc_python.step_or_map_diagrams.AxisType

Bases: tc_python.step_or_map_diagrams.AbstractAxisType

Factory class providing objects for configuring a logarithmic or linear axis by using AxisType.linear() or AxisType.logarithmic().

classmethod linear()

Creates an object for configuring a linear calculation axis.

Default: A minimum number of 40 steps.

Note

The returned object can be configured regarding the maximum step size or the minimum number of steps on the axis.

Returns

A new Linear object

classmethod logarithmic()

Creates an object for configuring a logarithmic calculation axis.

Default: A scale factor of 1.1

Note

The returned object can be configured regarding the scale factor.

Returns

A new Logarithmic object

class tc_python.step_or_map_diagrams.CalculationAxis(quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str])

Bases: object

A calculation axis used for property and phase diagram calculations.

Note

A calculation axis is defining the varied condition and the range of variation. It is the same concept as in Thermo-Calc Graphical Mode or Console Mode.

Default: A Linear axis with a minimum number of 40 steps

set_max(max: float)

Sets the maximum quantity value of the calculation axis.

There is no default value set, it always needs to be defined.

Parameters

max – The maximum quantity value of the axis [unit according to the axis quantity]

Returns

This CalculationAxis object

set_min(min: float)

Sets the minimum quantity value of the calculation axis.

There is no default value set, it always needs to be defined.

Parameters

min – The minimum quantity value of the axis [unit according to the axis quantity]

Returns

This CalculationAxis object

set_start_at(at: float)

Sets the starting point of the calculation on the axis.

Default: The default starting point is the center between the minimum and maximum quantity value

Parameters

at – The starting point on the axis [unit according to the axis quantity]

Returns

This CalculationAxis object

with_axis_type(axis_type: tc_python.step_or_map_diagrams.AxisType)

Sets the type of the axis.

Default: A Linear axis with a minimum number of 40 steps

Parameters

axis_type – The axis type (linear or logarithmic)

Returns

This CalculationAxis object

class tc_python.step_or_map_diagrams.Direction(value)

Bases: enum.Enum

An enumeration.

DECREASE_FIRST_AXIS = 3
DECREASE_SECOND_AXIS = 4
INCREASE_FIRST_AXIS = 0
INCREASE_SECOND_AXIS = 1
class tc_python.step_or_map_diagrams.InitialEquilibrium(first_axis: float, second_axis: float)

Bases: object

add_equilibria_at_all_phase_changes()

This generates one start point for each set of phase change in the chosen direction of the specified axis This ensures finding all possible phase boundary lines (not just the first one) along such an axis direction.

Default behavior is to only generate one start point at the first phase change.

Returns

This InitialEquilibrium object

add_equilibria_at_first_phase_change()

This generates one start point at the first phase change.

This is the default behavior.

Returns

This InitialEquilibrium object

set_direction(direction_enum: tc_python.step_or_map_diagrams.Direction)

Specifies along which axes the initial equilibria should be added.

The default direction is INCREASE_FIRST_AXIS.

Parameters

direction_enum

Returns

This InitialEquilibrium object

class tc_python.step_or_map_diagrams.Linear

Bases: tc_python.step_or_map_diagrams.AxisType

Represents a linear axis.

get_type() → str

Convenience method for getting axis type.

Returns

The type

set_max_step_size(max_step_size: float)

Sets the axis to use the maximum step size configuration.

Default: This is not the default which is minimum number of steps

Note

Either maximum step size or minimum number of steps can be used but not both at the same time.

Parameters

max_step_size – The maximum step size [unit according to the axis quantity]

Returns

This Linear object

set_min_nr_of_steps(min_nr_of_steps: float = 40)

Sets the axis to use the minimum number of steps configuration.

Default: This is the default option (with a minimum number of steps of 40)

Note

Either maximum step size or minimum number of steps can be used but not both at the same time.

Parameters

min_nr_of_steps – The minimum number of steps

Returns

This Linear object

class tc_python.step_or_map_diagrams.Logarithmic(scale_factor: float = 1.1)

Bases: tc_python.step_or_map_diagrams.AxisType

Represents a logarithmic axis.

Note

A logarithmic axis is useful for low fractions like in a gas phase where 1E-7 to 1E-2 might be an interesting range. For the pressure a logarithmic axis is often also useful.

get_type() → str

Convenience method for getting axis type.

Returns

The type

set_scale_factor(scale_factor: float = 1.1)

Sets the scale factor.

Default: 1.1

Parameters

scale_factor – The scale factor setting the maximum factor between two calculated values, must be larger than 1.0

Returns

This Logarithmic object

class tc_python.step_or_map_diagrams.PhaseDiagramCalculation(calculator)

Bases: tc_python.step_or_map_diagrams.AbstractPhaseDiagramCalculation

Configuration for a phase diagram calculation.

Note

Specify the conditions, the calculation is performed with calculate().

add_initial_equilibrium(initial_equilibrium: tc_python.step_or_map_diagrams.InitialEquilibrium)

Add initial equilibrium start points from which a phase diagram is calculated.

Scans along the axis variables and generates start points when the scan procedure crosses a phase boundary.

It may take a little longer to execute than using the minimum number of start points, as some lines may be calculated more than once. But the core remembers all node points and subsequently stops calculations along a line when it finds a known node point.

It is also possible to create a sequence of start points from one initial equilibria.

Parameters

initial_equilibrium – The initial equilibrium

Returns

This PhaseDiagramCalculation object

calculate(keep_previous_results: bool = False, timeout_in_minutes: float = 0.0)tc_python.step_or_map_diagrams.PhaseDiagramResult

Performs the phase diagram calculation.

Warning

If you use keep_previous_results=True, you must not use another calculator or even get results in between the calculations using calculate(). Then the previous results will actually be lost.

Parameters
  • keep_previous_results – If True, results from any previous call to this method are appended. This can be used to combine calculations with multiple start points if the mapping fails at a certain condition.

  • timeout_in_minutes – Used to prevent the calculation from running longer than what is wanted, or from hanging. If the calculation runs longer than timeout_in_minutes, a UnrecoverableCalculationException will be thrown, the current TCPython-block will be unusable and a new TCPython block must be created for further calculations.

Returns

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

disable_global_minimization()

Disables global minimization.

Default: Enabled

Returns

This PhaseDiagramCalculation object

dont_keep_default_equilibria()

Do not keep the initial equilibria added by default.

This is only relevant in combination with add_initial_equilibrium().

This is the default behavior.

Returns

This PhaseDiagramCalculation object

enable_global_minimization()

Enables global minimization.

Default: Enabled

Returns

This PhaseDiagramCalculation object

get_components() → List[str]

Returns the names of the components in the system (including all components auto-selected by the database(s)).

Returns

The component names

get_gibbs_energy_addition_for(phase: str) → float

Used to get the additional energy term (always being a constant) of a given phase. The value given is added to the Gibbs energy of the (stoichiometric or solution) phase. It can represent a nucleation barrier, surface tension, elastic energy, etc.

It is not composition-, temperature- or pressure-dependent.

Parameters

phase – Specify the name of the (stoichiometric or solution) phase with the addition

Returns

Gibbs energy addition to G per mole formula unit.

get_system_data()tc_python.abstract_base.SystemData

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

keep_default_equilibria()

Keep the initial equilibria added by default. This is only relevant in combination with add_initial_equilibrium().

Default behavior is to not keep default equilibria.

Returns

This PhaseDiagramCalculation object

remove_all_conditions()

Removes all set conditions.

Returns

This PhaseDiagramCalculation object

remove_all_initial_equilibria()

Removes all previously added initial equilibria.

Returns

This PhaseDiagramCalculation object

remove_condition(quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str])

Removes the specified condition.

Parameters

quantity – The thermodynamic quantity to set as condition; a Console Mode syntax string can be used as an alternative (for example X(Cr))

Returns

This ThermodynamicCalculation object

run_poly_command(command: str)

Runs a Thermo-Calc command from the Console Mode POLY module immediately in the engine.

Parameters

command – The Thermo-Calc Console Mode command

Returns

This PhaseDiagramCalculation object

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 Thermo-Calc commands directly in the engine, it may hang the program in case of spelling mistakes (e.g. forgotten equals sign).

set_condition(quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str], value: float)

Sets the specified condition.

Parameters
  • quantity – The thermodynamic quantity to set as condition; a Console Mode syntax string can be used as an alternative (for example X(Cr))

  • value – The value of the condition

Returns

This PhaseDiagramCalculation object

set_gibbs_energy_addition_for(phase: str, gibbs_energy: float)

Used to specify the additional energy term (always being a constant) of a given phase. The value (gibbs_energy) given is added to the Gibbs energy of the (stoichiometric or solution) phase. It can represent a nucleation barrier, surface tension, elastic energy, etc.

It is not composition-, temperature- or pressure-dependent.

Parameters
  • phase – Specify the name of the (stoichiometric or solution) phase with the addition

  • gibbs_energy – Addition to G per mole formula unit

Returns

This PhaseDiagramCalculation object

set_phase_to_dormant(phase: str)

Sets the phase to the status DORMANT, necessary for calculating the driving force to form the specified phase.

Parameters

phase – The phase name or ALL_PHASES for all phases

Returns

This PhaseDiagramCalculation object

set_phase_to_entered(phase: str, amount: float = 1.0)

Sets the phase to the status ENTERED, that is the default state.

Parameters
  • phase – The phase name or ALL_PHASES for all phases

  • amount – The phase fraction (between 0.0 and 1.0)

Returns

This PhaseDiagramCalculation object

set_phase_to_fixed(phase: str, amount: float)

Sets the phase to the status FIXED, i.e. it is guaranteed to have the specified phase fraction after the calculation.

Parameters
  • phase – The phase name

  • amount – The fixed phase fraction (between 0.0 and 1.0)

Returns

This PhaseDiagramCalculation object

set_phase_to_suspended(phase: str)

Sets the phase to the status SUSPENDED, i.e. it is ignored in the calculation.

Parameters

phase – The phase name or ALL_PHASES for all phases

Returns

This PhaseDiagramCalculation object

with_first_axis(axis: tc_python.step_or_map_diagrams.CalculationAxis)

Sets the first calculation axis.

Parameters

axis – The axis

Returns

This PhaseDiagramCalculation object

with_options(options: tc_python.step_or_map_diagrams.PhaseDiagramOptions)

Sets the simulation options.

Parameters

options – The simulation options

Returns

This PhaseDiagramCalculation object

with_reference_state(component: str, phase: str = 'SER', temperature: float = - 1.0, pressure: float = 100000.0)

The reference state for a component is important when calculating activities, chemical potentials and enthalpies and is determined by the database being used. For each component the data must be referred to a selected phase, temperature and pressure, i.e. the reference state.

All data in all phases where this component dissolves must use the same reference state. However, different databases can use different reference states for the same element/component. It is important to be careful when combining data obtained from different databases.

By default, activities, chemical potentials and so forth are computed relative to the reference state used by the database. If the reference state in the database is not suitable for your purposes, use this command to set the reference state for a component using SER, i.e. the Stable Element Reference (which is usually set as default for a major component in alloys dominated by the component). In such cases, the temperature and pressure for the reference state is not needed.

For a phase to be usable as a reference for a component, the component needs to have the same composition as an end member of the phase. The reference state is an end member of a phase. The selection of the end member associated with the reference state is only performed once this command is executed.

If a component has the same composition as several end members of the chosen reference phase, then the end member that is selected at the specified temperature and pressure will have the lowest Gibbs energy.

Parameters
  • component – The name of the element must be given.

  • phase – Name of a phase used as the new reference state. Or SER for the Stable Element Reference.

  • temperature – The Temperature (in K) for the reference state. Or CURRENT_TEMPERATURE which means that the current temperature is used at the time of evaluation of the reference energy for the calculation.

  • pressure – The Pressure (in Pa) for the reference state.

Returns

This PhaseDiagramCalculation object

with_second_axis(axis: tc_python.step_or_map_diagrams.CalculationAxis)

Sets the second calculation axis.

Parameters

axis – The axis

Returns

This PhaseDiagramCalculation object

with_system_modifications(system_modifications: tc_python.abstract_base.SystemModifications)

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

Returns

This PhaseDiagramCalculation object

class tc_python.step_or_map_diagrams.PhaseDiagramOptions

Bases: object

Simulation options for phase diagram calculations.

disable_approximate_driving_force_for_metastable_phases()

Disables the approximation of the driving force for metastable phases.

Default: Enabled

Note

When enabled, the metastable phases are included in all iterations. However, these may not have reached their most favorable composition and thus their driving forces may be only approximate.

If it is important that these driving forces are correct, use disable_approximate_driving_force_for_metastable_phases() to force the calculation to converge for the metastable phases.

Returns

This PhaseDiagramOptions object

disable_control_step_size_during_minimization()

Disables stepsize control during minimization (non-global).

Default: Enabled

Returns

This PhaseDiagramOptions object

disable_force_positive_definite_phase_hessian()

Disables forcing of positive definite phase Hessian. This determines how the minimum of an equilibrium state in a normal minimization procedure (non-global) is reached. For details, search the Thermo-Calc documentation for “Hessian minimization”.

Default: Enabled

Returns

This PhaseDiagramOptions object

dont_use_auto_start_points()

Switches the usage of automatic starting points for the mapping off.

Default: Switched on

Returns

This PhaseDiagramOptions object

dont_use_inside_mesh_points()

Switches the usage of inside meshing points for the mapping off.

Default: Switched off

Returns

This PhaseDiagramOptions object

enable_approximate_driving_force_for_metastable_phases()

Enables the approximation of the driving force for metastable phases.

Default: Enabled

Note

When enabled, the metastable phases are included in all iterations. However, these may not have reached their most favorable composition and thus their driving forces may be only approximate.

If it is important that these driving forces are correct, use disable_approximate_driving_force_for_metastable_phases() to force the calculation to converge for the metastable phases.

Returns

This PhaseDiagramOptions object

enable_control_step_size_during_minimization()

Enables stepsize control during normal minimization (non-global).

Default: Enabled

Returns

This PhaseDiagramOptions object

enable_force_positive_definite_phase_hessian()

Enables forcing of positive definite phase Hessian. This determines how the minimum of an equilibrium state in a normal minimization procedure (non-global) is reached. For details, search the Thermo-Calc documentation for “Hessian minimization”.

Default: Enabled

Returns

This PhaseDiagramOptions object

set_global_minimization_max_grid_points(max_grid_points: int = 2000)

Sets the maximum number of grid points in global minimization. ** Only applicable if global minimization is actually used**.

Default: 2000 points

Parameters

max_grid_points – The maximum number of grid points

Returns

This PhaseDiagramOptions object

set_global_minimization_test_interval(global_test_interval: int = 0)

Sets the interval for the global test.

Default: 0

Parameters

global_test_interval – The global test interval

Returns

This PhaseDiagramOptions object

set_max_no_of_iterations(max_no_of_iterations: int = 500)

Set the maximum number of iterations.

Default: max. 500 iterations

Note

As some models give computation times of more than 1 CPU second/iteration, this number is also used to check the CPU time and the calculation stops if 500 CPU seconds/iterations are used.

Parameters

max_no_of_iterations – The max. number of iterations

Returns

This PhaseDiagramOptions object

set_no_of_mesh_along_axis(no_of_mesh_along_axis: int = 3)

Sets the number of meshes along an axis for the mapping.

Default: 3

Parameters

no_of_mesh_along_axis – The number of meshes

Returns

This PhaseDiagramOptions object

set_required_accuracy(accuracy: float = 1e-06)

Sets the required relative accuracy.

Default: 1.0E-6

Note

This is a relative accuracy, and the program requires that the relative difference in each variable must be lower than this value before it has converged. A larger value normally means fewer iterations but less accurate solutions. The value should be at least one order of magnitude larger than the machine precision.

Parameters

accuracy – The required relative accuracy

Returns

This PhaseDiagramOptions object

set_smallest_fraction(smallest_fraction: float = 1e-12)

Sets the smallest fraction for constituents that are unstable.

It is normally only in the gas phase that you can find such low fractions.

The default value for the smallest site-fractions is 1E-12 for all phases except for IDEAL phase with one sublattice site (such as the GAS mixture phase in many databases) for which the default value is always as 1E-30.

Parameters

smallest_fraction – The smallest fraction for constituents that are unstable

Returns

This PhaseDiagramOptions object

use_auto_start_points()

Switches the usage of automatic starting points for the mapping on.

Default: Switched on

Returns

This PhaseDiagramOptions object

use_inside_mesh_points()

Switches the usage of inside meshing points for the mapping off.

Default: Switched off

Returns

This PhaseDiagramOptions object

class tc_python.step_or_map_diagrams.PhaseDiagramResult(result)

Bases: tc_python.abstract_base.AbstractResult

Result of a phase diagram calculation, it can be evaluated using quantities or Console Mode syntax.

add_coordinate_for_phase_label(x: float, y: float)

Sets a coordinate in the result plot for which the stable phases will be evaluated and provided in the result data object. This can be used to plot the phases of a region into the phase diagram or just to programmatically evaluate the phases in certain regions.

Warning

This method takes coordinates of the plot axes and not of the calculation axis.

Parameters
  • x – The coordinate of the first plot axis (“x-axis”) [unit of the plot axis]

  • y – The coordinate of the second plot axis (“y-axis”) [unit of the plot axis]

Returns

This PhaseDiagramResult object

get_values_grouped_by_quantity_of(x_quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str], y_quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str])tc_python.step_or_map_diagrams.PhaseDiagramResultValues

Returns x-y-line data grouped by the multiple datasets of the specified quantities (for example in dependency of components). The available quantities can be found in the documentation of the factory class ThermodynamicQuantity. Usually the result data represents the phase diagram.

Note

The different datasets will contain NaN-values between different subsections and are not sorted (because they are unsortable due to their nature).

Note

Its possible to use functions as axis variables, either by using ThermodynamicQuantity.user_defined_function, or by using an expression that contains ‘=’.

Example get_values_grouped_by_quantity_of(‘T’, ThermodynamicQuantity.user_defined_function(‘HM.T’))

Example get_values_grouped_by_quantity_of(‘T’, ‘CP=HM.T’)

Parameters
  • x_quantity – The first quantity (“x-axis”), Console Mode syntax strings can be used as an alternative (for example ‘T’), or even a function (for example ‘f=T*1.01’)

  • y_quantity – The second quantity (“y-axis”), Console Mode syntax strings can be used as an alternative (for example ‘NV’), or even a function (for example ‘CP=HM.T’)

Returns

The phase diagram data

get_values_grouped_by_stable_phases_of(x_quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str], y_quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str])tc_python.step_or_map_diagrams.PhaseDiagramResultValues

Returns x-y-line data grouped by the sets of “stable phases” (for example “LIQUID” or “LIQUID + FCC_A1”). The available quantities can be found in the documentation of the factory class ThermodynamicQuantity. Usually the result data represents the phase diagram.

Note

The different datasets will contain NaN-values between different subsections and are not sorted (because they are unsortable due to their nature).

Note

Its possible to use functions as axis variables, either by using ThermodynamicQuantity.user_defined_function, or by using an expression that contains ‘=’.

Example get_values_grouped_by_quantity_of(‘T’, ThermodynamicQuantity.user_defined_function(‘HM.T’))

Example get_values_grouped_by_quantity_of(‘T’, ‘CP=HM.T’)

Parameters
  • x_quantity – The first quantity (“x-axis”), Console Mode syntax strings can be used as an alternative (for example ‘T’), or even a function (for example ‘f=T*1.01’)

  • y_quantity – The second quantity (“y-axis”), Console Mode syntax strings can be used as an alternative (for example ‘NV’), or even a function (for example ‘CP=HM.T’)

Returns

The phase diagram data

remove_phase_labels()

Erases all added coordinates for phase labels.

Returns

This PhaseDiagramResult object

save_to_disk(path: str)

Saves the result to disc. Note that a result is a folder, containing potentially many files. The result can later be loaded with load_result_from_disk()

Parameters

path – the path to the folder you want the result to be saved in. It can be relative or absolute.

Returns

this PhaseDiagramResult object

set_phase_name_style(phase_name_style_enum: tc_python.step_or_map_diagrams.PhaseNameStyle = <PhaseNameStyle.NONE: 0>)

Sets the style of the phase name labels that will be used in the result data object (constitution description, ordering description, …).

Default: PhaseNameStyle.NONE

Parameters

phase_name_style_enum – The phase name style

Returns

This PhaseDiagramResult object

class tc_python.step_or_map_diagrams.PhaseDiagramResultValues(phase_diagram_values_java)

Bases: object

Represents the data of a phase diagram.

get_invariants()tc_python.utils.ResultValueGroup

Returns the x- and y-datasets of all invariants in the phase diagram.

Note

The datasets will normally contain different sections separated by NaN-values.

Returns

The invariants dataset object

get_lines() → Dict[str, tc_python.utils.ResultValueGroup]

Returns the x- and y-datasets of all phase boundaries in the phase diagram.

Note

The datasets will normally contain different sections separated by NaN-values.

Returns

Containing the phase boundary datasets with the quantities or stable phases as keys (depending on the used method to get the values)

get_phase_labels() → List[tc_python.step_or_map_diagrams.PhaseLabel]

Returns the phase labels added for certain coordinates using PhaseDiagramResult.add_coordinate_for_phase_label().

Returns

The list with the phase label data (that contains plot coordinates and stable phases)

get_tie_lines()tc_python.utils.ResultValueGroup

Returns the x- and y-datasets of all tie-lines in the phase diagram.

Note

The datasets will normally contain different sections separated by NaN-values.

Returns

The tie-line dataset object

class tc_python.step_or_map_diagrams.PhaseLabel(phase_label_java)

Bases: object

Represents a phase label at a plot coordinate, i.e. the stable phases that are present at that plot coordinate.

get_text() → str

Accessor for the phase label :return: the phase label

get_x() → List[float]

Accessor for the x-value :return: the x value

get_y() → List[float]

Accessor for the y-value :return: the y value

class tc_python.step_or_map_diagrams.PhaseNameStyle(value)

Bases: enum.Enum

The style of the phase names used in the labels.

ALL = 1

Adding ordering and constitution description.

CONSTITUTION_DESCRIPTION = 3

Adding only constitution description.

NONE = 0

Only the phase names.

ORDERING_DESCRIPTION = 4

Adding only ordering description.

class tc_python.step_or_map_diagrams.PropertyDiagramCalculation(calculator)

Bases: tc_python.step_or_map_diagrams.AbstractPropertyDiagramCalculation

calculate(keep_previous_results: bool = False, timeout_in_minutes: float = 0.0)tc_python.step_or_map_diagrams.PropertyDiagramResult

Performs the property diagram calculation.

Warning

If you use keep_previous_results=True, you must not use another calculator or even get results in between the calculations using calculate(). Then the previous results will actually be lost.

Parameters
  • keep_previous_results – If True, results from any previous call to this method are appended. This can be used to combine calculations with multiple start points if the stepping fails at a certain condition.

  • timeout_in_minutes – Used to prevent the calculation from running longer than what is wanted, or from hanging. If the calculation runs longer than timeout_in_minutes, a UnrecoverableCalculationException will be thrown, the current TCPython-block will be unusable and a new TCPython block must be created for further calculations.

Returns

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

disable_global_minimization()

Disables global minimization.

Default: Enabled

Returns

This PropertyDiagramCalculation object

disable_step_separate_phases()

Disables step separate phases. This is the default setting.

Returns

This PropertyDiagramCalculation object

enable_global_minimization()

Enables global minimization.

Default: Enabled

Returns

This PropertyDiagramCalculation object

enable_step_separate_phases()

Enables step separate phases.

Default: By default separate phase stepping is disabled

Note

This is an advanced option, it is used mostly to calculate how the Gibbs energy for a number of phases varies for different compositions. This is particularly useful to calculate Gibbs energies for complex phases with miscibility gaps and for an ordered phase that is never disordered (e.g. SIGMA-phase, G-phase, MU-phase, etc.).

Returns

This PropertyDiagramCalculation object

get_components() → List[str]

Returns the names of the components in the system (including all components auto-selected by the database(s)).

Returns

The component names

get_gibbs_energy_addition_for(phase: str) → float

Used to get the additional energy term (always being a constant) of a given phase. The value given is added to the Gibbs energy of the (stoichiometric or solution) phase. It can represent a nucleation barrier, surface tension, elastic energy, etc.

It is not composition-, temperature- or pressure-dependent.

Parameters

phase – Specify the name of the (stoichiometric or solution) phase with the addition

Returns

Gibbs energy addition to G per mole formula unit.

get_system_data()tc_python.abstract_base.SystemData

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

remove_all_conditions()

Removes all set conditions.

Returns

This PropertyDiagramCalculation object

remove_condition(quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str])

Removes the specified condition.

Parameters

quantity – The thermodynamic quantity to set as condition; a Console Mode syntax string can be used as an alternative (for example X(Cr))

Returns

This PropertyDiagramCalculation object

run_poly_command(command: str)

Runs a Thermo-Calc command from the Console Mode POLY module immediately in the engine.

Parameters

command – The Thermo-Calc Console Mode command

Returns

This PropertyDiagramCalculation object

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 Thermo-Calc commands directly in the engine, it may hang the program in case of spelling mistakes (e.g. forgotten equals sign).

set_condition(quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str], value: float)

Sets the specified condition.

Parameters
  • quantity – The thermodynamic quantity to set as condition; a Console Mode syntax string can be used as an alternative (for example X(Cr))

  • value – The value of the condition

Returns

This PropertyDiagramCalculation object

set_gibbs_energy_addition_for(phase: str, gibbs_energy: float)

Used to specify the additional energy term (always being a constant) of a given phase. The value (gibbs_energy) given is added to the Gibbs energy of the (stoichiometric or solution) phase. It can represent a nucleation barrier, surface tension, elastic energy, etc.

It is not composition-, temperature- or pressure-dependent.

Parameters
  • phase – Specify the name of the (stoichiometric or solution) phase with the addition

  • gibbs_energy – Addition to G per mole formula unit

Returns

This PropertyDiagramCalculation object

set_phase_to_dormant(phase: str)

Sets the phase to the status DORMANT, necessary for calculating the driving force to form the specified phase.

Parameters

phase – The phase name or ALL_PHASES for all phases

Returns

This PropertyDiagramCalculation object

set_phase_to_entered(phase: str, amount: float = 1.0)

Sets the phase to the status ENTERED, that is the default state.

Parameters
  • phase – The phase name or ALL_PHASES for all phases

  • amount – The phase fraction (between 0.0 and 1.0)

Returns

This PropertyDiagramCalculation object

set_phase_to_fixed(phase: str, amount: float)

Sets the phase to the status FIXED, i.e. it is guaranteed to have the specified phase fraction after the calculation.

Parameters
  • phase – The phase name

  • amount – The fixed phase fraction (between 0.0 and 1.0)

Returns

This PropertyDiagramCalculation object

set_phase_to_suspended(phase: str)

Sets the phase to the status SUSPENDED, i.e. it is ignored in the calculation.

Parameters

phase – The phase name or ALL_PHASES for all phases

Returns

This PropertyDiagramCalculation object

with_axis(axis: tc_python.step_or_map_diagrams.CalculationAxis)

Sets the calculation axis.

Parameters

axis – The axis

Returns

This PropertyDiagramCalculation object

with_options(options: tc_python.step_or_map_diagrams.PropertyDiagramOptions)

Sets the simulation options.

Parameters

options – The simulation options

Returns

This PropertyDiagramCalculation object

with_reference_state(component: str, phase: str = 'SER', temperature: float = - 1.0, pressure: float = 100000.0)

The reference state for a component is important when calculating activities, chemical potentials and enthalpies and is determined by the database being used. For each component the data must be referred to a selected phase, temperature and pressure, i.e. the reference state.

All data in all phases where this component dissolves must use the same reference state. However, different databases can use different reference states for the same element/component. It is important to be careful when combining data obtained from different databases.

By default, activities, chemical potentials and so forth are computed relative to the reference state used by the database. If the reference state in the database is not suitable for your purposes, use this command to set the reference state for a component using SER, i.e. the Stable Element Reference (which is usually set as default for a major component in alloys dominated by the component). In such cases, the temperature and pressure for the reference state is not needed.

For a phase to be usable as a reference for a component, the component needs to have the same composition as an end member of the phase. The reference state is an end member of a phase. The selection of the end member associated with the reference state is only performed once this command is executed.

If a component has the same composition as several end members of the chosen reference phase, then the end member that is selected at the specified temperature and pressure will have the lowest Gibbs energy.

Parameters
  • component – The name of the element must be given.

  • phase – Name of a phase used as the new reference state. Or SER for the Stable Element Reference.

  • temperature – The Temperature (in K) for the reference state. Or CURRENT_TEMPERATURE which means that the current temperature is used at the time of evaluation of the reference energy for the calculation.

  • pressure – The Pressure (in Pa) for the reference state.

Returns

This PropertyDiagramCalculation object

with_system_modifications(system_modifications: tc_python.abstract_base.SystemModifications)

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

Returns

This PropertyDiagramCalculation object

class tc_python.step_or_map_diagrams.PropertyDiagramOptions

Bases: object

Simulation options for the property diagram calculations.

disable_approximate_driving_force_for_metastable_phases()

Disables the approximation of the driving force for metastable phases.

Default: Enabled

Note

When enabled, the metastable phases are included in all iterations. However, these may not have reached their most favorable composition and thus their driving forces may be only approximate.

If it is important that these driving forces are correct, use disable_approximate_driving_force_for_metastable_phases() to force the calculation to converge for the metastable phases.

Returns

This PropertyDiagramOptions object

disable_control_step_size_during_minimization()

Disables stepsize control during minimization (non-global).

Default: Enabled

Returns

This PropertyDiagramOptions object

disable_force_positive_definite_phase_hessian()

Disables forcing of positive definite phase Hessian. This determines how the minimum of an equilibrium state in a normal minimization procedure (non-global) is reached. For details, search the Thermo-Calc documentation for “Hessian minimization”.

Default: Enabled

Returns

This PropertyDiagramOptions object

enable_approximate_driving_force_for_metastable_phases()

Enables the approximation of the driving force for metastable phases.

Default: Enabled

Note

When enabled, the metastable phases are included in all iterations. However, these may not have reached their most favorable composition and thus their driving forces may be only approximate.

If it is important that these driving forces are correct, use disable_approximate_driving_force_for_metastable_phases() to force the calculation to converge for the metastable phases.

Returns

This PropertyDiagramOptions object

enable_control_step_size_during_minimization()

Enables stepsize control during normal minimization (non-global).

Default: Enabled

Returns

This PropertyDiagramOptions object

enable_force_positive_definite_phase_hessian()

Enables forcing of positive definite phase Hessian. This determines how the minimum of an equilibrium state in a normal minimization procedure (non-global) is reached. For details, search the Thermo-Calc documentation for “Hessian minimization”.

Default: Enabled

Returns

This PropertyDiagramOptions object

set_global_minimization_max_grid_points(max_grid_points: int = 2000)

Sets the maximum number of grid points in global minimization. Only applicable if global minimization is actually used.

Default: 2000 points

Parameters

max_grid_points – The maximum number of grid points

Returns

This PropertyDiagramOptions object

set_global_minimization_test_interval(global_test_interval: int = 0)

Sets the interval for the global test.

Default: 0

Parameters

global_test_interval – The global test interval

Returns

This PropertyDiagramOptions object

set_max_no_of_iterations(max_no_of_iterations: int = 500)

Set the maximum number of iterations.

Default: max. 500 iterations

Note

As some models give computation times of more than 1 CPU second/iteration, this number is also used to check the CPU time and the calculation stops if 500 CPU seconds/iterations are used.

Parameters

max_no_of_iterations – The max. number of iterations

Returns

This PropertyDiagramOptions object

set_required_accuracy(accuracy: float = 1e-06)

Sets the required relative accuracy.

Default: 1.0E-6

Note

This is a relative accuracy, and the program requires that the relative difference in each variable must be lower than this value before it has converged. A larger value normally means fewer iterations but less accurate solutions. The value should be at least one order of magnitude larger than the machine precision.

Parameters

accuracy – The required relative accuracy

Returns

This PropertyDiagramOptions object

set_smallest_fraction(smallest_fraction: float = 1e-12)

Sets the smallest fraction for constituents that are unstable.

It is normally only in the gas phase that you can find such low fractions.

The default value for the smallest site-fractions is 1E-12 for all phases except for IDEAL phase with one sublattice site (such as the GAS mixture phase in many databases) for which the default value is always as 1E-30.

Parameters

smallest_fraction – The smallest fraction for constituents that are unstable

Returns

This PropertyDiagramOptions object

class tc_python.step_or_map_diagrams.PropertyDiagramResult(result)

Bases: tc_python.abstract_base.AbstractResult

Result of a property diagram. This can be used to query for specific values.

get_values_grouped_by_quantity_of(x_quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str], y_quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str], sort_and_merge: bool = True) → Dict[str, tc_python.utils.ResultValueGroup]

Returns x-y-line data grouped by the multiple datasets of the specified quantities (typically the phases). The available quantities can be found in the documentation of the factory class ThermodynamicQuantity.

Note

The different datasets might contain NaN-values between different subsections and might not be sorted even if the flag `sort_and_merge` has been set (because they might be unsortable due to their nature).

Note

Its possible to use functions as axis variables, either by using ThermodynamicQuantity.user_defined_function, or by using an expression that contains ‘=’.

Example get_values_grouped_by_quantity_of(‘T’, ThermodynamicQuantity.user_defined_function(‘HM.T’))

Example get_values_grouped_by_quantity_of(‘T’, ‘CP=HM.T’)

Parameters
  • x_quantity – The first quantity (“x-axis”), Console Mode syntax strings can be used as an alternative (for example ‘T’), or even a function (for example ‘f=T*1.01’)

  • y_quantity – The second quantity (“y-axis”), Console Mode syntax strings can be used as an alternative (for example ‘NV’), or even a function (for example ‘CP=HM.T’)

  • sort_and_merge – If True, the data is sorted and merged into as few subsections as possible (divided by NaN)

Returns

Containing the datasets with the quantities as their keys

get_values_grouped_by_stable_phases_of(x_quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str], y_quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str], sort_and_merge: bool = True) → Dict[str, tc_python.utils.ResultValueGroup]

Returns x-y-line data grouped by the sets of “stable phases” (for example “LIQUID” or “LIQUID + FCC_A1”). The available quantities can be found in the documentation of the factory class ThermodynamicQuantity.

Note

The different datasets might contain NaN-values between different subsections and different lines of an ambiguous dataset. They might not be sorted even if the flag `sort_and_merge` has been set (because they might be unsortable due to their nature).

Note

Its possible to use functions as axis variables, either by using ThermodynamicQuantity.user_defined_function, or by using an expression that contains ‘=’.

Example get_values_grouped_by_quantity_of(‘T’, ThermodynamicQuantity.user_defined_function(‘HM.T’))

Example get_values_grouped_by_quantity_of(‘T’, ‘CP=HM.T’)

Parameters
  • x_quantity – The first quantity (“x-axis”), Console Mode syntax strings can be used as an alternative (for example ‘T’), or even a function (for example ‘f=T*1.01’)

  • y_quantity – The second quantity (“y-axis”), Console Mode syntax strings can be used as an alternative (for example ‘NV’), or even a function (for example ‘CP=HM.T’)

  • sort_and_merge – If True, the data will be sorted and merged into as few subsections as possible (divided by NaN)

Returns

Containing the datasets with the quantities as their keys

get_values_of(x_quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str], y_quantity: Union[tc_python.quantity_factory.ThermodynamicQuantity, str])[typing.List[float], typing.List[float]]

Returns sorted x-y-line data without any separation. Use get_values_grouped_by_quantity_of() or get_values_grouped_by_stable_phases_of() instead if you need such a separation. The available quantities can be found in the documentation of the factory class ThermodynamicQuantity.

Note

This method will always return sorted data without any NaN-values. If it is unsortable that might give data that is hard to interpret. In such a case you need to choose the quantity in another way or use one of the other methods. One example of this is to use quantities with All-markers, for example MassFractionOfAComponent(“All”).

Note

Its possible to use functions as axis variables, either by using ThermodynamicQuantity.user_defined_function, or by using an expression that contains ‘=’.

Example get_values_grouped_by_quantity_of(‘T’, ThermodynamicQuantity.user_defined_function(‘HM.T’))

Example get_values_grouped_by_quantity_of(‘T’, ‘CP=HM.T’)

Parameters
  • x_quantity – The first Thermodynamic quantity (“x-axis”), Console Mode syntax strings can be used as an alternative (for example ‘T’) or even a function (for example ‘f=T*1.01’)

  • y_quantity – The second Thermodynamic quantity (“y-axis”), Console Mode syntax strings can be used as an alternative (for example ‘NV’), or even a function (for example ‘CP=HM.T’)

Returns

A tuple containing the x- and y-data in lists

save_to_disk(path: str)

Saves the result to disc. Note that a result is a folder, containing potentially many files. The result can later be loaded with load_result_from_disk()

Parameters

path – the path to the folder you want the result to be saved in. It can be relative or absolute.

Returns

this PropertyDiagramResult object

set_phase_name_style(phase_name_style_enum: tc_python.step_or_map_diagrams.PhaseNameStyle = <PhaseNameStyle.NONE: 0>)

Sets the style of the phase name labels that will be used in the result data object (constitution description, ordering description, …).

Default: PhaseNameStyle.NONE

Parameters

phase_name_style_enum – The phase name style

Returns

This PropertyDiagramResult object