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
Epagneul is a tool to visualize and investigate windows event logs

epagneul Epagneul is a tool to visualize and investigate windows event logs. Dep

jurelou 190 Dec 13, 2022
Editor and Presenter for Manim Generated Content.

Editor and Presenter for Manim Generated Content. Take a look at the Working Example. More information can be found on the documentation. These Browse

Manim Community 149 Dec 29, 2022
Using SQLite within Python to create database and analyze Starcraft 2 units data (Pandas also used)

SQLite python Starcraft 2 English This project shows the usage of SQLite with python. To create, modify and communicate with the SQLite database from

1 Dec 30, 2021
Gallery of applications built using bqplot and widget libraries like ipywidgets, ipydatagrid etc.

bqplot Gallery This is a gallery of bqplot examples. View the gallery at https://bqplot.github.io/bqplot-gallery. Contributing new examples Clone this

8 Aug 23, 2022
ipyvizzu - Jupyter notebook integration of Vizzu

ipyvizzu - Jupyter notebook integration of Vizzu. Tutorial · Examples · Repository About The Project ipyvizzu is the Jupyter Notebook integration of V

Vizzu 729 Jan 08, 2023
Getting started with Python, Dash and Plot.ly for the Data Dashboards team

data_dashboards Getting started with Python, Dash and Plot.ly for the Data Dashboards team Getting started MacOS users: # Install the pyenv version ma

Department for Levelling Up, Housing and Communities 1 Nov 08, 2021
A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews

hvPlot A high-level plotting API for the PyData ecosystem built on HoloViews. Build Status Coverage Latest dev release Latest release Docs What is it?

HoloViz 694 Jan 04, 2023
Dipto Chakrabarty 7 Sep 06, 2022
cqMore is a CadQuery plugin based on CadQuery 2.1.

cqMore (under construction) cqMore is a CadQuery plugin based on CadQuery 2.1. Installation Please use conda to install CadQuery and its dependencies

Justin Lin 36 Dec 21, 2022
Automatically visualize your pandas dataframe via a single print! 📊 💡

A Python API for Intelligent Visual Discovery Lux is a Python library that facilitate fast and easy data exploration by automating the visualization a

Lux 4.3k Dec 28, 2022
Minimal Ethereum fee data viewer for the terminal, contained in a single python script.

Minimal Ethereum fee data viewer for the terminal, contained in a single python script. Connects to your node and displays some metrics in real-time.

48 Dec 05, 2022
This is Pygrr PolyArt, a program used for drawing custom Polygon models for your Pygrr project!

This is Pygrr PolyArt, a program used for drawing custom Polygon models for your Pygrr project!

Isaac 4 Dec 14, 2021
Small U-Net for vehicle detection

Small U-Net for vehicle detection Vivek Yadav, PhD Overview In this repository , we will go over using U-net for detecting vehicles in a video stream

Vivek Yadav 91 Nov 03, 2022
PyFlow is a general purpose visual scripting framework for python

PyFlow is a general purpose visual scripting framework for python. State Base structure of program implemented, such things as packages disco

1.8k Jan 07, 2023
Movies-chart - A CLI app gets the top 250 movies of all time from imdb.com and the top 100 movies from rottentomatoes.com

movies-chart This CLI app gets the top 250 movies of all time from imdb.com and

3 Feb 17, 2022
Realtime Viewer Mandelbrot set with Python and Taichi (cpu, opengl, cuda, vulkan, metal)

Mandelbrot-set-Realtime-Viewer- Realtime Viewer Mandelbrot set with Python and Taichi (cpu, opengl, cuda, vulkan, metal) Control: "WASD" - movement, "

22 Oct 31, 2022
A curated list of awesome Dash (plotly) resources

Awesome Dash A curated list of awesome Dash (plotly) resources Dash is a productive Python framework for building web applications. Written on top of

Luke Singham 1.7k Dec 26, 2022
Data aggregated from the reports found at the MCPS COVID Dashboard into a set of visualizations.

Montgomery County Public Schools COVID-19 Visualizer Contents About this project Data Support this project About this project Data All data we use can

James 3 Jan 19, 2022
Bioinformatics tool for exploring RNA-Protein interactions

Explore RNA-Protein interactions. RNPFind is a bioinformatics tool. It takes an RNA transcript as input and gives a list of RNA binding protein (RBP)

Nahin Khan 3 Jan 27, 2022
Visualization of numerical optimization algorithms

Visualization of numerical optimization algorithms

Zhengxia Zou 46 Dec 01, 2022