diff --git a/initial_sizing/src/bwb/BwbInitialSizingConfig.h b/initial_sizing/src/bwb/BwbInitialSizingConfig.h index 4385715b10da773e5a1def9d62c883a79405a561..ff6f7d8aa11b5218d185780135ae0030084de778 100644 --- a/initial_sizing/src/bwb/BwbInitialSizingConfig.h +++ b/initial_sizing/src/bwb/BwbInitialSizingConfig.h @@ -20,8 +20,8 @@ * This file is part of UNICADO. */ -#ifndef INITIALSIZING_SRC_BWB_BWBINITIALSIZINGCONFIG_H_ -#define INITIALSIZING_SRC_BWB_BWBINITIALSIZINGCONFIG_H_ +#ifndef INITIAL_SIZING_SRC_BWB_BWBINITIALSIZINGCONFIG_H_ +#define INITIAL_SIZING_SRC_BWB_BWBINITIALSIZINGCONFIG_H_ #include <string> #include <vector> @@ -36,19 +36,19 @@ */ class BwbInitialSizingConfig { public: - explicit BwbInitialSizingConfig(const node& config) {} + BwbInitialSizingConfig() {} void readAll(const node& config) { readProgramSettings(config); } - double wing_loading_user; /**< Wing loading set by the user to be used in design [kg/m^2] */ - double thrust_loading_user; /**< Thrust loading set by the user to be used in design [-] */ - double maximum_takeoff_mass_user; /**< Maximum takeoff mass set by the user to be used in design [kg] */ - double operating_mass_empty_user; /**< Operating mass empty set by the user to be used in design [kg] */ + double wing_loading_user = 0.; /**< Wing loading set by the user to be used in design [kg/m^2] */ + double thrust_loading_user = 0.; /**< Thrust loading set by the user to be used in design [-] */ + double maximum_takeoff_mass_user = 0.; /**< Maximum takeoff mass set by the user to be used in design [kg] */ + double operating_mass_empty_user = 0.; /**< Operating mass empty set by the user to be used in design [kg] */ private: void readProgramSettings(const node& config); }; -#endif // INITIALSIZING_SRC_BWB_BWBINITIALSIZINGCONFIG_H_ +#endif // INITIAL_SIZING_SRC_BWB_BWBINITIALSIZINGCONFIG_H_ diff --git a/initial_sizing/src/bwb/BwbInitialSizingIOData.cpp b/initial_sizing/src/bwb/BwbInitialSizingIOData.cpp index a720def02d5e6bac99bfe6ddfd393590a576c17b..4aff61694bb52e6574972be3fdcf294c4fbfdadc 100644 --- a/initial_sizing/src/bwb/BwbInitialSizingIOData.cpp +++ b/initial_sizing/src/bwb/BwbInitialSizingIOData.cpp @@ -38,7 +38,7 @@ BwbInitialSizingIOData::BwbInitialSizingIOData(std::shared_ptr<RuntimeIO> rtIO, aircraftType(EndnodeReadOnly<std::string>("aircraft_exchange_file/general/type").read(rtIO_->acxml).value()), aircraftModel(EndnodeReadOnly<std::string>("aircraft_exchange_file/general/model").read(rtIO_->acxml).value()), configFile(config), - configuration(BwbInitialSizingConfig(config)) { + configuration(BwbInitialSizingConfig()) { // Call readAll method here configuration.readAll(config); } diff --git a/initial_sizing/src/taw/TawInitialSizingConfig.cpp b/initial_sizing/src/taw/TawInitialSizingConfig.cpp index 9ba95498a6f7f92ec48f197f7903915f3ac8859f..734288db7af2861716d789765a547fb8d6c01c28 100644 --- a/initial_sizing/src/taw/TawInitialSizingConfig.cpp +++ b/initial_sizing/src/taw/TawInitialSizingConfig.cpp @@ -24,6 +24,7 @@ #include <algorithm> #include <aixml/node.h> #include <standardFiles/functions.h> +#include <string> /* Methods for reading program settings of config */ diff --git a/initial_sizing/src/taw/TawInitialSizingConfig.h b/initial_sizing/src/taw/TawInitialSizingConfig.h index 363359fddfa99e9fdf7e208ca61fb292f74c9c2c..e0eeee3ac5349155128acb31fa2c6b778ae27dfb 100644 --- a/initial_sizing/src/taw/TawInitialSizingConfig.h +++ b/initial_sizing/src/taw/TawInitialSizingConfig.h @@ -20,8 +20,8 @@ * This file is part of UNICADO. */ -#ifndef INITIALSIZING_SRC_TAW_TAWINITIALSIZINGCONFIG_H_ -#define INITIALSIZING_SRC_TAW_TAWINITIALSIZINGCONFIG_H_ +#ifndef INITIAL_SIZING_SRC_TAW_TAWINITIALSIZINGCONFIG_H_ +#define INITIAL_SIZING_SRC_TAW_TAWINITIALSIZINGCONFIG_H_ #include <string> #include <vector> @@ -36,7 +36,7 @@ */ class TawInitialSizingConfig { public: - explicit TawInitialSizingConfig(const node& config) {} + TawInitialSizingConfig() {} bool designCase = true;/**< Determine whether system architecture is also sized **/ double ff_warmup = 0.0; double ff_taxi = 0.0; @@ -66,10 +66,10 @@ class TawInitialSizingConfig { std::string theProgramName; /**< Name of intial sizing program depending on design or study case **/ - double wing_loading_user; /**< Wing loading set by the user to be used in design [kg/m^2] */ - double thrust_loading_user; /**< Thrust loading set by the user to be used in design [-] */ - double maximum_takeoff_mass_user; /**< Maximum takeoff mass set by the user to be used in design [kg] */ - double operating_mass_empty_user; /**< Operating mass empty set by the user to be used in design [kg] */ + double wing_loading_user = 0.; /**< Wing loading set by the user to be used in design [kg/m^2] */ + double thrust_loading_user = 0.; /**< Thrust loading set by the user to be used in design [-] */ + double maximum_takeoff_mass_user = 0.; /**< Maximum takeoff mass set by the user to be used in design [kg] */ + double operating_mass_empty_user = 0.; /**< Operating mass empty set by the user to be used in design [kg] */ void readAll(const node& config) { readProgramSettings(config); @@ -79,4 +79,4 @@ class TawInitialSizingConfig { void readProgramSettings(const node& config); }; -#endif // INITIALSIZING_SRC_TAW_TAWINITIALSIZINGCONFIG_H_ +#endif // INITIAL_SIZING_SRC_TAW_TAWINITIALSIZINGCONFIG_H_ diff --git a/initial_sizing/src/taw/TawInitialSizingIOData.cpp b/initial_sizing/src/taw/TawInitialSizingIOData.cpp index fc515b4683132a54462e304e638a634b62c6ca7a..04817003d677009bfba20e69a791c6c809a32280 100644 --- a/initial_sizing/src/taw/TawInitialSizingIOData.cpp +++ b/initial_sizing/src/taw/TawInitialSizingIOData.cpp @@ -37,8 +37,8 @@ TawInitialSizingIOData::TawInitialSizingIOData(std::shared_ptr<RuntimeIO> rtIO, rtIO_(rtIO), aircraftType(EndnodeReadOnly<std::string>("aircraft_exchange_file/general/type").read(rtIO_->acxml).value()), aircraftModel(EndnodeReadOnly<std::string>("aircraft_exchange_file/general/model").read(rtIO_->acxml).value()), - configuration(TawInitialSizingConfig(config)), - configFile(config) { + configFile(config), + configuration(TawInitialSizingConfig()) { // Call readAll method here configuration.readAll(config); } @@ -47,28 +47,56 @@ TawInitialSizingIOData::TawInitialSizingIOData(std::shared_ptr<RuntimeIO> rtIO, void TawInitialSizingIOData::readAccomodation(const node& acxml) { - data.Accommodation.numberPassengers = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/design_specification/transport_task/passenger_definition/total_number_passengers").read(acxml).value(); - data.Accommodation.massPassenger = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/design_specification/transport_task/passenger_definition/mass_per_passenger").read(acxml).value(); - data.Accommodation.massLuggage = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/design_specification/transport_task/passenger_definition/luggage_mass_per_passenger").read(acxml).value(); - data.Accommodation.massCargo = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/design_specification/transport_task/cargo_definition/additional_cargo_mass").read(acxml).value(); + data.Accommodation.numberPassengers = + EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/design_specification/transport_task/passenger_definition/total_number_passengers") + .read(acxml).value(); + data.Accommodation.massPassenger = + EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/design_specification/transport_task/passenger_definition/mass_per_passenger") + .read(acxml).value(); + data.Accommodation.massLuggage = + EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/design_specification/transport_task/passenger_definition/luggage_mass_per_passenger") + .read(acxml).value(); + data.Accommodation.massCargo = + EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/design_specification/transport_task/cargo_definition/additional_cargo_mass") + .read(acxml).value(); } void TawInitialSizingIOData::readMissionInfo(const node& acxml) { - data.MissionInfo.range = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/design_mission/range").read(acxml).value(); - data.MissionInfo.contingency = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/design_mission/contingency").read(acxml).value(); - data.MissionInfo.distalt = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/design_mission/alt_dist").read(acxml).value(); - data.MissionInfo.loitertime = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/design_mission/loiter_time").read(acxml).value(); - data.MissionInfo.vApproach = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/flight_envelope/maximum_approach_speed").read(acxml).value(); - data.MissionInfo.sTOFL = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/takeoff_distance").read(acxml).value(); - data.MissionInfo.machNumber = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/design_mission/initial_cruise_mach_number").read(acxml).value(); - data.MissionInfo.altitude = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/design_mission/initial_cruise_altitude").read(acxml).value(); - data.MissionInfo.Gamma = EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/flight_envelope/climb_or_descent_segment_gradient").read(acxml).value(); + data.MissionInfo.range = + EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/design_mission/range") + .read(acxml).value(); + data.MissionInfo.contingency = + EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/design_mission/contingency") + .read(acxml).value(); + data.MissionInfo.distalt = + EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/design_mission/alt_dist") + .read(acxml).value(); + data.MissionInfo.loitertime = + EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/design_mission/loiter_time") + .read(acxml).value(); + data.MissionInfo.vApproach = + EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/flight_envelope/maximum_approach_speed") + .read(acxml).value(); + data.MissionInfo.sTOFL = + EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/takeoff_distance") + .read(acxml).value(); + data.MissionInfo.machNumber = + EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/design_mission/initial_cruise_mach_number") + .read(acxml).value(); + data.MissionInfo.altitude = + EndnodeReadOnly<double>("/aircraft_exchange_file/requirements_and_specifications/design_mission/initial_cruise_altitude") + .read(acxml).value(); + data.MissionInfo.Gamma = + EndnodeReadOnly<double> + ("/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/flight_envelope/climb_or_descent_segment_gradient") + .read(acxml).value(); } void TawInitialSizingIOData::readEnergyCarrier(const node& acxml) { - data.EnergyCarrier.energyCarrier = EndnodeReadOnly<std::string>("/aircraft_exchange_file/requirements_and_specifications/design_specification/energy_carriers/energy_carrier/type").read(acxml).value(); + data.EnergyCarrier.energyCarrier = + EndnodeReadOnly<std::string>("/aircraft_exchange_file/requirements_and_specifications/design_specification/energy_carriers/energy_carrier/type").read(acxml).value(); } void TawInitialSizingIOData::updateMTOM(double mo_iteration) { @@ -87,7 +115,7 @@ void TawInitialSizingIOData::updateMTOM(double mo_iteration) { // Inertia std::string inertiaPath = basePath + "/inertia"; - + if (!(rtIO_->acxml.find(inertiaPath))) { rtIO_->acxml[inertiaPath]; } @@ -131,7 +159,7 @@ void TawInitialSizingIOData::updateMTOM(double mo_iteration) { // Center of Gravity std::string cogPath = basePath + "/center_of_gravity"; - + if (!(rtIO_->acxml.find(cogPath))) { rtIO_->acxml[cogPath]; } @@ -163,7 +191,7 @@ void TawInitialSizingIOData::updateOME(double final_mass_estimation) { // Inertia std::string inertiaPath = basePath + "/inertia"; - + if (!(rtIO_->acxml.find(inertiaPath))) { rtIO_->acxml[inertiaPath]; } @@ -207,7 +235,7 @@ void TawInitialSizingIOData::updateOME(double final_mass_estimation) { // Center of Gravity std::string cogPath = basePath + "/center_of_gravity"; - + if (!(rtIO_->acxml.find(cogPath))) { rtIO_->acxml[cogPath]; } @@ -261,7 +289,8 @@ void TawInitialSizingIOData::setGlobalReferencePoint() { std::string referenceComponent = (ACconfiguration == "tube_and_wing") ? "fuselage" : "wing"; // Create Endnode for reference_component - Endnode<std::string> refCompNode = data.create_endnode<std::string>(referenceComponent, componentDesignPath + "/reference_component", "Global reference point of aircraft geometry"); + Endnode<std::string> refCompNode = + data.create_endnode<std::string>(referenceComponent, componentDesignPath + "/reference_component", "Global reference point of aircraft geometry"); refCompNode.update(rtIO_->acxml); // Create Endnode for x coordinate diff --git a/initial_sizing/src/taw/analytical/TawAnalytical.cpp b/initial_sizing/src/taw/analytical/TawAnalytical.cpp index 12f2a31e6c67226dc2fc0e2572b50f42ce98009d..d2290cbd3f92360e6f2a0f676aa215b6c8c8ca52 100644 --- a/initial_sizing/src/taw/analytical/TawAnalytical.cpp +++ b/initial_sizing/src/taw/analytical/TawAnalytical.cpp @@ -24,6 +24,9 @@ #include <cmath> #include <memory> #include <string> +#include <algorithm> +#include <utility> +#include <vector> #include "TawAnalytical.h" #include "../TawInitialSizingIOData.h" #include "../TawInitialSizingData.h" @@ -80,7 +83,7 @@ void TawAnalytical::save() { void TawAnalytical::size() { myRuntimeInfo->out << "Start calculation ..." << std::endl; - + myRuntimeInfo->out << "Calculating payload ..." << std::endl; calculatePayloadAndCrew(); @@ -99,7 +102,7 @@ void TawAnalytical::size() { calculateCruise(); calculateLanding(); - + findIntersectionPoints_LTO(); findIntersectionPoints_CL(); @@ -107,7 +110,7 @@ void TawAnalytical::size() { findIntersectionPoints_CR(); findIntersectionPoints_CT(); - + findIntersectionPoints_TC(); getoptiCL(); @@ -122,7 +125,6 @@ void TawAnalytical::size() { findDesignPoint(); myRuntimeInfo->out << "... calculation finished!" << std::endl; - } @@ -139,9 +141,9 @@ void TawAnalytical::calculatePayloadAndCrew() { cargoWeight = data_->data.Accommodation.massCargo; // The ratios (0/0/0/0.1/0.9) represent the relative passenger distribution for the classes - // The ratios (10/14/28/35/40) represent how many crew members are needed for every 10, 14, 28, 35, 40 passengers in each class. - - numPresidentCrew = std::ceil(data_->data.Accommodation.numberPassengers * 0 / 10.0); + // The ratios (10/14/28/35/40) represent how many crew members are needed for every 10, 14, 28, 35, 40 passengers in each class. + + numPresidentCrew = std::ceil(data_->data.Accommodation.numberPassengers * 0 / 10.0); numFirstClassCrew = std::ceil(data_->data.Accommodation.numberPassengers * 0 / 14.0); numBusinessClassCrew = std::ceil(data_->data.Accommodation.numberPassengers * 0 / 28.0); numPremiumEconomyCrew = std::ceil(data_->data.Accommodation.numberPassengers * 0.1 / 35.0); @@ -154,13 +156,12 @@ void TawAnalytical::calculatePayloadAndCrew() { // Calculate total payload Payload = passengerWeight + cargoWeight; - + std::cout << "Passenger Weight: " << passengerWeight << std::endl; std::cout << "Crew Number: " << numCrew << std::endl; std::cout << "Crew Weight: " << crewWeight << std::endl; std::cout << "cargoWeight: " << cargoWeight << std::endl; std::cout << "Payload: " << Payload << std::endl; - } @@ -171,7 +172,7 @@ void TawAnalytical::calculateFuelFraction() { machNumber = data_->data.MissionInfo.machNumber; SFCKerosene = data_->configuration.SFCKerosene; LDInitialCruise = data_->configuration.LDInitialCruise; - LDInitialLoiter = data_->configuration.LDInitialLoiter; + LDInitialLoiter = data_->configuration.LDInitialLoiter; energyCarrier = data_->data.EnergyCarrier.energyCarrier; @@ -199,12 +200,12 @@ void TawAnalytical::calculateFuelFraction() { CruiseFuel = exp((-range * SFCKerosene) / (vCruise * LDInitialCruise)); distAlter = data_->data.MissionInfo.distalt; std::cout << "Alternate Distance: " << distAlter << std::endl; - AltFuel = exp((-distAlter * SFCKerosene) / (vCruise * LDInitialCruise)); + AltFuel = exp((-distAlter * SFCKerosene) / (vCruise * LDInitialCruise)); timeLoiter = data_->data.MissionInfo.loitertime; std::cout << "Loiter time: " << timeLoiter << std::endl; - LoiterFuel = exp((-timeLoiter * (0.85 * SFCKerosene)) / (LDInitialLoiter)); - + LoiterFuel = exp((-timeLoiter * (0.85 * SFCKerosene)) / (LDInitialLoiter)); + // Calculate fuel fraction based on fuel type (0: kerosene, 1: liquid hydrogen) if (energyCarrier == "kerosene") { @@ -301,7 +302,6 @@ void TawAnalytical::calculateTakeoff() { takeoffDataWS.push_back(mo_S); takeoffDataTW.push_back(T_W_TO); } - } @@ -313,13 +313,12 @@ void TawAnalytical::calculateClimb() { double mc_mo = ff_warmup*ff_taxi*ff_takeoff; double CD_TO = CD0_clean + DeltaCD_HL + (std::pow(CLmaxTO, 2) / (PI * AR * e)); - double T_W_C = mc_mo * ((numberOfEngines / (numberOfEngines - 1.0)) * (Gamma + (CD_TO / CLmaxTO))); climbDataWS.clear(); climbDataTW.clear(); for (double mo_S = 100; mo_S <= 1000; mo_S += 0.5) { - double T_W_C = mc_mo * ((numberOfEngines / (numberOfEngines - 1.0)) * (Gamma + (CD_TO / CLmaxTO))); + double T_W_C = mc_mo * ((numberOfEngines / (numberOfEngines - 1.0)) * (Gamma + (CD_TO / CLmaxTO))); climbDataWS.push_back(mo_S); climbDataTW.push_back(T_W_C); } @@ -362,7 +361,7 @@ void TawAnalytical::calculateLanding() { landingDataWS.clear(); landingDataTW.clear(); - size_t size = cruiseDataTW.size(); + size_t size = cruiseDataTW.size(); for (size_t i = 0; i < size; ++i) { double moS_landing = ((std::pow(vApproach, 2))*densitySL*CLmaxL)/((std::pow(densitySL, 2))*2*g*(ml_mo)); @@ -373,7 +372,6 @@ void TawAnalytical::calculateLanding() { void TawAnalytical::findIntersectionPoints_LTO() { - // Iterate over the landing and takeoff data to find intersections for (size_t i = 0; i < landingDataWS.size() - 1; ++i) { double landingWS1 = landingDataWS[i]; @@ -405,7 +403,6 @@ void TawAnalytical::findIntersectionPoints_LTO() { void TawAnalytical::findIntersectionPoints_CL() { - // Iterate over the landing and climb data to find intersections for (size_t i = 0; i < landingDataWS.size() - 1; ++i) { double landingWS1 = landingDataWS[i]; @@ -468,7 +465,6 @@ void TawAnalytical::findIntersectionPoints_CR() { void TawAnalytical::findIntersectionPoints_CT() { - // Iterate over the climb and takeoff data to find intersections for (size_t i = 0; i < climbDataWS.size() - 1; ++i) { double climbWS1 = climbDataWS[i]; @@ -500,7 +496,6 @@ void TawAnalytical::findIntersectionPoints_CT() { void TawAnalytical::findIntersectionPoints_TC() { - // Iterate over the takeoff and cruise data to find intersections for (size_t i = 0; i < takeoffDataWS.size() - 1; ++i) { double takeoffWS1 = takeoffDataWS[i]; @@ -669,7 +664,7 @@ void TawAnalytical::findDesignPoint() { return 0.0; }; - // optimal CL data + // optimal CL data getoptiCL(); double TW_CL = findTW(intersectionPoints_CL); @@ -703,7 +698,7 @@ void TawAnalytical::findDesignPoint() { double TW_TC = findTW(intersectionPoints_TC); double ws_TC = findCorrespondingWS(intersectionPoints_TC, TW_TC); - // Determine the higher T/W between takeoff-climb and takeoff-cruise intersections to be + // Determine the higher T/W between takeoff-climb and takeoff-cruise intersections to be // interpolated with the highest point of T/W in takeoff-landing constraint double TW_temp = std::max(TW_CT, TW_TC); @@ -743,5 +738,4 @@ void TawAnalytical::findDesignPoint() { // Print the final design point WS and TW std::cout << "W/S: " << designWS_ << ", T/W: " << designTW_ << '\n'; std::cout << "Design Point Intersection: " << designPoint << '\n'; - } diff --git a/initial_sizing/src/taw/analytical/TawAnalytical.h b/initial_sizing/src/taw/analytical/TawAnalytical.h index 93d7c150b56588ecf52725cba7666c4fc77ff09d..7efde90189c1ad3786ac0e68d0404fc069d6df07 100644 --- a/initial_sizing/src/taw/analytical/TawAnalytical.h +++ b/initial_sizing/src/taw/analytical/TawAnalytical.h @@ -20,11 +20,13 @@ * This file is part of UNICADO. */ -#ifndef INITIALSIZING_SRC_TAW_ANALYTICAL_TAWANALYTICAL_H_ -#define INITIALSIZING_SRC_TAW_ANALYTICAL_TAWANALYTICAL_H_ +#ifndef INITIAL_SIZING_SRC_TAW_ANALYTICAL_TAWANALYTICAL_H_ +#define INITIAL_SIZING_SRC_TAW_ANALYTICAL_TAWANALYTICAL_H_ #include <memory> #include <vector> +#include <utility> +#include <string> #include <moduleBasics/strategySelector.h> #include <moduleBasics/report.h> #include <moduleBasics/plot.h> @@ -48,8 +50,8 @@ class TawAnalytical : public Strategy { void calculateFuelFraction(); void calculateMassEstimation(); bool checkConvergence(double mo_iteration, double mo_iteration_previous); - double final_mass_estimation_; // Member variable to store the final mass estimation - double mo_iteration_; + double final_mass_estimation_ = 0.; // Member variable to store the final mass estimation + double mo_iteration_ = 0.; void calculateCDO(); void calculateTakeoff(); void calculateClimb(); @@ -87,9 +89,8 @@ class TawAnalytical : public Strategy { std::vector<std::pair<double, double>> intersectionPoints_optiCL_Takeoff; - double designWS_; - double designTW_; - + double designWS_ = 0.; + double designTW_ = 0.; /* Reporting elements */ /** @@ -161,11 +162,10 @@ class TawAnalytical : public Strategy { double contingency = 0.; double CruiseFuel = 0.; double distAlter = 0.; - double AltFuel = 0.; + double AltFuel = 0.; double timeLoiter = 0.; - double LoiterFuel = 0.; + double LoiterFuel = 0.; double c_fuel = 0.; - }; -#endif // INITIALSIZING_SRC_TAW_ANALYTICAL_TAWANALYTICAL_H_ +#endif // INITIAL_SIZING_SRC_TAW_ANALYTICAL_TAWANALYTICAL_H_ diff --git a/initial_sizing/src/taw/analytical/TawAnalyticalPlot.cpp b/initial_sizing/src/taw/analytical/TawAnalyticalPlot.cpp index 6e564cd400cfc998178665a0d7b13113c2aa6cdd..6c33917bb30002a627ac5bae65d9453f4621db28 100644 --- a/initial_sizing/src/taw/analytical/TawAnalyticalPlot.cpp +++ b/initial_sizing/src/taw/analytical/TawAnalyticalPlot.cpp @@ -24,6 +24,8 @@ #include "../../toolinfo.h" #include <vector> #include <matplot/matplot.h> +#include <string> +#include <iostream> void TawAnalytical::generatePlotData() { diff --git a/initial_sizing/src/taw/analytical/TawAnalyticalReport.cpp b/initial_sizing/src/taw/analytical/TawAnalyticalReport.cpp index e9f69b78d80d46f44588d1b833b9026104f4dc31..4a6acae3b335ff5e080df8eb3a7d2814a698408c 100644 --- a/initial_sizing/src/taw/analytical/TawAnalyticalReport.cpp +++ b/initial_sizing/src/taw/analytical/TawAnalyticalReport.cpp @@ -23,6 +23,7 @@ #include "TawAnalytical.h" #include "../../toolinfo.h" #include <vector> +#include <string> void TawAnalytical::setHtmlBody() { report_.htmlReportStream() << "<div class=\"box data\">\n"; @@ -48,13 +49,13 @@ void TawAnalytical::setHtmlBody() { report_.htmlReportStream() << "Study Mode: " << "</h1>" << std::endl; report_.htmlReportStream() << "<td>The program was run in study mode.</td>" << std::endl << "<td>The masses were not redetermined!</td>" << std::endl; - } + } } void TawAnalytical::setTexBody() { if (data_->configuration.designCase == true) { - report_.texReportStream() + report_.texReportStream() << "\\section{Initial Sizing}" << std::endl << "\\begin{frame}" << std::endl << " \\frametitle{Initial Sizing ...}" << std::endl @@ -80,13 +81,14 @@ void TawAnalytical::setTexBody() { << " \\begin{minipage}{0.5\\textwidth}" << std::endl << " \\tiny" << std::endl << " \\def\\svgwidth{5 cm}" << std::endl - << " \\import{" + win2lin(relativePath(rtIO_->getPlotDir(), rtIO_->getReportDir())) + "}{" + data_->configuration.theProgramName + "_MassBreakdown_plot.pdf_tex}" << std::endl + << " \\import{" + win2lin(relativePath(rtIO_->getPlotDir(), rtIO_->getReportDir())) + "}{" + + data_->configuration.theProgramName + "_MassBreakdown_plot.pdf_tex}" << std::endl << " \\caption{\\footnotesize{Initial Sizing Plot}}" << std::endl << " \\end{minipage}" << std::endl << "\\end{figure}" << std::endl << "\\end{frame}" << std::endl; } else { - report_.texReportStream() + report_.texReportStream() << "\\begin{frame}" << std::endl << " \\frametitle{Study Mode}" << std::endl << std::endl @@ -95,7 +97,3 @@ void TawAnalytical::setTexBody() { << "\\end{frame}" << std::endl; } } - - - - diff --git a/initial_sizing/src/taw/database/data_interpolated/TawInitialSizingInt.cpp b/initial_sizing/src/taw/database/data_interpolated/TawInitialSizingInt.cpp index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9947cc1cc6edb76ea168e704b32b41094c267139 100644 --- a/initial_sizing/src/taw/database/data_interpolated/TawInitialSizingInt.cpp +++ b/initial_sizing/src/taw/database/data_interpolated/TawInitialSizingInt.cpp @@ -0,0 +1,23 @@ +/* + * 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 "TawInitialSizingInt.h" diff --git a/initial_sizing/src/taw/database/data_interpolated/TawInitialSizingInt.h b/initial_sizing/src/taw/database/data_interpolated/TawInitialSizingInt.h index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..db215b2f2bebb050cd8eef1febc4b356cdb3e352 100644 --- a/initial_sizing/src/taw/database/data_interpolated/TawInitialSizingInt.h +++ b/initial_sizing/src/taw/database/data_interpolated/TawInitialSizingInt.h @@ -0,0 +1,26 @@ +/* + * 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 INITIAL_SIZING_SRC_TAW_DATABASE_DATA_INTERPOLATED_TAWINITIALSIZINGINT_H_ +#define INITIAL_SIZING_SRC_TAW_DATABASE_DATA_INTERPOLATED_TAWINITIALSIZINGINT_H_ + +#endif // INITIAL_SIZING_SRC_TAW_DATABASE_DATA_INTERPOLATED_TAWINITIALSIZINGINT_H_ diff --git a/initial_sizing/src/taw/database/data_reference/TawInitialSizingRef.cpp b/initial_sizing/src/taw/database/data_reference/TawInitialSizingRef.cpp index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..18df670af4b9d47ccd915517e90cbd506fa68367 100644 --- a/initial_sizing/src/taw/database/data_reference/TawInitialSizingRef.cpp +++ b/initial_sizing/src/taw/database/data_reference/TawInitialSizingRef.cpp @@ -0,0 +1,23 @@ +/* + * 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 "TawInitialSizingRef.h" diff --git a/initial_sizing/src/taw/database/data_reference/TawInitialSizingRef.h b/initial_sizing/src/taw/database/data_reference/TawInitialSizingRef.h index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ef82a87de788574647fbc96175c5b6d6f8da5bec 100644 --- a/initial_sizing/src/taw/database/data_reference/TawInitialSizingRef.h +++ b/initial_sizing/src/taw/database/data_reference/TawInitialSizingRef.h @@ -0,0 +1,26 @@ +/* + * 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 INITIAL_SIZING_SRC_TAW_DATABASE_DATA_REFERENCE_TAWINITIALSIZINGREF_H_ +#define INITIAL_SIZING_SRC_TAW_DATABASE_DATA_REFERENCE_TAWINITIALSIZINGREF_H_ + +#endif // INITIAL_SIZING_SRC_TAW_DATABASE_DATA_REFERENCE_TAWINITIALSIZINGREF_H_