mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Really fix #1091 this time...
This commit is contained in:
@@ -828,7 +828,7 @@ void set_reference_stateS(const std::string &fluid_string, const std::string &re
|
||||
}
|
||||
}
|
||||
}
|
||||
void set_reference_stateD(const std::string &Ref, double T, double rhomolar, double hmass0, double smass0)
|
||||
void set_reference_stateD(const std::string &Ref, double T, double rhomolar, double hmolar0, double smolar0)
|
||||
{
|
||||
std::vector<std::string> _comps(1, Ref);
|
||||
CoolProp::HelmholtzEOSMixtureBackend HEOS(_comps);
|
||||
@@ -836,10 +836,10 @@ void set_reference_stateD(const std::string &Ref, double T, double rhomolar, dou
|
||||
HEOS.update(DmolarT_INPUTS, rhomolar, T);
|
||||
|
||||
// Get current values for the enthalpy and entropy
|
||||
double deltah = HEOS.hmass() - hmass0; // offset from specified enthalpy in J/kg
|
||||
double deltas = HEOS.smass() - smass0; // offset from specified entropy in J/kg/K
|
||||
double delta_a1 = deltas/(HEOS.gas_constant()/HEOS.molar_mass());
|
||||
double delta_a2 = -deltah/(HEOS.gas_constant()/HEOS.molar_mass()*HEOS.get_reducing_state().T);
|
||||
double deltah = HEOS.hmolar() - hmolar0; // offset from specified enthalpy in J/mol
|
||||
double deltas = HEOS.smolar() - smolar0; // offset from specified entropy in J/mol/K
|
||||
double delta_a1 = deltas/(HEOS.gas_constant());
|
||||
double delta_a2 = -deltah/(HEOS.gas_constant()*HEOS.get_reducing_state().T);
|
||||
set_fluid_enthalpy_entropy_offset(Ref, delta_a1, delta_a2, "custom");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user