Temporary hack to avoid NaN problems when _mp is negative (?). Discovered by Csaba
This commit is contained in:
parent
12dc71a3c0
commit
fd043ed56e
1 changed files with 1 additions and 1 deletions
|
@ -169,7 +169,7 @@ void PistonEngine::calc(float pressure, float temp, float speed)
|
||||||
// pressure change can be assumed to be adiabatic. Calculate a
|
// pressure change can be assumed to be adiabatic. Calculate a
|
||||||
// temperature change, and use that to get the density.
|
// temperature change, and use that to get the density.
|
||||||
// Note: need to model intercoolers here...
|
// 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);
|
float rho = _mp / (287.1f * T);
|
||||||
|
|
||||||
// The actual fuel flow is determined only by engine RPM and the
|
// The actual fuel flow is determined only by engine RPM and the
|
||||||
|
|
Loading…
Add table
Reference in a new issue