supaero-aircraft-design / FAST-GA

FAST-(OAD)-GA is a framework for performing rapid Overall Aircraft Design for General Aviation Aircraft
GNU General Public License v3.0
30 stars 22 forks source link

Save flight points #187

Closed esnguyenvan closed 1 year ago

esnguyenvan commented 2 years ago

The major modification is the usage of FlightPoint dataclass of FAST-OAD to handle and save the mission flight points in csv file. To add more variable to the .csv file, instead of manually adding a new variable to the saving functions in the mission files, it can be added from any file by extending the FlightPoint dataclass (see doc here ) and completing the field of the FlightPoint instance. This can be done directly in the propulsion model for example, without intervention in the mission files.

Minor modifications includes: -Addition of a engine weight tuning factor (k_b1) -Addition of the position of the front landing gear as input (instead of hard coded) -Fix potential bug in submodule: Roskam engine weight.

esnguyenvan commented 2 years ago

The one failing test may be a wrong reference value. As the beechcraft 76 has 2 lycoming O-360 engines each weighting 117kg (dry weight see wiki, the total weight of 400kg makes more sense than 800kg.

florentLutz commented 2 years ago

There are also a few Codacy issue that can be solved, do you have access to them ?

esnguyenvan commented 2 years ago

I'll do the remaining modifications & formatting directly on the branch. Concerning your remark on extensibility of FlightPoint class, I find it a bit tricky too but a demo is actually already shown in the FAST-OAD documentation here. Do you find this example sufficient? In case it is not, we should directly extend the Fast-oad documentation.

florentLutz commented 2 years ago

A link to the documentation of FAST-OAD for the next release will do just fine

florentLutz commented 2 years ago

A "small" comment on the CSV file that stores the results of the mission with these new flight points: there are some empty columns in the CSV, would it be possible to delete or fill them ? The missing columns are :

Also since the FAST_GA_fields are used as the name of the columns in the CSV, would it be possible to change cl_wing and cl_htp to CL_wing and CL_htp to match the CL from FAST-OAD-core and could their units be set to [-], again to match the units from FAST-OAD-core ?

Here is a CSV file which highlights what I'm refering to : cirrus_sr22_v2.csv

esnguyenvan commented 1 year ago

Hello, Yes I can apply most of these changes, except for the CD. I consider it a major drawback to not have access to this information in the flightpoints as it prevents the user to explicitly compute the L/D at which the aircraft is flying. This information is of primary importance to know if the aircraft is correctly sized for the cruise phase. So I'll let it empty and will launch an issue to fix this ;)

florentLutz commented 1 year ago

Hello, what I meant by my last comment was precisely to compute it, not drop it, I totally agree with what you said. When I said hard to obtain other than in cruise is that in cruise thrust = drag so you could directly find it in the .CSV. The solution does not seem trivial so OK for an issue.

codecov-commenter commented 1 year ago

Codecov Report

Merging #187 (1cd5377) into main (2ba9bc0) will increase coverage by 0.04%. The diff coverage is 77.52%.

@@            Coverage Diff             @@
##             main     #187      +/-   ##
==========================================
+ Coverage   83.42%   83.46%   +0.04%     
==========================================
  Files         317      317              
  Lines       22806    22831      +25     
  Branches     1362     1369       +7     
==========================================
+ Hits        19025    19057      +32     
+ Misses       3506     3499       -7     
  Partials      275      275              
Impacted Files Coverage Δ
...models/performances/mission/dynamic_equilibrium.py 86.32% <66.66%> (+1.45%) :arrow_up:
.../cg/cg_components/a_airframe/a5_landing_gear_cg.py 68.88% <66.66%> (-0.16%) :arrow_down:
...performances/mission/mission_components/descent.py 92.90% <81.81%> (+1.93%) :arrow_up:
.../performances/mission/mission_components/cruise.py 90.90% <85.71%> (+3.26%) :arrow_up:
...s/performances/mission/mission_components/climb.py 92.53% <90.90%> (+1.95%) :arrow_up:
...ht/mass_breakdown/b_propulsion/b1_engine_weight.py 100.00% <100.00%> (ø)
...mass_breakdown/unitary_tests/test_beechcraft_76.py 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more