diff --git a/aerodynamic_analysis/src/methods/viscDragForTandem.cpp b/aerodynamic_analysis/src/methods/viscDragForTandem.cpp index 6974a1feff44f378257caac132ecc9171d4f870d..81ed5102ab5173d709abac7570ea1ea79b47499f 100644 --- a/aerodynamic_analysis/src/methods/viscDragForTandem.cpp +++ b/aerodynamic_analysis/src/methods/viscDragForTandem.cpp @@ -59,14 +59,14 @@ using std::vector; */ viscDragForTandemInitialization::viscDragForTandemInitialization() : - calculateWing(false), + calculateFrontWing(false), calculateFuselage(false), calculateVTP(false), calculateBackWing(false), calculateNacelles(false), calculateMisc(false), manualTransitionLocation(false), - transitionLocationWing(NAN), + transitionLocationFrontWing(NAN), transitionLocationBackWing(NAN), transitionLocationVTP(NAN), doCalibration(false), @@ -76,20 +76,20 @@ viscDragForTandemInitialization::viscDragForTandemInitialization() CDvisc_CDsum_lowMa(NAN), CDvisc_CLfact_lowMa(NAN), CDvisc_CLexp_lowMa(NAN), - jetEngine(false) { + jetEngine(false) { // TODO kayra: Tandem de nereye ve ne kadar koyacagimiz daha belli degil } viscDragForTandem::viscDragForTandem(const std::shared_ptr<RuntimeIO>& rtIO, const viscDragForTandemInitialization& viscDragInit) : // the following variables need to be initialized externally - calculateWing(viscDragInit.calculateWing), + calculateFrontWing(viscDragInit.calculateFrontWing), calculateFuselage(viscDragInit.calculateFuselage), calculateVTP(viscDragInit.calculateVTP), calculateBackWing(viscDragInit.calculateBackWing), calculateNacelles(viscDragInit.calculateNacelles), calculateMisc(viscDragInit.calculateMisc), manualTransitionLocation(viscDragInit.manualTransitionLocation), - transitionLocationWing(viscDragInit.transitionLocationWing), + transitionLocationFrontWing(viscDragInit.transitionLocationFrontWing), transitionLocationBackWing(viscDragInit.transitionLocationBackWing), transitionLocationVTP(viscDragInit.transitionLocationVTP), doCalibration(viscDragInit.doCalibration), @@ -100,14 +100,14 @@ viscDragForTandem::viscDragForTandem(const std::shared_ptr<RuntimeIO>& rtIO, con CDvisc_CLfact_lowMa(viscDragInit.CDvisc_CLfact_lowMa), CDvisc_CLexp_lowMa(viscDragInit.CDvisc_CLexp_lowMa), jetEngine(viscDragInit.jetEngine), - Sref_Wing(NAN), - Swet_Wing(NAN), - MAC_Wing(NAN), - avgTtoC_Wing(NAN), - mXtoC_Wing(NAN), - eta_ref_Wing(NAN), - phiAtmXtoC_Wing(NAN), - QC_Wing(NAN), + Sref_FrontWing(NAN), + Swet_FrontWing(NAN), + MAC_FrontWing(NAN), + avgTtoC_FrontWing(NAN), + mXtoC_FrontWing(NAN), + eta_ref_FrontWing(NAN), + phiAtmXtoC_FrontWing(NAN), + QC_FrontWing(NAN), Sref_BackWing(NAN), Swet_BackWing(NAN), MAC_BackWing(NAN), @@ -135,8 +135,8 @@ viscDragForTandem::viscDragForTandem(const std::shared_ptr<RuntimeIO>& rtIO, con maxHeightNacelles(NAN), QC_Nacelles(NAN), factorProtuberances(NAN) { - if (calculateWing) { - theAircraftComponents.myWing = viscDragInit.theWing; + if (calculateFrontWing) { + theAircraftComponents.myFrontWing = viscDragInit.theFrontWing; } if (calculateFuselage) { theAircraftComponents.myFuselage = viscDragInit.theFuselage; @@ -151,7 +151,7 @@ viscDragForTandem::viscDragForTandem(const std::shared_ptr<RuntimeIO>& rtIO, con theAircraftComponents.myVTP = viscDragInit.theVTP; } if (!manualTransitionLocation) { - transitionLocationWing = 0.0; + transitionLocationFrontWing = 0.0; transitionLocationBackWing = 0.0; transitionLocationVTP = 0.0; } @@ -159,32 +159,32 @@ viscDragForTandem::viscDragForTandem(const std::shared_ptr<RuntimeIO>& rtIO, con void viscDragForTandem::preprocessGeometry() { myRuntimeInfo->debug << "viscDragForTandem: preprocess the aircraft geometry" << endl; - if (calculateWing) { - Sref_Wing = geom2::measure::reference_area(theAircraftComponents.myWing); - Swet_Wing = geom2::measure::area(theAircraftComponents.myWing); - MAC_Wing = geom2::measure::mean_aerodynamic_chord(theAircraftComponents.myWing); - avgTtoC_Wing = getAverageTtoC(theAircraftComponents.myWing); - mXtoC_Wing = 0.5; // Assumption by Raymer for chordwise location of airfoil maximum thickness point for high-speed airfoils - eta_ref_Wing = 0.65; // Reference position used for local sweep <- cant find this value in the source - phiAtmXtoC_Wing = getLocalSweep(theAircraftComponents.myWing, eta_ref_Wing * getHalfSpan(theAircraftComponents.myWing), mXtoC_Wing, "RADIAN"); - QC_Wing = 1.; // Assumtion for high, mid, and well fitted low wing + if (calculateFrontWing) { + Sref_FrontWing = geom2::measure::reference_area(theAircraftComponents.myFrontWing); + Swet_FrontWing = geom2::measure::area(theAircraftComponents.myFrontWing); + MAC_FrontWing = geom2::measure::mean_aerodynamic_chord(theAircraftComponents.myFrontWing); + avgTtoC_FrontWing = getAverageTtoC(theAircraftComponents.myFrontWing); + mXtoC_FrontWing = 0.5; // Assumption by Raymer for chordwise location of airfoil maximum thickness point for high-speed airfoils + eta_ref_FrontWing = 0.65; // Reference position used for local sweep <- cant find this value in the source + phiAtmXtoC_FrontWing = getLocalSweep(theAircraftComponents.myFrontWing, eta_ref_FrontWing * getHalfSpan(theAircraftComponents.myFrontWing), mXtoC_FrontWing, "RADIAN"); + QC_FrontWing = 1.; // Assumtion for high, mid, and well fitted low wing /* // Wetted Surface if (!myAcftPt->theFuselage.empty()) { - wFuselage = myAcftPt->theFuselage.at(0).getLocalWidth(myAcftPt->theWing.at(i).referencePtx); - hFuselage = myAcftPt->theFuselage.at(0).getLocalHeight(myAcftPt->theWing.at(i).referencePtx); - zFuselage = myAcftPt->theFuselage.at(0).getLocalOffset(myAcftPt->theWing.at(i).referencePtx); + wFuselage = myAcftPt->theFuselage.at(0).getLocalWidth(myAcftPt->theFrontWing.at(i).referencePtx); + hFuselage = myAcftPt->theFuselage.at(0).getLocalHeight(myAcftPt->theFrontWing.at(i).referencePtx); + zFuselage = myAcftPt->theFuselage.at(0).getLocalOffset(myAcftPt->theFrontWing.at(i).referencePtx); } // Check if wing object is located in fuselage - if (myAcftPt->theWing.at(i).referencePtz < (zFuselage + hFuselage / 2) && - myAcftPt->theWing.at(i).referencePtz > (zFuselage - hFuselage / 2)) { // If tailplane Z-coordinate inside fuselage - Swet.push_back(myAcftPt->theWing.at(i).getWingSurface() - 2.*(wFuselage * myAcftPt->theWing.at(i).l_i_right)); + if (myAcftPt->theFrontWing.at(i).referencePtz < (zFuselage + hFuselage / 2) && + myAcftPt->theFrontWing.at(i).referencePtz > (zFuselage - hFuselage / 2)) { // If tailplane Z-coordinate inside fuselage + Swet.push_back(myAcftPt->theFrontWing.at(i).getWingSurface() - 2.*(wFuselage * myAcftPt->theFrontWing.at(i).l_i_right)); } else { - Swet.push_back(myAcftPt->theWing.at(i).getWingSurface()); + Swet.push_back(myAcftPt->theFrontWing.at(i).getWingSurface()); } */ } - if (calculateBackWing) { //TODO kayra: her türlü tandem icin yap bir tane, damit nutzer nicht verwirrt wird. + if (calculateBackWing) { Sref_BackWing = geom2::measure::reference_area(theAircraftComponents.myBackWing); Swet_BackWing = geom2::measure::area(theAircraftComponents.myBackWing); MAC_BackWing = geom2::measure::mean_aerodynamic_chord(theAircraftComponents.myBackWing); @@ -192,7 +192,7 @@ void viscDragForTandem::preprocessGeometry() { mXtoC_BackWing = 0.5; // Assumption by Raymer for chordwise location of airfoil maximum thickness point for high-speed airfoils BackWing //TODO: kayra eta_ref_BackWing = 0.65; // Reference position used for local sweep phiAtmXtoC_BackWing = getLocalSweep(theAircraftComponents.myBackWing, eta_ref_BackWing * getHalfSpan(theAircraftComponents.myBackWing), mXtoC_BackWing, "RADIAN"); - QC_BackWing = 1.04; // Form factor BackWing + QC_BackWing = 1.04; // Form factor BackWing TODO kayra: sorun var } if (calculateVTP) { Swet_VTP = geom2::measure::area(theAircraftComponents.myVTP); @@ -225,7 +225,7 @@ void viscDragForTandem::preprocessGeometry() { factorProtuberances = 0.07; } myRuntimeInfo->out << "Viscous drag calculation by Raymer successfully initialized for:" << endl; - if (calculateWing) + if (calculateFrontWing) myRuntimeInfo->out << " -FrontWing" << endl; if (calculateBackWing) myRuntimeInfo->out << " -BackWing" << endl; @@ -239,17 +239,17 @@ void viscDragForTandem::preprocessGeometry() { myRuntimeInfo->out << " -miscellaneous" << endl; } -std::vector<double> viscDragForTandem::calculateViscDrag(const Polar& aPolar, const double transitionLocationWing, +std::vector<double> viscDragForTandem::calculateViscDrag(const Polar& aPolar, const double transitionLocationFrontWing, const double transitionLocationBackWing, const double transitionLocationVTP) { // [Ray18] p. 280 ff. (pdf p. 294 ff.) - if (calculateWing == false) { + if (calculateFrontWing == false) { //TODO kayra:sadece bir tanesine bakiyor belki degistirebiliriz std::stringstream errorMsg; - errorMsg << "No wing in viscous drag raymer. Unable to calculate drag"; + errorMsg << "No front wing in viscous drag raymer. Unable to calculate drag"; throwError(__FILE__, __func__, __LINE__, errorMsg.str()); } - // vector with component order: 0 = Wing, 1 = BackWing, 2 = VTP, 3 = Fuselage, 4 = Nacelles, 5 = Miscellaneous + // vector with component order: 0 = FrontWing, 1 = BackWing, 2 = VTP, 3 = Fuselage, 4 = Nacelles, 5 = Miscellaneous vector <double> theComponentDrags; - theComponentDrags.push_back(calculateViscDragWing(aPolar, transitionLocationWing)); + theComponentDrags.push_back(calculateViscDragFrontWing(aPolar, transitionLocationFrontWing)); // calculate BackWing drag if switch is on if (calculateBackWing) { theComponentDrags.push_back(calculateViscDragBackWing(aPolar, transitionLocationBackWing)); @@ -293,7 +293,7 @@ std::vector<double> viscDragForTandem::calculateCorrectedViscDrag(const std::vec std::vector <double> correctedComponentDrags = componentDrags; if (doCalibration) { if (aMachNumber > 0.5) { - correctedComponentDrags.front() += CDvisc_CDsum + CDvisc_CLfact * pow(CL, CDvisc_CLexp); + correctedComponentDrags.front() += CDvisc_CDsum + CDvisc_CLfact * pow(CL, CDvisc_CLexp); //TODO kayra } else if (aMachNumber <= 0.5) { correctedComponentDrags.front() += CDvisc_CDsum_lowMa + CDvisc_CLfact_lowMa * pow(CL, CDvisc_CLexp_lowMa); } @@ -301,25 +301,25 @@ std::vector<double> viscDragForTandem::calculateCorrectedViscDrag(const std::vec return correctedComponentDrags; } -double viscDragForTandem::calculateViscDragWing(const Polar& aPolar, const double transitionLocationWing) { +double viscDragForTandem::calculateViscDragFrontWing(const Polar& aPolar, const double transitionLocationFrontWing) { // [Ray18] p. 280 ff. (pdf p. 294 ff.) - myRuntimeInfo->debug << " - Get viscous drag wing ..." << endl; - double CDvisc_Wing(0.); - double reynoldNumberWing = getReynoldsNumber(MAC_Wing, aPolar.altitude, aPolar.MachNumber); + myRuntimeInfo->debug << " - Get viscous drag front wing ..." << endl; + double CDvisc_FrontWing(0.); + double reynoldNumberFrontWing = getReynoldsNumber(MAC_FrontWing, aPolar.altitude, aPolar.MachNumber); double Cf; double Cflaminar; double FF; // Friction Coefficient (turbulent) for the wing - Cf = (getFrictionCoefficient(aPolar.MachNumber, reynoldNumberWing)); + Cf = (getFrictionCoefficient(aPolar.MachNumber, reynoldNumberFrontWing)); // Friction Coefficient (laminar) for the wing - Cflaminar = (1.328 / sqrt(reynoldNumberWing)); + Cflaminar = (1.328 / sqrt(reynoldNumberFrontWing)); // Form factor for the components (eq. 12.30) - FF = (1. + 0.6 / mXtoC_Wing * avgTtoC_Wing + 100.*pow(avgTtoC_Wing, 4.)) - * (1.34 * pow(aPolar.MachNumber, 0.18) * pow(cos(phiAtmXtoC_Wing), 0.28)); + FF = (1. + 0.6 / mXtoC_FrontWing * avgTtoC_FrontWing + 100.*pow(avgTtoC_FrontWing, 4.)) + * (1.34 * pow(aPolar.MachNumber, 0.18) * pow(cos(phiAtmXtoC_FrontWing), 0.28)); // fully turbulent for transitionLocation = 0.0 - CDvisc_Wing = (Cflaminar * transitionLocationWing + Cf * (1. - transitionLocationWing)) - * FF * QC_Wing * Swet_Wing / (Sref_Wing + Sref_BackWing); - return CDvisc_Wing; + CDvisc_FrontWing = (Cflaminar * transitionLocationFrontWing + Cf * (1. - transitionLocationFrontWing)) + * FF * QC_FrontWing * Swet_FrontWing / (Sref_FrontWing + Sref_BackWing); + return CDvisc_FrontWing; } double viscDragForTandem::calculateViscDragBackWing(const Polar& aPolar, const double transitionLocationBackWing) { @@ -338,7 +338,7 @@ double viscDragForTandem::calculateViscDragBackWing(const Polar& aPolar, const d FF = ((1. + 0.6 / mXtoC_BackWing * avgTtoC_BackWing + 100.*pow(avgTtoC_BackWing, 4.)) * (1.34 * pow(aPolar.MachNumber, 0.18) * pow(cos(phiAtmXtoC_BackWing), 0.28))); CDvisc_BackWing = (Cflaminar * transitionLocationBackWing + Cf * (1. - transitionLocationBackWing)) - * FF * QC_BackWing * Swet_BackWing / (Sref_Wing + Sref_BackWing); + * FF * QC_BackWing * Swet_BackWing / (Sref_FrontWing + Sref_BackWing); return CDvisc_BackWing; } @@ -358,7 +358,7 @@ double viscDragForTandem::calculateViscDragVTP(const Polar& aPolar, const double * (1.34 * pow(aPolar.MachNumber, 0.18) * pow(cos(phiAtmXtoC_VTP), 0.28)); // Store components CDvisc_VTP = (Cflaminar * transitionLocationVTP + Cf * (1. - transitionLocationVTP)) - * FF * QC_VTP * Swet_VTP / (Sref_Wing + Sref_BackWing); + * FF * QC_VTP * Swet_VTP / (Sref_FrontWing + Sref_BackWing); return CDvisc_VTP; } @@ -374,7 +374,7 @@ double viscDragForTandem::calculateViscDragFuselage(const Polar& aPolar) { // Form factor for fuselage double f_Fuselage = l_Fuselage / sqrt(maxHeightFuselage * maxWidthFuselage); FF = 1. + (60. / pow(f_Fuselage, 3.)) + (f_Fuselage / 400.); - CDvisc_Fuselage = Cf * FF * QC_Fuselage * Swet_Fuselage / (Sref_Wing + Sref_BackWing); + CDvisc_Fuselage = Cf * FF * QC_Fuselage * Swet_Fuselage / (Sref_FrontWing + Sref_BackWing); return CDvisc_Fuselage; } @@ -393,7 +393,7 @@ double viscDragForTandem::calculateViscDragNacelles(const Polar& aPolar) { double f_Nacelles = l_Nacelles / sqrt(maxHeightNacelles * maxWidthNacelles); FF = 1 + (0.35 / f_Nacelles); // Store components - CDvisc_Nacelles = theAircraftComponents.myNacelles.size() * Cf * FF * QC_Nacelles * Swet_Nacelles / (Sref_Wing + Sref_BackWing); + CDvisc_Nacelles = theAircraftComponents.myNacelles.size() * Cf * FF * QC_Nacelles * Swet_Nacelles / (Sref_FrontWing + Sref_BackWing); return CDvisc_Nacelles; } @@ -402,7 +402,7 @@ double viscDragForTandem::calculateViscDragMisc(const Polar& aPolar) { myRuntimeInfo->debug << " - Get viscous drag Miscellaneous ..." << endl; double CDvisc_misc = 0.0; if (calculateFuselage) { - CDvisc_misc = 3.83 * pow(fuselageUpsweepAngle, 2.5) * (PI * 0.5 * maxWidthFuselage * 0.5 * maxHeightFuselage) / (Sref_Wing + Sref_BackWing); + CDvisc_misc = 3.83 * pow(fuselageUpsweepAngle, 2.5) * (PI * 0.5 * maxWidthFuselage * 0.5 * maxHeightFuselage) / (Sref_FrontWing + Sref_BackWing); } return CDvisc_misc; } diff --git a/aerodynamic_analysis/src/methods/viscDragForTandem.h b/aerodynamic_analysis/src/methods/viscDragForTandem.h index 428701de37dd6da7fdae3815939898e09015992c..361cbc4cfa72d66413141b61adda93543ff30f87 100644 --- a/aerodynamic_analysis/src/methods/viscDragForTandem.h +++ b/aerodynamic_analysis/src/methods/viscDragForTandem.h @@ -31,7 +31,7 @@ class viscDragForTandemInitialization { public: // geometry switches - bool calculateWing; /**< calculate viscous drag of the wing switch */ + bool calculateFrontWing; /**< calculate viscous drag of the wing switch */ bool calculateFuselage; /**< calculate viscous drag of the fuselage switch */ bool calculateVTP; /**< calculate viscous drag of the VTP switch */ bool calculateBackWing; /**< calcualte viscous drag of the BackWing switch */ @@ -39,7 +39,7 @@ class viscDragForTandemInitialization { bool calculateMisc; /**< calculate miscellaneous drag switch */ // transition parameters bool manualTransitionLocation; /**< switch wether transition location is given manually or flow is considered turbulent over all surfaces */ - double transitionLocationWing; /**< relative chord position on wing, where the flow goes from laminar to turbulent [-] */ + double transitionLocationFrontWing; /**< relative chord position on wing, where the flow goes from laminar to turbulent [-] */ double transitionLocationBackWing; /**< relative chord position on BackWing, where the flow goes from laminar to turbulent [-] */ double transitionLocationVTP; /**< relative chord position on VTP, where the flow goes from laminar to turbulent [-] */ // calibration parameters @@ -53,7 +53,7 @@ class viscDragForTandemInitialization { // other bool jetEngine; /**< switch if aircraft flies with jet engines or propellers */ // geometry - geom2::MultisectionSurface<geom2::AirfoilSection> theWing; /**< geometry of the main wing */ + geom2::MultisectionSurface<geom2::AirfoilSection> theFrontWing; /**< geometry of the main wing */ geom2::MultisectionSurface<geom2::AirfoilSection> theBackWing; /**< geometry of the horzontal tail plane */ geom2::MultisectionSurface<geom2::AirfoilSection> theVTP; /**< geometry of the vertical tail plaine */ geom2::MultisectionSurface<geom2::PolygonSection> theFuselage; /**< geometry of the fuselage */ @@ -68,7 +68,7 @@ class viscDragForTandem { std::filesystem::path aircraftPath; std::string airfoilPath; // geometry switches - bool calculateWing; /**< calculate viscous drag of the wing switch */ + bool calculateFrontWing; /**< calculate viscous drag of the wing switch */ bool calculateFuselage; /**< calculate viscous drag of the fuselage switch */ bool calculateVTP; /**< calculate viscous drag of the VTP switch */ bool calculateBackWing; /**< calcualte viscous drag of the BackWing switch */ @@ -76,7 +76,7 @@ class viscDragForTandem { bool calculateMisc; /**< calculate miscellaneous drag switch */ // transition parameters bool manualTransitionLocation; - double transitionLocationWing; /**< relative chord position on wing, where the flow goes from laminar to turbulent [-] */ + double transitionLocationFrontWing; /**< relative chord position on wing, where the flow goes from laminar to turbulent [-] */ double transitionLocationBackWing; /**< relative chord position on BackWing, where the flow goes from laminar to turbulent [-] */ double transitionLocationVTP; /**< relative chord position on VTP, where the flow goes from laminar to turbulent [-] */ // calibration parameters @@ -91,7 +91,7 @@ class viscDragForTandem { bool jetEngine; /**< switch if aircraft flies with jet engines or propellers */ // geometry struct aircraftComponents { /**< struct which stores all possible aircraft geometry elements */ - geom2::MultisectionSurface<geom2::AirfoilSection> myWing; /**< geometry of the main wing */ + geom2::MultisectionSurface<geom2::AirfoilSection> myFrontWing; /**< geometry of the main wing */ geom2::MultisectionSurface<geom2::AirfoilSection> myBackWing; /**< geometry of the horzontal tail plane */ geom2::MultisectionSurface<geom2::AirfoilSection> myVTP; /**< geometry of the vertical tail plaine */ geom2::MultisectionSurface<geom2::PolygonSection> myFuselage; /**< geometry of the fuselage */ @@ -99,14 +99,14 @@ class viscDragForTandem { }; aircraftComponents theAircraftComponents; // geometry dependent wing parameters - double Sref_Wing; /**< Reference area of the wing [m^2] */ - double Swet_Wing; /**< Wetted area of the wing [m^2] */ - double MAC_Wing; /**< Mean aerodynamic chord of the wing [m] */ - double avgTtoC_Wing; /**< Average thickness to chord ratio of the wing [-] */ - double eta_ref_Wing; /**< Relative span position used for local sweep [-] */ - double phiAtmXtoC_Wing; /**< Local sweep at reference position [rad] */ - double mXtoC_Wing; /**< Chordwise location of airfoil maximum thickness point [-] */ - double QC_Wing; /**< Form factor wing [-] */ + double Sref_FrontWing; /**< Reference area of the wing [m^2] */ + double Swet_FrontWing; /**< Wetted area of the wing [m^2] */ + double MAC_FrontWing; /**< Mean aerodynamic chord of the wing [m] */ + double avgTtoC_FrontWing; /**< Average thickness to chord ratio of the wing [-] */ + double eta_ref_FrontWing; /**< Relative span position used for local sweep [-] */ + double phiAtmXtoC_FrontWing; /**< Local sweep at reference position [rad] */ + double mXtoC_FrontWing; /**< Chordwise location of airfoil maximum thickness point [-] */ + double QC_FrontWing; /**< Form factor wing [-] */ // geometry dependent BackWing parameters double Sref_BackWing; /**< Reference area of the back wing [m^2] */ double Swet_BackWing; /**< Wetted area of the BackWing [m^2] */ //TODO kayra: buradaki parametreleri de degistirmem lazim mi? @@ -143,11 +143,11 @@ class viscDragForTandem { // calculations /** \brief Overall function to calculate viscous drag * \param aPolar polar/flight condition for which the drag gets calculated - * \param transitionLocationWing relative transition location where the flow turns turbulent on the wing + * \param transitionLocationFrontWing relative transition location where the flow turns turbulent on the wing * \param transitionLocationBackWing relative transition location where the flow turns turbulent on the BackWing * \param transitionLocationVTP relative transition location where the flow turns turbulent on the VTP */ - std::vector <double> calculateViscDrag(const Polar& aPolar, const double transitionLocationWing, + std::vector <double> calculateViscDrag(const Polar& aPolar, const double transitionLocationFrontWing, const double transitionLocationBackWing, const double transitionLocationVTP); /** \brief Overall function to calculate viscous drag corrections * \param componentDrags vector of the component drags which need to be corrected @@ -157,9 +157,9 @@ class viscDragForTandem { std::vector <double> calculateCorrectedViscDrag(const std::vector <double>& componentDrags, const double aMachNumber, const double CL); /** \brief Function to calculate the wing component drag * \param aPolar polar/flight condition for which the drag gets calculated - * \param transitionLocationWing relative transition location where the flow turns turbulent on the wing + * \param transitionLocationFrontWing relative transition location where the flow turns turbulent on the wing */ - double calculateViscDragWing(const Polar& aPolar, const double transitionLocationWing); + double calculateViscDragFrontWing(const Polar& aPolar, const double transitionLocationFrontWing); /** \brief Function to calculate the BackWing component drag * \param aPolar polar/flight condition for which the drag gets calculated * \param transitionLocationBackWing relative transition location where the flow turns turbulent on the BackWing diff --git a/aerodynamic_analysis/src/tandem/tandemCalculatePolarConfig.cpp b/aerodynamic_analysis/src/tandem/tandemCalculatePolarConfig.cpp index b64f1d82d22562df13618198d9381592fa75e9fe..3c4223d08e4d2468ffa54a6f941497f8575739e2 100644 --- a/aerodynamic_analysis/src/tandem/tandemCalculatePolarConfig.cpp +++ b/aerodynamic_analysis/src/tandem/tandemCalculatePolarConfig.cpp @@ -60,7 +60,7 @@ tandemCalculatePolarConfig::tandemCalculatePolarConfig(const node& config) factorIndDragCleanPolar(EndnodeReadOnly<double>("LiftingLineForTAW/InducedDragCorrection/factorIndDragCleanPolar")), // visc drag raymer transition parameters manualTransition(EndnodeReadOnly<bool>("program_settings/ViscDragRaymer/ManualTransition")), - manualTransitionWing(EndnodeReadOnly<double>("program_settings/ViscDragRaymer/TransitionLocationWing")), + manualTransitionFrontWing(EndnodeReadOnly<double>("program_settings/ViscDragRaymer/TransitionLocationWing")), manualTransitionBackWing(EndnodeReadOnly<double>("program_settings/ViscDragRaymer/TransitionLocationStabilizer")), //TODO kayra:bunu stab mi wing mi yapayim sor manualTransitionFin(EndnodeReadOnly<double>("program_settings/ViscDragRaymer/TransitionLocationFin")), // visc drag raymer calibration parameters @@ -104,7 +104,7 @@ tandemCalculatePolarConfig::tandemCalculatePolarConfig(const node& config) numberFlightConditions.read(config); pathToLiftingLine.read(config); manualTransition.read(config); - manualTransitionWing.read(config); + manualTransitionFrontWing.read(config); manualTransitionBackWing.read(config); manualTransitionFin.read(config); doViscDragCalibration.read(config); diff --git a/aerodynamic_analysis/src/tandem/tandemCalculatePolarConfig.h b/aerodynamic_analysis/src/tandem/tandemCalculatePolarConfig.h index ed64e8ed0c2fb3fffb75ea4eb2353180f2129be7..db1b7fe5a229fddd56163a28a057322156242e4e 100644 --- a/aerodynamic_analysis/src/tandem/tandemCalculatePolarConfig.h +++ b/aerodynamic_analysis/src/tandem/tandemCalculatePolarConfig.h @@ -55,7 +55,7 @@ class tandemCalculatePolarConfig{ EndnodeReadOnly<double> factorIndDragCleanPolar; // visc drag raymer EndnodeReadOnly<bool> manualTransition; - EndnodeReadOnly<double> manualTransitionWing; + EndnodeReadOnly<double> manualTransitionFrontWing; EndnodeReadOnly<double> manualTransitionBackWing; EndnodeReadOnly<double> manualTransitionFin; EndnodeReadOnly<bool> doViscDragCalibration; diff --git a/aerodynamic_analysis/src/tandem/tandemDefaultStrategy.cpp b/aerodynamic_analysis/src/tandem/tandemDefaultStrategy.cpp index f1ea09e49fe9d601db4f1df485ff7c3413af407f..9969c097916d9449a13a11d85567b396f3c0e882 100644 --- a/aerodynamic_analysis/src/tandem/tandemDefaultStrategy.cpp +++ b/aerodynamic_analysis/src/tandem/tandemDefaultStrategy.cpp @@ -228,8 +228,8 @@ void tandemDefaultStrategy::initializeLiLiforTandem(LiLiforTandemInitialization void tandemDefaultStrategy::initializeViscDragForTandem(viscDragForTandemInitialization *myViscDragInit) { // copy geometry - myViscDragInit->theWing = liftingSurfaces.at(0); - myViscDragInit->calculateWing = true; + myViscDragInit->theFrontWing = liftingSurfaces.at(0); + myViscDragInit->calculateFrontWing = true; myViscDragInit->theBackWing = liftingSurfaces.at(1); myViscDragInit->calculateBackWing = true; myViscDragInit->theVTP = VTP; @@ -241,7 +241,7 @@ void tandemDefaultStrategy::initializeViscDragForTandem(viscDragForTandemInitial myViscDragInit->calculateMisc = true; // initialize transition parameters myViscDragInit->manualTransitionLocation = config_->manualTransition.value(); //TODO kayra: sadece front winge - myViscDragInit->transitionLocationWing = config_->manualTransitionWing.value(); + myViscDragInit->transitionLocationFrontWing = config_->manualTransitionFrontWing.value(); myViscDragInit->transitionLocationBackWing = config_->manualTransitionBackWing.value(); myViscDragInit->transitionLocationVTP = config_->manualTransitionFin.value(); // initialize calibration parameters @@ -323,7 +323,7 @@ void tandemDefaultStrategy::calculateViscDragForTandem(viscDragForTandem *myVisc // loop over all points to calculate CL dependent visc drag correction hepsini transloc sifir konulmus for (size_t pointID(0); pointID < currentPolarSet.cleanPolars.at(polarID).Points.size(); ++pointID) { vector <double> theCorrectedComponentDrags = myViscDragForTandem->calculateCorrectedViscDrag(theComponentDrags, currentPolarSet.cleanPolars.at(polarID).MachNumber, - currentPolarSet.cleanPolars.at(polarID).Points.at(pointID).CL); + currentPolarSet.cleanPolars.at(polarID).Points.at(pointID).CL); //TODO kayra: yine tüm Cl kullaniyor sanirim // assign total and componentwise viscous drag to the polar map currentPolarSet.cleanPolars.at(polarID).Points.at(pointID).CD_visc = std::accumulate(theCorrectedComponentDrags.begin(), theCorrectedComponentDrags.end(), 0.0); currentPolarSet.cleanPolars.at(polarID).PointsFrontWing.at(pointID).CD_visc = theCorrectedComponentDrags.at(0); @@ -338,6 +338,9 @@ void tandemDefaultStrategy::calculateViscDragForTandem(viscDragForTandem *myVisc } void tandemDefaultStrategy::calculateWaveDragMason(waveDragMason *myWaveDragMason) { + double frontWingArea = geom2::measure::reference_area(liftingSurfaces.at(0)); + double backWingArea = geom2::measure::reference_area(liftingSurfaces.at(1)); + double totalWingArea = frontWingArea + backWingArea; // run wave drag calculation by Mason over the current polar set for (size_t polarID(0); polarID < currentPolarSet.cleanPolars.size(); ++polarID) { double sweepPosition(0.0); @@ -351,20 +354,20 @@ void tandemDefaultStrategy::calculateWaveDragMason(waveDragMason *myWaveDragMaso = myWaveDragMason->calculateWaveDrag(currentPolarSet.cleanPolars.at(polarID).Points.at(pointID), currentPolarSet.cleanPolars.at(polarID).MachNumber, 0, sweepPosition, currentPolarSet.cleanPolars.at(polarID).PointsFrontWing.at(pointID).yStations, - currentPolarSet.cleanPolars.at(polarID).PointsFrontWing.at(pointID).Cl_distr, false); //TODO kayra: false yaptim cünkü sanirim - currentPolarSet.cleanPolars.at(polarID).PointsBackWing.at(pointID).CD_wave //tüm lifte bakiyor sikinti cikmasin diye + currentPolarSet.cleanPolars.at(polarID).PointsFrontWing.at(pointID).Cl_distr, false) * (frontWingArea / totalWingArea); //TODO kayra: false yaptim cünkü sanirim + currentPolarSet.cleanPolars.at(polarID).PointsBackWing.at(pointID).CD_wave //tüm lifte bakiyor sikinti cikmasin diye = myWaveDragMason->calculateWaveDrag(currentPolarSet.cleanPolars.at(polarID).Points.at(pointID), currentPolarSet.cleanPolars.at(polarID).MachNumber, 1, sweepPosition, currentPolarSet.cleanPolars.at(polarID).PointsBackWing.at(pointID).yStations, - currentPolarSet.cleanPolars.at(polarID).PointsBackWing.at(pointID).Cl_distr, false); - currentPolarSet.cleanPolars.at(polarID).Points.at(pointID).CD_wave = currentPolarSet.cleanPolars.at(polarID).PointsFrontWing.at(pointID).CD_wave // TODO kayra: bunlari toplamak sacma degil mi + currentPolarSet.cleanPolars.at(polarID).PointsBackWing.at(pointID).Cl_distr, false) * (backWingArea / totalWingArea); + currentPolarSet.cleanPolars.at(polarID).Points.at(pointID).CD_wave = currentPolarSet.cleanPolars.at(polarID).PointsFrontWing.at(pointID).CD_wave + currentPolarSet.cleanPolars.at(polarID).PointsBackWing.at(pointID).CD_wave; } } myRuntimeInfo->out << "... Wave drag has been calculated sucessfully!" << endl; } -void tandemDefaultStrategy::sumUpDragComponents() { //TODO kayra: burda birtek arka kanadin wave dragi kendi alanina referansla böyle bir sikinti var +void tandemDefaultStrategy::sumUpDragComponents() { myRuntimeInfo->out << "Sum up drag components" << endl; for (size_t polarID(0); polarID < currentPolarSet.cleanPolars.size(); ++polarID) { for (size_t pointID(0); pointID < currentPolarSet.cleanPolars.at(polarID).Points.size(); ++pointID) {