mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-02-09 13:25:12 -05:00
Got Javascript wrapper working again - required changing all std::tr1::shared_ptr to shared_ptr
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
@@ -183,7 +183,7 @@ void FlashRoutines::PHSU_D_flash(HelmholtzEOSMixtureBackend &HEOS, int other)
|
||||
{
|
||||
CoolPropFluid * component = HEOS.components[0];
|
||||
|
||||
std::tr1::shared_ptr<HelmholtzEOSMixtureBackend> Sat;
|
||||
shared_ptr<HelmholtzEOSMixtureBackend> Sat;
|
||||
long double rhoLtriple = component->pEOS->rhoLtriple;
|
||||
long double rhoVtriple = component->pEOS->rhoVtriple;
|
||||
// Check if in the "normal" region
|
||||
|
||||
@@ -203,7 +203,7 @@ long double HelmholtzEOSMixtureBackend::calc_viscosity(void)
|
||||
std::string fluid_name = component.transport.viscosity_ecs.reference_fluid;
|
||||
std::vector<std::string> names(1, fluid_name);
|
||||
// Get a managed pointer to the reference fluid for ECS
|
||||
std::tr1::shared_ptr<HelmholtzEOSMixtureBackend> ref_fluid(new HelmholtzEOSMixtureBackend(names));
|
||||
shared_ptr<HelmholtzEOSMixtureBackend> ref_fluid(new HelmholtzEOSMixtureBackend(names));
|
||||
// Get the viscosity using ECS
|
||||
return TransportRoutines::viscosity_ECS(*this, *(ref_fluid.get()));
|
||||
}
|
||||
@@ -267,7 +267,7 @@ long double HelmholtzEOSMixtureBackend::calc_conductivity(void)
|
||||
std::string fluid_name = component.transport.conductivity_ecs.reference_fluid;
|
||||
std::vector<std::string> name(1, fluid_name);
|
||||
// Get a managed pointer to the reference fluid for ECS
|
||||
std::tr1::shared_ptr<HelmholtzEOSMixtureBackend> ref_fluid(new HelmholtzEOSMixtureBackend(name,false));
|
||||
shared_ptr<HelmholtzEOSMixtureBackend> ref_fluid(new HelmholtzEOSMixtureBackend(name,false));
|
||||
// Get the viscosity using ECS
|
||||
return TransportRoutines::conductivity_ECS(*this, *(ref_fluid.get()));
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
std::vector<long double> &get_K(){return K;};
|
||||
std::vector<long double> &get_lnK(){return lnK;};
|
||||
|
||||
std::tr1::shared_ptr<HelmholtzEOSMixtureBackend> SatL, SatV; ///<
|
||||
shared_ptr<HelmholtzEOSMixtureBackend> SatL, SatV; ///<
|
||||
|
||||
void update(long input_pair, double value1, double value2);
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ void SaturationSolvers::saturation_PHSU_pure(HelmholtzEOSMixtureBackend *HEOS, l
|
||||
|
||||
HEOS->calc_reducing_state();
|
||||
const SimpleState & reduce = HEOS->get_reducing();
|
||||
std::tr1::shared_ptr<HelmholtzEOSMixtureBackend> SatL = HEOS->SatL,
|
||||
SatV = HEOS->SatV;
|
||||
shared_ptr<HelmholtzEOSMixtureBackend> SatL = HEOS->SatL,
|
||||
SatV = HEOS->SatV;
|
||||
const std::vector<long double> & mole_fractions = HEOS->get_mole_fractions();
|
||||
const long double R_u = HEOS->gas_constant();
|
||||
|
||||
@@ -213,8 +213,8 @@ void SaturationSolvers::saturation_D_pure(HelmholtzEOSMixtureBackend *HEOS, long
|
||||
|
||||
HEOS->calc_reducing_state();
|
||||
const SimpleState & reduce = HEOS->get_reducing();
|
||||
std::tr1::shared_ptr<HelmholtzEOSMixtureBackend> SatL = HEOS->SatL,
|
||||
SatV = HEOS->SatV;
|
||||
shared_ptr<HelmholtzEOSMixtureBackend> SatL = HEOS->SatL,
|
||||
SatV = HEOS->SatV;
|
||||
const std::vector<long double> & mole_fractions = HEOS->get_mole_fractions();
|
||||
|
||||
long double T, rhoL,rhoV;
|
||||
@@ -379,8 +379,8 @@ void SaturationSolvers::saturation_T_pure_Akasaka(HelmholtzEOSMixtureBackend *HE
|
||||
HEOS->calc_reducing_state();
|
||||
const SimpleState & reduce = HEOS->get_reducing();
|
||||
long double R_u = HEOS->calc_gas_constant();
|
||||
std::tr1::shared_ptr<HelmholtzEOSMixtureBackend> SatL = HEOS->SatL,
|
||||
SatV = HEOS->SatV;
|
||||
shared_ptr<HelmholtzEOSMixtureBackend> SatL = HEOS->SatL,
|
||||
SatV = HEOS->SatV;
|
||||
|
||||
long double rhoL,rhoV,JL,JV,KL,KV,dJL,dJV,dKL,dKV;
|
||||
long double DELTA, deltaL=0, deltaV=0, tau=0, error, PL, PV, stepL, stepV;
|
||||
@@ -511,8 +511,8 @@ long double SaturationSolvers::successive_substitution(HelmholtzEOSMixtureBacken
|
||||
ln_phi_liq.resize(N); ln_phi_vap.resize(N); x.resize(N); y.resize(N);
|
||||
|
||||
x_and_y_from_K(beta, K, z, x, y);
|
||||
std::tr1::shared_ptr<HelmholtzEOSMixtureBackend> SatL(new HelmholtzEOSMixtureBackend(HEOS->get_components())),
|
||||
SatV(new HelmholtzEOSMixtureBackend(HEOS->get_components()));
|
||||
shared_ptr<HelmholtzEOSMixtureBackend> SatL(new HelmholtzEOSMixtureBackend(HEOS->get_components())),
|
||||
SatV(new HelmholtzEOSMixtureBackend(HEOS->get_components()));
|
||||
SatL->specify_phase(iphase_liquid);
|
||||
SatV->specify_phase(iphase_gas);
|
||||
|
||||
@@ -621,8 +621,8 @@ void SaturationSolvers::newton_raphson_VLE_GV::check_Jacobian(HelmholtzEOSMixtur
|
||||
std::size_t N = K.size();
|
||||
resize(N);
|
||||
|
||||
std::tr1::shared_ptr<HelmholtzEOSMixtureBackend> SatL(new HelmholtzEOSMixtureBackend(HEOS->get_components())),
|
||||
SatV(new HelmholtzEOSMixtureBackend(HEOS->get_components()));
|
||||
shared_ptr<HelmholtzEOSMixtureBackend> SatL(new HelmholtzEOSMixtureBackend(HEOS->get_components())),
|
||||
SatV(new HelmholtzEOSMixtureBackend(HEOS->get_components()));
|
||||
SatL->specify_phase(iphase_liquid);
|
||||
SatV->specify_phase(iphase_gas);
|
||||
|
||||
@@ -689,8 +689,8 @@ void SaturationSolvers::newton_raphson_VLE_GV::call(HelmholtzEOSMixtureBackend *
|
||||
pre_call();
|
||||
resize(K.size());
|
||||
|
||||
std::tr1::shared_ptr<HelmholtzEOSMixtureBackend> SatL(new HelmholtzEOSMixtureBackend(HEOS->get_components())),
|
||||
SatV(new HelmholtzEOSMixtureBackend(HEOS->get_components()));
|
||||
shared_ptr<HelmholtzEOSMixtureBackend> SatL(new HelmholtzEOSMixtureBackend(HEOS->get_components())),
|
||||
SatV(new HelmholtzEOSMixtureBackend(HEOS->get_components()));
|
||||
SatL->specify_phase(iphase_liquid); // So it will always just use single-phase solution
|
||||
SatV->specify_phase(iphase_gas); // So it will always just use single-phase solution
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@ double _PropsSI(const std::string &Output, const std::string &Name1, double Prop
|
||||
long iName2 = get_parameter_index(Name2);
|
||||
|
||||
// The state we are going to use
|
||||
std::tr1::shared_ptr<AbstractState> State;
|
||||
shared_ptr<AbstractState> State;
|
||||
try
|
||||
{
|
||||
// We are going to let the factory function determine which backend to use
|
||||
@@ -310,8 +310,6 @@ double _PropsSI(const std::string &Output, const std::string &Name1, double Prop
|
||||
// Generate the State class pointer using the factory function with unknown backend
|
||||
State.reset(AbstractState::factory(unknown_backend, Ref));
|
||||
|
||||
if (State == NULL){ throw ValueError("unable to instantiate AbstractState*");}
|
||||
|
||||
if (State->using_mole_fractions()){
|
||||
State->set_mole_fractions(z);
|
||||
}
|
||||
@@ -641,7 +639,7 @@ double Props1SI(std::string FluidName,std::string Output)
|
||||
//
|
||||
void set_reference_stateS(std::string Ref, std::string reference_state)
|
||||
{
|
||||
std::tr1::shared_ptr<CoolProp::HelmholtzEOSMixtureBackend> HEOS;
|
||||
shared_ptr<CoolProp::HelmholtzEOSMixtureBackend> HEOS;
|
||||
std::vector<std::string> _comps(1, Ref);
|
||||
HEOS.reset(new CoolProp::HelmholtzEOSMixtureBackend(_comps));
|
||||
|
||||
@@ -758,7 +756,7 @@ std::string get_fluid_param_string(std::string FluidName, std::string ParamName)
|
||||
{
|
||||
try{
|
||||
std::vector<std::string> comps(1,FluidName);
|
||||
std::tr1::shared_ptr<CoolProp::HelmholtzEOSMixtureBackend> HEOS(new CoolProp::HelmholtzEOSMixtureBackend(comps));
|
||||
shared_ptr<CoolProp::HelmholtzEOSMixtureBackend> HEOS(new CoolProp::HelmholtzEOSMixtureBackend(comps));
|
||||
|
||||
CoolProp::CoolPropFluid *fluid = HEOS->get_components()[0];
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <iostream>
|
||||
|
||||
|
||||
std::tr1::shared_ptr<CoolProp::AbstractState> Water, Air;
|
||||
shared_ptr<CoolProp::AbstractState> Water, Air;
|
||||
|
||||
namespace HumidAir
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ void compare_REFPROP_and_CoolProp(std::string fluid, int inputs, double val1, do
|
||||
time_t t1,t2;
|
||||
double dx = 1/((double)N);
|
||||
|
||||
std::tr1::shared_ptr<AbstractState> State(AbstractState::factory("HEOS", fluid));
|
||||
shared_ptr<AbstractState> State(AbstractState::factory("HEOS", fluid));
|
||||
t1 = clock();
|
||||
for (std::size_t ii = 0; ii < N; ++ii)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user