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
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
Pydrawer: The Python package for visualizing curves and linear transformations in a super simple way

pydrawer 📐 The Python package for visualizing curves and linear transformations in a super simple way. ✏️ Installation Install pydrawer package with

Dylan Tintenfich 56 Dec 30, 2022
A way of looking at COVID-19 data that I haven't seen before.

Visualizing Omicron: COVID-19 Deaths vs. Cases Click here for other countries. Data is from Our World in Data/Johns Hopkins University. About this pro

1 Jan 10, 2022
demir.ai Dataset Operations

demir.ai Dataset Operations With this application, you can have the empty values (nan/null) deleted or filled before giving your dataset to machine le

Ahmet Furkan DEMIR 8 Nov 01, 2022
Create SVG drawings from vector geodata files (SHP, geojson, etc).

SVGIS Create SVG drawings from vector geodata files (SHP, geojson, etc). SVGIS is great for: creating small multiples, combining lots of datasets in a

Neil Freeman 78 Dec 09, 2022
Complex heatmaps are efficient to visualize associations between different sources of data sets and reveal potential patterns.

Make Complex Heatmaps Complex heatmaps are efficient to visualize associations between different sources of data sets and reveal potential patterns. H

Zuguang Gu 973 Jan 09, 2023
This tool is designed to help administrators get an overview of their Active Directory structure.

This tool is designed to help administrators get an overview of their Active Directory structure. In the group view you can see all elements of an AD (OU, USER, GROUPS, COMPUTERS etc.). In the user v

deexno 2 Oct 30, 2022
Jupyter Notebook extension leveraging pandas DataFrames by integrating DataTables and ChartJS.

Jupyter DataTables Jupyter Notebook extension to leverage pandas DataFrames by integrating DataTables JS. About Data scientists and in fact many devel

Marek Čermák 142 Dec 28, 2022
Draw datasets from within Jupyter.

drawdata This small python app allows you to draw a dataset in a jupyter notebook. This should be very useful when teaching machine learning algorithm

vincent d warmerdam 505 Nov 27, 2022
Simple Inkscape Scripting

Simple Inkscape Scripting Description In the Inkscape vector-drawing program, how would you go about drawing 100 diamonds, each with a random color an

Scott Pakin 140 Dec 27, 2022
Cartopy - a cartographic python library with matplotlib support

Cartopy is a Python package designed to make drawing maps for data analysis and visualisation easy. Table of contents Overview Get in touch License an

1.2k Jan 01, 2023
An application that allows you to design and test your own stock trading algorithms in an attempt to beat the market.

StockBot is a Python application for designing and testing your own daily stock trading algorithms. Installation Use the

Ryan Cullen 280 Dec 19, 2022
Small binja plugin to import header file to types

binja-import-header (v1.0.0) Author: matteyeux Import header file to Binary Ninja types view Description: Binary Ninja plugin to import types from C h

matteyeux 15 Dec 10, 2022
Automatically generate GitHub activity!

Commit Bot Automatically generate GitHub activity! We've all wanted to be the developer that commits every day, but that requires a lot of work. Let's

Ricky 4 Jun 07, 2022
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
Colormaps for astronomers

cmastro: colormaps for astronomers 🔭 This package contains custom colormaps that have been used in various astronomical applications, similar to cmoc

Adrian Price-Whelan 12 Oct 11, 2022
Leyna's Visualizing Data With Python

Leyna's Visualizing Data Below is information on the number of bilingual students in three school districts in Massachusetts. You will also find infor

11 Oct 28, 2021
This project is an Algorithm Visualizer where a user can visualize algorithms like Bubble Sort, Merge Sort, Quick Sort, Selection Sort, Linear Search and Binary Search.

Algo_Visualizer This project is an Algorithm Visualizer where a user can visualize common algorithms like "Bubble Sort", "Merge Sort", "Quick Sort", "

Rahul 4 Feb 07, 2022
A research of IT labor market based especially on hh.ru. Salaries, rate of technologies and etc.

hh_ru_research Проект реализован в учебных целях анализа рынка труда, в особенности по hh.ru Input data В качестве входных данных используются сериали

3 Sep 07, 2022
Python Data Validation for Humans™.

validators Python data validation for Humans. Python has all kinds of data validation tools, but every one of them seems to require defining a schema

Konsta Vesterinen 670 Jan 09, 2023