Module “entities”

class tc_python.entities.CompositionSet(phase_name: str)

Bases: object

Used by the method tc_python.system.SystemBuilder.with_new_composition_set() to enter two or more composition sets for a phase.

Parameters

phase_name – The name of the phase for which a new composition set is required

set_major_constituents_for_sublattice(sublattice_index: int, major_constituents: List[str])

Specify the new major constituent(s) for the sublattice.

Default: If not specified, a default is automatically chosen based on the specified composition set.

Note

This is useful in order to make calculations converge faster and more easily (because it may simplify giving start values when calculating the equilibrium as those phases with miscibility gaps should have different major constituents for each composition set). The databases often set major constituents for several phases automatically when the data is retrieved.

Parameters
  • sublattice_index – Index of the sublattice to set the major constituents for (starting with 1)

  • major_constituents – Optional list of the major constituents, which must be selected from the phase constitution of the current system.

Returns

This CompositionSet object

class tc_python.entities.Element(element)

Bases: object

Represents an element, making detailed information about the element accessible.

get_enthalpy() → float

Returns the enthalpy of the element at 298 K, part of the stable element reference state (SER).

Returns

The enthalpy [J]

get_entropy_diff_0_to_298k() → float

Returns the entropy difference 0 - 298 K of the element, part of the stable element reference state (SER).

Returns

The entropy difference 0 - 298 K [J/K]

get_molar_mass() → float

Returns the molar mass of the element.

Returns

The molar mass [g/mol]

get_name() → str

Returns the name of the element.

Returns

The element name

get_stable_element_reference() → str

Returns the stable element reference (i.e. the stable phase at 298.15 K and 1 bar, reference for all element thermodynamic data).

Returns

The name of the stable element reference

is_interstitial() → bool

Returns if the element is interstitial.

Note

In the diffusion simulations (DICTRA), the assumption that the volume is carried by the substitutional elements only is applied. The interstitial elements are assumed to have zero molar volumes.

Returns

If the element is interstitial

is_special() → bool

Returns if the element is special (i.e. vacancies (VA) and electrons (denoted either as /- in gaseous, liquid or solid phases, or ZE in an aqueous solution phase)).

Returns

If the element is special

is_valid() → bool

Returns if the element is valid. Non-valid elements are represented by an empty name.

Returns

If the element is valid

class tc_python.entities.Phase(phase)

Bases: object

Represents a phase, making detailed information about the phase accessible.

get_name() → str

Returns the name of the phase.

Returns

The phase name

get_species() → Set[tc_python.entities.Species]

Returns the species of the phase.

Returns

A set containing the species

get_species_for_composition_profile() → Set[tc_python.entities.Species]

Returns all species that need to be defined in a composition profile of the phase for diffusion simulations - except for one species that needs to be the dependent species.

Note

In a composition profile of a phase for diffusion simulations it is necessary to specify all non-stoichiometric and non-special species. In case of a DILUTE diffusion model, the database enforces the choice of a certain dependent species.

Returns

Set with the species

get_sublattices() → List[tc_python.entities.Sublattice]

Returns the sublattices of the phase in a well-defined contiguous order.

Returns

A list containing the Sublattice objects

get_type()tc_python.entities.PhaseType

Returns the type of the phase (liquid, ionic liquid, solid, gas).

Returns

The type of a phase

has_diffusion_data() → bool

Returns if diffusion data exists for the phase.

Returns

If diffusion data exists for the phase

has_molar_volume_data() → bool

Returns if molar volume data exists for the phase.

Returns

If molar volume data exists for the phase

is_dilute_diffusion_model() → bool

Returns if diffusion is described using the DILUTE model for the phase. This will always return False if no diffusion data is available.

Returns

If the DILUTE model is used

is_gas() → bool

Returns if the phase is a gas phase.

Returns

If the phase is a gas phase

is_ionic_liquid() → bool

Returns if the phase is an ionic liquid phase.

Returns

If the phase is an ionic liquid phase

is_liquid() → bool

Returns if the phase is a liquid or ionic liquid phase.

Returns

If the phase is a liquid phase

is_solid() → bool

Returns if the phase is a solid phase.

Returns

If the phase is a solid phase

class tc_python.entities.PhaseType(value)

Bases: enum.Enum

The type of a phase.

GAS = 0

Gas phase.

IONIC_LIQUID = 2

Ionic liquid phase.

LIQUID = 1

Liquid phase.

SOLID = 3

Solid phase.

class tc_python.entities.Species(species)

Bases: object

Represents a species, making detailed information about the species accessible.

get_all_elements() → List[Tuple[tc_python.entities.Element, float]]

Returns all the elements that the species is composed of.

Returns

List of all elements of the species and their stoichiometry

get_charge() → int

Returns the charge of the species.

Returns

The charge of the species

get_name() → str

Returns the name of the species.

Returns

The species name

is_element() → bool

Returns if the species actually represents an element.

Returns

If the species represents an element

is_interstitial() → bool

Returns if the species is interstitial.

Note

In the diffusion simulations (DICTRA), the assumption that the volume is carried by the substitutional elements only is applied. The interstitial elements are assumed to have zero molar volumes.

Returns

If the species is interstitial

is_special() → bool

Returns if the species is special (i.e. vacancies (VA) and electrons (denoted either as /- in gaseous, liquid or solid phases, or ZE in an aqueous solution phase)).

Returns

If the species is special

is_valid() → bool

Returns if the species is valid. Non-valid species are represented by an empty name.

Returns

If the species is valid

to_element()tc_python.entities.Element

Returns the Element representation of the species - if the species actually represents an element.

Returns

The Element object

class tc_python.entities.Sublattice(sublattice)

Bases: object

Represents a sublattice of a phase.

get_constituents() → Set[tc_python.entities.Species]

Returns the constituents of the sublattice.

Returns

A set containing the constituents

get_nr_of_sites() → float

Returns the number of sites in the sublattice.

Returns

A float number