Merge branch 'master' into eigenPolynomials

This commit is contained in:
jowr
2014-07-14 17:01:51 +02:00
10 changed files with 61 additions and 29 deletions

View File

@@ -552,14 +552,14 @@ void REFPROPMixtureBackend::set_REFPROP_fluids(const std::vector<std::string> &f
}
else if (ierr > 0) // Error
{
if (k==0 && N > 1)
if (k==0 && N == 1)
continue; // Allow us to use PPF if a pure fluid
else
throw ValueError(format("%s",herr));
throw ValueError(format("%s", herr));
}
else // Warning
{
throw ValueError(format("%s",herr));
throw ValueError(format("%s", herr));
}
}
}

View File

@@ -1097,15 +1097,16 @@ long double ResidualHelmholtzNonAnalytic::dTau2(const long double &tau, const lo
ResidualHelmholtzNonAnalyticElement &el = elements[i];
long double ni = el.n, ai = el.a, bi = el.b, betai = el.beta;
long double Ai = el.A, Bi = el.B, Ci = el.C, Di = el.D;
long double theta=(1.0-tau)+Ai*pow(pow(delta-1.0,2),1.0/(2.0*betai));
long double DELTA=pow(theta,2)+Bi*pow(pow(delta-1.0,2),ai);
long double PSI=exp(-Ci*pow(delta-1.0,2)-Di*pow(tau-1.0,2));
long double dPSI_dTau=-2.0*Di*(tau-1.0)*PSI;
long double dDELTAbi_dTau=-2.0*theta*bi*pow(DELTA,bi-1.0);
long double dPSI2_dTau2=(2.0*Di*pow(tau-1.0,2)-1.0)*2.0*Di*PSI;
long double dDELTAbi2_dTau2=2.0*bi*pow(DELTA,bi-1.0)+4.0*pow(theta,2)*bi*(bi-1.0)*pow(DELTA,bi-2.0);
s[i] = ni*(dDELTAbi2_dTau2*PSI+2.0*dDELTAbi_dTau*dPSI_dTau+pow(DELTA,bi)*dPSI2_dTau2);
long double theta = (1.0-tau)+Ai*pow(pow(delta-1.0,2),1.0/(2.0*betai));
long double DELTA = pow(theta,2)+Bi*pow(pow(delta-1.0,2),ai);
long double PSI = exp(-Ci*pow(delta-1.0,2)-Di*pow(tau-1.0,2));
long double dPSI_dTau = -2.0*Di*(tau-1.0)*PSI;
long double dDELTAbi_dTau = -2.0*theta*bi*pow(DELTA,bi-1.0);
long double dPSI2_dTau2 = (2.0*Di*pow(tau-1.0,2)-1.0)*2.0*Di*PSI;
long double dDELTAbi2_dTau2 = 2.0*bi*pow(DELTA,bi-1.0)+4.0*pow(theta,2)*bi*(bi-1.0)*pow(DELTA,bi-2.0);
s[i] = ni*delta*(dDELTAbi2_dTau2*PSI+2.0*dDELTAbi_dTau*dPSI_dTau+pow(DELTA,bi)*dPSI2_dTau2);
}
return std::accumulate(s.begin(), s.end(), 0.0);
}

View File

@@ -164,13 +164,11 @@ vel("SF6", "T", 400, "Dmass", 1e-14, "V", 19.6796e-6, 1e-4),
vel("SF6", "T", 400, "Dmass", 278.47, "V", 24.4272e-6, 1e-4),
vel("SF6", "T", 400, "Dmass", 1123.8, "V", 84.7835e-6, 1e-4),
// Vogel, JCED, 2011
vel("H2S", "T", 405.76, "Dmass", 0.740, "V", 15.56e-6, 1e-2),
// Quinones-Cisneros, JCED, 2012
vel("H2S", "T", 373.15, "P", 1e6, "V", 15.9e-6, 1e-3),
vel("H2S", "T", 373.15, "P", 10e6, "V", 48.3e-6, 1e-3),
vel("H2S", "T", 423.15, "P", 1e6, "V", 16.5e-6, 1e-3),
vel("H2S", "T", 423.15, "P", 10e6, "V", 21.2e-6, 1e-3),
// Quinones-Cisneros, JCED, 2012, data from validation
vel("H2S", "T", 200, "P", 1000e5, "V", 0.000460287, 1e-3),
vel("H2S", "T", 200, "P", 0.251702e5, "V", 8.02322E-06, 1e-3),
vel("H2S", "T", 596.961, "P", 1000e5, "V", 6.94741E-05, 1e-3),
vel("H2S", "T", 596.961, "P", 1e5, "V", 2.38654E-05, 1e-3),
// Geller, Purdue Conference, 2000
//vel("R410A", "T", 243.15, "Q", 0, "V", 238.61e-6, 5e-2),

View File

@@ -53,13 +53,34 @@ void generate_melting_curve_data(const char* file_name, const char *fluid_name,
fclose(fp);
}
struct element
{
double d,t,ld;
int l;
};
{
double d,t,ld;
int l;
};
int main()
{
if (1){
shared_ptr<CoolProp::AbstractState> AS(AbstractState::factory("INCOMP","ExamplePure"));
AS->update(CoolProp::PT_INPUTS, 101325, 373);
double mu = AS->conductivity();
int rr =0;
}
// if (1)
// {
// std::string s = get_csv_parameter_list();
// std::vector<std::string> keys = strsplit(s,',');
// for (std::vector<std::string>::iterator it = keys.begin(); it != keys.end(); ++it){
// std::string pp = (*it);
// int key = CoolProp::get_parameter_index((*it));
// std::string IO = get_parameter_information(key, "IO");
// std::string units = get_parameter_information(key, "units");
// std::string longg = get_parameter_information(key, "long");
// std::cout << format("%s\t%s\t%s\t%s",(*it).c_str(), IO.c_str(), units.c_str(), longg.c_str()) << std::endl;
// }
// std::cout << s << std::endl;
// int rr =0;
// }
set_debug_level(1);
@@ -322,7 +343,6 @@ int main()
double tt = 0;
}
if (0)
{
#ifdef ENABLE_CATCH