Skip to main content

Python Chemical Thermodynamics for Process Modeling

PyPI - License PyPI - Python Version PyPI PyPI - Downloads

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

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

Metadata

Release files for PyCTPM 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyCTPM 1.0.6
File Size Uploaded Provenance Actions
PyCTPM-1.0.6.tar.gz 22.8 kB Without provenance Details for PyCTPM-1.0.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for PyCTPM 1.0.6
File Interpreter ABI Platform Actions
PyCTPM-1.0.6-py3-none-any.whl Python 3 none any Details for PyCTPM-1.0.6-py3-none-any.whl

Total release size: 50.1 kB

Release files / PyCTPM-1.0.6.tar.gz

Download URL PyCTPM-1.0.6.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
893001d702dca4814b0f1f342aee789449c1eab3d2efddbef2a73f7c00560a6d
BLAKE2b-256 checksum
How to use checksums
b4fb2f373a1f7bb3ae45a3857f1e2389142b62fd3c408bf1d9bb0f5296b634e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release files / PyCTPM-1.0.6-py3-none-any.whl

Download URL PyCTPM-1.0.6-py3-none-any.whl
Size 27.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a991a31d50cc2ea1ad0ef84ffba488bf6eecbb97d9154da8d8c523fa98801181
BLAKE2b-256 checksum
How to use checksums
a3f537cd53eb7b5d45946305dcdf99ef9d69283c903c37fb145e15d62e540311
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Security for PyCTPM 1.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page