The PC-SAFT equation of state, including dipole, association and ion terms.
Project description
Introduction
This package implements the PC-SAFT equation of state. In addition to the hard chain and dispersion terms, these functions also include dipole, association and ion terms for use with these types of compounds. When the ion term is included it is also called electrolyte PC-SAFT (ePC-SAFT).
Documentation
Documentation for the package is available on Read the Docs.
Example
import numpy as np
from pcsaft import pcsaft_den
# Toluene
x = np.asarray([1.])
m = np.asarray([2.8149])
s = np.asarray([3.7169])
e = np.asarray([285.69])
pyargs = {'m':m, 's':s, 'e':e}
t = 320 # K
p = 101325 # Pa
den = pcsaft_den(t, p, x, pyargs, phase='liq')
print('Density of toluene at {} K: {} mol m^-3'.format(t, den))
# Water using default 2B association scheme
x = np.asarray([1.])
m = np.asarray([1.2047])
e = np.asarray([353.95])
volAB = np.asarray([0.0451])
eAB = np.asarray([2425.67])
t = 274
p = 101325
s = np.asarray([2.7927 + 10.11*np.exp(-0.01775*t) - 1.417*np.exp(-0.01146*t)]) # temperature dependent sigma is used for better accuracy
pyargs = {'m':m, 's':s, 'e':e, 'e_assoc':eAB, 'vol_a':volAB}
den = pcsaft_den(t, p, x, pyargs, phase='liq')
print('Density of water at {} K: {} mol m^-3'.format(t, den))
# Water using 4C association scheme
x = np.asarray([1.])
m = np.asarray([1.2047])
e = np.asarray([353.95])
volAB = np.asarray([0.0451])
eAB = np.asarray([2425.67])
assoc_schemes = ['4c']
t = 274
p = 101325
s = np.asarray([2.7927 + 10.11*np.exp(-0.01775*t) - 1.417*np.exp(-0.01146*t)]) # temperature dependent sigma is used for better accuracy
pyargs = {'m':m, 's':s, 'e':e, 'e_assoc':eAB, 'vol_a':volAB, 'assoc_scheme':assoc_schemes}
den = pcsaft_den(t, p, x, pyargs, phase='liq')
print('Density of water at {} K: {} mol m^-3'.format(t, den))
Dependencies
The Numpy and Scipy packages are required. The core functions have been written in C++ to improve calculation speed, so Cython is needed, along with the Eigen package for linear algebra. For unit testing pytest is used.
Python package
To make it easier to use this code, it has been added as a package to PyPi (pcsaft), which means it can be installed using pip. This allows you to use the code without needing to compile the Cython code yourself. Binaries might not be available for all platforms or Python versions.
Compiling with Cython
To speed up the original Python code the core functions have been rewritten in C++. These are then connected with the remaining Python code using Cython. This gave a significant improvement in speed. The Cython code needs to be compiled before use. To do so install Cython. Then run the following command from the directory containing the PC-SAFT code
python setup.py build_ext --inplace
Make sure that the Eigen header files are somewhere on your path. More about the Cython build process can be found from the Cython documentation.
The original Python-only code has been removed from the repository. If you still want to use the original Python-only functions, go back to an earlier version of the repository. Note that the Python-only code is no longer maintained, so it may not be as reliable as the Cython code.
License
This project is licensed under the GNU General Public License v3.0
Acknowledgments
When developing these functions the code from two other groups was used as references
Code from Joachim Gross (https://www.th.bci.tu-dortmund.de/cms/de/Forschung/PC-SAFT/Download/index.html)
The MATLAB/Octave program written by Angel Martin and others (http://hpp.uva.es/open-source-software-eos/)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pcsaft-1.4.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc0bcb49b9893b441f84c6ca2b0f65b2143033b63c56d0b6db45b0b00de21f11 |
|
MD5 | 553c70e62872086312b1ec9e2cf4bc35 |
|
BLAKE2b-256 | 262f9e7abe8d437bbcc919f74a3722f32458c6c50465d72cfd6d8d8e526e88aa |
Hashes for pcsaft-1.4.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbf5364a05baf901e3c99101f8dbe6286b2a7169da0388573b9315c2d36aba15 |
|
MD5 | 7457042c4e1f1d6116ba64b8f9fcb3db |
|
BLAKE2b-256 | 0bbca7699e60997f0506aa5fd07ca4cc75394882f329a0a893a95973adc78afd |
Hashes for pcsaft-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc1b712e60f567e70fec5073867b98814dfbd9f82ac06d44b285a715c9651635 |
|
MD5 | 78d6d4712edd35681cc70ecb4b71b8db |
|
BLAKE2b-256 | 7ff98a14d18c261544d3075827f7dce818749980c770e7ddf9e9b94d77496304 |
Hashes for pcsaft-1.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 933697be03b51ccde2e5cd895f73143c8db268c231f55ce77c76253df75a7e6a |
|
MD5 | 755df4de98401c68d1edf9d11cc1d291 |
|
BLAKE2b-256 | 5c737bbdddf0b442f925058daf4a1ef917187aa0b2a1bc63f2508b5d7e19bc7b |
Hashes for pcsaft-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a95ab3da1363970c147861bd04b967af8468c443fa84601aabe6bb6a79c7f2a |
|
MD5 | 74632efaa972577f4fa87585e5b2c702 |
|
BLAKE2b-256 | 7b10bcaa619e0bb893bdac2d42e5cb8dda694080153dd9db807b0e96d0ddff27 |
Hashes for pcsaft-1.4.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7b3de0d87c8cd0d0f50eff074274b37ffb679d8c17ea89fd80a3f906c1ee93b |
|
MD5 | ef98f49246513f4d0b114d9492254667 |
|
BLAKE2b-256 | 4f7cf28162bfe3657aa89535e77de05a679dd6121f36625285c0facdbc1e6f1d |
Hashes for pcsaft-1.4.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3838b9a07dea9de53609f27451132a485577aa06659551418687984efa2dc745 |
|
MD5 | 3a09a0a5528fd1e9f350b7eb69e626a9 |
|
BLAKE2b-256 | 29bbdaae940a68b8e53a0b3803ed7b28b53a52dfe051c1f82a120880898d9df8 |
Hashes for pcsaft-1.4.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5191e0bc4c58c9eabd550d93d3f745f01f232e921af2c3e422e8b18364e48ccb |
|
MD5 | ef65d4bdc7d4a346e3ad0456ea4d7f2f |
|
BLAKE2b-256 | f26aa01d763c18db8034088f11abfac6bdaa0e6c6d317f8325d27b056ba029ee |
Hashes for pcsaft-1.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4364c5527f887f28ea73b9beb504947a5f9cae5d2e8b0241244d190d62f5d5a8 |
|
MD5 | 4aa54f250f15807fe504cae2510d5bc0 |
|
BLAKE2b-256 | 6e19f26cc0a03b5fbdf24f8032e15ea97f4008d44deaf078707db918837b4bbe |
Hashes for pcsaft-1.4.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8c8b2a1e808863c5a6a13e0e66f61c15d42055f1355a918ba5dfd8fd6e4fba0 |
|
MD5 | 54b5b964e2f502c767293481771ea924 |
|
BLAKE2b-256 | bf85355e7dd43ddfaa03167c775aceca5db643c867c80ed04e14c25cf27187d6 |
Hashes for pcsaft-1.4.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34e0807fcd4e01ee92bc270e25d95fa1ce1c583874588c335856b6ffeebbbcfb |
|
MD5 | 9805a78f9f70b91d7e9a7acebb2d0f0c |
|
BLAKE2b-256 | 9b525463dbaad5e1a259023a17a885a3049e2ae3bbc8131fee68134bf6928fc6 |
Hashes for pcsaft-1.4.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a1babc1b133adb5ba1327e18255f7733ce91b07d0eb285729ede8b7286fdc18 |
|
MD5 | 73781a87ad4568226fefaf3e4f1b15d6 |
|
BLAKE2b-256 | 5a9c4813630f47817d7d14c3fc857514e7024f9be0f376c0f0279140895aa73f |
Hashes for pcsaft-1.4.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 642f839d86148af48701d74fcbf6af71d24364d260c394a53dad96f8e631415a |
|
MD5 | 05a506e93ee3cae25203a27bbb073324 |
|
BLAKE2b-256 | 6db0c1d802f56e14d12d4ff822b31c7a51d0abb0b9ca8a66d2646b85539d1a58 |
Hashes for pcsaft-1.4.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cb0104972fa92edf6531f7bbbe1faaeea8367c809a5bb4f062e4970af15d94d |
|
MD5 | 6ca46386d3a7b4f4f5d4aa47e97a7cfd |
|
BLAKE2b-256 | 55991b478e2ecdc1030b18f33b5336ee3baf6c51cf6b73b610a3a0fa13b247d1 |
Hashes for pcsaft-1.4.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f023c77579ca9d90a5b1e1b3d6a8ff7df1941ca105c042ff001a9e42f6e02a34 |
|
MD5 | f485b137f5a26990d4af2204ee2943c4 |
|
BLAKE2b-256 | 6159d96e30e511d6a088a34407685199ea694552c5af890e053073886050a0d7 |
Hashes for pcsaft-1.4.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38da29fdc248997a601c8362a7d6b1a89febc748eb490e5f90ae4eb030bacbbf |
|
MD5 | bb03a5ebbbbf305612db7f6e08e646a0 |
|
BLAKE2b-256 | 209151e7b7b91cad0194bae1e06d043328a62b847e27097262d45bec422eafc3 |
Hashes for pcsaft-1.4.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8af982b146502cd0af6ddeadb7679e2789101dc27104ba1064570809fa9540d5 |
|
MD5 | 6760562a56756827c3a1cf8e4759f2d0 |
|
BLAKE2b-256 | 7ac276827386eb02ba984369dbe5ea3c6d54ba22b3db567f7929386558d7f291 |
Hashes for pcsaft-1.4.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6fb55dd811e42bc3ba419914bc7c59942d866362c432b6d19e45a36422c78bb |
|
MD5 | bae82f27f8d767c609fbeb206db4a3bd |
|
BLAKE2b-256 | 08ac8dbcfd0587429163d750040db35bf9fb330cc1494735fb9616a2ee83d690 |
Hashes for pcsaft-1.4.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24b372d66cafffde9c20488784775117ccf7a86cf0c733147e07305df4987815 |
|
MD5 | 852f19a97279cea9a06c62878e79c7ca |
|
BLAKE2b-256 | 738b8cd0bc7ab69ea0f31183d3109ca8b0b8379ac13a22b28021d164dbe2f586 |
Hashes for pcsaft-1.4.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b17cbfd0700fa0ad867ac4ac8ce9f64cba17e53c1c3af041157226dd4b1dc85 |
|
MD5 | 42487cf3a3b01402bebe4a064a0d0da2 |
|
BLAKE2b-256 | c57f33328910d70e08a77c0697ef34c35a855d1fc4fb4178f5c3fa985bff418f |