iurisegtovich / PC-SAFT

Functions implementing the PC-SAFT equation of state, including association, electrolyte and dipole terms
GNU General Public License v3.0
0 stars 0 forks source link

pure python #4

Open iurisegtovich opened 3 years ago

iurisegtovich commented 3 years ago

last known pure python commit

commit 582549404a369d49a991b434968137245b41e148 Merge: b43bf56 e48de73 Author: Zach Baird ztbaird@gmail.com Date: Fri Mar 13 09:48:29 2020 +0200

Merge pull request #67 from zmeri/zmeri-patch-7

Zmeri patch 7
iurisegtovich commented 3 years ago

shown in the README: https://github.com/zmeri/PC-SAFT/tree/b43bf568c4dc1907316422d5c3f7b809e9725848

iurisegtovich commented 2 years ago

py version said "Residual Helmholtz energy (J mol^{-1})" calculated actually "A/RT, dimensionless"

cpp version says nothing but it is clearly still A/RT dimensionless, as seen by usage in the gres method

double pcsaft_gres_cpp(double t, double rho, vector<double> x, add_args &cppargs) {
    /**
    Calculate the residual Gibbs energy for one phase of the system.
    */
    double ares = pcsaft_ares_cpp(t, rho, x, cppargs);
    double Z = pcsaft_Z_cpp(t, rho, x, cppargs);

    double gres = (ares + (Z - 1) - log(Z))*kb*N_AV*t; // Equation A.50 from Gross and Sadowski 2001
    return gres;
}