1 2 #include <ThermoFun/ThermoFun.h> 3 using namespace ThermoFun; 4 main()5int main() 6 { 7 Database db; 8 9 Substance water; 10 water.setSymbol("water"); 11 water.setFormula("H2O"); 12 water.setSubstanceClass(SubstanceClass::type::AQSOLVENT); 13 water.setAggregateState(AggregateState::type::AQUEOUS); 14 water.setMethodGenEoS(MethodGenEoS_Thrift::type::CTPM_WJNR); 15 water.setMethod_T(MethodCorrT_Thrift::type::CTM_WWP); 16 water.setReferenceP(1e5); 17 water.setReferenceT(298.15); 18 19 db.addSubstance(water); 20 21 Substance OH_; 22 23 OH_.setSymbol("OH-"); 24 OH_.setFormula("OH-"); 25 OH_.setSubstanceClass(SubstanceClass::type::AQSOLUTE); 26 OH_.setAggregateState(AggregateState::type::AQUEOUS); 27 OH_.setMethodGenEoS(MethodGenEoS_Thrift::type::CTPM_HP98); 28 OH_.setReferenceP(1e5); 29 OH_.setReferenceT(298.15); 30 31 ThermoParametersSubstance params; 32 params.solute_holland_powell98_coeff = {0.0}; 33 OH_.setThermoParameters(params); 34 35 ThermoPropertiesSubstance tpsr; 36 tpsr.gibbs_energy = -157220; 37 tpsr.enthalpy = -230020; 38 tpsr.entropy = -10.71; 39 tpsr.heat_capacity_cp = -137.2; 40 tpsr.volume = -0.418; 41 42 OH_.setThermoReferenceProperties(tpsr); 43 44 db.addSubstance(OH_); 45 46 ThermoEngine engine(db); 47 engine.setSolventSymbol("water"); 48 49 double TK = 298.15; 50 double pPa = 1e5; 51 52 auto tps = engine.thermoPropertiesSubstance(TK, pPa, "OH-"); 53 54 cout <<"G0 " << tps.gibbs_energy << endl; 55 cout <<"H0 " << tps.enthalpy << endl; 56 cout <<"S0 " << tps.entropy << endl; 57 cout <<"V0 " << tps.volume << endl; 58 cout <<"Cp0 " << tps.heat_capacity_cp << endl; 59 60 //G --157220 // calc -157218 61 //H -230020 // calc -230018 62 //S -10.71 // -10.71 63 //V -0.418 // -0.418 64 //cp(0) -137.2 // -137.2 65 66 67 return 0; 68 } 69