From 4b0132a52c3c472ac260b9cb6e1c9456b3f71c8b Mon Sep 17 00:00:00 2001 From: moritzbarnert <moritz.barnert@ilr.rwth-aachen.de> Date: Mon, 17 Feb 2025 16:55:28 +0100 Subject: [PATCH 01/19] New performance_assesment_conf "full version" --- .../performance_assessment_conf.xml | 135 +++++++++--------- 1 file changed, 68 insertions(+), 67 deletions(-) diff --git a/performance_assessment/performance_assessment_conf.xml b/performance_assessment/performance_assessment_conf.xml index e6a9539e..3e0c8684 100644 --- a/performance_assessment/performance_assessment_conf.xml +++ b/performance_assessment/performance_assessment_conf.xml @@ -1,40 +1,41 @@ -<module_configuration_file Name="performance_assessment_conf.xml"> - <control_settings description="General control settings for this tool"> - <aircraft_exchange_file_name description="Specify the name of the exchange file"> - <value>csmr-2020.xml</value> - </aircraft_exchange_file_name> - <aircraft_exchange_file_directory description="Specify the direction in which the aircraft exchange file can be found"> - <value>../projects/</value> +<?xml version="1.0" encoding="utf-8" ?> +<module_configuration_file name="aerodynamic_analysis_conf.xml"> + <control_settings description="General control settings for this tool"> + <aircraft_exchange_file_name description="Specify the name of the exchange file"> + <value>csmr-2020.xml</value> + </aircraft_exchange_file_name> + <aircraft_exchange_file_directory description="Specify the direction in which the aircraft exchange file can be found"> + <value>../projects/CSMR/CSMR-2020/</value> </aircraft_exchange_file_directory> <own_tool_level description="Specify the tool level of this tool"> <value>2</value> </own_tool_level> - <console_output description="Selector to specify the console output ('mode_0': Off, 'mode_1': only out/err/warn, 'mode_2': 1 + info, 'mode_3': 2 + debug)"> - <value>mode_1</value> - </console_output> - <log_file_output description="Selector to specify the log file output ('mode_0': Off, 'mode_1': only out/err/warn, 'mode_2': 1 + info, 'mode_3': 2 + debug)"> - <value>mode_1</value> - </log_file_output> - <plot_output description="Specify the way plotting shall be handled"> - <enable description="Switch to enable plotting ('true': On, 'false': Off)"> - <value>true</value> - </enable> - <copy_plotting_files description="Switch if plotting files shall be copied ('true': On, 'false': Off)"> - <value>true</value> - </copy_plotting_files> - <delete_plotting_files_from_tool_folder description="Switch if plotting files shall be deleted from folder ('true': On, 'false': Off)"> - <value>true</value> - </delete_plotting_files_from_tool_folder> - </plot_output> - <report_output description="Switch to generate an HTML report ('true': On, 'false': Off)"> - <value>true</value> - </report_output> - <tex_report description="Switch to generate a Tex report ('true': On, 'false': Off)"> - <value>true</value> - </tex_report> - <write_info_files description="Switch to generate info files ('true': On, 'false': Off)"> - <value>false</value> - </write_info_files> + <console_output description="Selector to specify the console output. Selector: mode_0 (Off) / mode_1 (only out/err/warn) / mode_2 (1 + info) / mode_3 (2 + debug)"> + <value>mode_1</value> + </console_output> + <log_file_output description="Selector to specify the log file output. Selector: mode_0 (Off) / mode_1 (only out/err/warn) / mode_2 (1 + info) / mode_3 (2 + debug)"> + <value>mode_1</value> + </log_file_output> + <plot_output description="Specify the way plotting shall be handled"> + <enable description="Switch to enable plotting. Switch: true (On) / false (Off)"> + <value>true</value> + </enable> + <copy_plotting_files description="Switch if plotting files shall be copied. Switch: true (On) / false (Off)"> + <value>true</value> + </copy_plotting_files> + <delete_plotting_files_from_tool_folder description="Switch if plotting files shall be deleted from folder. Switch: true (On) / false (Off)"> + <value>true</value> + </delete_plotting_files_from_tool_folder> + </plot_output> + <report_output description="Switch to generate an HTML report. Switch: true (On) / false (Off)"> + <value>true</value> + </report_output> + <tex_report description="Switch to generate a Tex report. Switch: true (On) / false (Off)"> + <value>true</value> + </tex_report> + <write_info_files description="Switch to generate info files. Switch: true (On) / false (Off)"> + <value>false</value> + </write_info_files> <log_file description="Specify the name of the log file"> <value>performance_assessment.log</value> </log_file> @@ -44,43 +45,43 @@ <gnuplot_path description="Path to the gnuplot application ('DEFAULT': Use gnuplot from the UNICADO repo structure)"> <value>../gnuplot/</value> </gnuplot_path> - </control_settings> + </control_settings> <program_settings description="program settings"> - <module_strategy description="Select the strategy level option tool execution" Default="default_methods" >default_methods</module_strategy> - <module_fidelity_level>low</module_fidelity_level> + <module_strategy description="Select the strategy level option tool execution (options: default_methods)" >default_methods</module_strategy> + <module_fidelity_level description="Select the fidelity level (options: low)">low</module_fidelity_level> <performance_checks description="Settings that affect different functionalities!"> <payload_range_diagram description="Payload Range Diagram Calculation"> - <switch description="On-Off-Switch for this method: 1:On, 0:Off" Unit="-" Default="1">1</switch> - <fidelity_level description="Fidelity level of calculation">low</fidelity_level> + <switch description="Switch to calculate the Payload Range Diagram; Switch: true (on) / flase (off)">true</switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> </payload_range_diagram> <engine_performance description="Engine power estimation"> - <switch description="On-Off-Switch for this method: 1:On, 0:Off" Unit="-" Default="1">1</switch> - <fidelity_level description="Fidelity level of calculation">low</fidelity_level> + <switch description="Switch to calculate the enigne power estimation; Switch: true (on) / flase (off)">true</switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> </engine_performance> <flight_envelope_performance description="Estimation of flight range limits"> - <switch description="On-Off-Switch for this method: 1:On, 0:Off" Unit="-" Default="1">1</switch> - <fidelity_level description="Fidelity level of calculation">low</fidelity_level> + <switch description="Switch to calculate the estimation of flight range limits; Switch: true (on) / flase (off)">true</switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> <overwrite_initial_values>0</overwrite_initial_values> </flight_envelope_performance> - <climb_performance description="Climb Performance (so far only for plots)" Default="1"> - <switch description="On-Off-Switch for this method: 1:On, 0:Off" Default="1">1</switch> - <fidelity_level description="Fidelity level of calculation">low</fidelity_level> + <climb_performance description="Calculate the climb performance (so far only for plots)"> + <switch description="Switch to calculate climb performance; Switch: true (on) / flase (off)">true</switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> </climb_performance> <takeoff_performance description="Estimation of the starting distance"> - <switch description="On-Off-Switch for this method: 1:On, 0:Off" Unit="-" Default="1">1</switch> - <fidelity_level description="Fidelity level of calculation">low</fidelity_level> - <calculate_blfl_performance>1</calculate_blfl_performance> + <switch description="Switch to calculate the estimation of the starting distance; Switch: true (on) / flase (off)">true</switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> + <calculate_blfl_performance description="Switch to calculate the blfl performance; Switch: true (on) / flase (off)">true</calculate_blfl_performance> </takeoff_performance> - <landing_performance description="Landing distance estimation" > - <switch description="On-Off-Switch for this method: 1:On, 0:Off" Unit="-" Default="1">1</switch> - <fidelity_level description="Fidelity level of calculation">low</fidelity_level> + <landing_performance description="Estimation of the landing distance" > + <switch description="Switch to calculate the estimation of the landing distance; Switch: true (on) / flase (off)">true</switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> </landing_performance> - <vn_diagram description="Switch for calculation of V-n diagram 1: On, 0: Off"> - <switch description="On-Off-Switch for this method: 1:On, 0:Off" Unit="-" Default="1">1</switch> - <fidelity_level description="Fidelity level of calculation">low</fidelity_level> + <vn_diagram description="Calculate the V-n diagram"> + <switch description="Switch to calculate the V-n diagram; Switch: true (on) / flase (off)">1</switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> </vn_diagram> <sar_performance> - <fidelity_level>low</fidelity_level> + <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> </sar_performance> </performance_checks> <constants_for_performance_checks> @@ -107,7 +108,7 @@ <lower_boundary>-25</lower_boundary> <upper_boundary>25</upper_boundary> </runway_slope> - <head_wind description="headwind speed" Default="0"> + <head_wind description="headwind speed (default: 0)"> <value>0.0</value> <unit>m/s</unit> <lower_boundary>-50</lower_boundary> @@ -115,25 +116,25 @@ </head_wind> </field_performance> <vn_diagram> - <max_n_clean description="Maximum load factor in clean configuration (fixed for CS-25 2.5)" Default="2.5"> + <max_n_clean description="Maximum load factor in clean configuration (fixed for CS-25 2.5) (default: 2.5)"> <value>2.5</value> <unit>1</unit> <lower_boundary>-10</lower_boundary> <upper_boundary>10</upper_boundary> </max_n_clean> - <min_n_clean description="Minimum load factor in clean configuration (fixed -1.0 for CS-25)" Default="-1.0"> + <min_n_clean description="Minimum load factor in clean configuration (fixed -1.0 for CS-25)"> <value>-0.1</value> <unit>1</unit> <lower_boundary>-10</lower_boundary> <upper_boundary>10</upper_boundary> </min_n_clean> - <max_n_flaps description="Maximum load factor with flaps (fixed for CS-25 2.0)" Default="2.0"> + <max_n_flaps description="Maximum load factor with flaps (fixed for CS-25 2.0)"> <value>2.0</value> <unit>1</unit> <lower_boundary>-10</lower_boundary> <upper_boundary>10</upper_boundary> </max_n_flaps> - <min_n_flaps description="Minimum load factor with flaps (fixed at CS-25 0.0)" Default="0.0"> + <min_n_flaps description="Minimum load factor with flaps (fixed at CS-25 0.0)"> <value>0.0</value> <unit>1</unit> <lower_boundary>-10</lower_boundary> @@ -142,18 +143,18 @@ </vn_diagram> </constants_for_performance_checks> <modes description="other settings that influence different modes!"> - <fuel_planning description="Fuel estimation switch: 1:On, 0:Off" Default="0">1</fuel_planning> - <use_study_mission_for_analysis description="1: use missionStudy.xml, 0: use missionDesign.xml" Default="0">0</use_study_mission_for_analysis> - <mtom_design description="Redetermination of the MTOM: 1:Yes (e.g. DesignLoop), 0:No (e.g. only analysis)" Default="0">0</mtom_design> + <fuel_planning description="Switch for fuel estimation switch; Switch: true (on) / false (off)">true</fuel_planning> + <use_study_mission_for_analysis description="Switch to use study mission for analysis; Switch: true(use missionStudy.xml) / false (use missionDesign.xml)">false</use_study_mission_for_analysis> + <mtom_design description="Switch for the redetermination of the MTOM; Switch: true (yes, e.g. DesignLoop) / fales (no, e.g. only analysis)">false</mtom_design> </modes> <mission description="Specification of the mission"> - <optimize_mission_profile description="Switch to optimize the mission profile" Unit="-" Default="0">0</optimize_mission_profile> - <fidelity_level>low</fidelity_level> + <optimize_mission_profile description="Switch to optimize the mission profile; Switch: true (on) / flase (off)">false</optimize_mission_profile> + <fidelity_level description= "Select the fidelity level of the calculation (options: low)">low</fidelity_level> </mission> <fuel_planning> <switch>1</switch> - <fidelity_level description="Fidelity level of calculation">low</fidelity_level> - <contingency_fuel description="Relative percentage of Contigency Fuel in total Trip Fuel" Default="0.05"> + <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> + <contingency_fuel description="Relative percentage of Contigency Fuel in total Trip Fuel (default: 0.05)"> <value>0.03</value> <unit>1</unit> <lower_boundary>0</lower_boundary> -- GitLab From c7a6f9716572544feadd37ddb1807be14264763a Mon Sep 17 00:00:00 2001 From: moritzbarnert <moritz.barnert@ilr.rwth-aachen.de> Date: Mon, 17 Feb 2025 17:30:22 +0100 Subject: [PATCH 02/19] New performance_assesment "full version" 2.0 --- .../performance_assessment_conf.xml | 119 ++++++++++++------ 1 file changed, 84 insertions(+), 35 deletions(-) diff --git a/performance_assessment/performance_assessment_conf.xml b/performance_assessment/performance_assessment_conf.xml index 3e0c8684..1af98b9d 100644 --- a/performance_assessment/performance_assessment_conf.xml +++ b/performance_assessment/performance_assessment_conf.xml @@ -47,41 +47,93 @@ </gnuplot_path> </control_settings> <program_settings description="program settings"> - <module_strategy description="Select the strategy level option tool execution (options: default_methods)" >default_methods</module_strategy> - <module_fidelity_level description="Select the fidelity level (options: low)">low</module_fidelity_level> + <module_strategy description="Select the strategy level option tool execution (options: default_methods)" > + <value>default_methods</value> + </module_strategy> + <module_fidelity_level description="Select the fidelity level (options: low)"> + <value>low</value> + </module_fidelity_level> <performance_checks description="Settings that affect different functionalities!"> - <payload_range_diagram description="Payload Range Diagram Calculation"> - <switch description="Switch to calculate the Payload Range Diagram; Switch: true (on) / flase (off)">true</switch> - <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> + <fuel_planning description="Fuel planning calculation"> + <switch description="Switch for fuel estimation; Switch: true (on) / false (off)"> + <value>true</value> + </switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)"> + <value>low</value> + </fidelity_level> + <contingency_fuel description="Relative percentage of Contigency Fuel in total Trip Fuel (default: 0.05)"> + <value>0.03</value> + <unit>1</unit> + <lower_boundary>0</lower_boundary> + <upper_boundary>0.2</upper_boundary> + </contingency_fuel> + </fuel_planning> + <payload_range_diagram description="Payload Range Diagram calculation"> + <switch description="Switch to calculate the Payload Range Diagram; Switch: true (on) / flase (off)"> + <value>true</value> + </switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)"> + <value>low</value> + </fidelity_level> </payload_range_diagram> <engine_performance description="Engine power estimation"> - <switch description="Switch to calculate the enigne power estimation; Switch: true (on) / flase (off)">true</switch> - <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> + <switch description="Switch to calculate the enigne power estimation; Switch: true (on) / flase (off)"> + <value>true</value> + </switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)"> + <value>low</value> + </fidelity_level> </engine_performance> <flight_envelope_performance description="Estimation of flight range limits"> - <switch description="Switch to calculate the estimation of flight range limits; Switch: true (on) / flase (off)">true</switch> - <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> - <overwrite_initial_values>0</overwrite_initial_values> + <switch description="Switch to calculate the estimation of flight range limits; Switch: true (on) / flase (off)"> + <value>true</value> + </switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)"> + <value>low</value> + </fidelity_level> + <overwrite_initial_values> + <value>0</value> + </overwrite_initial_values> </flight_envelope_performance> <climb_performance description="Calculate the climb performance (so far only for plots)"> - <switch description="Switch to calculate climb performance; Switch: true (on) / flase (off)">true</switch> - <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> + <switch description="Switch to calculate climb performance; Switch: true (on) / flase (off)"> + <value>true</value> + </switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)"> + <value>low</value> + </fidelity_level> </climb_performance> <takeoff_performance description="Estimation of the starting distance"> - <switch description="Switch to calculate the estimation of the starting distance; Switch: true (on) / flase (off)">true</switch> - <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> - <calculate_blfl_performance description="Switch to calculate the blfl performance; Switch: true (on) / flase (off)">true</calculate_blfl_performance> + <switch description="Switch to calculate the estimation of the starting distance; Switch: true (on) / flase (off)"> + <value>true</value> + </switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)"> + <value>low</value> + </fidelity_level> + <calculate_blfl_performance description="Switch to calculate the blfl performance; Switch: true (on) / flase (off)"> + <value>true</value> + </calculate_blfl_performance> </takeoff_performance> <landing_performance description="Estimation of the landing distance" > - <switch description="Switch to calculate the estimation of the landing distance; Switch: true (on) / flase (off)">true</switch> - <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> + <switch description="Switch to calculate the estimation of the landing distance; Switch: true (on) / flase (off)"> + <value>true</value> + </switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)"> + <value>low</value> + </fidelity_level> </landing_performance> <vn_diagram description="Calculate the V-n diagram"> - <switch description="Switch to calculate the V-n diagram; Switch: true (on) / flase (off)">1</switch> - <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> + <switch description="Switch to calculate the V-n diagram; Switch: true (on) / flase (off)"> + <value>true</value> + </switch> + <fidelity_level description="Select the fidelity level of the calculation (options: low)"> + <value>low</value> + </fidelity_level> </vn_diagram> <sar_performance> - <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> + <fidelity_level description="Select the fidelity level of the calculation (options: low)"> + <value>low</value> + </fidelity_level> </sar_performance> </performance_checks> <constants_for_performance_checks> @@ -143,23 +195,20 @@ </vn_diagram> </constants_for_performance_checks> <modes description="other settings that influence different modes!"> - <fuel_planning description="Switch for fuel estimation switch; Switch: true (on) / false (off)">true</fuel_planning> - <use_study_mission_for_analysis description="Switch to use study mission for analysis; Switch: true(use missionStudy.xml) / false (use missionDesign.xml)">false</use_study_mission_for_analysis> - <mtom_design description="Switch for the redetermination of the MTOM; Switch: true (yes, e.g. DesignLoop) / fales (no, e.g. only analysis)">false</mtom_design> + <use_study_mission_for_analysis description="Switch to use study mission for analysis; Switch: true(use missionStudy.xml) / false (use missionDesign.xml)"> + <value>false</value> + </use_study_mission_for_analysis> + <mtom_design description="Switch for the redetermination of the MTOM; Switch: true (yes, e.g. DesignLoop) / fales (no, e.g. only analysis)"> + <value>flase</value> + </mtom_design> </modes> <mission description="Specification of the mission"> - <optimize_mission_profile description="Switch to optimize the mission profile; Switch: true (on) / flase (off)">false</optimize_mission_profile> - <fidelity_level description= "Select the fidelity level of the calculation (options: low)">low</fidelity_level> + <optimize_mission_profile description="Switch to optimize the mission profile; Switch: true (on) / flase (off)"> + <value>flase</value> + </optimize_mission_profile> + <fidelity_level description= "Select the fidelity level of the calculation (options: low)"> + <value>low</value> + </fidelity_level> </mission> - <fuel_planning> - <switch>1</switch> - <fidelity_level description="Select the fidelity level of the calculation (options: low)">low</fidelity_level> - <contingency_fuel description="Relative percentage of Contigency Fuel in total Trip Fuel (default: 0.05)"> - <value>0.03</value> - <unit>1</unit> - <lower_boundary>0</lower_boundary> - <upper_boundary>0.2</upper_boundary> - </contingency_fuel> - </fuel_planning> </program_settings> </module_configuration_file> -- GitLab From 687c5084b7f3ae48b83b3b3029595a331200627b Mon Sep 17 00:00:00 2001 From: philipphansmann <Philipp Hansmann> Date: Tue, 18 Feb 2025 09:32:52 +0100 Subject: [PATCH 03/19] reintegrating changed config file, minor cleanup --- .../performance_assessment_conf.xml | 6 +-- .../src/taw/defaultMethods/aircraft.cpp | 16 ++---- .../low_fidelity/payloadRange.cpp | 22 ++++----- .../performance_assessment_factory.cpp | 49 ++++++++++--------- .../performance_assessment_output.cpp | 15 ++++-- .../performance_assessment_settings.cpp | 48 +++++++++++------- 6 files changed, 83 insertions(+), 73 deletions(-) diff --git a/performance_assessment/performance_assessment_conf.xml b/performance_assessment/performance_assessment_conf.xml index 1af98b9d..0bba912d 100644 --- a/performance_assessment/performance_assessment_conf.xml +++ b/performance_assessment/performance_assessment_conf.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="utf-8" ?> -<module_configuration_file name="aerodynamic_analysis_conf.xml"> +<module_configuration_file name="performance_assessment_conf.xml"> <control_settings description="General control settings for this tool"> <aircraft_exchange_file_name description="Specify the name of the exchange file"> <value>csmr-2020.xml</value> </aircraft_exchange_file_name> <aircraft_exchange_file_directory description="Specify the direction in which the aircraft exchange file can be found"> - <value>../projects/CSMR/CSMR-2020/</value> + <value>../projects/</value> </aircraft_exchange_file_directory> <own_tool_level description="Specify the tool level of this tool"> <value>2</value> @@ -204,7 +204,7 @@ </modes> <mission description="Specification of the mission"> <optimize_mission_profile description="Switch to optimize the mission profile; Switch: true (on) / flase (off)"> - <value>flase</value> + <value>false</value> </optimize_mission_profile> <fidelity_level description= "Select the fidelity level of the calculation (options: low)"> <value>low</value> diff --git a/performance_assessment/src/taw/defaultMethods/aircraft.cpp b/performance_assessment/src/taw/defaultMethods/aircraft.cpp index 3792ed0a..c14bb35f 100644 --- a/performance_assessment/src/taw/defaultMethods/aircraft.cpp +++ b/performance_assessment/src/taw/defaultMethods/aircraft.cpp @@ -103,7 +103,7 @@ aircraft::aircraft(const std::shared_ptr<RuntimeIO>& rtIO, const std::shared_ptr /* Requirements */ myReqs.OEICruiseAltitude = EndnodeReadOnly<double>( - "/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/flight_envelope/maximum_one_engine_operating_altitude") + "/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/flight_envelope/maximum_altitude_one_engine_inoperative") .read(rtIO->acxml).value(); myReqs.TOFL = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/takeoff_distance") .read(rtIO->acxml).value(); @@ -254,9 +254,8 @@ double aircraft::getMinimumFactorForV2() { factor += 0.0025; double Mach = factor * this->v1gS_TO(this->MTOM, altitude) / this->atm.getSpeedOfSound(altitude); double tempTAS = convertUnit(MACH, TRUEAIRSPEED, altitude, this->atm, Mach); - //this->ROC(..., true, ...): OEI active, which is a requirement for minimum climb gradient in 2nd climb segment - double tempROC = this->ROC(this->MTOM, altitude, Mach, 0.0, "climb", "takeoff", this->myMission.bleedOffTO, this->myMission.shaftOffTO, true, this->aero); - tempClimbGradient = tempROC / tempTAS * 100.; + double tempROC_OEI = this->ROC(this->MTOM, altitude, Mach, 0.0, "climb", "takeoff", this->myMission.bleedOffTO, this->myMission.shaftOffTO, true, this->aero); + tempClimbGradient = tempROC_OEI / tempTAS * 100.; } while (tempClimbGradient < myReqs.climbGradientSecondTOSegment); return factor; } @@ -266,23 +265,14 @@ void aircraft::Requirements::setRequiredClimbGradients(const uint16_t& numberOfE myRuntimeInfo->err << "Climbing requirements are invalid for a single engine aircraft!" << endl; exit(1); } else if (numberOfEngines == 2) { - // this->climbGradientSecondTOSegment = checkBoundaries(climbGradientRequirement.at("secondTOsegment"), 2.4, true, 10., true); - // this->climbGradientFinalTOSegment = checkBoundaries(climbGradientRequirement.at("finalTOsegment"), 1.2, true, 10., true); - // this->climbGradientApproachOEI = checkBoundaries(climbGradientRequirement.at("approachOEI"), 2.1, true, 10., true); this->climbGradientSecondTOSegment = 2.4; this->climbGradientFinalTOSegment = 1.2; this->climbGradientApproachOEI = 2.1; } else if (numberOfEngines == 3) { - // this->climbGradientSecondTOSegment = checkBoundaries(climbGradientRequirement.at("secondTOsegment"), 2.7, true, 10., true); - // this->climbGradientFinalTOSegment = checkBoundaries(climbGradientRequirement.at("finalTOsegment"), 1.5, true, 10., true); - // this->climbGradientApproachOEI = checkBoundaries(climbGradientRequirement.at("approachOEI"), 2.4, true, 10., true); this->climbGradientSecondTOSegment = 2.7; this->climbGradientFinalTOSegment = 1.5; this->climbGradientApproachOEI = 2.4; } else if (numberOfEngines >= 4) { - // this->climbGradientSecondTOSegment = checkBoundaries(climbGradientRequirement.at("secondTOsegment"), 3.0, true, 10., true); - // this->climbGradientFinalTOSegment = checkBoundaries(climbGradientRequirement.at("finalTOsegment"), 1.7, true, 10., true); - // this->climbGradientApproachOEI = checkBoundaries(climbGradientRequirement.at("approachOEI"), 2.7, true, 10., true); this->climbGradientSecondTOSegment = 3.0; this->climbGradientFinalTOSegment = 1.7; this->climbGradientApproachOEI = 2.7; diff --git a/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp b/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp index 9b570acc..21abcf6b 100644 --- a/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp +++ b/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp @@ -37,7 +37,7 @@ payloadRange::~payloadRange() { void payloadRange::calcPayloadRange() { // Determine Payload Range via Breguet with Mass Fractions (s. FZB1, Uebung1, WS20122013, eq. 13) - // Determine Breguet Factors = (V*L/D)/g*SFC; ATTENTION: With Tim Breguet Factors = g*SFC/(V*L/D) + // Determine Breguet Factors = (V*L/D)/g*SFC double breguetFactor(0.); double cruiseHeight(0.); // Average of Cruise Altitude for Breguet as Sum of Step Altitudes Weighted with Segment Length @@ -47,23 +47,19 @@ void payloadRange::calcPayloadRange() { else cruiseHeight += (theAcftPt->myMission.cruiseSegLength.at(i) - theAcftPt->myMission.cruiseSegLength.at(i - 1)) * theAcftPt->myMission.cruiseAlt.at(i); } - cruiseHeight = convertUnit(FOOT, METER, cruiseHeight); - // myRuntimeInfo->out << "cruiseHeigth " << cruiseHeight << endl; - // TODO(franz#1#): statt MTOM, MTOM reduziert um Massfractions Start, Climb - // TODO(franz#1#): ggf. statt LoverD und SFC ausrechnen aus Aircraft XML holen und dann Drag ausrechnen - double theLoverD = theAcftPt->aero.getCruiseLoverD(theAcftPt->myMission.crMach, convertUnit(FOOT, METER, theAcftPt->hInitialCruise), 0.0, theAcftPt->MTOM, "clean", - theAcftPt->atm); - double theDrag = theAcftPt->aero.getCruiseDrag(theAcftPt->myMission.crMach, convertUnit(FOOT, METER, theAcftPt->hInitialCruise), 0.0, theAcftPt->MTOM, "clean", theAcftPt->atm); - theAcftPt->myEngines.calculate_N1_with_thrustlimit(theAcftPt->myEnergyProviders.energyCarrierID_cruise, theAcftPt->hInitialCruise, theAcftPt->myMission.crMach, theAcftPt->atm, 1.0, "maximum_continuous", 0., 0., - theDrag); - double theSFC = theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_cruise) / theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_cruise); + double theLoverD = theAcftPt->aero.getCruiseLoverD(theAcftPt->myMission.crMach, theAcftPt->hInitialCruise, 0.0, theAcftPt->MTOM, "clean", theAcftPt->atm); + double theDrag = theAcftPt->aero.getCruiseDrag(theAcftPt->myMission.crMach, theAcftPt->hInitialCruise, 0.0, theAcftPt->MTOM, "clean", theAcftPt->atm); + theAcftPt->myEngines.calculate_N1_with_thrustlimit(theAcftPt->myEnergyProviders.energyCarrierID_cruise, theAcftPt->hInitialCruise, theAcftPt->myMission.crMach, theAcftPt->atm, + 1.0, "maximum_continuous", 0., 0., theDrag); + double theSFC = theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_cruise) + / theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_cruise); breguetFactor = (theAcftPt->myMission.crMach * theAcftPt->atm.getSpeedOfSound(cruiseHeight) * theLoverD) / (G_FORCE * theSFC); - /* Determination of the 0.point */ + /* Determination of point 0 */ Payload.push_back(theAcftPt->maxPayload); Fuel.push_back(0.); TOM.push_back(theAcftPt->OME + theAcftPt->maxPayload); Range.push_back(0.); - /* 1.point, range will be determined later */ + /* Point 1 masses; range will be determined later */ Payload.push_back(theAcftPt->maxPayload); Fuel.push_back(theAcftPt->MTOM - theAcftPt->OME - Payload.back()); TOM.push_back(theAcftPt->MTOM); diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp index 65b9b11a..9b1ce385 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp @@ -38,22 +38,24 @@ performance_assessment_factory::performance_assessment_factory(const std::shared void performance_assessment_factory::initialize() { /* Get desired fidelity level of methods*/ - fidelityLevelFuelPlanning = static_cast<std::string>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/fuel_planning/fidelity_level")); - fidelityLevelOptimizeMission = static_cast<std::string>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/mission/fidelity_level")); - fidelityLevelPayloadRangeDiagram = static_cast<std::string>(rtIO->moduleConfig - .at("/module_configuration_file/program_settings/performance_checks/payload_range_diagram/fidelity_level")); - fidelityLevelEnginePerformance = static_cast<std::string>(rtIO->moduleConfig - .at("/module_configuration_file/program_settings/performance_checks/engine_performance/fidelity_level")); - fidelityLevelFlightEnvelopePerformance = static_cast<std::string>(rtIO->moduleConfig - .at("/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/fidelity_level")); - fidelityLevelClimbPerformance = static_cast<std::string>(rtIO->moduleConfig - .at("/module_configuration_file/program_settings/performance_checks/climb_performance/fidelity_level")); - fidelityLevelTakeOffPerformance = static_cast<std::string>(rtIO->moduleConfig - .at("/module_configuration_file/program_settings/performance_checks/takeoff_performance/fidelity_level")); - fidelityLevelLandingPerformance = static_cast<std::string>(rtIO->moduleConfig - .at("/module_configuration_file/program_settings/performance_checks/landing_performance/fidelity_level")); - fidelityLevelVnDiagram = static_cast<std::string>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/vn_diagram/fidelity_level")); - fidelityLevelSARPerformance = static_cast<std::string>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/sar_performance/fidelity_level")); + fidelityLevelFuelPlanning = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/fuel_planning/fidelity_level").read(rtIO->moduleConfig).value(); + fidelityLevelOptimizeMission = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/mission/fidelity_level").read(rtIO->moduleConfig).value(); + fidelityLevelPayloadRangeDiagram = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/payload_range_diagram/fidelity_level") + .read(rtIO->moduleConfig).value(); + fidelityLevelEnginePerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/engine_performance/fidelity_level") + .read(rtIO->moduleConfig).value(); + fidelityLevelFlightEnvelopePerformance = EndnodeReadOnly<std::string>( + "/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/fidelity_level").read(rtIO->moduleConfig).value(); + fidelityLevelClimbPerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/climb_performance/fidelity_level") + .read(rtIO->moduleConfig).value(); + fidelityLevelTakeOffPerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/takeoff_performance/fidelity_level") + .read(rtIO->moduleConfig).value(); + fidelityLevelLandingPerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/landing_performance/fidelity_level") + .read(rtIO->moduleConfig).value(); + fidelityLevelVnDiagram = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/vn_diagram/fidelity_level") + .read(rtIO->moduleConfig).value(); + fidelityLevelSARPerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/sar_performance/fidelity_level") + .read(rtIO->moduleConfig).value(); /* Initialization of performance_assessment objects */ /* Fuel Planning */ @@ -154,6 +156,7 @@ void performance_assessment_factory::initialize() { void performance_assessment_factory::run() { /* Run the selected modules */ +/* Fuel Planning */ if (mySettingsPt->mySwitches.doFuelPlanning == true) { try { myRuntimeInfo->out << " -> Fuel Planning" << std::endl; @@ -176,17 +179,18 @@ if (mySettingsPt->optimizeMission == true) { /* PayloadRange */ if (mySettingsPt->mySwitches.doPayloadRange == true) { try { - if (mySettingsPt->mySwitches.doFuelPlanning == false || mySettingsPt->check_sucessfully_executed.doFuelPlanning == false) { - throwError(__FILE__, __func__, __LINE__, - "Error in payload range diagram calculation: Fuel planning needed for payload range calculation. Please turn on fuel planning."); - } if (!mySettingsPt->designForMTOM && mySettingsPt->useStudyMissionForAnalysis) { myRuntimeInfo->out << "Attention: Payload range diagram incorrect when MTOM Design off or StudyMission is used!" << std::endl; abstractFuelPlanningPt->doPayloadRangeOLD(); } else { + if (mySettingsPt->mySwitches.doFuelPlanning == false || mySettingsPt->check_sucessfully_executed.doFuelPlanning == false) { + myRuntimeInfo->out << " ... Payload Range" << std::endl; + abstractPayloadRangePt->calcPayloadRange(); + } else { myRuntimeInfo->out << " ... Payload Range using OLD method" << std::endl; abstractFuelPlanningPt->doPayloadRangeOLD(); abstractFuelPlanningPt->doFuelPayloadRangeOLD(); + } } mySettingsPt->check_sucessfully_executed.doPayloadRange = true; } catch (const int& errorCode) { @@ -196,10 +200,7 @@ if (mySettingsPt->mySwitches.doPayloadRange == true) { } else { abstractFuelPlanningPt->payloadRangeFromAcftXML(); } -if (mySettingsPt->mySwitches.doPayloadRange == true && mySettingsPt->mySwitches.doFuelPlanning == false) { - myRuntimeInfo->out << " ... Payload Range" << std::endl; // TODO(hansmann): Cannot be reached (?) - abstractPayloadRangePt->calcPayloadRange(); -} + /* EnginePerformance */ if (mySettingsPt->mySwitches.doEnginePerformance == true) { diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp index c7f02fc1..11534341 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp @@ -965,9 +965,18 @@ void performance_assessment_output::generate_plot_payload_range() { // Gather data vector<double> x_range; vector<double> y_payload; - for (unsigned int i(0); i < abstractFuelPlanningPt->myPayloadRange.size(); i++) { - x_range.push_back(abstractFuelPlanningPt->myPayloadRange.at(i).Range / 1000); // in km - y_payload.push_back(abstractFuelPlanningPt->myPayloadRange.at(i).Payload); + if (mySettingsPt->mySwitches.doFuelPlanning == true) { + // Case: Payload range data was generated by fuel planning class + for (unsigned int i(0); i < abstractFuelPlanningPt->myPayloadRange.size(); i++) { + x_range.push_back(abstractFuelPlanningPt->myPayloadRange.at(i).Range / 1000); // in km + y_payload.push_back(abstractFuelPlanningPt->myPayloadRange.at(i).Payload); + } + } else { + // Case: Payload range data was generated by payload range class + for (unsigned int i(0); i < abstractPayloadRangePt->Range.size(); i++) { + x_range.push_back(abstractPayloadRangePt->Range.at(i) / 1000); + y_payload.push_back(abstractPayloadRangePt->Payload.at(i)); + } } // Plot matplot::figure_handle fig = matplot::figure(true); diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp index 2a2a296a..2affc415 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp @@ -26,9 +26,9 @@ using std::endl; performance_assessment_settings::performance_assessment_settings(const std::shared_ptr<RuntimeIO>& rtIOin) : rtIO(rtIOin), - designForMTOM(rtIO->moduleConfig.at("/module_configuration_file/program_settings/modes/mtom_design")), - useStudyMissionForAnalysis(rtIO->moduleConfig.at("/module_configuration_file/program_settings/modes/use_study_mission_for_analysis")), // CSV-Output? - optimizeMission(rtIO->moduleConfig.at("/module_configuration_file/program_settings/mission/optimize_mission_profile")) { + designForMTOM(rtIO->moduleConfig.at("/module_configuration_file/program_settings/modes/mtom_design/value")), + useStudyMissionForAnalysis(rtIO->moduleConfig.at("/module_configuration_file/program_settings/modes/use_study_mission_for_analysis/value")), // CSV-Output? + optimizeMission(rtIO->moduleConfig.at("/module_configuration_file/program_settings/mission/optimize_mission_profile/value")) { /* Constants for start/runway calculations */ myField.runwaySlope = PI / 180. * EndnodeReadOnly<double>("/module_configuration_file/program_settings/constants_for_performance_checks/field_performance/runway_slope") @@ -53,23 +53,37 @@ performance_assessment_settings::performance_assessment_settings(const std::shar enginePerformance.Rating.push_back(tempRating); } /* Switch for Performance Checks */ - mySwitches.doPayloadRange = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/payload_range_diagram/switch")); - mySwitches.doEnginePerformance = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/engine_performance/switch")); - mySwitches.doFlightEnvelopePerformance = static_cast<bool>(rtIO->moduleConfig.at( - "/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/switch")); - mySwitches.overwriteInitialValues = static_cast<bool>(rtIO->moduleConfig.at( - "/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/overwrite_initial_values")); - mySwitches.doClimbPerformance = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/climb_performance/switch")); - mySwitches.doTOPerformance = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/takeoff_performance/switch")); + mySwitches.doPayloadRange = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/payload_range_diagram/switch") + .read(rtIO->moduleConfig).value(); + // mySwitches.doPayloadRange = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/payload_range_diagram/switch/value")); + mySwitches.doEnginePerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/engine_performance/switch") + .read(rtIO->moduleConfig).value(); + // mySwitches.doEnginePerformance = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/engine_performance/switch/value")); + mySwitches.doFlightEnvelopePerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/switch") + .read(rtIO->moduleConfig).value(); + // mySwitches.doFlightEnvelopePerformance = static_cast<bool>(rtIO->moduleConfig.at( + // "/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/switch/value")); + mySwitches.overwriteInitialValues = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/overwrite_initial_values") + .read(rtIO->moduleConfig).value(); + // mySwitches.overwriteInitialValues = static_cast<bool>(rtIO->moduleConfig.at( + // "/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/overwrite_initial_values/value")); + mySwitches.doClimbPerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/climb_performance/switch") + .read(rtIO->moduleConfig).value(); + // mySwitches.doClimbPerformance = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/climb_performance/switch/value")); + mySwitches.doTOPerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/takeoff_performance/switch") + .read(rtIO->moduleConfig).value(); + // mySwitches.doTOPerformance = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/takeoff_performance/switch/value")); if (mySwitches.doTOPerformance) { - mySwitches.doBLFLPerformance = static_cast<bool>(rtIO->moduleConfig.at( - "/module_configuration_file/program_settings/performance_checks/takeoff_performance/calculate_blfl_performance")); + mySwitches.doBLFLPerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/takeoff_performance/calculate_blfl_performance") + .read(rtIO->moduleConfig).value(); + // mySwitches.doBLFLPerformance = static_cast<bool>(rtIO->moduleConfig.at( + // "/module_configuration_file/program_settings/performance_checks/takeoff_performance/calculate_blfl_performance/value")); } else { - mySwitches.doBLFLPerformance = false; + mySwitches.doBLFLPerformance = false; } - mySwitches.doLandingPerformance = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/landing_performance/switch")); - mySwitches.doVnDiagram = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/vn_diagram/switch")); - mySwitches.doFuelPlanning = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/fuel_planning/switch")); + mySwitches.doLandingPerformance = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/landing_performance/switch/value")); + mySwitches.doVnDiagram = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/vn_diagram/switch/value")); + mySwitches.doFuelPlanning = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/fuel_planning/switch/value")); /* Fuel Planning */ myFuelPlan.contingencyFuel = EndnodeReadOnly<double>("/module_configuration_file/program_settings/fuel_planning/contingency_fuel").read(rtIO->moduleConfig).value(); } -- GitLab From cf41e934e473b1fa1d2c9e2a78146b981f148ac1 Mon Sep 17 00:00:00 2001 From: philipphansmann <Philipp Hansmann> Date: Tue, 18 Feb 2025 15:13:47 +0100 Subject: [PATCH 04/19] Fixed config pathes --- .../performance_assessment_conf.xml | 2 +- .../performance_assessment_output.cpp | 6 +++--- .../performance_assessment_settings.cpp | 19 ++++++------------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/performance_assessment/performance_assessment_conf.xml b/performance_assessment/performance_assessment_conf.xml index 0bba912d..1d42544d 100644 --- a/performance_assessment/performance_assessment_conf.xml +++ b/performance_assessment/performance_assessment_conf.xml @@ -91,7 +91,7 @@ <fidelity_level description="Select the fidelity level of the calculation (options: low)"> <value>low</value> </fidelity_level> - <overwrite_initial_values> + <overwrite_initial_values description="Causes recalculation of dive speeds"> <value>0</value> </overwrite_initial_values> </flight_envelope_performance> diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp index 11534341..de343469 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp @@ -929,9 +929,9 @@ void performance_assessment_output::generatePlots() { if (mySettingsPt->mySwitches.doPayloadRange == true) { generate_plot_payload_range(); } - // if (mySettingsPt->mySwitches.doEnginePerformance == true) { - // generate_plot_engine_performance(); - // } + if (mySettingsPt->mySwitches.doEnginePerformance == true) { + generate_plot_engine_performance(); + } if (mySettingsPt->mySwitches.doClimbPerformance == true && mySettingsPt->check_sucessfully_executed.doClimbPerformance == true) { generate_plot_ceiling_performance(); } diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp index 2affc415..aa086ff9 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp @@ -55,35 +55,28 @@ performance_assessment_settings::performance_assessment_settings(const std::shar /* Switch for Performance Checks */ mySwitches.doPayloadRange = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/payload_range_diagram/switch") .read(rtIO->moduleConfig).value(); - // mySwitches.doPayloadRange = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/payload_range_diagram/switch/value")); mySwitches.doEnginePerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/engine_performance/switch") .read(rtIO->moduleConfig).value(); - // mySwitches.doEnginePerformance = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/engine_performance/switch/value")); mySwitches.doFlightEnvelopePerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/switch") .read(rtIO->moduleConfig).value(); - // mySwitches.doFlightEnvelopePerformance = static_cast<bool>(rtIO->moduleConfig.at( - // "/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/switch/value")); mySwitches.overwriteInitialValues = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/overwrite_initial_values") .read(rtIO->moduleConfig).value(); - // mySwitches.overwriteInitialValues = static_cast<bool>(rtIO->moduleConfig.at( - // "/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/overwrite_initial_values/value")); mySwitches.doClimbPerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/climb_performance/switch") .read(rtIO->moduleConfig).value(); - // mySwitches.doClimbPerformance = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/climb_performance/switch/value")); mySwitches.doTOPerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/takeoff_performance/switch") .read(rtIO->moduleConfig).value(); - // mySwitches.doTOPerformance = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/takeoff_performance/switch/value")); if (mySwitches.doTOPerformance) { mySwitches.doBLFLPerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/takeoff_performance/calculate_blfl_performance") .read(rtIO->moduleConfig).value(); - // mySwitches.doBLFLPerformance = static_cast<bool>(rtIO->moduleConfig.at( - // "/module_configuration_file/program_settings/performance_checks/takeoff_performance/calculate_blfl_performance/value")); } else { mySwitches.doBLFLPerformance = false; } - mySwitches.doLandingPerformance = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/landing_performance/switch/value")); - mySwitches.doVnDiagram = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/performance_checks/vn_diagram/switch/value")); - mySwitches.doFuelPlanning = static_cast<bool>(rtIO->moduleConfig.at("/module_configuration_file/program_settings/fuel_planning/switch/value")); + mySwitches.doLandingPerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/landing_performance/switch") + .read(rtIO->moduleConfig).value(); + mySwitches.doLandingPerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/landing_performance/switch") + .read(rtIO->moduleConfig).value(); + mySwitches.doVnDiagram = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/vn_diagram/switch").read(rtIO->moduleConfig).value(); + mySwitches.doFuelPlanning = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/fuel_planning/switch").read(rtIO->moduleConfig).value(); /* Fuel Planning */ myFuelPlan.contingencyFuel = EndnodeReadOnly<double>("/module_configuration_file/program_settings/fuel_planning/contingency_fuel").read(rtIO->moduleConfig).value(); } -- GitLab From a4bf414f2ca0e98b2f36a7d83c48f2468667d8fe Mon Sep 17 00:00:00 2001 From: philipphansmann <Philipp Hansmann> Date: Wed, 19 Feb 2025 09:08:53 +0100 Subject: [PATCH 05/19] changed header year --- performance_assessment/src/main.cpp | 2 +- performance_assessment/src/performance_assessment.cpp | 2 +- performance_assessment/src/performance_assessment.h | 2 +- .../taw/defaultMethods/SARPerformance/abstractSARPerformance.h | 2 +- .../SARPerformance/low_fidelity/SARPerformance.cpp | 2 +- .../defaultMethods/SARPerformance/low_fidelity/SARPerformance.h | 2 +- .../src/taw/defaultMethods/VnDiagram/abstractVnDiagram.h | 2 +- .../src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp | 2 +- .../src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.h | 2 +- performance_assessment/src/taw/defaultMethods/aircraft.cpp | 2 +- performance_assessment/src/taw/defaultMethods/aircraft.h | 2 +- .../ceilingPerformance/abstractCeilingPerformance.h | 2 +- .../ceilingPerformance/low_fidelity/ceilingPerformance.cpp | 2 +- .../ceilingPerformance/low_fidelity/ceilingPerformance.h | 2 +- .../enginePerformance/abstractEnginePerformance.h | 2 +- .../enginePerformance/low_fidelity/enginePerformance.cpp | 2 +- .../enginePerformance/low_fidelity/enginePerformance.h | 2 +- .../defaultMethods/flightEnvelopes/abstractFlightEnvelopes.h | 2 +- .../flightEnvelopes/low_fidelity/flightEnvelopes.cpp | 2 +- .../flightEnvelopes/low_fidelity/flightEnvelopes.h | 2 +- .../src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h | 2 +- .../fuelPlanning/low_fidelity/flightSimulator.cpp | 2 +- .../defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h | 2 +- .../fuelPlanning/low_fidelity/fuelFromMassFraction.cpp | 2 +- .../fuelPlanning/low_fidelity/fuelFromMassFraction.h | 2 +- .../defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp | 2 +- .../taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.h | 2 +- .../landingPerformance/abstractLandingPerformance.h | 2 +- .../landingPerformance/low_fidelity/landingPerformance.cpp | 2 +- .../landingPerformance/low_fidelity/landingPerformance.h | 2 +- .../src/taw/defaultMethods/missionDefinition.cpp | 2 +- .../src/taw/defaultMethods/missionDefinition.h | 2 +- .../optimizeMissionProfile/abstractOptimizeMissionProfile.h | 2 +- .../low_fidelity/optimizeMissionProfile.cpp | 2 +- .../low_fidelity/optimizeMissionProfile.h | 2 +- .../src/taw/defaultMethods/payloadRange/abstractPayloadRange.h | 2 +- .../defaultMethods/payloadRange/low_fidelity/payloadRange.cpp | 2 +- .../taw/defaultMethods/payloadRange/low_fidelity/payloadRange.h | 2 +- .../src/taw/defaultMethods/performance_assessment_factory.cpp | 2 +- .../src/taw/defaultMethods/performance_assessment_factory.h | 2 +- .../src/taw/defaultMethods/performance_assessment_output.cpp | 2 +- .../src/taw/defaultMethods/performance_assessment_output.h | 2 +- .../src/taw/defaultMethods/performance_assessment_settings.cpp | 2 +- .../src/taw/defaultMethods/performance_assessment_settings.h | 2 +- .../takeOffPerformance/abstractTakeOffPerformance.h | 2 +- .../takeOffPerformance/low_fidelity/takeOffPerformance.cpp | 2 +- .../takeOffPerformance/low_fidelity/takeOffPerformance.h | 2 +- performance_assessment/src/toolinfo.h | 2 +- 48 files changed, 48 insertions(+), 48 deletions(-) diff --git a/performance_assessment/src/main.cpp b/performance_assessment/src/main.cpp index 0fb57149..f9b4e054 100644 --- a/performance_assessment/src/main.cpp +++ b/performance_assessment/src/main.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/performance_assessment.cpp b/performance_assessment/src/performance_assessment.cpp index 5c6f9d29..01015f06 100644 --- a/performance_assessment/src/performance_assessment.cpp +++ b/performance_assessment/src/performance_assessment.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/performance_assessment.h b/performance_assessment/src/performance_assessment.h index 7bba9c22..5bb3c36c 100644 --- a/performance_assessment/src/performance_assessment.h +++ b/performance_assessment/src/performance_assessment.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/SARPerformance/abstractSARPerformance.h b/performance_assessment/src/taw/defaultMethods/SARPerformance/abstractSARPerformance.h index 229da71d..2e14f772 100644 --- a/performance_assessment/src/taw/defaultMethods/SARPerformance/abstractSARPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/SARPerformance/abstractSARPerformance.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.cpp b/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.cpp index 179335d5..79ee9c2d 100644 --- a/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.cpp +++ b/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.h b/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.h index 446af407..a291b40d 100644 --- a/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/VnDiagram/abstractVnDiagram.h b/performance_assessment/src/taw/defaultMethods/VnDiagram/abstractVnDiagram.h index a4a129b6..84e24fbc 100644 --- a/performance_assessment/src/taw/defaultMethods/VnDiagram/abstractVnDiagram.h +++ b/performance_assessment/src/taw/defaultMethods/VnDiagram/abstractVnDiagram.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp b/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp index 2d96155c..f9853899 100644 --- a/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp +++ b/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.h b/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.h index 37b8fbda..b9a7a24e 100644 --- a/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.h +++ b/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/aircraft.cpp b/performance_assessment/src/taw/defaultMethods/aircraft.cpp index c794b4de..2ed612d3 100644 --- a/performance_assessment/src/taw/defaultMethods/aircraft.cpp +++ b/performance_assessment/src/taw/defaultMethods/aircraft.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/aircraft.h b/performance_assessment/src/taw/defaultMethods/aircraft.h index 05d0fbea..e1d47256 100644 --- a/performance_assessment/src/taw/defaultMethods/aircraft.h +++ b/performance_assessment/src/taw/defaultMethods/aircraft.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/ceilingPerformance/abstractCeilingPerformance.h b/performance_assessment/src/taw/defaultMethods/ceilingPerformance/abstractCeilingPerformance.h index 5757cd27..890bd46a 100644 --- a/performance_assessment/src/taw/defaultMethods/ceilingPerformance/abstractCeilingPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/ceilingPerformance/abstractCeilingPerformance.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/ceilingPerformance/low_fidelity/ceilingPerformance.cpp b/performance_assessment/src/taw/defaultMethods/ceilingPerformance/low_fidelity/ceilingPerformance.cpp index 26dab4ea..01b3599f 100644 --- a/performance_assessment/src/taw/defaultMethods/ceilingPerformance/low_fidelity/ceilingPerformance.cpp +++ b/performance_assessment/src/taw/defaultMethods/ceilingPerformance/low_fidelity/ceilingPerformance.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/ceilingPerformance/low_fidelity/ceilingPerformance.h b/performance_assessment/src/taw/defaultMethods/ceilingPerformance/low_fidelity/ceilingPerformance.h index 0cb16717..4517e52f 100644 --- a/performance_assessment/src/taw/defaultMethods/ceilingPerformance/low_fidelity/ceilingPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/ceilingPerformance/low_fidelity/ceilingPerformance.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/enginePerformance/abstractEnginePerformance.h b/performance_assessment/src/taw/defaultMethods/enginePerformance/abstractEnginePerformance.h index 031cd7b7..e7e843fa 100644 --- a/performance_assessment/src/taw/defaultMethods/enginePerformance/abstractEnginePerformance.h +++ b/performance_assessment/src/taw/defaultMethods/enginePerformance/abstractEnginePerformance.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/enginePerformance/low_fidelity/enginePerformance.cpp b/performance_assessment/src/taw/defaultMethods/enginePerformance/low_fidelity/enginePerformance.cpp index 2fbbd44b..38b8f566 100644 --- a/performance_assessment/src/taw/defaultMethods/enginePerformance/low_fidelity/enginePerformance.cpp +++ b/performance_assessment/src/taw/defaultMethods/enginePerformance/low_fidelity/enginePerformance.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/enginePerformance/low_fidelity/enginePerformance.h b/performance_assessment/src/taw/defaultMethods/enginePerformance/low_fidelity/enginePerformance.h index afffebf8..73b2a5cf 100644 --- a/performance_assessment/src/taw/defaultMethods/enginePerformance/low_fidelity/enginePerformance.h +++ b/performance_assessment/src/taw/defaultMethods/enginePerformance/low_fidelity/enginePerformance.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/flightEnvelopes/abstractFlightEnvelopes.h b/performance_assessment/src/taw/defaultMethods/flightEnvelopes/abstractFlightEnvelopes.h index e12d5130..b80ac17f 100644 --- a/performance_assessment/src/taw/defaultMethods/flightEnvelopes/abstractFlightEnvelopes.h +++ b/performance_assessment/src/taw/defaultMethods/flightEnvelopes/abstractFlightEnvelopes.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/flightEnvelopes/low_fidelity/flightEnvelopes.cpp b/performance_assessment/src/taw/defaultMethods/flightEnvelopes/low_fidelity/flightEnvelopes.cpp index 53caec3e..3b56020f 100644 --- a/performance_assessment/src/taw/defaultMethods/flightEnvelopes/low_fidelity/flightEnvelopes.cpp +++ b/performance_assessment/src/taw/defaultMethods/flightEnvelopes/low_fidelity/flightEnvelopes.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/flightEnvelopes/low_fidelity/flightEnvelopes.h b/performance_assessment/src/taw/defaultMethods/flightEnvelopes/low_fidelity/flightEnvelopes.h index d0b6ea88..a6a3b0ee 100644 --- a/performance_assessment/src/taw/defaultMethods/flightEnvelopes/low_fidelity/flightEnvelopes.h +++ b/performance_assessment/src/taw/defaultMethods/flightEnvelopes/low_fidelity/flightEnvelopes.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h index f83162d3..6f02a654 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.cpp b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.cpp index 9e8abf07..562d7768 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.cpp +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h index 55b75a27..dc503dab 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.cpp b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.cpp index c7925156..362acdcb 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.cpp +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.h index 481f464b..baceb59d 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.h +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp index 95ec252a..254b1d13 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.h index 267f8494..3ea0252d 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.h +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/landingPerformance/abstractLandingPerformance.h b/performance_assessment/src/taw/defaultMethods/landingPerformance/abstractLandingPerformance.h index eef06ef9..ddc10491 100644 --- a/performance_assessment/src/taw/defaultMethods/landingPerformance/abstractLandingPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/landingPerformance/abstractLandingPerformance.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/landingPerformance/low_fidelity/landingPerformance.cpp b/performance_assessment/src/taw/defaultMethods/landingPerformance/low_fidelity/landingPerformance.cpp index 0119aba6..7cd719c5 100644 --- a/performance_assessment/src/taw/defaultMethods/landingPerformance/low_fidelity/landingPerformance.cpp +++ b/performance_assessment/src/taw/defaultMethods/landingPerformance/low_fidelity/landingPerformance.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/landingPerformance/low_fidelity/landingPerformance.h b/performance_assessment/src/taw/defaultMethods/landingPerformance/low_fidelity/landingPerformance.h index 045c3fe9..cf8decd8 100644 --- a/performance_assessment/src/taw/defaultMethods/landingPerformance/low_fidelity/landingPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/landingPerformance/low_fidelity/landingPerformance.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/missionDefinition.cpp b/performance_assessment/src/taw/defaultMethods/missionDefinition.cpp index 9828f219..05bb3a49 100644 --- a/performance_assessment/src/taw/defaultMethods/missionDefinition.cpp +++ b/performance_assessment/src/taw/defaultMethods/missionDefinition.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/missionDefinition.h b/performance_assessment/src/taw/defaultMethods/missionDefinition.h index d2a72f3d..7136a0a0 100644 --- a/performance_assessment/src/taw/defaultMethods/missionDefinition.h +++ b/performance_assessment/src/taw/defaultMethods/missionDefinition.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/abstractOptimizeMissionProfile.h b/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/abstractOptimizeMissionProfile.h index 2d1ee16d..8e6a75a7 100644 --- a/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/abstractOptimizeMissionProfile.h +++ b/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/abstractOptimizeMissionProfile.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.cpp b/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.cpp index 3281c9a8..395b61b7 100644 --- a/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.cpp +++ b/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.h b/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.h index 0ec2ab81..25b02671 100644 --- a/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.h +++ b/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/payloadRange/abstractPayloadRange.h b/performance_assessment/src/taw/defaultMethods/payloadRange/abstractPayloadRange.h index 02af9a88..b2e1819e 100644 --- a/performance_assessment/src/taw/defaultMethods/payloadRange/abstractPayloadRange.h +++ b/performance_assessment/src/taw/defaultMethods/payloadRange/abstractPayloadRange.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp b/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp index 21abcf6b..eb3e1af0 100644 --- a/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp +++ b/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.h b/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.h index 5dbb5f6a..b5dd8b00 100644 --- a/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.h +++ b/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp index 9b1ce385..f7129740 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.h b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.h index 6d382c67..adb51d9d 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.h +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp index f34bc3c4..0e438213 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h index a3c0f6bc..024470f7 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp index aa086ff9..ec52051a 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h index cb0f658a..c3e380dc 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/takeOffPerformance/abstractTakeOffPerformance.h b/performance_assessment/src/taw/defaultMethods/takeOffPerformance/abstractTakeOffPerformance.h index 0902ceed..6844b8f0 100644 --- a/performance_assessment/src/taw/defaultMethods/takeOffPerformance/abstractTakeOffPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/takeOffPerformance/abstractTakeOffPerformance.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/takeOffPerformance/low_fidelity/takeOffPerformance.cpp b/performance_assessment/src/taw/defaultMethods/takeOffPerformance/low_fidelity/takeOffPerformance.cpp index 394d7501..c4e1874d 100644 --- a/performance_assessment/src/taw/defaultMethods/takeOffPerformance/low_fidelity/takeOffPerformance.cpp +++ b/performance_assessment/src/taw/defaultMethods/takeOffPerformance/low_fidelity/takeOffPerformance.cpp @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/taw/defaultMethods/takeOffPerformance/low_fidelity/takeOffPerformance.h b/performance_assessment/src/taw/defaultMethods/takeOffPerformance/low_fidelity/takeOffPerformance.h index 1216f83f..ed0b3c11 100644 --- a/performance_assessment/src/taw/defaultMethods/takeOffPerformance/low_fidelity/takeOffPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/takeOffPerformance/low_fidelity/takeOffPerformance.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/performance_assessment/src/toolinfo.h b/performance_assessment/src/toolinfo.h index aa846b0e..9ea7a76d 100644 --- a/performance_assessment/src/toolinfo.h +++ b/performance_assessment/src/toolinfo.h @@ -1,7 +1,7 @@ /* * UNICADO - UNIversity Conceptual Aircraft Design and Optimization * - * Copyright (C) 2024 UNICADO consortium + * Copyright (C) 2025 UNICADO consortium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by -- GitLab From da43086619c7e35f88b93ed70a137efa86559c71 Mon Sep 17 00:00:00 2001 From: moritzbarnert <moritz.barnert@ilr.rwth-aachen.de> Date: Wed, 19 Feb 2025 10:10:00 +0100 Subject: [PATCH 06/19] first draft of performance_assesment_report --- .../performance_assessment_report.cpp | 48 +++++++++++++++++++ .../performance_assessment_report.h | 44 +++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 performance_assessment/src/taw/defaultMethods/performance_assessment_report.cpp create mode 100644 performance_assessment/src/taw/defaultMethods/performance_assessment_report.h diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_report.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_report.cpp new file mode 100644 index 00000000..d50cade3 --- /dev/null +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_report.cpp @@ -0,0 +1,48 @@ +/* + * UNICADO - UNIversity Conceptual Aircraft Design and Optimization + * + * Copyright (C) 2024 UNICADO consortium + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + * Description: + * This file is part of UNICADO. + */ + +void performance_assesment_report::setHtmlBody(){ + + report_.htmlReportStream() << "<div class=\"box data\">\n"; + report_.htmlReportStream() << "<h1>Program Mode: "; + // Add the plot image to the HTML report + std::string plotFilePath = rtIO_->getPlotFilesDir() + "/payload_range_diagram_plot.svg"; + report_.htmlReportStream() << "<div class=\"plot-container\">\n"; + report_.htmlReportStream() << "<img class=\"image-plot\" src=\"" + relativePath(rtIO_->getPlotFilesDir(), rtIO_->getReportDir()) + "/_payload_range.svg\">" << std::endl; + report_.htmlReportStream() << "</div>" << std::endl; + + + report_.htmlReportStream() << "<h2>Points of the payload-range diagram</h2>" << std::endl; + report_.htmlReportStream() << "<table>" << std::endl; + report_.htmlReportStream() << "<tr><td>/td><td> Payload </td><td> Range </td></tr>" << std::endl; + report_.htmlReportStream() << "<tr><td>Point 1</td><td>" << Rounding(theAcftPt->maxPayload, 0) << " kg</td><td> 0 km</td></tr>" << std::endl; + report_.htmlReportStream() << "<tr><td>Point 2</td><td>" << Rounding(Payload.at(1), 0) << " kg</td><td> " << Rounding(Range.at(1), 0) << " km</td></tr>" << std::endl; + report_.htmlReportStream() << "<tr><td>Point 3</td><td>" << Rounding(Payload.at(2), 0) << " kg</td><td> " << Rounding(Range.at(2), 0) << " km</td></tr>" << std::endl; + report_.htmlReportStream() << "<tr><td>Point 4</td><td>" << Rounding(Payload.at(3), 0) << " kg</td><td> " << Rounding(Range.at(3), 0) << " km</td></tr>" << std::endl; + report_.htmlReportStream() << "</table>" << std::endl; + +} + +theReport.htmlReportStream() << "<img src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + + theProgramName + "_payloadRange.svg\">" << std::endl; + +std::string plot_file_path = rtIO->getPlotDir() + "/" + std::string(TOOL_NAME) + "_payload_range.svg"; \ No newline at end of file diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_report.h b/performance_assessment/src/taw/defaultMethods/performance_assessment_report.h new file mode 100644 index 00000000..a7335f59 --- /dev/null +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_report.h @@ -0,0 +1,44 @@ +/* + * UNICADO - UNIversity Conceptual Aircraft Design and Optimization + * + * Copyright (C) 2024 UNICADO consortium + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + * + * Description: + * This file is part of UNICADO. + */ + +#include <memory> +#include <vector> + +#include <moduleBasics/report.h> +#include <moduleBasics/plot.h> +#include "../../toolinfo.h" + + + +class performance_assesment_report{ + public: + void run(); + void update(); + void report(); + void save(); + + + + private: + std::shared_ptr<RuntimeIO> rtIO_; + Report report_; +}; \ No newline at end of file -- GitLab From e257f8b79a70b6673ba97f63a9e1f9786bca7390 Mon Sep 17 00:00:00 2001 From: philipphansmann <Philipp Hansmann> Date: Wed, 19 Feb 2025 10:41:24 +0100 Subject: [PATCH 07/19] added v1 of html-Report, minor cleanup --- .../performance_assessment_conf.xml | 24 +-- .../fuelPlanning/abstractFuelPlanning.h | 20 +-- .../low_fidelity/flightSimulator.h | 4 +- .../low_fidelity/fuelFromMassFraction.h | 6 +- .../fuelPlanning/low_fidelity/fuelPlanning.h | 41 +---- .../abstractLandingPerformance.h | 6 +- .../low_fidelity/landingPerformance.h | 33 +--- .../low_fidelity/payloadRange.cpp | 3 +- .../performance_assessment_output.cpp | 169 +++--------------- .../performance_assessment_report.cpp | 48 ----- .../performance_assessment_report.h | 44 ----- 11 files changed, 62 insertions(+), 336 deletions(-) delete mode 100644 performance_assessment/src/taw/defaultMethods/performance_assessment_report.cpp delete mode 100644 performance_assessment/src/taw/defaultMethods/performance_assessment_report.h diff --git a/performance_assessment/performance_assessment_conf.xml b/performance_assessment/performance_assessment_conf.xml index 1d42544d..f00031c5 100644 --- a/performance_assessment/performance_assessment_conf.xml +++ b/performance_assessment/performance_assessment_conf.xml @@ -56,7 +56,7 @@ <performance_checks description="Settings that affect different functionalities!"> <fuel_planning description="Fuel planning calculation"> <switch description="Switch for fuel estimation; Switch: true (on) / false (off)"> - <value>true</value> + <value>false</value> </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> <value>low</value> @@ -69,7 +69,7 @@ </contingency_fuel> </fuel_planning> <payload_range_diagram description="Payload Range Diagram calculation"> - <switch description="Switch to calculate the Payload Range Diagram; Switch: true (on) / flase (off)"> + <switch description="Switch to calculate the Payload Range Diagram; Switch: true (on) / false (off)"> <value>true</value> </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> @@ -77,7 +77,7 @@ </fidelity_level> </payload_range_diagram> <engine_performance description="Engine power estimation"> - <switch description="Switch to calculate the enigne power estimation; Switch: true (on) / flase (off)"> + <switch description="Switch to calculate the enigne power estimation; Switch: true (on) / false (off)"> <value>true</value> </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> @@ -85,7 +85,7 @@ </fidelity_level> </engine_performance> <flight_envelope_performance description="Estimation of flight range limits"> - <switch description="Switch to calculate the estimation of flight range limits; Switch: true (on) / flase (off)"> + <switch description="Switch to calculate the estimation of flight range limits; Switch: true (on) / false (off)"> <value>true</value> </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> @@ -96,7 +96,7 @@ </overwrite_initial_values> </flight_envelope_performance> <climb_performance description="Calculate the climb performance (so far only for plots)"> - <switch description="Switch to calculate climb performance; Switch: true (on) / flase (off)"> + <switch description="Switch to calculate climb performance; Switch: true (on) / false (off)"> <value>true</value> </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> @@ -104,18 +104,18 @@ </fidelity_level> </climb_performance> <takeoff_performance description="Estimation of the starting distance"> - <switch description="Switch to calculate the estimation of the starting distance; Switch: true (on) / flase (off)"> - <value>true</value> + <switch description="Switch to calculate the estimation of the starting distance; Switch: true (on) / false (off)"> + <value>false</value> </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> <value>low</value> </fidelity_level> - <calculate_blfl_performance description="Switch to calculate the blfl performance; Switch: true (on) / flase (off)"> + <calculate_blfl_performance description="Switch to calculate the blfl performance; Switch: true (on) / false (off)"> <value>true</value> </calculate_blfl_performance> </takeoff_performance> <landing_performance description="Estimation of the landing distance" > - <switch description="Switch to calculate the estimation of the landing distance; Switch: true (on) / flase (off)"> + <switch description="Switch to calculate the estimation of the landing distance; Switch: true (on) / false (off)"> <value>true</value> </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> @@ -123,7 +123,7 @@ </fidelity_level> </landing_performance> <vn_diagram description="Calculate the V-n diagram"> - <switch description="Switch to calculate the V-n diagram; Switch: true (on) / flase (off)"> + <switch description="Switch to calculate the V-n diagram; Switch: true (on) / false (off)"> <value>true</value> </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> @@ -199,11 +199,11 @@ <value>false</value> </use_study_mission_for_analysis> <mtom_design description="Switch for the redetermination of the MTOM; Switch: true (yes, e.g. DesignLoop) / fales (no, e.g. only analysis)"> - <value>flase</value> + <value>false</value> </mtom_design> </modes> <mission description="Specification of the mission"> - <optimize_mission_profile description="Switch to optimize the mission profile; Switch: true (on) / flase (off)"> + <optimize_mission_profile description="Switch to optimize the mission profile; Switch: true (on) / false (off)"> <value>false</value> </optimize_mission_profile> <fidelity_level description= "Select the fidelity level of the calculation (options: low)"> diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h index 6f02a654..93dcb894 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h @@ -32,7 +32,7 @@ class performance_assessment_factory; /* Abstract class of fuel planning */ // The purpose of this class is to be inherited by all "fuelPlanning" (high/mid/.../low) methods. -class abstractFuelPlanning : public std::enable_shared_from_this<abstractFuelPlanning> { +class abstractFuelPlanning { public: virtual ~abstractFuelPlanning() { } virtual void doFuelPlanning() = 0; @@ -71,14 +71,14 @@ class abstractFuelPlanning : public std::enable_shared_from_this<abstractFuelPla */ class missionFuelData { public: - double Time; /**< Time spent for the mission (min) */ - double Range; /**< Distance covered in the mission (km) */ + double Time; /**< Time spent for the mission (s) */ + double Range; /**< Distance covered in the mission (m) */ double Altitude; /**< Aircraft altitude during the mission (m) */ double TAS; /**< True air speed during the mission (m/s) */ double Mach; /**< Mach number during the mission (-) */ double Mass; /**< Aircraft mass (kg) */ double consumedFuel; /**< Fuel consumed during the mission (kg) */ - double Thrust; /**< Aircraft thrust (kN) */ + double Thrust; /**< Aircraft thrust (N) */ double fuelFlow; /**< Fuel flow (kg/s) */ double ROC; /**< Aircraft rate of climb (m/s) */ @@ -104,7 +104,7 @@ class abstractFuelPlanning : public std::enable_shared_from_this<abstractFuelPla */ class payloadRangeData { public: - double Range; /**< Distance covered in the mission based on the payload-range diagram (NM) */ + double Range; /**< Distance covered in the mission based on the payload-range diagram (m) */ double Payload; /**< Payload carried by the aircraft (kg) */ double Fuel; /**< Fuel carried by the aircraft (kg) */ double TOM; /**< Aircraft take-off mass (kg) */ @@ -117,14 +117,8 @@ class abstractFuelPlanning : public std::enable_shared_from_this<abstractFuelPla }; std::vector<payloadRangeData> myPayloadRange; /**< List of values of the payload-range diagram */ - double tripTime; /**< Trip time (min) */ - double blockTime; /**< Block time (min) */ - - std::shared_ptr<taw::performance_assessment_factory> theFactory; - void setFactory(std::shared_ptr<taw::performance_assessment_factory> aFactory) { this->theFactory = aFactory; } + double tripTime; /**< Trip time (s) */ + double blockTime; /**< Block time (s) */ }; #endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_ABSTRACTFUELPLANNING_H_ - - - diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h index dc503dab..a94261fe 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h @@ -42,7 +42,7 @@ using std::string; class flightSimulator { public: /**\brief Function to calculate the taxi fuel - *\param taxi time (min) + *\param taxi time (s) * \return taxi fuel (kg) */ double calcTaxiFuel(double taxiTime); @@ -207,7 +207,7 @@ class flightSimulator { *\param theROC Rate of climb (m/s) *\param theConfiguration Flap configuration (-) *\param AERO Object of the aerodynamics class - *\return The required thrust for the given rate of climb (kN) + *\return The required thrust for the given rate of climb (N) */ double calcThrustForROC(double massOfAC, double H, double Mach, double theROC, string theConfiguration, aerodynamics theAERO); }; diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.h index baceb59d..e26401cc 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.h +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.h @@ -46,7 +46,7 @@ class fuelFromMassFraction { *\param targetMissionFuel Supposed aircraft mission fuel needed (kg) *\param targetTripFuel Supposed aircraft trip fuel needed (kg) *\param designPayload Aircraft design payload (kg) - *\param designRange Aircraft design range (NM) + *\param designRange Aircraft design range (m) */ void calibrateBreguet(double targetMissionFuel, double targetTripFuel, double designPayload, double designRange); @@ -54,14 +54,14 @@ class fuelFromMassFraction { *\param payloadForRange Aircraft payload (kg) *\param takeOffMass Aircraft take-off mass (kg) *\param theMTOM Maximum aircraft take off mass (kg) - *\param theDesignRange Aircraft design range (NM) + *\param theDesignRange Aircraft design range (m) *\return range of the aircraft after Breguet */ double iterativeBreguetForRange(double payloadForRange, double takeOffMass, double theMTOM, double theDesignRange); /**\brief Function calculates the block and the trip fuel for the given payload and range *\param missionPayload Payload during the mission (kg) - *\param missionRange Aircraft range of the mission (NM) + *\param missionRange Aircraft range of the mission (m) */ void calcFuelFromMassFractions(double missionPayload, double missionRange); diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.h index 3ea0252d..6fe9ea9c 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.h +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.h @@ -44,10 +44,6 @@ #include "../../SARPerformance/low_fidelity/SARPerformance.h" // <-- questionable -namespace taw { -class performance_assessment_factory; -} - namespace low { class fuelPlanning : public ::abstractFuelPlanning { @@ -69,27 +65,6 @@ class fuelPlanning : public ::abstractFuelPlanning { */ virtual ~fuelPlanning() { } - // /**\class payloadRangeData Class with parameters for the payload range diagram - // * - // */ - // class payloadRangeData { - // public: - // double Range; /**< Distance covered in the mission based on the payload-range diagram (NM) */ - // double Payload; /**< Payload carried by the aircraft (kg) */ - // double Fuel; /**< Fuel carried by the aircraft (kg) */ - // double TOM; /**< Aircraft take-off mass (kg) */ - // payloadRangeData() { - // Range = 0.0; - // Payload = 0.0; - // Fuel = 0.0; - // TOM = 0.0; - // } - // }; - // vector<payloadRangeData> myPayloadRange; /**< List of values of the payload-range diagram */ - - // double tripTime; /**< Trip time (min) */ - // double blockTime; /**< Block time (min) */ - /**\brief Calculates the data for the payload range diagram * */ @@ -124,7 +99,7 @@ class fuelPlanning : public ::abstractFuelPlanning { double ROC; /**< Aircraft rate of climb (m/s) */ double derate; /**< Artificial constant to reduce the engine spool speed (between 0 and 1) */ double bleedOff; /**< Current bleed air offtake (kg/s) */ - double shaftOff; /**< Current shaft power offtake (kW) */ + double shaftOff; /**< Current shaft power offtake (W) */ string config; /**< Flap configuration of the aircraft */ string rating; /**< Engine rating (Take-Off, MaxCont, Climb, Idle, Cruise) */ @@ -152,7 +127,7 @@ class fuelPlanning : public ::abstractFuelPlanning { *\param theAlternateFuel Alternate fuel (kg) *\param theFinalReserveFuel Final reserve fuel (kg) *\param theTripFuel Trip fuel (kg) - *\param theRange Aircraft range (km) + *\param theRange Aircraft range (m) *\param thePayload Aircraft payload (kg) *\param writingMissionData Switch if the fuel mission data shall be written *\param myAERO Object of the aerodynamics class @@ -164,7 +139,7 @@ class fuelPlanning : public ::abstractFuelPlanning { /**\brief Function to calculate the block fuel *\param acMass Aircraft mass (kg) - *\param Range Aircraft range (NM) + *\param Range Aircraft range (m) *\param writeMission Switch if the fuel mission data shall be written) *\param theAERO Object of the aerodynamics class *\return Block fuel (kg) @@ -188,7 +163,7 @@ class fuelPlanning : public ::abstractFuelPlanning { /**\brief Method to calculate the trip fuel *\param WO Take-Off mass (kg) *\param Time Cruise duration at 10000 ft (s) - *\param theSFC Specific fuel consumption (kg/kN*s) + *\param theSFC Specific fuel consumption (kg/N*s) *\param theLoD glide ratio *\return Fuel mass (kg) */ @@ -204,12 +179,12 @@ class fuelPlanning : public ::abstractFuelPlanning { double calcBestSARSpeed(double alt, double mass, double lowerSpeed, double upperSpeed); // /**\brief Function calculates the remaining range to reach a target mass -// *\param Range0 First range value (NM) -// *\param Range1 Second range value (NM) +// *\param Range0 First range value (m) +// *\param Range1 Second range value (m) // *\param Mass0 First mass value (kg) // *\param Mass1 Second mass value (kg) // *\param targetMass Target mass (kg) -// *\return Remaining range (NM) +// *\return Remaining range (m) // */ // double calcRangeForMass(double Range0, double Range1, double Mass0, double Mass1, double targetMass); @@ -236,7 +211,7 @@ class fuelPlanning : public ::abstractFuelPlanning { /**\brief Function checks if the thrust allows a steady level flight *\param ID Mission segment *\param theP Object of the pointData class - *\param theDrag Drag (kN) + *\param theDrag Drag (N) */ void exitSteadyLevelFlight(int ID, pointData theP, double theDrag); diff --git a/performance_assessment/src/taw/defaultMethods/landingPerformance/abstractLandingPerformance.h b/performance_assessment/src/taw/defaultMethods/landingPerformance/abstractLandingPerformance.h index ddc10491..c75e6ebb 100644 --- a/performance_assessment/src/taw/defaultMethods/landingPerformance/abstractLandingPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/landingPerformance/abstractLandingPerformance.h @@ -19,8 +19,8 @@ * Description: * This file is part of UNICADO. */ -#ifndef performance_assessment_SRC_TAW_DEFAULTMETHODS_LANDINGPERFORMANCE_ABSTRACTLANDINGPERFORMANCE_H_ -#define performance_assessment_SRC_TAW_DEFAULTMETHODS_LANDINGPERFORMANCE_ABSTRACTLANDINGPERFORMANCE_H_ +#ifndef PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_LANDINGPERFORMANCE_ABSTRACTLANDINGPERFORMANCE_H_ +#define PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_LANDINGPERFORMANCE_ABSTRACTLANDINGPERFORMANCE_H_ #include <vector> @@ -62,4 +62,4 @@ class abstractLandingPerformance { }; -#endif // performance_assessment_SRC_TAW_DEFAULTMETHODS_LANDINGPERFORMANCE_ABSTRACTLANDINGPERFORMANCE_H_ +#endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_LANDINGPERFORMANCE_ABSTRACTLANDINGPERFORMANCE_H_ diff --git a/performance_assessment/src/taw/defaultMethods/landingPerformance/low_fidelity/landingPerformance.h b/performance_assessment/src/taw/defaultMethods/landingPerformance/low_fidelity/landingPerformance.h index cf8decd8..d3370db8 100644 --- a/performance_assessment/src/taw/defaultMethods/landingPerformance/low_fidelity/landingPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/landingPerformance/low_fidelity/landingPerformance.h @@ -36,42 +36,11 @@ using std::vector; namespace low { -/**\class landingPerformance Class contains the landing performance data +/**\class landingPerformance class contains the landing performance data * */ class landingPerformance :public abstractLandingPerformance { public: - // /**\class dataLND Class contains data about the landing - // * - // */ - // class dataLDN { - // public: - // /** \brief Allowed landing distance with all engines operating and MLM - // * \details landing distance required including 60% safety margin (EASA: 60 percent of maximum available runway length) (m) - // */ - // double ALD_AEO; - // double grossMass; /**< Aircraft mass (kg) */ - - // dataLDN() { - // ALD_AEO = 0.0; - // grossMass = 0.0; - // } - // }; - - // /**\class dataElevationLDN Class contains landing parameters for different elevations - // * - // */ - // class dataElevationLDN { - // public: - // double elevation; /**< Elevation (m) */ - // vector<dataLDN> myLDN; /**< List of landing data (time, mass, landing distance) */ - - // dataElevationLDN() { - // elevation = 0.0; - // } - // }; - // vector<dataElevationLDN> myLDNField; /**< List of elevation at landing data */ - /**\brief Function to calculate the landing distance for different altitudes and aircraft masses *\param theRunwaySlope Slope of the runway (rad) *\param theGroundFrictionBraking Friction coefficient at full braking (-) diff --git a/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp b/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp index eb3e1af0..6b301f50 100644 --- a/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp +++ b/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp @@ -66,7 +66,8 @@ void payloadRange::calcPayloadRange() { Range.push_back(0.); /* Determination of the design point according to Breguet and deviation from the given (real) design range */ // TODO(franz#1#): Mass fractions aus Requirement-Mission bestimmen - double designRangeBreguet = -breguetFactor * log((theAcftPt->OME + theAcftPt->designPayload) / (0.9065 * theAcftPt->MTOM)); + double designRangeBreguet = -breguetFactor * log((theAcftPt->OME + theAcftPt->designPayload) / (0.9065 * theAcftPt->MTOM)); // TODO(Hansman): Fuel consumed during takeoff + // and climb shall not be hardcoded double calibrateFactor = theAcftPt->designRange / designRangeBreguet; myRuntimeInfo->out << "calibrateFactor Breguet: " << calibrateFactor << endl; /* Determination of the 2nd point */ diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp index 0e438213..406b0d01 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp @@ -62,153 +62,32 @@ performance_assessment_output::~performance_assessment_output() { } void performance_assessment_output::generateHtmlBody() { - theReport.htmlReportStream() << "<h1>Report " << myAcftPt->acftName << "</h1>" << std::endl; - if (mySettingsPt->mySwitches.doFuelPlanning == true) { - theReport.htmlReportStream() << "<h2>Fuel Planning</h2>" << std::endl - << "<table class=\"ceras\">" << std::endl - << "<tr>" << std::endl - << "<td>Taxi Fuel: </td><td>" << abstractFuelPlanningPt->myFuel.taxiFuelTakeoff + abstractFuelPlanningPt->myFuel.taxiFuelLanding << " kg</td>" << std::endl - << "</tr>" << std::endl - << "<tr>" << std::endl - << "<td>Mission Fuel: </td><td>" << abstractFuelPlanningPt->myFuel.missionFuel << " kg</td>" << std::endl - << "</tr>" << std::endl - << "<tr>" << std::endl - << "<td>Trip Fuel: </td><td>" << abstractFuelPlanningPt->myFuel.tripFuel << " kg</td>" << std::endl - << "</tr>" << std::endl - << "<tr>" << std::endl - << "<td>-> TOM: </td><td>" << Rounding(myAcftPt->OME - + myAcftPt->myMission.missionPayload - + abstractFuelPlanningPt->myFuel.missionFuel - - abstractFuelPlanningPt->myFuel.taxiFuelTakeoff, 1) << " kg</td>" << std::endl - << "</tr>" << std::endl - << "<tr>" << std::endl - << "<td>-> MTOM: </td><td>" << myAcftPt->MTOM << " kg</td>" << std::endl - << "</tr>" << std::endl - << "</table>" << std::endl - << "<img class=\"ceras\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) - + theProgramName + "_Mission_plot.svg\">" << std::endl; - } - theReport.htmlReportStream() << "<h2>Payload Range</h2>" << std::endl; - if (mySettingsPt->mySwitches.doPayloadRange == true) { - if (mySettingsPt->mySwitches.doFuelPlanning == true) { - theReport.htmlReportStream() << "<img src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + - theProgramName + "_payloadRange.svg\">" << std::endl; - } else { - if (abstractPayloadRangePt->Range.at(2) > myAcftPt->designRange) { - theReport.htmlReportStream() << "<img src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + - theProgramName + "_payloadRange.svg\">" << std::endl; - } else { - theReport.htmlReportStream() << "<table>" << std::endl - << "<tr>" << std::endl - << "<td>... not calculated due to error (Range_maxFuelatMTOM smaller DesignRange)!</td>" << std::endl - << "</tr>" << std::endl - << "</table>" << std::endl; - } - } - } else { - theReport.htmlReportStream() << "<table>" << std::endl - << "<tr>" << std::endl - << "<td>... not calculated!</td>" << std::endl - << "</tr>" << std::endl - << "</table>" << std::endl; - } - theReport.htmlReportStream() << "<h2>Flight Envelope</h2>" << std::endl; - if (mySettingsPt->mySwitches.doFlightEnvelopePerformance == true) { - theReport.htmlReportStream() << "<img src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + - theProgramName + "_FlightEnvelope.svg\">" << std::endl; - } else { - theReport.htmlReportStream() << "<table>" << std::endl - << "<tr>" << std::endl - << "<td>... not calculated!</td>" << std::endl - << "</tr>" << std::endl - << "</table>" << std::endl; - } - theReport.htmlReportStream() << "<h2>Ceiling</h2>" << std::endl; - if (mySettingsPt->mySwitches.doFlightEnvelopePerformance == true) { - theReport.htmlReportStream() << "<img src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + - theProgramName + "_Ceiling.svg\">" << std::endl; - } else { - theReport.htmlReportStream() << "<table>" << std::endl - << "<tr>" << std::endl - << "<td>... not calculated!</td>" << std::endl - << "</tr>" << std::endl - << "</table>" << std::endl; - } - theReport.htmlReportStream() << "<h2>Specific Air Range (SAR)</h2>" << std::endl; - if (mySettingsPt->mySwitches.doFlightEnvelopePerformance == true) { - theReport.htmlReportStream() << "<img src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + - theProgramName + "_SAR.svg\">" << std::endl - << "<div id=\"wrapper\">" << std::endl - << "<div id=\"leftCol\">" << std::endl - << "<h2>Best Specific Air Range (SAR)</h2>" << std::endl - << "<img class=\"ceras\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + - theProgramName + "_bestSAR.svg\">" << std::endl - << "</div>" << std::endl - << "</div>" << std::endl; - } else { - theReport.htmlReportStream() << "<table>" << std::endl - << "<tr>" << std::endl - << "<td>... not calculated!</td>" << std::endl - << "</tr>" << std::endl - << "</table>" << std::endl; - } - theReport.htmlReportStream() << "<h2>Takeoff Performance</h2>" << std::endl; - if (mySettingsPt->mySwitches.doTOPerformance == true) { - theReport.htmlReportStream() << "<img src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + - theProgramName + "_TOFL.svg\">" << std::endl; - } else { - theReport.htmlReportStream() << "<table>" << std::endl - << "<tr>" << std::endl - << "<td>... not calculated!</td>" << std::endl - << "</tr>" << std::endl - << "</table>" << std::endl; - } - theReport.htmlReportStream() << "<h2>BFL Performance</h2>" << std::endl; - if (mySettingsPt->mySwitches.doBLFLPerformance == true) { - theReport.htmlReportStream() << "<img src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + - theProgramName + "_BLFL.svg\">" << std::endl; - } else { - theReport.htmlReportStream() << "<table>" << std::endl - << "<tr>" << std::endl - << "<td>... not calculated!</td>" << std::endl - << "</tr>" << std::endl - << "</table>" << std::endl; - } - theReport.htmlReportStream() << "<h2>Landing Performance</h2>" << std::endl; - if (mySettingsPt->mySwitches.doLandingPerformance == true) { - theReport.htmlReportStream() << "<img src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + - theProgramName + "_LDN.svg\">" << std::endl; - } else { - theReport.htmlReportStream() << "<table>" << std::endl - << "<tr>" << std::endl - << "<td>... not calculated!</td>" << std::endl - << "</tr>" << std::endl - << "</table>" << std::endl; - } - theReport.htmlReportStream() << "<h2>Engine Performance</h2>" << std::endl; - if (mySettingsPt->mySwitches.doEnginePerformance == true) { - theReport.htmlReportStream() << "<img src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + - theProgramName + "_EnginePerformance.svg\">" << std::endl; - } else { - theReport.htmlReportStream() << "<table>" << std::endl - << "<tr>" << std::endl - << "<td>... not calculated!</td>" << std::endl - << "</tr>" << std::endl - << "</table>" << std::endl; - } - theReport.htmlReportStream() << "<h2>V-n-Diagram</h2>" << std::endl; - if (mySettingsPt->mySwitches.doVnDiagram == true) { - theReport.htmlReportStream() << "<img src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + - theProgramName + "_VnDiagram.svg\">" << std::endl; - } else { - theReport.htmlReportStream() << "<table>" << std::endl - << "<tr>" << std::endl - << "<td>... not calculated!</td>" << std::endl - << "</tr>" << std::endl - << "</table>" << std::endl; - } + + theReport.htmlReportStream() << "<div class=\"box data\">\n"; + theReport.htmlReportStream() << "<h1>Program Mode: "; + // Add the plot image to the HTML report + theReport.htmlReportStream() << "<div class=\"plot-container\">\n"; + theReport.htmlReportStream() << "<img class=\"image-plot\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_payload_range.svg\">" << std::endl; + theReport.htmlReportStream() << "</div>" << std::endl; + + theReport.htmlReportStream() << "<h2>Points of the payload-range diagram</h2>" << std::endl; + theReport.htmlReportStream() << "<table>" << std::endl; + theReport.htmlReportStream() << "<tr><td>/td><td> Payload </td><td> Range </td></tr>" << std::endl; + theReport.htmlReportStream() << "<tr><td>Point 1</td><td>" << Rounding(abstractPayloadRangePt->Payload.at(0), 0) << " kg</td><td> 0 km</td></tr>" << std::endl; + theReport.htmlReportStream() << "<tr><td>Point 2</td><td>" << Rounding(abstractPayloadRangePt->Payload.at(1), 0) << " kg</td><td> " << + Rounding(abstractPayloadRangePt->Range.at(1), 0) << " km</td></tr>" << std::endl; + theReport.htmlReportStream() << "<tr><td>Point 3</td><td>" << Rounding(abstractPayloadRangePt->Payload.at(2), 0) << " kg</td><td> " << + Rounding(abstractPayloadRangePt->Range.at(2), 0) << " km</td></tr>" << std::endl; + theReport.htmlReportStream() << "<tr><td>Point 4</td><td>" << Rounding(abstractPayloadRangePt->Payload.at(3), 0) << " kg</td><td> " << + Rounding(abstractPayloadRangePt->Range.at(3), 0) << " km</td></tr>" << std::endl; + theReport.htmlReportStream() << "</table>" << std::endl; + + theReport.generateReports(); } + + void performance_assessment_output::writeXmlOutput() { string subPath; /* MTOM */ diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_report.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_report.cpp deleted file mode 100644 index d50cade3..00000000 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_report.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * UNICADO - UNIversity Conceptual Aircraft Design and Optimization - * - * Copyright (C) 2024 UNICADO consortium - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - * - * Description: - * This file is part of UNICADO. - */ - -void performance_assesment_report::setHtmlBody(){ - - report_.htmlReportStream() << "<div class=\"box data\">\n"; - report_.htmlReportStream() << "<h1>Program Mode: "; - // Add the plot image to the HTML report - std::string plotFilePath = rtIO_->getPlotFilesDir() + "/payload_range_diagram_plot.svg"; - report_.htmlReportStream() << "<div class=\"plot-container\">\n"; - report_.htmlReportStream() << "<img class=\"image-plot\" src=\"" + relativePath(rtIO_->getPlotFilesDir(), rtIO_->getReportDir()) + "/_payload_range.svg\">" << std::endl; - report_.htmlReportStream() << "</div>" << std::endl; - - - report_.htmlReportStream() << "<h2>Points of the payload-range diagram</h2>" << std::endl; - report_.htmlReportStream() << "<table>" << std::endl; - report_.htmlReportStream() << "<tr><td>/td><td> Payload </td><td> Range </td></tr>" << std::endl; - report_.htmlReportStream() << "<tr><td>Point 1</td><td>" << Rounding(theAcftPt->maxPayload, 0) << " kg</td><td> 0 km</td></tr>" << std::endl; - report_.htmlReportStream() << "<tr><td>Point 2</td><td>" << Rounding(Payload.at(1), 0) << " kg</td><td> " << Rounding(Range.at(1), 0) << " km</td></tr>" << std::endl; - report_.htmlReportStream() << "<tr><td>Point 3</td><td>" << Rounding(Payload.at(2), 0) << " kg</td><td> " << Rounding(Range.at(2), 0) << " km</td></tr>" << std::endl; - report_.htmlReportStream() << "<tr><td>Point 4</td><td>" << Rounding(Payload.at(3), 0) << " kg</td><td> " << Rounding(Range.at(3), 0) << " km</td></tr>" << std::endl; - report_.htmlReportStream() << "</table>" << std::endl; - -} - -theReport.htmlReportStream() << "<img src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + - theProgramName + "_payloadRange.svg\">" << std::endl; - -std::string plot_file_path = rtIO->getPlotDir() + "/" + std::string(TOOL_NAME) + "_payload_range.svg"; \ No newline at end of file diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_report.h b/performance_assessment/src/taw/defaultMethods/performance_assessment_report.h deleted file mode 100644 index a7335f59..00000000 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_report.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * UNICADO - UNIversity Conceptual Aircraft Design and Optimization - * - * Copyright (C) 2024 UNICADO consortium - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - * - * Description: - * This file is part of UNICADO. - */ - -#include <memory> -#include <vector> - -#include <moduleBasics/report.h> -#include <moduleBasics/plot.h> -#include "../../toolinfo.h" - - - -class performance_assesment_report{ - public: - void run(); - void update(); - void report(); - void save(); - - - - private: - std::shared_ptr<RuntimeIO> rtIO_; - Report report_; -}; \ No newline at end of file -- GitLab From 00a692af0f9a818adc08caddd1ec799051d08585 Mon Sep 17 00:00:00 2001 From: philipphansmann <Philipp Hansmann> Date: Wed, 19 Feb 2025 13:16:41 +0100 Subject: [PATCH 08/19] medium code cleanup --- .../performance_assessment_conf.xml | 2 +- .../SARPerformance/abstractSARPerformance.h | 19 ++------- .../low_fidelity/SARPerformance.h | 13 ++---- .../VnDiagram/low_fidelity/VnDiagram.cpp | 7 ++-- .../VnDiagram/low_fidelity/VnDiagram.h | 6 +-- .../src/taw/defaultMethods/aircraft.cpp | 7 +--- .../src/taw/defaultMethods/aircraft.h | 22 +++++----- .../abstractCeilingPerformance.h | 1 - .../low_fidelity/ceilingPerformance.h | 9 ++-- .../abstractEnginePerformance.h | 13 +++--- .../low_fidelity/enginePerformance.h | 12 +++--- .../fuelPlanning/abstractFuelPlanning.h | 3 -- .../low_fidelity/flightSimulator.h | 4 +- .../low_fidelity/fuelPlanning.cpp | 8 ++-- .../taw/defaultMethods/missionDefinition.cpp | 14 +++---- .../taw/defaultMethods/missionDefinition.h | 22 ++++------ .../performance_assessment_factory.cpp | 13 +++--- .../performance_assessment_output.cpp | 41 +++++++------------ .../performance_assessment_output.h | 14 ++----- .../performance_assessment_settings.h | 15 ------- .../abstractTakeOffPerformance.h | 8 ++-- .../low_fidelity/takeOffPerformance.h | 37 +---------------- 22 files changed, 93 insertions(+), 197 deletions(-) diff --git a/performance_assessment/performance_assessment_conf.xml b/performance_assessment/performance_assessment_conf.xml index f00031c5..bdfea09d 100644 --- a/performance_assessment/performance_assessment_conf.xml +++ b/performance_assessment/performance_assessment_conf.xml @@ -105,7 +105,7 @@ </climb_performance> <takeoff_performance description="Estimation of the starting distance"> <switch description="Switch to calculate the estimation of the starting distance; Switch: true (on) / false (off)"> - <value>false</value> + <value>true</value> </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> <value>low</value> diff --git a/performance_assessment/src/taw/defaultMethods/SARPerformance/abstractSARPerformance.h b/performance_assessment/src/taw/defaultMethods/SARPerformance/abstractSARPerformance.h index 2e14f772..725e8ee0 100644 --- a/performance_assessment/src/taw/defaultMethods/SARPerformance/abstractSARPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/SARPerformance/abstractSARPerformance.h @@ -19,17 +19,13 @@ * Description: * This file is part of UNICADO. */ -#ifndef performance_assessment_SRC_TAW_DEFAULTMETHODS_SARPERFORMANCE_ABSTRACTSARPERFORMANCE_H_ -#define performance_assessment_SRC_TAW_DEFAULTMETHODS_SARPERFORMANCE_ABSTRACTSARPERFORMANCE_H_ +#ifndef PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_SARPERFORMANCE_ABSTRACTSARPERFORMANCE_H_ +#define PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_SARPERFORMANCE_ABSTRACTSARPERFORMANCE_H_ #include <memory> +#include <vector> #include "../flightEnvelopes/abstractFlightEnvelopes.h" -// Forward declarations -namespace taw { -class performance_assessment_factory; -} - class abstractSARPerformance { public: virtual ~abstractSARPerformance() { } @@ -70,13 +66,6 @@ class abstractSARPerformance { virtual void doSARCalculation(std::shared_ptr<abstractFlightEnvelopes> aFlightEnvelopes) = 0; - - /* -- Test -- */ - std::shared_ptr<taw::performance_assessment_factory> theFactory; // Pointer to the enclosing class (enables objects of derived classes of this clas to access members of the - // enclosing class (theFactory) */ - void setFactory(std::shared_ptr<taw::performance_assessment_factory> aFactory) { this->theFactory = aFactory; } // introduces the factory to the current object. Needs to be - // called within the factory after initialization of the object of the derived class - /* -- Test end -- */ }; -#endif // performance_assessment_SRC_TAW_DEFAULTMETHODS_SARPERFORMANCE_ABSTRACTSARPERFORMANCE_H_ +#endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_SARPERFORMANCE_ABSTRACTSARPERFORMANCE_H_ diff --git a/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.h b/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.h index a291b40d..39b050bb 100644 --- a/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.h @@ -19,8 +19,8 @@ * Description: * This file is part of UNICADO. */ -#ifndef performance_assessment_SRC_TAW_DEFAULTMETHODS_SARPERFORMANCE_LOW_FIDELITY_SARPERFORMANCE_H_ -#define performance_assessment_SRC_TAW_DEFAULTMETHODS_SARPERFORMANCE_LOW_FIDELITY_SARPERFORMANCE_H_ +#ifndef PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_SARPERFORMANCE_LOW_FIDELITY_SARPERFORMANCE_H_ +#define PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_SARPERFORMANCE_LOW_FIDELITY_SARPERFORMANCE_H_ #include <moduleBasics/module.h> @@ -32,10 +32,6 @@ #include "../../flightEnvelopes/abstractFlightEnvelopes.h" #include "../../aircraft.h" - -// class aircraft; -// class flightEnvelopes; - using std::string; using std::vector; @@ -46,8 +42,6 @@ namespace low { */ class SARPerformance : public abstractSARPerformance{ public: - - /**\brief Function to calculate the flight parameters for the specific air range *\param theEnvelopes flightEnvelopes object */ @@ -92,4 +86,5 @@ class SARPerformance : public abstractSARPerformance{ double findMaxMach(double theAlt, std::shared_ptr<abstractFlightEnvelopes> theEnvelopes, int ID); }; } // namespace low -#endif // performance_assessment_SRC_TAW_DEFAULTMETHODS_SARPERFORMANCE_LOW_FIDELITY_SARPERFORMANCE_H_ + +#endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_SARPERFORMANCE_LOW_FIDELITY_SARPERFORMANCE_H_ diff --git a/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp b/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp index f9853899..8ec358d9 100644 --- a/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp +++ b/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp @@ -45,21 +45,22 @@ void VnDiagram::doVnDiagram() { // Note here the use of MLM instead of MTOM FlapsCoefficientLDG = (theAcftPt->aero.CLmaxLanding * 0.5 * theAcftPt->atm.getDensity(0.) * theAcftPt->S_Wing) / (theAcftPt->MLM * G_FORCE); /* Diagram for die Clean-configuration */ - for (int i = 0 ; i <= theAcftPt->VDive + convertUnit(KNOTS, METERPERSECOND, 5); i += step) { + for (int i = 0 ; i <= theAcftPt->VDive + convertUnit(KNOTS, METERPERSECOND, 5); i += convertUnit(KNOTS, METERPERSECOND, step)) { tempValues.speed = i; tempValues.n_upperBound = calc_upperBoundClean(CleanCoefficientPos, tempValues.speed); tempValues.n_lowerBound = calc_lowerBoundClean(CleanCoefficientNeg, tempValues.speed); myCleanDiagram.push_back(tempValues); } /* Diagram for the Takeoff configuration */ - for (int i = 0 ; i <= theAcftPt->VDive + 5; i += step) { // TODO(Ufermann): Determine maximum speed for TakeOff configuration + for (int i = 0 ; i <= theAcftPt->VDive + 5; i += convertUnit(KNOTS, METERPERSECOND, step)) { // TODO(Ufermann): Determine maximum speed for TakeOff configuration tempValues.speed = i; tempValues.n_upperBound = calc_upperBoundFlaps("takeoff", FlapsCoefficientTO, tempValues.speed); tempValues.n_lowerBound = 0; myTakeoffDiagram.push_back(tempValues); } /* Diagram for the Landing configuration */ - for (int i = 0 ; i <= theAcftPt->VDive + convertUnit(KNOTS, METERPERSECOND, 5); i += step) { // TODO(Ufermann): Determine maximum speed for landing configuration + for (int i = 0 ; i <= theAcftPt->VDive + convertUnit(KNOTS, METERPERSECOND, 5); i += convertUnit(KNOTS, METERPERSECOND, step)) { + // TODO(Ufermann): Determine maximum speed for landing configuration tempValues.speed = i; tempValues.n_upperBound = calc_upperBoundFlaps("landing", FlapsCoefficientLDG, tempValues.speed); tempValues.n_lowerBound = 0; diff --git a/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.h b/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.h index b9a7a24e..8cffac9a 100644 --- a/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.h +++ b/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.h @@ -20,8 +20,8 @@ * This file is part of UNICADO. */ -#ifndef performance_assessment_SRC_TAW_DEFAULTMETHODS_VNDIAGRAM_LOW_FIDELITY_VNDIAGRAM_H_ -#define performance_assessment_SRC_TAW_DEFAULTMETHODS_VNDIAGRAM_LOW_FIDELITY_VNDIAGRAM_H_ +#ifndef PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_VNDIAGRAM_LOW_FIDELITY_VNDIAGRAM_H_ +#define PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_VNDIAGRAM_LOW_FIDELITY_VNDIAGRAM_H_ #include <unitConversion/unitConversion.h> @@ -122,5 +122,5 @@ class VnDiagram : public abstractVnDiagram{ }; } // namespace low -#endif // performance_assessment_SRC_TAW_DEFAULTMETHODS_VNDIAGRAM_LOW_FIDELITY_VNDIAGRAM_H_ +#endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_VNDIAGRAM_LOW_FIDELITY_VNDIAGRAM_H_ diff --git a/performance_assessment/src/taw/defaultMethods/aircraft.cpp b/performance_assessment/src/taw/defaultMethods/aircraft.cpp index 2ed612d3..8ee30e5b 100644 --- a/performance_assessment/src/taw/defaultMethods/aircraft.cpp +++ b/performance_assessment/src/taw/defaultMethods/aircraft.cpp @@ -50,7 +50,6 @@ aircraft::aircraft(const std::shared_ptr<RuntimeIO>& rtIO, const std::shared_ptr polarXML(aixml::openDocument(rtIO->getAeroDataDir() + "/" + rtIO->acxml.at("analysis/aerodynamics/polar/polar_file/value"))), aero(rtIO->acxml, polarXML) { /* Constructor */ - // polarXML = aixml::openDocument(rtIO->getIODir() + "/aeroData/" + rtIO->acxml.at("/aircraft_exchange_file/analysis/aerodynamics/polar/polar_file/value")); acftName = rtIO->aircraft_type() + rtIO->aircraft_model(); MTOM = EndnodeReadOnly<double>("/aircraft_exchange_file/analysis/masses_cg_inertia/maximum_takeoff_mass/mass_properties/mass").read(rtIO->acxml).value(); MLM = EndnodeReadOnly<double>("/aircraft_exchange_file/analysis/masses_cg_inertia/maximum_landing_mass/mass_properties/mass").read(rtIO->acxml).value(); @@ -93,10 +92,6 @@ aircraft::aircraft(const std::shared_ptr<RuntimeIO>& rtIO, const std::shared_ptr "/aircraft_exchange_file/requirements_and_specifications/requirements/additional_requirements/landing_gear/friction_coefficient").read(rtIO->acxml).value(); brakingCoefficient = EndnodeReadOnly<double>( "/aircraft_exchange_file/requirements_and_specifications/requirements/additional_requirements/landing_gear/braking_coefficient").read(rtIO->acxml).value(); - // myEngine(rtIO->getEngineDataDir()); - // myEngines(rtIO); - // aero = aerodynamics(rtIO->acxml, polarXML); - // myMission = string(rtIO->getIODir(), rtIO->acxml.at("/aircraft_exchange_file/requirements_and_specifications/mission_files/" + this->getMissionType() + "/value")); factorVLOF = 1.1; factorV2 = 1.1; @@ -300,7 +295,7 @@ void aircraft::decipher_icao_ref_code(const std::string icao_ref_code) { } else if (icao_ref_code[1] == 'F') { myReqs.span_limit = 80.; } else { - throw std::invalid_argument("ICAO ref code pos 2 malformed!"); + throw std::invalid_argument("ICAO ref code pos 2 malformed!"); // TODO(hansmann): Add case of intentional noncompliance with ICAO ref code } // Third letter: Tail height // (...) diff --git a/performance_assessment/src/taw/defaultMethods/aircraft.h b/performance_assessment/src/taw/defaultMethods/aircraft.h index e1d47256..656b84e1 100644 --- a/performance_assessment/src/taw/defaultMethods/aircraft.h +++ b/performance_assessment/src/taw/defaultMethods/aircraft.h @@ -47,13 +47,13 @@ class aircraft { const std::shared_ptr<performance_assessment_settings> mySettingsPt; /**< pointer to the mySettings object */ node& polarXML; /**< Address of aixml object for the polar file */ - string acftName;/**<Name of the aircraft*/ + string acftName; /**<Name of the aircraft*/ /** \brief Function to get the mission type * \return Type of mission that should be analyzed (DesignMission or StudyMission)(-) */ string getMissionType(); - + double banana; double MTOM;/**< Maximum Take-off Mass (kg)*/ double MLM; /**< Maximum Landing Mass (kg)*/ @@ -67,20 +67,20 @@ class aircraft { double VDive; /** Diving speed (m/s) */ double MInitialCruise; /**< Initial cruise Mach number (-) */ - double hInitialCruise; /**< Initial cruise altitude (ft) */ - double hMaxOperating; /**< Maximum operating altitude (ft) */ + double hInitialCruise; /**< Initial cruise altitude (m) */ + double hMaxOperating; /**< Maximum operating altitude (m) */ double timeToClimb; /**< Design time to climb (from 1500 ft to initial cruise altitude at ISA+deltaISA (s)*/ double delta_isa; /**< Temperature delta to the ISA-Conditions (K)*/ - double designRange; /**< Design range (km) */ + double designRange; /**< Design range (m) */ double designPayload; /**< Design payload (kg)*/ - double rangeMaxPayload; /**< Range with maximum payload and fuel till the aircraft reaches MTOM (km) */ - double rangeMaxFuel; /**< Range with maximum fuel and payload till the aircraft reaches MTOM (km) */ + double rangeMaxPayload; /**< Range with maximum payload and fuel till the aircraft reaches MTOM (m) */ + double rangeMaxFuel; /**< Range with maximum fuel and payload till the aircraft reaches MTOM (m) */ double payloadRangeMaxfuel; /** Payload with maximum fuel and MTOM (kg) */ - double rangeFerry; /** Range with maximum fuel and zero payload (km) */ + double rangeFerry; /** Range with maximum fuel and zero payload (m) */ int numberEngines; /**< Number of engines (-) */ @@ -118,17 +118,17 @@ class aircraft { */ void setRequiredClimbGradients(const uint16_t& numberOfEngines); // Member variables - double OEICruiseAltitude; /**< Maximum operating altitude with one engine inoperative (ft) */ + double OEICruiseAltitude; /**< Maximum operating altitude with one engine inoperative (m) */ double TOFL; /**< Take-off field length (m) */ double climbGradientSecondTOSegment; /**< Required climb gradient in the second climb segment (%) */ double climbGradientFinalTOSegment; /**< Required climb gradient in the third (final) climb segment (%) */ double LDN; /**< Design landing field length (m) */ double climbGradientApproachOEI; /**< Required climb gradient for go-around during approach and one engine inoperative(%) */ double climbGradientApproachAEO; /**< Required climb gradient for go-around during approach (%) */ - double approachSpeed; /**< Design approach speed (kts) */ + double approachSpeed; /**< Design approach speed (m/s) */ string icao_aerodrome_reference_code; // ICAO reference code - code_number 1-4 (field length) + code_letter A-F (wing span limits) + // faa ADG code number I-VI (wing span limits + tail height limits) + Aircraft Approach Category letter A-D */ - double span_limit; /**< Maximum span limit according to ICAO ref code */ + double span_limit; /**< Maximum span limit according to ICAO ref code (m) */ }; Requirements myReqs; diff --git a/performance_assessment/src/taw/defaultMethods/ceilingPerformance/abstractCeilingPerformance.h b/performance_assessment/src/taw/defaultMethods/ceilingPerformance/abstractCeilingPerformance.h index 890bd46a..a3cddbdd 100644 --- a/performance_assessment/src/taw/defaultMethods/ceilingPerformance/abstractCeilingPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/ceilingPerformance/abstractCeilingPerformance.h @@ -53,5 +53,4 @@ class abstractCeilingPerformance }; - #endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_CEILINGPERFORMANCE_ABSTRACTCEILINGPERFORMANCE_H_ diff --git a/performance_assessment/src/taw/defaultMethods/ceilingPerformance/low_fidelity/ceilingPerformance.h b/performance_assessment/src/taw/defaultMethods/ceilingPerformance/low_fidelity/ceilingPerformance.h index 4517e52f..e1ae6807 100644 --- a/performance_assessment/src/taw/defaultMethods/ceilingPerformance/low_fidelity/ceilingPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/ceilingPerformance/low_fidelity/ceilingPerformance.h @@ -39,8 +39,6 @@ namespace low { */ class ceilingPerformance : public abstractCeilingPerformance{ public: - - /** \brief Calculate the aircraft ceiling */ void doCeilingCalculation() override; @@ -56,11 +54,11 @@ class ceilingPerformance : public abstractCeilingPerformance{ private: /**\brief Function calculates the maximum altitude, at which the rate of climb (ROC) can be achieved *\param Mass Aircraft mass (kg) - *\param ROC Aircraft rate of climb (ft/min) + *\param ROC Aircraft rate of climb (m/s) *\param Mach Aircraft Mach number (-) - *\param startAlt Initial aircraft altitude (ft) + *\param startAlt Initial aircraft altitude (m) *\param OEI Switch if one engine is inoperative (true/false) - *\return Aircraft ceiling (ft) + *\return Aircraft ceiling (m) */ double iterateForCeiling(double Mass, double ROC, double Mach, double startAlt, bool OEI); @@ -88,4 +86,5 @@ class ceilingPerformance : public abstractCeilingPerformance{ }; } // namespace low + #endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_CEILINGPERFORMANCE_LOW_FIDELITY_CEILINGPERFORMANCE_H_ diff --git a/performance_assessment/src/taw/defaultMethods/enginePerformance/abstractEnginePerformance.h b/performance_assessment/src/taw/defaultMethods/enginePerformance/abstractEnginePerformance.h index e7e843fa..339fdf8d 100644 --- a/performance_assessment/src/taw/defaultMethods/enginePerformance/abstractEnginePerformance.h +++ b/performance_assessment/src/taw/defaultMethods/enginePerformance/abstractEnginePerformance.h @@ -19,8 +19,8 @@ * Description: * This file is part of UNICADO. */ -#ifndef performance_assessment_SRC_TAW_DEFAULTMETHODS_ENGINEPERFORMANCE_ABSTRACTENGINEPERFORMANCE_H_ -#define performance_assessment_SRC_TAW_DEFAULTMETHODS_ENGINEPERFORMANCE_ABSTRACTENGINEPERFORMANCE_H_ +#ifndef PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_ENGINEPERFORMANCE_ABSTRACTENGINEPERFORMANCE_H_ +#define PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_ENGINEPERFORMANCE_ABSTRACTENGINEPERFORMANCE_H_ #include <vector> #include <string> @@ -37,8 +37,8 @@ class abstractEnginePerformance public: double Altitude; /**< Aircraft altitude (m) */ vector<double> Mach; /**< List of aircraft Mach number from 0 to maximum operating Mach number (-) */ - vector<double> Thrust; /**< List of thrust per engine for different altitudes, flight speeds and engine ratings (kN) */ - vector<double> SFC; /**< List of specific fuel consumptions for different altitudes, flight speeds and engine ratings (mg/Ns) */ + vector<double> Thrust; /**< List of thrust per engine for different altitudes, flight speeds and engine ratings (N) */ + vector<double> SFC; /**< List of specific fuel consumptions for different altitudes, flight speeds and engine ratings (kg/Ns) */ /** \brief Constructor enginePerfParameter * @@ -72,7 +72,4 @@ class abstractEnginePerformance virtual void doEngineCalculation(std::vector<std::string> engineRating) = 0; }; - - - -#endif // performance_assessment_SRC_TAW_DEFAULTMETHODS_ENGINEPERFORMANCE_ABSTRACTENGINEPERFORMANCE_H_ +#endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_ENGINEPERFORMANCE_ABSTRACTENGINEPERFORMANCE_H_ diff --git a/performance_assessment/src/taw/defaultMethods/enginePerformance/low_fidelity/enginePerformance.h b/performance_assessment/src/taw/defaultMethods/enginePerformance/low_fidelity/enginePerformance.h index 73b2a5cf..0262df56 100644 --- a/performance_assessment/src/taw/defaultMethods/enginePerformance/low_fidelity/enginePerformance.h +++ b/performance_assessment/src/taw/defaultMethods/enginePerformance/low_fidelity/enginePerformance.h @@ -19,8 +19,8 @@ * Description: * This file is part of UNICADO. */ -#ifndef performance_assessment_SRC_TAW_DEFAULTMETHODS_ENGINEPERFORMANCE_LOW_FIDELITY_ENGINEPERFORMANCE_H_ -#define performance_assessment_SRC_TAW_DEFAULTMETHODS_ENGINEPERFORMANCE_LOW_FIDELITY_ENGINEPERFORMANCE_H_ +#ifndef PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_ENGINEPERFORMANCE_LOW_FIDELITY_ENGINEPERFORMANCE_H_ +#define PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_ENGINEPERFORMANCE_LOW_FIDELITY_ENGINEPERFORMANCE_H_ #include <vector> #include <string> @@ -39,7 +39,7 @@ namespace low { */ class enginePerformance : public abstractEnginePerformance{ public: - double maxThrust; /** Maximum thrust of the aircraft (kN) */ + double maxThrust; /** Maximum thrust of the aircraft (N) */ /** \brief Calculates the aircraft engine performance for different engine ratings * \param theRating vector with engine rating @@ -60,12 +60,10 @@ class enginePerformance : public abstractEnginePerformance{ std::shared_ptr<aircraft> theAircraftPt; /**< Pointer to the aircraft object */ /**\brief Function to get the maximum thrust - * \return Maximum thrust (kN) + * \return Maximum thrust (N) */ double getMaxThrust(); }; } // namespace low -#endif // performance_assessment_SRC_TAW_DEFAULTMETHODS_ENGINEPERFORMANCE_LOW_FIDELITY_ENGINEPERFORMANCE_H_ - - +#endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_ENGINEPERFORMANCE_LOW_FIDELITY_ENGINEPERFORMANCE_H_ diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h index 93dcb894..209af077 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h @@ -29,9 +29,6 @@ namespace taw { class performance_assessment_factory; } -/* Abstract class of fuel planning */ -// The purpose of this class is to be inherited by all "fuelPlanning" (high/mid/.../low) methods. - class abstractFuelPlanning { public: virtual ~abstractFuelPlanning() { } diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h index a94261fe..ba14dd67 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h @@ -22,8 +22,6 @@ #ifndef PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_LOW_FIDELITY_FLIGHTSIMULATOR_H_ #define PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_LOW_FIDELITY_FLIGHTSIMULATOR_H_ -#include "../../aircraft.h" - #include <aerodynamics/aerodynamics.h> #include <runtimeInfo/runtimeInfo.h> #include <unitConversion/unitConversion.h> @@ -31,6 +29,8 @@ #include <string> #include <memory> +#include "../../aircraft.h" + class aircraft; class aerodynamics; diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp index 254b1d13..9e486222 100644 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp +++ b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp @@ -226,25 +226,25 @@ void fuelPlanning::doFuelPayloadRangeOLD() { } void fuelPlanning::payloadRangeFromAcftXML() { - //0.point + // 0.Point myPayloadRange.push_back(payloadRangeData()); myPayloadRange.back().Payload = theAcftPt->maxPayload; myPayloadRange.back().Fuel = 0.; myPayloadRange.back().Range = 0.; myPayloadRange.back().TOM = 0.; - //0.point + // 1.Point myPayloadRange.push_back(payloadRangeData()); myPayloadRange.back().Payload = theAcftPt->maxPayload; myPayloadRange.back().Fuel = theAcftPt->MTOM - theAcftPt->OME - theAcftPt->maxPayload; myPayloadRange.back().Range = theAcftPt->rangeMaxPayload; myPayloadRange.back().TOM = theAcftPt->MTOM; - //0.point + // 2.Point myPayloadRange.push_back(payloadRangeData()); myPayloadRange.back().Payload = theAcftPt->payloadRangeMaxfuel; myPayloadRange.back().Fuel = theAcftPt->MFM; myPayloadRange.back().Range = theAcftPt->rangeMaxFuel; myPayloadRange.back().TOM = theAcftPt->MTOM; - //0.point + // 3.Point myPayloadRange.push_back(payloadRangeData()); myPayloadRange.back().Payload = 0.; myPayloadRange.back().Fuel = 0.; diff --git a/performance_assessment/src/taw/defaultMethods/missionDefinition.cpp b/performance_assessment/src/taw/defaultMethods/missionDefinition.cpp index 05bb3a49..29578d65 100644 --- a/performance_assessment/src/taw/defaultMethods/missionDefinition.cpp +++ b/performance_assessment/src/taw/defaultMethods/missionDefinition.cpp @@ -24,7 +24,7 @@ using std::endl; using std::stringstream; -missionDefinition::missionDefinition(const string &fileNameAndDir, double delta_isa) +missionDefinition::missionDefinition(const std::string &fileNameAndDir, double delta_isa) : bleedOffTO(0.0), shaftOffTO(0.0), @@ -64,9 +64,9 @@ void missionDefinition::readMission() { this->readSteps("approach", this->numberApproachSteps); } -void missionDefinition::readSteps(const string& missionPhase, const uint16_t& numberTotalSteps) { +void missionDefinition::readSteps(const std::string& missionPhase, const uint16_t& numberTotalSteps) { for (uint16_t aStepNumber(0); aStepNumber < numberTotalSteps; ++aStepNumber) { - string xmlPath("mission/"); + std::string xmlPath("mission/"); if (missionPhase == "departure") { xmlPath += "departure/departure_step@"; } else if (missionPhase == "cruise") { @@ -82,11 +82,11 @@ void missionDefinition::readSteps(const string& missionPhase, const uint16_t& nu } } -void missionDefinition::getMissionSegment(string XML) { +void missionDefinition::getMissionSegment(std::string XML) { /* General parameters that are always available */ - Steps.back().modeStep = string(missionXML.at(XML+"/mode/value")); - Steps.back().configuration = string(missionXML.at(XML + "/configuration/value")); - Steps.back().rating = string(missionXML.at(XML + "/rating/value")); + Steps.back().modeStep = std::string(missionXML.at(XML+"/mode/value")); + Steps.back().configuration = std::string(missionXML.at(XML + "/configuration/value")); + Steps.back().rating = std::string(missionXML.at(XML + "/rating/value")); Steps.back().derating = EndnodeReadOnly<double>(XML + "/derate").read(missionXML).value(); if (missionXML.find(XML+"/altitude")) { Steps.back().endAltitude = EndnodeReadOnly<double>(XML + "/altitude").read(missionXML).value(); diff --git a/performance_assessment/src/taw/defaultMethods/missionDefinition.h b/performance_assessment/src/taw/defaultMethods/missionDefinition.h index 7136a0a0..7a772ff7 100644 --- a/performance_assessment/src/taw/defaultMethods/missionDefinition.h +++ b/performance_assessment/src/taw/defaultMethods/missionDefinition.h @@ -33,19 +33,16 @@ #include <string> #include <vector> - - class node; using std::vector; -using std::string; /** \class missionDefinition contains all information about the flight mission * */ class missionDefinition { public: - string missionPhase; /**< name of the mission phase */ + std::string missionPhase; /**< name of the mission phase */ double missionPayload; /**< Payload during the mission (kg) */ double missionPAX; /**< Number of passengers during the mission (-) */ @@ -73,7 +70,7 @@ class missionDefinition { */ class averageMissionPoint { public: - string simplifiedMODE; /**< Mission phase (TakeOff, Climb, Accelerate, Cruise, Descend, Landing) */ + std::string simplifiedMODE; /**< Mission phase (TakeOff, Climb, Accelerate, Cruise, Descend, Landing) */ double Altitude; /**< Aircraft altitude (m) */ double Temperature; /**< Air temperature (K) */ @@ -109,14 +106,14 @@ class missionDefinition { public: averageMissionPoint Point; - string missionPhase; /**< Phase during the mission (Departure, Cruise, Approach)*/ - string modeStep; /**< Mode of the segments in mission.xml */ //(Takeoff, Climb, Accelerate, ChangeSpeed_to_CAS, Climb_to_cruise, + std::string missionPhase; /**< Phase during the mission (Departure, Cruise, Approach)*/ + std::string modeStep; /**< Mode of the segments in mission.xml */ //(Takeoff, Climb, Accelerate, ChangeSpeed_to_CAS, Climb_to_cruise, //ChangeSpeed_to_M, Cruise, ChangeFLconstROC, Descend_to_approach, //ChangeSpeed, Descend, LevelGSInterception, Landing) - string rating; /**< Engine rating (TO, MaxCont, Climb, Idle, Cruise)*/ + std::string rating; /**< Engine rating (TO, MaxCont, Climb, Idle, Cruise)*/ double derating; /**< Engine derate (-)*/ - string configuration; /**< Aerodynamic configuration in the mission.xml (TakeOff, Climb, Clean, Approach, ApproachLG, Landing)*/ + std::string configuration; /**< Aerodynamic configuration in the mission.xml (TakeOff, Climb, Clean, Approach, ApproachLG, Landing)*/ double endAltitude; /**< Altitude at the end of the mission segment in the mission.xml (ft) */ double endFL; /**< Flight level at the end of the mission segment in the mission.xml (-) */ @@ -157,7 +154,7 @@ class missionDefinition { /** \brief Constructor missionDefinition * */ - explicit missionDefinition(const string &fileNameAndDir, double delta_isa); + explicit missionDefinition(const std::string &fileNameAndDir, double delta_isa); /** \brief Destructor missionDefinition * @@ -176,12 +173,12 @@ class missionDefinition { * \param missionPhase const string: Constant reference to a string of a certain mission phase. Allowed are "Departure"/"Cruise"/"Approach" * \param numberTotalSteps const uint16_t: Constant reference to the total number of missionSteps in the mission phase */ - void readSteps(const string& missionPhase, const uint16_t& numberTotalSteps); + void readSteps(const std::string& missionPhase, const uint16_t& numberTotalSteps); /** \brief Fill the parameters for each mission step with the data from mission.xml * \param XML Subpath in the mission.xml file */ - void getMissionSegment(string XML); + void getMissionSegment(std::string XML); /** \brief Get the parameters for each mission step */ @@ -193,4 +190,3 @@ class missionDefinition { }; #endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_MISSIONDEFINITION_H_ - diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp index f7129740..7a81cd78 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp @@ -30,11 +30,9 @@ performance_assessment_factory::performance_assessment_factory(const std::shared mySettings(rtIOin), mySettingsPt(std::make_shared<performance_assessment_settings>(mySettings)), myAcft(rtIO, mySettingsPt), - myAcftPt(std::make_shared<aircraft>(myAcft)) - // missionXML(aixml::openDocument(static_cast<std::string>(rtIO->acxml.at( - // "/aircraft_exchange_file/requirements_and_specifications/mission_files/study_mission_file/value")))) - { -} + myAcftPt(std::make_shared<aircraft>(myAcft)) { + // ctor + } void performance_assessment_factory::initialize() { /* Get desired fidelity level of methods*/ @@ -201,7 +199,6 @@ if (mySettingsPt->mySwitches.doPayloadRange == true) { abstractFuelPlanningPt->payloadRangeFromAcftXML(); } - /* EnginePerformance */ if (mySettingsPt->mySwitches.doEnginePerformance == true) { try { @@ -241,7 +238,7 @@ if (mySettingsPt->mySwitches.doClimbPerformance == true) { } } -/* Take-Off Performance*/ +/* Takeoff Performance*/ if (mySettingsPt->mySwitches.doTOPerformance == true) { try { myRuntimeInfo->out << " -> Takeoff Performance" << std::endl; @@ -254,7 +251,7 @@ if (mySettingsPt->mySwitches.doTOPerformance == true) { mySettingsPt->check_sucessfully_executed.doTOPerformance = false; // Prevents generation of plots with nonexisting data myRuntimeInfo->out << "Error in takeoff performance calculation. See logLevel=2 (Info) for more details." << std::endl; } - if (mySettingsPt->mySwitches.doBLFLPerformance == true) { // BLFL performance cannot be calculated without TOperformance + if (mySettingsPt->mySwitches.doBLFLPerformance == true) { // BLFL performance cannot be calculated without Takeoff-performance try { // Calculation of Balance Field Length myRuntimeInfo->out << " -> Calculation of BLFL" << std::endl; diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp index 406b0d01..0dc776ea 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp @@ -381,7 +381,7 @@ void performance_assessment_output::generatePlotData() { if (mySettingsPt->mySwitches.doFlightEnvelopePerformance == true && mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance == true) { generateFlightEnvelopeData(); generateSARPlotData(); - // generateBestSARAltPlotData(); + generate_best_SAR_Data(); } if (mySettingsPt->mySwitches.doTOPerformance == true && mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { generateTOFLPlotData(); @@ -660,25 +660,25 @@ void performance_assessment_output::generateSARPlotData() { } } -void performance_assessment_output::generateBestSARAltPlotData() { +void performance_assessment_output::generate_best_SAR_Data() { // TODO(franz#1#): kathi (18.11.2013): Plot seltsam -> reparieren - std::ofstream plot; - string plotDataFile(mySettingsPt->rtIO->getCsvFilesDirTool() + "/" + theProgramName + "_bestSAR.csv"); - plot.open(plotDataFile.c_str()); - if (!plot) { + std::ofstream csv; + string csvDataFile(mySettingsPt->rtIO->getCsvFilesDirTool() + "/" + theProgramName + "_bestSAR.csv"); + csv.open(csvDataFile.c_str()); + if (!csv) { myRuntimeInfo->err << string(theProgramName) + "_bestSAR.csv could not be opened!" << std::endl; exit(1); } else { - plot << "# " + string(theProgramName) + "_bestSAR.csv" << std::endl; + csv << "# " + string(theProgramName) + "_bestSAR.csv" << std::endl; // Adjust data structure: - plot << "# (1) Mach; (2) Gross Mass [kg]; (3) Opt. Altitude [m]; (4) Opt. SAR [m/kg]" << std::endl; - for (unsigned int i(0); i <= abstractSARPerformancePt->theSAR.size() - 1; i++) { - plot << abstractSARPerformancePt->theSAR.at(i).bestSARMach << "; "; - plot << abstractSARPerformancePt->theSAR.at(i).Mass << "; "; - plot << 3.2808 * abstractSARPerformancePt->theSAR.at(i).bestSARAlt << "; "; - plot << abstractSARPerformancePt->theSAR.at(i).bestSAR << std::endl; + csv << "# (1) Mach; (2) Gross Mass [kg]; (3) Opt. Altitude [m]; (4) Opt. SAR [m/kg]" << std::endl; + for (unsigned int i(0); i < abstractSARPerformancePt->theSAR.size(); i++) { + csv << abstractSARPerformancePt->theSAR.at(i).bestSARMach << "; "; + csv << abstractSARPerformancePt->theSAR.at(i).Mass << "; "; + csv << abstractSARPerformancePt->theSAR.at(i).bestSARAlt << "; "; + csv << abstractSARPerformancePt->theSAR.at(i).bestSAR << std::endl; } - plot.close(); + csv.close(); } } @@ -808,11 +808,7 @@ void performance_assessment_output::generateVnPlotData() { } void performance_assessment_output::generatePlots() { - - // if (mySettingsPt->mySwitches.doFuelPlanning == true) { - // generate_plot_mission(); - // } - if (mySettingsPt->mySwitches.doPayloadRange == true) { + if (mySettingsPt->mySwitches.doPayloadRange == true && mySettingsPt->check_sucessfully_executed.doPayloadRange == true) { generate_plot_payload_range(); } if (mySettingsPt->mySwitches.doEnginePerformance == true && mySettingsPt->check_sucessfully_executed.doEnginePerformance == true) { @@ -824,7 +820,6 @@ void performance_assessment_output::generatePlots() { if (mySettingsPt->mySwitches.doFlightEnvelopePerformance == true && mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance == true) { generate_plot_flight_envelope(); generate_plot_SAR_performance(); - // generateBestSARAltPlotData(); } if (mySettingsPt->mySwitches.doTOPerformance == true && mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { generate_plot_takeoff_field_length(); @@ -838,14 +833,8 @@ void performance_assessment_output::generatePlots() { if (mySettingsPt->mySwitches.doVnDiagram == true && mySettingsPt->check_sucessfully_executed.doVnDiagram == true) { generate_plot_v_n_diagram(); } - } -void performance_assessment_output::generate_plot_mission() { - // matplot::figure_handle fig = matplot::figure(true); - // matplot::axes_handle ax = fig->current_axes(); - // (...) -} void performance_assessment_output::generate_plot_payload_range() { // Gather data diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h index 024470f7..a5acc1f9 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h @@ -97,10 +97,6 @@ class performance_assessment_output { */ void generatePlots(); - /** \brief Generate mission data plot - */ - void generate_plot_mission(); - /** \brief Generate the payload-range diagram */ void generatePlotDataPayloadRange(); @@ -121,6 +117,8 @@ class performance_assessment_output { */ void generateCeilingPlotData(); + /** \brief Generates the ceiling performance plot + */ void generate_plot_ceiling_performance(); /** \brief Generate the plot data of the flight envelope @@ -131,17 +129,13 @@ class performance_assessment_output { */ void generateFlightEnvelopeData(); - // /** \brief Set the settings of the flight envelope plot - // */ - // void generateFlightEnvelopePlotScript(); - /** \brief Generate the specific air range plot */ void generateSARPlotData(); /** \brief Generate the optimum specific air range plot */ - void generateBestSARAltPlotData(); + void generate_best_SAR_Data(); /** \brief Generates the specific air range plot */ @@ -184,6 +178,4 @@ class performance_assessment_output { void generate_plot_v_n_diagram(); }; - - #endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_PERFORMANCE_ASSESSMENT_OUTPUT_H_ diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h index c3e380dc..7cb09fb2 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h @@ -62,21 +62,6 @@ class performance_assessment_settings { bool useStudyMissionForAnalysis; /**< Switch if missionStudy.xml should be used instead of missionDesign.xml */ bool optimizeMission; /** Switch if the mission profile will be optimized */ - // class performance_check_sucessfull { - // public: - // bool fuel_planning; - // bool optimize_mission; - // bool payload_range; - // bool engine_performance; - // bool ceiling_calculation; - // bool dive_speed_limits; - // bool sar_calculation; - // bool takeoff_performance; - // bool balanced_field_length; - // bool landing_performance; - // bool vn_diagram; - // }; - /** \class enginePerfData Includes the engine performance rating * */ diff --git a/performance_assessment/src/taw/defaultMethods/takeOffPerformance/abstractTakeOffPerformance.h b/performance_assessment/src/taw/defaultMethods/takeOffPerformance/abstractTakeOffPerformance.h index 6844b8f0..5ace0761 100644 --- a/performance_assessment/src/taw/defaultMethods/takeOffPerformance/abstractTakeOffPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/takeOffPerformance/abstractTakeOffPerformance.h @@ -19,8 +19,8 @@ * Description: * This file is part of UNICADO. */ -#ifndef performance_assessment_SRC_TAW_DEFAULTMETHODS_TAKEOFFPERFORMANCE_ABSTRACTTAKEOFFPERFORMANCE_H_ -#define performance_assessment_SRC_TAW_DEFAULTMETHODS_TAKEOFFPERFORMANCE_ABSTRACTTAKEOFFPERFORMANCE_H_ +#ifndef PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_TAKEOFFPERFORMANCE_ABSTRACTTAKEOFFPERFORMANCE_H_ +#define PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_TAKEOFFPERFORMANCE_ABSTRACTTAKEOFFPERFORMANCE_H_ #include <vector> @@ -37,7 +37,7 @@ class abstractTakeOffPerformance { dataTOFL() { grossMass = 0.0; - TODR_AEO = 0.0; // Take-off Distance Required, All Engines Operating + TODR_AEO = 0.0; Time = 0.0; } }; @@ -86,4 +86,4 @@ class abstractTakeOffPerformance { virtual void calcBLFL(double theRunwaySlope, double theGroundFriction, double theGroundFrictionBraking, double theHeadWind) = 0; }; -#endif // performance_assessment_SRC_TAW_DEFAULTMETHODS_TAKEOFFPERFORMANCE_ABSTRACTTAKEOFFPERFORMANCE_H_ +#endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_TAKEOFFPERFORMANCE_ABSTRACTTAKEOFFPERFORMANCE_H_ diff --git a/performance_assessment/src/taw/defaultMethods/takeOffPerformance/low_fidelity/takeOffPerformance.h b/performance_assessment/src/taw/defaultMethods/takeOffPerformance/low_fidelity/takeOffPerformance.h index ed0b3c11..87144c62 100644 --- a/performance_assessment/src/taw/defaultMethods/takeOffPerformance/low_fidelity/takeOffPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/takeOffPerformance/low_fidelity/takeOffPerformance.h @@ -43,37 +43,6 @@ namespace low { */ class takeOffPerformance : public abstractTakeOffPerformance { public: - // /**\class dataTOFL class contains informations about the take-off field length - // * - // */ - // class dataTOFL { - // public: - // double TODR_AEO; /**< Take-off distance required with all engines operating (m) */ - // double Time; /**< Time (s) */ - // double grossMass; /**< Aircraft gross mass (kg) */ - - // dataTOFL() { - // grossMass = 0.0; - // TODR_AEO = 0.0; // Take-off Distance Required, All Engines Operating - // Time = 0.0; - // } - // }; - - // /**\class dataElevationTOFL class contains airfield elevation data - // * - // */ - // class dataElevationTOFL { - // public: - // double elevation; /**< Elevation of the airfield (m) */ - // vector<dataTOFL> myTOFL; /**< List of take-off field length data (Aircraft mass, Take-off distance, Time) */ - - // dataElevationTOFL() { - // elevation = 0.0; - // } - // }; - // vector<dataElevationTOFL> myTOFLField; /**< List of airfield elevation data */ - - /**\class dataBLFL class contains data for the balanced field length * */ @@ -94,10 +63,6 @@ class takeOffPerformance : public abstractTakeOffPerformance { TODR_AEO = 0.0; } }; - // dataBLFL myBLFL; - - // double scdSegmentGradient; /**< Climb or descend gradient of the second segment (%) */ - // double finalSegmentGradient; /**< Descend gradient of the final segment (%) */ /**\brief Function to compute the take-off performance *\param theRunwaySlope Slope of the runway (rad) @@ -203,5 +168,7 @@ class takeOffPerformance : public abstractTakeOffPerformance { */ bool checkForFinalSegment(); }; + } // namespace low + #endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_TAKEOFFPERFORMANCE_LOW_FIDELITY_TAKEOFFPERFORMANCE_H_ -- GitLab From 9ad9dd13e7e79e228783544de5f4b25660fb16a2 Mon Sep 17 00:00:00 2001 From: moritzbarnert <moritz.barnert@ilr.rwth-aachen.de> Date: Wed, 19 Feb 2025 13:59:47 +0100 Subject: [PATCH 09/19] Updated html report (payload-range diagram only) --- .../performance_assessment_output.cpp | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp index 406b0d01..f33628f0 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp @@ -21,6 +21,8 @@ */ #include "performance_assessment_factory.h" #include "performance_assessment_output.h" +#include <moduleBasics/html.h> + performance_assessment_output::performance_assessment_output( std::shared_ptr<abstractFuelPlanning> abstractFuelPlanningPt, @@ -63,25 +65,26 @@ performance_assessment_output::~performance_assessment_output() { void performance_assessment_output::generateHtmlBody() { + //Creating the table for the display of the data from each payload-range diagram point. theReport.htmlReportStream() << "<div class=\"box data\">\n"; - theReport.htmlReportStream() << "<h1>Program Mode: "; + theReport.htmlReportStream() << html::h2("Points of the payload-range diagram") + << html::table_begin({"Point", "Payload", "Range"}) + << html::table_row("Point 1", std::to_string(static_cast<int>(abstractPayloadRangePt->Payload.at(0))) + " kg" , std::to_string(static_cast<int>(abstractPayloadRangePt->Range.at(0) / 1000)) + " km") + << html::table_row("Point 2", std::to_string(static_cast<int>(abstractPayloadRangePt->Payload.at(1))) + " kg" , std::to_string(static_cast<int>(abstractPayloadRangePt->Range.at(1) / 1000)) + " km") + << html::table_row("Point 3", std::to_string(static_cast<int>(abstractPayloadRangePt->Payload.at(2))) + " kg" , std::to_string(static_cast<int>(abstractPayloadRangePt->Range.at(2) / 1000)) + " km") + << html::table_row("Point 4", std::to_string(static_cast<int>(abstractPayloadRangePt->Payload.at(3))) + " kg" , std::to_string(static_cast<int>(abstractPayloadRangePt->Range.at(3) / 1000)) + " km") + << html::table_end; + theReport.htmlReportStream() << "</div>\n"; + // Add the plot image to the HTML report + theReport.htmlReportStream() << "<div class=\"box data\">\n"; + theReport.htmlReportStream() << "<h1>Program Mode: "; theReport.htmlReportStream() << "<div class=\"plot-container\">\n"; theReport.htmlReportStream() << "<img class=\"image-plot\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + "_payload_range.svg\">" << std::endl; theReport.htmlReportStream() << "</div>" << std::endl; + theReport.htmlReportStream() << "</div>\n"; - theReport.htmlReportStream() << "<h2>Points of the payload-range diagram</h2>" << std::endl; - theReport.htmlReportStream() << "<table>" << std::endl; - theReport.htmlReportStream() << "<tr><td>/td><td> Payload </td><td> Range </td></tr>" << std::endl; - theReport.htmlReportStream() << "<tr><td>Point 1</td><td>" << Rounding(abstractPayloadRangePt->Payload.at(0), 0) << " kg</td><td> 0 km</td></tr>" << std::endl; - theReport.htmlReportStream() << "<tr><td>Point 2</td><td>" << Rounding(abstractPayloadRangePt->Payload.at(1), 0) << " kg</td><td> " << - Rounding(abstractPayloadRangePt->Range.at(1), 0) << " km</td></tr>" << std::endl; - theReport.htmlReportStream() << "<tr><td>Point 3</td><td>" << Rounding(abstractPayloadRangePt->Payload.at(2), 0) << " kg</td><td> " << - Rounding(abstractPayloadRangePt->Range.at(2), 0) << " km</td></tr>" << std::endl; - theReport.htmlReportStream() << "<tr><td>Point 4</td><td>" << Rounding(abstractPayloadRangePt->Payload.at(3), 0) << " kg</td><td> " << - Rounding(abstractPayloadRangePt->Range.at(3), 0) << " km</td></tr>" << std::endl; - theReport.htmlReportStream() << "</table>" << std::endl; theReport.generateReports(); } -- GitLab From 9c52ec8404d070bcce693c949fe6b4b7a283746d Mon Sep 17 00:00:00 2001 From: philipphansmann <Philipp Hansmann> Date: Wed, 19 Feb 2025 14:54:38 +0100 Subject: [PATCH 10/19] fixed bug in Vn-Diagram calculation --- .../taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp b/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp index 8ec358d9..315f37b1 100644 --- a/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp +++ b/performance_assessment/src/taw/defaultMethods/VnDiagram/low_fidelity/VnDiagram.cpp @@ -45,21 +45,21 @@ void VnDiagram::doVnDiagram() { // Note here the use of MLM instead of MTOM FlapsCoefficientLDG = (theAcftPt->aero.CLmaxLanding * 0.5 * theAcftPt->atm.getDensity(0.) * theAcftPt->S_Wing) / (theAcftPt->MLM * G_FORCE); /* Diagram for die Clean-configuration */ - for (int i = 0 ; i <= theAcftPt->VDive + convertUnit(KNOTS, METERPERSECOND, 5); i += convertUnit(KNOTS, METERPERSECOND, step)) { + for (int i = 0 ; i <= theAcftPt->VDive + convertUnit(KNOTS, METERPERSECOND, 5); i += step) { tempValues.speed = i; tempValues.n_upperBound = calc_upperBoundClean(CleanCoefficientPos, tempValues.speed); tempValues.n_lowerBound = calc_lowerBoundClean(CleanCoefficientNeg, tempValues.speed); myCleanDiagram.push_back(tempValues); } /* Diagram for the Takeoff configuration */ - for (int i = 0 ; i <= theAcftPt->VDive + 5; i += convertUnit(KNOTS, METERPERSECOND, step)) { // TODO(Ufermann): Determine maximum speed for TakeOff configuration + for (int i = 0 ; i <= theAcftPt->VDive + 5; i += step) { // TODO(Ufermann): Determine maximum speed for TakeOff configuration tempValues.speed = i; tempValues.n_upperBound = calc_upperBoundFlaps("takeoff", FlapsCoefficientTO, tempValues.speed); tempValues.n_lowerBound = 0; myTakeoffDiagram.push_back(tempValues); } /* Diagram for the Landing configuration */ - for (int i = 0 ; i <= theAcftPt->VDive + convertUnit(KNOTS, METERPERSECOND, 5); i += convertUnit(KNOTS, METERPERSECOND, step)) { + for (int i = 0 ; i <= theAcftPt->VDive + convertUnit(KNOTS, METERPERSECOND, 5); i += step) { // TODO(Ufermann): Determine maximum speed for landing configuration tempValues.speed = i; tempValues.n_upperBound = calc_upperBoundFlaps("landing", FlapsCoefficientLDG, tempValues.speed); -- GitLab From 3ae45f932828da58bc58be7aa8ef6eb72274ae0a Mon Sep 17 00:00:00 2001 From: moritzbarnert <moritz.barnert@ilr.rwth-aachen.de> Date: Wed, 19 Feb 2025 16:24:54 +0100 Subject: [PATCH 11/19] Updated html report: all performance assessment plots are now included. --- .../performance_assessment_output.cpp | 50 ++++++++++++++++++- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp index 8737aada..d5ff87bc 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp @@ -78,10 +78,56 @@ void performance_assessment_output::generateHtmlBody() { // Add the plot image to the HTML report theReport.htmlReportStream() << "<div class=\"box data\">\n"; - theReport.htmlReportStream() << "<h1>Program Mode: "; theReport.htmlReportStream() << "<div class=\"plot-container\">\n"; - theReport.htmlReportStream() << "<img class=\"image-plot\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + "_payload_range.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_balanced_field_length_performance.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_best_SAR.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_ceiling.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_engine_performance_climb_mach.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_engine_performance_climb_sfc.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_engine_performance_cruise_mach.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_engine_performance_cruise_sfc.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_engine_performance_maximum_continuous_mach.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_engine_performance_maximum_continuous_sfc.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_engine_performance_takeoff_mach.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_engine_performance_takeoff_sfc.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_flight_envelope.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_landing_performance.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_SAR_9144m.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_SAR_9752m.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_SAR_10360m.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_SAR_10968m.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_SAR_11576m.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_SAR_12184m.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_SAR_12792m.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_SAR_13400m.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_takeoff_performance.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + + "_Vn_diagram.svg\">" << std::endl; + theReport.htmlReportStream() << "</div>" << std::endl; theReport.htmlReportStream() << "</div>\n"; -- GitLab From 63186d7a5b63babc62e09a4b6af89a580ad2a509 Mon Sep 17 00:00:00 2001 From: philipphansmann <Philipp Hansmann> Date: Thu, 20 Feb 2025 09:32:42 +0100 Subject: [PATCH 12/19] adjustments to html-report, removed banana from aircraft --- .../low_fidelity/SARPerformance.h | 2 +- .../src/taw/defaultMethods/aircraft.h | 4 +- .../flightEnvelopes/abstractFlightEnvelopes.h | 9 +- .../performance_assessment_factory.cpp | 2 +- .../performance_assessment_output.cpp | 228 +++++++++--------- .../performance_assessment_output.h | 3 + 6 files changed, 118 insertions(+), 130 deletions(-) diff --git a/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.h b/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.h index 39b050bb..de0e24c8 100644 --- a/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.h +++ b/performance_assessment/src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.h @@ -40,7 +40,7 @@ namespace low { /**\class SARPerformance global class that contains informations about the specific air range (SAR) * */ -class SARPerformance : public abstractSARPerformance{ +class SARPerformance : public abstractSARPerformance { public: /**\brief Function to calculate the flight parameters for the specific air range *\param theEnvelopes flightEnvelopes object diff --git a/performance_assessment/src/taw/defaultMethods/aircraft.h b/performance_assessment/src/taw/defaultMethods/aircraft.h index 656b84e1..12e06973 100644 --- a/performance_assessment/src/taw/defaultMethods/aircraft.h +++ b/performance_assessment/src/taw/defaultMethods/aircraft.h @@ -53,8 +53,8 @@ class aircraft { * \return Type of mission that should be analyzed (DesignMission or StudyMission)(-) */ string getMissionType(); - - double banana; + + // double banana; double MTOM;/**< Maximum Take-off Mass (kg)*/ double MLM; /**< Maximum Landing Mass (kg)*/ double OME;/**< Operating Mass Empty(kg) */ diff --git a/performance_assessment/src/taw/defaultMethods/flightEnvelopes/abstractFlightEnvelopes.h b/performance_assessment/src/taw/defaultMethods/flightEnvelopes/abstractFlightEnvelopes.h index b80ac17f..6b5d09c8 100644 --- a/performance_assessment/src/taw/defaultMethods/flightEnvelopes/abstractFlightEnvelopes.h +++ b/performance_assessment/src/taw/defaultMethods/flightEnvelopes/abstractFlightEnvelopes.h @@ -28,10 +28,8 @@ #include "../ceilingPerformance/abstractCeilingPerformance.h" #include "../aircraft.h" -class abstractFlightEnvelopes -{ +class abstractFlightEnvelopes { public: - virtual ~abstractFlightEnvelopes() { } virtual void doFlightEnvelope(std::shared_ptr<abstractCeilingPerformance> ceilingPerf) = 0; virtual void doDiveSpeedLimits() = 0; @@ -74,9 +72,8 @@ class abstractFlightEnvelopes } }; std::vector<flightEnvelopeData> myFlightEnvelope; /**< List of flight envelope data */ - abstractFlightEnvelopes(std::shared_ptr<aircraft> myAcftPt) : theAcftPt(myAcftPt) { - theAcftPt->banana = 42; // Test if base class member is initialized correctly - } + + explicit abstractFlightEnvelopes(std::shared_ptr<aircraft> myAcftPt) : theAcftPt(myAcftPt) { } }; #endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FLIGHTENVELOPES_ABSTRACTFLIGHTENVELOPES_H_ diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp index 7a81cd78..668aa98f 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp @@ -312,10 +312,10 @@ void performance_assessment_factory::report() { myAcftPt); myRuntimeInfo->out << " -> Generating output" << std::endl; - theOutput.generateHtmlBody(); theOutput.writeXmlOutput(); theOutput.generatePlotData(); theOutput.generatePlots(); + theOutput.generateHtmlBody(); } void performance_assessment_factory::save() { diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp index d5ff87bc..d991b559 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp @@ -64,79 +64,81 @@ performance_assessment_output::~performance_assessment_output() { } void performance_assessment_output::generateHtmlBody() { - - //Creating the table for the display of the data from each payload-range diagram point. + // Creating the table for the display of the data from each payload-range diagram point. theReport.htmlReportStream() << "<div class=\"box data\">\n"; theReport.htmlReportStream() << html::h2("Points of the payload-range diagram") << html::table_begin({"Point", "Payload", "Range"}) - << html::table_row("Point 1", std::to_string(static_cast<int>(abstractPayloadRangePt->Payload.at(0))) + " kg" , std::to_string(static_cast<int>(abstractPayloadRangePt->Range.at(0) / 1000)) + " km") - << html::table_row("Point 2", std::to_string(static_cast<int>(abstractPayloadRangePt->Payload.at(1))) + " kg" , std::to_string(static_cast<int>(abstractPayloadRangePt->Range.at(1) / 1000)) + " km") - << html::table_row("Point 3", std::to_string(static_cast<int>(abstractPayloadRangePt->Payload.at(2))) + " kg" , std::to_string(static_cast<int>(abstractPayloadRangePt->Range.at(2) / 1000)) + " km") - << html::table_row("Point 4", std::to_string(static_cast<int>(abstractPayloadRangePt->Payload.at(3))) + " kg" , std::to_string(static_cast<int>(abstractPayloadRangePt->Range.at(3) / 1000)) + " km") + << html::table_row("Point 1", std::to_string(static_cast<int>(abstractPayloadRangePt->Payload.at(0))) + " kg" , + std::to_string(static_cast<int>(abstractPayloadRangePt->Range.at(0) / 1000)) + " km") + << html::table_row("Point 2", std::to_string(static_cast<int>(abstractPayloadRangePt->Payload.at(1))) + " kg" , + std::to_string(static_cast<int>(abstractPayloadRangePt->Range.at(1) / 1000)) + " km") + << html::table_row("Point 3", std::to_string(static_cast<int>(abstractPayloadRangePt->Payload.at(2))) + " kg" , + std::to_string(static_cast<int>(abstractPayloadRangePt->Range.at(2) / 1000)) + " km") + << html::table_row("Point 4", std::to_string(static_cast<int>(abstractPayloadRangePt->Payload.at(3))) + " kg" , + std::to_string(static_cast<int>(abstractPayloadRangePt->Range.at(3) / 1000)) + " km") << html::table_end; theReport.htmlReportStream() << "</div>\n"; - // Add the plot image to the HTML report + // Add the plots to the HTML report theReport.htmlReportStream() << "<div class=\"box data\">\n"; theReport.htmlReportStream() << "<div class=\"plot-container\">\n"; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_payload_range.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_balanced_field_length_performance.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_best_SAR.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_ceiling.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_engine_performance_climb_mach.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_engine_performance_climb_sfc.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_engine_performance_cruise_mach.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_engine_performance_cruise_sfc.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_engine_performance_maximum_continuous_mach.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_engine_performance_maximum_continuous_sfc.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_engine_performance_takeoff_mach.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_engine_performance_takeoff_sfc.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_flight_envelope.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_landing_performance.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_SAR_9144m.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_SAR_9752m.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_SAR_10360m.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_SAR_10968m.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_SAR_11576m.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_SAR_12184m.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_SAR_12792m.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_SAR_13400m.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_takeoff_performance.svg\">" << std::endl; - theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + - "_Vn_diagram.svg\">" << std::endl; - + /* Payload Range Diagram */ + if (mySettingsPt->check_sucessfully_executed.doPayloadRange == true) { + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + + "/" + std::string(TOOL_NAME) + "_payload_range.svg\">" << std::endl; + } + /* BFL */ + if (mySettingsPt->check_sucessfully_executed.doBLFLPerformance == true) { + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + + "/" + std::string(TOOL_NAME) + "_balanced_field_length_performance.svg\">" << std::endl; + } + /* Flight Envelope & SAR */ + if (mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance) { + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + + "/" + std::string(TOOL_NAME) + "_best_SAR.svg\">" << std::endl; + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + + "/" + std::string(TOOL_NAME) + "_flight_envelope.svg\">" << std::endl; + } + /* Climb/Ceiling Performance */ + if (mySettingsPt->check_sucessfully_executed.doClimbPerformance == true) { + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + + "/" + std::string(TOOL_NAME) + "_ceiling.svg\">" << std::endl; + } + /* Engine Performance */ + if (mySettingsPt->check_sucessfully_executed.doEnginePerformance == true) { + for (unsigned int i(0); i < engine_performance_plot_names.size(); i++) { + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + engine_performance_plot_names.at(i) + "\">" << std::endl; + } + } + /* Landing Performance */ + if (mySettingsPt->check_sucessfully_executed.doLandingPerformance == true) { + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + + "/" + std::string(TOOL_NAME) + "_landing_performance.svg\">" << std::endl; + } + /* Takeoff Performance */ + if (mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + + "/" + std::string(TOOL_NAME) + "_takeoff_performance.svg\">" << std::endl; + } + /* Vn-Diagram */ + if (mySettingsPt->check_sucessfully_executed.doVnDiagram == true) { + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + + "/" + std::string(TOOL_NAME) + "_Vn_diagram.svg\">" << std::endl; + } + /* SAR Detail Plots */ + if (mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance) { + for (unsigned int i(0); i < SAR_plot_names.size(); i++) { + theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + SAR_plot_names.at(i) + "\">" << std::endl; + } + } theReport.htmlReportStream() << "</div>" << std::endl; theReport.htmlReportStream() << "</div>\n"; - theReport.generateReports(); } - - void performance_assessment_output::writeXmlOutput() { string subPath; /* MTOM */ @@ -787,72 +789,72 @@ void performance_assessment_output::generateBLFLPlotData() { } void performance_assessment_output::generateLDNPlotData() { - std::ofstream plot; - string plotDataFile(mySettingsPt->rtIO->getCsvFilesDirTool() + "/" + theProgramName + "_LDN.csv"); - plot.open(plotDataFile.c_str()); - if (!plot) { + std::ofstream csv; + string csvDataFile(mySettingsPt->rtIO->getCsvFilesDirTool() + "/" + theProgramName + "_LDN.csv"); + csv.open(csvDataFile.c_str()); + if (!csv) { myRuntimeInfo->err << string(theProgramName) + "_LDN.csv could not be opened!" << std::endl; exit(1); } else { - plot << "# " + mySettingsPt->rtIO->getCsvFilesDirTool() + theProgramName + "_LDN.csv" << std::endl; - plot << "# (1) Altitude [m]; (2) Gross Mass [kg]; (3) ALD_AEO [m]" << std::endl; + csv << "# " + mySettingsPt->rtIO->getCsvFilesDirTool() + theProgramName + "_LDN.csv" << std::endl; + csv << "# (1) Altitude [m]; (2) Gross Mass [kg]; (3) ALD_AEO [m]" << std::endl; for (unsigned int i(0); i <= abstractLandingPerformancePt->myLDNField.size() - 1; i++) { for (unsigned int j(0); j <= abstractLandingPerformancePt->myLDNField.at(i).myLDN.size() - 1; j++) { - plot << abstractLandingPerformancePt->myLDNField.at(i).elevation << "; "; - plot << abstractLandingPerformancePt->myLDNField.at(i).myLDN.at(j).grossMass << "; "; - plot << abstractLandingPerformancePt->myLDNField.at(i).myLDN.at(j).ALD_AEO << std::endl; + csv << abstractLandingPerformancePt->myLDNField.at(i).elevation << "; "; + csv << abstractLandingPerformancePt->myLDNField.at(i).myLDN.at(j).grossMass << "; "; + csv << abstractLandingPerformancePt->myLDNField.at(i).myLDN.at(j).ALD_AEO << std::endl; } - plot << std::endl; - plot << std::endl; + csv << std::endl; + csv << std::endl; } // display TOFL - plot << abstractLandingPerformancePt->myLDNField.at(0).elevation << "; "; - plot << abstractLandingPerformancePt->myLDNField.at(0).myLDN.back().grossMass << "; "; - plot << abstractLandingPerformancePt->myLDNField.at(0).myLDN.back().ALD_AEO << std::endl; - plot << std::endl; - plot << std::endl; + csv << abstractLandingPerformancePt->myLDNField.at(0).elevation << "; "; + csv << abstractLandingPerformancePt->myLDNField.at(0).myLDN.back().grossMass << "; "; + csv << abstractLandingPerformancePt->myLDNField.at(0).myLDN.back().ALD_AEO << std::endl; + csv << std::endl; + csv << std::endl; // Req TOFL - plot << 0.0 << "; "; - plot << myAcftPt->MLM << "; "; - plot << myAcftPt->myReqs.LDN << std::endl; - plot.close(); + csv << 0.0 << "; "; + csv << myAcftPt->MLM << "; "; + csv << myAcftPt->myReqs.LDN << std::endl; + csv.close(); } } void performance_assessment_output::generateVnPlotData() { - std::ofstream plot; - string plotDataFile(mySettingsPt->rtIO->getCsvFilesDirTool() + "/" + theProgramName + "_VnDiagram.csv"); - plot.open(plotDataFile.c_str()); - if (!plot) { + std::ofstream csv; + string csvDataFile(mySettingsPt->rtIO->getCsvFilesDirTool() + "/" + theProgramName + "_VnDiagram.csv"); + csv.open(csvDataFile.c_str()); + if (!csv) { myRuntimeInfo->err << string(theProgramName) + "_VnDiagram.csv could not be opened!" << std::endl; getchar(); exit(1); } else { - plot << "# " + mySettingsPt->rtIO->getCsvFilesDirTool() + theProgramName + "_VnDiagram.csv" << std::endl; - plot << "# (1) v [m]; (2) max n (pos.) [-]; (3) min n (neg.) [-]" << std::endl; - plot << "#Clean configuration" << std::endl; + csv << "# " + mySettingsPt->rtIO->getCsvFilesDirTool() + theProgramName + "_VnDiagram.csv" << std::endl; + csv << "# (1) v [m]; (2) max n (pos.) [-]; (3) min n (neg.) [-]" << std::endl; + csv << "#Clean configuration" << std::endl; for (unsigned int i(0); i <= abstractVnDiagramPt->myCleanDiagram.size() - 1; i++) { - plot << abstractVnDiagramPt->myCleanDiagram.at(i).speed << "; "; - plot << abstractVnDiagramPt->myCleanDiagram.at(i).n_upperBound << "; "; - plot << abstractVnDiagramPt->myCleanDiagram.at(i).n_lowerBound << std::endl; + csv << abstractVnDiagramPt->myCleanDiagram.at(i).speed << "; "; + csv << abstractVnDiagramPt->myCleanDiagram.at(i).n_upperBound << "; "; + csv << abstractVnDiagramPt->myCleanDiagram.at(i).n_lowerBound << std::endl; } - plot << std::endl; - plot << std::endl; - plot << "#Takeoff configuration" << std::endl; + csv << std::endl; + csv << std::endl; + csv << "#Takeoff configuration" << std::endl; for (unsigned int i(0); i <= abstractVnDiagramPt->myCleanDiagram.size() - 1; i++) { - plot << abstractVnDiagramPt->myTakeoffDiagram.at(i).speed << "; "; - plot << abstractVnDiagramPt->myTakeoffDiagram.at(i).n_upperBound << "; "; - plot << abstractVnDiagramPt->myTakeoffDiagram.at(i).n_lowerBound << std::endl; + csv << abstractVnDiagramPt->myTakeoffDiagram.at(i).speed << "; "; + csv << abstractVnDiagramPt->myTakeoffDiagram.at(i).n_upperBound << "; "; + csv << abstractVnDiagramPt->myTakeoffDiagram.at(i).n_lowerBound << std::endl; } - plot << std::endl; - plot << std::endl; - plot << "#Landing configuration" << std::endl; + csv << std::endl; + csv << std::endl; + csv << "#Landing configuration" << std::endl; for (unsigned int i(0); i <= abstractVnDiagramPt->myCleanDiagram.size() - 1; i++) { - plot << abstractVnDiagramPt->myLandingDiagram.at(i).speed << "; "; - plot << abstractVnDiagramPt->myLandingDiagram.at(i).n_upperBound << "; "; - plot << abstractVnDiagramPt->myLandingDiagram.at(i).n_lowerBound << std::endl; + csv << abstractVnDiagramPt->myLandingDiagram.at(i).speed << "; "; + csv << abstractVnDiagramPt->myLandingDiagram.at(i).n_upperBound << "; "; + csv << abstractVnDiagramPt->myLandingDiagram.at(i).n_lowerBound << std::endl; } - plot.close(); + csv.close(); } } @@ -1177,24 +1179,7 @@ void performance_assessment_output::generate_plot_SAR_performance() { matplot::save(plot_file_path); matplot::cla(); -// Other SAR plots - // vector<unsigned int> ID; - // for (unsigned int i(0); i <= abstractSARPerformancePt->theSAR.at(0).tabSAR.size() - 1; i++) { - // if (ceil(abstractSARPerformancePt->theSAR.at(0).tabSAR.at(i).Altitude / 0.3048) <= 31000) { - // ID.push_back(i); - // } else if (ceil(convertUnit(METER, FOOT, abstractSARPerformancePt->theSAR.at(0).tabSAR.at(i).Altitude)) <= 33000) { - // ID.push_back(i); - // } else if (ceil(convertUnit(METER, FOOT, abstractSARPerformancePt->theSAR.at(0).tabSAR.at(i).Altitude)) <= 35000) { - // ID.push_back(i); - // } else if (ceil(convertUnit(METER, FOOT, abstractSARPerformancePt->theSAR.at(0).tabSAR.at(i).Altitude)) <= 37000) { - // ID.push_back(i); - // } else if (ceil(convertUnit(METER, FOOT, abstractSARPerformancePt->theSAR.at(0).tabSAR.at(i).Altitude)) <= 39000) { - // ID.push_back(i); - // } else if (ceil(convertUnit(METER, FOOT, abstractSARPerformancePt->theSAR.at(0).tabSAR.at(i).Altitude)) <= 41000) { - // ID.push_back(i); - // } - // } - + // Other SAR plots for (unsigned int i(0); i < abstractSARPerformancePt->theSAR.at(0).tabSAR.size(); i+=2) { // iterates over every the altitudes of interest double current_altitude = abstractSARPerformancePt->theSAR.at(0).tabSAR.at(i).Altitude; double current_altitude_ft = convertUnit(METER, FOOT, current_altitude); @@ -1231,6 +1216,7 @@ void performance_assessment_output::generate_plot_SAR_performance() { ax->legend()->location(matplot::legend::general_alignment::topleft); // Save plot std::string plot_file_path = rtIO->getPlotDir() + "/" + std::string(TOOL_NAME) + "_SAR_" + std::format("{:.0f}", floor(current_altitude)) + "m.svg"; + SAR_plot_names.push_back(std::string(TOOL_NAME) + "_SAR_" + std::format("{:.0f}", floor(current_altitude)) + "m.svg"); // saving plot names for html-report matplot::save(plot_file_path); matplot::cla(); } @@ -1301,7 +1287,9 @@ void performance_assessment_output::generate_plot_engine_performance() { // Save figures std::string plot_file_path_machplot = rtIO->getPlotDir() + "/" + std::string(TOOL_NAME) + "_engine_performance_" + current_rating + "_mach.svg"; fig1->save(plot_file_path_machplot); + engine_performance_plot_names.push_back(std::string(TOOL_NAME) + "_engine_performance_" + current_rating + "_mach.svg"); // saving plot names for html-report std::string plot_file_path_sfcplot = rtIO->getPlotDir() + "/" + std::string(TOOL_NAME) + "_engine_performance_" + current_rating + "_sfc.svg"; + engine_performance_plot_names.push_back(std::string(TOOL_NAME) + "_engine_performance_" + current_rating + "_sfc.svg"); // saving plot names for html-report fig2->save(plot_file_path_sfcplot); } } diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h index a5acc1f9..3790b847 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h @@ -72,6 +72,9 @@ class performance_assessment_output { Report theReport; std::string theProgramName; + vector<string> SAR_plot_names; + vector<string> engine_performance_plot_names; + /** \brief Function generates the body of HTML report * \details the function is full virtual and is implemented in each program; it defines the content BETWEEN the <body> tag of the HTML-report * \return report a stringstream of the information for the body-tag of HTML-Report -- GitLab From cf8972cf598bb769aa5a3e676c5278d25561753e Mon Sep 17 00:00:00 2001 From: philipphansmann <Philipp Hansmann> Date: Thu, 20 Feb 2025 10:48:10 +0100 Subject: [PATCH 13/19] removed submodule switches from config and code, removed fuelPlanning, removed missionOptimization (dependency of fuelPlanning) --- performance_assessment/CMakeLists.txt | 8 +- .../performance_assessment_conf.xml | 48 +- .../src/taw/defaultMethods/aircraft.cpp | 2 +- .../src/taw/defaultMethods/aircraft.h | 2 +- .../fuelPlanning/abstractFuelPlanning.h | 121 ---- .../low_fidelity/flightSimulator.cpp | 288 -------- .../low_fidelity/flightSimulator.h | 215 ------ .../low_fidelity/fuelFromMassFraction.cpp | 143 ---- .../low_fidelity/fuelFromMassFraction.h | 84 --- .../low_fidelity/fuelPlanning.cpp | 680 ------------------ .../fuelPlanning/low_fidelity/fuelPlanning.h | 227 ------ .../taw/defaultMethods/missionDefinition.cpp | 4 +- .../taw/defaultMethods/missionDefinition.h | 6 +- .../abstractOptimizeMissionProfile.h | 40 -- .../low_fidelity/optimizeMissionProfile.cpp | 102 --- .../low_fidelity/optimizeMissionProfile.h | 100 --- .../low_fidelity/payloadRange.cpp | 16 +- .../performance_assessment_factory.cpp | 214 ++---- .../performance_assessment_factory.h | 6 - .../performance_assessment_output.cpp | 208 ++---- .../performance_assessment_output.h | 8 - .../performance_assessment_settings.cpp | 31 +- .../performance_assessment_settings.h | 2 +- 23 files changed, 139 insertions(+), 2416 deletions(-) delete mode 100644 performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h delete mode 100644 performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.cpp delete mode 100644 performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h delete mode 100644 performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.cpp delete mode 100644 performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.h delete mode 100644 performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp delete mode 100644 performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.h delete mode 100644 performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/abstractOptimizeMissionProfile.h delete mode 100644 performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.cpp delete mode 100644 performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.h diff --git a/performance_assessment/CMakeLists.txt b/performance_assessment/CMakeLists.txt index c7851154..5596a393 100644 --- a/performance_assessment/CMakeLists.txt +++ b/performance_assessment/CMakeLists.txt @@ -19,10 +19,10 @@ set(MODULE_SOURCES src/taw/defaultMethods/ceilingPerformance/low_fidelity/ceilingPerformance.cpp src/taw/defaultMethods/enginePerformance/low_fidelity/enginePerformance.cpp src/taw/defaultMethods/flightEnvelopes/low_fidelity/flightEnvelopes.cpp - src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.cpp - src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.cpp - src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp - src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.cpp + #src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.cpp + #src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.cpp + #src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp + #src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.cpp src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp src/taw/defaultMethods/SARPerformance/low_fidelity/SARPerformance.cpp src/taw/defaultMethods/takeOffPerformance/low_fidelity/takeOffPerformance.cpp diff --git a/performance_assessment/performance_assessment_conf.xml b/performance_assessment/performance_assessment_conf.xml index bdfea09d..cb754d22 100644 --- a/performance_assessment/performance_assessment_conf.xml +++ b/performance_assessment/performance_assessment_conf.xml @@ -54,78 +54,40 @@ <value>low</value> </module_fidelity_level> <performance_checks description="Settings that affect different functionalities!"> - <fuel_planning description="Fuel planning calculation"> - <switch description="Switch for fuel estimation; Switch: true (on) / false (off)"> - <value>false</value> - </switch> - <fidelity_level description="Select the fidelity level of the calculation (options: low)"> - <value>low</value> - </fidelity_level> - <contingency_fuel description="Relative percentage of Contigency Fuel in total Trip Fuel (default: 0.05)"> - <value>0.03</value> - <unit>1</unit> - <lower_boundary>0</lower_boundary> - <upper_boundary>0.2</upper_boundary> - </contingency_fuel> - </fuel_planning> <payload_range_diagram description="Payload Range Diagram calculation"> - <switch description="Switch to calculate the Payload Range Diagram; Switch: true (on) / false (off)"> - <value>true</value> - </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> <value>low</value> </fidelity_level> </payload_range_diagram> <engine_performance description="Engine power estimation"> - <switch description="Switch to calculate the enigne power estimation; Switch: true (on) / false (off)"> - <value>true</value> - </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> <value>low</value> </fidelity_level> </engine_performance> <flight_envelope_performance description="Estimation of flight range limits"> - <switch description="Switch to calculate the estimation of flight range limits; Switch: true (on) / false (off)"> - <value>true</value> - </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> <value>low</value> </fidelity_level> <overwrite_initial_values description="Causes recalculation of dive speeds"> - <value>0</value> + <value>true</value> </overwrite_initial_values> </flight_envelope_performance> <climb_performance description="Calculate the climb performance (so far only for plots)"> - <switch description="Switch to calculate climb performance; Switch: true (on) / false (off)"> - <value>true</value> - </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> <value>low</value> </fidelity_level> </climb_performance> <takeoff_performance description="Estimation of the starting distance"> - <switch description="Switch to calculate the estimation of the starting distance; Switch: true (on) / false (off)"> - <value>true</value> - </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> <value>low</value> </fidelity_level> - <calculate_blfl_performance description="Switch to calculate the blfl performance; Switch: true (on) / false (off)"> - <value>true</value> - </calculate_blfl_performance> </takeoff_performance> <landing_performance description="Estimation of the landing distance" > - <switch description="Switch to calculate the estimation of the landing distance; Switch: true (on) / false (off)"> - <value>true</value> - </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> <value>low</value> </fidelity_level> </landing_performance> <vn_diagram description="Calculate the V-n diagram"> - <switch description="Switch to calculate the V-n diagram; Switch: true (on) / false (off)"> - <value>true</value> - </switch> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> <value>low</value> </fidelity_level> @@ -202,13 +164,5 @@ <value>false</value> </mtom_design> </modes> - <mission description="Specification of the mission"> - <optimize_mission_profile description="Switch to optimize the mission profile; Switch: true (on) / false (off)"> - <value>false</value> - </optimize_mission_profile> - <fidelity_level description= "Select the fidelity level of the calculation (options: low)"> - <value>low</value> - </fidelity_level> - </mission> </program_settings> </module_configuration_file> diff --git a/performance_assessment/src/taw/defaultMethods/aircraft.cpp b/performance_assessment/src/taw/defaultMethods/aircraft.cpp index 8ee30e5b..824a1d1d 100644 --- a/performance_assessment/src/taw/defaultMethods/aircraft.cpp +++ b/performance_assessment/src/taw/defaultMethods/aircraft.cpp @@ -163,7 +163,7 @@ aircraft::~aircraft() { string aircraft::getMissionType() { string missionType; - if (!mySettingsPt->designForMTOM && (mySettingsPt->mySwitches.doFuelPlanning && mySettingsPt->useStudyMissionForAnalysis)) { + if (!mySettingsPt->designForMTOM && mySettingsPt->useStudyMissionForAnalysis) { missionType = "study_mission"; } else { missionType = "design_mission"; diff --git a/performance_assessment/src/taw/defaultMethods/aircraft.h b/performance_assessment/src/taw/defaultMethods/aircraft.h index 12e06973..4de1ca5c 100644 --- a/performance_assessment/src/taw/defaultMethods/aircraft.h +++ b/performance_assessment/src/taw/defaultMethods/aircraft.h @@ -46,7 +46,7 @@ class aircraft { const std::shared_ptr<RuntimeIO>& rtIO; const std::shared_ptr<performance_assessment_settings> mySettingsPt; /**< pointer to the mySettings object */ node& polarXML; /**< Address of aixml object for the polar file */ - + string acftName; /**<Name of the aircraft*/ /** \brief Function to get the mission type diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h deleted file mode 100644 index 209af077..00000000 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/abstractFuelPlanning.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * UNICADO - UNIversity Conceptual Aircraft Design and Optimization - * - * Copyright (C) 2025 UNICADO consortium - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - * - * Description: - * This file is part of UNICADO. - */ -#ifndef PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_ABSTRACTFUELPLANNING_H_ -#define PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_ABSTRACTFUELPLANNING_H_ - -#include <vector> -#include <memory> - -namespace taw { -class performance_assessment_factory; -} - -class abstractFuelPlanning { - public: - virtual ~abstractFuelPlanning() { } - virtual void doFuelPlanning() = 0; - - virtual void doPayloadRangeOLD() { } - - virtual void doFuelPayloadRangeOLD() { } - virtual void payloadRangeFromAcftXML() { } - - class fuelData { - public: - double taxiFuelTakeoff; /**< Taxi fuel at take-off (kg) */ - double taxiFuelLanding; /**< Taxi fuel at landing (kg) */ - double missionFuel; /**< Mission fuel (kg) */ // flight fuel: fuel consumed without taxiing! - double contigencyFuel; /**< Contingency fuel (kg) */ - double alternateFuel; /**< Alternate fuel (kg) */ - double finalReserveFuel; /**< Final reserve fuel (kg) */ - double tripFuel; /**< Trip fuel (kg) */ - - /**\brief Constructor fuelData - * - */ - fuelData() { - taxiFuelTakeoff = 0.; - taxiFuelLanding = 0.; - missionFuel = 0.; - contigencyFuel = 0.; - alternateFuel = 0.; - finalReserveFuel = 0.; - tripFuel = 0.; - } - }; - - /**\brief Class missionFuelData contains aircraft parameters for each mission step - * - */ - class missionFuelData { - public: - double Time; /**< Time spent for the mission (s) */ - double Range; /**< Distance covered in the mission (m) */ - double Altitude; /**< Aircraft altitude during the mission (m) */ - double TAS; /**< True air speed during the mission (m/s) */ - double Mach; /**< Mach number during the mission (-) */ - double Mass; /**< Aircraft mass (kg) */ - double consumedFuel; /**< Fuel consumed during the mission (kg) */ - double Thrust; /**< Aircraft thrust (N) */ - double fuelFlow; /**< Fuel flow (kg/s) */ - double ROC; /**< Aircraft rate of climb (m/s) */ - - missionFuelData() { - Time = 0.0; - Range = 0.0; - Altitude = 0.0; - TAS = 0.0; - Mach = 0.0; - Mass = 0.0; - consumedFuel = 0.0; - Thrust = 0.0; - fuelFlow = 0.0; - ROC = 0.0; - } - }; - std::vector<missionFuelData> theMissionFuel; /**< List of the mission parameters */ - - fuelData myFuel; - - /**\class payloadRangeData Class with parameters for the payload range diagram - * - */ - class payloadRangeData { - public: - double Range; /**< Distance covered in the mission based on the payload-range diagram (m) */ - double Payload; /**< Payload carried by the aircraft (kg) */ - double Fuel; /**< Fuel carried by the aircraft (kg) */ - double TOM; /**< Aircraft take-off mass (kg) */ - payloadRangeData() { - Range = 0.0; - Payload = 0.0; - Fuel = 0.0; - TOM = 0.0; - } - }; - std::vector<payloadRangeData> myPayloadRange; /**< List of values of the payload-range diagram */ - - double tripTime; /**< Trip time (s) */ - double blockTime; /**< Block time (s) */ -}; - -#endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_ABSTRACTFUELPLANNING_H_ diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.cpp b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.cpp deleted file mode 100644 index 562d7768..00000000 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* - * UNICADO - UNIversity Conceptual Aircraft Design and Optimization - * - * Copyright (C) 2025 UNICADO consortium - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - * - * Description: - * This file is part of UNICADO. - */ -#include "flightSimulator.h" - -using std::endl; -using std::string; - -flightSimulator::flightSimulator(std::shared_ptr<aircraft> anAcftPtr) - : - theAcftPt(anAcftPtr), - climbAltSteps(50.), - cruiseSteps(10000.) { - //ctor -} - -flightSimulator::~flightSimulator() { - //dtor -} - -double flightSimulator::calcTaxiFuel(double taxiTime) { - double totalTaxiTime = taxiTime; // in s - theAcftPt->myEngines.calculate_N1_with_penalties(theAcftPt->myEnergyProviders.energyCarrierID_taxi, 0., 0., theAcftPt->atm, 1., "idle", theAcftPt->myMission.bleedOffTO, - theAcftPt->myMission.shaftOffTO); - double theTaxiFuel = totalTaxiTime * theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_taxi); - return theTaxiFuel; -} - -/* Climb Fuel */ -void flightSimulator::getClimbFuel(double grossMass, double startAlt, double endAlt, double startMach, double endMach, const string &Config, const string &Rating, - double bleedOff, double shaftOff, const aerodynamics &theAero, double *climbFuel, double *climbDistance, double *climbTime) { - // linear Mach curve - double machGradient = (endMach - startMach) / (endAlt - startAlt); - double machConstant = endMach - machGradient * endAlt; - double theAltitude = startAlt + climbAltSteps; - while (theAltitude <= endAlt) { - double segFuel(0.); - double segTime(0.); - double segDistance(0.); - double M0 = machGradient * (theAltitude - climbAltSteps) + machConstant; - double M1 = machGradient * theAltitude + machConstant; - calcClimbFuel(grossMass, theAltitude - climbAltSteps, theAltitude, - M0, M1, - Config, Rating, bleedOff, shaftOff, - theAero, - &segTime, &segFuel, &segDistance); - grossMass -= segFuel; - *climbFuel += segFuel; - *climbTime += segTime; - *climbDistance += segDistance; - theAltitude += climbAltSteps; - } -} - -void flightSimulator::calcClimbFuel(double massAC, double H0, double H1, double Mach0, double Mach1, const string& config, string rating, double bleed, double shaft, - aerodynamics AERO, double *theTime, double *theFuel, double *theDistance) { - /* minimum climb performance */ - double a_minROC = theAcftPt->hInitialCruise / theAcftPt->timeToClimb; //minimum ROC to maintain TTC requirement [m/s] - // double m_minROC = (a_minROC - convertUnit(FOOTPERMINUTE, METERPERSECOND, 500.)) / (0. - theAcftPt->hInitialCruise); - double m_minROC = (a_minROC - convertUnit(FOOTPERMINUTE, METERPERSECOND, 500.)) / (0. - theAcftPt->hInitialCruise); - - double minimumROC0 = m_minROC * H0 + a_minROC; - double minimumROC1 = m_minROC * H1 + a_minROC; - // estimate according to Raymer, p.463 and equation 17.48-17.49 - double ROC0 = theAcftPt->ROC(massAC, H0, Mach0, 0.0, config, rating, bleed, shaft, false, AERO); - double ROC1 = theAcftPt->ROC(massAC, H1, Mach1, 0.0, config, rating, bleed, shaft, false, AERO); - //Increase the setting to "maximum_continuous" - if (ROC0 <= minimumROC0 || ROC1 <= minimumROC1) { - rating = "maximum_continuous"; - ROC0 = theAcftPt->ROC(massAC, H0, Mach0, 0.0, config, rating, bleed, shaft, false, AERO); - ROC1 = theAcftPt->ROC(massAC, H1, Mach1, 0.0, config, rating, bleed, shaft, false, AERO); - if (ROC0 <= 0. || ROC1 <= 0.) { - myRuntimeInfo->err << " No climb possible!" << endl; - myRuntimeInfo->err << " H0: " << H0 << " m -> H1: " << H1 << " m" << endl; - myRuntimeInfo->err << " M0: " << Mach0 << " -> M1: " << Mach1 << "" << endl; - myRuntimeInfo->err << " Configuration: " << config << endl; - myRuntimeInfo->err << " Setting: " << rating << endl; - myRuntimeInfo->err << " ROC0: " << ROC0 << " m/s" << endl; - myRuntimeInfo->err << " ROC1: " << ROC1 << " m/s" << endl; - myRuntimeInfo->err << " Abort!" << endl; - exit(1); - } - if (ROC0 <= minimumROC0 || ROC1 <= minimumROC1) { - myRuntimeInfo->err << "The minimum climb requirement cannot be met!" << endl; - myRuntimeInfo->err << " H0: " << H0 << " m -> H1: " << H1 << " m" << endl; - myRuntimeInfo->err << " M0: " << Mach0 << " -> M1: " << Mach1 << "" << endl; - myRuntimeInfo->err << " Configuration: " << config << endl; - myRuntimeInfo->err << " Setting: " << rating << endl; - myRuntimeInfo->err << " ROC0: " << ROC0 << " m/s" << endl; - myRuntimeInfo->err << " ROC0required: " << minimumROC0 << " m/s" << endl; - myRuntimeInfo->err << " ROC1: " << ROC1 << " m/s" << endl; - myRuntimeInfo->err << " ROC1required: " << minimumROC1 << " m/s" << endl; - myRuntimeInfo->err << " Abort!" << endl; - exit(1); - } else { - ROC0 = minimumROC0; - ROC1 = minimumROC1; - } - } - /* Average Fuel Flow */ - double avgFuelFlow(0.0); - // Point 0 - double Thrust = calcThrustForROC(massAC, H0, Mach0, ROC0, config, AERO); - theAcftPt->myEngines.calculate_N1_with_thrustlimit(theAcftPt->myEnergyProviders.energyCarrierID_climb, H0, Mach0, theAcftPt->atm, 1.0, rating, bleed, shaft, Thrust); - if (theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_climb) < 0.99 * Thrust) { - myRuntimeInfo->err << "Engines do not provide the necessary thrust for climbing!" << endl; - myRuntimeInfo->err << " H: " << H0 << endl; - myRuntimeInfo->err << " M: " << Mach0 << endl; - myRuntimeInfo->err << " Configuration: " << config << endl; - myRuntimeInfo->err << " Setting: " << rating << endl; - myRuntimeInfo->err << " ROC: " << ROC0 << " m/s" << endl; - myRuntimeInfo->err << " Thrust_required: " << Thrust << " kN" << endl; - myRuntimeInfo->err << " Thrust_available: " << theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_climb)/1000 << " kN" << endl; - // myRuntimeInfo->err << " N1: " << theAcftPt->myEngine.() << endl; // TODO(hansmann): Currently no method available to get N1 afaik - myRuntimeInfo->err << "Abort!" << endl; - exit(1); - } - avgFuelFlow += theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_climb); - // Point 1 - Thrust = calcThrustForROC(massAC, H1, Mach1, ROC1, config, AERO); - theAcftPt->myEngines.calculate_N1_with_thrustlimit(theAcftPt->myEnergyProviders.energyCarrierID_climb, H1, Mach1, theAcftPt->atm, 1.0, rating, bleed, shaft, Thrust); - if (theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_climb) < 0.99 * Thrust) { - myRuntimeInfo->err << "Engines do not provide the necessary thrust for climbing!" << endl; - myRuntimeInfo->err << " H: " << H1 << endl; - myRuntimeInfo->err << " M: " << Mach1 << endl; - myRuntimeInfo->err << " Configuration: " << config << endl; - myRuntimeInfo->err << " Setting: " << rating << endl; - myRuntimeInfo->err << " ROC: " << ROC0 << " m/s" << endl; - myRuntimeInfo->err << " Thrust_required: " << Thrust << " kN" << endl; - myRuntimeInfo->err << " Thrust_available: " << theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_climb)/1000 << " kN" << endl; - // myRuntimeInfo->err << " N1: " << theAcftPt->myEngine.getEngineN() << endl; - myRuntimeInfo->err << "Abort!" << endl; - exit(1); - } - avgFuelFlow += theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_climb); - avgFuelFlow = 0.5 * avgFuelFlow; - /* Average TAS */ - double avgTAS(0.); - avgTAS = 0.5 * (Mach0 * theAcftPt->atm.getSpeedOfSound(H0) + Mach1 * theAcftPt->atm.getSpeedOfSound(H1)); - /* Average ROC */ - double avgROC = 0.5 * (ROC0 + ROC1); - *theTime = fabs(H1 - H0) / avgROC; -// Raymer, P.463, eq.17.47 -// double a = (ROC1 - ROC0) / (H1 - H0); //Warning: denominator of ROC_constant = 0!!!! -// *theTime = (-1./a) * log( ROC0/ROC1 ); //Warning: log(1) = 0 !!!! - *theFuel = *theTime * avgFuelFlow; - *theDistance = convertUnit(METER, KILO, METER, sqrt(pow((*theTime * avgTAS), 2) - pow((H1 - H0), 2))); -} - -double flightSimulator::calcThrustForROC(double massOfAC, double H, double Mach, double theROC, string theConfiguration, aerodynamics theAERO) { - double reqGamma = asin(theROC / (Mach * theAcftPt->atm.getSpeedOfSound(H))); - double regLiftCoefficient = 2. * G_FORCE * massOfAC * cos(reqGamma) / - (theAcftPt->atm.getDensity(H) * pow(Mach * theAcftPt->atm.getSpeedOfSound(H), 2.) * theAcftPt->S_Wing); - double reqDrag = theAERO.getCLDrag(Mach, H, regLiftCoefficient, theConfiguration, theAcftPt->atm); - double reqThrust = reqDrag + (G_FORCE * massOfAC) * theROC / (Mach * theAcftPt->atm.getSpeedOfSound(H)); - return reqThrust; //N -} - -/* Accelerate Fuel */ -void flightSimulator::getAccelerateFuel(double grossMass, double Altitude, double startMach, double endMach, string Config, string Rating, double bleedOff, double shaftOff, - aerodynamics theAero, double *accFuel, double *accDistance, double *accTime) { - if (startMach > endMach) { - myRuntimeInfo->err << "An acceleration is to be calculated, but" << endl; - myRuntimeInfo->err << "Mach0 = " << startMach << " > Mach1 = " << endMach << endl; - myRuntimeInfo->err << "Abort!" << endl; - exit(1); - } - // assumption of a constant acceleration -> linear increase in velocity - double avgMach = 0.5 * (startMach + endMach); - theAcftPt->myEngines.calculate_N1_with_penalties(theAcftPt->myEnergyProviders.energyCarrierID_cruise, Altitude, avgMach, theAcftPt->atm, 1.0, Rating, bleedOff, shaftOff); - double average_thrust = theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_cruise); - double average_drag = theAero.getCruiseDrag(avgMach, Altitude, 0.0, grossMass, Config, theAcftPt->atm); - double avgAcc = (1. / grossMass) * (average_thrust - average_drag); - if (avgAcc <= 0. && Rating == "cruise") { - Rating = "climb"; - theAcftPt->myEngines.calculate_N1_with_penalties(theAcftPt->myEnergyProviders.energyCarrierID_cruise, Altitude, avgMach, theAcftPt->atm, 1.0, Rating, bleedOff, shaftOff); - avgAcc = (1. / grossMass) * (theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_cruise)) - - theAero.getCruiseDrag(avgMach, Altitude, 0.0, grossMass, Config, theAcftPt->atm); - } - if (avgAcc <= 0. && Rating == "climb") { - Rating = "maximum_continuous"; - theAcftPt->myEngines.calculate_N1_with_penalties(theAcftPt->myEnergyProviders.energyCarrierID_climb, Altitude, avgMach, theAcftPt->atm, 1.0, Rating, bleedOff, shaftOff); - avgAcc = (1. / grossMass) * (theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_climb)) - - theAero.getCruiseDrag(avgMach, Altitude, 0.0, grossMass, Config, theAcftPt->atm); - } - if (avgAcc <= 0.) { - myRuntimeInfo->err << "No acceleration possible!" << endl; - myRuntimeInfo->err << "Altitude: " << convertUnit(METER, FOOT, Altitude) << " ft" << endl; - myRuntimeInfo->err << "Mach0: " << startMach << endl; - myRuntimeInfo->err << "Mach1: " << endMach << endl; - myRuntimeInfo->err << "Config: " << Config << endl; - myRuntimeInfo->err << "Rating: " << Rating << endl; - myRuntimeInfo->err << "Abort!" << endl; - exit(1); - } - *accTime = fabs(endMach - startMach) * theAcftPt->atm.getSpeedOfSound(Altitude) / avgAcc; - *accDistance = *accTime * fabs(endMach - startMach) * theAcftPt->atm.getSpeedOfSound(Altitude); - *accFuel = theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_cruise) * *accTime;; -} - -bool flightSimulator::checkForAcceleration(double grossMass, double Altitude, double Mach, string Config, string Rating, double Derate, double bleedOff, double shaftOff, - aerodynamics theAero) { - double theDrag = theAero.getCruiseDrag(Mach, Altitude, 0., grossMass, Config, theAcftPt->atm); - theAcftPt->myEngines.calculate_N1_with_penalties(theAcftPt->myEnergyProviders.energyCarrierID_cruise, Altitude, Mach, theAcftPt->atm, Derate, Rating, bleedOff, shaftOff); - // TODO(hansmann): cuise energy_carrier is currently hardcoded here as energy carrier - double currentThrust = theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_cruise); - if (0.995 * theDrag > currentThrust) { - return false; - } else { - return true; - } -} - -/* Cruise Flight */ -void flightSimulator::getCruiseFuel(double grossMass, double Altitude, double Mach, string Config, string Rating, double bleedOff, double shaftOff, aerodynamics theAero, - double *cruiseFuel, double cruiseDistance, double *cruiseTime) { - *cruiseTime = 0.; - *cruiseFuel = 0.; - if (cruiseDistance > 0.) { - double flownDistance(0.); - do { - double theDrag = theAero.getCruiseDrag(Mach, Altitude, 0., grossMass, Config, theAcftPt->atm); - theAcftPt->myEngines.calculate_N1_with_thrustlimit(theAcftPt->myEnergyProviders.energyCarrierID_cruise, Altitude, Mach, theAcftPt->atm, 1.0, Rating, bleedOff, shaftOff, - theDrag); - double theThrust = theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_cruise); - if (0.995 * theDrag > theThrust) { - myRuntimeInfo->err << "Error in cruise calculation! Abort!!!" << endl; - myRuntimeInfo->err << "Thrust is not equal to resistance:" << endl; - myRuntimeInfo->err << "-> Thrust: " << theThrust << " N" << endl; - myRuntimeInfo->err << "-> Drag: " << theDrag << " N" << endl; - exit(1); - } - double segTime = cruiseSteps / (Mach * theAcftPt->atm.getSpeedOfSound(Altitude)); - double segFuel = segTime * theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_cruise); - *cruiseTime += segTime; - *cruiseFuel += segFuel; - grossMass -= segFuel; - flownDistance += cruiseSteps; - } while (flownDistance <= cruiseDistance); - } else { - *cruiseTime = 0.; - *cruiseFuel = 0.; - } -} - -bool flightSimulator::checkForSteadyLevelFlight(double grossMass, double Altitude, double Mach, string Config, string Rating, double bleedOff, double shaftOff, - aerodynamics theAero) { - double theDrag = theAero.getCruiseDrag(Mach, Altitude, 0., grossMass, Config, theAcftPt->atm); - theAcftPt->myEngines.calculate_N1_with_thrustlimit(theAcftPt->myEnergyProviders.energyCarrierID_cruise, Altitude, Mach, theAcftPt->atm, 1.0, Rating, bleedOff, shaftOff, - theDrag); - double theThrust = theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_cruise); - if (0.995 * theDrag > theThrust) { - return false; - } else { - return true; - } -} - -/* Descend */ -void flightSimulator::getDescendFuel(double startAltitude, double endAltitude, double startMach, double endMach, double bleedOff, double shaftOff, double *descendFuel, - double *descendDistance, double *descendTime) { - double deltaAltitude = fabs(startAltitude - endAltitude); - double avgTAS = 0.5 * (startMach * theAcftPt->atm.getSpeedOfSound(startAltitude) - + endMach * theAcftPt->atm.getSpeedOfSound(endAltitude)); - *descendDistance = 1. / tan(convertUnit(DEGREE, RADIAN, 5.)) * deltaAltitude; - *descendTime = sqrt(pow(*descendDistance, 2.) + pow(deltaAltitude, 2)) / avgTAS; - theAcftPt->myEngines.calculate_N1_with_penalties(theAcftPt->myEnergyProviders.energyCarrierID_descent, startAltitude, startMach, theAcftPt->atm, 1., "idle", bleedOff, - shaftOff); - *descendFuel = *descendTime * theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_descent); -} diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h deleted file mode 100644 index ba14dd67..00000000 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/flightSimulator.h +++ /dev/null @@ -1,215 +0,0 @@ -/* - * UNICADO - UNIversity Conceptual Aircraft Design and Optimization - * - * Copyright (C) 2025 UNICADO consortium - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - * - * Description: - * This file is part of UNICADO. - */ -#ifndef PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_LOW_FIDELITY_FLIGHTSIMULATOR_H_ -#define PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_LOW_FIDELITY_FLIGHTSIMULATOR_H_ - -#include <aerodynamics/aerodynamics.h> -#include <runtimeInfo/runtimeInfo.h> -#include <unitConversion/unitConversion.h> - -#include <string> -#include <memory> - -#include "../../aircraft.h" - -class aircraft; -class aerodynamics; - -using std::string; - -/**\class flightSimulator class that contains the amounts of fuel required for each flight phase -* -*/ -class flightSimulator { - public: - /**\brief Function to calculate the taxi fuel - *\param taxi time (s) - * \return taxi fuel (kg) - */ - double calcTaxiFuel(double taxiTime); - - /**\brief Function to compute the necessary climb fuel - *\param grossMass Aircraft gross mass (kg) - *\param startAlt Altitude at the starting point of the climb segment (m) - *\param endAlt Altitude at the end of the climb segment (m) - *\param startMach Mach number at the start of the climb segment (-) - *\param endMach Mach number at the end of the climb segment (-) - *\param Config Flaps configuration (-) - *\param Rating Engine rating (-) - *\param bleedOff Current bleed air offtake (kg/s) - *\param shaftOff Shaft power offtake (W) - *\param theAero Object of the aerodynamics class - *\param climbFuel Fuel needed during climb phase (kg) - *\param climbDistance Distance covered during climb phase (km) - *\param climbTime Time spent during climb phase (s) - */ - void getClimbFuel(double grossMass, - double startAlt, double endAlt, - double startMach, double endMach, - const string &Config, const string &Rating, - double bleedOff, double shaftOff, - const aerodynamics &theAero, - double *climbFuel, double *climbDistance, double *climbTime); - - - /**\brief Function to compute the fuel needed to accelerate from one Mach number to another Mach number - *\param grossMass Aircraft gross mass (kg) - *\param Altitude Aircraft altitude (m) - *\param startMach Mach number at the starting point of the acceleration segment (-) - *\param endMach Mach number at the ending point of the acceleration segment (-) - *\param Config Flaps configuration (-) - *\param Rating Engine rating (-) - *\param bleedOff Current bleed air offtake (kg/s) - *\param shaftOff Current shaft power offtake (W) - *\param theAero Object of the aerodynamics class - *\param accFuel Fuel needed during acceleration phase (kg) - *\param accDistance Distance covered during acceleration phase (km) - *\param accTime Time spent during acceleration phase (s) - */ - void getAccelerateFuel(double grossMass, - double Altitude, - double startMach, double endMach, - string Config, string Rating, - double bleedOff, double shaftOff, - aerodynamics theAero, - double *accFuel, double *accDistance, double *accTime); - - /**\brief Function checks if enough thrust is provided by the engine - *\param grossMass Aircraft gross mass (kg) - *\param Altitude Aircraft altitude (m) - *\param Mach Aircraft Mach number (-) - *\param Config Flaps configuration (-) - *\param Rating Engine rating (-) - *\param Derate Artificial constant to reduce the engine spool speed (between 0 and 1) - *\param bleedOff Current bleed air offtake (kg/s) - *\param shaftOff Current shaft power offtake (W) - *\param theAero Object of the aerodynamics class - *\return True or false - */ - bool checkForAcceleration(double grossMass, - double Altitude, double Mach, - string Config, string Rating, double Derate, - double bleedOff, double shaftOff, - aerodynamics theAero); - - /**\brief Function to compute the cruise fuel needed - *\param grossMass Aircraft gross mass (kg) - *\param Altitude Aircraft altitude (m) - *\param Mach Aircraft Mach number (-) - *\param Config Flaps configuration (-) - *\param Rating Engine rating (-) - *\param bleedOff Current bleed air offtake (kg/s) - *\param shaftOff Current shaft power offtake (W) - *\param theAero Object of the aerodynamics class - *\param cruiseFuel Fuel needed during the cruise phase (kg) - *\param cruiseDistance Distance covered during cruise phase (km) - *\param cruiseTime Time spent for the cruise phase (s) - */ - void getCruiseFuel(double grossMass, - double Altitude, double Mach, - string Config, string Rating, - double bleedOff, double shaftOff, - aerodynamics theAero, - double *cruiseFuel, double cruiseDistance, double *cruiseTime); - - /**\brief Function checks if enough engine thrust is provided - *\param grossMass Aircraft gross mass (kg) - *\param Altitude Aircraft altitude (m) - *\param Mach Aircraft Mach number (-) - *\param Config Flap configuration (-) - *\param Rating Engine rating (-) - *\param bleedOff Current bleed air offtake (kg/s) - *\param shaftOff Current shaft power offtake (W) - *\param theAero Object of the aerodynamics class - *\return True or false - */ - bool checkForSteadyLevelFlight(double grossMass, - double Altitude, double Mach, - string Config, string Rating, - double bleedOff, double shaftOff, - aerodynamics theAero); - - /**\brief Function to compute the descend fuel needed - *\param startAltitude Altitude at the starting point of the descend segment (m) - *\param endAltitude Altitude at the end of the descend segment (m) - *\param startMach Mach number at the start of the descend segment (-) - *\param endMach Mach number at the end of the descend segment (-) - *\param bleedOff Current bleed air offtake (kg/s) - *\param shaftOff Shaft power offtake (W) - *\param descendFuel Fuel needed during descend phase (kg) - *\param descendDistance Distance covered during descend phase (km) - *\param descendTime Time spent for the descend phase (s) - */ - void getDescendFuel(double startAltitude, double endAltitude, - double startMach, double endMach, - double bleedOff, double shaftOff, - double *descendFuel, double *descendDistance, double *descendTime); - - /**\brief Constructor flightSimulator - *\param theAircraft Address to the aircraft object - */ - explicit flightSimulator(std::shared_ptr<aircraft> anAcftPtr); - - /**\brief Destructor flightSimulator object - * - */ - virtual ~flightSimulator(); - - private: - std::shared_ptr<aircraft> theAcftPt; /**< Pointer to the aircraft object */ - - double climbAltSteps; /**< Climb altitude steps (m) */ - double cruiseSteps; /**< Cruise steps (m) */ - - /**\brief Function to compute the climb fuel needed - *\param massAC Aircraft mass (kg) - *\param H0 Initial aircraft height (m) - *\param H1 Final aircraft height (m) - *\param Mach0 Initial aircraft Mach number (-) - *\param Mach1 Final aircraft Mach number (-) - *\param config Flap configuration (-) - *\param rating Engine rating (-) - *\param bleed Current bleed air (kg/s) - *\param shaft Shaft power (W) - *\param AERO Object of the aerodynamics class - *\param theTime Time spent in the climb phase (s) - *\param theFuel Average fuel needed (kg) - *\param theDistance Distance covered (km) - */ - void calcClimbFuel(double massAC, double H0, double H1, double Mach0, double Mach1, - const string& config, string rating, double bleed, double shaft, - aerodynamics AERO, - double *theTime, double *theFuel, double *theDistance); - - /**\brief Function to compute the thrust needed for the given rate of climb (theROC) - *\param massOfAC Aircraft mass (kg) - *\param H Height (m) - *\param Mach Mach number (-) - *\param theROC Rate of climb (m/s) - *\param theConfiguration Flap configuration (-) - *\param AERO Object of the aerodynamics class - *\return The required thrust for the given rate of climb (N) - */ - double calcThrustForROC(double massOfAC, double H, double Mach, double theROC, string theConfiguration, aerodynamics theAERO); -}; - -#endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_LOW_FIDELITY_FLIGHTSIMULATOR_H_ diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.cpp b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.cpp deleted file mode 100644 index 362acdcb..00000000 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * UNICADO - UNIversity Conceptual Aircraft Design and Optimization - * - * Copyright (C) 2025 UNICADO consortium - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - * - * Description: - * This file is part of UNICADO. - */ -#include "fuelFromMassFraction.h" - -using std::endl; -using std::vector; - -fuelFromMassFraction::fuelFromMassFraction(double thisOME, double cruiseMach) - : - theBreguetFactor(0.), - breguetEfficiencyBlockFuel(1.0), - breguetEfficiencyTripFuel(1.0), - missionFuel(0.), - tripFuel(0.), - theOME(thisOME), - theCruiseMach(cruiseMach) { - // ctor -} - -fuelFromMassFraction::~fuelFromMassFraction() { - // dtor -} - -// TODO(franz#1#): evtl ueberfluessig, die mit calcFuelFromMassFractions wird einfach so angepasst mit den breguetEfficiency-Faktoren, -// damit mission-/tripfuel gleich dem Fuel von calcStandardFuelPlanning in fuelPlanning - -void fuelFromMassFraction::calibrateBreguet(double targetMissionFuel, double targetTripFuel, double designPayload, double designRange) { - calcFuelFromMassFractions(designPayload, designRange); - breguetEfficiencyBlockFuel = targetMissionFuel / missionFuel; - breguetEfficiencyTripFuel = targetTripFuel / tripFuel; - calcFuelFromMassFractions(designPayload, designRange); - double theDeviation = sqrt(pow((targetMissionFuel - missionFuel) / targetMissionFuel, 2) - + pow((targetTripFuel - tripFuel) / targetTripFuel, 2)); - if (theDeviation > 0.01) { - myRuntimeInfo->err << "Calibration of Breguet fuel estimation not possible!" << endl; - myRuntimeInfo->err << "Abort!!!" << endl; - exit(1); - } -} - -double fuelFromMassFraction::iterativeBreguetForRange(double payloadForRange, double takeOffMass, double theMTOM, double theDesignRange) { - vector<double> ranges; - vector<double> deltaTOM; - double TOM(0.); - ranges.push_back(theDesignRange); - deltaTOM.push_back(takeOffMass - theMTOM); - ranges.push_back(0.8 * theDesignRange); - calcFuelFromMassFractions(payloadForRange, ranges.back()); - TOM = theOME + payloadForRange + tripFuel; - deltaTOM.push_back(takeOffMass - TOM); - int i = 1; - do { - ranges.push_back(ranges.at(i) - (ranges.at(i) - ranges.at(i - 1)) / (deltaTOM.at(i) - deltaTOM.at(i - 1))*deltaTOM.at(i)); - calcFuelFromMassFractions(payloadForRange, ranges.back()); - TOM = theOME + payloadForRange + tripFuel; - deltaTOM.push_back(takeOffMass - TOM); - i++; - if (deltaTOM.size() > 250) { - myRuntimeInfo->err << "Error in convergence of iterative Breguet-range calculation!" << endl; - myRuntimeInfo->err << "Abort!!!" << endl; - exit(1); - } - } while (fabs(deltaTOM.back()) > 0.005); - double resultRange = ranges.back(); - ranges.clear(); - deltaTOM.clear(); - return resultRange; -} - -void fuelFromMassFraction::calcFuelFromMassFractions(double missionPayload, double missionRange) { - vector<double> segmentMass; - vector<double> segmentFuel; - double oldTripFuel(0.); - tripFuel = 0.; - missionFuel = 0.; - do { - segmentFuel.clear(); - segmentMass.clear(); - double theTOM = theOME + missionPayload + missionFuel; - oldTripFuel = tripFuel; - tripFuel = 0.; - missionFuel = 0.; - segmentMass.push_back(theTOM); - for (int i = 1; i <= 9; i++) { - double fraction(0.); - /* Take-off */ - if (i == 1) { - fraction = 0.98; - } else if (i == 2) { /* Climb and Accelerate */ - fraction = 1.0065 - 0.0325 * theCruiseMach; - } else if (i == 3) { /* Cruise */ - double thisRange = (missionRange - 300000.); - fraction = pow(2.71828, (-1.) * thisRange * theBreguetFactor); - } else if (i == 4) { /* Descent */ - fraction = 0.992; - } else if (i == 5) { /* Aborted Landing -> T-O */ - fraction = 0.98; - } else if (i == 6) { /* Climb and Accelerate -> Diversion */ - fraction = 1.0065 - 0.0325 * 0.74; - } else if (i == 7) { /* Cruise Diversion */ - double thisRange = (200. - 100.) * 1000.; // m - fraction = pow(2.71828, (-1.) * thisRange * theBreguetFactor); - } else if (i == 8) { /* Approach Diversion */ - fraction = 0.992; - } else if (i == 9) { /* Landing */ - fraction = 0.995; - } - segmentFuel.push_back((1. - fraction) * segmentMass.at(i - 1)); - segmentMass.push_back(segmentMass.at(i - 1) - segmentFuel.back()); - tripFuel += segmentFuel.back(); - if (i <= 5) { - missionFuel += segmentFuel.back(); - } - if (segmentMass.back() < 0.) { - myRuntimeInfo->err << "Error in calcFuelFromMassFractions" << std::endl; - exit(1); - } - } - } while (fabs(oldTripFuel - tripFuel) / tripFuel >= 0.0001); - segmentFuel.clear(); - segmentMass.clear(); - missionFuel = breguetEfficiencyBlockFuel * missionFuel; - tripFuel = breguetEfficiencyTripFuel * tripFuel; -} diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.h deleted file mode 100644 index e26401cc..00000000 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelFromMassFraction.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * UNICADO - UNIversity Conceptual Aircraft Design and Optimization - * - * Copyright (C) 2025 UNICADO consortium - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - * - * Description: - * This file is part of UNICADO. - */ -#ifndef PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_LOW_FIDELITY_FUELFROMMASSFRACTION_H_ -#define PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_LOW_FIDELITY_FUELFROMMASSFRACTION_H_ - -#include <runtimeInfo/runtimeInfo.h> - -#include <cmath> -#include <vector> - - -/**\class fuelFromMassFraction Class contains the mass fractions necessary for the flight -* -*/ -class fuelFromMassFraction { - public: - double theBreguetFactor; /**< Breguet factor (1/m) */ // Breguet Factors = g*SFC / V*L/D - - double breguetEfficiencyBlockFuel; /**< Relation between target and actual block fuel (-) */ - double breguetEfficiencyTripFuel; /**< Relation between target and actual trip fuel (-) */ - - double missionFuel; /**< Required fuel for the block time (kg) */ - double tripFuel; /**< Required fuel from brake release till landing at the destination (kg) */ - - - /**\brief Calibration of Breguet fuel estimation - *\param targetMissionFuel Supposed aircraft mission fuel needed (kg) - *\param targetTripFuel Supposed aircraft trip fuel needed (kg) - *\param designPayload Aircraft design payload (kg) - *\param designRange Aircraft design range (m) - */ - void calibrateBreguet(double targetMissionFuel, double targetTripFuel, double designPayload, double designRange); - - /**\brief Computes iteratively the range after Breguet - *\param payloadForRange Aircraft payload (kg) - *\param takeOffMass Aircraft take-off mass (kg) - *\param theMTOM Maximum aircraft take off mass (kg) - *\param theDesignRange Aircraft design range (m) - *\return range of the aircraft after Breguet - */ - double iterativeBreguetForRange(double payloadForRange, double takeOffMass, double theMTOM, double theDesignRange); - - /**\brief Function calculates the block and the trip fuel for the given payload and range - *\param missionPayload Payload during the mission (kg) - *\param missionRange Aircraft range of the mission (m) - */ - void calcFuelFromMassFractions(double missionPayload, double missionRange); - - /**\brief Constructor fuelFromMassFraction - *\param thisOME Operating empty mass (kg) - *\param cruiseMach Aircraft cruise Mach number (-) - */ - fuelFromMassFraction(double thisOME, double cruiseMach); - - /**\brief Destructor fuelFromMassFraction - * - */ - virtual ~fuelFromMassFraction(); - - private: - double theOME; /**< Operating empty mass (kg) */ - double theCruiseMach; /**< Cruise Mach number (-) */ -}; - -#endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_LOW_FIDELITY_FUELFROMMASSFRACTION_H_ diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp deleted file mode 100644 index 9e486222..00000000 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.cpp +++ /dev/null @@ -1,680 +0,0 @@ -/* - * UNICADO - UNIversity Conceptual Aircraft Design and Optimization - * - * Copyright (C) 2025 UNICADO consortium - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - * - * Description: - * This file is part of UNICADO. - */ -#include "fuelPlanning.h" - -namespace low { - -fuelPlanning::fuelPlanning(std::shared_ptr<aircraft> anAcftPtr, const std::shared_ptr<performance_assessment_settings> aSettingsPt, const std::shared_ptr<RuntimeIO>& rtIO) - : - rtIO(rtIO), - theAcftPt(anAcftPtr), - theSettingsPt(aSettingsPt), - myFlightSim(anAcftPtr), - myBreguet(theAcftPt->OME, theAcftPt->MInitialCruise), - relConFuel(theSettingsPt->myFuelPlan.contingencyFuel), - P(pointData()) { - tripTime = 0.; - blockTime = 0.; - myFuel.taxiFuelTakeoff = 0.; - myFuel.taxiFuelLanding = 0.; - myFuel.missionFuel = 0.; // flight fuel: fuel consumed without taxiing! -> better: mission fuel? - myFuel.contigencyFuel = 0.; - myFuel.alternateFuel = 0.; - myFuel.finalReserveFuel = 0.; - myFuel.tripFuel = 0.; - // ctor -} - -void fuelPlanning::doFuelPlanning() { - this->calcStandardFuelPlanning(&myFuel.taxiFuelTakeoff, &myFuel.taxiFuelLanding, &myFuel.missionFuel, &myFuel.contigencyFuel, &myFuel.alternateFuel, &myFuel.finalReserveFuel, - &myFuel.tripFuel, theAcftPt->myMission.missionRange, theAcftPt->myMission.missionPayload, true, theAcftPt->aero); - if (theSettingsPt->designForMTOM == true) { - theAcftPt->MTOM = Rounding(theAcftPt->OME + theAcftPt->myMission.missionPayload + myFuel.missionFuel - myFuel.taxiFuelTakeoff, 2); - } else { -// TODO(franz#1#): ueberpruefen ob so ok - if (theSettingsPt->useStudyMissionForAnalysis) { - if (theAcftPt->MTOM < theAcftPt->OME + theAcftPt->myMission.missionPayload + myFuel.tripFuel - myFuel.taxiFuelTakeoff) { - myRuntimeInfo->err << "The mission cannot be flown.!" << std::endl; - myRuntimeInfo->err << "MTOM exceedance!" << std::endl; - myRuntimeInfo->err << "MTOM: " << theAcftPt->MTOM << " kg" << std::endl; - myRuntimeInfo->err << "TOM: " << theAcftPt->OME + theAcftPt->myMission.missionPayload + myFuel.tripFuel - myFuel.taxiFuelTakeoff << " kg" << std::endl; - exit(1); - } - } - } - if (theAcftPt->MFM < myFuel.tripFuel) { - myRuntimeInfo->err << "The mission cannot be flown.!" << std::endl; - myRuntimeInfo->err << "MFM exceedance!" << std::endl; - myRuntimeInfo->err << "MFM: " << theAcftPt->MFM << " kg" << std::endl; - myRuntimeInfo->err << "Trip Fuel: " << myFuel.tripFuel << " kg" << std::endl; - exit(1); - } - /* Determining the flight time */ - for (unsigned int i = 0; i <= theAcftPt->myMission.Steps.size() - 1; i++) { - tripTime += convertUnit(SECOND, MINUTE, theMissionFuel.at(i + 1).Time); - } - blockTime = tripTime; - tripTime += theAcftPt->myMission.taxiTimeOrigin + theAcftPt->myMission.taxiTimeDestination; -} - -void fuelPlanning::doPayloadRangeOLD() { - /* Determining the Breguet Factors = g*SFC / V*L/D */ - //double breguetFactor(0.); - double cruiseRange(0.); - double tempBreguetFactor(0.); - // where is theMissionFuel.at(i+1).consumedFuel (see below) set/calculated? - for (unsigned int i(0); i <= theAcftPt->myMission.Steps.size() - 1; i++) { - if (theAcftPt->myMission.Steps.at(i).modeStep == "cruise") { - if ((1. / (1. - theMissionFuel.at(i + 1).consumedFuel / theMissionFuel.at(i).Mass)) < 10e-8) { - myRuntimeInfo->err << "Abort: Log-Argument becomes too small!!!" << std::endl; - myRuntimeInfo->err << "1 / (1-f_consumed/f_mission) = " << (1. / (1. - theMissionFuel.at(i + 1).consumedFuel / theMissionFuel.at(i).Mass)) << std::endl; - exit(1); - } else { - tempBreguetFactor += theMissionFuel.at(i + 1).Range * (1. / theMissionFuel.at(i + 1).Range) - * log(1. / (1. - theMissionFuel.at(i + 1).consumedFuel / theMissionFuel.at(i).Mass)); - cruiseRange += theMissionFuel.at(i + 1).Range; - } - } - } - myBreguet.theBreguetFactor = tempBreguetFactor / cruiseRange; - myBreguet.calibrateBreguet(myFuel.missionFuel, myFuel.tripFuel, theAcftPt->designPayload, theAcftPt->designRange); - /* Determination of the 0.Segments */ - //1. Point - myPayloadRange.push_back(payloadRangeData()); - myPayloadRange.push_back(payloadRangeData()); - myPayloadRange.back().Payload = theAcftPt->maxPayload; - myPayloadRange.back().Fuel = theAcftPt->MTOM - theAcftPt->OME - myPayloadRange.back().Payload; - myPayloadRange.back().Range = myBreguet.iterativeBreguetForRange(theAcftPt->maxPayload, theAcftPt->MTOM, theAcftPt->MTOM, theAcftPt->designRange); - myPayloadRange.back().TOM = theAcftPt->MTOM; - // 2 Point ->Linear equation for Fuel: f(r) = m*r+a - vector<double> theRange; - vector<double> theFuel; - for (double i = 0.5; i <= 1.0; i += 0.05) { - theRange.push_back(i * myPayloadRange.back().Range); - myBreguet.calcFuelFromMassFractions(theAcftPt->maxPayload, theRange.back()); - theFuel.push_back(myBreguet.tripFuel); - } - vector<double> dataCoeff; - dataCoeff = calcRegressionCoefficientsUsingQRdecomp(theRange, theFuel, 1); - theFuel.clear(); - theRange.clear(); - // 0. Point - // myPayloadRange.insert( myPayloadRange.begin(), payloadRangeData() ); //see line 131! - myPayloadRange.at(0).Payload = theAcftPt->maxPayload; - myPayloadRange.at(0).Range = 0.0; - myPayloadRange.at(0).Fuel = dataCoeff.at(0); - myPayloadRange.at(0).TOM = theAcftPt->OME + theAcftPt->maxPayload + myPayloadRange.at(0).Fuel; - dataCoeff.clear(); - /* Determination of the 1. Segments */ - // 2. Point - myPayloadRange.push_back(payloadRangeData()); - myPayloadRange.back().TOM = theAcftPt->MTOM; - if (theAcftPt->OME + theAcftPt->MFM < theAcftPt->MTOM) { - myPayloadRange.back().Payload = theAcftPt->MTOM - theAcftPt->OME - theAcftPt->MFM; - if (myPayloadRange.back().Payload < 0.) { - myRuntimeInfo->err << "Payload cannot be negative!" << std::endl; - myRuntimeInfo->err << "Abort!!!" << std::endl; - exit(1); - } - myPayloadRange.back().Fuel = theAcftPt->MFM; - } else { - myPayloadRange.back().Payload = 0.; - myPayloadRange.back().Fuel = theAcftPt->MTOM - theAcftPt->OME; - if (myPayloadRange.back().Fuel > theAcftPt->MFM) { - myRuntimeInfo->err << "Fuel cannot be larger than MFM!" << std::endl; - myRuntimeInfo->err << "Abort!!!" << std::endl; - exit(1); - } - } - myPayloadRange.back().Range = myBreguet.iterativeBreguetForRange(myPayloadRange.back().Payload, theAcftPt->MTOM, theAcftPt->MTOM, theAcftPt->designRange); - /* 3. Segment: no payload and maximum refueled */ - if (theAcftPt->OME + theAcftPt->MFM < theAcftPt->MTOM) { - myPayloadRange.push_back(payloadRangeData()); - myPayloadRange.back().TOM = theAcftPt->OME + theAcftPt->MFM; - myPayloadRange.back().Payload = 0.; - myPayloadRange.back().Fuel = theAcftPt->MFM; - myPayloadRange.back().Range = myBreguet.iterativeBreguetForRange(0., myPayloadRange.back().TOM, theAcftPt->MTOM, theAcftPt->designRange); - } else { - myPayloadRange.push_back(payloadRangeData()); - int ID = myPayloadRange.size() - 2; - myPayloadRange.back().TOM = myPayloadRange.at(ID).TOM; - myPayloadRange.back().Payload = myPayloadRange.at(ID).Payload; - myPayloadRange.back().Fuel = myPayloadRange.at(ID).Fuel; - myPayloadRange.back().Range = myPayloadRange.at(ID).Range; - } -} - -void fuelPlanning::doFuelPayloadRangeOLD() { - if (!fileExists(rtIO->getCsvFilesDirTool())) { - myRuntimeInfo->out << "Create csvOutput folder in program folder: " << rtIO->getCsvFilesDirTool() << std::endl; - CreateDirectory(rtIO->getCsvFilesDirTool().c_str(), NULL); // ...Create folder - } - std::ofstream csv; - string csvFile(rtIO->getCsvFilesDirTool() + "/" + "performance_assessment" + "_fuelPayloadRange.csv"); // Replaced global variable "TOOLNAME" (?) - csv.open(csvFile.c_str()); - csv << "# Range [NM]; Payload [kg]; Consumed Fuel [kg]; Time [h]" << std::endl; - - /* 1. Range at maxPayload */ - for (int i(0); i <= 25; i++) { - for (unsigned int j = 0; j <= 50; j++) { - double range = static_cast<double>(i) / 25. * myPayloadRange.at(1).Range; - double payload = static_cast<double>(j) / 50. * theAcftPt->maxPayload; - myBreguet.calcFuelFromMassFractions(payload, range); - double fuel = myBreguet.missionFuel; - double time = 1.10 * range / (theAcftPt->MInitialCruise * theAcftPt->atm.getSpeedOfSoundISA(35000. * 0.3048) * 3.6); - csv << range / 1.852 << "; "; - csv << payload << "; "; - csv << fuel << "; "; - csv << time << std::endl; - } - csv << std::endl; - } - /* 2. Range at maxPayload */ - for (unsigned int i(1); i <= 25; i++) { - for (unsigned int j(0); j <= 50; j++) { - double range = myPayloadRange.at(1).Range + static_cast<double>(i) / 25. * (myPayloadRange.at(2).Range - myPayloadRange.at(1).Range); - double m = (myPayloadRange.at(1).Payload - myPayloadRange.at(2).Payload) / (myPayloadRange.at(1).Range - myPayloadRange.at(2).Range); - double a = myPayloadRange.at(1).Payload - m * myPayloadRange.at(1).Range; - double payload = static_cast<double>(j) / 50. * (m * range + a); - myBreguet.calcFuelFromMassFractions(payload, range); - double fuel = myBreguet.missionFuel; - double time = 1.10 * range / (theAcftPt->MInitialCruise * theAcftPt->atm.getSpeedOfSoundISA(35000. * 0.3048) * 3.6); - csv << range / 1.852 << "; "; - csv << payload << "; "; - csv << fuel << "; "; - csv << time << std::endl; - } - csv << std::endl; - } - /* 3. Range at maxPayload */ - for (int i = 1; i <= 24; i++) { - for (int j(0); j <= 50; j++) { - double range = myPayloadRange.at(2).Range + static_cast<double>(i) / 25. * (myPayloadRange.at(3).Range - myPayloadRange.at(2).Range); - double m = (myPayloadRange.at(2).Payload - myPayloadRange.at(3).Payload) / (myPayloadRange.at(2).Range - myPayloadRange.at(3).Range); - double a = myPayloadRange.at(2).Payload - m * myPayloadRange.at(2).Range; - double payload = static_cast<double>(j) / 50. * (m * range + a); - myBreguet.calcFuelFromMassFractions(payload, range); - double fuel = myBreguet.missionFuel; - double time = 1.10 * range / (theAcftPt->MInitialCruise * theAcftPt->atm.getSpeedOfSoundISA(35000. * 0.3048) * 3.6); - csv << range / 1.852 << "; "; - csv << payload << "; "; - csv << fuel << "; "; - csv << time << std::endl; - } - csv << std::endl; - } - csv.close(); -} - -void fuelPlanning::payloadRangeFromAcftXML() { - // 0.Point - myPayloadRange.push_back(payloadRangeData()); - myPayloadRange.back().Payload = theAcftPt->maxPayload; - myPayloadRange.back().Fuel = 0.; - myPayloadRange.back().Range = 0.; - myPayloadRange.back().TOM = 0.; - // 1.Point - myPayloadRange.push_back(payloadRangeData()); - myPayloadRange.back().Payload = theAcftPt->maxPayload; - myPayloadRange.back().Fuel = theAcftPt->MTOM - theAcftPt->OME - theAcftPt->maxPayload; - myPayloadRange.back().Range = theAcftPt->rangeMaxPayload; - myPayloadRange.back().TOM = theAcftPt->MTOM; - // 2.Point - myPayloadRange.push_back(payloadRangeData()); - myPayloadRange.back().Payload = theAcftPt->payloadRangeMaxfuel; - myPayloadRange.back().Fuel = theAcftPt->MFM; - myPayloadRange.back().Range = theAcftPt->rangeMaxFuel; - myPayloadRange.back().TOM = theAcftPt->MTOM; - // 3.Point - myPayloadRange.push_back(payloadRangeData()); - myPayloadRange.back().Payload = 0.; - myPayloadRange.back().Fuel = 0.; - myPayloadRange.back().Range = theAcftPt->rangeFerry; - myPayloadRange.back().TOM = 0.; -} - -void fuelPlanning::calcStandardFuelPlanning(double *theTaxiFuelTakeoff, double *theTaxiFuelLanding, double *theMissionFuel, double *theContigencyFuel, - double *theAlternateFuel, double *theFinalReserveFuel, double *theTripFuel, - double theRange, double thePayload, bool writingMissionData, const aerodynamics &myAERO) { - if (thePayload > theAcftPt->maxPayload) { - myRuntimeInfo->err << "The Payload mission is larger than the maximum payload.!" << std::endl; - myRuntimeInfo->err << "Mission Payload: " << thePayload << " kg" << std::endl; - myRuntimeInfo->err << "Max. Payload: " << theAcftPt->maxPayload << " kg" << std::endl; - myRuntimeInfo->err << "The Mission cannot be flown! Abort!" << std::endl; - exit(1); - } - *theTripFuel = this->fastFuelEstimate(myAERO); - *theMissionFuel = *theTripFuel; // initialization of the mission fuel - *theTaxiFuelTakeoff = myFlightSim.calcTaxiFuel(theAcftPt->myMission.taxiTimeOrigin); - *theTaxiFuelLanding = myFlightSim.calcTaxiFuel(theAcftPt->myMission.taxiTimeDestination); - double oldMissionFuel(0.); - int ID(0); - do { - oldMissionFuel = *theMissionFuel; - double acMass = theAcftPt->OME + thePayload + *theMissionFuel; - acMass -= *theTaxiFuelTakeoff; // Take-off mass - *theTripFuel = this->calcMissionFuel(acMass, theRange, writingMissionData, myAERO); - acMass -= *theTripFuel; - *theAlternateFuel = this->calcAlternateFuel(acMass, myAERO); - acMass -= *theAlternateFuel; - *theFinalReserveFuel = this->calcFinalReserveFuel(acMass, myAERO); - *theContigencyFuel = relConFuel * *theTripFuel; - // no taxi fuel at landing necessary if reserve fuel is used - *theMissionFuel = *theTaxiFuelTakeoff + *theTripFuel + *theAlternateFuel + *theFinalReserveFuel + *theContigencyFuel; - // *theTripFuel = *theTaxiFuel + *theMissionFuel + *theAlternateFuel + *theFinalReserveFuel + *theContigencyFuel; - ID++; - if (ID >= 30) { - myRuntimeInfo->out << "Attention: No tank convergence could be achieved." << std::endl; - myRuntimeInfo->out << "convergence criterion (tripFuel_0-tripFuel_1)/tripFuel_1 <! 0.0001" << std::endl; - myRuntimeInfo->out << "Convergence achieved after 30 iterations: " << fabs(oldMissionFuel - *theMissionFuel) / *theMissionFuel << std::endl; - break; - } - } while (fabs(oldMissionFuel - *theMissionFuel) / *theMissionFuel >= 0.0001); -} - -double fuelPlanning::calcMissionFuel(double acMass, double Range, bool writeMission, aerodynamics theAERO) { - if (writeMission == true) { - theMissionFuel.clear(); - theMissionFuel.push_back(missionFuelData()); - theMissionFuel.back().Time = 0.; - theMissionFuel.back().Range = 0.; - theMissionFuel.back().Altitude = 0.; - theMissionFuel.back().TAS = 0.; - theMissionFuel.back().Mach = 0.; - theMissionFuel.back().Mass = acMass; - theMissionFuel.back().consumedFuel = 0.; - theMissionFuel.back().Thrust = 0.; - theMissionFuel.back().fuelFlow = 0.; - theMissionFuel.back().ROC = 0.; - } - vector<double> missionFuel; - double distance = 0.; - double flownDistance = 0.; - double distanceCruise(0.); - double flownCruise = 0.0; - bool firstCruise(true); - unsigned int i(0); - while (i <= theAcftPt->myMission.Steps.size() - 1) { - setP(i); - bool checkSteadyLevelFlight(false); - bool checkAcceleration(false); - double time(0.); - double Drag(0.); - /* TakeOff, Climb, Accelerate, Cruise, Descend, Landing */ - if (theAcftPt->myMission.Steps.at(i).Point.simplifiedMODE == "takeoff") { - time = convertUnit(MINUTE, SECOND, 1.); // Assumption that take-off lasts 1 minute - // Drag = 0.0; // TODO(hansmann): Wechsel von Drag=0.0 & calculate_N1_with_thrustlimit auf calculate_N1_with_penalties mit vollschub abklären - // theAcftPt->myEngines.calculate_N1_with_thrustlimit(theAcftPt->myEnergyProviders.energyCarrierID_takeoff, P.Altitude, P.Mach, theAcftPt->atm, P.derate, P.rating, - // P.bleedOff, P.shaftOff, convertUnit(NEWTON, KILO, NEWTON, Drag)); - theAcftPt->myEngines.calculate_N1_with_penalties(theAcftPt->myEnergyProviders.energyCarrierID_takeoff, P.Altitude, P.Mach, theAcftPt->atm, P.derate, P.rating, - P.bleedOff, P.shaftOff); - missionFuel.push_back(time * theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_takeoff)); - } else if (theAcftPt->myMission.Steps.at(i).Point.simplifiedMODE == "climb") { - time = 0.0; - distance = 0.; - if (theAcftPt->myMission.Steps.at(i - 1).endAltitude < theAcftPt->myMission.Steps.at(i).endAltitude) { - missionFuel.push_back(0.); - myFlightSim.getClimbFuel(acMass, theAcftPt->myMission.Steps.at(i - 1).endAltitude, - theAcftPt->myMission.Steps.at(i).endAltitude, theAcftPt->myMission.Steps.at(i - 1).endMach, - theAcftPt->myMission.Steps.at(i).endMach, P.config, P.rating, P.bleedOff, P.shaftOff, theAERO, &missionFuel.back(), &distance, &time); - } else { - myRuntimeInfo->out << "... No change in altitude despite climb segment." << std::endl; - missionFuel.push_back(0.0); - } - flownDistance += distance; - } else if (theAcftPt->myMission.Steps.at(i).Point.simplifiedMODE == "accelerate") { - Drag = 0.0; - time = 0.0; - distance = 0.; - try { - checkAcceleration = myFlightSim.checkForAcceleration(acMass, P.Altitude, P.Mach, - P.config, P.rating, P.derate, P.bleedOff, P.shaftOff, theAERO); - } catch (const std::string& errMsg) { - myRuntimeInfo->out << errMsg << std::endl; - myRuntimeInfo->out << "Try to increase rating..." << std::endl; - } - if (checkAcceleration == false && P.rating == "cruise") { - P.rating = "climb"; - try { - checkAcceleration = myFlightSim.checkForAcceleration(acMass, P.Altitude, P.Mach, - P.config, P.rating, P.derate, P.bleedOff, P.shaftOff, theAERO); - } catch (const std::string& errMsg) { - myRuntimeInfo->out << errMsg << std::endl; - myRuntimeInfo->out << "Try to increase rating..." << std::endl; - } - } - if (checkAcceleration == false && P.rating == "climb") { - P.rating = "maximum_continuous"; - try { - checkAcceleration = myFlightSim.checkForAcceleration(acMass, P.Altitude, P.Mach, - P.config, P.rating, P.derate, P.bleedOff, P.shaftOff, theAERO); - } catch (const std::string& errMsg) { - myRuntimeInfo->out << errMsg << std::endl; - myRuntimeInfo->err << "Rating cannot be further increased..." << std::endl; - } - } - if (checkAcceleration == false) { - exitAcceleration(i, P, acMass); - } - missionFuel.push_back(0.); - myFlightSim.getAccelerateFuel(acMass, P.Altitude, - theAcftPt->myMission.Steps.at(i - 1).endMach, theAcftPt->myMission.Steps.at(i).endMach, - P.config, P.rating, - P.bleedOff, P.shaftOff, - theAERO, - &missionFuel.back(), &distance, &time); - flownDistance += distance; - } else if (theAcftPt->myMission.Steps.at(i).Point.simplifiedMODE == "cruise") { - if (firstCruise == true) { - distanceCruise = Range - flownDistance - 10000. / tan(convertUnit(DEGREE, RADIAN, 5.)); - flownCruise = 0.; - firstCruise = false; - } - try { - checkSteadyLevelFlight = myFlightSim.checkForSteadyLevelFlight(acMass, P.Altitude, P.Mach, P.config, P.rating, P.bleedOff, P.shaftOff, theAERO); - } catch (const std::string& errMsg) { - myRuntimeInfo->out << errMsg << std::endl; - myRuntimeInfo->out << "Try to increase rating..." << std::endl; - } - if (checkSteadyLevelFlight == false && P.rating == "cruise") { - P.rating = "climb"; - try { - checkSteadyLevelFlight = myFlightSim.checkForSteadyLevelFlight(acMass, P.Altitude, P.Mach, P.config, P.rating, P.bleedOff, P.shaftOff, theAERO); - } catch (const std::string& errMsg) { - myRuntimeInfo->out << errMsg << std::endl; - myRuntimeInfo->out << "Try to increase rating..." << std::endl; - } - } - if (checkSteadyLevelFlight == false && P.rating == "climb") { - P.rating = "maximum_continuous"; - try { - checkSteadyLevelFlight = myFlightSim.checkForSteadyLevelFlight(acMass, P.Altitude, P.Mach, P.config, P.rating, P.bleedOff, P.shaftOff, theAERO); - } catch (const std::string& errMsg) { - myRuntimeInfo->out << errMsg << std::endl; - myRuntimeInfo->err << "Rating cannot be further increased..." << std::endl; - } - } - if (checkSteadyLevelFlight == false) { - exitSteadyLevelFlight(i, P, Drag); - } - double cruiseRange(0.0); - cruiseRange = theAcftPt->myMission.Steps.at(i).relSegmentLength * distanceCruise - flownCruise; - if (cruiseRange < 0.) { - myRuntimeInfo->err << "Negative cruise route!" << std::endl; - myRuntimeInfo->err << "Abort!" << std::endl; - myRuntimeInfo->err << "Segment: " << i << std::endl; - myRuntimeInfo->err << "Altitude:" << theAcftPt->myMission.Steps.at(i).Point.Altitude << std::endl; - myRuntimeInfo->err << "Altitude:" << theAcftPt->myMission.Steps.at(i).Point.Mach << std::endl; - myRuntimeInfo->err << "-> Possible reason: too slow climb to the altitude, so that the climb is longer than the actual mission segment." << std::endl; - exit(1); - } - distance = cruiseRange; - flownCruise += cruiseRange; - flownDistance += cruiseRange; - missionFuel.push_back(0.); - time = 0.; - myFlightSim.getCruiseFuel(acMass, P.Altitude, P.Mach, P.config, P.rating, P.bleedOff, P.shaftOff, theAERO, - &missionFuel.back(), cruiseRange, &time); - } else if (theAcftPt->myMission.Steps.at(i).Point.simplifiedMODE == "descend") { - time = 0.; - missionFuel.push_back(0.); - myFlightSim.getDescendFuel(theAcftPt->myMission.Steps.at(i - 1).endAltitude, - theAcftPt->myMission.Steps.at(i).endAltitude, theAcftPt->myMission.Steps.at(i - 1).endMach, - theAcftPt->myMission.Steps.at(i).endMach, P.bleedOff, P.shaftOff, &missionFuel.back(), &distance, &time); - flownDistance += distance; - } else if (theAcftPt->myMission.Steps.at(i).Point.simplifiedMODE == "landing") { - Drag = 0.0; - time = convertUnit(MINUTE, SECOND, 2.0); // Assume the final approach and landing will take 2 minutes. - distance = 0.; - theAcftPt->myEngines.calculate_N1_with_penalties(theAcftPt->myEnergyProviders.energyCarrierID_landing, P.Altitude, P.Mach, theAcftPt->atm, P.derate, P.rating, - P.bleedOff, P.shaftOff); - missionFuel.push_back(time * theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_landing)); - } else { - myRuntimeInfo->err << "unknown simplified Mode !" << std::endl; - myRuntimeInfo->err << theAcftPt->myMission.Steps.at(i).Point.simplifiedMODE << std::endl; - exit(1); - } - acMass -= missionFuel.back(); - if (writeMission == true) { - double maxROC(0.); - theMissionFuel.push_back(missionFuelData()); - theMissionFuel.back().Time = time; - theMissionFuel.back().Range = distance; - theMissionFuel.back().Altitude = P.Altitude; - theMissionFuel.back().TAS = P.TAS; - theMissionFuel.back().Mach = P.Mach; - theMissionFuel.back().Mass = acMass; - theMissionFuel.back().consumedFuel = missionFuel.back(); - theMissionFuel.back().Thrust = theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_cruise); // TODO(hansmann): Take operating state into account - theMissionFuel.back().fuelFlow = theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_cruise); - theMissionFuel.back().ROC = maxROC; // this is obviously wrong. Should be fixed when parts are merged with missionAnalysis - } - i++; - } - return accumulate(missionFuel.begin(), missionFuel.end(), 0.0); -} - -double fuelPlanning::calcAlternateFuel(double acMass, aerodynamics theAERO) { - /* Alternate Fuel */ - double Fuel(0.0); - double alternateAlt = convertUnit(FOOT, METER, 27000.); - double alternateMach = 0.95 * theAcftPt->MInitialCruise; - double tempAlternateRange = theAcftPt->myMission.alternateRange - 1. * alternateAlt / tan(convertUnit(DEGREE, RADIAN, 5.)); - /* Climb */ - double tempTime(0.); - double climbFuel(0.); - double climbDistance(0.); - // 0 ft up to 1,500 ft in Climb configuration with v2 + 10 kts - double climbTAS = theAcftPt->v2(acMass, convertUnit(FOOT, METER, 750.)) + convertUnit(KNOTS, METERPERSECOND, 10.); - myFlightSim.getClimbFuel(acMass, 0.0, convertUnit(FOOT, METER, 1500.), - climbTAS / theAcftPt->atm.getSpeedOfSound(0.), climbTAS / theAcftPt->atm.getSpeedOfSound(convertUnit(FOOT, METER, 1500.)), - "climb", "takeoff", 0.0, 0.0, theAERO, - &climbFuel, &climbDistance, &tempTime); - Fuel += climbFuel; - acMass -= climbFuel; - tempAlternateRange -= climbDistance; - // Acceleration from v2+10kt to 250 kt - tempTime = 0.; - climbFuel = 0.; - climbDistance = 0.; - myFlightSim.getAccelerateFuel(acMass, convertUnit(FOOT, METER, 1500.), - climbTAS / theAcftPt->atm.getSpeedOfSound(convertUnit(FOOT, METER, 1500.)), - convertUnit(KNOTS, METERPERSECOND, 250.) / theAcftPt->atm.getSpeedOfSound(convertUnit(FOOT, METER, 1500.)), - "clean", "takeoff", 0.0, 0.0, theAERO, - &climbFuel, &climbDistance, &tempTime); - Fuel += climbFuel; - acMass -= climbFuel; - tempAlternateRange -= climbDistance; - // Climb from 1500 ft up to 10000 ft with 250 kt - tempTime = 0.; - climbFuel = 0.; - climbDistance = 0.; - climbTAS = convertUnit(KNOTS, METERPERSECOND, 250); - myFlightSim.getClimbFuel(acMass, convertUnit(FOOT, METER, 1500.), convertUnit(FOOT, METER, 10000.), - climbTAS / theAcftPt->atm.getSpeedOfSound(convertUnit(FOOT, METER, 1500.)), climbTAS / theAcftPt->atm.getSpeedOfSound(convertUnit(FOOT, METER, 10000.)), - "clean", "maximum_continuous", 0.0, 0.0, theAERO, - &climbFuel, &climbDistance, &tempTime); - Fuel += climbFuel; - acMass -= climbFuel; - tempAlternateRange -= climbDistance; - // accelerating to 300 kt - tempTime = 0.; - climbFuel = 0.; - climbDistance = 0.; - myFlightSim.getAccelerateFuel(acMass, convertUnit(FOOT, METER, 10000.), - climbTAS / theAcftPt->atm.getSpeedOfSound(convertUnit(FOOT, METER, 10000.)), - convertUnit(KNOTS, METERPERSECOND, 300) / theAcftPt->atm.getSpeedOfSound(convertUnit(FOOT, METER, 10000.)), - "clean", "maximum_continuous", 0.0, 0.0, theAERO, - &climbFuel, &climbDistance, &tempTime); - Fuel += climbFuel; - acMass -= climbFuel; - tempAlternateRange -= climbDistance; - // Climb to alternative altitude with 300 kt - tempTime = 0.; - climbFuel = 0.; - climbDistance = 0.; - climbTAS = 300. * (1.852 / 3.6); - myFlightSim.getClimbFuel(acMass, 10000.*0.3048, alternateAlt, - climbTAS / theAcftPt->atm.getSpeedOfSound(10000.*0.3048), climbTAS / theAcftPt->atm.getSpeedOfSound(alternateAlt), - "clean", "climb", 0.0, 0.0, theAERO, - &climbFuel, &climbDistance, &tempTime); - Fuel += climbFuel; - acMass -= climbFuel; - tempAlternateRange -= climbDistance; - // Acceleration to alternative Mach - if (alternateMach > climbTAS / theAcftPt->atm.getSpeedOfSound(alternateAlt)) { - tempTime = 0.; - climbFuel = 0.; - climbDistance = 0.; - myFlightSim.getAccelerateFuel(acMass, alternateAlt, - climbTAS / theAcftPt->atm.getSpeedOfSound(10000.*0.3048), - alternateMach, - "clean", "maximum_continuous", 0.0, 0.0, theAERO, - &climbFuel, &climbDistance, &tempTime); - Fuel += climbFuel; - acMass -= climbFuel; - tempAlternateRange -= climbDistance; - } - if (tempAlternateRange < 0.) { - tempAlternateRange = 50.; - } - /* Alternate Cruise */ - tempTime = 0.; - climbFuel = 0.; - climbDistance = 0.; - myFlightSim.getCruiseFuel(acMass, alternateAlt, alternateMach, "clean", "maximum_continuous", 0.0, 0.0, theAERO, - &climbFuel, tempAlternateRange, &tempTime); - Fuel += climbFuel; - return Fuel; -} - -double fuelPlanning::calcFinalReserveFuel(double acMass, aerodynamics theAERO) { - // Determination of Final Reserves: 30min @ 1,500ft - // SARPerformance SAR(*theAcftPt); - // Determining the most effective speed via SAR - double holdingM(0.); - double holding_altitude = convertUnit(FOOT, METER, 1500.); - double holdingSpeed = 1.05 * theAcftPt->v1gS_Clean(acMass, holding_altitude); - holdingM = calcBestSARSpeed(holding_altitude, acMass, holdingSpeed, convertUnit(KNOTS, METERPERSECOND, 250.)); - double holdingDrag = theAERO.getCruiseDrag(holdingM, holding_altitude, 0., acMass, "clean", theAcftPt->atm); - theAcftPt->myEngines.calculate_N1_with_thrustlimit(theAcftPt->myEnergyProviders.energyCarrierID_cruise, holding_altitude, holdingM, theAcftPt->atm, 1., - "maximum_continuous", 0.0, 0.0, holdingDrag); - double LoverD = (G_FORCE * acMass) / holdingDrag; - double SFC = theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_cruise) - / theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_cruise); - return acMass * (expm1(convertUnit(MINUTE, SECOND, 30.) * G_FORCE * SFC * 1. / LoverD)); // return calcBreguet(acMass, 30.*60., SFC, LoverD); -} - -double fuelPlanning::calcBestSARSpeed(double alt, double mass, double lowerSpeed, double upperSpeed) { - low::SARPerformance SAR(theAcftPt); // TODO(Hansmann): Reconsider hardcoding namespace / fidelity level - double tempSAR(0.); - double tempMach(lowerSpeed / theAcftPt->atm.getSpeedOfSound(alt)); - while (lowerSpeed < upperSpeed) { - if (tempSAR <= SAR.calculateSAR(mass, alt, lowerSpeed / theAcftPt->atm.getSpeedOfSound(alt), "climb", "clean")) { - tempMach = lowerSpeed / theAcftPt->atm.getSpeedOfSound(convertUnit(FOOT, METER, 1500.)); - } - lowerSpeed += 0.5; - } - return tempMach; -} - -double fuelPlanning::calcBreguet(double W0, double Time, double theSFC, double theLoD) { - return W0 * (1. - 1. / exp(Time * G_FORCE * theSFC * 1. / theLoD)); -} - -//double fuelPlanning::calcRangeForMass(double Range0, double Range1, double Mass0, double Mass1, double targetMass) { -// double m(0.); -// double a(0.); -// m = (Mass0 - Mass1) / (Range0 - Range1); -// a = Mass0 - m * Range0; -// return (targetMass - a) / m; -//} - -void fuelPlanning::setP(int ID) { - P.Mach = theAcftPt->myMission.Steps.at(ID).Point.Mach; - P.Altitude = theAcftPt->myMission.Steps.at(ID).Point.Altitude; - P.TAS = theAcftPt->myMission.Steps.at(ID).Point.TAS; - P.ROC = theAcftPt->myMission.Steps.at(ID).Point.ROC; - P.derate = theAcftPt->myMission.Steps.at(ID).derating; - P.bleedOff = theAcftPt->myMission.Steps.at(ID).Point.bleedOffTakes; - P.shaftOff = theAcftPt->myMission.Steps.at(ID).Point.shaftOffTakes; - P.config = theAcftPt->myMission.Steps.at(ID).configuration; - P.rating = theAcftPt->myMission.Steps.at(ID).rating; -} - -//void fuelPlanning::exitROC(int ID, pointData theP, double massAircraft, aerodynamics theAERO) { -// theAcftPt->myEngine.setEngineRating(theP.Altitude, theP.Mach, theAcftPt->atm, theP.derate, theP.rating, theP.bleedOff, theP.shaftOff); -// double maxROC = theAcftPt->ROC(massAircraft, theP.Altitude, theP.Mach, 0.0, -// theP.config, theP.rating, theP.bleedOff, theP.shaftOff, false, theAERO); -// myRuntimeInfo->err << "Error in fuel estimation!" << std::endl; -// myRuntimeInfo->err << "Thrust does not allow the required ROC!" << std::endl; -// myRuntimeInfo->err << "mission segment: " << ID << std::endl; -// myRuntimeInfo->err << "Mission mode: " << theAcftPt->myMission.Steps.at(ID).modeStep << std::endl; -// myRuntimeInfo->err << "max. ROC: " << maxROC << " ft/min" << std::endl; -// myRuntimeInfo->err << "required ROC: " << theP.ROC << " ft/min" << std::endl; -// myRuntimeInfo->err << "flight altitude: " << theP.Altitude / 0.3048 << " ft" << std::endl; -// myRuntimeInfo->err << "Mach number: " << theP.Mach << "" << std::endl; -// myRuntimeInfo->err << "Engine-Rating: " << theP.rating << std::endl; -// exit(1); -//} - -void low::fuelPlanning::exitAcceleration(int ID, pointData theP, double massAircraft) { - double Drag = theAcftPt->aero.getCruiseDrag(theP.Mach, theP.Altitude, 0., massAircraft, theP.config, theAcftPt->atm); - theAcftPt->myEngines.calculate_N1_with_thrustlimit(theAcftPt->myEnergyProviders.energyCarrierID_cruise, theP.Altitude, theP.Mach, theAcftPt->atm, theP.derate, theP.rating, theP.bleedOff, theP.shaftOff, Drag); - myRuntimeInfo->err << "Error in fuel estimation!" << std::endl; - myRuntimeInfo->err << "Thrust does not allow acceleration!" << std::endl; - myRuntimeInfo->err << "mission segment: " << ID << std::endl; - myRuntimeInfo->err << "Mission mode: " << theAcftPt->myMission.Steps.at(ID).modeStep << std::endl; - myRuntimeInfo->err << "available thrust: " << theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_cruise) << " N" << std::endl; - myRuntimeInfo->err << "drag: " << Drag << " N" << std::endl; - myRuntimeInfo->err << "flight altitude: " << theP.Altitude << " m" << std::endl; - myRuntimeInfo->err << "Mach number: " << theP.Mach << "" << std::endl; - myRuntimeInfo->err << "Engine-Rating: " << theP.rating << std::endl; - exit(1); -} - -void low::fuelPlanning::exitSteadyLevelFlight(int ID, pointData theP, double theDrag) { - myRuntimeInfo->err << "Error in fuel estimation!" << std::endl; - myRuntimeInfo->err << "Thrust does not allow Steady Level Flight!" << std::endl; - myRuntimeInfo->err << "Mission segment: " << ID << std::endl; - myRuntimeInfo->err << "Mission mode: " << theAcftPt->myMission.Steps.at(ID).modeStep << std::endl; - myRuntimeInfo->err << "available thrust: " << theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_cruise) << " N" << std::endl; - myRuntimeInfo->err << "drag: " << theDrag << " N" << std::endl; - myRuntimeInfo->err << "flight altitude: " << theP.Altitude << " m" << std::endl; - myRuntimeInfo->err << "Mach number: " << theP.Mach << "" << std::endl; - myRuntimeInfo->err << "Engine-Rating: " << theP.rating << std::endl; - exit(1); -} - -double low::fuelPlanning::fastFuelEstimate(aerodynamics theAERO) { - double Time = theAcftPt->myMission.missionRange / (theAcftPt->myMission.crMach * theAcftPt->atm.getSpeedOfSoundISA(10000.)); - double acMass = theAcftPt->MTOM; - double theLoverD = theAERO.getCruiseLoverD(theAcftPt->myMission.crMach, 10000., 0.0, acMass, "clean", theAcftPt->atm); - double theDrag = theAERO.getCruiseDrag(theAcftPt->myMission.crMach, 10000., 0.0, acMass, "clean", theAcftPt->atm); - theAcftPt->myEngines.calculate_N1_with_thrustlimit(theAcftPt->myEnergyProviders.energyCarrierID_cruise, 10000., theAcftPt->myMission.crMach, theAcftPt->atm, 1.0, - "maximum_continuous", 0., 0., theDrag); - double theSFC = theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_cruise) - / theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_cruise); - return this->calcBreguet(theAcftPt->MTOM, Time, theSFC, theLoverD); -} - -} // namespace low diff --git a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.h b/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.h deleted file mode 100644 index 6fe9ea9c..00000000 --- a/performance_assessment/src/taw/defaultMethods/fuelPlanning/low_fidelity/fuelPlanning.h +++ /dev/null @@ -1,227 +0,0 @@ -/* - * UNICADO - UNIversity Conceptual Aircraft Design and Optimization - * - * Copyright (C) 2025 UNICADO consortium - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - * - * Description: - * This file is part of UNICADO. - */ -#ifndef PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_LOW_FIDELITY_FUELPLANNING_H_ -#define PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_LOW_FIDELITY_FUELPLANNING_H_ - -#include <moduleBasics/module.h> -#include <unitConversion/unitConversion.h> -#include <standardFiles/functions.h> - -#include <memory> -#include <vector> -#include <string> -#ifdef _WIN32 - #include <windows.h> -#endif // _WIN32 -#include <numeric> - -#include "../abstractFuelPlanning.h" -#include "../../SARPerformance/abstractSARPerformance.h" - -#include "../../performance_assessment_settings.h" -#include "../../aircraft.h" -#include "flightSimulator.h" -#include "fuelFromMassFraction.h" - -#include "../../SARPerformance/low_fidelity/SARPerformance.h" // <-- questionable - -namespace low { - -class fuelPlanning : public ::abstractFuelPlanning { - public: - - /**\brief Method for the fuel planning - * - */ - void doFuelPlanning() override; - - /**\brief Constructor fuelPlanning - *\param theAircraft Address to the aircraft object - *\param rtIO pointer to the runtimeIO object - */ - fuelPlanning(std::shared_ptr<aircraft> anAcftPtr, const std::shared_ptr<performance_assessment_settings> aSettingsPt, const std::shared_ptr<RuntimeIO>& rtIO); - - /**\brief Destructor fuelPlanning - * - */ - virtual ~fuelPlanning() { } - - /**\brief Calculates the data for the payload range diagram - * - */ - void doPayloadRangeOLD() override; // PayloadRange-Calculation if FuelPlanning on; otherwise see payloadRange class - - /**\brief Creates plot for maximum payload - * - */ - void doFuelPayloadRangeOLD() override; // writes fuelPayloadRange.csv for Plot - - /**\brief Reads the payload-range data from the AcftXML - * - */ - void payloadRangeFromAcftXML() override; - - private: - const std::shared_ptr<RuntimeIO>& rtIO; - std::shared_ptr<aircraft> theAcftPt; /**< Pointer to aircraft object */ - const std::shared_ptr<performance_assessment_settings> theSettingsPt; /**< Pointer to the performance_assessment_settings object */ - flightSimulator myFlightSim; /**< flightSimulator object */ - fuelFromMassFraction myBreguet; /**< fuelFromMassFraction object */ - double relConFuel; /**< Relative amount of contingency fuel in reference to the total trip fuel (-) */ - - /**\class pointData Class containing data for the various mission points - * - */ - class pointData { - public: - double Mach; /**< Mach number (-) */ - double Altitude; /**< Aircraft altitude (m) */ - double TAS; /**< True air speed (m/s) */ - double ROC; /**< Aircraft rate of climb (m/s) */ - double derate; /**< Artificial constant to reduce the engine spool speed (between 0 and 1) */ - double bleedOff; /**< Current bleed air offtake (kg/s) */ - double shaftOff; /**< Current shaft power offtake (W) */ - - string config; /**< Flap configuration of the aircraft */ - string rating; /**< Engine rating (Take-Off, MaxCont, Climb, Idle, Cruise) */ - - pointData() - : - config(""), - rating("") { - Mach = 0.0; - Altitude = 0.0; - TAS = 0.0; - ROC = 0.0; - derate = 0.0; - bleedOff = 0.0; - shaftOff = 0.0; - } - }; - pointData P; - - /**\brief Method to calculate the standard fuel planned for the flight - *\param theTaxiFuelTakeoff Taxiing fuel at takeoff (kg) - *\param theTaxiFuelLanding Taxiing fuel at landing (kg) - *\param theMissionFuel Mission fuel (kg) - *\param theContigencyFuel Contigency fuel (kg) - *\param theAlternateFuel Alternate fuel (kg) - *\param theFinalReserveFuel Final reserve fuel (kg) - *\param theTripFuel Trip fuel (kg) - *\param theRange Aircraft range (m) - *\param thePayload Aircraft payload (kg) - *\param writingMissionData Switch if the fuel mission data shall be written - *\param myAERO Object of the aerodynamics class - */ - void calcStandardFuelPlanning(double *theTaxiFuelTakeoff, double *theTaxiFuelLanding, double *theMissionFuel, double *theContigencyFuel, - double *theAlternateFuel, double *theFinalReserveFuel, double *theTripFuel, - double theRange, double thePayload, bool writingMissionData, - const aerodynamics &myAERO); - - /**\brief Function to calculate the block fuel - *\param acMass Aircraft mass (kg) - *\param Range Aircraft range (m) - *\param writeMission Switch if the fuel mission data shall be written) - *\param theAERO Object of the aerodynamics class - *\return Block fuel (kg) - */ - double calcMissionFuel(double acMass, double Range, bool writeMission, aerodynamics theAERO); - - /**\brief Function to calculate the alternate fuel - *\param acMass Aircraft mass (kg) - *\param theAERO Object of the aerodynamics class - *\return Alternate fuel (kg) - */ - double calcAlternateFuel(double acMass, aerodynamics theAERO); - - /**\brief Function to calculate the final reserve fuel - *\param acMass Aircraft mass (kg) - *\param theAERO Object of the aerodynamics class - *\return Final reserve fuel (kg) - */ - double calcFinalReserveFuel(double acMass, aerodynamics theAERO); - - /**\brief Method to calculate the trip fuel - *\param WO Take-Off mass (kg) - *\param Time Cruise duration at 10000 ft (s) - *\param theSFC Specific fuel consumption (kg/N*s) - *\param theLoD glide ratio - *\return Fuel mass (kg) - */ - double calcBreguet(double W0, double Time, double theSFC, double theLoD); - - /**\brief Function to calculate the speed for the highest specific air range (SAR) - *\param alt Aircraft altitude (m) - *\param mass Aircraft mass (kg) - *\param lowerSpeed Lowest aircraft speed (m/s) - *\param upperSpeed Highest aircraft speed (m/s) - *\return Mach number (-) - */ - double calcBestSARSpeed(double alt, double mass, double lowerSpeed, double upperSpeed); - -// /**\brief Function calculates the remaining range to reach a target mass -// *\param Range0 First range value (m) -// *\param Range1 Second range value (m) -// *\param Mass0 First mass value (kg) -// *\param Mass1 Second mass value (kg) -// *\param targetMass Target mass (kg) -// *\return Remaining range (m) -// */ -// double calcRangeForMass(double Range0, double Range1, double Mass0, double Mass1, double targetMass); - - /**\brief Function sets a mission point - *\param ID Mission segment - */ - void setP(int ID); - -// /**\brief Function checks if the thrust allows the required ROC -// *\param ID Mission segment -// *\param theP Object of the pointData class -// *\param massAircraft Aircraft mass (kg) -// *\param theAERO Object of the aerodynamics class -// */ -// void exitROC(int ID, pointData theP, double massAircraft, aerodynamics theAERO); - - /**\brief Function checks if the thrust allows the required acceleration - *\param ID Mission segment - *\param theP Object of the pointData class - *\param massAircraft Aircraft mass (kg) - */ - void exitAcceleration(int ID, pointData theP, double massAircraft); - - /**\brief Function checks if the thrust allows a steady level flight - *\param ID Mission segment - *\param theP Object of the pointData class - *\param theDrag Drag (N) - */ - void exitSteadyLevelFlight(int ID, pointData theP, double theDrag); - - /**\brief Function estimates the quantity of fuel - *\param theAERO Object of the aerodynamics class - *\return Fuel mass (kg) - */ - double fastFuelEstimate(aerodynamics theAERO); - -}; - -} // namespace low -#endif // PERFORMANCE_ASSESSMENT_SRC_TAW_DEFAULTMETHODS_FUELPLANNING_LOW_FIDELITY_FUELPLANNING_H_ diff --git a/performance_assessment/src/taw/defaultMethods/missionDefinition.cpp b/performance_assessment/src/taw/defaultMethods/missionDefinition.cpp index 29578d65..35f13f42 100644 --- a/performance_assessment/src/taw/defaultMethods/missionDefinition.cpp +++ b/performance_assessment/src/taw/defaultMethods/missionDefinition.cpp @@ -55,7 +55,7 @@ missionDefinition::missionDefinition(const std::string &fileNameAndDir, double d } missionDefinition::~missionDefinition() { - //dtor + // dtor } void missionDefinition::readMission() { @@ -131,7 +131,6 @@ void missionDefinition::getMissionSegment(std::string XML) { exit(1); } Steps.back().endCAS = Steps.at(Steps.size() - 2).endCAS; - //Steps.back().endROC = missionXML.at(XML + "/ROC"); } else if (Steps.back().modeStep == "accelerate") { if (Steps.back().endCAS <= 0.0) { myRuntimeInfo->err << "flight phase: " << Steps.back().missionPhase << " | Step: " << Steps.back().modeStep << endl; @@ -184,7 +183,6 @@ void missionDefinition::getMissionSegment(std::string XML) { Steps.back().endTAS = convertUnit(MACH, TRUEAIRSPEED, Steps.back().endAltitude, myISA, Steps.back().endMach); Steps.back().endCAS = convertUnit(MACH, CALIBRATEDAIRSPEED, Steps.back().endAltitude, myISA, Steps.back().endMach); cruiseAlt.push_back(Steps.back().endAltitude); - //Steps.back().endROC = missionXML.at(XML + "/ROC"); } else if (Steps.back().modeStep == "change_speed_to_Mach") { if (Steps.back().endMach <= 0.0) { myRuntimeInfo->err << "flight phase: " << Steps.back().missionPhase << " | Step: " << Steps.back().modeStep << endl; diff --git a/performance_assessment/src/taw/defaultMethods/missionDefinition.h b/performance_assessment/src/taw/defaultMethods/missionDefinition.h index 7a772ff7..c29b34d4 100644 --- a/performance_assessment/src/taw/defaultMethods/missionDefinition.h +++ b/performance_assessment/src/taw/defaultMethods/missionDefinition.h @@ -107,9 +107,9 @@ class missionDefinition { averageMissionPoint Point; std::string missionPhase; /**< Phase during the mission (Departure, Cruise, Approach)*/ - std::string modeStep; /**< Mode of the segments in mission.xml */ //(Takeoff, Climb, Accelerate, ChangeSpeed_to_CAS, Climb_to_cruise, - //ChangeSpeed_to_M, Cruise, ChangeFLconstROC, Descend_to_approach, - //ChangeSpeed, Descend, LevelGSInterception, Landing) + std::string modeStep; /**< Mode of the segments in mission.xml */ // (Takeoff, Climb, Accelerate, ChangeSpeed_to_CAS, Climb_to_cruise, + // ChangeSpeed_to_M, Cruise, ChangeFLconstROC, Descend_to_approach, + // ChangeSpeed, Descend, LevelGSInterception, Landing) std::string rating; /**< Engine rating (TO, MaxCont, Climb, Idle, Cruise)*/ double derating; /**< Engine derate (-)*/ diff --git a/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/abstractOptimizeMissionProfile.h b/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/abstractOptimizeMissionProfile.h deleted file mode 100644 index 8e6a75a7..00000000 --- a/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/abstractOptimizeMissionProfile.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * UNICADO - UNIversity Conceptual Aircraft Design and Optimization - * - * Copyright (C) 2025 UNICADO consortium - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - * - * Description: - * This file is part of UNICADO. - */ -#ifndef performance_assessment_SRC_TAW_DEFAULTMETHODS_OPTIMIZEMISSIONPROFILE_ABSTRACTOPTIMIZEMISSIONPROFILE_H_ -#define performance_assessment_SRC_TAW_DEFAULTMETHODS_OPTIMIZEMISSIONPROFILE_ABSTRACTOPTIMIZEMISSIONPROFILE_H_ - -#include <memory> -#include <string> - -#include "../performance_assessment_settings.h" -#include "../fuelPlanning/abstractFuelPlanning.h" - -class abstractFuelplanning; - -class abstractOptimizeMissionProfile { - public: - virtual ~abstractOptimizeMissionProfile() { } - virtual void doOptimizeMission(std::shared_ptr<abstractFuelPlanning>& myFuelPlanning, const std::shared_ptr<RuntimeIO>& rtIO, bool sizingForMTOM) = 0; -}; - - -#endif // performance_assessment_SRC_TAW_DEFAULTMETHODS_OPTIMIZEMISSIONPROFILE_ABSTRACTOPTIMIZEMISSIONPROFILE_H_ diff --git a/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.cpp b/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.cpp deleted file mode 100644 index 395b61b7..00000000 --- a/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * UNICADO - UNIversity Conceptual Aircraft Design and Optimization - * - * Copyright (C) 2025 UNICADO consortium - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - * - * Description: - * This file is part of UNICADO. - */ -#include "optimizeMissionProfile.h" - -using std::string; - -namespace low { - -optimizeMissionProfile::optimizeMissionProfile(aircraft *theAircraft) - : - theAcftPt(theAircraft) { - // ctor -} -optimizeMissionProfile::~optimizeMissionProfile() { - // dtor -} - -void low::optimizeMissionProfile::doOptimizeMission(std::shared_ptr<abstractFuelPlanning>& myFuelPlanning, const std::shared_ptr<RuntimeIO>& rtIO, bool sizingForMTOM) { - double maxAltitudeForRange = 0.5 * (theAcftPt->designRange - 150.) * 1000. * tan(convertUnit(DEGREE, RADIAN, 2.5)) / 0.3048 / 100.; - if (theAcftPt->hMaxOperating / 100. < maxAltitudeForRange) { - maxAltitudeForRange = theAcftPt->hMaxOperating / 100.; - } - for (unsigned int i(0); i <= theAcftPt->myMission.Steps.size() - 1; i++) { - if (theAcftPt->myMission.Steps.at(i).modeStep == "cruise") { - cruiseSteps.push_back(theCruiseSteps()); - cruiseSteps.back().ID = i + 1; - cruiseSteps.back().oldFL = theAcftPt->myMission.Steps.at(i).endFL; - cruiseSteps.back().Mach = theAcftPt->myMission.Steps.at(i).endMach; - cruiseSteps.back().grossMass = 0.5 * (myFuelPlanning->theMissionFuel.at(i).Mass - + myFuelPlanning->theMissionFuel.at(i + 1).Mass); - /* Calculation of the optimized flight altitude */ - cruiseSteps.back().newFL = getNewFlightLevel(G_FORCE * cruiseSteps.back().grossMass, cruiseSteps.back().Mach); - if (cruiseSteps.back().newFL > maxAltitudeForRange) { - cruiseSteps.back().newFL = static_cast<int>(floor(maxAltitudeForRange)); - } - /* Write in mission block of AC-XML file */ - std::stringstream tempID; - tempID.str(""); - tempID << int(cruiseSteps.size()); - // TODO(franz#1#): neue xml-Klasse (mit pointer) verwenden; VORSICHT: gleiches Ergebnis? - if (sizingForMTOM == true) { - rtIO->acxml.at("AcftExchangeFile/Performance/MissionAnalysis/DesignMission/CruiseSteps") = static_cast<int>(cruiseSteps.size()); - rtIO->acxml.at("AcftExchangeFile/Performance/MissionAnalysis/DesignMission/CruiseStep@" + tempID.str() + "/FlightLevel") = cruiseSteps.back().newFL; - } else { - rtIO->acxml.at("AcftExchangeFile/Performance/MissionAnalysis/StudyMission/CruiseSteps") = static_cast<int>(cruiseSteps.size()); - rtIO->acxml.at("AcftExchangeFile/Performance/MissionAnalysis/StudyMission/CruiseStep@" + tempID.str() + "/FlightLevel") = cruiseSteps.back().newFL; - } - } - } -} - -double optimizeMissionProfile::getNewFlightLevel(double theLift, double theMach) { - double deltaStep = 100.; - //double nrSteps = floor( (theAcftPt->hMaxOperating - theAcftPt->hInitialCruise)/deltaStep ); - double targetFL(theAcftPt->hInitialCruise / 100.); - double SAR = 0.; - for (double i = theAcftPt->hInitialCruise; i <= theAcftPt->hMaxOperating; i = i + deltaStep) { - double theDrag = theAcftPt->aero.getCruiseDrag(theMach, i * 0.3048, 0., theLift / G_FORCE, "clean", theAcftPt->atm); - theAcftPt->myEngines.calculate_N1_with_thrustlimit(theAcftPt->myEnergyProviders.energyCarrierID_cruise, i * 0.3048, theMach, theAcftPt->atm, 1., "maximum_continuous", - theAcftPt->myMission.bleedOffCr, theAcftPt->myMission.shaftOffCr, theDrag); - if (theAcftPt->myEngines.get_thrust_aircraft(theAcftPt->myEnergyProviders.energyCarrierID_cruise) < 0.99999 * theDrag) { - break; - } - double tempROC = theAcftPt->ROC(theLift / G_FORCE, i * 0.3048, theMach, 1.0, "clean", "maximum_continuous", - theAcftPt->myMission.bleedOffCr, theAcftPt->myMission.shaftOffCr, - false, theAcftPt->aero) * (60. / 0.3048); - if (tempROC < 300.) { - break; - } - double tempFF = theAcftPt->myEngines.get_aircraft_fuelflow(theAcftPt->myEnergyProviders.energyCarrierID_cruise); - double tempTAS = theMach * theAcftPt->atm.getSpeedOfSoundISA(i * 0.3048); - double tempSAR = tempTAS / tempFF; - if (i <= theAcftPt->hInitialCruise) { - SAR = tempTAS / tempFF; - targetFL = Rounding(i / 100., 0.); - } else if (SAR < tempSAR) { - SAR = tempTAS / tempFF; - targetFL = Rounding(i / 100., 0.); - } - } - return targetFL; -} -} // namespace low \ No newline at end of file diff --git a/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.h b/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.h deleted file mode 100644 index 25b02671..00000000 --- a/performance_assessment/src/taw/defaultMethods/optimizeMissionProfile/low_fidelity/optimizeMissionProfile.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * UNICADO - UNIversity Conceptual Aircraft Design and Optimization - * - * Copyright (C) 2025 UNICADO consortium - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. - * - * Description: - * This file is part of UNICADO. - */ -#ifndef performance_assessment_SRC_TAW_DEFAULTMETHODS_OPTIMIZEMISSIONPROFILE_LOW_FIDELITY_OPTIMIZEMISSIONPROFILE_H_ -#define performance_assessment_SRC_TAW_DEFAULTMETHODS_OPTIMIZEMISSIONPROFILE_LOW_FIDELITY_OPTIMIZEMISSIONPROFILE_H_ - -// #include <standardFiles/functions.h> -// #include <aixml/node.h> - -#include <vector> -#include <string> -#include <memory> - -#include "../../aircraft.h" -#include "../../fuelPlanning/abstractFuelPlanning.h" -#include "../abstractOptimizeMissionProfile.h" - -// class aircraft; -// class fuelPlanning; - -using std::vector; -using std::string; - -namespace low { - -/**\brief optimizeMissionProfile Global class containing the initial and the optimized mission -* -*/ -class optimizeMissionProfile : public abstractOptimizeMissionProfile { - public: - /**\brief Constructor optimizeMissionProfile - *\param theAircraft Address to the aircraft object - */ - explicit optimizeMissionProfile(aircraft *theAircraft); - - /**\class theCruiseSteps Class containing flight data for each mission segment - * - */ - class theCruiseSteps { - public: - int ID; /**< Mission segment ID */ - double grossMass; /**< Aircraft mass (kg) */ - double oldFL; /**< Previous flight level (-) */ - double newFL; /**< Optimized flight level for the i flight segment (-) */ - double Mach; /**< Mach number (-) */ - - theCruiseSteps() { - ID = 0; - grossMass = 0.; - oldFL = 0.; - newFL = 0.; - Mach = 0.; - } - }; - vector<theCruiseSteps> cruiseSteps; /**< List of the cruise steps */ - - /**\brief Calculation of the optimized flight data - *\param myFuelPlanning object of the fuelPlanning class - *\param ioFile Aircraft file name - *\param sizingForMTOM Switch if Design or Study mission shall be changed - */ - void doOptimizeMission(std::shared_ptr<abstractFuelPlanning>& myFuelPlanning, const std::shared_ptr<RuntimeIO>& rtIO, bool sizingForMTOM) override; - - /**\brief Destructor optimizeMissionProfile - * - */ - virtual ~optimizeMissionProfile(); - - private: - aircraft *theAcftPt; /**< Pointer to the aircraft object */ - - /**\brief Function to calculate the optimized flight level - *\param theLift Lift at the mission segment (N) - *\param theMach Mach number at the mission segment (-) - *\return The optimized flight level (-) - */ - double getNewFlightLevel(double theLift, double theMach); -}; -} // namespace low - -#endif // performance_assessment_SRC_TAW_DEFAULTMETHODS_OPTIMIZEMISSIONPROFILE_LOW_FIDELITY_OPTIMIZEMISSIONPROFILE_H_ - diff --git a/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp b/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp index 6b301f50..7be9530e 100644 --- a/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp +++ b/performance_assessment/src/taw/defaultMethods/payloadRange/low_fidelity/payloadRange.cpp @@ -21,8 +21,6 @@ */ #include "payloadRange.h" -using std::endl; - namespace low { payloadRange::payloadRange(aircraft *theAircraft, const performance_assessment_settings &theSettings) @@ -36,11 +34,10 @@ payloadRange::~payloadRange() { } void payloadRange::calcPayloadRange() { - // Determine Payload Range via Breguet with Mass Fractions (s. FZB1, Uebung1, WS20122013, eq. 13) // Determine Breguet Factors = (V*L/D)/g*SFC double breguetFactor(0.); double cruiseHeight(0.); - // Average of Cruise Altitude for Breguet as Sum of Step Altitudes Weighted with Segment Length + // Average of cruise altitude for Breguet as sum of step altitudes weighted with segment length for (unsigned int i(0); i < theAcftPt->myMission.cruiseSegLength.size(); i++) { if (i == 0) cruiseHeight = theAcftPt->myMission.cruiseSegLength.at(i) * theAcftPt->myMission.cruiseAlt.at(i); @@ -65,27 +62,23 @@ void payloadRange::calcPayloadRange() { TOM.push_back(theAcftPt->MTOM); Range.push_back(0.); /* Determination of the design point according to Breguet and deviation from the given (real) design range */ - // TODO(franz#1#): Mass fractions aus Requirement-Mission bestimmen double designRangeBreguet = -breguetFactor * log((theAcftPt->OME + theAcftPt->designPayload) / (0.9065 * theAcftPt->MTOM)); // TODO(Hansman): Fuel consumed during takeoff // and climb shall not be hardcoded double calibrateFactor = theAcftPt->designRange / designRangeBreguet; - myRuntimeInfo->out << "calibrateFactor Breguet: " << calibrateFactor << endl; + myRuntimeInfo->out << "calibrateFactor Breguet: " << calibrateFactor << std::endl; /* Determination of the 2nd point */ Fuel.push_back(theAcftPt->MFM); Payload.push_back(theAcftPt->MTOM - theAcftPt->OME - Fuel.back()); TOM.push_back(theAcftPt->MTOM); Range.push_back((-breguetFactor * log((theAcftPt->OME + Payload.back()) / (0.9065 * TOM.back())))*calibrateFactor); -// TODO(franz#1#): Testen ob calibrateFactor Ergebnisse verbessert (bei A320 eher Verschlechterung) - // Range.push_back(breguetFactor * log(1./(1.- myPayloadRange.back().Fuel/myPayloadRange.back().TOM))));//simply Breguet, without Mass-Fractions if (Range.at(2) > theAcftPt->designRange) { /* Determination of range of 1st point, from extrapolation between design point and 2nd point */ Range.at(1) = theAcftPt->designRange + (Range.at(2) - theAcftPt->designRange) / (Payload.at(2) - theAcftPt->designPayload) * (Payload.at(1) - theAcftPt->designPayload); } else { - myRuntimeInfo->out << "ERROR: Range_maxFuelatMTOM smaller DesignRange! " << endl; + myRuntimeInfo->out << "ERROR: Range_maxFuelatMTOM smaller DesignRange! " << std::endl; Range.at(1) = 0.; // not extrapolatable -// TODO(franz#1#): ggf. besser: Punkte mit Missionsanalyse abfliegen } /* 3. point: no payload and maximum refuelled */ if (theAcftPt->OME + theAcftPt->MFM < theAcftPt->MTOM) { @@ -97,8 +90,7 @@ void payloadRange::calcPayloadRange() { Range.push_back(-breguetFactor * log((theAcftPt->OME + Payload.back()) / (0.9065 * TOM.back()))); } else { Range.push_back((-breguetFactor * log((theAcftPt->OME + Payload.back()) / (0.9065 * TOM.back())))*calibrateFactor); - myRuntimeInfo->warn << "Range_maxFuelEmpty smaller Range_maxFuelatMTOM. Range_maxFuelEmpty will also be calibrated!" << endl; -// TODO(franz#1#): WICHTIG: PayloadRange Kalibrierung work-around Loesung; evtl. besser + myRuntimeInfo->warn << "Range_maxFuelEmpty smaller Range_maxFuelatMTOM. Range_maxFuelEmpty will also be calibrated!" << std::endl; } } else { // 3. point = 2. point diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp index 668aa98f..8829b0b8 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp @@ -56,26 +56,7 @@ void performance_assessment_factory::initialize() { .read(rtIO->moduleConfig).value(); /* Initialization of performance_assessment objects */ - /* Fuel Planning */ - if (fidelityLevelFuelPlanning == "high") { // high fidelity fuel Planning - // Custom implementation here, e.g.: - // abstractFuelPlanningPt = std::make_shared<high::fuelPlanning>(someArgs); // Create Object and puts it in interface class pointer - } else if (fidelityLevelFuelPlanning == "low") { // low fidelity fuelPlanning - abstractFuelPlanningPt = std::make_shared<low::fuelPlanning>(myAcftPt, mySettingsPt, rtIO); // Create Object and puts it in interface class pointer - // abstractFuelPlanningPt->setFactory(shared_from_this()); // Enables Factory-Products to access the factory to check what fidelity levels other products are - } else { - myRuntimeInfo->warn << "Unavailable fidelity level for 'FuelPlanning' selected! Exiting"<< std::endl; - exit(1); - } - /* Mission Optimization */ - if (fidelityLevelOptimizeMission == "high") { // high fidelity optimizeMission - // ... - } else if (fidelityLevelFuelPlanning == "low") { // low fidelity optimizeMission - abstractOptimizeMissionProfilePt = std::make_shared<low::optimizeMissionProfile>(&myAcft); // Create Object and puts it in interface class pointer - } else { // default case: low - myRuntimeInfo->warn << "Unavailable fidelity level for 'MissionOptimization' selected! Exiting"<< std::endl; - exit(1); - } + /* PayloadRange */ if (fidelityLevelPayloadRangeDiagram == "high") { // ... @@ -154,143 +135,100 @@ void performance_assessment_factory::initialize() { void performance_assessment_factory::run() { /* Run the selected modules */ -/* Fuel Planning */ -if (mySettingsPt->mySwitches.doFuelPlanning == true) { - try { - myRuntimeInfo->out << " -> Fuel Planning" << std::endl; - abstractFuelPlanningPt->doFuelPlanning(); - mySettingsPt->check_sucessfully_executed.doFuelPlanning = true; - } catch (const int& errorCode) { - mySettingsPt->check_sucessfully_executed.doFuelPlanning = false; - myRuntimeInfo->out << "Error in fuel planning. See logLevel=2 (Info) for more details." << std::endl; - } -} -/* Optimize Mission */ -if (mySettingsPt->optimizeMission == true) { - try { - abstractOptimizeMissionProfilePt->doOptimizeMission(abstractFuelPlanningPt, rtIO, mySettingsPt->designForMTOM); - } catch (const int& errorCode) { - myRuntimeInfo->err << "Error in mission optimization. See logLevel=2 (Info) for more details." << std::endl; - } -} /* PayloadRange */ -if (mySettingsPt->mySwitches.doPayloadRange == true) { - try { - if (!mySettingsPt->designForMTOM && mySettingsPt->useStudyMissionForAnalysis) { - myRuntimeInfo->out << "Attention: Payload range diagram incorrect when MTOM Design off or StudyMission is used!" << std::endl; - abstractFuelPlanningPt->doPayloadRangeOLD(); - } else { - if (mySettingsPt->mySwitches.doFuelPlanning == false || mySettingsPt->check_sucessfully_executed.doFuelPlanning == false) { - myRuntimeInfo->out << " ... Payload Range" << std::endl; - abstractPayloadRangePt->calcPayloadRange(); - } else { - myRuntimeInfo->out << " ... Payload Range using OLD method" << std::endl; - abstractFuelPlanningPt->doPayloadRangeOLD(); - abstractFuelPlanningPt->doFuelPayloadRangeOLD(); - } - } - mySettingsPt->check_sucessfully_executed.doPayloadRange = true; - } catch (const int& errorCode) { - myRuntimeInfo->err << "Error in payload range calculation. See logLevel=2 (Info) for more details." << std::endl; - mySettingsPt->check_sucessfully_executed.doPayloadRange = false; - } -} else { - abstractFuelPlanningPt->payloadRangeFromAcftXML(); +try { + myRuntimeInfo->out << " ... Payload Range" << std::endl; + abstractPayloadRangePt->calcPayloadRange(); +} catch (const int& errorCode) { + myRuntimeInfo->err << "Error in payload range calculation. See logLevel=2 (Info) for more details." << std::endl; + mySettingsPt->check_sucessfully_executed.doPayloadRange = false; } /* EnginePerformance */ -if (mySettingsPt->mySwitches.doEnginePerformance == true) { - try { - myRuntimeInfo->out << " -> Engine Performance" << std::endl; - abstractEnginePerformancePt->doEngineCalculation(mySettingsPt->enginePerformance.Rating); - mySettingsPt->check_sucessfully_executed.doEnginePerformance = true; - } catch (const int& errorCode) { - mySettingsPt->check_sucessfully_executed.doEnginePerformance = false; - myRuntimeInfo->out << "Error in engine performance evaluation. See logLevel=2 (Info) for more details." << std::endl; - } +try { + myRuntimeInfo->out << " -> Engine Performance" << std::endl; + abstractEnginePerformancePt->doEngineCalculation(mySettingsPt->enginePerformance.Rating); + mySettingsPt->check_sucessfully_executed.doEnginePerformance = true; +} catch (const int& errorCode) { + mySettingsPt->check_sucessfully_executed.doEnginePerformance = false; + myRuntimeInfo->out << "Error in engine performance evaluation. See logLevel=2 (Info) for more details." << std::endl; } + /* Climb Performance */ -if (mySettingsPt->mySwitches.doClimbPerformance == true) { +try { + myRuntimeInfo->out << " -> Ceiling Performance" << std::endl; + abstractCeilingPerformancePt->doCeilingCalculation(); try { - myRuntimeInfo->out << " -> Ceiling Performance" << std::endl; - abstractCeilingPerformancePt->doCeilingCalculation(); - if (mySettingsPt->mySwitches.doFlightEnvelopePerformance == true) { - try { - myRuntimeInfo->out << " -> Flight Envelopes" << std::endl; - if (fabs(myAcftPt->MDive - 0) < ACCURACY_HIGH || fabs(myAcftPt->VDive - 0.) < ACCURACY_HIGH || mySettingsPt->mySwitches.overwriteInitialValues) { - abstractFlightEnvelopesPt->doDiveSpeedLimits(); - } - abstractFlightEnvelopesPt->doFlightEnvelope(abstractCeilingPerformancePt); - myRuntimeInfo->out << " -> SAR Performance" << std::endl; - abstractSARPerformancePt->doSARCalculation(abstractFlightEnvelopesPt); - mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance = true; - } catch (const int& errorCode) { - mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance = false; - myRuntimeInfo->err << "Error in flight envelope calculation. See logLevel=2 (Info) for more details." << std::endl; - } - } - mySettingsPt->check_sucessfully_executed.doClimbPerformance = true; + myRuntimeInfo->out << " -> Flight Envelopes" << std::endl; + if (fabs(myAcftPt->MDive - 0) < ACCURACY_HIGH || fabs(myAcftPt->VDive - 0.) < ACCURACY_HIGH || mySettingsPt->overwrite_initial_values) { + abstractFlightEnvelopesPt->doDiveSpeedLimits(); + } + abstractFlightEnvelopesPt->doFlightEnvelope(abstractCeilingPerformancePt); + myRuntimeInfo->out << " -> SAR Performance" << std::endl; + abstractSARPerformancePt->doSARCalculation(abstractFlightEnvelopesPt); + mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance = true; } catch (const int& errorCode) { - mySettingsPt->check_sucessfully_executed.doClimbPerformance = false; // Prevents generation of plots with nonexisting data - myRuntimeInfo->out << "Error in climb performance calculation. See logLevel=2 (Info) for more details." << std::endl; + mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance = false; + myRuntimeInfo->err << "Error in flight envelope calculation. See logLevel=2 (Info) for more details." << std::endl; } + mySettingsPt->check_sucessfully_executed.doClimbPerformance = true; +} catch (const int& errorCode) { + mySettingsPt->check_sucessfully_executed.doClimbPerformance = false; // Prevents generation of plots with nonexisting data + myRuntimeInfo->out << "Error in climb performance calculation. See logLevel=2 (Info) for more details." << std::endl; } + /* Takeoff Performance*/ -if (mySettingsPt->mySwitches.doTOPerformance == true) { - try { - myRuntimeInfo->out << " -> Takeoff Performance" << std::endl; - abstractTakeOffPerformancePt->doTakeOffPerformance(mySettingsPt->myField.runwaySlope, - myAcftPt->frictionCoefficient, - myAcftPt->brakingCoefficient, - mySettingsPt->myField.headWind); - mySettingsPt->check_sucessfully_executed.doTOPerformance = true; - } catch (const int& errorCode) { - mySettingsPt->check_sucessfully_executed.doTOPerformance = false; // Prevents generation of plots with nonexisting data - myRuntimeInfo->out << "Error in takeoff performance calculation. See logLevel=2 (Info) for more details." << std::endl; - } - if (mySettingsPt->mySwitches.doBLFLPerformance == true) { // BLFL performance cannot be calculated without Takeoff-performance - try { - // Calculation of Balance Field Length - myRuntimeInfo->out << " -> Calculation of BLFL" << std::endl; - abstractTakeOffPerformancePt->calcBLFL(mySettingsPt->myField.runwaySlope, - myAcftPt->frictionCoefficient, - myAcftPt->brakingCoefficient, - mySettingsPt->myField.headWind); - mySettingsPt->check_sucessfully_executed.doBLFLPerformance = true; - } catch (const int& errorCode) { - mySettingsPt->check_sucessfully_executed.doBLFLPerformance = false; - myRuntimeInfo->out << "Error in balanced field length calculation. See logLevel=2 (Info) for more details." << std::endl; - } - } +try { + myRuntimeInfo->out << " -> Takeoff Performance" << std::endl; + abstractTakeOffPerformancePt->doTakeOffPerformance(mySettingsPt->myField.runwaySlope, + myAcftPt->frictionCoefficient, + myAcftPt->brakingCoefficient, + mySettingsPt->myField.headWind); + mySettingsPt->check_sucessfully_executed.doTOPerformance = true; +} catch (const int& errorCode) { + mySettingsPt->check_sucessfully_executed.doTOPerformance = false; // Prevents generation of plots with nonexisting data + myRuntimeInfo->out << "Error in takeoff performance calculation. See logLevel=2 (Info) for more details." << std::endl; } +try { + // Calculation of Balance Field Length + myRuntimeInfo->out << " -> Calculation of BLFL" << std::endl; + abstractTakeOffPerformancePt->calcBLFL(mySettingsPt->myField.runwaySlope, + myAcftPt->frictionCoefficient, + myAcftPt->brakingCoefficient, + mySettingsPt->myField.headWind); + mySettingsPt->check_sucessfully_executed.doBLFLPerformance = true; +} catch (const int& errorCode) { + mySettingsPt->check_sucessfully_executed.doBLFLPerformance = false; + myRuntimeInfo->out << "Error in balanced field length calculation. See logLevel=2 (Info) for more details." << std::endl; +} + + /* Landing Performance */ -if (mySettingsPt->mySwitches.doLandingPerformance == true) { - try { - myRuntimeInfo->out << " -> Landing Performance" << std::endl; - abstractLandingPerformancePt->doLandingPerformance(mySettingsPt->myField.runwaySlope, - myAcftPt->brakingCoefficient, - mySettingsPt->myField.headWind); - mySettingsPt->check_sucessfully_executed.doLandingPerformance = true; - } catch (const int& errorCode) { - mySettingsPt->check_sucessfully_executed.doLandingPerformance = false; // Prevents generation of plots with nonexisting data - myRuntimeInfo->out << "Error in landing performance calculation. See logLevel=2 (Info) for more details." << std::endl; - } +try { + myRuntimeInfo->out << " -> Landing Performance" << std::endl; + abstractLandingPerformancePt->doLandingPerformance(mySettingsPt->myField.runwaySlope, + myAcftPt->brakingCoefficient, + mySettingsPt->myField.headWind); + mySettingsPt->check_sucessfully_executed.doLandingPerformance = true; +} catch (const int& errorCode) { + mySettingsPt->check_sucessfully_executed.doLandingPerformance = false; // Prevents generation of plots with nonexisting data + myRuntimeInfo->out << "Error in landing performance calculation. See logLevel=2 (Info) for more details." << std::endl; } + /* Vn-Diagram */ -if (mySettingsPt->mySwitches.doVnDiagram == true) { - try { - myRuntimeInfo->out << " -> V-n Diagram" << std::endl; - abstractVnDiagramPt->doVnDiagram(); - mySettingsPt->check_sucessfully_executed.doVnDiagram = true; - } catch (const int& errorCode) { - mySettingsPt->check_sucessfully_executed.doVnDiagram = false; // Prevents generation of plots with nonexisting data - myRuntimeInfo->out << "Error in Vn diagram calculation. See logLevel=2 (Info) for more details." << std::endl; - } +try { + myRuntimeInfo->out << " -> V-n Diagram" << std::endl; + abstractVnDiagramPt->doVnDiagram(); + mySettingsPt->check_sucessfully_executed.doVnDiagram = true; +} catch (const int& errorCode) { + mySettingsPt->check_sucessfully_executed.doVnDiagram = false; // Prevents generation of plots with nonexisting data + myRuntimeInfo->out << "Error in Vn diagram calculation. See logLevel=2 (Info) for more details." << std::endl; } + } // end of run() void performance_assessment_factory::update() { @@ -299,8 +237,6 @@ void performance_assessment_factory::update() { void performance_assessment_factory::report() { performance_assessment_output theOutput( - abstractFuelPlanningPt, - abstractOptimizeMissionProfilePt, abstractPayloadRangePt, abstractEnginePerformancePt, abstractCeilingPerformancePt, diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.h b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.h index adb51d9d..16495ec4 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.h +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.h @@ -40,8 +40,6 @@ // ... /* Default methods and classes */ -#include "fuelPlanning/low_fidelity/fuelPlanning.h" -#include "optimizeMissionProfile/low_fidelity/optimizeMissionProfile.h" #include "payloadRange/low_fidelity/payloadRange.h" #include "enginePerformance/low_fidelity/enginePerformance.h" #include "SARPerformance/low_fidelity/SARPerformance.h" @@ -53,8 +51,6 @@ /* Interfaces */ #include "ceilingPerformance/abstractCeilingPerformance.h" -#include "fuelPlanning/abstractFuelPlanning.h" -#include "optimizeMissionProfile/abstractOptimizeMissionProfile.h" #include "payloadRange/abstractPayloadRange.h" #include "enginePerformance/abstractEnginePerformance.h" #include "SARPerformance/abstractSARPerformance.h" @@ -84,8 +80,6 @@ class performance_assessment_factory : public Strategy, std::enable_shared_from_ aircraft myAcft; std::shared_ptr<aircraft> myAcftPt; - std::shared_ptr<abstractFuelPlanning> abstractFuelPlanningPt; /**< fuelPlanning object */ - std::shared_ptr<abstractOptimizeMissionProfile> abstractOptimizeMissionProfilePt; /**< optimizeMissionProfile object */ std::shared_ptr<abstractPayloadRange> abstractPayloadRangePt; /**< payloadRange object */ std::shared_ptr<abstractEnginePerformance> abstractEnginePerformancePt; /**< enginePerformance object */ std::shared_ptr<abstractCeilingPerformance> abstractCeilingPerformancePt; /**< ceilingPerformance object*/ diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp index d991b559..36b4cf43 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp @@ -25,8 +25,6 @@ performance_assessment_output::performance_assessment_output( - std::shared_ptr<abstractFuelPlanning> abstractFuelPlanningPt, - std::shared_ptr<abstractOptimizeMissionProfile> abstractOptimizeMissionProfilePt, std::shared_ptr<abstractPayloadRange> abstractPayloadRangePt, std::shared_ptr<abstractEnginePerformance> abstractEnginePerformancePt, std::shared_ptr<abstractCeilingPerformance> abstractCeilingPerformancePt, @@ -40,8 +38,6 @@ performance_assessment_output::performance_assessment_output( myAcftPt(anAcftPt), mySettingsPt(myAcftPt->mySettingsPt), rtIO(myAcftPt->rtIO), - abstractFuelPlanningPt(abstractFuelPlanningPt), - abstractOptimizeMissionProfilePt(abstractOptimizeMissionProfilePt), abstractPayloadRangePt(abstractPayloadRangePt), abstractEnginePerformancePt(abstractEnginePerformancePt), abstractCeilingPerformancePt(abstractCeilingPerformancePt), @@ -52,7 +48,7 @@ performance_assessment_output::performance_assessment_output( abstractVnDiagramPt(abstractVnDiagramPt), theReport(myAcftPt->rtIO) { // ctor - if (mySettingsPt->mySwitches.doFuelPlanning && mySettingsPt->useStudyMissionForAnalysis) { + if (mySettingsPt->useStudyMissionForAnalysis) { theProgramName = rtIO->programname + "_study"; } else { theProgramName = rtIO->programname; @@ -142,10 +138,7 @@ void performance_assessment_output::generateHtmlBody() { void performance_assessment_output::writeXmlOutput() { string subPath; /* MTOM */ - if (mySettingsPt->designForMTOM == true && mySettingsPt->mySwitches.doFuelPlanning == true) { - rtIO->acxml.at("analysis/masses_cg_inertia/maximum_takeoff_mass/mass_properties/mass/value") = myAcftPt->MTOM; - } - if (mySettingsPt->mySwitches.doFlightEnvelopePerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance == true) { /* Speeds */ subPath = "aircraft_exchange_file/assessment/performance/speed"; Endnode<double> MMO(subPath + "/maximum_operating_mach_number", "Maximum operating mach number"); @@ -175,7 +168,7 @@ void performance_assessment_output::writeXmlOutput() { v1gsClean.update(rtIO->acxml); } /* Start */ - if (mySettingsPt->mySwitches.doTOPerformance == true && mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { subPath = "aircraft_exchange_file/assessment/performance/takeoff"; // Endnode<double> todns(subPath + "/takeoff_distance_normal_safety", "Takeoff distance normal safety"); // todns.set_value(abstractTakeOffPerformancePt->myTOFLField.at(0).myTOFL.back().TODR_AEO); @@ -221,7 +214,7 @@ void performance_assessment_output::writeXmlOutput() { finalSegmentGradient.update(rtIO->acxml); } /* BLFL */ - if (mySettingsPt->mySwitches.doBLFLPerformance == true && mySettingsPt->check_sucessfully_executed.doBLFLPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doBLFLPerformance == true) { subPath = "aircraft_exchange_file/assessment/performance/takeoff"; Endnode<double> BLFL(subPath + "/balanced_field_length", "Balanced field length"); BLFL.set_value(abstractTakeOffPerformancePt->myBLFL.BLFL); @@ -230,7 +223,7 @@ void performance_assessment_output::writeXmlOutput() { BLFL.update(rtIO->acxml); } /* Landing */ - if (mySettingsPt->mySwitches.doLandingPerformance == true && mySettingsPt->check_sucessfully_executed.doLandingPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doLandingPerformance == true) { subPath = "aircraft_exchange_file/assessment/performance/landing"; Endnode<double> needed_runway_length(subPath + "/needed_runway_length", "Needed runway length"); needed_runway_length.set_value(abstractLandingPerformancePt->myLDNField.at(0).myLDN.back().ALD_AEO); @@ -243,25 +236,18 @@ void performance_assessment_output::writeXmlOutput() { vappr.set_unit("m/s"); vappr.update(rtIO->acxml); } - if (mySettingsPt->mySwitches.doPayloadRange == true && mySettingsPt->check_sucessfully_executed.doPayloadRange == true) { + if (mySettingsPt->check_sucessfully_executed.doPayloadRange == true) { /* Ranges */ subPath = "aircraft_exchange_file/assessment/performance/range"; Endnode<double> range_max_payload_at_maximum_takeoff_mass(subPath + "/range_max_payload_at_maximum_takeoff_mass", "Range at max payload at maximum take off mass"); Endnode<double> range_max_fuel_at_maximum_takeoff_mass(subPath + "/range_max_fuel_at_maximum_takeoff_mass", "Range at max fuel at maximum take off mass"); Endnode<double> payload_maximum_fuel_at_maximum_takeoff_mass(subPath + "/payload_maximum_fuel_at_maximum_takeoff_mass", "Payload at maximum fuel at maximum takeoff mass"); Endnode<double> range_maximum_fuel_empty(subPath + "/range_maximum_fuel_empty", "Range at maximum fuel empty"); - if (mySettingsPt->mySwitches.doFuelPlanning == true) { - range_max_payload_at_maximum_takeoff_mass.set_value(abstractFuelPlanningPt->myPayloadRange.at(1).Range); - range_max_fuel_at_maximum_takeoff_mass.set_value(abstractFuelPlanningPt->myPayloadRange.at(2).Range); - payload_maximum_fuel_at_maximum_takeoff_mass.set_value(abstractFuelPlanningPt->myPayloadRange.at(2).Payload); - range_maximum_fuel_empty.set_value(abstractFuelPlanningPt->myPayloadRange.at(3).Range); - } else { - if (abstractPayloadRangePt->Range.at(2) > myAcftPt->designRange) { - range_max_payload_at_maximum_takeoff_mass.set_value(abstractPayloadRangePt->Range.at(1)); - range_max_fuel_at_maximum_takeoff_mass.set_value(abstractPayloadRangePt->Range.at(2)); - payload_maximum_fuel_at_maximum_takeoff_mass.set_value(abstractPayloadRangePt->Payload.at(2)); - range_maximum_fuel_empty.set_value(abstractPayloadRangePt->Range.at(3)); - } + if (abstractPayloadRangePt->Range.at(2) > myAcftPt->designRange) { + range_max_payload_at_maximum_takeoff_mass.set_value(abstractPayloadRangePt->Range.at(1)); + range_max_fuel_at_maximum_takeoff_mass.set_value(abstractPayloadRangePt->Range.at(2)); + payload_maximum_fuel_at_maximum_takeoff_mass.set_value(abstractPayloadRangePt->Payload.at(2)); + range_maximum_fuel_empty.set_value(abstractPayloadRangePt->Range.at(3)); } range_max_payload_at_maximum_takeoff_mass.set_boundaries(0, INFINITY); range_max_payload_at_maximum_takeoff_mass.set_unit("m"); @@ -276,7 +262,7 @@ void performance_assessment_output::writeXmlOutput() { range_maximum_fuel_empty.set_unit("m"); range_maximum_fuel_empty.update(rtIO->acxml); } - if (mySettingsPt->mySwitches.doFuelPlanning == true && mySettingsPt->check_sucessfully_executed.doFuelPlanning == true) { + if (mySettingsPt->check_sucessfully_executed.doFuelPlanning == true) { /* Mission Fuels */ if (!mySettingsPt->designForMTOM && mySettingsPt->useStudyMissionForAnalysis) { subPath = "aircraft_exchange_file/analysis/mission/study_mission"; @@ -286,22 +272,8 @@ void performance_assessment_output::writeXmlOutput() { Endnode<double> missionRange(subPath + "/range", "Traveled range from break release to end of taxi at destination"); missionRange.set_value(myAcftPt->myMission.missionRange); missionRange.update(rtIO->acxml); - // rtIO->acxml.at(subPath + "/range") = myAcftPt->myMission.missionRange; - // Fuel - // rtIO->acxml.at(subPath + "/mission_energy") = std::to_string(abstractFuelPlanningPt->myFuel.missionFuel) + "<-Fuel[kg]"; // Total Tanked Fuel - // rtIO->acxml.at(subPath + "/trip_energy") = abstractFuelPlanningPt->myFuel.tripFuel; // Tanked fuel - Reserve Fuel - Taxi Fuel - // rtIO->acxml.at(subPath + "/taxi_energy") = abstractFuelPlanningPt->myFuel.taxiFuelTakeoff; // TODO(hansmann): xpath&fuel2energyconversion - // rtIO->acxml.at(subPath + "/TaxifuelLdg") = abstractFuelPlanningPt->myFuel.taxiFuelLanding; // TODO(hansmann): xpath&fuel2energyconversion // Rest - Endnode<double> tom(subPath + "/takeoff_mass", "Take off mass"); - tom.set_value(myAcftPt->OME + myAcftPt->myMission.missionPayload + abstractFuelPlanningPt->myFuel.missionFuel - abstractFuelPlanningPt->myFuel.taxiFuelTakeoff); - tom.set_unit("kg"); - tom.set_boundaries(0, INFINITY); - tom.update(rtIO->acxml); - // rtIO->acxml.at(subPath + "/TOM") = myAcftPt->OME - // + myAcftPt->myMission.missionPayload - // + abstractFuelPlanningPt->myFuel.missionFuel - // - abstractFuelPlanningPt->myFuel.taxiFuelTakeoff; + Endnode<double> payload_mass(subPath + "/payload_mass", "Mission payload mass"); payload_mass.set_value(myAcftPt->myMission.missionPayload); payload_mass.set_boundaries(0, INFINITY); @@ -321,21 +293,13 @@ void performance_assessment_output::writeXmlOutput() { takeoff_engine_derate.set_value(myAcftPt->myMission.Steps.at(0).derating); takeoff_engine_derate.set_unit("1"); takeoff_engine_derate.update(rtIO->acxml); - Endnode<double> block_time(subPath + "/block_time", "Block time for the whole mission: Time from break release to end of taxiing after landing"); - block_time.set_value(abstractFuelPlanningPt->blockTime); - block_time.set_unit("s"); - block_time.update(rtIO->acxml); - Endnode<double> flight_time(subPath + "/flight_time", "Flight time for the whole mission"); - flight_time.set_value(abstractFuelPlanningPt->tripTime); - flight_time.set_unit("s"); - flight_time.update(rtIO->acxml); } /* Requirements Checks */ // TLARS subPath = "aircraft_exchange_file/requirement_compliance/top_level_aircraft_requirements"; Endnode<bool> design_takeoff_distance_checked(subPath + "/design_takeoff_distance/checked", "Indicates if the value has been checked against the requirement."); design_takeoff_distance_checked.set_value(false); - if (mySettingsPt->mySwitches.doTOPerformance == true && mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { Endnode<bool> design_takeoff_distance_maintainable(subPath + "/design_takeoff_distance/maintainable", "Switch indicating if design takeoff distance can be maintained."); design_takeoff_distance_maintainable.set_value(myAcftPt->myChecks.TOFL); @@ -348,7 +312,7 @@ void performance_assessment_output::writeXmlOutput() { design_landing_field_length_checked.set_value(false); Endnode<bool> design_approach_speed_maintainable_checked(subPath + "/design_approach_speed/checked", "Indicates if the value has been checked against the requirement."); design_approach_speed_maintainable_checked.set_value(false); - if (mySettingsPt->mySwitches.doLandingPerformance == true && mySettingsPt->check_sucessfully_executed.doLandingPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doLandingPerformance == true) { Endnode<bool> design_landing_field_length_maintainable(subPath + "/design_landing_field_length/maintainable", "Switch indicating if landing field length can be maintained."); design_landing_field_length_maintainable.set_value(myAcftPt->myChecks.LDN); @@ -378,7 +342,7 @@ void performance_assessment_output::writeXmlOutput() { "Indicates if the value has been checked against the requirement."); climb_gradient_of_final_takeoff_segment_checked.set_value(false); - if (mySettingsPt->mySwitches.doTOPerformance == true && mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { Endnode<bool> climb_gradient_of_second_takeoff_segment(subPath + "/climb_gradient_of_second_takeoff_segment/maintainable", "Switch indicating if climb gradient of second takeoff segment can be maintained."); climb_gradient_of_second_takeoff_segment.set_value(myAcftPt->myChecks.climbGradientSecondSegment); @@ -399,7 +363,7 @@ void performance_assessment_output::writeXmlOutput() { Endnode<bool> climb_gradient_all_engines_operative_checked(subPath + "/climb_gradient_all_engines_operative/checked", "Indicates if the value has been checked against the requirement."); climb_gradient_all_engines_operative_checked.set_value(false); - if (mySettingsPt->mySwitches.doLandingPerformance == true && mySettingsPt->check_sucessfully_executed.doLandingPerformance) { + if (mySettingsPt->check_sucessfully_executed.doLandingPerformance) { Endnode<bool> climb_gradient_approach_one_engine_inoperative(subPath + "/climb_gradient_approach_one_engine_inoperative/maintainable", "Switch indicating if climb gradient approach one engine inoperative can be maintained."); climb_gradient_approach_one_engine_inoperative.set_value(myAcftPt->myChecks.climbGradientApproachOEI); @@ -417,94 +381,34 @@ void performance_assessment_output::writeXmlOutput() { void performance_assessment_output::generatePlotData() { - if (mySettingsPt->mySwitches.doFuelPlanning == true && mySettingsPt->check_sucessfully_executed.doFuelPlanning == true) { - generatePlotDataMission(); - } - if (mySettingsPt->mySwitches.doPayloadRange == true && mySettingsPt->check_sucessfully_executed.doPayloadRange == true) { + if (mySettingsPt->check_sucessfully_executed.doPayloadRange == true) { generatePlotDataPayloadRange(); } - if (mySettingsPt->mySwitches.doEnginePerformance == true && mySettingsPt->check_sucessfully_executed.doEnginePerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doEnginePerformance == true) { generate_engine_performance_data(); } - if (mySettingsPt->mySwitches.doClimbPerformance == true && mySettingsPt->check_sucessfully_executed.doClimbPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doClimbPerformance == true) { generateCeilingPlotData(); } - if (mySettingsPt->mySwitches.doFlightEnvelopePerformance == true && mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance == true) { generateFlightEnvelopeData(); generateSARPlotData(); generate_best_SAR_Data(); } - if (mySettingsPt->mySwitches.doTOPerformance == true && mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { generateTOFLPlotData(); } - if (mySettingsPt->mySwitches.doBLFLPerformance == true && mySettingsPt->check_sucessfully_executed.doBLFLPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doBLFLPerformance == true) { generateBLFLPlotData(); } - if (mySettingsPt->mySwitches.doLandingPerformance == true && mySettingsPt->check_sucessfully_executed.doLandingPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doLandingPerformance == true) { generateLDNPlotData(); } - if (mySettingsPt->mySwitches.doVnDiagram == true && mySettingsPt->check_sucessfully_executed.doVnDiagram == true) { + if (mySettingsPt->check_sucessfully_executed.doVnDiagram == true) { generateVnPlotData(); } } -void performance_assessment_output::generatePlotDataMission() { -std::ofstream csv; - string csvDataFile(mySettingsPt->rtIO->getCsvFilesDirTool() + "/" + theProgramName + "_Mission.csv"); - csv.open(csvDataFile.c_str()); - if (!csv) { - myRuntimeInfo->err << string(theProgramName) + "_Mission.csv could not be opened!" << std::endl; - exit(1); - } else { - csv << "# " + mySettingsPt->rtIO->getCsvFilesDirTool() + theProgramName + "_Mission.csv" << std::endl; - // Adjust data structure: - csv << "# (1) ID; (2) Time [s]; (3) Range [m]; (4) Altitude [m]; (5) TAS [m/s]; (6) CAS [m/s]; (7) Mach; "; - csv << "(8) A/C Mass [kg]; (9) consumed Fuel [kg]; (10) total consumed Fuel [kg]; (11) Thrust [N]; "; - csv << "(12) Fuel Flow [kg/s]; (13) ROC [m/s]; (14) C_L" << std::endl; - /*(1)*/ csv << "0; "; - /*(1)*/ csv << "0; "; - /*(3)*/ csv << "0; "; - /*(4)*/ csv << "0; "; - /*(5)*/ csv << "0; "; - /*(6)*/ csv << "0; "; - /*(7)*/ csv << "0; "; - /*(8)*/ csv << abstractFuelPlanningPt->theMissionFuel.at(0).Mass << "; "; - /*(9)*/ csv << "0; "; - /*(10)*/ csv << "0; "; - /*(11)*/ csv << "0; "; - /*(12)*/ csv << "0; "; - /*(13)*/ csv << "0; "; - /*(14)*/ csv << "0" << std::endl; - double time(0.); - double range(0.); - double fuel(0.); - for (unsigned int i = 0; i <= myAcftPt->myMission.Steps.size() - 1; i++) { - time += abstractFuelPlanningPt->theMissionFuel.at(i + 1).Time; - range += abstractFuelPlanningPt->theMissionFuel.at(i + 1).Range; - fuel += abstractFuelPlanningPt->theMissionFuel.at(i + 1).consumedFuel; - double C_L = (2. * G_FORCE * abstractFuelPlanningPt->theMissionFuel.at(i + 1).Mass) - / (myAcftPt->atm.getDensity(myAcftPt->myMission.Steps.at(i).endAltitude) - * pow(myAcftPt->myMission.Steps.at(i).endTAS, 2.) - * myAcftPt->S_Wing); - /*(1)*/ csv << i + 1 << "; "; - /*(1)*/ csv << time << "; "; - /*(3)*/ csv << range << "; "; - /*(4)*/ csv << myAcftPt->myMission.Steps.at(i).endAltitude << "; "; - /*(5)*/ csv << myAcftPt->myMission.Steps.at(i).endTAS << "; "; - /*(6)*/ csv << myAcftPt->myMission.Steps.at(i).endCAS << "; "; - /*(7)*/ csv << myAcftPt->myMission.Steps.at(i).endMach << "; "; - /*(8)*/ csv << abstractFuelPlanningPt->theMissionFuel.at(i + 1).Mass << "; "; - /*(9)*/ csv << abstractFuelPlanningPt->theMissionFuel.at(i + 1).consumedFuel << "; "; - /*(10)*/ csv << fuel << "; "; - /*(11)*/ csv << abstractFuelPlanningPt->theMissionFuel.at(i + 1).Thrust << "; "; - /*(12)*/ csv << abstractFuelPlanningPt->theMissionFuel.at(i + 1).fuelFlow << "; "; - /*(13)*/ csv << abstractFuelPlanningPt->theMissionFuel.at(i + 1).ROC << "; "; - /*(14)*/ csv << C_L << std::endl; - } - csv.close(); - } -} - void performance_assessment_output::generatePlotDataPayloadRange() { std::ofstream csv; string csvDataFile(mySettingsPt->rtIO->getCsvFilesDirTool() + "/" + theProgramName + "_payloadRange.csv"); @@ -516,26 +420,15 @@ std::ofstream csv; csv << "# " + mySettingsPt->rtIO->getCsvFilesDirTool() + theProgramName + "_missionFuel.csv" << std::endl; // Adjust data structure: csv << "# (1) Range [m]; (2) Payload [kg]; (3) Fuel [kg]; (4) TOM [kg]; (5) OME [kg]" << std::endl; - if (mySettingsPt->mySwitches.doFuelPlanning == true) { - for (unsigned int i(0); i <= abstractFuelPlanningPt->myPayloadRange.size() - 1; i++) { - csv << abstractFuelPlanningPt->myPayloadRange.at(i).Range << "; "; - csv << abstractFuelPlanningPt->myPayloadRange.at(i).Payload << "; "; - csv << abstractFuelPlanningPt->myPayloadRange.at(i).Fuel << "; "; - csv << abstractFuelPlanningPt->myPayloadRange.at(i).TOM << "; "; - csv << myAcftPt->OME << "; "; - csv << std::endl; - } - } else { - for (unsigned int i(0); i <= abstractPayloadRangePt->Range.size() - 1; i++) { - csv << abstractPayloadRangePt->Range.at(i) << "; "; - csv << abstractPayloadRangePt->Payload.at(i) << "; "; - csv << abstractPayloadRangePt->Fuel.at(i) << "; "; - csv << abstractPayloadRangePt->TOM.at(i) << "; "; - // csv << myPerfPt->abstractFuelPlanning.myPayloadRange.at(i).Fuel << "; "; - // csv << myPerfPt->abstractFuelPlanning.myPayloadRange.at(i).TOM << "; "; - // csv << myAcftPt->OME << "; "; - csv << std::endl; - } + for (unsigned int i(0); i <= abstractPayloadRangePt->Range.size() - 1; i++) { + csv << abstractPayloadRangePt->Range.at(i) << "; "; + csv << abstractPayloadRangePt->Payload.at(i) << "; "; + csv << abstractPayloadRangePt->Fuel.at(i) << "; "; + csv << abstractPayloadRangePt->TOM.at(i) << "; "; + // csv << myPerfPt->abstractFuelPlanning.myPayloadRange.at(i).Fuel << "; "; + // csv << myPerfPt->abstractFuelPlanning.myPayloadRange.at(i).TOM << "; "; + // csv << myAcftPt->OME << "; "; + csv << std::endl; } csv << std::endl; csv << std::endl; @@ -712,7 +605,6 @@ void performance_assessment_output::generateSARPlotData() { } void performance_assessment_output::generate_best_SAR_Data() { -// TODO(franz#1#): kathi (18.11.2013): Plot seltsam -> reparieren std::ofstream csv; string csvDataFile(mySettingsPt->rtIO->getCsvFilesDirTool() + "/" + theProgramName + "_bestSAR.csv"); csv.open(csvDataFile.c_str()); @@ -859,29 +751,29 @@ void performance_assessment_output::generateVnPlotData() { } void performance_assessment_output::generatePlots() { - if (mySettingsPt->mySwitches.doPayloadRange == true && mySettingsPt->check_sucessfully_executed.doPayloadRange == true) { + if (mySettingsPt->check_sucessfully_executed.doPayloadRange == true) { generate_plot_payload_range(); } - if (mySettingsPt->mySwitches.doEnginePerformance == true && mySettingsPt->check_sucessfully_executed.doEnginePerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doEnginePerformance == true) { generate_plot_engine_performance(); } - if (mySettingsPt->mySwitches.doClimbPerformance == true && mySettingsPt->check_sucessfully_executed.doClimbPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doClimbPerformance == true) { generate_plot_ceiling_performance(); } - if (mySettingsPt->mySwitches.doFlightEnvelopePerformance == true && mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance == true) { generate_plot_flight_envelope(); generate_plot_SAR_performance(); } - if (mySettingsPt->mySwitches.doTOPerformance == true && mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { generate_plot_takeoff_field_length(); } - if (mySettingsPt->mySwitches.doBLFLPerformance == true && mySettingsPt->check_sucessfully_executed.doBLFLPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doBLFLPerformance == true) { generate_plot_balanced_field_length(); } - if (mySettingsPt->mySwitches.doLandingPerformance == true && mySettingsPt->check_sucessfully_executed.doLandingPerformance == true) { + if (mySettingsPt->check_sucessfully_executed.doLandingPerformance == true) { generate_plot_landing_performance(); } - if (mySettingsPt->mySwitches.doVnDiagram == true && mySettingsPt->check_sucessfully_executed.doVnDiagram == true) { + if (mySettingsPt->check_sucessfully_executed.doVnDiagram == true) { generate_plot_v_n_diagram(); } } @@ -891,18 +783,10 @@ void performance_assessment_output::generate_plot_payload_range() { // Gather data vector<double> x_range; vector<double> y_payload; - if (mySettingsPt->mySwitches.doFuelPlanning == true) { - // Case: Payload range data was generated by fuel planning class - for (unsigned int i(0); i < abstractFuelPlanningPt->myPayloadRange.size(); i++) { - x_range.push_back(abstractFuelPlanningPt->myPayloadRange.at(i).Range / 1000); // in km - y_payload.push_back(abstractFuelPlanningPt->myPayloadRange.at(i).Payload); - } - } else { - // Case: Payload range data was generated by payload range class - for (unsigned int i(0); i < abstractPayloadRangePt->Range.size(); i++) { - x_range.push_back(abstractPayloadRangePt->Range.at(i) / 1000); - y_payload.push_back(abstractPayloadRangePt->Payload.at(i)); - } + // Case: Payload range data was generated by payload range class + for (unsigned int i(0); i < abstractPayloadRangePt->Range.size(); i++) { + x_range.push_back(abstractPayloadRangePt->Range.at(i) / 1000); + y_payload.push_back(abstractPayloadRangePt->Payload.at(i)); } // Plot matplot::figure_handle fig = matplot::figure(true); diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h index 3790b847..3b7910a5 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.h @@ -41,8 +41,6 @@ class performance_assessment_factory; class performance_assessment_output { public: performance_assessment_output( - std::shared_ptr<abstractFuelPlanning> abstractFuelPlanningPt, - std::shared_ptr<abstractOptimizeMissionProfile> abstractOptimizeMissionProfilePt, std::shared_ptr<abstractPayloadRange> abstractPayloadRangePt, std::shared_ptr<abstractEnginePerformance> abstractEnginePerformancePt, std::shared_ptr<abstractCeilingPerformance> abstractCeilingPerformancePt, @@ -58,8 +56,6 @@ class performance_assessment_output { const std::shared_ptr<performance_assessment_settings> mySettingsPt; const std::shared_ptr<RuntimeIO>& rtIO; - std::shared_ptr<abstractFuelPlanning> abstractFuelPlanningPt; - std::shared_ptr<abstractOptimizeMissionProfile> abstractOptimizeMissionProfilePt; std::shared_ptr<abstractPayloadRange> abstractPayloadRangePt; std::shared_ptr<abstractEnginePerformance> abstractEnginePerformancePt; std::shared_ptr<abstractCeilingPerformance> abstractCeilingPerformancePt; @@ -91,10 +87,6 @@ class performance_assessment_output { */ void generatePlotData(); - /** \brief Generate the plot of the mission data (Range, altitude, velocity, mass, thrust, fuel flow, rate of climb, lift coefficient) - */ - void generatePlotDataMission(); - /** \brief Generate all relevant Plots * \return void */ diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp index ec52051a..cfecfd1c 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp @@ -27,9 +27,7 @@ performance_assessment_settings::performance_assessment_settings(const std::shar : rtIO(rtIOin), designForMTOM(rtIO->moduleConfig.at("/module_configuration_file/program_settings/modes/mtom_design/value")), - useStudyMissionForAnalysis(rtIO->moduleConfig.at("/module_configuration_file/program_settings/modes/use_study_mission_for_analysis/value")), // CSV-Output? - optimizeMission(rtIO->moduleConfig.at("/module_configuration_file/program_settings/mission/optimize_mission_profile/value")) { - + useStudyMissionForAnalysis(rtIO->moduleConfig.at("/module_configuration_file/program_settings/modes/use_study_mission_for_analysis/value")) { /* Constants for start/runway calculations */ myField.runwaySlope = PI / 180. * EndnodeReadOnly<double>("/module_configuration_file/program_settings/constants_for_performance_checks/field_performance/runway_slope") .read(rtIO->moduleConfig).value(); @@ -52,33 +50,8 @@ performance_assessment_settings::performance_assessment_settings(const std::shar + num2Str(i+1)+"/value"); enginePerformance.Rating.push_back(tempRating); } - /* Switch for Performance Checks */ - mySwitches.doPayloadRange = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/payload_range_diagram/switch") - .read(rtIO->moduleConfig).value(); - mySwitches.doEnginePerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/engine_performance/switch") - .read(rtIO->moduleConfig).value(); - mySwitches.doFlightEnvelopePerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/switch") - .read(rtIO->moduleConfig).value(); - mySwitches.overwriteInitialValues = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/overwrite_initial_values") - .read(rtIO->moduleConfig).value(); - mySwitches.doClimbPerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/climb_performance/switch") - .read(rtIO->moduleConfig).value(); - mySwitches.doTOPerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/takeoff_performance/switch") - .read(rtIO->moduleConfig).value(); - if (mySwitches.doTOPerformance) { - mySwitches.doBLFLPerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/takeoff_performance/calculate_blfl_performance") - .read(rtIO->moduleConfig).value(); - } else { - mySwitches.doBLFLPerformance = false; - } - mySwitches.doLandingPerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/landing_performance/switch") - .read(rtIO->moduleConfig).value(); - mySwitches.doLandingPerformance = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/landing_performance/switch") + overwrite_initial_values = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/overwrite_initial_values") .read(rtIO->moduleConfig).value(); - mySwitches.doVnDiagram = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/vn_diagram/switch").read(rtIO->moduleConfig).value(); - mySwitches.doFuelPlanning = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/fuel_planning/switch").read(rtIO->moduleConfig).value(); - /* Fuel Planning */ - myFuelPlan.contingencyFuel = EndnodeReadOnly<double>("/module_configuration_file/program_settings/fuel_planning/contingency_fuel").read(rtIO->moduleConfig).value(); } void performance_assessment_settings::checkForValidity(double Value, double lowerBound, double upperBound, const string &Text) { diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h index 7cb09fb2..ef05e607 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h @@ -55,8 +55,8 @@ class performance_assessment_settings { bool doLandingPerformance; /**< Switch for landing distance estimation */ bool doVnDiagram; /**< "Switch for calculation of V-n diagram */ }; - switches mySwitches; switches check_sucessfully_executed; /**< Indicated if a performance check has been executed sucessfully */ + bool overwrite_initial_values; /** Causes recalculation of dive speeds */ bool designForMTOM; /**< Switch for a new determination of the MTOM */ bool useStudyMissionForAnalysis; /**< Switch if missionStudy.xml should be used instead of missionDesign.xml */ -- GitLab From ea39bee12df3c7ae8b7a96d1789781304d2a99b1 Mon Sep 17 00:00:00 2001 From: philipphansmann <Philipp Hansmann> Date: Thu, 20 Feb 2025 16:45:28 +0100 Subject: [PATCH 14/19] deleted old node from config --- performance_assessment/performance_assessment_conf.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/performance_assessment/performance_assessment_conf.xml b/performance_assessment/performance_assessment_conf.xml index cb754d22..7e17edc1 100644 --- a/performance_assessment/performance_assessment_conf.xml +++ b/performance_assessment/performance_assessment_conf.xml @@ -50,9 +50,6 @@ <module_strategy description="Select the strategy level option tool execution (options: default_methods)" > <value>default_methods</value> </module_strategy> - <module_fidelity_level description="Select the fidelity level (options: low)"> - <value>low</value> - </module_fidelity_level> <performance_checks description="Settings that affect different functionalities!"> <payload_range_diagram description="Payload Range Diagram calculation"> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> -- GitLab From 45079ff6cfaf48c45412be0557eaed11e5ce75ff Mon Sep 17 00:00:00 2001 From: philipphansmann <Philipp Hansmann> Date: Fri, 21 Feb 2025 10:21:23 +0100 Subject: [PATCH 15/19] deactivated execution of engine_performance, SAR_performance, BFL, Vn + removed respective nodes from config --- .../performance_assessment_conf.xml | 67 +------------ .../performance_assessment_factory.cpp | 96 ++++++++++--------- .../performance_assessment_output.cpp | 5 + .../performance_assessment_settings.cpp | 39 ++++---- .../performance_assessment_settings.h | 21 ++-- 5 files changed, 93 insertions(+), 135 deletions(-) diff --git a/performance_assessment/performance_assessment_conf.xml b/performance_assessment/performance_assessment_conf.xml index 7e17edc1..14139630 100644 --- a/performance_assessment/performance_assessment_conf.xml +++ b/performance_assessment/performance_assessment_conf.xml @@ -56,19 +56,6 @@ <value>low</value> </fidelity_level> </payload_range_diagram> - <engine_performance description="Engine power estimation"> - <fidelity_level description="Select the fidelity level of the calculation (options: low)"> - <value>low</value> - </fidelity_level> - </engine_performance> - <flight_envelope_performance description="Estimation of flight range limits"> - <fidelity_level description="Select the fidelity level of the calculation (options: low)"> - <value>low</value> - </fidelity_level> - <overwrite_initial_values description="Causes recalculation of dive speeds"> - <value>true</value> - </overwrite_initial_values> - </flight_envelope_performance> <climb_performance description="Calculate the climb performance (so far only for plots)"> <fidelity_level description="Select the fidelity level of the calculation (options: low)"> <value>low</value> @@ -84,34 +71,8 @@ <value>low</value> </fidelity_level> </landing_performance> - <vn_diagram description="Calculate the V-n diagram"> - <fidelity_level description="Select the fidelity level of the calculation (options: low)"> - <value>low</value> - </fidelity_level> - </vn_diagram> - <sar_performance> - <fidelity_level description="Select the fidelity level of the calculation (options: low)"> - <value>low</value> - </fidelity_level> - </sar_performance> </performance_checks> <constants_for_performance_checks> - <engine_performance> - <ratings> - <rating ID="1"> - <value>cruise</value> - </rating> - <rating ID="2"> - <value>climb</value> - </rating> - <rating ID="3"> - <value>maximum_continuous</value> - </rating> - <rating ID="4"> - <value>takeoff</value> - </rating> - </ratings> - </engine_performance> <field_performance> <runway_slope description="Slope / climb of the runway"> <value>0</value> @@ -126,38 +87,12 @@ <upper_boundary>50</upper_boundary> </head_wind> </field_performance> - <vn_diagram> - <max_n_clean description="Maximum load factor in clean configuration (fixed for CS-25 2.5) (default: 2.5)"> - <value>2.5</value> - <unit>1</unit> - <lower_boundary>-10</lower_boundary> - <upper_boundary>10</upper_boundary> - </max_n_clean> - <min_n_clean description="Minimum load factor in clean configuration (fixed -1.0 for CS-25)"> - <value>-0.1</value> - <unit>1</unit> - <lower_boundary>-10</lower_boundary> - <upper_boundary>10</upper_boundary> - </min_n_clean> - <max_n_flaps description="Maximum load factor with flaps (fixed for CS-25 2.0)"> - <value>2.0</value> - <unit>1</unit> - <lower_boundary>-10</lower_boundary> - <upper_boundary>10</upper_boundary> - </max_n_flaps> - <min_n_flaps description="Minimum load factor with flaps (fixed at CS-25 0.0)"> - <value>0.0</value> - <unit>1</unit> - <lower_boundary>-10</lower_boundary> - <upper_boundary>10</upper_boundary> - </min_n_flaps> - </vn_diagram> </constants_for_performance_checks> <modes description="other settings that influence different modes!"> <use_study_mission_for_analysis description="Switch to use study mission for analysis; Switch: true(use missionStudy.xml) / false (use missionDesign.xml)"> <value>false</value> </use_study_mission_for_analysis> - <mtom_design description="Switch for the redetermination of the MTOM; Switch: true (yes, e.g. DesignLoop) / fales (no, e.g. only analysis)"> + <mtom_design description="Switch for the redetermination of the MTOM; Switch: true (yes, e.g. DesignLoop) / false (no, e.g. only analysis)"> <value>false</value> </mtom_design> </modes> diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp index 8829b0b8..0f7ad9a0 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_factory.cpp @@ -36,23 +36,23 @@ performance_assessment_factory::performance_assessment_factory(const std::shared void performance_assessment_factory::initialize() { /* Get desired fidelity level of methods*/ - fidelityLevelFuelPlanning = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/fuel_planning/fidelity_level").read(rtIO->moduleConfig).value(); - fidelityLevelOptimizeMission = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/mission/fidelity_level").read(rtIO->moduleConfig).value(); - fidelityLevelPayloadRangeDiagram = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/payload_range_diagram/fidelity_level") + fidelityLevelFuelPlanning = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/fuel_planning/fidelity_level", "low").read(rtIO->moduleConfig).value(); + fidelityLevelOptimizeMission = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/mission/fidelity_level", "low").read(rtIO->moduleConfig).value(); + fidelityLevelPayloadRangeDiagram = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/payload_range_diagram/fidelity_level", "low") .read(rtIO->moduleConfig).value(); - fidelityLevelEnginePerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/engine_performance/fidelity_level") + fidelityLevelEnginePerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/engine_performance/fidelity_level", "low") .read(rtIO->moduleConfig).value(); fidelityLevelFlightEnvelopePerformance = EndnodeReadOnly<std::string>( - "/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/fidelity_level").read(rtIO->moduleConfig).value(); - fidelityLevelClimbPerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/climb_performance/fidelity_level") + "/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/fidelity_level", "low").read(rtIO->moduleConfig).value(); + fidelityLevelClimbPerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/climb_performance/fidelity_level", "low") .read(rtIO->moduleConfig).value(); - fidelityLevelTakeOffPerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/takeoff_performance/fidelity_level") + fidelityLevelTakeOffPerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/takeoff_performance/fidelity_level", "low") .read(rtIO->moduleConfig).value(); - fidelityLevelLandingPerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/landing_performance/fidelity_level") + fidelityLevelLandingPerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/landing_performance/fidelity_level", "low") .read(rtIO->moduleConfig).value(); - fidelityLevelVnDiagram = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/vn_diagram/fidelity_level") + fidelityLevelVnDiagram = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/vn_diagram/fidelity_level", "low") .read(rtIO->moduleConfig).value(); - fidelityLevelSARPerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/sar_performance/fidelity_level") + fidelityLevelSARPerformance = EndnodeReadOnly<std::string>("/module_configuration_file/program_settings/performance_checks/sar_performance/fidelity_level", "low") .read(rtIO->moduleConfig).value(); /* Initialization of performance_assessment objects */ @@ -140,40 +140,46 @@ void performance_assessment_factory::run() { try { myRuntimeInfo->out << " ... Payload Range" << std::endl; abstractPayloadRangePt->calcPayloadRange(); + mySettingsPt->check_sucessfully_executed.doPayloadRange = true; } catch (const int& errorCode) { myRuntimeInfo->err << "Error in payload range calculation. See logLevel=2 (Info) for more details." << std::endl; mySettingsPt->check_sucessfully_executed.doPayloadRange = false; } /* EnginePerformance */ -try { - myRuntimeInfo->out << " -> Engine Performance" << std::endl; - abstractEnginePerformancePt->doEngineCalculation(mySettingsPt->enginePerformance.Rating); - mySettingsPt->check_sucessfully_executed.doEnginePerformance = true; -} catch (const int& errorCode) { - mySettingsPt->check_sucessfully_executed.doEnginePerformance = false; - myRuntimeInfo->out << "Error in engine performance evaluation. See logLevel=2 (Info) for more details." << std::endl; +if (false) { // Engine performance is teporarily disabled + try { + myRuntimeInfo->out << " -> Engine Performance" << std::endl; + abstractEnginePerformancePt->doEngineCalculation(mySettingsPt->enginePerformance.Rating); + mySettingsPt->check_sucessfully_executed.doEnginePerformance = true; + } catch (const int& errorCode) { + mySettingsPt->check_sucessfully_executed.doEnginePerformance = false; + myRuntimeInfo->out << "Error in engine performance evaluation. See logLevel=2 (Info) for more details." << std::endl; + } } - /* Climb Performance */ try { myRuntimeInfo->out << " -> Ceiling Performance" << std::endl; abstractCeilingPerformancePt->doCeilingCalculation(); + mySettingsPt->check_sucessfully_executed.doClimbPerformance = true; try { myRuntimeInfo->out << " -> Flight Envelopes" << std::endl; - if (fabs(myAcftPt->MDive - 0) < ACCURACY_HIGH || fabs(myAcftPt->VDive - 0.) < ACCURACY_HIGH || mySettingsPt->overwrite_initial_values) { - abstractFlightEnvelopesPt->doDiveSpeedLimits(); - } + if (fabs(myAcftPt->MDive - 0) < ACCURACY_HIGH || fabs(myAcftPt->VDive - 0.) < ACCURACY_HIGH || mySettingsPt->overwrite_initial_values) { + abstractFlightEnvelopesPt->doDiveSpeedLimits(); + } abstractFlightEnvelopesPt->doFlightEnvelope(abstractCeilingPerformancePt); - myRuntimeInfo->out << " -> SAR Performance" << std::endl; - abstractSARPerformancePt->doSARCalculation(abstractFlightEnvelopesPt); mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance = true; + if (false) { // SAR Performance is temporarily disabled + myRuntimeInfo->out << " -> SAR Performance" << std::endl; + abstractSARPerformancePt->doSARCalculation(abstractFlightEnvelopesPt); + mySettingsPt->check_sucessfully_executed.doSARCalculation = true; + } } catch (const int& errorCode) { mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance = false; myRuntimeInfo->err << "Error in flight envelope calculation. See logLevel=2 (Info) for more details." << std::endl; } - mySettingsPt->check_sucessfully_executed.doClimbPerformance = true; + } catch (const int& errorCode) { mySettingsPt->check_sucessfully_executed.doClimbPerformance = false; // Prevents generation of plots with nonexisting data myRuntimeInfo->out << "Error in climb performance calculation. See logLevel=2 (Info) for more details." << std::endl; @@ -192,17 +198,20 @@ try { mySettingsPt->check_sucessfully_executed.doTOPerformance = false; // Prevents generation of plots with nonexisting data myRuntimeInfo->out << "Error in takeoff performance calculation. See logLevel=2 (Info) for more details." << std::endl; } -try { - // Calculation of Balance Field Length - myRuntimeInfo->out << " -> Calculation of BLFL" << std::endl; - abstractTakeOffPerformancePt->calcBLFL(mySettingsPt->myField.runwaySlope, - myAcftPt->frictionCoefficient, - myAcftPt->brakingCoefficient, - mySettingsPt->myField.headWind); - mySettingsPt->check_sucessfully_executed.doBLFLPerformance = true; -} catch (const int& errorCode) { - mySettingsPt->check_sucessfully_executed.doBLFLPerformance = false; - myRuntimeInfo->out << "Error in balanced field length calculation. See logLevel=2 (Info) for more details." << std::endl; + +if (false) { // Balanced Field Length is teporarily disabled + try { + // Calculation of Balance Field Length + myRuntimeInfo->out << " -> Calculation of BLFL" << std::endl; + abstractTakeOffPerformancePt->calcBLFL(mySettingsPt->myField.runwaySlope, + myAcftPt->frictionCoefficient, + myAcftPt->brakingCoefficient, + mySettingsPt->myField.headWind); + mySettingsPt->check_sucessfully_executed.doBLFLPerformance = true; + } catch (const int& errorCode) { + mySettingsPt->check_sucessfully_executed.doBLFLPerformance = false; + myRuntimeInfo->out << "Error in balanced field length calculation. See logLevel=2 (Info) for more details." << std::endl; + } } @@ -220,15 +229,16 @@ try { } /* Vn-Diagram */ -try { - myRuntimeInfo->out << " -> V-n Diagram" << std::endl; - abstractVnDiagramPt->doVnDiagram(); - mySettingsPt->check_sucessfully_executed.doVnDiagram = true; -} catch (const int& errorCode) { - mySettingsPt->check_sucessfully_executed.doVnDiagram = false; // Prevents generation of plots with nonexisting data - myRuntimeInfo->out << "Error in Vn diagram calculation. See logLevel=2 (Info) for more details." << std::endl; +if (false) { // Vn-Diagram is teporarily disabled + try { + myRuntimeInfo->out << " -> V-n Diagram" << std::endl; + abstractVnDiagramPt->doVnDiagram(); + mySettingsPt->check_sucessfully_executed.doVnDiagram = true; + } catch (const int& errorCode) { + mySettingsPt->check_sucessfully_executed.doVnDiagram = false; // Prevents generation of plots with nonexisting data + myRuntimeInfo->out << "Error in Vn diagram calculation. See logLevel=2 (Info) for more details." << std::endl; + } } - } // end of run() void performance_assessment_factory::update() { diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp index 36b4cf43..f2d4a20d 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp @@ -332,6 +332,7 @@ void performance_assessment_output::writeXmlOutput() { span_limit.update(rtIO->acxml); Endnode<bool> span_limit_checked(subPath + "/span_limit/checked", "Indicates if the value has been checked against the requirement."); span_limit_checked.set_value(true); + span_limit_checked.update(rtIO->acxml); // Certification subPath = "aircraft_exchange_file/requirement_compliance/certification"; @@ -392,6 +393,8 @@ void performance_assessment_output::generatePlotData() { } if (mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance == true) { generateFlightEnvelopeData(); + } + if (mySettingsPt->check_sucessfully_executed.doSARCalculation == true) { generateSARPlotData(); generate_best_SAR_Data(); } @@ -762,6 +765,8 @@ void performance_assessment_output::generatePlots() { } if (mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance == true) { generate_plot_flight_envelope(); + } + if (mySettingsPt->check_sucessfully_executed.doSARCalculation == true) { generate_plot_SAR_performance(); } if (mySettingsPt->check_sucessfully_executed.doTOPerformance == true) { diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp index cfecfd1c..3b2c4c6f 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.cpp @@ -33,24 +33,31 @@ performance_assessment_settings::performance_assessment_settings(const std::shar .read(rtIO->moduleConfig).value(); myField.headWind = EndnodeReadOnly<double>("/module_configuration_file/program_settings/constants_for_performance_checks/field_performance/head_wind") .read(rtIO->moduleConfig).value(); - /* Constants for the Representation of the Vn Diagram */ - myVnDiagramConstants.maxNClean = EndnodeReadOnly<double>("/module_configuration_file/program_settings/constants_for_performance_checks/vn_diagram/max_n_clean") - .read(rtIO->moduleConfig).value(); - myVnDiagramConstants.minNClean = EndnodeReadOnly<double>("/module_configuration_file/program_settings/constants_for_performance_checks/vn_diagram/min_n_clean") - .read(rtIO->moduleConfig).value(); - myVnDiagramConstants.maxNFlaps = EndnodeReadOnly<double>("/module_configuration_file/program_settings/constants_for_performance_checks/vn_diagram/max_n_flaps") - .read(rtIO->moduleConfig).value(); - myVnDiagramConstants.minNFlaps = EndnodeReadOnly<double>("/module_configuration_file/program_settings/constants_for_performance_checks/vn_diagram/min_n_flaps") - .read(rtIO->moduleConfig).value(); + + if (false) { // Vn-Diagram is temporarily disabled + /* Constants for the Representation of the Vn Diagram */ + myVnDiagramConstants.maxNClean = EndnodeReadOnly<double>("/module_configuration_file/program_settings/constants_for_performance_checks/vn_diagram/max_n_clean") + .read(rtIO->moduleConfig).value(); + myVnDiagramConstants.minNClean = EndnodeReadOnly<double>("/module_configuration_file/program_settings/constants_for_performance_checks/vn_diagram/min_n_clean") + .read(rtIO->moduleConfig).value(); + myVnDiagramConstants.maxNFlaps = EndnodeReadOnly<double>("/module_configuration_file/program_settings/constants_for_performance_checks/vn_diagram/max_n_flaps") + .read(rtIO->moduleConfig).value(); + myVnDiagramConstants.minNFlaps = EndnodeReadOnly<double>("/module_configuration_file/program_settings/constants_for_performance_checks/vn_diagram/min_n_flaps") + .read(rtIO->moduleConfig).value(); + } + /* Engine Performance Settings */ - int nPerfSettings = rtIO->moduleConfig.getVector("/module_configuration_file/program_settings/constants_for_performance_checks/engine_performance/ratings/rating", 1).size(); - auto aVector = rtIO->moduleConfig.getVector("/module_configuration_file/program_settings/constants_for_performance_checks/engine_performance/ratings", 1); - for (int i = 0; i <= nPerfSettings - 1; i++) { - string tempRating = rtIO->moduleConfig.at("/module_configuration_file/program_settings/constants_for_performance_checks/engine_performance/ratings/rating@" - + num2Str(i+1)+"/value"); - enginePerformance.Rating.push_back(tempRating); + if (false) { // Engine performance is tremporarily disabled + int nPerfSettings = rtIO->moduleConfig.getVector("/module_configuration_file/program_settings/constants_for_performance_checks/engine_performance/ratings/rating", 1) + .size(); + auto aVector = rtIO->moduleConfig.getVector("/module_configuration_file/program_settings/constants_for_performance_checks/engine_performance/ratings", 1); + for (int i = 0; i <= nPerfSettings - 1; i++) { + string tempRating = rtIO->moduleConfig.at("/module_configuration_file/program_settings/constants_for_performance_checks/engine_performance/ratings/rating@" + + num2Str(i+1)+"/value"); + enginePerformance.Rating.push_back(tempRating); + } } - overwrite_initial_values = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/overwrite_initial_values") + overwrite_initial_values = EndnodeReadOnly<bool>("/module_configuration_file/program_settings/performance_checks/flight_envelope_performance/overwrite_initial_values", true) .read(rtIO->moduleConfig).value(); } diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h index ef05e607..bad1f0c9 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_settings.h @@ -44,16 +44,17 @@ class performance_assessment_settings { class switches { public: - bool doFuelPlanning; /**< Switch for fuel planning */ - bool doPayloadRange; /**< Switch for payload range diagram */ - bool doEnginePerformance; /**< Switch for engine performance calculation */ - bool doFlightEnvelopePerformance; /**< Switch for flight envelope calculation */ - bool overwriteInitialValues; /**< Switch if initial flight envelope values are overwritten */ - bool doClimbPerformance; /**< Switch for climb performance calculation */ - bool doTOPerformance; /**< Switch for estimating the take-off distance */ - bool doBLFLPerformance; /**< Switch for estimating the balanced field length */ - bool doLandingPerformance; /**< Switch for landing distance estimation */ - bool doVnDiagram; /**< "Switch for calculation of V-n diagram */ + bool doFuelPlanning = false; /**< Switch for fuel planning */ + bool doPayloadRange = false; /**< Switch for payload range diagram */ + bool doEnginePerformance = false; /**< Switch for engine performance calculation */ + bool doFlightEnvelopePerformance = false; /**< Switch for flight envelope calculation */ + bool doSARCalculation = false; + bool overwriteInitialValues = false; /**< Switch if initial flight envelope values are overwritten */ + bool doClimbPerformance = false; /**< Switch for climb performance calculation */ + bool doTOPerformance = false; /**< Switch for estimating the take-off distance */ + bool doBLFLPerformance = false; /**< Switch for estimating the balanced field length */ + bool doLandingPerformance = false; /**< Switch for landing distance estimation */ + bool doVnDiagram = false; /**< "Switch for calculation of V-n diagram */ }; switches check_sucessfully_executed; /**< Indicated if a performance check has been executed sucessfully */ bool overwrite_initial_values; /** Causes recalculation of dive speeds */ -- GitLab From 1c642a6adb2a97caedfe2ede6eafebb7dc2a1e76 Mon Sep 17 00:00:00 2001 From: philipphansmann <Philipp Hansmann> Date: Fri, 21 Feb 2025 11:24:14 +0100 Subject: [PATCH 16/19] fixed minor error in html report --- .../taw/defaultMethods/performance_assessment_output.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp index f2d4a20d..0434ed80 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp @@ -88,10 +88,13 @@ void performance_assessment_output::generateHtmlBody() { theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + "_balanced_field_length_performance.svg\">" << std::endl; } - /* Flight Envelope & SAR */ - if (mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance) { + /* SAR */ + if (mySettingsPt->check_sucessfully_executed.doSARCalculation == true) { theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + "_best_SAR.svg\">" << std::endl; + } + /* Flight Envelope & SAR */ + if (mySettingsPt->check_sucessfully_executed.doFlightEnvelopePerformance == true) { theReport.htmlReportStream() << "<img class=\"image-plot\" style=\"display: block; margin-bottom: 10px;\" src=\"" + relativePath(rtIO->getPlotDir(), rtIO->getReportDir()) + "/" + std::string(TOOL_NAME) + "_flight_envelope.svg\">" << std::endl; } -- GitLab From 3eb4d66630b362d8e7f08b0600dceee609cf90a6 Mon Sep 17 00:00:00 2001 From: philipphansmann <Philipp Hansmann> Date: Fri, 21 Feb 2025 14:39:39 +0100 Subject: [PATCH 17/19] fix for v1 being written in acxml even when not calculated --- .../defaultMethods/performance_assessment_output.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp index 0434ed80..21c65108 100644 --- a/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp +++ b/performance_assessment/src/taw/defaultMethods/performance_assessment_output.cpp @@ -184,12 +184,6 @@ void performance_assessment_output::writeXmlOutput() { vlof.set_boundaries(0, 400); vlof.set_unit("m/s"); vlof.update(rtIO->acxml); - Endnode<double> decision_speed(subPath + "/decision_speed", "Take off decision speed (V1)"); - decision_speed.set_value(abstractTakeOffPerformancePt->myBLFL.v1); - decision_speed.set_lower_boundary(0); - decision_speed.set_upper_boundary(200); - decision_speed.set_unit("m/s"); - decision_speed.update(rtIO->acxml); Endnode<double> v2(subPath + "/takeoff_safety_speed", "Take off safety speed (V2)"); v2.set_value(myAcftPt->v2(myAcftPt->MTOM, 0.0)); v2.set_boundaries(0, 200); @@ -224,6 +218,12 @@ void performance_assessment_output::writeXmlOutput() { BLFL.set_boundaries(0, 100000); BLFL.set_unit("m"); BLFL.update(rtIO->acxml); + Endnode<double> decision_speed(subPath + "/decision_speed", "Take off decision speed (V1)"); + decision_speed.set_value(abstractTakeOffPerformancePt->myBLFL.v1); + decision_speed.set_lower_boundary(0); + decision_speed.set_upper_boundary(200); + decision_speed.set_unit("m/s"); + decision_speed.update(rtIO->acxml); } /* Landing */ if (mySettingsPt->check_sucessfully_executed.doLandingPerformance == true) { -- GitLab From e259496b79614ab7a485da47676876e5c1f2445f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=BCltke?= <florian.schueltke@ilr.rwth-aachen.de> Date: Fri, 21 Feb 2025 23:07:43 +0100 Subject: [PATCH 18/19] Apply 1 suggestion(s) to 1 file(s) --- performance_assessment/performance_assessment_conf.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/performance_assessment/performance_assessment_conf.xml b/performance_assessment/performance_assessment_conf.xml index 14139630..457a1663 100644 --- a/performance_assessment/performance_assessment_conf.xml +++ b/performance_assessment/performance_assessment_conf.xml @@ -89,7 +89,7 @@ </field_performance> </constants_for_performance_checks> <modes description="other settings that influence different modes!"> - <use_study_mission_for_analysis description="Switch to use study mission for analysis; Switch: true(use missionStudy.xml) / false (use missionDesign.xml)"> + <use_study_mission_for_analysis description="Switch to use study mission for analysis; Switch: true(use missionStudy.xml) / false (use missionDesign.xml)"> <value>false</value> </use_study_mission_for_analysis> <mtom_design description="Switch for the redetermination of the MTOM; Switch: true (yes, e.g. DesignLoop) / false (no, e.g. only analysis)"> -- GitLab From 09f47f1f76dc6337d1fd07aedcac5db99d20571d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=BCltke?= <florian.schueltke@ilr.rwth-aachen.de> Date: Fri, 21 Feb 2025 23:07:49 +0100 Subject: [PATCH 19/19] Apply 1 suggestion(s) to 1 file(s) --- performance_assessment/performance_assessment_conf.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/performance_assessment/performance_assessment_conf.xml b/performance_assessment/performance_assessment_conf.xml index 457a1663..b26c90e0 100644 --- a/performance_assessment/performance_assessment_conf.xml +++ b/performance_assessment/performance_assessment_conf.xml @@ -68,7 +68,7 @@ </takeoff_performance> <landing_performance description="Estimation of the landing distance" > <fidelity_level description="Select the fidelity level of the calculation (options: low)"> - <value>low</value> + <value>low</value> </fidelity_level> </landing_performance> </performance_checks> -- GitLab