Giter Club home page Giter Club logo

phdg's Introduction

PHDG

Thermo phase diagrams with ease.
Build by Chenxing with ❤️.

Table of Contents

Introduction

Background

The phase relation business has always been tedious. Even we only consider two elements, they could have already form many compounds and each have a bound of polymorphs. When we are dealing with a real world phase system like that in the earth, it could be nothing but even more annoying. This package hopes to resolve this phase relation problem for scientists. After you have calculated Gibbs free energy for all the phases, this program will consider the possible combinations at each temperature-pressure point at a given grid, and help you build the phase diagrams.

Based on the Gibbs free energy calculated with quasi-harmonic approximation, this package serves the following purposes:

  1. Plot the given Gibbs energy pressure temperature field for all of the phases
  2. Plot fields for all the possible combinations
  3. Plot phase diagrams for a given system
  4. Plot energy difference at a given temperature and pressure range

Concepts

Here we introduces three basic abstractions for our program.

System

System is the ensemble of everything. A system comprises of several substances. Some of them could form combinations.

Combination

Combination is a combination of one or more substances. You can understand it as one side of chemical reaction equation.

Substance

The substance could be understood as one polymorph for one given chemical formula, it is the basic unit of processing. Substance instance holds the gibbs free energy.

Example

Let’s discuss these problem with the example of the buring of hydrogen in the air. Which is the following reaction equation:

In this reaction, substances are H2 (g), O2 (g) and H2O (l). However, if you would like to work on high temperature status, you would want to add in H2O (g), which is water vapour, then you should be tabulating the following four:

  • H2O (g)
  • H2O (l)
  • H2 (g)
  • O2 (g)

Then the combinations should be the following three:

  • 2 H2O (g)
  • 2 H2O (l)
  • 2 H2 (g) + O2 (g)

And all these are the hydrogen-oxygen system.

Usage

Dependencies

This package is build for Python 3 (>=3.6) with minimalism in mind. It depends only on

  • Numpy: Math library.
  • Matplotlib: Afterall, this is a package for ploting, right? :)
  • PyYAML: Parses configuration file.

You would be able to install these dependencies with

CLI interface

Get the input file ready, and just run the src/app.py script with Python:

Input file

Currently we only support YAML input file.

Example

This is an example input file as we have discussed for the hydrogen-oxygen system:

Licence

To be decided.

phdg's People

Contributors

chazeon avatar singularitti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.