When exploring a new alloy system, a valuable exploration is to evaluate phase development and transformation at a known set of conditions. In the Taheri-Mousavi laboratory, this has been the "first step" of any new project, from diule Al-alloys to multi-principle element alloys (MPEAs), where we evaluate phases and distribution versus temperature, introduction of new elements, and changes to composition (such as along the range of compositions).
This code is intended to accelerate these explorations by offering a general script which, using a local ThermoCalc and TC-Python installation, will take an alloy, database, and set of input conditions (currently configured to be temepratures, "T", or fraction of a non-balancing element), then perform single equilibrium calculatiuons at each condition and automatically generate plots for phase fraction, composition of each phsae, and distribution of each element in phases.
The architecture of this is a custom class, "alloy_sys" with the following properties selections:
- dependent (balancing element, default: 'Al')
- composition (Dictionary containing alloying elements and initial composition in weight or mole fraction, default: {"Si":0.1,"Mg":0.0035})
- param (Axis for simulation, currently accepts temperature ("T") or an element in the composition ("Si","Mg"), default: 'T')
- param_range (Values for parameter to be varied on, equilibrium is performed at each condition, default: range(300,1300,100))
- unit (Character that describes if composition is in weight fraction ("W") or mole fraction ("X"), default: 'X')
- custom (Boolean value for if custom database or preloaded ThermoCalc database is used, default: False)
- database (If using ThermoCalc databse (custom is False) write string for databse selected, otherwise enter path to custom TDB file, default: 'TCAL9')
- suspended (List of phases to be suspended from calculation, default: None)
The class has four built-in functions:
- do_perform_single_axis_split() which performs calculation. Additional arguments are temerpature (T, default=298) and threshold (default 0.0001) - threshold is used to prevenet clutter by exlcuding phases that are at extremely small fractions, as well as only show elements that are in phase in the composition plots.
- phase_distribution() which plots the amount of phase at each composition
- composition_distribution() which creates subplots for each phase and shows composition trends
- element_distribution() which creates subplots for each element and shows which phases they are in
The three plotting functions also pass the threhsold number as an argument, as well as a list of phases to be explictely excluded from the charts.