Giter Site home page Giter Site logo

transformation-diagrams's Introduction

About

Collection of scripts for calculating TTT and CCT diagrams of iron-based alloys using the methods described on the paper by Li et al., 1998.

Feel free to edit the code to, for instance, automatize the generation of diagrams. transformation_models.py contains the models used for calculating the transformation diagrams. Two main classes are defined: Alloy and TransformationDiagrams. Alloy stores the information of the prior austenite grain size and composition, while TransformationDiagrams is used for plotting the TTT and CCT diagrams and phase fraction evolution for a given thermal cycle.

The repository also contains scripts for easy plotting of phase diagrams and phase fraction curves: plot_diagrams.py and plot_phase_fractions.py.

Dependencies

The python script works for python 2 (>= 2.7) and python 3 (>= 3.5). However, since support for python 2 has reached its end of life in January 2020, it is recommended to run the scripts using python 3.

The python script runs using the non standard python libraries argparse, numpy, matplotlib, pandas, and scipy. Install them from the Python Package Index:

pip3 install numpy matplotlib pandas argparse scipy --user

Usage

plot_diagrams.py:

usage: plot_diagrams.py [-h] [-g GS] [-C C] [-Si SI] [-Mn MN] [-Ni NI] [-Mo MO] 
[-Cr CR] [-V V] [-Co CO] [-Cu CU] [-Al AL] [-W W] [-Tini TINI]

Script for plotting TTT and CCT diagrams

optional arguments:
  -h, --help            show this help message and exit
  -g GS, --gs GS        Grain size
  -C C, --C C           Carbon wt.%
  -Si SI, --Si SI       Silicon wt.%
  -Mn MN, --Mn MN       Manganese wt.%
  -Ni NI, --Ni NI       Nickel wt.%
  -Mo MO, --Mo MO       Molybdenum wt.%
  -Cr CR, --Cr CR       Chromium wt.%
  -V V, --V V           Vanadium wt.%
  -Co CO, --Co CO       Cobalt wt.%
  -Cu CU, --Cu CU       Copper wt.%
  -Al AL, --Al AL       Aluminium wt.%
  -W W, --W W           Tungsten wt.%
  -Tini TINI, --Tini TINI
                        Initial continuous cooling temperature

plot_phase_fractions.py:

usage: plot_phase_fractions.py [-h] -Tini TINI -t T [-phi PHI] [-g GS] [-C C] [-Si SI] 
[-Mn MN] [-Ni NI] [-Mo MO] [-Cr CR] [-V V] [-Co CO] [-Cu CU] [-Al AL] [-W W]

Script for plotting phase fraction curves for a given thermal cycle

optional arguments:
  -h, --help            show this help message and exit
  -Tini TINI, --Tini TINI
                        Initial temperature
  -t T, --t T           Total time
  -phi PHI, --phi PHI   Cooling rate (if 0, isothermal)
  -g GS, --gs GS        Grain size
  -C C, --C C           Carbon wt.%
  -Si SI, --Si SI       Silicon wt.%
  -Mn MN, --Mn MN       Manganese wt.%
  -Ni NI, --Ni NI       Nickel wt.%
  -Mo MO, --Mo MO       Molybdenum wt.%
  -Cr CR, --Cr CR       Chromium wt.%
  -V V, --V V           Vanadium wt.%
  -Co CO, --Co CO       Cobalt wt.%
  -Cu CU, --Cu CU       Copper wt.%
  -Al AL, --Al AL       Aluminium wt.%
  -W W, --W W           Tungsten wt.%

Examples

A script with examples is available in the repository: examples.py.

Plot TTT and CCT diagrams:

python3 mucg83_python_interface.py -C 0.1 -Mn 1

This will prompt a matplotlib window with the following TTT and CCT diagrams:

Fe-1%Mn-0.1%Mn diagrams

Plot phase fraction for a thermal cycle specified by -Tini, -t, and -phi parameters:

python3 plot_phase_fractions.py -C 0.1 -Mn 1 -Tini 1000 -t 100 -phi 10

Fe-1%Mn-0.1%Mn phase fraction

transformation-diagrams's People

Contributors

arthursn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.