1
0
Fork 0

Temporary hack to avoid NaN problems when _mp is negative (?). Discovered by Csaba

This commit is contained in:
fredb 2009-01-01 10:18:13 +00:00 committed by Tim Moore
parent 12dc71a3c0
commit fd043ed56e

View file

@ -169,7 +169,7 @@ void PistonEngine::calc(float pressure, float temp, float speed)
// pressure change can be assumed to be adiabatic. Calculate a
// temperature change, and use that to get the density.
// Note: need to model intercoolers here...
float T = temp * Math::pow(_mp/pressure, 2.0/7.0);
float T = temp * Math::pow((_mp*_mp)/(pressure*pressure), 1.0/7.0);
float rho = _mp / (287.1f * T);
// The actual fuel flow is determined only by engine RPM and the