Git Product home page Git Product logo

chemics's Introduction

Chemics

Chemics is a Python package for chemistry and chemical engineering applications. It is open-source and contributions from the scientific 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 package manager.

$ pip install chemics

Usage

The example below imports the Chemics package and uses the Gas class to calculate the density and viscosity of nitrogen gas at a temperature of 773 K and pressure of 101,325 Pa.

import chemics as cm

gas = cm.Gas("N2", 773)
rho = gas.density()
mu = gas.viscosity()

print("Nitrogen gas properties at 773 K and 101,325 Pa")
print(f"density    {rho:.4f} kg/m³")
print(f"viscosity  {mu:.2f} μP")

This prints the following:

Nitrogen gas properties at 773 K and 101,325 Pa
density    0.4416 kg/m³
viscosity  363.82 μP

This example uses 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.is_balanced()
# This returns True for balanced equation

ce.rct_properties
# This 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 documentation.

Documentation

Documentation for the Chemics package is available at chemics.readthedocs.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.

chemics's People

Contributors

jan-janssen avatar janiceto avatar norvell-git avatar sheodun avatar wigging avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chemics's Issues

Move documentation to Read the Docs

Currently, the Chemics documentation is manually created with Sphinx and the generated HTML is moved to the chemics.github.io repository. This approach makes chemics.github.io the URL for the documentation.

Use Read the Docs instead of manually creating the documentation. This would make a new URL for the documentation. The old chemics.github.io URL can be used as a landing page for the project.

ValueError: Gas viscosity for NH3 is not available.

chemic_gasrho.zip
Need to update database I suppose

File /data/data/com.termux/files/usr/lib/python3.9/site-packages/chemics/gas_viscosity.py:147, in mu_gas(formula, temp, cas, full)
    144     return mu
    146 else:
--> 147     raise ValueError(f'Gas viscosity for {formula} is not available.')
ValueError: Gas viscosity for NH3 is not available.

Update README and Sphinx index page

Need to update content of the README file. Also, update the index page of the Sphinx documentation to be similar with the README on GitHub.

Change the balance attribute on ChemicalEquation to a method

As suggested in a reply on the Python Reddit, the balance attribute on the ChemicalEquation class should be a method. The current implementation is:

import chemics as cm
equation = cm.ChemicalEquation('2 HCl + 2 Na -> 2 NaCl + H2')
equation.balance

So using a method would be something like this:

import chemics as cm
equation = cm.ChemicalEquation('2 HCl + 2 Na -> 2 NaCl + H2')
equation.is_balanced()

A Cantera Example Would be Desirable

Knowing that the chemics code has been used with Cantera, it would be desirable to have an example provided for that [full folder so that anyone with cantera can run the example]. Additionally, if there are any reports / papers where the combination was used, that will be good to provide with the example [either the actual report or a link to the report].

Move fluidization code, docs, examples, and tests

Move fluidization code, tests, and documentation to the tavy package. See below for a checklist of items that need to be moved from chemics to tavy.

Code

  • bed_expansion_factor.py
  • bubble_diameter.py
  • bubble_fraction.py
  • bubble_rise_velocity.py
  • choking_velocity.py
  • devol_time.py
  • emulsion.py
  • geldart.py
  • mass_transfer_correlations.py
  • minimum_fluidization_velocity.py
  • pressure_drop.py
  • residence_time.py
  • terminal_velocity.py
  • transport_disengaging_height.py
  • transport_velocity.py

Documentation

  • bed_expansion_factor.rst
  • bubble_rise_velocity.rst
  • choking_velocity.rst
  • devol_time.rst
  • geldart.rst
  • mass_transfer_correlations.rst
  • minimum_fluidization_velocity.rst
  • pressure_drop.rst
  • terminal_velocity.rst
  • transport_disengaging_height.rst
  • transport_velocity.rst

Examples

  • bed_expansion_factor.py
  • bubble_velocity.py
  • devol_time.py
  • geldart.py
  • minimum_fluidization_velocity.py
  • rtd_cstr_vusse.ipynb
  • rtd_weibull.ipynb
  • terminal_velocity.py
  • transport_disengaging_height.py
  • transport_velocity.py
  • uch_compare.py

Tests

  • test_bed_expansion_factor.py
  • test_bubble_rise_velocity_holland.py
  • test_bubble_rise_velocity_kunii.py
  • test_devol_time.py
  • test_mass_transfer_correlations.py
  • test_minimum_fluidization_velocity.py
  • test_pressure_drop.py
  • test_terminal_velocity.py
  • test_transport_disengaging_height.py
  • test_transport_velocity.py

Updates for gas_density module

The following updates related to the rhog() function in the gas_density module are needed:

  • Update function docstring
  • Write tests
  • Add example script to chemics-example repo
  • Update Sphinx documentation
  • Update website files with new documentation

Remove from conda-forge

@jan-janssen Please remove chemics from the conda-forge repository. I'm in the process of moving chemics to my personal GitHub account where I will continue its development. Future versions will rely on pip for the installation process.

Archimedes number

Add a function to the dimensionless numbers module to calculate the Archimedes number.

Conda support

@jan-janssen Thank you for working on the conda-forge package. Can you add the recipe into the Chemics repo and update the README with instructions for installing with conda?

Question about the specific heat capacity data

HI, I would like to ask a question about the specific heat capacity data, the CAS No. of some compounds in the 4 cvs files is in date format, such as: "CH2Cl2, dichloromethane, 1975-09-02 00:00:00,...", and it should be "75-09-2". I think it may be caused by data conversion, it needs to be corrected from the original data.

JOSS

Hey! I'm submitting this fake issue per our prior conversation. If you submit this to JOSS one day, feel free to ping me (or suggest me as a reviewer directly). Would be happy to review this.

Nice work on this!

Cheers,
Andrew

Update contributing document

The CONTRIBUTING.md document needs to be updated with the following:

  • For the Flake8 style settings, ignore the E501, W503, W605 errors and warnings
  • Contributions should be made to the develop branch and not directly to the main branch

Chemics UI

Hi I stumbled upon your project and even though I'm not into chemistry it looks interesting :)

I've used a Python tool/framework called Plotly Dash for creating data-driven dashboards for several projects, so I thought your library would be a nice fit for a Dash app, here's what I've done with a couple of lines of code:

chemics-ui

let me know if you like the idea, always happy to contribute to open-source

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.