Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated PCSAFT.cpp to fix minor errors #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions PCSAFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#include "math.h"
#include <iostream>

const static double k_Boltzmann = 1.3806622169047228e-23;
const static double PI = 3.141592654;
const static double N_AV = 6.022e23;
const static double k_Boltzmann = 1.38064852e-23;
const static double PI = 3.14159265359;
const static double N_AV = 6.022140857e23;

/// Coefficients for one fluid
struct SAFTCoeffs{
Expand Down Expand Up @@ -103,7 +103,7 @@ class PCSAFTMixture{
}

/// Convert from molar density to total number density of molecules in mol/Angstroms^3
double rho_A3 = rhomolar*N_AV/10e30; //[molecules (not moles)/A^3]
double rho_A3 = rhomolar*N_AV/1e30; //[molecules (not moles)/A^3]

double summer = 0;
for (std::size_t i = 0; i < N; ++i){
Expand Down Expand Up @@ -136,7 +136,7 @@ class PCSAFTMixture{
double calc_p(double rhomolar, double T){

/// Convert from molar density to total number density of molecules in mol/Angstroms^3
double rho_A3 = rhomolar*N_AV/10e30; //[molecules (not moles)/A^3]
double rho_A3 = rhomolar*N_AV/1e30; //[molecules (not moles)/A^3]

double p = calc_Z(rhomolar, T)*k_Boltzmann*T*rho_A3*1e30; //[Pa]
return p;
Expand Down Expand Up @@ -249,4 +249,4 @@ int main(){
double B12 = mix.B12(1e-12, 300);
std::cout << z0 << " " << B12 << std::endl;
}
}
}