MCPcopy Create free account
hub / github.com/CoolProp/CoolProp / set_reference_stateD

Function set_reference_stateD

src/CoolProp.cpp:1028–1040  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1026 }
1027}
1028void set_reference_stateD(const std::string& FluidName, double T, double rhomolar, double hmolar0, double smolar0) {
1029 std::vector<std::string> _comps(1, FluidName);
1030 CoolProp::HelmholtzEOSMixtureBackend HEOS(_comps);
1031
1032 HEOS.update(DmolarT_INPUTS, rhomolar, T);
1033
1034 // Get current values for the enthalpy and entropy
1035 double deltah = HEOS.hmolar() - hmolar0; // offset from specified enthalpy in J/mol
1036 double deltas = HEOS.smolar() - smolar0; // offset from specified entropy in J/mol/K
1037 double delta_a1 = deltas / (HEOS.gas_constant());
1038 double delta_a2 = -deltah / (HEOS.gas_constant() * HEOS.get_reducing_state().T);
1039 set_fluid_enthalpy_entropy_offset(FluidName, delta_a1, delta_a2, "custom");
1040}
1041
1042std::string get_global_param_string(const std::string& ParamName) {
1043 if (ParamName == "version") {

Callers 2

init_CoolPropFunction · 0.70

Calls 5

updateMethod · 0.45
hmolarMethod · 0.45
smolarMethod · 0.45
gas_constantMethod · 0.45

Tested by

no test coverage detected