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
This is my favourite function - the Rastrigin function.

This is my favourite function - the Rastrigin function. What sparked my curiosity and interest in the function was its complexity in terms of many local optimum points, which makes it particularly in

1 Dec 27, 2021
This project is created to visualize the system statistics such as memory usage, CPU usage, memory accessible by process and much more using Kibana Dashboard with Elasticsearch.

System Stats Visualizer This project is created to visualize the system statistics such as memory usage, CPU usage, memory accessible by process and m

Vishal Teotia 5 Feb 06, 2022
paintable GitHub contribute table

githeart paintable github contribute table how to use: Functions key color select 1,2,3,4,5 clear c drawing mode mode on turn off e print paint matrix

Bahadır Araz 27 Nov 24, 2022
3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK)

PyVista Deployment Build Status Metrics Citation License Community 3D plotting and mesh analysis through a streamlined interface for the Visualization

PyVista 1.6k Jan 08, 2023
A Scheil-Gulliver simulation tool using pycalphad.

scheil A Scheil-Gulliver simulation tool using pycalphad. import matplotlib.pyplot as plt from pycalphad import Database, variables as v from scheil i

pycalphad 6 Dec 10, 2021
Streamlit component for Let's-Plot visualization library

streamlit-letsplot This is a work-in-progress, providing a convenience function to plot charts from the Lets-Plot visualization library. Example usage

Randy Zwitch 9 Nov 03, 2022
This is a super simple visualization toolbox (script) for transformer attention visualization ✌

Trans_attention_vis This is a super simple visualization toolbox (script) for transformer attention visualization ✌ 1. How to prepare your attention m

Mingyu Wang 3 Jul 09, 2022
Data Visualization Guide for Presentations, Reports, and Dashboards

This is a highly practical and example-based guide on visually representing data in reports and dashboards.

Anton Zhiyanov 395 Dec 29, 2022
哔咔漫画window客户端,界面使用PySide2,已实现分类、搜索、收藏夹、下载、在线观看、waifu2x等功能。

picacomic-windows 哔咔漫画window客户端,界面使用PySide2,已实现分类、搜索、收藏夹、下载、在线观看等功能。 功能介绍 登陆分流,还原安卓端的三个分流入口 分类,搜索,排行,收藏夹使用同一的逻辑,滚轮下滑自动加载下一页,双击打开 漫画详情,章节列表和评论列表 下载功能,目

1.8k Dec 31, 2022
Python support for Godot 🐍🐍🐍

Godot Python, because you want Python on Godot ! The goal of this project is to provide Python language support as a scripting module for the Godot ga

Emmanuel Leblond 1.4k Jan 04, 2023
Kglab - an abstraction layer in Python for building knowledge graphs

Graph Data Science: an abstraction layer in Python for building knowledge graphs, integrated with popular graph libraries – atop Pandas, RDFlib, pySHACL, RAPIDS, NetworkX, iGraph, PyVis, pslpython, p

derwen.ai 466 Jan 09, 2023
Visualize data of Vietnam's regions with interactive maps.

Plotting Vietnam Development Map This is my personal project that I use plotly to analyse and visualize data of Vietnam's regions with interactive map

1 Jun 26, 2022
A Python library for plotting hockey rinks with Matplotlib.

Hockey Rink A Python library for plotting hockey rinks with Matplotlib. Installation pip install hockey_rink Current Rinks The following shows the cus

24 Jan 02, 2023
trade bot connected to binance API/ websocket.,, include dashboard in plotly dash to visualize trades and balances

Crypto trade bot 1. What it is Trading bot connected to Binance API. This project made for fun. So ... Do not use to trade live before you have backte

G 3 Oct 07, 2022
An automatic prover for tautologies in Metamath

completeness An automatic prover for tautologies in Metamath This program implements the constructive proof of the Completeness Theorem for propositio

Scott Fenton 2 Dec 15, 2021
Jupyter notebook and datasets from the pandas Q&A video series

Python pandas Q&A video series Read about the series, and view all of the videos on one page: Easier data analysis in Python with pandas. Jupyter Note

Kevin Markham 2k Jan 05, 2023
Scientific Visualization: Python + Matplotlib

An open access book on scientific visualization using python and matplotlib

Nicolas P. Rougier 8.6k Dec 31, 2022
Productivity Tools for Plotly + Pandas

Cufflinks This library binds the power of plotly with the flexibility of pandas for easy plotting. This library is available on https://github.com/san

Jorge Santos 2.7k Dec 30, 2022
Shaded 😎 quantile plots

shadyquant 😎 This python package allows you to quantile and plot lines where you have multiple samples, typically for visualizing uncertainty. Your d

Mehrad Ansari 13 Sep 29, 2022
The Timescale NFT Starter Kit is a step-by-step guide to get up and running with collecting, storing, analyzing and visualizing NFT data from OpenSea, using PostgreSQL and TimescaleDB.

Timescale NFT Starter Kit The Timescale NFT Starter Kit is a step-by-step guide to get up and running with collecting, storing, analyzing and visualiz

Timescale 102 Dec 24, 2022