Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AB water vapor pressure calc #4956

Merged
merged 5 commits into from
May 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified ace_advanced_ballistics.dll
Binary file not shown.
Binary file modified ace_advanced_ballistics_x64.dll
Binary file not shown.
3 changes: 2 additions & 1 deletion addons/weather/functions/fnc_calculateAirDensity.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ _pressure = _pressure * 100; // hPa to Pa

if (_relativeHumidity > 0) then {
// Saturation vapor pressure calculated according to: http://wahiduddin.net/calc/density_algorithms.htm
private _pSat = 6.1078 * 10 ^ ((7.5 * _temperature) / (_temperature + 237.3));
// 610.78 gives pressure in Pa - https://en.wikipedia.org/wiki/Density_of_air
private _pSat = 610.78 * 10 ^ ((7.5 * _temperature) / (_temperature + 237.3));
private _vaporPressure = _relativeHumidity * _pSat;
private _partialPressure = _pressure - _vaporPressure;

Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/development/extension-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ order: 9

```
cd extensions\build
cmake .. -G "Visual Studio 14 2015"
cmake .. -G "Visual Studio 15 2017 Win64"
```

A Visual studio project file will now be generated in your build directory.
Expand Down
2 changes: 1 addition & 1 deletion extensions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ endif()

string(TIMESTAMP ACE_BUILDSTAMP "%Y-%m-%dT%H:%M:%SZ")
set(ACE_VERSION_MAJOR 3)
set(ACE_VERSION_MINOR 6)
set(ACE_VERSION_MINOR 10)
set(ACE_VERSION_REVISION 0)
EXECUTE_PROCESS(COMMAND git rev-parse --verify HEAD
OUTPUT_VARIABLE T_ACE_VERSION_BUILD
Expand Down
11 changes: 9 additions & 2 deletions extensions/advanced_ballistics/AdvancedBallistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ double calculateAirDensity(double temperature, double pressure, double relativeH
pressure = pressure * 100;

if (relativeHumidity > 0) {
double _pSat = 6.1078 * pow(10, ((7.5 * temperature) / (temperature + 237.3)));
// 610.78 gives pressure in Pa - https://en.wikipedia.org/wiki/Density_of_air
double _pSat = 610.78 * pow(10, ((7.5 * temperature) / (temperature + 237.3)));
double vaporPressure = relativeHumidity * _pSat;
double partialPressure = pressure - vaporPressure;

Expand Down Expand Up @@ -338,7 +339,13 @@ double calculateZeroAngle(double zeroRange, double muzzleVelocity, double boreHe

extern "C"
{
EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function);
EXPORT void __stdcall RVExtensionVersion(char *output, int outputSize);
EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function);
}

void __stdcall RVExtensionVersion(char *output, int outputSize)
{
strncpy_s(output, outputSize, ACE_FULL_VERSION_STR, _TRUNCATE);
}

void __stdcall RVExtension(char *output, int outputSize, const char *function)
Expand Down