PC-SAFT
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/)
Metadata
Release files for pcsaft 1.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pcsaft-1.4.1.tar.gz | 117.1 kB | Details |
Built distributions (wheels)
Total release size: 21.2 MB
Release files / pcsaft-1.4.1.tar.gz
| Download URL | pcsaft-1.4.1.tar.gz |
|---|---|
| Size | 117.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
38e775a7105f74c0a406333f974f3ec22c38c8426328a35545a8eee6f91aa935
|
|
BLAKE2b-256 checksum How to use checksums |
6c38e18ec5949f6cb931fe537dd1be7934478c65bfdf15a895be7cd08ef1a4dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp39-cp39-win_amd64.whl
| Download URL | pcsaft-1.4.1-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 194.4 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cc0bcb49b9893b441f84c6ca2b0f65b2143033b63c56d0b6db45b0b00de21f11
|
|
BLAKE2b-256 checksum How to use checksums |
262f9e7abe8d437bbcc919f74a3722f32458c6c50465d72cfd6d8d8e526e88aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp39-cp39-win32.whl
| Download URL | pcsaft-1.4.1-cp39-cp39-win32.whl |
|---|---|
| Size | 164.9 kB |
| Tags | CPython 3.9 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
dbf5364a05baf901e3c99101f8dbe6286b2a7169da0388573b9315c2d36aba15
|
|
BLAKE2b-256 checksum How to use checksums |
0bbca7699e60997f0506aa5fd07ca4cc75394882f329a0a893a95973adc78afd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
| Download URL | pcsaft-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.9 Linux glibc 2.12+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
bc1b712e60f567e70fec5073867b98814dfbd9f82ac06d44b285a715c9651635
|
|
BLAKE2b-256 checksum How to use checksums |
7ff98a14d18c261544d3075827f7dce818749980c770e7ddf9e9b94d77496304
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
| Download URL | pcsaft-1.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.9 Linux glibc 2.12+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
933697be03b51ccde2e5cd895f73143c8db268c231f55ce77c76253df75a7e6a
|
|
BLAKE2b-256 checksum How to use checksums |
5c737bbdddf0b442f925058daf4a1ef917187aa0b2a1bc63f2508b5d7e19bc7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl
| Download URL | pcsaft-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl |
|---|---|
| Size | 269.7 kB |
| Tags | CPython 3.9 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
6a95ab3da1363970c147861bd04b967af8468c443fa84601aabe6bb6a79c7f2a
|
|
BLAKE2b-256 checksum How to use checksums |
7b10bcaa619e0bb893bdac2d42e5cb8dda694080153dd9db807b0e96d0ddff27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp38-cp38-win_amd64.whl
| Download URL | pcsaft-1.4.1-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 194.6 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d7b3de0d87c8cd0d0f50eff074274b37ffb679d8c17ea89fd80a3f906c1ee93b
|
|
BLAKE2b-256 checksum How to use checksums |
4f7cf28162bfe3657aa89535e77de05a679dd6121f36625285c0facdbc1e6f1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp38-cp38-win32.whl
| Download URL | pcsaft-1.4.1-cp38-cp38-win32.whl |
|---|---|
| Size | 165.2 kB |
| Tags | CPython 3.8 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
3838b9a07dea9de53609f27451132a485577aa06659551418687984efa2dc745
|
|
BLAKE2b-256 checksum How to use checksums |
29bbdaae940a68b8e53a0b3803ed7b28b53a52dfe051c1f82a120880898d9df8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
| Download URL | pcsaft-1.4.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.8 Linux glibc 2.12+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
5191e0bc4c58c9eabd550d93d3f745f01f232e921af2c3e422e8b18364e48ccb
|
|
BLAKE2b-256 checksum How to use checksums |
f26aa01d763c18db8034088f11abfac6bdaa0e6c6d317f8325d27b056ba029ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
| Download URL | pcsaft-1.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.8 Linux glibc 2.12+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
4364c5527f887f28ea73b9beb504947a5f9cae5d2e8b0241244d190d62f5d5a8
|
|
BLAKE2b-256 checksum How to use checksums |
6e19f26cc0a03b5fbdf24f8032e15ea97f4008d44deaf078707db918837b4bbe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp38-cp38-macosx_10_9_x86_64.whl
| Download URL | pcsaft-1.4.1-cp38-cp38-macosx_10_9_x86_64.whl |
|---|---|
| Size | 267.9 kB |
| Tags | CPython 3.8 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
d8c8b2a1e808863c5a6a13e0e66f61c15d42055f1355a918ba5dfd8fd6e4fba0
|
|
BLAKE2b-256 checksum How to use checksums |
bf85355e7dd43ddfaa03167c775aceca5db643c867c80ed04e14c25cf27187d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp37-cp37m-win_amd64.whl
| Download URL | pcsaft-1.4.1-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 189.7 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
34e0807fcd4e01ee92bc270e25d95fa1ce1c583874588c335856b6ffeebbbcfb
|
|
BLAKE2b-256 checksum How to use checksums |
9b525463dbaad5e1a259023a17a885a3049e2ae3bbc8131fee68134bf6928fc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp37-cp37m-win32.whl
| Download URL | pcsaft-1.4.1-cp37-cp37m-win32.whl |
|---|---|
| Size | 164.0 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
7a1babc1b133adb5ba1327e18255f7733ce91b07d0eb285729ede8b7286fdc18
|
|
BLAKE2b-256 checksum How to use checksums |
5a9c4813630f47817d7d14c3fc857514e7024f9be0f376c0f0279140895aa73f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
| Download URL | pcsaft-1.4.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
642f839d86148af48701d74fcbf6af71d24364d260c394a53dad96f8e631415a
|
|
BLAKE2b-256 checksum How to use checksums |
6db0c1d802f56e14d12d4ff822b31c7a51d0abb0b9ca8a66d2646b85539d1a58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
| Download URL | pcsaft-1.4.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
1cb0104972fa92edf6531f7bbbe1faaeea8367c809a5bb4f062e4970af15d94d
|
|
BLAKE2b-256 checksum How to use checksums |
55991b478e2ecdc1030b18f33b5336ee3baf6c51cf6b73b610a3a0fa13b247d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp37-cp37m-macosx_10_9_x86_64.whl
| Download URL | pcsaft-1.4.1-cp37-cp37m-macosx_10_9_x86_64.whl |
|---|---|
| Size | 268.6 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
f023c77579ca9d90a5b1e1b3d6a8ff7df1941ca105c042ff001a9e42f6e02a34
|
|
BLAKE2b-256 checksum How to use checksums |
6159d96e30e511d6a088a34407685199ea694552c5af890e053073886050a0d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp36-cp36m-win_amd64.whl
| Download URL | pcsaft-1.4.1-cp36-cp36m-win_amd64.whl |
|---|---|
| Size | 189.5 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
38da29fdc248997a601c8362a7d6b1a89febc748eb490e5f90ae4eb030bacbbf
|
|
BLAKE2b-256 checksum How to use checksums |
209151e7b7b91cad0194bae1e06d043328a62b847e27097262d45bec422eafc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp36-cp36m-win32.whl
| Download URL | pcsaft-1.4.1-cp36-cp36m-win32.whl |
|---|---|
| Size | 163.7 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
8af982b146502cd0af6ddeadb7679e2789101dc27104ba1064570809fa9540d5
|
|
BLAKE2b-256 checksum How to use checksums |
7ac276827386eb02ba984369dbe5ea3c6d54ba22b3db567f7929386558d7f291
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
| Download URL | pcsaft-1.4.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
c6fb55dd811e42bc3ba419914bc7c59942d866362c432b6d19e45a36422c78bb
|
|
BLAKE2b-256 checksum How to use checksums |
08ac8dbcfd0587429163d750040db35bf9fb330cc1494735fb9616a2ee83d690
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl
| Download URL | pcsaft-1.4.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-32 Linux glibc 2.5+ x86-32 |
|
SHA-256 checksum How to use checksums |
24b372d66cafffde9c20488784775117ccf7a86cf0c733147e07305df4987815
|
|
BLAKE2b-256 checksum How to use checksums |
738b8cd0bc7ab69ea0f31183d3109ca8b0b8379ac13a22b28021d164dbe2f586
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pcsaft-1.4.1-cp36-cp36m-macosx_10_9_x86_64.whl
| Download URL | pcsaft-1.4.1-cp36-cp36m-macosx_10_9_x86_64.whl |
|---|---|
| Size | 276.7 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
4b17cbfd0700fa0ad867ac4ac8ce9f64cba17e53c1c3af041157226dd4b1dc85
|
|
BLAKE2b-256 checksum How to use checksums |
c57f33328910d70e08a77c0697ef34c35a855d1fc4fb4178f5c3fa985bff418f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|