Coder Social home page Coder Social logo

sinagilassi / pyctpm Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 363 KB

Python Chemical Thermodynamics for Process Modeling

License: MIT License

Python 100.00%
chemical-engineering thermodynamic-properties thermodynamics process-modeling process-simulation

pyctpm's Introduction

Python Chemical Thermodynamics for Process Modeling

PyPI - License PyPI - Python Version PyPI PyPI - Downloads Open In Colab Open In Colab

::: Under Maintenance :::

Python Chemical Thermodynamics for Process Modeling (PyCTPM) is an open-source package which can be used to estimate thermodynamic properties in a typical process modeling. The current version consists of methods for estimation of gas properties as:

  1. Diffusivity coefficient (DiCo)
  2. Heat capacity at constant pressure (Cpp)
  3. Thermal conductivity (ThCo)
  4. Viscosity (Vi)

The above thermodynamic properties can be estimate for single and multi-component systems.

Note:

DiCo-MIX is the Diffusivity coefficient for a multi-component system

Example

You can also run PyCTPM on Google Colaboratory as:

  1. Example 1
  2. Example 2: mixture properties

Getting started

You can install this package

pip install PyCTPM

Documentation

PyCTPM can be initialized as follows:

1- COMPONENT SELECTION

In order to define these components: H2; CO2; H2O; CO; CH3OH; DME

this code is automatically converted to python as:

# component list
compList = ["H2","CO2","H2O","CO","CH4O","C2H6O"]

2- OTHER PROPERTIES

# Mole fraction of each component is defined as an element in a python list as:
MoFri = [0.50, 0.25, 0.0001, 0.25, 0.0001, 0.0001]

# temperature [K]
T = 523

# pressure [Pa]
P = 3500000

# model input
modelInput = {
    "components": compList,
    "MoFri": MoFri,
    "params": {
        "P": P,
        "T": T,
    },
    "unit": "SI",
    "eq": 'DEFAULT'
}

Note:

The modelInput keys, unit and eq, they should be set as above in the current version.

3- ESTIMATE PROPERTIES

# import package/module
import PyCTPM
from PyCTPM import thermo, thermoInfo, PackInfo

# version
print("PyCTPM version: ", PyCTPM.__version__)

# description
print("PyCTPM description: ", PyCTPM.__description__)

# component available in the database
PackInfo.components()

# property
PackInfo.properties()

# property list
propNameList = ["MW", "Tc", "Pc", "w", "dHf25", "dGf25"]

for i in range(len(propNameList)):
    print(thermo(propNameList[i], modelInput))

# property info
# all property info
print(thermoInfo('ALL'))

# one property
for i in range(len(propNameList)):
    print(thermoInfo(propNameList[i]))

# diffusivity coefficient of components in the mixture
res = thermo("DiCo-MIX", modelInput)
# log
print("Dij: ", res)

# heat capacity of components at desired temp [kJ/kmol.K]
res = thermo("Cpp", modelInput)
# log
print("Cpp: ", res)

# mean heat capacity of components at desired temp (Tref = 25 C) [kJ/kmol.K]
res = thermo("Cpp-MEAN", modelInput)
# log
print("Cpp-MEAN: ", res)

# mixture heat capacity of components at desired temp (Tref = 25 C) [kJ/kmol.K]
res = thermo("Cpp-MIX", modelInput)
# log
print("Cpp-MIX: ", res)

# thermal conductivity of components in the mixture [W/m.K]
res = thermo("ThCo", modelInput)
# log
print("ThCoi: ", res)

# thermal conductivity in the mixture [W/m.K]
res = thermo("ThCo-MIX", modelInput)
# log
print("ThCo-MIX: ", res)

# viscosity of components [Pa.s]
res = thermo("Vi", modelInput)
# log
print("Vi: ", res)

# viscosity mixture [Pa.s]
res = thermo("Vi-MIX", modelInput)
# log
print("Vi-MIX: ", res)

FAQ

For any question, you can contact me on LinkedIn or Twitter.

Authors

pyctpm's People

Contributors

sinagilassi avatar

Stargazers

 avatar

Watchers

 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.