Closed ibell closed 8 years ago
Testing code:
#if 0 std::vector<std::string> names; names.push_back("n-Butane"); names.push_back("Ethane"); shared_ptr<CoolProp::AbstractState> AS(CoolProp::AbstractState::factory("HEOS", names)); std::vector<double> z(2, 0.5); AS->set_mole_fractions(z); HelmholtzEOSMixtureBackend *HEOS = static_cast<HelmholtzEOSMixtureBackend*>(AS.get()); GERG2008ReducingFunction *GERG = static_cast<GERG2008ReducingFunction*>(HEOS->Reducing.get()); double dTrdgT = GERG->dTr_dgammaT(z); double gT = AS->get_binary_interaction_double(0, 1, "gammaT"); AS->set_binary_interaction_double(0, 1, "gammaT", gT+0.0001); double Trp = AS->T_reducing(); AS->set_binary_interaction_double(0, 1, "gammaT", gT-0.0001); double Trm = AS->T_reducing(); double deriv = (Trp-Trm)/0.0002; #endif #if 1 std::vector<std::string> names; names.push_back("n-Butane"); names.push_back("Ethane"); shared_ptr<CoolProp::AbstractState> AS(CoolProp::AbstractState::factory("HEOS", names)); std::vector<double> z(2, 0.5); AS->set_mole_fractions(z); HelmholtzEOSMixtureBackend *HEOS = static_cast<HelmholtzEOSMixtureBackend*>(AS.get()); GERG2008ReducingFunction *GERG = static_cast<GERG2008ReducingFunction*>(HEOS->Reducing.get()); double dTrdgT = GERG->drhormolar_dgammaV(z); double gT = AS->get_binary_interaction_double(0, 1, "gammaV"); AS->set_binary_interaction_double(0, 1, "gammaV", gT+0.0001); double Trp = AS->rhomolar_reducing(); AS->set_binary_interaction_double(0, 1, "gammaV", gT-0.0001); double Trm = AS->rhomolar_reducing(); double deriv = (Trp-Trm)/0.0002; int rrr =0; #endif
Closed by dfb89141e66f1674e4c9d96e3159e874ef574849
Testing code: