Merge pull request #1424 from acemod/barometricPressureFix

Fixed incorrect barometric pressure calculation
This commit is contained in:
ulteq 2015-05-29 12:40:17 +02:00
commit 1ec37aabed
4 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ _temperature = GVAR(temperature);
_barometricPressure = GVAR(barometricPressure);
_relativeHumidity = GVAR(relativeHumidity);
if (!GVAR(atmosphereModeTBH)) then {
_barometricPressure = 1013.25 * exp(-(_altitude) / 7990);
_barometricPressure = 1013.25 * (1 - (0.0065 * _altitude) / (273.15 + _temperature + 0.0065 * _altitude)) ^ 5.255754495;
_relativeHumidity = 50;
};

View File

@ -47,7 +47,7 @@ _temperature = GVAR(temperature);
_barometricPressure = GVAR(barometricPressure);
_relativeHumidity = GVAR(relativeHumidity);
if (!GVAR(atmosphereModeTBH)) then {
_barometricPressure = 1013.25 * exp(-(_altitude) / 7990);
_barometricPressure = 1013.25 * (1 - (0.0065 * _altitude) / (273.15 + _temperature + 0.0065 * _altitude)) ^ 5.255754495;
_relativeHumidity = 50;
};

View File

@ -14,4 +14,4 @@
*/
#include "script_component.hpp"
(1013.25 * exp(-(GVAR(Altitude) + _this) / 7990) - 10 * overcast)
((1013.25 - 10 * overcast) * (1 - (0.0065 * (GVAR(Altitude) + _this)) / (KELVIN(GVAR(currentTemperature)) + 0.0065 * GVAR(Altitude))) ^ 5.255754495);

View File

@ -501,7 +501,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
trueSpeed = sqrt(pow(trueVelocity[0], 2) + pow(trueVelocity[1], 2) + pow(trueVelocity[2], 2));
temperature = bulletDatabase[index].temperature - 0.0065 * position[2];
pressure = 1013.25 * exp(-(bulletDatabase[index].altitude + position[2]) / 7990) - 10 * bulletDatabase[index].overcast;
pressure = (1013.25 - 10 * bulletDatabase[index].overcast) * pow(1 - (0.0065 * (bulletDatabase[index].altitude + position[2])) / (273.15 + temperature + 0.0065 * bulletDatabase[index].altitude), 5.255754495);
if (bulletDatabase[index].ballisticCoefficients.size() == bulletDatabase[index].velocityBoundaries.size() + 1) {
dragRef = deltaT * bulletDatabase[index].airFriction * bulletSpeed * bulletSpeed;