Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • tombrinkdenis/aircraft-design
  • unicado/aircraft-design
  • alfin.johny/aircraft-design
3 results
Select Git revision
Show changes
Commits on Source (4)
Showing
with 293 additions and 251 deletions
......@@ -105,7 +105,9 @@ void EnergyBased::operator()()
break;
}
}
Mattingly::constraint_analysis constraint_analysis_plotting = constraint_analysis_tool;
readMission mission_data(missionCSV);
assess_constraints(W_over_S_data, constraint_analysis_tool, mission_data, engine);
......@@ -141,9 +143,30 @@ void EnergyBased::operator()()
/* Plot the complete design chart with constraints, boundaries and design point*/
std::string plotting = this->configuration()->at("module_configuration_file/control_settings/plot_output/enable/value");
if (plotting == "true") {
WS_start = 50;
WS_end = 820;
WS_size = WS_end - WS_start + 1; // Range from 50 to 820, inclusive
std::vector<double> W_over_S_data(WS_size);
for (int i = 0; i < WS_size; ++i) {
W_over_S_data[i] = (WS_start + i) * 9.81;
}
this->constraint_list = {};
this->boundaries = {};
assess_constraints(W_over_S_data, constraint_analysis_plotting, mission_data, engine);
Simple_Analysis min_finder_2 = Simple_Analysis(this->constraint_list, this->aircraft_xml(), this->boundaries);
min_finder_2.find_dominant_curve();
ConstraintAnalysis_Plot ca_plot;
ca_plot.fill_infeasible_area(W_over_S_data, min_finder.dominant_thrust_to_weight, boundaries);
ca_plot.fill_infeasible_area(W_over_S_data, min_finder_2.dominant_thrust_to_weight, boundaries);
for (auto ca_case : this->constraint_list)
{
ca_plot.add_curve(ca_case.wing_loading, ca_case.thrust_to_weight, ca_case.constraint_case);
......
......@@ -159,12 +159,12 @@
<upper_boundary>1.0</upper_boundary>
</relative_time_passed>
</polar_switch_mission_point>
<glideslope_interception_distance description="Buffer distance to hit the glideslope exactly">
<glide_slope_interception_distance description="Buffer distance to hit the glide slope exactly">
<value>1000.</value>
<unit>m</unit>
<lower_boundary>0.0</lower_boundary>
<upper_boundary>1000000</upper_boundary>
</glideslope_interception_distance>
</glide_slope_interception_distance>
<use_breguet_estimation_in_cruise description="Switch to activate fuel estimation using Breguet range equation in mid fidelity methods. Switch: true (On) / false (Off)">
<value>false</value>
</use_breguet_estimation_in_cruise>
......
......@@ -70,9 +70,9 @@ FlightConditions::FlightConditions(std::vector<MissionFileDataHandler::MissionDa
/* Initialization of rate of climb */
ROC(0.),
/* Initialization of path angle parameters */
glidepath_angle(0.),
mean_glidepath_angle(0.),
end_glidepath_angle(0.),
glide_path_angle(0.),
mean_glide_path_angle(0.),
end_glide_path_angle(0.),
/* Initialization of acceleration factors */
acceleration(0.),
mean_acceleration(0.),
......@@ -114,37 +114,38 @@ void FlightConditions::update_operating_condition(const OperatingConditions& oc)
/* Set Initial flight conditions */
void FlightConditions::set_initial_flight_track() {
switch (this->mission_data->at(this->operating_condition->mission_step).mode) {
case ACCELERATE:
case FLCHANGE:
case FLCHANGESIMULATION: {
case ACCELERATE: {
this->ROC = this->mission_data->at(this->operating_condition->mission_step).ROC;
this->glidepath_angle = fabs(this->ROC) < 1.e-3 ? 0. : asin(this->ROC / this->TAS);
this->glide_path_angle = fabs(this->ROC) < 1.e-3 ? 0. : asin(this->ROC / this->TAS);
break;
}
case CLIMBCONSTCAS:
case CLIMBTOCRUISE:
case CLIMBTOSERVICECEILING:
case FlightConditions::DESCENT:
case FREEFLIGHT: { // use kinetic energy to climb/descent
this->glidepath_angle = asin((std::min(1., (this->thrust - this->drag) / this->aircraft_mass / G_FORCE)));
this->ROC = sin(this->glidepath_angle) * this->TAS;
case DESCENT:
case FLCHANGE:
case FLCHANGESIMULATION:
case FREEFLIGHT: { // use kinetic energy to climb/descend
this->glide_path_angle = asin((std::min(1., (this->thrust - this->drag) / this->aircraft_mass / G_FORCE)));
this->ROC = sin(this->glide_path_angle) * this->TAS;
// If highest possible ROC (all thrust used) is above maximum ROC, set to maximum ROC
if (this->mission_data->at(this->operating_condition->mission_step).ROC > 0.
&& this->ROC > this->mission_data->at(this->operating_condition->mission_step).ROC) {
this->ROC = this->mission_data->at(this->operating_condition->mission_step).ROC; //fix ROC for climb to maximum given climb rate
this->glidepath_angle = asin(this->ROC / this->TAS);
this->glide_path_angle = asin(this->ROC / this->TAS);
}
break;
}
case DECELERATE:
case APPROACH:
case LANDING: {
this->glidepath_angle = this->mission_data->at(this->operating_condition->mission_step).glidepath;
this->ROC = sin(this->glidepath_angle) * this->TAS;
this->glide_path_angle = this->mission_data->at(this->operating_condition->mission_step).glide_path;
this->ROC = sin(this->glide_path_angle) * this->TAS;
break;
}
default: //use kinetic energy to accelerate/decelerate
this->glidepath_angle = 0.;
this->ROC = sin(this->glidepath_angle) * this->TAS;
this->glide_path_angle = 0.;
this->ROC = sin(this->glide_path_angle) * this->TAS;
}
}
......@@ -167,8 +168,8 @@ void FlightConditions::set_initial_acceleration_factors(const double& braking_co
this->acceleration = 0.;
break;
default:
//according to Newton's law F = m * a. Acceleration force F_a = (Thrust - drag - m * sin(glidepath_angle) * g) = m * a
this->acceleration = (this->thrust - this->drag - this->aircraft_mass * sin(this->glidepath_angle) * G_FORCE) / this->aircraft_mass;
//according to Newton's law F = m * a. Acceleration force F_a = (Thrust - drag - m * sin(glide_path_angle) * g) = m * a
this->acceleration = (this->thrust - this->drag - this->aircraft_mass * sin(this->glide_path_angle) * G_FORCE) / this->aircraft_mass;
}
}
......@@ -187,7 +188,7 @@ void FlightConditions::set_initial_thrust() {
case CRUISECI:
case APPROACH:
case GSINTERCEPTION: {
double required_thrust(sin(this->glidepath_angle) * this->aircraft_mass * G_FORCE + this->aircraft_mass * this->acceleration + this->drag);
double required_thrust(sin(this->glide_path_angle) * this->aircraft_mass * G_FORCE + this->aircraft_mass * this->acceleration + this->drag);
/* Set engine rating to required thrust:
* if required thrust is smaller than idle thrust, the engine library throws engine_status = 3, which is caught here and the rating is then set to idle
* in the almost impossible case that in descent or cruise the required thrust exceeds maximum available thrust, the engine library throws engine_status = 2
......@@ -247,38 +248,38 @@ void FlightConditions::set_flight_track() {
case FLCHANGE:
case FLCHANGESIMULATION: { //constant ROC
this->ROC = this->mission_data->at(this->operating_condition->mission_step).ROC;
this->end_glidepath_angle = fabs(this->ROC) < 1.e-3 ? 0. : asin(this->ROC / this->end_TAS);
this->mean_glidepath_angle = (this->glidepath_angle + this->end_glidepath_angle) / 2.;
this->ROC = sin(this->mean_glidepath_angle) * (this->TAS + this->end_TAS) / 2.;
this->end_glide_path_angle = fabs(this->ROC) < 1.e-3 ? 0. : asin(this->ROC / this->end_TAS);
this->mean_glide_path_angle = (this->glide_path_angle + this->end_glide_path_angle) / 2.;
this->ROC = sin(this->mean_glide_path_angle) * (this->TAS + this->end_TAS) / 2.;
break;
}
case CLIMBCONSTCAS:
case CLIMBTOCRUISE:
case CLIMBTOSERVICECEILING:
case DESCENT:
case FREEFLIGHT: { // use kinetic energy to climb/descent
this->end_glidepath_angle = asin((std::min(1., (this->end_thrust - this->end_drag) / this->end_aircraft_mass / G_FORCE)));
this->ROC = sin(this->end_glidepath_angle) * this->end_TAS;
case FREEFLIGHT: { // use kinetic energy to climb/descend
this->end_glide_path_angle = asin((std::min(1., (this->end_thrust - this->end_drag) / this->end_aircraft_mass / G_FORCE)));
this->ROC = sin(this->end_glide_path_angle) * this->end_TAS;
if (this->mission_data->at(this->operating_condition->mission_step).ROC > 0.
&& this->ROC > this->mission_data->at(this->operating_condition->mission_step).ROC) {
this->ROC = this->mission_data->at(this->operating_condition->mission_step).ROC; //fix ROC for climb to maximum given climb rate
this->end_glidepath_angle = asin(this->ROC / this->end_TAS);
this->end_glide_path_angle = asin(this->ROC / this->end_TAS);
}
this->mean_glidepath_angle = (this->glidepath_angle + this->end_glidepath_angle) / 2.;
this->ROC = sin(this->mean_glidepath_angle) * (this->TAS + this->end_TAS) / 2.;
this->mean_glide_path_angle = (this->glide_path_angle + this->end_glide_path_angle) / 2.;
this->ROC = sin(this->mean_glide_path_angle) * (this->TAS + this->end_TAS) / 2.;
break;
}
case DECELERATE:
case APPROACH:
case LANDING: {
this->end_glidepath_angle = this->mission_data->at(this->operating_condition->mission_step).glidepath;
this->mean_glidepath_angle = (this->glidepath_angle + this->end_glidepath_angle) / 2.;
this->ROC = sin(this->mean_glidepath_angle) * (this->TAS + this->end_TAS) / 2.;
this->end_glide_path_angle = this->mission_data->at(this->operating_condition->mission_step).glide_path;
this->mean_glide_path_angle = (this->glide_path_angle + this->end_glide_path_angle) / 2.;
this->ROC = sin(this->mean_glide_path_angle) * (this->TAS + this->end_TAS) / 2.;
break;
}
default:
this->mean_glidepath_angle = (this->glidepath_angle + this->end_glidepath_angle) / 2.;
this->ROC = sin(this->mean_glidepath_angle) * (this->TAS + this->end_TAS) / 2.;
this->mean_glide_path_angle = (this->glide_path_angle + this->end_glide_path_angle) / 2.;
this->ROC = sin(this->mean_glide_path_angle) * (this->TAS + this->end_TAS) / 2.;
}
}
......@@ -294,13 +295,13 @@ void FlightConditions::set_acceleration_factors(const double& braking_coefficien
this->end_acceleration = this->get_ground_run_acceleration(this->end_thrust, this->end_drag, lift_force, this->end_aircraft_mass * G_FORCE,
minimum_acceleration, friction_coefficient);
} else {
// Acceleration according to Newton's law F = m * a. Acceleration force F_a = (Thrust - drag - m * sin(glidepath_angle) * g) = m * a
this->end_acceleration = (this->end_thrust - this->end_drag - this->end_aircraft_mass * sin(this->end_glidepath_angle) * G_FORCE) / this->end_aircraft_mass;
// Acceleration according to Newton's law F = m * a. Acceleration force F_a = (Thrust - drag - m * sin(glide_path_angle) * g) = m * a
this->end_acceleration = (this->end_thrust - this->end_drag - this->end_aircraft_mass * sin(this->end_glide_path_angle) * G_FORCE) / this->end_aircraft_mass;
}
if (accuracyCheck(this->mean_glidepath_angle, 0., ACCURACY_HIGH) || accuracyCheck(this->delta_h, 0., ACCURACY_HIGH)) {
if (accuracyCheck(this->mean_glide_path_angle, 0., ACCURACY_HIGH) || accuracyCheck(this->delta_h, 0., ACCURACY_HIGH)) {
this->mean_acceleration = (this->acceleration + this->end_acceleration) / 2.;
} else {
this->mean_acceleration = (pow(this->end_TAS, 2.) - pow(this->TAS, 2.)) / (2. * this->delta_h / sin(this->mean_glidepath_angle));
this->mean_acceleration = (pow(this->end_TAS, 2.) - pow(this->TAS, 2.)) / (2. * this->delta_h / sin(this->mean_glide_path_angle));
}
if (accuracyCheck(this->mean_acceleration, 0., ACCURACY_LOW)) { //set numerical instability to zero
this->mean_acceleration = 0.;
......@@ -308,7 +309,7 @@ void FlightConditions::set_acceleration_factors(const double& braking_coefficien
}
void FlightConditions::set_thrust() {
double required_thrust(sin(this->mean_glidepath_angle) * this->end_aircraft_mass * G_FORCE + this->end_aircraft_mass * this->mean_acceleration + this->end_drag);
double required_thrust(sin(this->mean_glide_path_angle) * this->end_aircraft_mass * G_FORCE + this->end_aircraft_mass * this->mean_acceleration + this->end_drag);
switch (this->mission_data->at(this->operating_condition->mission_step).mode) {
case CRUISE:
case CRUISECI:
......@@ -373,7 +374,7 @@ void FlightConditions::activate_spoilers() {
case CRUISECI:
case APPROACH:
case GSINTERCEPTION: {
if (!this->aero->useSpoiler((this->end_thrust - sin(this->mean_glidepath_angle) * this->end_aircraft_mass * G_FORCE -
if (!this->aero->useSpoiler((this->end_thrust - sin(this->mean_glide_path_angle) * this->end_aircraft_mass * G_FORCE -
this->end_aircraft_mass * this->mean_acceleration), &this->end_drag))
throwError(__FILE__, __func__, __LINE__, "drag too low to maintain requested flight state.");
myRuntimeInfo->info << "end_drag after spoiler: " << this->end_drag << std::endl;
......@@ -407,35 +408,35 @@ void FlightConditions::set_way_and_time() {
* --> in the end the flight path vector must be corrected by track angle to get the range back
* in general (from standstill): v = a * t; s = 1/2 * a * t^2
* here: end_TAS = TAS + mean_acceleration * delta_t; delta_x = TAS * delta_t + 1/2 * mean_acceleration * delta_t^2 (constant motion + accelerated motion)
* Climb/Descent: delta_x = delta_h / sin(mean_glidepath_angle) --> delta_t^2 + 2 * TAS / mean_acceleration - 2 * delta_h / sin(mean_glidepath_angle) / mean_acceleration = 0
* delta_t = -TAS / mean_acceleration +/- sqrt((TAS/mean_acceleration)^2 + 2 * delta_h / sin(mean_glidepath_angle) / mean_acceleration)
* mean_acceleration = (TAS_end^2 - TAS^2) / (2 * delta_h / sin(mean_glidepath_angle))
* Climb/Descent: delta_x = delta_h / sin(mean_glide_path_angle) --> delta_t^2 + 2 * TAS / mean_acceleration - 2 * delta_h / sin(mean_glide_path_angle) / mean_acceleration = 0
* delta_t = -TAS / mean_acceleration +/- sqrt((TAS/mean_acceleration)^2 + 2 * delta_h / sin(mean_glide_path_angle) / mean_acceleration)
* mean_acceleration = (TAS_end^2 - TAS^2) / (2 * delta_h / sin(mean_glide_path_angle))
*/
if (accuracyCheck(this->mean_acceleration, 0., 0.01)) { //constant motion
if (!accuracyCheck(this->TAS, 0., ACCURACY_LOW) && !accuracyCheck(this->mean_glidepath_angle, 0., ACCURACY_LOW)) {
this->delta_t = this->delta_h / sin(this->mean_glidepath_angle) / this->TAS;
if (!accuracyCheck(this->TAS, 0., ACCURACY_LOW) && !accuracyCheck(this->mean_glide_path_angle, 0., ACCURACY_LOW)) {
this->delta_t = this->delta_h / sin(this->mean_glide_path_angle) / this->TAS;
} else { // this condition is only met if CRUISE and, there, delta_x is preset
this->delta_t = this->delta_x / this->TAS;
}
} else if (!accuracyCheck(this->mean_acceleration, 0., ACCURACY_LOW)) {
if (accuracyCheck(this->mean_glidepath_angle, 0., ACCURACY_LOW)) { // horizontal acceleration
if (accuracyCheck(this->mean_glide_path_angle, 0., ACCURACY_LOW)) { // horizontal acceleration
this->delta_t = (this->end_TAS - this->TAS) / this->mean_acceleration;
} else if (this->mean_acceleration < 0.) { // deceleration in climb/descent
this->delta_t = -sqrt(pow(this->TAS / this->mean_acceleration, 2.) +
2. * this->delta_h / sin(this->mean_glidepath_angle) / this->mean_acceleration) - this->TAS / this->mean_acceleration;
2. * this->delta_h / sin(this->mean_glide_path_angle) / this->mean_acceleration) - this->TAS / this->mean_acceleration;
} else { // acceleration in climb/descent
this->delta_t = sqrt(pow(this->TAS / this->mean_acceleration, 2.) +
2. * this->delta_h / sin(this->mean_glidepath_angle) / this->mean_acceleration) - this->TAS / this->mean_acceleration;
2. * this->delta_h / sin(this->mean_glide_path_angle) / this->mean_acceleration) - this->TAS / this->mean_acceleration;
}
} else {
myRuntimeInfo->err << "TAS: " << this->TAS << std::endl;
myRuntimeInfo->err << "end_TAS: " << this->end_TAS << std::endl;
myRuntimeInfo->err << "mean_acceleration: " << this->mean_acceleration << std::endl;
myRuntimeInfo->err << "mean_glidepath_angle: " << this->mean_glidepath_angle << std::endl;
myRuntimeInfo->err << "mean_glide_path_angle: " << this->mean_glide_path_angle << std::endl;
myRuntimeInfo->err << "delta_h: " << this->delta_h << std::endl;
throwError(__FILE__, __func__, __LINE__, "BUG in program. Abort program.");
}
this->delta_x = this->TAS * this->delta_t + 0.5 * this->mean_acceleration * pow(this->delta_t, 2.); // s = v*t + 1/2*a*t^2 = constant motion + accelerated motion
/* Shift vector in ground distance direction */
this->delta_x *= cos(this->mean_glidepath_angle);
this->delta_x *= cos(this->mean_glide_path_angle);
}
......@@ -91,9 +91,9 @@ class FlightConditions {
double ROC; /**< Rate of climb [m/s] */
double glidepath_angle; /**< Path angle at the beginning of the segment [rad] */
double mean_glidepath_angle; /**< Mean path angle of the segment [rad] */
double end_glidepath_angle; /**< Path angle at the end of the segment [rad] */
double glide_path_angle; /**< Path angle at the beginning of the segment [rad] */
double mean_glide_path_angle; /**< Mean path angle of the segment [rad] */
double end_glide_path_angle; /**< Path angle at the end of the segment [rad] */
double acceleration; /**< Acceleration at the beginning of the segment [m/s^2] */
double mean_acceleration; /**< Mean acceleration of the segment [m/s^2] */
......@@ -149,7 +149,7 @@ class FlightConditions {
* \details the equations of constant and accelerated motion are used to get way and time values for the segment
*/
void set_way_and_time();
/** \brief Function sets initial segment values for glidepath_angle and ROC
/** \brief Function sets initial segment values for glide_path_angle and ROC
*/
void set_initial_flight_track();
/** \brief Function sets initial segment values for the acceleration factor
......@@ -181,7 +181,7 @@ class FlightConditions {
* \details the engine is set to a rating/spool speed
*/
void set_initial_thrust();
/** \brief Function sets values for end_glidepath_angle, mean_glidepath_angle, and ROC
/** \brief Function sets values for end_glide_path_angle, mean_glide_path_angle, and ROC
*/
void set_flight_track();
/** \brief Function sets a value for end_thrust
......
......@@ -73,10 +73,10 @@ void MissionFileDataHandler::read_departure_steps(const double& max_operating_sp
data.CAS = 0.; // End CAS [m/s]
data.mach = 0.; // Mach number
data.mach_switch = false;
data.glidepath = 0.; // Glide angle [rad]
data.glide_path = 0.; // Glide angle [rad]
data.rel_segment_length = 0.; // Flight route for cruise
data.auto_altitude_steps = 0.;
data.ground_distance = 0.;
data.auto_FL_optimum = false;
data.round_to_regular_FL = false;
data.CI = 0.; // Cost index [kg/min], scaled 0 to 999 according to Sperry/Honeywell [1]
......@@ -167,10 +167,9 @@ void MissionFileDataHandler::read_flight_steps(double* average_shaft_bleed, doub
data.CAS = 0.; // End CAS [m/s]
data.mach = 0.; // Mach number
data.mach_switch = false;
data.glidepath = 0.; // Glide angle [rad]
data.glide_path = 0.; // Glide angle [rad]
data.rel_segment_length = 0.; // Flight route for cruise
data.auto_altitude_steps = 0.;
data.ground_distance = 0.;
data.CI = 0.; // Cost index [kg/min], scaled 0 to 999 according to Sperry/Honeywell [1]
data.transfer_time = 0.;
data.transfer_rate = 0.;
......@@ -324,10 +323,9 @@ void MissionFileDataHandler::read_approach_steps(const double& max_operating_spe
data.CAS = 0.; // End CAS [m/s]
data.mach = 0.; // Mach number
data.mach_switch = false;
data.glidepath = 0.; // Glide angle [rad]
data.glide_path = 0.; // Glide angle [rad]
data.rel_segment_length = 0.; // Flight route for cruise
data.auto_altitude_steps = 0.;
data.ground_distance = 0.;
data.auto_FL_optimum = false;
data.round_to_regular_FL = false;
data.CI = 0.; // Cost index [kg/min], scaled 0 to 999 according to Sperry/Honeywell [1]
......@@ -370,12 +368,11 @@ void MissionFileDataHandler::read_approach_steps(const double& max_operating_spe
if (data.mode_name == "descend") { // Mode: descend
data.mode = FlightConditions::APPROACH;
data.altitude = EndnodeReadOnly<double>(subpath + num2Str(i) + "/altitude").read(mission_xml).value();
data.glidepath = EndnodeReadOnly<double>(subpath + num2Str(i) + "/glide_path").read(mission_xml).value();
data.glide_path = EndnodeReadOnly<double>(subpath + num2Str(i) + "/glide_path").read(mission_xml).value();
data.energy_carrier_id = descent_id;
} else if (data.mode_name == "change_speed") { // Mode: change speed
data.mode = FlightConditions::DECELERATE;
data.ground_distance = EndnodeReadOnly<double>(subpath + num2Str(i) + "/ground_distance").read(mission_xml).value();
data.glidepath = EndnodeReadOnly<double>(subpath + num2Str(i) + "/glide_path").read(mission_xml).value();
data.glide_path = EndnodeReadOnly<double>(subpath + num2Str(i) + "/glide_path").read(mission_xml).value();
data.CAS = EndnodeReadOnly<double>(subpath + num2Str(i) + "/calibrated_airspeed").read(mission_xml).value();
if (data.CAS > max_operating_speed) {
throwError(__FILE__, __func__, __LINE__,
......@@ -386,7 +383,7 @@ void MissionFileDataHandler::read_approach_steps(const double& max_operating_spe
} else if (data.mode_name == "landing") { // Mode: landing
data.mode = FlightConditions::LANDING;
data.altitude = EndnodeReadOnly<double>(subpath + num2Str(i) + "/altitude").read(mission_xml).value();
data.glidepath = EndnodeReadOnly<double>(subpath + num2Str(i) + "/glide_path").read(mission_xml).value();
data.glide_path = EndnodeReadOnly<double>(subpath + num2Str(i) + "/glide_path").read(mission_xml).value();
data.energy_carrier_id = landing_id;
} else if (data.mode_name == "level_glide_slope_interception") { // Mode: level glide slope interception
data.mode = FlightConditions::GSINTERCEPTION;
......
......@@ -71,9 +71,8 @@ class MissionFileDataHandler {
double CAS; /**< End CAS [m/s] */
double mach; /**< Mach number [-] */
bool mach_switch; /**< Switch for using Mach */
double glidepath; /**< Glide angle [rad] */
double glide_path; /**< Glide angle [rad] */
double rel_segment_length; /**< Relative segment length in cruise */
double ground_distance; /**< Ground distance [m] */
bool auto_FL_optimum; /**< Switch to auto select optimum flight level */
bool round_to_regular_FL; /**< Switch for rounding to regular flight level */
double auto_altitude_steps; /**< Altitude change for optimum altitude in cruise [ft] */
......
......@@ -146,7 +146,7 @@ double MultiEnginePropulsion::get_aircraft_fuelflow(const int& energy_carrier_id
// Loop through all propulsors running on that energy carrier
for (uint16_t i(0); i < this->propulsors[energy_carrier_id].size(); i++) {
// Trick: Propulsors with same engines have multiple IDs -> size() scales overall fuelflow acordingly
total_fuel_flow += this->propulsors[energy_carrier_id][i].engine.get_aircraft_fuelflow() * this->propulsors[energy_carrier_id][i].engine_id.size();
total_fuel_flow += this->propulsors[energy_carrier_id][i].engine.get_fuelflow() * this->propulsors[energy_carrier_id][i].engine_id.size();
}
return total_fuel_flow;
}
......
......@@ -224,7 +224,7 @@ void StandardMissionOutput::generate_mission_profile_data() {
<< my_mission_ptr->mission_profile.at(i).end_fuel_cg << "; ";
}
csvStream << my_mission_ptr->mission_profile.at(i).end_angle_of_attack << "; "
<< convertUnit(RADIAN, DEGREE, my_mission_ptr->mission_profile.at(i).end_glidepath_angle) << "; "
<< convertUnit(RADIAN, DEGREE, my_mission_ptr->mission_profile.at(i).end_glide_path_angle) << "; "
<< my_mission_ptr->mission_profile.at(i).end_stabilizer_incidence;
for (uint8_t k(0); k < my_mission_ptr->mission_profile.at(i).end_origin_polar[1].size(); ++k) {
csvStream << "; " << my_mission_ptr->mission_profile.at(i).end_origin_polar[1].at(k);
......
......@@ -190,8 +190,8 @@ StandardMission::StandardMission(const std::shared_ptr<RuntimeIO>& rtIO) :
step_height_cruise(0.),
cruise_profile_start(0),
cruise_profile_end(0),
top_of_climb_range("top_of_climb_range", "Flown range from takeoff to top of climb (= start of initial cruise altitude (ICA))", 0, "kg", 0, 500000),
top_of_descent_range("top_of_descent_range", "Flown range from takeoff to top of descent", 0, "kg", 0, 5000000),
top_of_climb_range("top_of_climb_range", "Flown range from takeoff to top of climb (= start of initial cruise altitude (ICA))", 0, "m", 0, 500000),
top_of_descent_range("top_of_descent_range", "Flown range from takeoff to top of descent", 0, "m", 0, 5000000),
descent_range(0.),
descent_range_next_FL(0.),
top_of_descent_altitude(0.),
......@@ -399,7 +399,7 @@ void StandardMission::run() {
break;
/* Mode: descend to approach */
case FlightConditions::DESCENT:
myRuntimeInfo->out << "Descent to 10.000 ft ... " << std::endl;
myRuntimeInfo->out << "Descend to 10.000 ft ... " << std::endl;
this->cruise_profile_end = this->mission_profile.size() - 1; // Set index
this->change_altitude_at_constant_speed(&oc, &fc, i);
break;
......@@ -424,7 +424,7 @@ void StandardMission::run() {
break;
/* Mode: glide slope interception */
case FlightConditions::GSINTERCEPTION:
this->glideslope_interception(&oc, &fc, i);
this->glide_slope_interception(&oc, &fc, i);
break;
/* Mode: climb (change flight level) with a constant calibrated airspeed or Mach number at a fixed rate of climb */
case FlightConditions::FLCHANGE:
......@@ -849,9 +849,9 @@ void StandardMission::requirements_mission_update() {
"design_approach_speed"
};
bool takeoff_check(EndnodeReadOnly<double>("requirements_and_specifications/requirements/top_level_aircraft_requirements/landing_field_length").read(rtIO->acxml).value() >
bool takeoff_check(EndnodeReadOnly<double>("requirements_and_specifications/requirements/top_level_aircraft_requirements/takeoff_distance").read(rtIO->acxml).value() >
EndnodeReadOnly<double>("assessment/takeoff/takeoff_distance_normal_safety").read(rtIO->acxml).value());
bool landing_check(EndnodeReadOnly<double>("requirements_and_specifications/requirements/top_level_aircraft_requirements/takeoff_distance").read(rtIO->acxml).value() >
bool landing_check(EndnodeReadOnly<double>("requirements_and_specifications/requirements/top_level_aircraft_requirements/landing_field_length").read(rtIO->acxml).value() >
EndnodeReadOnly<double>("assessment/landing/needed_runway_length").read(rtIO->acxml).value());
bool approach_check(approach_speed_required + ACCURACY_LOW >= // ACCURACY_LOW added to avoid floating point issues for equal values
EndnodeReadOnly<double>("assessment/performance/approach/approach_speed").read(rtIO->acxml).value());
......
......@@ -253,7 +253,7 @@ class StandardMission : public Strategy {
double end_L_over_D; /**< Lift over drag coefficient at the end of the segment [-] */
double end_specific_air_range; /**< Specific air range at the end of the segment [m/kg] */
std::string end_aero_config; /**< Aerodynamic configuration at the end of the segment */
double end_glidepath_angle; /**< Path angle at the end of the segment [deg] */
double end_glide_path_angle; /**< Path angle at the end of the segment [deg] */
double end_TAS; /**< True airspeed at the end of the segment [m/s] */
double end_mach; /**< Mach number at the end of the segment [-] */
double end_CAS; /**< Calibrated airspeed at the end of the segment [m/s] */
......@@ -459,7 +459,7 @@ class StandardMission : public Strategy {
* \param fc: pointer to a flight condition object
* \param a_mission_step: reference to a mission step [-]
* \param simulation_mode Constant reference to a switch if the function should run the estimation mode or the real mode; default is the real mode
* \return range_for_descent if simulation_mode is active, the needed range to descent to approach is returned [m]
* \return range_for_descent if simulation_mode is active, the needed range to descend to approach is returned [m]
*/
double calculate_climb_or_descent(OperatingConditions* oc, FlightConditions* fc,
const uint16_t& a_mission_step, const bool& simulation_mode = false);
......@@ -467,7 +467,7 @@ class StandardMission : public Strategy {
* \param last_segment_free_flight_switch Constant reference to a switch if the last mission segment is a free_flight segment
*/
void estimate_descent(const bool& last_segment_free_flight_switch);
/** \brief Function estimates the descend distance of the approach route
/** \brief Function estimates the descent distance of the approach route
* \param oc: reference to an operating condition object
* \param fc: reference to a flight condition object
* \param top_of_descent_mass: mass at top of descent [kg]
......@@ -485,21 +485,21 @@ class StandardMission : public Strategy {
*/
std::pair<double, double> iterate_descent(double* segmend_end_range, double* top_of_descent_aircraft_mass, const double& current_descent_distance,
const OperatingConditions& oc, const FlightConditions& fc, const uint16_t& a_mission_step);
/** \brief Function to calculate glideslope interception
/** \brief Function to calculate glide_slope interception
* \param oc: pointer to an operating condition object
* \param fc: pointer to a flight condition object
* \param a_mission_step: reference to a mission step [-]
* \param simulation_mode Constant reference to a switch if the function should run the estimation mode or the real mode; default is the real mode
* \return range_for_descent Needed range to descent to perform a glide slope landing [m]
* \return range_for_descent Needed range to descend to perform a glide slope landing [m]
*/
double glideslope_interception(OperatingConditions* oc, FlightConditions* fc, const uint16_t& a_mission_step,
double glide_slope_interception(OperatingConditions* oc, FlightConditions* fc, const uint16_t& a_mission_step,
const bool& simulation_mode = false);
/** \brief Function for landing
* \param oc: pointer to an operating condition object
* \param fc: pointer to a flight condition object
* \param a_mission_step: reference to a mission step [-]
* \param simulation_mode Constant reference to a switch if the function should run the estimation mode or the real mode; default is the real mode
* \return range_for_descentToTouchdown the needed range to descent from screen height (50ft) to touchdown is returned [m]
* \return range_for_descentToTouchdown the needed range to descend from screen height (50ft) to touchdown is returned [m]
*/
double landing(OperatingConditions* oc, FlightConditions* fc, const uint16_t& a_mission_step, const bool& simulation_mode = false);
/** \brief Function changes speed at constant rate of climb
......@@ -507,7 +507,7 @@ class StandardMission : public Strategy {
* \param fc: pointer to a flight condition object
* \param a_mission_step: reference to a mission step [-]
* \param simulation_mode Constant reference to a switch if the function should run the estimation mode or the real mode; default is the real mode
* \return range_for_descent if simulation_mode is active, the needed range to descent to approach is returned [m]
* \return range_for_descent if simulation_mode is active, the needed range to descend to approach is returned [m]
*/
double change_speed_at_constant_ROC(OperatingConditions* oc, FlightConditions* fc,
const uint16_t& a_mission_step, const bool& simulation_mode = false);
......@@ -517,7 +517,7 @@ class StandardMission : public Strategy {
* \param fc: pointer to a flight condition object
* \param a_mission_step: reference to a mission step [-]
* \param simulation_mode Constant reference to a switch if the function should run the estimation mode or the real mode; default is the real mode
* \return descentRange if simulation_mode is active, the needed range to descent to approach is returned [m]
* \return descent_range if simulation_mode is active, the needed range to descend to approach is returned [m]
*/
double change_altitude_at_constant_speed(OperatingConditions* oc, FlightConditions* fc,
const uint16_t& a_mission_step, const bool& simulation_mode = false);
......@@ -549,7 +549,7 @@ class StandardMission : public Strategy {
*/
void calculate_econ_cruise_speed(double* econ_mach_number, const double& altitude, const double CI,
const double& aircraft_mass, const std::string& config, const std::string& rating);
/** \brief Function simulates a flight level change.
/** \brief Function simulates a flight level change to check if it is possible
* \param fc: pointer to a flight conditions
* \param oc: constant reference to object of operating conditions
* \param altitude_change_step: altitude change within the step [m]
......@@ -595,7 +595,7 @@ class StandardMission : public Strategy {
*/
void set_segment_initial_conditions(FlightConditions* fc, const bool& use_mission_condition = true, const double& an_end_CL = NAN);
/** \brief Function sets initial segment iteration start values
* \details values for glidepath_angle, a, liftcoefficient, drag and thrust are set
* \details values for glide_path_angle, a, liftcoefficient, drag and thrust are set
* \param fc: pointer to a flight condition object
* \param an_end_CL constant reference to an end lift coefficient of the segment; if not preset, it is calculated from constant level flight [-]
*/
......@@ -653,13 +653,10 @@ class StandardMission : public Strategy {
/** \brief Function decides whether the flight level is changed.
* \param cruise_flight_condition: constant reference to object of cruise flight conditions
* \param next_FL_flight_condition: constant reference to object of flight level change flight conditions
* \param cost_index: reference to cost index [kg/min], scaled 0 to 999 according to Sperry/Honeywell [1]
* \param cruise_range: reference to the cruise range from reference mission point (end_range) to end of constant level cruise segment [m]
* \param cruise_fuel: reference to the cruise fuel used from reference mission point (end_range) to end of constant level cruise segment [kg]
* \return true or false [-]
*/
bool decide_FL_change(const FlightConditions& cruise_flight_condition, const FlightConditions& next_FL_flight_condition,
const double& cost_index, const double& cruise_range, const double& cruise_fuel);
bool decide_FL_change(const FlightConditions& cruise_flight_condition, const FlightConditions& next_FL_flight_condition, const double& cruise_range);
/** \brief Function calculates the optimum flight level
* \param optimum_altitude: pointer to altitude [m]
* \param mach: reference to a Mach number [-]
......@@ -825,10 +822,10 @@ class StandardMission : public Strategy {
inline double calculate_cost_function(const int &energy_carrier_id, const double &mach, const double &altitude,
const double &aircraft_mass, const std::string& config, const std::string &rating,
const double &bleed, const double &shaft_power, const double& cost_index) {
double theCostFunction;
theCostFunction = 1. / this->static_flight_specific_air_range(energy_carrier_id, mach, altitude, aircraft_mass, config, rating) +
double the_cost_function;
the_cost_function = 1. / this->static_flight_specific_air_range(energy_carrier_id, mach, altitude, aircraft_mass, config, rating) +
cost_index / convertUnit(MINUTE, SECOND, 1.) / convertUnit(MACH, TRUEAIRSPEED, altitude, this->atm, mach);
return theCostFunction;
return the_cost_function;
}
/** \brief Function to find number of elements having the same keywords in their names
* \param xml xml file
......