Giter Site home page Giter Site logo

chemics's Introduction

Chemics

The Chemics package is a collection of Python functions for performing calculations in the field of chemical and fluidization engineering. Source code for the package is available on GitHub and contributions from the community are encouraged.

Installation

If you don't have Python installed on your computer, the Anaconda or Miniconda distribution of Python is recommended for scientific computing. After setting up Python, the Chemics package can be downloaded and installed using the pip or conda package managers.

Install Chemics using the pip package manager:

$ pip install chemics

Install Chemics using the conda package manager:

$ conda config --add channels conda-forge
$ conda install chemics

Usage

The example below imports the Chemics package then uses the rhog() function to calculate the density of a gas based on its molecular weight, pressure, and temperature.

import chemics as cm
cm.rhog(28, 101325, 773)    # returns 0.4414

The ut() function calculates the terminal velocity of a particle according to the Haider and Levenspiel 1989 paper as shown below.

import chemics as cm

# Parameters
dp = 0.00016    # particle diameter [m]
mu = 1.8e-5     # gas viscosity [kg/(m s)]
phi = 0.67      # particle sphericity [-]
rhog = 1.2      # gas density [kg/m^3]
rhos = 2600     # particle density [kg/m^3]

# Haider and Levenspiel terminal velocity [m/s]
# this assigns a value of 0.8857 to `ut_haider`
ut_haider = cm.ut_haider(dp, mu, phi, rhog, rhos)

Use the ChemicalEquation class to get properties of the reactants and products from a given chemical equation.

import chemics as cm

ce = cm.ChemicalEquation('2 HCl + 2 Na -> 2 NaCl + H2')

ce.balance
# returns True for balanced equation

ce.rct_properties
# returns a dataframe of the reactant properties
#                HCl        Na
# moles            2         2
# species        HCl        Na
# molwt       36.458     22.99
# mass        72.916     45.98
# molfrac        0.5       0.5
# massfrac  0.613275  0.386725

More examples are available in the chemics-examples repository.

Documentation

Documentation for the Chemics package is available at chemics.github.io.

Contributing

See the CONTRIBUTING.md document for guidelines on contributing to the Chemics package.

License

Chemics is available under the MIT License - see the LICENSE file for more information.

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.