A Scheil-Gulliver simulation tool using pycalphad.

Overview

scheil

A Scheil-Gulliver simulation tool using pycalphad.

import matplotlib.pyplot as plt
from pycalphad import Database, variables as v
from scheil import simulate_scheil_solidification

# setup the simulation parameters
dbf = Database('alzn_mey.tdb')
comps = ['AL', 'ZN', 'VA']
phases = sorted(dbf.phases.keys())

liquid_phase_name = 'LIQUID'
initial_composition = {v.X('ZN'): 0.3}
start_temperature = 850

# perform the simulation
sol_res = simulate_scheil_solidification(dbf, comps, phases, initial_composition, start_temperature, step_temperature=1.0)

# plot the result
for phase_name, amounts in sol_res.cum_phase_amounts.items():
    plt.plot(sol_res.temperatures, amounts, label=phase_name)
plt.plot(sol_res.temperatures, sol_res.fraction_liquid, label='LIQUID')
plt.ylabel('Phase Fraction')
plt.xlabel('Temperature (K)')
plt.title('Al-30Zn Scheil simulation, phase fractions')
plt.legend(loc='best')
plt.show()

Phase fraction evolution during a Scheil simulation of Al-30Zn

Installation

pip (recommended)

scheil is suggested to be installed from PyPI.

pip install scheil

Anaconda

conda install -c conda-forge scheil

Development versions

To install an editable development version with pip:

git clone https://github.com/pycalphad/scheil.git
cd scheil
pip install --editable .[dev]

Upgrading scheil later requires you to run git pull in this directory.

Run the automated tests using

pytest

Theory

Uses classic Scheil-Gulliver theory (see G.H. Gulliver, J. Inst. Met. 9 (1913) 120–157 and Scheil, Zeitschrift Für Met. 34 (1942) 70–72.) with assumptions of

  1. Perfect mixing in the liquid
  2. Local equilibrium between solid and liquid
  3. No diffusion in the solid

Getting Help

For help on installing and using scheil, please join the pycalphad/pycalphad Gitter room.

Bugs and software issues should be reported on GitHub.

License

scheil is MIT licensed. See LICENSE.

Citing

If you use the scheil package in your work, please cite the relevant version.

The following DOI, doi:10.5281/zenodo.3630656, will link to the latest released version of the code on Zenodo where you can cite the specific version that you haved used. For example, version 0.1.2 can be cited as:

Bocklund, Brandon, Bobbio, Lourdes D., Otis, Richard A., Beese, Allison M., & Liu, Zi-Kui. (2020, January 29). pycalphad-scheil: 0.1.2 (Version 0.1.2). Zenodo. http://doi.org/10.5281/zenodo.3630657
@software{bocklund_brandon_2020_3630657,
  author       = {Bocklund, Brandon and
                  Bobbio, Lourdes D. and
                  Otis, Richard A. and
                  Beese, Allison M. and
                  Liu, Zi-Kui},
  title        = {pycalphad-scheil: 0.1.2},
  month        = jan,
  year         = 2020,
  publisher    = {Zenodo},
  version      = {0.1.2},
  doi          = {10.5281/zenodo.3630657},
  url          = {https://doi.org/10.5281/zenodo.3630657}
}
Comments
  • Multicomponent systems stop prematurely

    Multicomponent systems stop prematurely

    Hi Brandon, I am trying to use pycalphad to simulate solidification behaviour of alloys 625 and Monel. I noticed that simulation ends at some temperature dependent on composition and temperature step, even if solidification is far from complete. I attach an extreme example for Monel, comparing temperature steps of 5K and 2K. The simulation with 2K stops prematurely. I noted a similar behavior with alloys 625, even if not so dramatic. Also changes in composition affects the end point.

    image image

    I attach the code and the database I am using, derived from mc_ni_v2.034.tdb Thank you very much for your help and all you did with pycalphad!

    MonelScheil.txt ARNi.txt

    opened by AndRicci 10
  • Error while simulating Ni-Al-Cr system

    Error while simulating Ni-Al-Cr system

    I am using a revised version of Ni-database from MatCalc. This database works with pycalphad 0.8.3. When I run scheil 0.1.1, I got error message: ALN: Sublattice frozenset({Species('N', 'N1')}) of (frozenset({Species('AL', 'AL1')}), frozenset({Species('N', 'N1')})) has no components in {Species('AL', 'AL1')}

    Any suggestion?

    opened by dpttw 2
  • `simulate_equilibrium_solidification` should do order/disorder checks automatically

    `simulate_equilibrium_solidification` should do order/disorder checks automatically

    Currently there are no checks for order/disorder phase name checking in simulate_equilibrium_solidification, so a order/disorder modeled phase that is in a disordered configuration will still show as the ordered phase name.

    The main challenge in making this change that the order/disorder check assumes a pycalphad LightDataset, rather than xarray Dataset.

    opened by bocklund 1
  • Performance pass

    Performance pass

    The code should be profiled and any optimizations made if possible and reasonable.

    For example, equilibrium(..., to_xarray=False) could be used, but the indexing into the LightDataset objects would have to be updated

    opened by bocklund 1
  • Multicomponent systems incorrectly terminate at peritectic reactions

    Multicomponent systems incorrectly terminate at peritectic reactions

    Peritectic-type reactions in the ternary go from L+A -> A+B, terminating the current Scheil algorithm. Section 12.8 in Hillert's Phase Equilibria, Phase Diagrams, and Phase Transformations (2nd Edition) may be insightful. Specifically, the idea below might be able to be used to determine when a peritectic region is found and how to update the composition of the liquid so that the liquidus can continue to be followed down the liquidus projection to a eutectic.

    screen shot 2019-01-02 at 2 02 47 pm
    opened by bocklund 1
  • ENH: improve handling for ordered phases

    ENH: improve handling for ordered phases

    Introduces an OrderingRecord object to track the relationship between ordered and disordered phases, replacing the old ordering code. The new ordering approach can be used for arbitrary equilibrium calculations and is used to fix #8.

    The logic for defining how to compare the disordered phases is currently the same as before, considering the site ratios to determine equivalent sublattices. I am deferring action on this with the issue filed in https://github.com/pycalphad/scheil/issues/23.

    opened by bocklund 0
  • ENH: use adaptive sampling by default

    ENH: use adaptive sampling by default

    • Points dictionaries are now created for the user by default if they are not provided.
    • Adaptive sampling does not do any "local" random sampling by default, it just adds the point from the solution
    • Don't use pycalphad.core.utils.generate_dof to create the dof_dict (it is deprecated)
    opened by bocklund 0
  • ENH: Build phase records instead of callables

    ENH: Build phase records instead of callables

    Uses the pycalphad API to pass PhaseRecord dictionaries to calculate and equilibrium to improve the tight-loop performance of equilibrium and Scheil solidification simulations https://github.com/pycalphad/pycalphad/pull/361.

    Building phase records can give a significant performance boost, roughly 10x to 100x speedup in some cases.

    opened by bocklund 0
  • BLD/MAINT: Modernize project metadata

    BLD/MAINT: Modernize project metadata

    • Add pyproject.toml
    • Switch to setuptools_scm instead of versioneer
    • Update installation instructions in README
    • Add automated deployment on Releases
    • Update docs theme to furo
    opened by bocklund 0
  • FIX: Fix removing disordered phase candidates

    FIX: Fix removing disordered phase candidates

    Fixes a regression introduced in #11, where filter_phases was introduced to remove phases that cannot be stable or phases where the disordered part is given as a candidate phase. The change in #11 made it so the disordered phase was not a part of the list of solid_phases that could form during the solidification simulations. With the disordered phase name not included in the solid_phases, the order_disorder_eq_phases function that renamed the ordered phases with disordered configurations to their disordered counterpart would lead to the phase amount of disordered configurations to not be saved.

    This PR fixes that and adds a parameterized test case that tests that the disordered phase always is accounted for regardless of whether or not the ordered phase is in the candidate phases or not.

    opened by bocklund 0
  • FIX: Force exit in equilibrium solidification after a successful binary search

    FIX: Force exit in equilibrium solidification after a successful binary search

    • Exit the equilibrium solidification while loop after a binary search, because the solidification must be converged then by definition (fixes a floating point precision issue where 0.999... < 1 caused the loop to be infinite on some platforms.
    • Update CI for pip version of pycalphad
    • Remove environment.yml development file
    • Drop Python 3.6
    opened by bocklund 0
  • Improve logic for deciding which sublattices are equivalent when checking ordering

    Improve logic for deciding which sublattices are equivalent when checking ordering

    Currently, sublattices in ordered (partitioned) phases are considered equivalent by symmetry if their site ratios are equal. This is a poor heuristic and will fail to determine that sublattices 0 and 1 are equivalent in an FCC_L12 phase with sublattice model [['A', 'B'], ['A', 'B'], ['VA']] with site ratios [0.25, 0.75, 3].

    Relevant for this fix will be the current heuristic in pycalphad models https://github.com/pycalphad/pycalphad/pull/311, and the changes that will occur as a result of fixing https://github.com/pycalphad/pycalphad/issues/345.

    opened by bocklund 0
Releases(0.1.6)
Owner
pycalphad
Computational Thermodynamics in Python
pycalphad
Smoking Simulation is an app to simulate the spreading of smokers and non-smokers, their interactions and population during certain amount of time.

Smoking Simulation is an app to simulate the spreading of smokers and non-smokers, their interactions and population during certain

Bohdan Ruban 5 Nov 8, 2022
Attractors is a package for simulation and visualization of strange attractors.

attractors Attractors is a package for simulation and visualization of strange attractors. Installation The simplest way to install the module is via

Vignesh M 45 Jul 31, 2022
This is a Boids Simulation, written in Python with Pygame.

PyNBoids A Python Boids Simulation This is a Boids simulation, written in Python3, with Pygame2 and NumPy. To use: Save the pynboids_sp.py file (and n

Nik 17 Dec 18, 2022
Dipto Chakrabarty 7 Sep 6, 2022
Pebble is a stat's visualization tool, this will provide a skeleton to develop a monitoring tool.

Pebble is a stat's visualization tool, this will provide a skeleton to develop a monitoring tool.

Aravind Kumar G 2 Nov 17, 2021
A tool to plot and execute Rossmos's Formula, that helps to catch serial criminals using mathematics

Rossmo Plotter A tool to plot and execute Rossmos's Formula using python, that helps to catch serial criminals using mathematics Author: Amlan Saha Ku

Amlan Saha Kundu 3 Aug 29, 2022
The open-source tool for building high-quality datasets and computer vision models

The open-source tool for building high-quality datasets and computer vision models. Website • Docs • Try it Now • Tutorials • Examples • Blog • Commun

Voxel51 2.4k Jan 7, 2023
The open-source tool for building high-quality datasets and computer vision models

The open-source tool for building high-quality datasets and computer vision models. Website • Docs • Try it Now • Tutorials • Examples • Blog • Commun

Voxel51 209 Feb 17, 2021
SummVis is an interactive visualization tool for text summarization.

SummVis is an interactive visualization tool for analyzing abstractive summarization model outputs and datasets.

Robustness Gym 246 Dec 8, 2022
erdantic is a simple tool for drawing entity relationship diagrams (ERDs) for Python data model classes

erdantic is a simple tool for drawing entity relationship diagrams (ERDs) for Python data model classes. Diagrams are rendered using the venerable Graphviz library.

DrivenData 129 Jan 4, 2023
BGraph is a tool designed to generate dependencies graphs from Android.bp soong files.

BGraph BGraph is a tool designed to generate dependencies graphs from Android.bp soong files. Overview BGraph (for Build-Graphs) is a project aimed at

Quarkslab 10 Dec 19, 2022
Yata is a fast, simple and easy Data Visulaization tool, running on python dash

Yata is a fast, simple and easy Data Visulaization tool, running on python dash. The main goal of Yata is to provide a easy way for persons with little programming knowledge to visualize their data easily.

Cybercreek 3 Jun 28, 2021
Squidpy is a tool for the analysis and visualization of spatial molecular data.

Squidpy is a tool for the analysis and visualization of spatial molecular data. It builds on top of scanpy and anndata, from which it inherits modularity and scalability. It provides analysis tools that leverages the spatial coordinates of the data, as well as tissue images if available.

Theis Lab 251 Dec 19, 2022
A simple python tool for explore your object detection dataset

A simple tool for explore your object detection dataset. The goal of this library is to provide simple and intuitive visualizations from your dataset and automatically find the best parameters for generating a specific grid of anchors that can fit you data characteristics

GRADIANT - Centro Tecnolóxico de Telecomunicacións de Galicia 142 Dec 25, 2022
Rubrix is a free and open-source tool for exploring and iterating on data for artificial intelligence projects.

Open-source tool for exploring, labeling, and monitoring data for AI projects

Recognai 1.5k Jan 7, 2023
Simple spectra visualization tool for astronomers

SpecViewer A simple visualization tool for astronomers. Dependencies Python >= 3.7.4 PyQt5 >= 5.15.4 pyqtgraph == 0.10.0 numpy >= 1.19.4 How to use py

null 5 Oct 7, 2021
A visualization tool made in Pygame for various pathfinding algorithms.

Pathfinding-Visualizer ?? A visualization tool made in Pygame for various pathfinding algorithms. Pathfinding is closely related to the shortest path

Aysha sana 7 Jul 9, 2022
A command line tool for visualizing CSV/spreadsheet-like data

PerfPlotter Read data from CSV files using pandas and generate interactive plots using bokeh, which can then be embedded into HTML pages and served by

Gino Mempin 0 Jun 25, 2022
simple tool to paint axis x and y

simple tool to paint axis x and y

G705 1 Oct 21, 2021