JSBSim-Team / jsbsim

An open source flight dynamics & control software library
GNU Lesser General Public License v2.1
1.23k stars 423 forks source link

Enable the usage of the NRLMSIS00 atmospheric model. #941

Closed bcoconni closed 9 months ago

bcoconni commented 10 months ago

This PR is the last step to enable the MSIS atmospheric model in JSBSim (the previous PRs were #902, #908 and #916).

After this PR will be merged, the usage of the MSIS atmosphere will be triggered by the following XML code:

<planet name="Earth">
  <atmosphere model="MSIS">
    <day>172</day>    <!--  Jun 21st  -->
    <utc>29000</utc>  <!-- 08:03:20AM -->
  </atmosphere>
</planet>

The XML can either be embedded in an aircraft definition file or supplied to JSBSim.exe via the --planet option or loaded with the C++ method FGFDMExec::LoadPlanet() or the Python method FGFDMExec.load_planet().

At the moment the date shall be supplied as the day of the year, counting from Jan 1st which is day 1 to Dec 31st which is day 365. The time zone is UTC+00:00 and the time is supplied as the number of seconds elapsed since 00:00 (12:00AM).

This PR adds a test to TestPlanet.py to check that the pressure, density and temperature are computed by the MSIS model when the XML file above is supplied.

codecov[bot] commented 10 months ago

Codecov Report

Merging #941 (7fd1f33) into master (81e590c) will decrease coverage by 0.02%. The diff coverage is 15.78%.

@@            Coverage Diff             @@
##           master     #941      +/-   ##
==========================================
- Coverage   24.90%   24.89%   -0.02%     
==========================================
  Files         168      168              
  Lines       18870    18887      +17     
==========================================
+ Hits         4699     4701       +2     
- Misses      14171    14186      +15     
Impacted Files Coverage Δ
src/FGFDMExec.cpp 39.16% <15.78%> (-0.62%) :arrow_down:
seanmcleod commented 10 months ago

Looks good.

agodemar commented 10 months ago

Sounds good. Please go ahead with the merge step

bcoconni commented 9 months ago

Thanks @seanmcleod and @agodemar. The PR is merged.

rickechler commented 9 months ago

Hi, after these changes were merged, I was unable to build JSBSimForUnreal.sln. Got the error that FGMSISData.cpp was missing from src/models/atmosphere/. When I reverted, I was able to build. Thanks! image

bcoconni commented 9 months ago

@rickechler, this should now be fixed by the commit 8a807a7b6f59a6195c5b1c6bfc7df84f9a75ac01.