metallurgy

Alloy

class metallurgy.alloy.Alloy[source]

An alloy, a mixture of chemical elements with specific percentages.

Generation

metallurgy.analyse.find_max(...) tuple[Alloy, Number] | None[source]

Finds the maximum value of a property in an alloy system.

metallurgy.analyse.find_min(...) tuple[Alloy, Number] | None[source]

Finds the minimum value of a property in an alloy system.

metallurgy.generate.random_alloy(min_elements: int = 1, ...)[source]

Generate a random alloy.

metallurgy.generate.random_alloys(num_alloys: int, ...)[source]

Generate multiple random alloys.

metallurgy.generate.mixture(alloys: list[Alloy], ...)[source]

Mix some alloys.

metallurgy.generate.system(elements: list | str, ...)[source]

Generate a set of alloys in a particular elemental composition-space.

metallurgy.generate.binary(elements: list | str, ...)[source]

Generate a set of binary alloys in a particular elemental composition-space.

metallurgy.generate.ternary(elements: list | str, ...)[source]

Generate a set of ternary alloys.

metallurgy.generate.quaternary(elements: list | str, ...)[source]

Generate a set of quaternary alloys.

Utilities

metallurgy.write_csv(alloys: list | DataFrame, ...)[source]

Creates a CSV file of alloy data.

metallurgy.alloy.parse_composition(composition) dict[source]

Parse elemental percentages of an alloy from input

metallurgy.alloy.parse_composition_string(...) dict[source]

Parse elemental percentages of an alloy from a string

metallurgy.alloy.parse_composition_string_block(...) dict[source]

Parse a block of a composition string, found between brackets, returning a composition dictionary for that block

metallurgy.alloy.parse_composition_dict(composition: dict) dict[source]

Parse elemental percentages of an alloy from a dict

metallurgy.alloy.filter_order_composition(...) OrderedDict[source]

Filter & order elements in an alloy composition

metallurgy.alloy.parse_constraints(...) dict[source]

Parse constraint rules from input

metallurgy.alloy.donate_percentage(composition: Composition, ...)[source]

Adjusts a composition by transferring some percentage from one element (the donor) to another element (the recipient).

metallurgy.alloy.element_is_in_range(element: str, ...) bool[source]

Returns True if an element is within its constrained percentage range, False if not.

metallurgy.alloy.normal_round(num: float, ndigits: int = 0) float[source]

Rounds a float to the specified number of decimal places.

metallurgy.alloy.multiple_round(num: float, ...) float | int[source]

Round a number to the nearest multiple of another number.

metallurgy.analyse.find_unique_elements(alloys) list[str][source]

Finds the unique elements in a list of alloy compositions.

metallurgy.analyse.find_unique_percentages(alloys) dict[source]

Finds the unique percentages per element in a list of alloy compositions.

Calculations

metallurgy.calculate(...) float | None | list[float | None][source]

Returns the a particular property calculated for an alloy, using other calculation functions provided by metallurgy. The property_name must match a function name in a metallurgy module, or be suffixed with _linearmix or _deviation to denote linear mixture or deviation of an elemental property.

metallurgy.deviation(...) float | None | list[float | None][source]

Returns the deviation of a particular elemental property in an alloy.

metallurgy.linear_mixture(...) Number | None | list[Number | None][source]

Returns the linear mixture of a particular elemental property of an alloy.

metallurgy.maximum(...) Number | None | list[Number | None][source]

Returns the maximum of a particular elemental property of an alloy.

metallurgy.minimum(...) Number | None | list[Number | None][source]

Returns the minimum of a particular elemental property of an alloy.

metallurgy.range(alloy, ...) Number | None | list[Number | None][source]

Returns the range of a particular elemental property of an alloy.

Enthalpy

metallurgy.enthalpy.gamma(element_a: str, ...) Number | None[source]

Calculates the gamma term of the Miedema model. See equation 1 of: http://dx.doi.org/10.1016/j.cpc.2016.08.013

metallurgy.enthalpy.calculate_QPR(...) tuple[Number, Number, Number] | None[source]

Calculates the Q, P, and R factors of the Miedema model. See equation 1 of: http://dx.doi.org/10.1016/j.cpc.2016.08.013

metallurgy.enthalpy.calculate_electronegativity_enthalpy_component(...) Number[source]

Calculates the electronegativity contribution to the gamma factor in the Miedema model of mixing enthalpy. See equation 1 of: http://dx.doi.org/10.1016/j.cpc.2016.08.013

metallurgy.enthalpy.calculate_WS_enthalpy_component(...) Number[source]

Calculates the Wigner-Seitz radius discontinuity contribution to the gamma factor in the Miedema model of mixing enthalpy. See equation 1 of: http://dx.doi.org/10.1016/j.cpc.2016.08.013

metallurgy.enthalpy.wigner_seitz_electron_density_discontinuity_delta(...) Number[source]

Calculates the Wigner-Seitz radius discontinuity contribution to the gamma factor in the Miedema model of mixing enthalpy. See equation 1 of: http://dx.doi.org/10.1016/j.cpc.2016.08.013

metallurgy.enthalpy.calculate_surface_concentration(...) Number[source]

Calculates the surface concentration in the Miedema model of mixing enthalpy. See equation 2 of: http://dx.doi.org/10.1016/j.cpc.2016.08.013

metallurgy.enthalpy.calculate_corrected_volume(element_a: str, ...)[source]

Calculates the corrected volume of element_a in an alloy with element_b, as defined by the Meidema model. See equation 2 of: http://dx.doi.org/10.1016/j.cpc.2016.08.013

metallurgy.enthalpy.calculate_interface_enthalpy(...) Number[source]

Calculates the interfacial enthalpy term of the Miedema model. See equation 1 of: http://dx.doi.org/10.1016/j.cpc.2016.08.013

metallurgy.enthalpy.mixing_enthalpy(alloy: Alloy | str | dict)[source]

Calculates the Miedema model mixing enthalpy. See equation 15a of: http://dx.doi.org/10.1016/j.cpc.2016.08.013

metallurgy.enthalpy.mixing_Gibbs_free_energy(alloy) Number[source]

Calculates the Gibbs free energy of mixing.

metallurgy.enthalpy.topological_enthalpy(alloy)[source]

Calculates the topological enthalpy. See equation 16b of http://dx.doi.org/10.1016/j.cpc.2016.08.013

metallurgy.enthalpy.mismatch_PHS(alloy) Number[source]

Calculates the mismatch PHS factor. See https://doi.org/10.1016/j.intermet.2012.11.020.

metallurgy.enthalpy.mixing_PHS(alloy)[source]

Calculates the mixing PHS factor. See https://doi.org/10.1016/j.intermet.2012.11.020.

metallurgy.enthalpy.mixing_PHSS(alloy: Alloy | str | dict) Number[source]

Calculates the mismatch PHS factor. See https://doi.org/10.1016/j.intermet.2012.11.020.

metallurgy.enthalpy.thermodynamic_factor(alloy) Number[source]

Calculates the thermodynamic factor. See equation 11 of https://doi.org/10.1016/j.matdes.2020.108835.

Entropy

metallurgy.entropy.ideal_entropy(...) Number | None | list[Number | None][source]

Returns the ideal entropy of an alloy. See equation 4 of https://doi.org/10.1016/j.chemphys.2020.110898.

metallurgy.entropy.ideal_entropy_xia(...) Number | None | list[Number | None][source]

Returns Xia’s ideal entropy of an alloy. See equation 8 of http://dx.doi.org/10.1063/1.2345259.

metallurgy.entropy.mismatch_entropy(...) Number | None | list[Number | None][source]

Returns the mismatch entropy of an alloy. See equation 2 of https://doi.org/10.2320/matertrans1989.41.1372.

metallurgy.entropy.mixing_entropy(...) Number | None | list[Number | None][source]

Returns the mixing entropy of an alloy, combining the ideal_entropy() and mismatch_entropy().

Density

metallurgy.density.theoretical_density(...) Number | None | list[Number | None][source]

Returns the theoretical density of an alloy. See equation 8 of https://doi.org/10.1016/j.jnoncrysol.2019.03.001.

Radii

metallurgy.radii.radius_gamma(...) float | None | list[float | None][source]

Returns the radius gamma property for an alloy.

metallurgy.radii.lattice_distortion(...) float | None | list[float | None][source]

Returns the lattice distortion of an alloy.

Ratios

metallurgy.ratios.shell_valence_electron_concentration_ratio(...) Number | None | list[Number | None][source]

Returns the ratio between shell number and valence electron concentration of an alloy.

metallurgy.ratios.shell_mendeleev_number_ratio(...) Number | None | list[Number | None][source]

Returns the ratio between shell number and Mendeleev number of an alloy.

Valence

metallurgy.valence.valence_number(...) Number | None | list[Number | None][source]

Returns the number of the valence electrons which are in a particular orbital.

metallurgy.valence.valence_proportion(...) Number | None | list[Number | None][source]

Returns the proportion of the valence electrons which are in a particular orbital.

metallurgy.valence.s_valence(...) Number | None | list[Number | None][source]

Returns the proportion of the valence electrons which are in the s orbital.

metallurgy.valence.p_valence(...) Number | None | list[Number | None][source]

Returns the proportion of the valence electrons which are in the p orbital.

metallurgy.valence.d_valence(...) Number | None | list[Number | None][source]

Returns the proportion of the valence electrons which are in the d orbital.

metallurgy.valence.f_valence(...) Number | None | list[Number | None][source]

Returns the proportion of the valence electrons which are in the f orbital.

metallurgy.valence.s_valence_number(...) Number | None | list[Number | None][source]

Returns the number of valence electrons which are in the s orbital.

metallurgy.valence.p_valence_number(...) Number | None | list[Number | None][source]

Returns the number of the valence electrons which are in the p orbital.

metallurgy.valence.d_valence_number(...) Number | None | list[Number | None][source]

Returns the number of the valence electrons which are in the d orbital.

metallurgy.valence.f_valence_number(...) Number | None | list[Number | None][source]

Returns the number of the valence electrons which are in the f orbital.

Viscosity

metallurgy.viscosity.viscosity(...) Number | None | list[Number | None][source]

Returns the approximate viscosity of an alloy.

Price

metallurgy.price.price(alloy) float | None | list[float | None][source]

Returns the approximate price per kilogramme of an alloy.

Plots

metallurgy.plots.binary(alloys, data, ...)[source]

Plots an alloy property across a binary alloy composition.

metallurgy.plots.ternary(alloys, data, step=0.01, ...)[source]

Plots an alloy property across a ternary alloy composition.


Last update: Jun 08, 2023