Fix Coverity CID 38614

This commit is contained in:
mikekaganski
2015-03-06 22:52:20 +10:00
parent 4ae7040d91
commit 725f706c6e

View File

@@ -639,7 +639,7 @@ void FlashRoutines::HSU_D_flash_twophase(HelmholtzEOSMixtureBackend &HEOS, CoolP
public:
HelmholtzEOSMixtureBackend &HEOS;
CoolPropDbl rhomolar_spec, Qd, Qo;
CoolPropDbl rhomolar_spec;
parameters other;
CoolPropDbl value;
Residual(HelmholtzEOSMixtureBackend &HEOS, CoolPropDbl rhomolar_spec, parameters other, CoolPropDbl value) : HEOS(HEOS), rhomolar_spec(rhomolar_spec), other(other), value(value){};
@@ -648,9 +648,9 @@ void FlashRoutines::HSU_D_flash_twophase(HelmholtzEOSMixtureBackend &HEOS, CoolP
HelmholtzEOSMixtureBackend &SatL = HEOS.get_SatL(),
&SatV = HEOS.get_SatV();
// Quality from density
Qd = (1/HEOS.rhomolar()-1/SatL.rhomolar())/(1/SatV.rhomolar()-1/SatL.rhomolar());
CoolPropDbl Qd = (1 / HEOS.rhomolar() - 1 / SatL.rhomolar()) / (1 / SatV.rhomolar() - 1 / SatL.rhomolar());
// Quality from other parameter (H,S,U)
Qo = (value-SatL.keyed_output(other))/(SatV.keyed_output(other)-SatL.keyed_output(other));
CoolPropDbl Qo = (value - SatL.keyed_output(other)) / (SatV.keyed_output(other) - SatL.keyed_output(other));
// Residual is the difference between the two
return Qo-Qd;
}