Python wrapper is more or less back in action completely. Additional testing is required.

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-08-12 16:25:33 +02:00
parent a98ef9c44a
commit e4c8d3f061
11 changed files with 170 additions and 130 deletions

View File

@@ -398,7 +398,7 @@ void SaturationSolvers::saturation_T_pure_Akasaka(HelmholtzEOSMixtureBackend *HE
SatV = HEOS->SatV;
long double rhoL,rhoV,JL,JV,KL,KV,dJL,dJV,dKL,dKV;
long double DELTA, deltaL=0, deltaV=0, tau, error, PL, PV, stepL, stepV;
long double DELTA, deltaL=0, deltaV=0, error, PL, PV, stepL, stepV;
int iter=0;
try
@@ -434,7 +434,6 @@ void SaturationSolvers::saturation_T_pure_Akasaka(HelmholtzEOSMixtureBackend *HE
deltaL = rhoL/reduce.rhomolar;
deltaV = rhoV/reduce.rhomolar;
tau = reduce.T/T;
}
catch(NotImplementedError &)
{

View File

@@ -445,6 +445,10 @@ double PropsSI(const std::string &Output, const std::string &Name1, double Prop1
}
#endif
}
std::vector<double> PropsSI(const std::string &Output, const std::string &Name1, const std::vector<double> &Prop1, const std::string &Name2, const std::vector<double> Prop2, const std::string &FluidName)
{
return PropsSI(Output, Name1, Prop1, Name2, Prop2, FluidName, std::vector<double>(1,1));
}
std::vector<double> PropsSI(const std::string &Output, const std::string &Name1, const std::vector<double> &Prop1, const std::string &Name2, const std::vector<double> Prop2, const std::string &Ref, const std::vector<double> &z)
{
std::vector<double> out(Prop1.size(), _HUGE);

View File

@@ -117,7 +117,7 @@ bool is_trivial_parameter(int key)
}
else
{
throw ValueError(format("Unable to match the key [%d] in is_trivial_parameter",key));
throw ValueError(format("Unable to match the key [%d: %s] in is_trivial_parameter",key, get_parameter_information(key, "short").c_str()));
}
}

View File

@@ -362,11 +362,9 @@ static double dC_m_dT(double T, double psi_w)
{
// dCm_dT has units of m^6/mol^2/K
double Tj,tau_Air,tau_Water,dC_dT_aaa,dC_dT_www,dC_dT_aww,dC_dT_aaw;
double Tj,dC_dT_aaa,dC_dT_www,dC_dT_aww,dC_dT_aaw;
// 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)
{
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);

View File

@@ -445,10 +445,12 @@ int main()
{
char ykey[] = "H";
double Ts, y, T2, dT = -1;
double dd0 = CoolProp::Props1SI("Tmax","n-Propane");
double dd1 = CoolProp::Props1SI("n-Propane","Tmax");
double dd = PropsSI("D","Q",0,"P",0.5e-3,"n-Propane");
shared_ptr<AbstractState> Water(AbstractState::factory("REFPROP","water"));
shared_ptr<AbstractState> Water(AbstractState::factory("HEOS","water"));
Water->update(PT_INPUTS, 101325, 0);
double ptt = Water->melting_line(iT, iP, 138.268e6);