mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-01-22 20:38:01 -05:00
@@ -56,7 +56,7 @@ std::vector<std::string> strsplit(std::string s, char del)
|
||||
iR = s.find_first_of(del,iR+1);
|
||||
// Move the iL to the right to avoid the delimiter
|
||||
iL += 1;
|
||||
if (iR == (int)std::string::npos)
|
||||
if (iR == std::string::npos)
|
||||
{
|
||||
v.push_back(s.substr(iL,N-iL));
|
||||
break;
|
||||
|
||||
@@ -362,9 +362,8 @@ static double dC_m_dT(double T, double psi_w)
|
||||
{
|
||||
// dCm_dT has units of m^6/mol^2/K
|
||||
|
||||
double Tj,dC_dT_aaa,dC_dT_www,dC_dT_aww,dC_dT_aaw;
|
||||
double dC_dT_aaa,dC_dT_www,dC_dT_aww,dC_dT_aaw;
|
||||
// NDG for fluid EOS for virial terms
|
||||
Tj=132.6312;
|
||||
if (FlagUseVirialCorrelations)
|
||||
{
|
||||
dC_dT_aaa=-2.46582342273e-10 +4.425401935447e-12*T -3.669987371644e-14*pow(T,2) +1.765891183964e-16*pow(T,3) -5.240097805744e-19*pow(T,4) +9.502177003614e-22*pow(T,5) -9.694252610339e-25*pow(T,6) +4.276261986741e-28*pow(T,7);
|
||||
@@ -423,10 +422,10 @@ double isothermal_compressibility(double T, double p)
|
||||
}
|
||||
double f_factor(double T, double p)
|
||||
{
|
||||
double f=0,Rbar=8.314371,eps=1e-8,Tj;
|
||||
double f=0,Rbar=8.314371,eps=1e-8;
|
||||
double x1=0,x2=0,x3,y1=0,y2,change=_HUGE;
|
||||
int iter=1;
|
||||
double p_ws,tau_Air,tau_Water,B_aa,B_aw,B_ww,C_aaa,C_aaw,C_aww,C_www,
|
||||
double p_ws,B_aa,B_aw,B_ww,C_aaa,C_aaw,C_aww,C_www,
|
||||
line1,line2,line3,line4,line5,line6,line7,line8,k_T,beta_H,LHS,RHS,psi_ws,
|
||||
vbar_ws;
|
||||
|
||||
@@ -457,9 +456,6 @@ double f_factor(double T, double p)
|
||||
}
|
||||
|
||||
// NDG for fluid EOS for virial terms
|
||||
Tj=132.6312;
|
||||
tau_Air=Tj/T;
|
||||
tau_Water=Water->keyed_output(CoolProp::iT_reducing)/T;
|
||||
if (FlagUseVirialCorrelations)
|
||||
{
|
||||
B_aa=-0.000721183853646 +1.142682674467e-05*T -8.838228412173e-08*pow(T,2)
|
||||
@@ -1430,11 +1426,7 @@ double HAProps_Aux(const char* Name,double T, double p, double W, char *units)
|
||||
// Requires W since it is nice and fast and always defined. Put a dummy value if you want something that doesn't use humidity
|
||||
|
||||
// Takes temperature, pressure, and humidity ratio W as inputs;
|
||||
double psi_w,Tj,tau_Water,tau_Air,B_aa,C_aaa,B_ww,C_www,B_aw,C_aaw,C_aww,v_bar;
|
||||
|
||||
Tj=132.6312;
|
||||
tau_Air=Tj/T;
|
||||
tau_Water=Water->keyed_output(CoolProp::iT_critical)/T;
|
||||
double psi_w,B_aa,C_aaa,B_ww,C_www,B_aw,C_aaw,C_aww,v_bar;
|
||||
|
||||
try{
|
||||
if (!strcmp(Name,"Baa"))
|
||||
|
||||
@@ -69,7 +69,7 @@ Eigen::MatrixXd Polynomial2D::integrateCoeffs(const Eigen::MatrixXd &coefficient
|
||||
break;
|
||||
}
|
||||
|
||||
std::size_t r, c, i, j;
|
||||
std::size_t r, c;
|
||||
for (int k = 0; k < times; k++){
|
||||
oldCoefficients = Eigen::MatrixXd(newCoefficients);
|
||||
r = oldCoefficients.rows(), c = oldCoefficients.cols();
|
||||
@@ -642,7 +642,7 @@ double Polynomial2DFrac::integral(const Eigen::MatrixXd &coefficients, const dou
|
||||
else {
|
||||
// Reduce the coefficients to the integration dimension:
|
||||
newCoefficients = Eigen::MatrixXd(r,1);
|
||||
for (int i=0; i<r; i++){
|
||||
for (std::size_t i=0; i<r; i++){
|
||||
newCoefficients(i,0) = evaluate(coefficients.row(i), other_val, other_exp, other_base);
|
||||
}
|
||||
return fracIntCentral(newCoefficients.transpose(),int_val,int_base);
|
||||
|
||||
@@ -186,11 +186,11 @@ double BoundedSecant(FuncWrapper1D* f, double x0, double xmin, double xmax, doub
|
||||
while (iter<=3 || fabs(fval)>tol)
|
||||
{
|
||||
if (iter==1){x1=x0; x=x1;}
|
||||
if (iter==2){x2=x0+dx; x=x2;}
|
||||
if (iter>2) {x=x2;}
|
||||
else if (iter==2){x2=x0+dx; x=x2;}
|
||||
else {x=x2;}
|
||||
fval=f->call(x);
|
||||
if (iter==1){y1=fval;}
|
||||
if (iter>1)
|
||||
else
|
||||
{
|
||||
y2=fval;
|
||||
x3=x2-y2/(y2-y1)*(x2-x1);
|
||||
|
||||
@@ -11,7 +11,6 @@ namespace CoolProp{
|
||||
void compare_REFPROP_and_CoolProp(std::string fluid, int inputs, double val1, double val2, std::size_t N, double d1, double d2)
|
||||
{
|
||||
time_t t1,t2;
|
||||
double dx = 1/((double)N);
|
||||
|
||||
shared_ptr<AbstractState> State(AbstractState::factory("HEOS", fluid));
|
||||
t1 = clock();
|
||||
|
||||
Reference in New Issue
Block a user