diff --git a/cpacs_interface/cpacs_interface_conf.xml b/cpacs_interface/cpacs_interface_conf.xml index a57181545f54643307d004b746f472e13cbd2b48..c15a609031f5704d30aef5e030c7a2ccfaa68dcc 100644 --- a/cpacs_interface/cpacs_interface_conf.xml +++ b/cpacs_interface/cpacs_interface_conf.xml @@ -92,10 +92,10 @@ <value>true</value> </accommodation> <propulsion description="Convert propulsion from UNICADO to CPACS? Switch: true (yes) / false (no)"> - <value>false</value> + <value>true</value> </propulsion> <systems description="Convert systems from UNICADO to CPACS? Switch: true (yes) / false (no)"> - <value>false</value> + <value>true</value> </systems> <aerodynamics description="Convert aerodynamics from UNICADO to CPACS? Switch: true (yes) / false (no)"> <value>false</value> diff --git a/cpacs_interface/src/UNICADO2CPACS/CPACS_aircraft/cpacsAcftXML.cpp b/cpacs_interface/src/UNICADO2CPACS/CPACS_aircraft/cpacsAcftXML.cpp index 319ae30bf31a032a16469b964a98bc50a7ae8387..5727b741011fc34e80fc705953b9334e7da2651d 100644 --- a/cpacs_interface/src/UNICADO2CPACS/CPACS_aircraft/cpacsAcftXML.cpp +++ b/cpacs_interface/src/UNICADO2CPACS/CPACS_aircraft/cpacsAcftXML.cpp @@ -66,8 +66,7 @@ cpacsAcft::cpacsMassBreakdown::cpacsMassBreakdown() mOEM.at("mEM").emplace("mStructure", cpacsAcft::cpacsMassBreakdown::massMapElement()); mOEM.at("mEM").at("mStructure").emplace("mWingsStructure", cpacsAcft::cpacsMassBreakdown::massMapElement()); mOEM.at("mEM").at("mStructure").at("mWingsStructure").emplace("mWingStructure@1", cpacsAcft::cpacsMassBreakdown::massMapElement()); - mOEM.at("mEM").at("mStructure").at("mWingsStructure").emplace("tailplane", cpacsAcft::cpacsMassBreakdown::massMapElement()); - mOEM.at("mEM").at("mStructure").at("mWingsStructure").emplace("fin", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mEM").at("mStructure").at("mWingsStructure").emplace("empennage", cpacsAcft::cpacsMassBreakdown::massMapElement()); mOEM.at("mEM").at("mStructure").at("mWingsStructure").emplace("centerWing", cpacsAcft::cpacsMassBreakdown::massMapElement()); mOEM.at("mEM").at("mStructure").at("mWingsStructure").at("centerWing").emplace("mComponentSegments", cpacsAcft::cpacsMassBreakdown::massMapElement()); mOEM.at("mEM").at("mStructure").at("mWingsStructure").at("centerWing").at("mComponentSegments").emplace("mMiscellaneous", cpacsAcft::cpacsMassBreakdown::massMapElement()); @@ -91,7 +90,7 @@ cpacsAcft::cpacsMassBreakdown::cpacsMassBreakdown() mOEM.at("mEM").at("mStructure").emplace("mPylons", cpacsAcft::cpacsMassBreakdown::massMapElement()); //PowerUnits mOEM.at("mEM").emplace("mPowerUnits", cpacsAcft::cpacsMassBreakdown::massMapElement()); - //Engines (mEngines or mEquippedEngines) emplaced in convertUNICADO2CPACS + mOEM.at("mEM").at("mPowerUnits").emplace("mEngines", cpacsAcft::cpacsMassBreakdown::massMapElement()); mOEM.at("mEM").at("mPowerUnits").emplace("mBleedAirSystem", cpacsAcft::cpacsMassBreakdown::massMapElement()); mOEM.at("mEM").at("mPowerUnits").emplace("mEngineControl", cpacsAcft::cpacsMassBreakdown::massMapElement()); mOEM.at("mEM").at("mPowerUnits").emplace("mFuelSystem", cpacsAcft::cpacsMassBreakdown::massMapElement()); @@ -126,15 +125,28 @@ cpacsAcft::cpacsMassBreakdown::cpacsMassBreakdown() mOEM.at("mEM").emplace("mFurnishing", cpacsAcft::cpacsMassBreakdown::massMapElement()); mOEM.at("mEM").at("mFurnishing").emplace("mEmergencyOxygenSystems", cpacsAcft::cpacsMassBreakdown::massMapElement()); mOEM.at("mEM").at("mFurnishing").emplace("mLavatories", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mEM").at("mFurnishing").emplace("mCabinLightings", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mEM").at("mFurnishing").emplace("mCargoLinings", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mEM").at("mFurnishing").emplace("mCargoLoadings", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mEM").at("mFurnishing").emplace("mExtLightings", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mEM").at("mFurnishing").emplace("mEmergencyOxygenSystems", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mEM").at("mFurnishing").emplace("mFloorCoverings", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mEM").at("mFurnishing").emplace("mInsulations", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mEM").at("mFurnishing").emplace("mLavatories", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mEM").at("mFurnishing").emplace("mLinings", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mEM").at("mFurnishing").emplace("mMiscellaneous", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mEM").at("mFurnishing").emplace("mOverheadBins", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.emplace("mOperatorItems", cpacsAcft::cpacsMassBreakdown::massMapElement()); - mOEM.at("mOperatorItems").emplace("mStandardItems", cpacsAcft::cpacsMassBreakdown::massMapElement()); - mOEM.at("mOperatorItems").emplace("mOperationalItems", cpacsAcft::cpacsMassBreakdown::massMapElement()); - mOEM.at("mOperatorItems").emplace("mOperatorEquipment", cpacsAcft::cpacsMassBreakdown::massMapElement()); - mOEM.at("mOperatorItems").emplace("mOperationalEquipment", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mOperatorItems").emplace("mCaterings", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mOperatorItems").emplace("mCrewMembers", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mOperatorItems").emplace("mEmergencyEquipments", cpacsAcft::cpacsMassBreakdown::massMapElement()); mOEM.at("mOperatorItems").emplace("mFixedGalleys", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mOperatorItems").emplace("mIFEs", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mOperatorItems").emplace("mMiscellaneous", cpacsAcft::cpacsMassBreakdown::massMapElement()); mOEM.at("mOperatorItems").emplace("mSeats", cpacsAcft::cpacsMassBreakdown::massMapElement()); - - mOEM.emplace("mNotAllocated", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mOperatorItems").emplace("mToiletFluids", cpacsAcft::cpacsMassBreakdown::massMapElement()); + mOEM.at("mOperatorItems").emplace("mUnusableFuels", cpacsAcft::cpacsMassBreakdown::massMapElement()); } /* Destructor for cpacsMassBreakdown object */ @@ -591,7 +603,8 @@ cpacsAcft::transformation::~transformation() { cpacsAcft::cpacsMassBreakdown::massElement::massElement() : location(0., 0., 0.), - mass(0.) { + mass(0.), + componentUID("") { } /* Destructor for massElement object */ diff --git a/cpacs_interface/src/UNICADO2CPACS/CPACS_aircraft/cpacsAcftXML.h b/cpacs_interface/src/UNICADO2CPACS/CPACS_aircraft/cpacsAcftXML.h index 75181a713e9f2e465576fd92a1f06e17523e24e0..eca2746ebc12262d0ae18d843a687fac0b671aca 100644 --- a/cpacs_interface/src/UNICADO2CPACS/CPACS_aircraft/cpacsAcftXML.h +++ b/cpacs_interface/src/UNICADO2CPACS/CPACS_aircraft/cpacsAcftXML.h @@ -92,6 +92,7 @@ class cpacsAcft { Vec3 location; /**< Location of the mass element in reference to the global point of reference (x,y,z coordinates) [m] */ double mass; /**< Mass of the mass element [kg] */ Mat3 inertia; /**< 3x3 Matrix for Moment of intertia [kg*m^2] */ + std::string componentUID; /**< UID of the geometric description of the component */ //Constructor and Destructor /** \brief Constructor of class massElement diff --git a/cpacs_interface/src/UNICADO2CPACS/UNICADO2CPACS.cpp b/cpacs_interface/src/UNICADO2CPACS/UNICADO2CPACS.cpp index 5025b65eb2b39223df8cf9dbe15aa040e69d2066..cbb1535add0683042c12eeffafc41e344db00d85 100644 --- a/cpacs_interface/src/UNICADO2CPACS/UNICADO2CPACS.cpp +++ b/cpacs_interface/src/UNICADO2CPACS/UNICADO2CPACS.cpp @@ -79,6 +79,7 @@ void UNICADO2CPACS::initialize() { if (!this->cpacs_pt) { throwError(__FILE__, __func__, __LINE__, "Could not initialize CPACS aircraft."); } + this->cpacsAcftModelXMLPath = "cpacs/vehicles/aircraft/model@uID=" + this->cpacsAircraftUID; } void UNICADO2CPACS::run() { @@ -93,109 +94,103 @@ void UNICADO2CPACS::run() { myRuntimeInfo->out << "-----------------------------------------------" << std::endl; myRuntimeInfo->out << "Read UNICADO Design Specifications" << std::endl; this->unicado_pt->read_design_specs(); - myRuntimeInfo->out << "Convert Design Specifications to CPACS" << std::endl; - // this->convertDesignSpecs(); } //Accommodations Block will be converted to CPACS if (accommodationSwitch) { myRuntimeInfo->out << "-----------------------------------------------" << std::endl; myRuntimeInfo->out << "Read UNICADO Accommodation" << std::endl; this->unicado_pt->readAccommodation(); - myRuntimeInfo->out << "Convert Accommodation to CPACS" << std::endl; - // this->convertAccommodation(); } //MassesAndLoadings-Block in Unicado-XML-file will be read if (massesSwitch) { myRuntimeInfo->out << "-----------------------------------------------" << std::endl; myRuntimeInfo->out << "Read UNICADO Masses and Loadings" << std::endl; this->unicado_pt->readMassesAndLoadings(); - myRuntimeInfo->out << "Convert Masses and Loadings to CPACS" << std::endl; - // this->convertMassesAndLoadings(); + } + //Propulsion-Block in UNICADO-XML-file will be read before converting it to CPACS + if (propulsionSwitch) { + myRuntimeInfo->out << "-----------------------------------------------" << std::endl; + myRuntimeInfo->out << "Read UNICADO Propulsion" << std::endl; + this->unicado_pt->readPropulsion(); } //Geometry-Block in UNICADO-XML-file will be read before converting it to CPACS if (geometrySwitch || wingGeometrySwitch || stabilizerGeometrySwitch) { myRuntimeInfo->out << "-----------------------------------------------" << std::endl; myRuntimeInfo->out << "Read UNICADO Geometry" << std::endl; this->unicado_pt->readGeometry(); - myRuntimeInfo->out << "Convert Geometry to CPACS" << std::endl; - // this->convertGeometry(); - } - - //Propulsion-Block in UNICADO-XML-file will be read before converting it to CPACS - if (propulsionSwitch) { - myRuntimeInfo->out << "-----------------------------------------------" << std::endl; - myRuntimeInfo->out << "Read UNICADO Propulsion" << std::endl; - if (!this->unicado_pt->propulsionAlreadyRead) { - this->unicado_pt->readPropulsion(); - } - this->unicado_pt->readEnginePerformanceMap(); - myRuntimeInfo->out << "Convert Propulsion to CPACS" << std::endl; - // this->convertPropulsion(); } - //Systems-Block in UNICADO-XML-file will be read before converting it to CPACS if (systemsSwitch) { myRuntimeInfo->out << "-----------------------------------------------" << std::endl; myRuntimeInfo->out << "Read UNICADO Systems" << std::endl; this->unicado_pt->readSystems(); - myRuntimeInfo->out << "Convert Systems to CPACS" << std::endl; - // this->convertSystems(); } //Aerodynamics-Block in UNICADO-XML-file will be read before converting it to CPACS if (aerodynamicSwitch) { myRuntimeInfo->out << "-----------------------------------------------" << std::endl; myRuntimeInfo->out << "Read UNICADO Aerodynamics" << std::endl; this->unicado_pt->readAerodynamics(); - myRuntimeInfo->out << "Convert Aerodynamics to CPACS" << std::endl; - // this->convertAerodynamics(); } //StabilityAndControlCharacteristics-Block in UNICADO-XML-file will be read before converting it to CPACS if (stabilityAndControlCharacteristicsSwitch) { myRuntimeInfo->out << "-----------------------------------------------" << std::endl; myRuntimeInfo->out << "Read UNICADO StabilityAndControlCharacteristics" << std::endl; this->unicado_pt->readStabilityAndControlCharacteristics(); - myRuntimeInfo->out << "Convert StabilityAndControlCharacteristics to CPACS" << std::endl; - // this->convertStabilityAndControl(); } //Missions and Trajectory-Block in UNICADO-XML-file will be read before converting it to CPACS if (performanceSwitch) { myRuntimeInfo->out << "-----------------------------------------------" << std::endl; myRuntimeInfo->out << "Read UNICADO Missions and Trajectory" << std::endl; this->unicado_pt->readPerformance(); - myRuntimeInfo->out << "Convert Missions and Trajectory to CPACS" << std::endl; - // this->convertPerformance(); } //Monetary Values-Block in UNICADO-XML-file will be read before converting it to CPACS if (monetarySwitch) { myRuntimeInfo->out << "-----------------------------------------------" << std::endl; myRuntimeInfo->out << "Read UNICADO Monetary Values" << std::endl; this->unicado_pt->readMonetaryValues(); - myRuntimeInfo->out << "Convert Monetary Values to CPACS" << std::endl; - // this->convertMonetaryValues(); } //Ecological Values-Block in UNICADO-XML-file will be read before converting it to CPACS if (ecologicalSwitch) { myRuntimeInfo->out << "-----------------------------------------------" << std::endl; myRuntimeInfo->out << "Read UNICADO Ecological Values" << std::endl; this->unicado_pt->readEcologicalValues(); - myRuntimeInfo->out << "Convert Ecological Values to CPACS" << std::endl; - // this->convertEcologicalValues(); } //Requirements Block in UNICADO-XML-file will be read before converting it to CPACS if (requirementSwitch) { myRuntimeInfo->out << "-----------------------------------------------" << std::endl; myRuntimeInfo->out << "Read UNICADO Requirements" << std::endl; this->unicado_pt->readRequirements(); - myRuntimeInfo->out << "Convert Requirements to CPACS" << std::endl; - // this->convertRequirements(); } + + myRuntimeInfo->out << "Convert Design Specifications to CPACS" << std::endl; + // this->convertDesignSpecs(); + myRuntimeInfo->out << "Convert Accommodation to CPACS" << std::endl; + // this->convertAccommodation(); + myRuntimeInfo->out << "Convert Masses and Loadings to CPACS" << std::endl; + this->convertMassesAndLoadings(); + myRuntimeInfo->out << "Convert Geometry to CPACS" << std::endl; + this->convertGeometry(); + myRuntimeInfo->out << "Convert Systems to CPACS" << std::endl; + // this->convertSystems(); + myRuntimeInfo->out << "Convert Aerodynamics to CPACS" << std::endl; + // this->convertAerodynamics(); + myRuntimeInfo->out << "Convert StabilityAndControlCharacteristics to CPACS" << std::endl; + // this->convertStabilityAndControl(); + myRuntimeInfo->out << "Convert Missions and Trajectory to CPACS" << std::endl; + // this->convertPerformance(); + myRuntimeInfo->out << "Convert Monetary Values to CPACS" << std::endl; + // this->convertMonetaryValues(); + myRuntimeInfo->out << "Convert Ecological Values to CPACS" << std::endl; + // this->convertEcologicalValues(); + myRuntimeInfo->out << "Convert Requirements to CPACS" << std::endl; + // this->convertRequirements(); + myRuntimeInfo->out << "Convert Propulsion to CPACS" << std::endl; + this->convertPropulsion(); myRuntimeInfo->out << "###############################################" << std::endl; } void UNICADO2CPACS::update() { - myRuntimeInfo->out << "run UNICADO2CPACS2" << std::endl; } void UNICADO2CPACS::report() { - myRuntimeInfo->out << "run UNICADO2CPACS3" << std::endl; } void UNICADO2CPACS::save() { myRuntimeInfo->out << "-----------------------------------------------" << std::endl; @@ -224,8 +219,8 @@ void UNICADO2CPACS::save() { myRuntimeInfo->out << "Write <cpacs/header> ..." << std::endl; this->writeCpacsHeader(); /* <cpacs/vehicles> */ - // myRuntimeInfo->out << "Write <cpacs/vehicles> ..." << std::endl; - // this->writeVehicles(); + myRuntimeInfo->out << "Write <cpacs/vehicles> ..." << std::endl; + this->writeVehicles(); /* <cpacs/mission> */ // if (performanceSwitch) { // myRuntimeInfo->out << "Write <cpacs/missions> ..." << std::endl; diff --git a/cpacs_interface/src/UNICADO2CPACS/UNICADO2CPACS.h b/cpacs_interface/src/UNICADO2CPACS/UNICADO2CPACS.h index 119f9f91f94f8c84d67d61a12158c97a94843554..ff7ee3cdb9f252efecb6283a25dd97bee18b094d 100644 --- a/cpacs_interface/src/UNICADO2CPACS/UNICADO2CPACS.h +++ b/cpacs_interface/src/UNICADO2CPACS/UNICADO2CPACS.h @@ -81,6 +81,9 @@ class UNICADO2CPACS : public Strategy { */ void convertMassBreakdown(); + void loopMassBreakdown(const UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement& mass_breakdown, + cpacsAcft::cpacsMassBreakdown::massMapElement* cpcacs_element); + //Geometry /** \brief Function that converts geometry from UNICADO-file into CPACS XML-Structure */ @@ -125,8 +128,7 @@ class UNICADO2CPACS : public Strategy { * \param cpacsEnginePt: pointer to cpacs engine * \param index: index variable */ - void convertEngines(UnicadoAircraft::unicadoPropulsion* unicadoEnginedPt, cpacsAcft::cpacsEngine* cpacsEnginePt, - int index); + void convertEngines(UnicadoAircraft::unicadoPropulsion* unicadoEnginedPt, cpacsAcft::cpacsEngine* cpacsEnginePt); /** \brief Function that converts scaled performance from UNICADO-file into CPACS XML-Structure * \param unicadoEnginedPt: pointer to unicado engine diff --git a/cpacs_interface/src/UNICADO2CPACS/converters/geometry_converter.cpp b/cpacs_interface/src/UNICADO2CPACS/converters/geometry_converter.cpp index 1f7a92c38cc4ad9d70fe01e22133e0c566f87daf..1abed0a9aa9414ca09dbf97171d6369db65603bd 100644 --- a/cpacs_interface/src/UNICADO2CPACS/converters/geometry_converter.cpp +++ b/cpacs_interface/src/UNICADO2CPACS/converters/geometry_converter.cpp @@ -57,7 +57,7 @@ void UNICADO2CPACS::convertGeometry() { // this->convertNacelles();//convertNacelles must be in front of convertPropulsionGeometry, because of the definition of the class cpacsEngine // } - // this->convertPropulsionGeometry(); + this->convertPropulsionGeometry(); // if (this->unicado_pt->theUnicadoGeo.theUnicadoWing.empty() && this->unicado_pt->unicado_design_specs.mainGearPosition == "Wing") { // myRuntimeInfo->out << " - Warning: Landing gears are not converted and written, due to missing wing geometry." << std::endl; @@ -992,22 +992,8 @@ void UNICADO2CPACS::convertFin() { // TODO(Gerrit) /* Transfer the propulsion geometry into CPACS */ void UNICADO2CPACS::convertPropulsionGeometry() { - //Engines - myRuntimeInfo->out << "Convert geometry of Engines" << std::endl; - for (unsigned int i(0); i < this->unicado_pt->theUnicadoPropulsion.noOfEngines; ++i) { - std::vector<cpacsAcft::cpacsEngine>::const_iterator aCpacsEngine(std::find_if(this->cpacs_pt->theCpacsEngines.begin(), this->cpacs_pt->theCpacsEngines.end(), - [this, i](const cpacsAcft::cpacsEngine & aCpacsEngine) { - return aCpacsEngine.info.name == this->unicado_pt->theUnicadoPropulsion.engineModel; - })); - if (aCpacsEngine == this->cpacs_pt->theCpacsEngines.end()) { //add only if engine does not yet exists - this->cpacs_pt->theCpacsEngines.push_back(cpacsAcft::cpacsEngine()); //theCpacsEngines vector iterator starts at theUnicadoGeo.usedElements.Nacelles - convertEngines(&this->unicado_pt->theUnicadoPropulsion, &this->cpacs_pt->theCpacsEngines.back(), i); - } else { //add values to the engine if the object already exists - convertEngines(&this->unicado_pt->theUnicadoPropulsion, &this->cpacs_pt->theCpacsEngines.back(), i); - } - } //Pylons - myRuntimeInfo->out << "Convert geometry of Pylon" << std::endl; // TODO (Gerrit) + // myRuntimeInfo->out << "Convert geometry of Pylon" << std::endl; // TODO (Gerrit) // for (int i(0); i < this->unicado_pt->theUnicadoGeo.usedElements.Pylons; ++i) { // /* Check if current pylon is symmetric on other side */ // std::vector<cpacsAcft::cpacsPylon>::iterator aCpacsPylon(std::find_if(this->cpacs_pt->theCpacsPylon.begin(), this->cpacs_pt->theCpacsPylon.end(), diff --git a/cpacs_interface/src/UNICADO2CPACS/converters/mass_converter.cpp b/cpacs_interface/src/UNICADO2CPACS/converters/mass_converter.cpp index 8fa579e04bd480541e18b721059ae475ab4481f2..10f9b11900a347420432a546a7749dd1b289ffaf 100644 --- a/cpacs_interface/src/UNICADO2CPACS/converters/mass_converter.cpp +++ b/cpacs_interface/src/UNICADO2CPACS/converters/mass_converter.cpp @@ -79,15 +79,10 @@ void UNICADO2CPACS::convertMassBreakdown() { /* wing structure */ this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mStructure").at("mWingsStructure").mass = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.mass + - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.at("Fin").mass + - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.at("Tailplane").mass; + this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.mass; this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mStructure").at("mWingsStructure").location = - (this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.mass * - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.refPoint + - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.at("Fin").mass * - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.at("Fin").refPoint + - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.at("Tailplane").mass * - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.at("Tailplane").refPoint) / + (this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.mass * this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.refPoint + + this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.mass * this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.refPoint) / this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mStructure").at("mWingsStructure").mass; /** \todo [T1224](https://unicado.ilr.rwth-aachen.de/T1224) (Ohm#1#): Check sub elements that could be transfered @@ -95,41 +90,41 @@ void UNICADO2CPACS::convertMassBreakdown() { const cpacsAcft::cpacsMassBreakdown::massMapElement& mWingStructure(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mStructure").at("mWingsStructure")); mWingStructure.at("centerWing").mass = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.mass; mWingStructure.at("centerWing").location = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.refPoint; - mWingStructure.at("tailplane").mass = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.at("Tailplane").mass; - mWingStructure.at("tailplane").location = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.at("Tailplane").refPoint; - mWingStructure.at("fin").mass = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.at("Fin").mass; - mWingStructure.at("fin").location = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.at("Fin").refPoint; - mWingStructure.at("centerWing").at("mComponentSegments").at("mMiscellaneous").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("CenterWing").mass; - mWingStructure.at("centerWing").at("mComponentSegments").at("mMiscellaneous").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("CenterWing").refPoint; - mWingStructure.at("centerWing").at("mComponentSegments").at("mFixedLeadingEdges").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("FixedLeadingEdge").mass; - mWingStructure.at("centerWing").at("mComponentSegments").at("mFixedLeadingEdges").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("FixedLeadingEdge").refPoint; - mWingStructure.at("centerWing").at("mComponentSegments").at("mFixedTrailingEdges").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("FixedTrailingEdge").mass; - mWingStructure.at("centerWing").at("mComponentSegments").at("mFixedTrailingEdges").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("FixedTrailingEdge").refPoint; - mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableLeadingEdges").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("MovableLeadingEdge").mass; - mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableLeadingEdges").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("MovableLeadingEdge").refPoint; - mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableTrailingEdge").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("MovableTrailingEdge").mass; - mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableTrailingEdge").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("MovableTrailingEdge").refPoint; + mWingStructure.at("empennage").mass = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.mass; + mWingStructure.at("empennage").location = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.refPoint; + // mWingStructure.at("fin").mass = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.at("Fin").mass; + // mWingStructure.at("fin").location = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.at("Fin").refPoint; + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMiscellaneous").mass = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("CenterWing").mass; + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMiscellaneous").location = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("CenterWing").refPoint; + // mWingStructure.at("centerWing").at("mComponentSegments").at("mFixedLeadingEdges").mass = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("FixedLeadingEdge").mass; + // mWingStructure.at("centerWing").at("mComponentSegments").at("mFixedLeadingEdges").location = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("FixedLeadingEdge").refPoint; + // mWingStructure.at("centerWing").at("mComponentSegments").at("mFixedTrailingEdges").mass = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("FixedTrailingEdge").mass; + // mWingStructure.at("centerWing").at("mComponentSegments").at("mFixedTrailingEdges").location = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("FixedTrailingEdge").refPoint; + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableLeadingEdges").mass = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("MovableLeadingEdge").mass; + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableLeadingEdges").location = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("MovableLeadingEdge").refPoint; + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableTrailingEdge").mass = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("MovableTrailingEdge").mass; + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableTrailingEdge").location = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").at("MovableTrailingEdge").refPoint; - mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").mass = - mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableLeadingEdges").mass + - mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableTrailingEdge").mass; + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").mass = + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableLeadingEdges").mass + + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableTrailingEdge").mass; - mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").location = - (mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableLeadingEdges").mass * - mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableLeadingEdges").location + - mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableTrailingEdge").mass * - mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableTrailingEdge").location) / - mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").mass; + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").location = + // (mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableLeadingEdges").mass * + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableLeadingEdges").location + + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableTrailingEdge").mass * + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").at("mMoveableTrailingEdge").location) / + // mWingStructure.at("centerWing").at("mComponentSegments").at("mMoveables").mass; /* Landing gear structure */ this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mStructure").at("mLandingGears").mass = @@ -159,174 +154,57 @@ void UNICADO2CPACS::convertMassBreakdown() { this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mStructure").at("mPylons").location) / (this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mStructure").mass); - /* Power Units */ - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").mass = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").location = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.refPoint; - int numberOfEngines = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").size(); - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").emplace("mEngines", cpacsAcft::cpacsMassBreakdown::massMapElement()); - for (int i = 0; i < numberOfEngines; i++) { - std::string engineName = "Engine" + num2Str(i + 1); - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").emplace(engineName, cpacsAcft::cpacsMassBreakdown::massMapElement()); - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at(engineName).mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at(engineName).mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at(engineName).location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at(engineName).refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").mass += - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at(engineName).mass; - // Mass weighted location [m*kg] within this loop -> total mass not known a priori - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").location += - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at(engineName).location * - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at(engineName).mass; - } - // Divide total mass from mass weighted location to get the actual location [(m*kg)/kg] = [m] - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").location = - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").location / - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").mass; + /* Power Units */ // TODO(GErrit): Now @convert propulsion + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").mass = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.mass; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").location = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.refPoint; + // int numberOfEngines = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").size(); + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").emplace("mEngines", cpacsAcft::cpacsMassBreakdown::massMapElement()); + // for (int i = 0; i < numberOfEngines; i++) { + // std::string engineName = "Engine" + num2Str(i + 1); + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").emplace(engineName, cpacsAcft::cpacsMassBreakdown::massMapElement()); + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at(engineName).mass = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at(engineName).mass; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at(engineName).location = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at(engineName).refPoint; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").mass += + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at(engineName).mass; + // // Mass weighted location [m*kg] within this loop -> total mass not known a priori + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").location += + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at(engineName).location * + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at(engineName).mass; + // } + // // Divide total mass from mass weighted location to get the actual location [(m*kg)/kg] = [m] + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").location = + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").location / + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mBleedAirSystem").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("BleedAirSystem").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mBleedAirSystem").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("BleedAirSystem").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControl").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("EngineControls").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControl").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("EngineControls").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mFuelSystem").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("FuelSystem").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mFuelSystem").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("FuelSystem").refPoint; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mBleedAirSystem").mass = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("BleedAirSystem").mass; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mBleedAirSystem").location = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("BleedAirSystem").refPoint; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControl").mass = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("EngineControls").mass; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControl").location = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("EngineControls").refPoint; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mFuelSystem").mass = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("FuelSystem").mass; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mFuelSystem").location = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("FuelSystem").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControls").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("EngineControls").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControls").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("EngineControls").refPoint; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControls").mass = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("EngineControls").mass; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControls").location = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("EngineControls").refPoint; /* Systems */ // NOTE (ohm#1#): Could be compared to the sum of the elements this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").mass = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.mass; this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").location = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.refPoint; - // APU - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mAuxillaryPowerUnit").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("APU").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mAuxillaryPowerUnit").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("APU").refPoint; - // Hydraulic - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mHydraulicGeneration").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("HydraulicGeneration").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mHydraulicGeneration").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("HydraulicGeneration").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mHydraulicDistribution").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("HydraulicDistribution").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mHydraulicDistribution").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("HydraulicDistribution").refPoint; - // Air conditioning - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mAirConditioning").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("AirConditioning").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mAirConditioning").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("AirConditioning").refPoint; - // De-icing - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mDeIcing").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("DeIcing").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mDeIcing").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("DeIcing").refPoint; - // Fire protection - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFireProtection").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FireProtection").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFireProtection").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FireProtection").refPoint; - // Flight controls - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mRoll").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("Roll").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mRoll").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("Roll").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mYaw").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("Yaw").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mYaw").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("Yaw").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mPitch").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("Pitch").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mPitch").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("Pitch").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mMovableHorizontalTail").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("MovableHorizontalTail").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mMovableHorizontalTail").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("MovableHorizontalTail").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mFlaps").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("Flaps").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mFlaps").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("Flaps").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mSpoilersAirbrakesLiftdumpers").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("SpoilersAirbrakesLiftdumpers").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mSpoilersAirbrakesLiftdumpers").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("SpoilersAirbrakesLiftdumpers").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mSlats").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("Slats").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mSlats").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("Slats").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mCommonInstallation").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("CommonInstallation").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mCommonInstallation").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("FlightControls").at("CommonInstallation").refPoint; - // Instrument panel - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mInstrumentPanel").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("Instruments").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mInstrumentPanel").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("Instruments").refPoint; - // Automatic flight system - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mAutomaticFlightSystem").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("AutomaticFlightSystem").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mAutomaticFlightSystem").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("AutomaticFlightSystem").refPoint; - // Navigation - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mNavigation").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("Navigation").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mNavigation").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("Navigation").refPoint; - // Communication - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mCommunication").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("Communication").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mCommunication").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("Communication").refPoint; - // Electrical generation and distribution - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mElectricalGeneration").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("ElectricalGeneration").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mElectricalGeneration").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("ElectricalGeneration").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mElectricalDistribution").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("ElectricalDistribution").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mElectricalDistribution").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("ElectricalDistribution").refPoint; + loopMassBreakdown(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.systems, &this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems")); + /* Furnishings */ -// NOTE (ohm#1#): Cpacs 2.3 Furnishings and operator items have new items and has been reworked this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").mass = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.furnishings.mass; this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").location = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.furnishings.refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mEmergencyOxygenSystems").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.furnishings.at("FixedEmergencyOxygen").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mEmergencyOxygenSystems").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.furnishings.at("FixedEmergencyOxygen").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").emplace("mFurnishings", cpacsAcft::cpacsMassBreakdown::massMapElement()); - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").emplace("mCabinLightings", cpacsAcft::cpacsMassBreakdown::massMapElement()); - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").emplace("mFreshWaterSystems", cpacsAcft::cpacsMassBreakdown::massMapElement()); - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mFurnishings").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.furnishings.at("Furnishings").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mFurnishings").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.furnishings.at("Furnishings").refPoint; - - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.furnishings.mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.furnishings.refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mCabinLightings").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.furnishings.at("Lighting").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mCabinLightings").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.furnishings.at("Lighting").refPoint; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mFreshWaterSystems").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.furnishings.at("WaterInstallation").mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mFreshWaterSystems").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.furnishings.at("WaterInstallation").refPoint; + loopMassBreakdown(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.furnishings, &this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing")); /* Center of gravity of MEM */ this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").location = @@ -344,37 +222,29 @@ void UNICADO2CPACS::convertMassBreakdown() { this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").mass = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.mass; this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").location = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.refPoint; // Seat masses - for (int i = 0; i < this->unicado_pt->theUnicadoAccommodation.noOfSeatTypes; i++) { - for (int j = 0; j < this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).noOfSeatConfigurations; j++) { - std::string seatName = this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).seatClassType + "_seat_" + num2Str(j + 1); - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").emplace(seatName, cpacsAcft::cpacsMassBreakdown::massMapElement()); - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mSeats").emplace(seatName, cpacsAcft::cpacsMassBreakdown::massMapElement()); - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mSeats").at(seatName).mass = - this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).theSeatConfiguration.at(j).mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mSeats").mass += - this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).theSeatConfiguration.at(j).mass * - this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).theSeatConfiguration.at(j).noOfSeats; - } - } - /**< \todo [T1125] (https://unicado.ilr.rwth-aachen.de/T1225) (aigner#1#): (JAN) mStandardItems and mOperationalItems need to be placed in CPACS categories. - */ - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mOperatorEquipment").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.at("OperatorEquipment").mass; - - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mOperatorEquipment").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.at("OperatorEquipment").refPoint; + // for (int i = 0; i < this->unicado_pt->theUnicadoAccommodation.noOfSeatTypes; i++) { + // for (int j = 0; j < this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).noOfSeatConfigurations; j++) { + // std::string seatName = this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).seatClassType + "_seat_" + num2Str(j + 1); + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").emplace(seatName, cpacsAcft::cpacsMassBreakdown::massMapElement()); + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mSeats").emplace(seatName, cpacsAcft::cpacsMassBreakdown::massMapElement()); + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mSeats").at(seatName).mass = + // this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).theSeatConfiguration.at(j).mass; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mSeats").mass += + // this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).theSeatConfiguration.at(j).mass * + // this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).theSeatConfiguration.at(j).noOfSeats; + // } + // } + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").mass = + this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.mass; + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").location = + this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.refPoint; + loopMassBreakdown(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems, &this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems")); - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mOperationalEquipment").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.at("OperationalEquipment").mass; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mNotAllocated").mass = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.notAllocated.mass; - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mOperationalEquipment").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.at("OperationalEquipment").refPoint; - - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mNotAllocated").mass = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.notAllocated.mass; - - this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mNotAllocated").location = - this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.notAllocated.refPoint; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mNotAllocated").location = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.notAllocated.refPoint; /* Center of gravity of MOEM */ this->cpacs_pt->theCpacsMassBreakdown.mOEM.location = @@ -384,3 +254,11 @@ void UNICADO2CPACS::convertMassBreakdown() { this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").location) / this->cpacs_pt->theCpacsMassBreakdown.mOEM.mass; } + +void UNICADO2CPACS::loopMassBreakdown(const UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement& mass_breakdown, + cpacsAcft::cpacsMassBreakdown::massMapElement* cpcacs_element) { + for (const auto& mass_element : mass_breakdown.elements->map) { + cpcacs_element->at("m" + mass_element.first).mass = mass_element.second.mass; + cpcacs_element->at("m" + mass_element.first).location = mass_element.second.refPoint; + } +} diff --git a/cpacs_interface/src/UNICADO2CPACS/converters/propulsion_converter.cpp b/cpacs_interface/src/UNICADO2CPACS/converters/propulsion_converter.cpp index b20190aa4c7c970a8b53a0d9fe4ece5abc4b398f..c48261924beb370b1cb59f71c4f7d7cd6edeea1c 100644 --- a/cpacs_interface/src/UNICADO2CPACS/converters/propulsion_converter.cpp +++ b/cpacs_interface/src/UNICADO2CPACS/converters/propulsion_converter.cpp @@ -27,10 +27,11 @@ #include "../UNICADO2CPACS.h" /* Transfer engines into CPACS */ -void UNICADO2CPACS::convertEngines(UnicadoAircraft::unicadoPropulsion* unicadoEnginePt, cpacsAcft::cpacsEngine* cpacsEnginePt, int index) { +void UNICADO2CPACS::convertEngines(UnicadoAircraft::unicadoPropulsion* unicadoEnginePt, cpacsAcft::cpacsEngine* cpacsEnginePt) { cpacsEnginePt->info.uID = unicadoEnginePt->engineModel; cpacsEnginePt->info.name = unicadoEnginePt->engineModel; cpacsEnginePt->info.description = unicadoEnginePt->engineModel; + cpacsEnginePt->engineUID = cpacsEnginePt->info.uID; //Trafoelements cpacsEnginePt->length = unicadoEnginePt->theEngineDimensions.length; cpacsEnginePt->diameter = sqrt((unicadoEnginePt->theEngineDimensions.height * unicadoEnginePt->theEngineDimensions.height + unicadoEnginePt->theEngineDimensions.width * @@ -84,3 +85,133 @@ void UNICADO2CPACS::convertEngines(UnicadoAircraft::unicadoPropulsion* unicadoEn /**< \todo [T1237] (https://unicado.ilr.rwth-aachen.de/T1237) (Philip#1#): check if enginemount can be calculated with UNICADO */ } + + +/* Transfer propulsion data into CPACS */ +void UNICADO2CPACS::convertPropulsion() { + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").mass = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.mass; + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").location = this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.refPoint; + + for (uint16_t engine_index(0); engine_index < this->unicado_pt->theUnicadoPropulsion.size(); ++engine_index) { + this->cpacs_pt->theCpacsEngines.push_back(cpacsAcft::cpacsEngine()); //theCpacsEngines vector iterator starts at theUnicadoGeo.usedElements.Nacelles + convertEngines(&this->unicado_pt->theUnicadoPropulsion.at(engine_index), &this->cpacs_pt->theCpacsEngines.back()); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.powerOfftake = 0; // pre-defined + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.bleedAirOfftake = 0; // pre-defined + this->cpacs_pt->theCpacsEngines.back().n2Max = this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.n2Max/60; // per min to per sec conversion + this->cpacs_pt->theCpacsEngines.back().n1Max = this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.n1Max/60; // per min to per sec conversion + this->cpacs_pt->theCpacsEngines.back().thrust00 = this->unicado_pt->theUnicadoPropulsion.at(engine_index).maxTakeOff.thrust; + this->cpacs_pt->theCpacsEngines.back().bpr00 = this->unicado_pt->theUnicadoPropulsion.at(engine_index).maxTakeOff.BPR; + this->cpacs_pt->theCpacsEngines.back().fpr00 = this->unicado_pt->theUnicadoPropulsion.at(engine_index).maxTakeOff.FPR; + this->cpacs_pt->theCpacsEngines.back().opr00 = this->unicado_pt->theUnicadoPropulsion.at(engine_index).maxTakeOff.OPR; + for (unsigned int i(0); i < this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.spoolSpeed.size(); ++i) { + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.n1.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.n2.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.flightLevel.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.machNumber.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.thrust.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.mDotFuel.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.mDot8.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.mDot18.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.rho8.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.rho18.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.t8.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.t18.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.tET.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.v8.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.v18.push_back(""); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.engineRating.push_back( + num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.spoolSpeed.at(i))); + for (unsigned int j(0); j < this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.flightLevel.size(); ++j) { + for (unsigned int k(0); k < this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.machNumber.size(); ++k) { + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.n1[i] += // spoolSpeed = n1 + num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.spoolSpeed.at(i)); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.flightLevel[i] += + num2Str(convertUnit(NOPREFIX, METER, HECTO, FOOT, this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.flightLevel.at(j))); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.machNumber[i] += + num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.machNumber.at(k)); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.thrust[i] += + num2Str(convertUnit(KILO, NEWTON, NOPREFIX, NEWTON, this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.thrust[j][k][i])); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.mDotFuel[i] += + num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.mDotFuel[j][k][i]); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.mDot8[i] += + num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.mDot8[j][k][i]); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.mDot18[i] += + num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.mDot18[j][k][i]); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.n2[i] += + num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.n2[j][k][i]); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.rho8[i] += + num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.rho8[j][k][i]); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.rho18[i] += + num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.rho18[j][k][i]); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.t8[i] += + num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.t8[j][k][i]); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.t18[i] += + num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.t18[j][k][i]); + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.tET[i] += // T2 = turbine entry temperature + num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.t2[j][k][i]); + // this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.v8[i] += // TODO(Gerrit): put back in when engine.cpp ready + // num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.v8[j][k][i]); + // this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.v18[i] += + // num2Str(this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.v18[j][k][i]); + // Suppress adding a semicolon when last FL/mach number combination of an N1 rating occurs + if (!((j == this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.flightLevel.size() - 1) + && (k == this->unicado_pt->theUnicadoPropulsion.at(engine_index).theEnginePerformanceMap.machNumber.size() - 1))) { + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.flightLevel[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.machNumber[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.n1[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.n2[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.thrust[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.mDotFuel[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.mDot8[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.mDot18[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.rho8[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.rho18[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.t8[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.t18[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.tET[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.v8[i] += ";"; + this->cpacs_pt->theCpacsEngines.back().theEnginePerformanceMap.v18[i] += ";"; + } + } + } + } + + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").emplace("Engine" + num2Str(engine_index + 1), + cpacsAcft::cpacsMassBreakdown::massMapElement()); + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at("Engine" + num2Str(engine_index + 1)).mass = + this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at(num2Str(engine_index)).mass; + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at("Engine" + num2Str(engine_index + 1)).location = + this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at(num2Str(engine_index)).refPoint; + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at("Engine" + num2Str(engine_index + 1)).componentUID = + this->cpacs_pt->theCpacsEngines.back().info.uID; + + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").mass += + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at("Engine" + num2Str(engine_index + 1)).mass; + // Mass weighted location [m*kg] within this loop -> total mass not known a priori + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").location += + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at("Engine" + num2Str(engine_index + 1)).location * + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at("Engine" + num2Str(engine_index + 1)).mass; + } + // Divide total mass from mass weighted location to get the actual location [(m*kg)/kg] = [m] + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").location = + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").location / + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").mass; + + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mBleedAirSystem").mass = + this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("BleedAirSystem").mass; + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mBleedAirSystem").location = + this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("BleedAirSystem").refPoint; + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControl").mass = + this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("EngineControls").mass; + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControl").location = + this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("EngineControls").refPoint; + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mFuelSystem").mass = + this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("FuelSystem").mass; + this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mFuelSystem").location = + this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("FuelSystem").refPoint; + + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControls").mass = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("EngineControls").mass; + // this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControls").location = + // this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("EngineControls").refPoint; +} diff --git a/cpacs_interface/src/UNICADO2CPACS/output/UNICADO2CPACS_output.cpp b/cpacs_interface/src/UNICADO2CPACS/output/UNICADO2CPACS_output.cpp index 0b607f87345958833ec0d2d3c04c2a5c458e92df..a9f754940d4fb1733be459d777c72b7396735352 100644 --- a/cpacs_interface/src/UNICADO2CPACS/output/UNICADO2CPACS_output.cpp +++ b/cpacs_interface/src/UNICADO2CPACS/output/UNICADO2CPACS_output.cpp @@ -40,27 +40,28 @@ void UNICADO2CPACS::writeVehicles() { myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/> ..." << std::endl; this->writeCpacsAircraft(); /* <cpacs/vehicle/engines/> */ - if (this->propulsionSwitch == 1) { + if (this->propulsionSwitch) { myRuntimeInfo->out << "Write <cpacs/vehicles/engines> ..." << std::endl; + this->writePropulsionGeometry(); this->writeEnginePerformance(); } - /* <cpacs/vehicle/profiles/> */ - /* All profiles */ - if (this->geometrySwitch == 1) { - myRuntimeInfo->out << "Write <cpacs/vehicles/profiles> ..." << std::endl; - this->writeProfiles(); - } + // /* <cpacs/vehicle/profiles/> */ + // /* All profiles */ + // if (this->geometrySwitch == 1) { + // myRuntimeInfo->out << "Write <cpacs/vehicles/profiles> ..." << std::endl; + // this->writeProfiles(); + // } - /* Lifting profiles */ - if (!this->geometrySwitch && (this->wingGeometrySwitch || this->stabilizerGeometrySwitch)) { - this->writeWingProfiles(); - } + // /* Lifting profiles */ + // if (!this->geometrySwitch && (this->wingGeometrySwitch || this->stabilizerGeometrySwitch)) { + // this->writeWingProfiles(); + // } - /* Writes used materials <cpacs/vehicle/materials> */ - if (this->cpacs_pt->theCpacsMaterials.materials.size() > 0) { - myRuntimeInfo->out << "Write <cpacs/vehicles/materials> ..." << std::endl; - this->writeMaterials(); - } + // /* Writes used materials <cpacs/vehicle/materials> */ + // if (this->cpacs_pt->theCpacsMaterials.materials.size() > 0) { + // myRuntimeInfo->out << "Write <cpacs/vehicles/materials> ..." << std::endl; + // this->writeMaterials(); + // } } /* Function writes the aircraft information in the cpacs file */ @@ -99,15 +100,75 @@ void UNICADO2CPACS::writeCpacsAircraft() { // this->writeFin(); // } - // /* <cpacs/vehicle/aircraft/model/engines> */ - // if (!this->cpacs_pt->theCpacsEngines.empty() - // && this->PropulsionGeometrySwitch == 1 - // && this->unicado_pt->theUnicadoGeo.usedElements.LiftingSurfaces != 0) { - // myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/engines> ..." << std::endl; - // this->writePropulsionGeometry(); - // } else { - // myRuntimeInfo->warn << " - engines can't be written due to missing engines or wings." << std::endl; - // } + + + /* write Pylon Output */ + if (!this->cpacs_pt->theCpacsEngines.empty() && this->PropulsionGeometrySwitch && unicado_pt->theUnicadoGeo.usedElements.LiftingSurfaces != 0) { + myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/engines> ..." << std::endl; + //[zumegen, 22.12.20] check if pylons exist + if (this->unicado_pt->theUnicadoGeo.usedElements.Pylons >= 1) { + myRuntimeInfo->debug << "writePylonGeometry" << std::endl; + for (unsigned int i(0); i < this->cpacs_pt->theCpacsPylon.size(); ++i) { + std::string PylonPath = cpacsAcftModelXMLPath + "/enginePylons/enginePylon@uID=" + this->cpacs_pt->theCpacsPylon.at(i).info.uID; + writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).info.name, PylonPath + "/name"); + cpacs_file->at(PylonPath).addAttrib("symmetry", this->cpacs_pt->theCpacsPylon.at(i).info.symmetry); + writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).info.description, PylonPath + "/description"); + writeCpacsXML(this->cpacs_pt->theCpacsFuse.info.uID, PylonPath + "/parentUID"); + + /* Hack from TUHH for Pylon positioning at the wing */ + writeCpacsXML("90", PylonPath + "/transformation/rotation/x"); + + writeVec3CpacsXml(this->cpacs_pt->theCpacsPylon.at(i).trafo.translation, PylonPath + "/transformation/translation"); + + /* sections */ + myRuntimeInfo->debug << "writeSections" << std::endl; + uint8_t aSectionNumber(0); + for (const cpacsAcft::section& aPylonSection : this->cpacs_pt->theCpacsPylon.at(i).pylonSections) { + /* write sections */ + std::string PylonSectionPath = PylonPath + "/sections/section@uID=" + aPylonSection.info.uID; + writeCpacsXML(aPylonSection.info.name, PylonSectionPath + "/name"); + if (aSectionNumber != 0) + writeCpacsXML(aPylonSection.trafo.rotation[0], PylonSectionPath + "/transformation/rotation/x"); + writeCpacsXML(aPylonSection.trafo.rotation[1], PylonSectionPath + "/transformation/rotation/y"); + + /* write Section Elements corresponds to the airfoils */ + std::string PylonSectionElementPath = PylonSectionPath + "/elements/element@uID=" + aPylonSection.sectionElements.at(i).info.uID; + writeCpacsXML(aPylonSection.sectionElements.at(i).info.name, PylonSectionElementPath + "/name"); + writeVec3CpacsXml(aPylonSection.sectionElements.at(i).trafo.scaling, PylonSectionElementPath + "/transformation/scaling"); + + /*Airfoils and Wingprofile*/ + writeCpacsXML(aPylonSection.sectionElements.at(i).profileUID, PylonSectionElementPath + "/airfoilUID"); + + //Frage Aigner was ist mit convertWingDatProfile? + + /*write Wing Segments*/ + if (aSectionNumber != 0) { + std::string PylonSegmentsPath = PylonPath + "/segments/segment@uID=" + this->cpacs_pt->theCpacsPylon.at(i).pylonSegments.at(aSectionNumber - 1).info.uID; + writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonSegments.at(aSectionNumber - 1).info.name, PylonSegmentsPath + "/name"); + writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonSegments.at(aSectionNumber - 1).fromElementUID, PylonSegmentsPath + "/fromElementUID"); + writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonSegments.at(aSectionNumber - 1).toElementUID, PylonSegmentsPath + "/toElementUID"); + } + + /* write positionings*/ + std::string PylonPositioningPath = PylonPath + "/positionings/positioning@uID=" + this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).uID; + writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).name, PylonPositioningPath + "/name"); + writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).length, PylonPositioningPath + "/length"); + if (aSectionNumber != 0) { + writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).sweepAngle, PylonPositioningPath + "/sweepAngle"); + writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).dihedralAngle, PylonPositioningPath + "/dihedralAngle"); + writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).fromSectionUID, PylonPositioningPath + "/fromSectionUID"); + } else { + writeCpacsXML(0, PylonPositioningPath + "/sweepAngle"); + writeCpacsXML(0, PylonPositioningPath + "/dihedralAngle"); + } + writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).toSectionUID, PylonPositioningPath + "/toSectionUID"); + ++aSectionNumber; + } + } + } + } else { + myRuntimeInfo->warn << " - engines can't be written due to missing engines or wings." << std::endl; + } // /* <cpacs/vehicle/aircraft/model/enginePylons> */ // if (this->cpacs_pt->theCpacsEngines.empty()) { @@ -152,16 +213,16 @@ void UNICADO2CPACS::writeCpacsAircraft() { this->writeSystems(); } - /* <cpacs/vehicle/aircraft/model/global> */ - if (this->requirementSwitch || this->designSpecsSwitch) { - myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/global> ..." << std::endl; - if (this->requirementSwitch == 1) { - this->writeRequirements(); - } - if (this->designSpecsSwitch == 1) { - this->writeDesignSpecs(); - } - } + // /* <cpacs/vehicle/aircraft/model/global> */ + // if (this->requirementSwitch || this->designSpecsSwitch) { + // myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/global> ..." << std::endl; + // if (this->requirementSwitch == 1) { + // this->writeRequirements(); + // } + // if (this->designSpecsSwitch == 1) { + // this->writeDesignSpecs(); + // } + // } /* <cpacs/vehicle/aircraft/model/analysis> */ if (this->aerodynamicSwitch || this->massesSwitch || this->monetarySwitch || this->ecologicalSwitch) { @@ -175,7 +236,7 @@ void UNICADO2CPACS::writeGeneral() { writeCpacsXML(this->cpacs_pt->info.name, "cpacs/vehicles/aircraft/model@uID=" + this->cpacs_pt->info.uID + "/name"); writeCpacsXML(this->cpacs_pt->info.description, "cpacs/vehicles/aircraft/model@uID=" + this->cpacs_pt->info.uID + "/description"); - /* Add name and version to toolspecific node */ + /* Add name and version to toolspecific node */ // TODO(Gerrit): Toolspec. -> kick out? writeCpacsXML("UNICADO", "cpacs/toolspecific/tool/name"); writeCpacsXML(TOOL_VERSION, "cpacs/toolspecific/tool/version"); } @@ -201,45 +262,42 @@ void UNICADO2CPACS::writeMaterials() { /* Function writes the analysis information in the cpacs file */ void UNICADO2CPACS::writeAnalysis() { /* <cpacs/vehicles/aircraft/model/analysis/aeroPerformanceMap> */ - if (this->aerodynamicSwitch == 1) { - myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/analysis/aeroPerformanceMap> ..." << std::endl; - this->writeAerodynamics(); - } + // if (this->aerodynamicSwitch == 1) { + // myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/analysis/aeroPerformanceMap> ..." << std::endl; + // this->writeAerodynamics(); + // } /* <cpacs/vehicles/aircraft/model/analysis/massBreakdown> */ - if (this->massesSwitch == 1) { + if (this->massesSwitch) { myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/analysis/massBreakdown> ..." << std::endl; this->writeMassesAndLoadings(); } /* <cpacs/vehicles/aircraft/model/analysis/monetaryValues> */ - if (this->monetarySwitch == 1) { - myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/analysis/monetaryValues> ..." << std::endl; - this->writeMonetaryValues(); - } + // if (this->monetarySwitch == 1) { + // myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/analysis/monetaryValues> ..." << std::endl; + // this->writeMonetaryValues(); + // } /* write ecological values dependent on cpacs version*/ - if (this->ecologicalSwitch == 1) { - if (this->cpacsVersion == "2.3.0") {/* <cpacs/vehicles/aircraft/model/analysis/noise> */ - myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/analysis/noise> ..." << std::endl; - } else {/* <cpacs/vehicles/aircraft/model/analysis/ecologicalValues> */ - myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/analysis/ecologicalValues> ..." << std::endl; - } - this->writeEcologicalValues(); - } + // if (this->ecologicalSwitch == 1) { + // if (this->cpacsVersion == "2.3.0") {/* <cpacs/vehicles/aircraft/model/analysis/noise> */ + // myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/analysis/noise> ..." << std::endl; + // } else {/* <cpacs/vehicles/aircraft/model/analysis/ecologicalValues> */ + // myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/analysis/ecologicalValues> ..." << std::endl; + // } + // this->writeEcologicalValues(); + // } /* <cpacs/vehicles/aircraft/model/analysis/weightAndBalance> */ - if (this->stabilityAndControlCharacteristicsSwitch == 1) { - myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/analysis/weightAndBalance> ..." << std::endl; - this->writeStabilityAndControlCharacteristics(); - } + // if (this->stabilityAndControlCharacteristicsSwitch == 1) { + // myRuntimeInfo->out << "Write <cpacs/vehicles/aircraft/model/analysis/weightAndBalance> ..." << std::endl; + // this->writeStabilityAndControlCharacteristics(); + // } } /* Function writes the masses and loading information in the cpacs file */ void UNICADO2CPACS::writeMassesAndLoadings() { -// NOTE (ohm#1#): rename into MassBreakdown massBreakdownPath = cpacsAcftModelXMLPath + "/analyses/massBreakdown"; - massBreakdownToolSpecificPath = cpacsAcftModelToolSpecificXMLPath + "/analyses/massBreakdown"; -// NOTE (ohm#1#): location of masses not defined in Unicado //Write all values to CPACs xml, even though a lot are still 0. due to not finding a representative in UNICADO structure //aem - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mMTM.mass, - massBreakdownToolSpecificPath + "/designMasses/mMTM@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_DesignMass_mMTM/mass"); //Maximum taxi mass + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mMTM.mass, + // massBreakdownToolSpecificPath + "/designMasses/mMTM@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_DesignMass_mMTM/mass"); //Maximum taxi mass writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mTOM.mass, massBreakdownPath + "/designMasses/mTOM@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_DesignMass_mTOM/mass"); // Maximum take-off mass writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mMLM.mass, @@ -252,7 +310,7 @@ void UNICADO2CPACS::writeMassesAndLoadings() { massBreakdownPath + "/payload/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_payloadMass/mass"); //Payload mass writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.fuel, massBreakdownPath + "/fuel/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_fuelMass/mass"); // Fuel mass - writeCpacsXML(this->unicado_pt->theUnicadoSystems.totalFuelVolume, massBreakdownToolSpecificPath + "/fuel/TotalFuelVolume"); // Fuel volume + // writeCpacsXML(this->unicado_pt->theUnicadoSystems.totalFuelVolume, massBreakdownToolSpecificPath + "/fuel/TotalFuelVolume"); // Fuel volume writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.mass, massBreakdownPath + "/mOEM/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mOEM/mass"); // Operating empty mass writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.location, @@ -262,18 +320,18 @@ void UNICADO2CPACS::writeMassesAndLoadings() { writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").location, massBreakdownPath + "/mOEM/mEM/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mEM/location"); //Empty mass center of gravity - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.load, massBreakdownToolSpecificPath + "/WingLoading"); - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.force, massBreakdownToolSpecificPath + "/ThrustToWeight"); - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.power, massBreakdownToolSpecificPath + "/PowerToWeight"); + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.load, massBreakdownToolSpecificPath + "/WingLoading"); + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.force, massBreakdownToolSpecificPath + "/ThrustToWeight"); + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.power, massBreakdownToolSpecificPath + "/PowerToWeight"); - writeMat3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.MomentofInertia, massBreakdownToolSpecificPath + "/MomentsOfInertia"); + // writeMat3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.MomentofInertia, massBreakdownToolSpecificPath + "/MomentsOfInertia"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.COGTrimRefPt, - massBreakdownToolSpecificPath + "/CentreOfGravityRange/TrimRefPt/location"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.COGForwardLimit, - massBreakdownToolSpecificPath + "/CentreOfGravityRange/ForwardLimit/location"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.COGAftLimit, - massBreakdownToolSpecificPath + "/CentreOfGravityRange/AftLimit/location"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.COGTrimRefPt, + // massBreakdownToolSpecificPath + "/CentreOfGravityRange/TrimRefPt/location"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.COGForwardLimit, + // massBreakdownToolSpecificPath + "/CentreOfGravityRange/ForwardLimit/location"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.COGAftLimit, + // massBreakdownToolSpecificPath + "/CentreOfGravityRange/AftLimit/location"); this->writeMassBreakdown(); } @@ -324,78 +382,78 @@ void UNICADO2CPACS::writeMassBreakdown() { writeVec3CpacsXml(wingStructure.at("centerWing").location, mWingStructurePath + "/mComponentSegments/mComponentSegment/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_component/location"); - writeCpacsXML("Other wing components (skins, spars, ribs, pylon attachments, LG supports)", mWingStructurePath + - "/mComponentSegments/mComponentSegment/mMiscellaneous/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMiscellaneous/description"); - writeCpacsXML(wingStructureComponents.at("mMiscellaneous").mass, mWingStructurePath + - "/mComponentSegments/mComponentSegment/mMiscellaneous/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMiscellaneous/mass"); - writeVec3CpacsXml(wingStructureComponents.at("mMiscellaneous").location, mWingStructurePath + - "/mComponentSegments/mComponentSegment/mMiscellaneous/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMiscellaneous/location"); - writeCpacsXML(wingStructureComponents.at("mFixedLeadingEdges").mass, mWingStructurePath + - "/mComponentSegments/mComponentSegment/mFixedLeadingEdges/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mFixedLeadingEdges/mass"); - writeVec3CpacsXml(wingStructureComponents.at("mFixedLeadingEdges").location, mWingStructurePath + - "/mComponentSegments/mComponentSegment/mFixedLeadingEdges/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mFixedLeadingEdges/location"); - writeCpacsXML(wingStructureComponents.at("mFixedTrailingEdges").mass, mWingStructurePath + - "/mComponentSegments/mComponentSegment/mFixedTrailingEdges/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mFixedTrailingEdges/mass"); - writeVec3CpacsXml(wingStructureComponents.at("mFixedTrailingEdges").location, mWingStructurePath + - "/mComponentSegments/mComponentSegment/mFixedTrailingEdges/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mFixedTrailingEdges/location"); - writeCpacsXML(wingStructureComponents.at("mMoveables").mass, mWingStructurePath + - "/mComponentSegments/mComponentSegment/mMoveables/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMoveables/mass"); - writeVec3CpacsXml(wingStructureComponents.at("mMoveables").location, mWingStructurePath + - "/mComponentSegments/mComponentSegment/mMoveables/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMoveables/location"); - writeCpacsXML(wingStructureComponents.at("mMoveables").at("mMoveableLeadingEdges").mass, mWingStructurePath + - "/mComponentSegments/mComponentSegment/mMoveables/mMoveableLeadingEdges/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMoveable_LeadingEdges/mass"); - writeVec3CpacsXml(wingStructureComponents.at("mMoveables").at("mMoveableLeadingEdges").location, mWingStructurePath + - "/mComponentSegments/mComponentSegment/mMoveables/mMoveableLeadingEdges/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMoveable_LeadingEdges/location"); - writeCpacsXML(wingStructureComponents.at("mMoveables").at("mMoveableTrailingEdge").mass, mWingStructurePath + - "/mComponentSegments/mComponentSegment/mMoveables/mMoveableTrailingEdge/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMoveable_TrailingEdge/mass"); - writeVec3CpacsXml(wingStructureComponents.at("mMoveables").at("mMoveableTrailingEdge").location, mWingStructurePath + - "/mComponentSegments/mComponentSegment/mMoveables/mMoveableTrailingEdge/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMoveable_TrailingEdge/location"); - mWingStructureNodes.push_back(&this->cpacs_file->at(mWingStructurePath)); - - writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").mass, massBreakdownToolSpecificPath + - "/mOEM/mEM/mStructure/mWingsStructure/WingLEandTE/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_WingLEandTE/mass"); - writeVec3CpacsXml(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").refPoint, massBreakdownToolSpecificPath - + "/mOEM/mEM/mStructure/mWingsStructure/WingLEandTE/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_WingLEandTE/location"); - - writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("Miscellaneous").mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mStructure/mWingsStructure/Miscellaneous/massDescription/mass"); - writeVec3CpacsXml(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("Miscellaneous").refPoint, - massBreakdownToolSpecificPath + "/mOEM/mEM/mStructure/mWingsStructure/Miscellaneous/massDescription/location"); + // writeCpacsXML("Other wing components (skins, spars, ribs, pylon attachments, LG supports)", mWingStructurePath + + // "/mComponentSegments/mComponentSegment/mMiscellaneous/massDescription@uID=" + + // this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMiscellaneous/description"); + // writeCpacsXML(wingStructureComponents.at("mMiscellaneous").mass, mWingStructurePath + + // "/mComponentSegments/mComponentSegment/mMiscellaneous/massDescription@uID=" + + // this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMiscellaneous/mass"); + // writeVec3CpacsXml(wingStructureComponents.at("mMiscellaneous").location, mWingStructurePath + + // "/mComponentSegments/mComponentSegment/mMiscellaneous/massDescription@uID=" + + // this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMiscellaneous/location"); + // writeCpacsXML(wingStructureComponents.at("mFixedLeadingEdges").mass, mWingStructurePath + + // "/mComponentSegments/mComponentSegment/mFixedLeadingEdges/massDescription@uID=" + + // this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mFixedLeadingEdges/mass"); + // writeVec3CpacsXml(wingStructureComponents.at("mFixedLeadingEdges").location, mWingStructurePath + + // "/mComponentSegments/mComponentSegment/mFixedLeadingEdges/massDescription@uID=" + + // this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mFixedLeadingEdges/location"); + // writeCpacsXML(wingStructureComponents.at("mFixedTrailingEdges").mass, mWingStructurePath + + // "/mComponentSegments/mComponentSegment/mFixedTrailingEdges/massDescription@uID=" + + // this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mFixedTrailingEdges/mass"); + // writeVec3CpacsXml(wingStructureComponents.at("mFixedTrailingEdges").location, mWingStructurePath + + // "/mComponentSegments/mComponentSegment/mFixedTrailingEdges/massDescription@uID=" + + // this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mFixedTrailingEdges/location"); + // writeCpacsXML(wingStructureComponents.at("mMoveables").mass, mWingStructurePath + + // "/mComponentSegments/mComponentSegment/mMoveables/massDescription@uID=" + + // this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMoveables/mass"); + // writeVec3CpacsXml(wingStructureComponents.at("mMoveables").location, mWingStructurePath + + // "/mComponentSegments/mComponentSegment/mMoveables/massDescription@uID=" + + // this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMoveables/location"); + // writeCpacsXML(wingStructureComponents.at("mMoveables").at("mMoveableLeadingEdges").mass, mWingStructurePath + + // "/mComponentSegments/mComponentSegment/mMoveables/mMoveableLeadingEdges/massDescription@uID=" + + // this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMoveable_LeadingEdges/mass"); + // writeVec3CpacsXml(wingStructureComponents.at("mMoveables").at("mMoveableLeadingEdges").location, mWingStructurePath + + // "/mComponentSegments/mComponentSegment/mMoveables/mMoveableLeadingEdges/massDescription@uID=" + + // this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMoveable_LeadingEdges/location"); + // writeCpacsXML(wingStructureComponents.at("mMoveables").at("mMoveableTrailingEdge").mass, mWingStructurePath + + // "/mComponentSegments/mComponentSegment/mMoveables/mMoveableTrailingEdge/massDescription@uID=" + + // this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMoveable_TrailingEdge/mass"); + // writeVec3CpacsXml(wingStructureComponents.at("mMoveables").at("mMoveableTrailingEdge").location, mWingStructurePath + + // "/mComponentSegments/mComponentSegment/mMoveables/mMoveableTrailingEdge/massDescription@uID=" + + // this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_centerWing_mMoveable_TrailingEdge/location"); + // mWingStructureNodes.push_back(&this->cpacs_file->at(mWingStructurePath)); + + // writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").mass, massBreakdownToolSpecificPath + + // "/mOEM/mEM/mStructure/mWingsStructure/WingLEandTE/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_WingLEandTE/mass"); + // writeVec3CpacsXml(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("WingLEandTE").refPoint, massBreakdownToolSpecificPath + // + "/mOEM/mEM/mStructure/mWingsStructure/WingLEandTE/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_WingLEandTE/location"); + + // writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("Miscellaneous").mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mStructure/mWingsStructure/Miscellaneous/massDescription/mass"); + // writeVec3CpacsXml(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.wing.at("Miscellaneous").refPoint, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mStructure/mWingsStructure/Miscellaneous/massDescription/location"); /* Empennage masses */ - writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mStructure/mEmpennageStructure/massDescription/mass"); - writeVec3CpacsXml(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.refPoint, - massBreakdownToolSpecificPath + "/mOEM/mEM/mStructure/mEmpennageStructure/massDescription/location"); + // writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mStructure/mEmpennageStructure/massDescription/mass"); + // writeVec3CpacsXml(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.empennage.refPoint, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mStructure/mEmpennageStructure/massDescription/location"); mWingStructurePath = massBreakdownPath + "/mOEM/mEM/mStructure/mWingsStructure/mWingStructure@uID=" + this->cpacs_pt->info.uID + "_Dummy_massBreakdown_mWingStructure_fin"; - writeCpacsXML(wingStructure.at("fin").mass, mWingStructurePath + - "/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_fin/mass"); - writeVec3CpacsXml(wingStructure.at("fin").location, mWingStructurePath + - "/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_fin/location"); + writeCpacsXML(wingStructure.at("empennage").mass, mWingStructurePath + + "/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_empennage/mass"); + writeVec3CpacsXml(wingStructure.at("empennage").location, mWingStructurePath + + "/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_empennage/location"); mWingStructureNodes.push_back(&this->cpacs_file->at(mWingStructurePath)); - mWingStructurePath = massBreakdownPath + "/mOEM/mEM/mStructure/mWingsStructure/mWingStructure@uID=" + - this->cpacs_pt->info.uID + "_Dummy_massBreakdown_mWingStructure_tailplane"; - writeCpacsXML(wingStructure.at("tailplane").mass, mWingStructurePath + - "/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_tailplane/mass"); - writeVec3CpacsXml(wingStructure.at("tailplane").location, mWingStructurePath + - "/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_tailplane/location"); - mWingStructureNodes.push_back(&this->cpacs_file->at(mWingStructurePath)); + // mWingStructurePath = massBreakdownPath + "/mOEM/mEM/mStructure/mWingsStructure/mWingStructure@uID=" + + // this->cpacs_pt->info.uID + "_Dummy_massBreakdown_mWingStructure_tailplane"; + // writeCpacsXML(wingStructure.at("tailplane").mass, mWingStructurePath + + // "/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_tailplane/mass"); + // writeVec3CpacsXml(wingStructure.at("tailplane").location, mWingStructurePath + + // "/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mWingStructure_tailplane/location"); + // mWingStructureNodes.push_back(&this->cpacs_file->at(mWingStructurePath)); for (node* aNode : mWingStructureNodes) { aNode->deleteAttrib("uID");//Delete uIDs from mWingStructureNodes (in CPACS, those are only needed within the description) @@ -408,10 +466,10 @@ void UNICADO2CPACS::writeMassBreakdown() { "/mOEM/mEM/mStructure/mLandingGears/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mLandingGears/location"); /* Pylons */ - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mStructure").at("mPylons").mass, massBreakdownPath + - "/mOEM/mEM/mStructure/mPylons/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mPylons/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mStructure").at("mPylons").location, massBreakdownPath + - "/mOEM/mEM/mStructure/mPylons/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mPylons/location"); + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mStructure").at("mPylons").mass, massBreakdownPath + + // "/mOEM/mEM/mStructure/mPylons/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mPylons/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mStructure").at("mPylons").location, massBreakdownPath + + // "/mOEM/mEM/mStructure/mPylons/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mPylons/location"); /* PowerUnits */ writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").mass, massBreakdownPath + @@ -444,26 +502,26 @@ void UNICADO2CPACS::writeMassBreakdown() { writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngines").at("Engine" + num2Str(i + 1)).location, mEnginePath + "/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_Engine_" + num2Str(i + 1) + "/location"); - writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine" + num2Str(i + 1)).at("Nacelle").mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngines/mEngine@uID=" + this->cpacs_pt->info.uID + "_toolspecific_Engine_" + num2Str(i + 1) + - "/Nacelle/massDescription/mass"); - writeVec3CpacsXml(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine" + num2Str(i + 1)).at("Nacelle").refPoint, - massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngines/mEngine@uID=" + - this->cpacs_pt->info.uID + "_toolspecific_Engine_" + num2Str(i + 1) + "/Nacelle/massDescription/location"); - - writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine" + num2Str(i + 1)).at("OtherSystems").mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngines/mEngine@uID=" + this->cpacs_pt->info.uID + "_toolspecific_Engine_" + num2Str(i + 1) + - "/OtherSystems/massDescription/mass"); - writeVec3CpacsXml(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine" + num2Str(i + 1)).at("OtherSystems").refPoint, - massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngines/mEngine@uID=" + - this->cpacs_pt->info.uID + "_toolspecific_Engine_" + num2Str(i + 1) + "/OtherSystems/massDescription/location"); - - writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine" + num2Str(i + 1)).at("Prop").mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngines/mEngine@uID=" + this->cpacs_pt->info.uID + "_toolspecific_Engine_" + num2Str(i + 1) + - "/Prop/massDescription/mass"); - writeVec3CpacsXml(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine" + num2Str(i + 1)).at("Prop").refPoint, - massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngines/mEngine@uID=" + - this->cpacs_pt->info.uID + "_toolspecific_Engine_" + num2Str(i + 1) + "/Prop/massDescription/location"); + // writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine" + num2Str(i + 1)).at("Nacelle").mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngines/mEngine@uID=" + this->cpacs_pt->info.uID + "_toolspecific_Engine_" + num2Str(i + 1) + + // "/Nacelle/massDescription/mass"); + // writeVec3CpacsXml(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine" + num2Str(i + 1)).at("Nacelle").refPoint, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngines/mEngine@uID=" + + // this->cpacs_pt->info.uID + "_toolspecific_Engine_" + num2Str(i + 1) + "/Nacelle/massDescription/location"); + + // writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine" + num2Str(i + 1)).at("OtherSystems").mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngines/mEngine@uID=" + this->cpacs_pt->info.uID + "_toolspecific_Engine_" + num2Str(i + 1) + + // "/OtherSystems/massDescription/mass"); + // writeVec3CpacsXml(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine" + num2Str(i + 1)).at("OtherSystems").refPoint, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngines/mEngine@uID=" + + // this->cpacs_pt->info.uID + "_toolspecific_Engine_" + num2Str(i + 1) + "/OtherSystems/massDescription/location"); + + // writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine" + num2Str(i + 1)).at("Prop").mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngines/mEngine@uID=" + this->cpacs_pt->info.uID + "_toolspecific_Engine_" + num2Str(i + 1) + + // "/Prop/massDescription/mass"); + // writeVec3CpacsXml(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine" + num2Str(i + 1)).at("Prop").refPoint, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngines/mEngine@uID=" + + // this->cpacs_pt->info.uID + "_toolspecific_Engine_" + num2Str(i + 1) + "/Prop/massDescription/location"); mEngineNodes.push_back(&this->cpacs_file->at(mEnginePath)); } @@ -475,24 +533,24 @@ void UNICADO2CPACS::writeMassBreakdown() { /* Engine dry mass can be found in CPACS engines node and not within mass breakdown * Since only one engine type can be specified by now, only engine 1 is taken for theCpacsEngines */ - for (unsigned int i(0); i < this->cpacs_pt->theCpacsEngines.size(); ++i) { - //check if the same engine type was already specified - if (i == 0 || this->cpacs_pt->theCpacsEngines.at(i).info.uID != this->cpacs_pt->theCpacsEngines.at(i-1).info.uID) { - std::string EngineAnalysisPath("cpacs/vehicles/engines/engine@uID=" + this->cpacs_pt->theCpacsEngines.at(i).info.uID + "_engine/analysis"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).info.name + " engine dry mass", EngineAnalysisPath + "/mass/name"); - this->cpacs_file->at(EngineAnalysisPath + "/mass", 1).addAttrib("uID", this->cpacs_pt->theCpacsEngines.at(i).info.uID + "_engine_dry_mass"); - writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine1").at("EngineDry").mass, - EngineAnalysisPath + "/mass/mass"); - } - } + // for (unsigned int i(0); i < this->cpacs_pt->theCpacsEngines.size(); ++i) { + // //check if the same engine type was already specified + // if (i == 0 || this->cpacs_pt->theCpacsEngines.at(i).info.uID != this->cpacs_pt->theCpacsEngines.at(i-1).info.uID) { + // std::string EngineAnalysisPath("cpacs/vehicles/engines/engine@uID=" + this->cpacs_pt->theCpacsEngines.at(i).info.uID + "_engine/analysis"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).info.name + " engine dry mass", EngineAnalysisPath + "/mass/name"); + // this->cpacs_file->at(EngineAnalysisPath + "/mass", 1).addAttrib("uID", this->cpacs_pt->theCpacsEngines.at(i).info.uID + "_engine_dry_mass"); + // writeCpacsXML(this->unicado_pt->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at("Engine1").at("EngineDry").mass, + // EngineAnalysisPath + "/mass/mass"); + // } + // } } /* Accommodation */ - if (this->accommodationSwitch == 1) { - if (this->massesSwitch == 0) - massBreakdownPath = cpacsAcftModelXMLPath + "/analyses/massBreakdown"; - this->writeAccommodation(); - } + // if (this->accommodationSwitch == 1) { + // if (this->massesSwitch == 0) + // massBreakdownPath = cpacsAcftModelXMLPath + "/analyses/massBreakdown"; + // this->writeAccommodation(); + // } /* Seat masses */ std::vector<node*> mSeatsNodes; @@ -500,25 +558,25 @@ void UNICADO2CPACS::writeMassBreakdown() { std::string seatName; writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mSeats").mass, massBreakdownPath + "/mOEM/mOperatorItems/mSeats/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mSeats/mass"); - for (int i = 0; i < this->unicado_pt->theUnicadoAccommodation.noOfSeatTypes; i++) { - for (int j = 0; j < this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).noOfSeatConfigurations; j++) { - seatName = this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).seatClassType + "_seat_" + num2Str(j + 1); - mSeatsPath = massBreakdownPath + "/mOEM/mOperatorItems/mSeats/mSeat@uID=" + this->cpacs_pt->info.uID + - "_massBreakdown_mSeats_Dummy_" + seatName; - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mSeats").at(seatName).mass, - mSeatsPath + "/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mSeats_" + seatName + "/mass"); - writeCpacsXML(this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).theSeatConfiguration.at(j).noOfSeats, - massBreakdownToolSpecificPath + "/mOEM/mOperatorItems/mSeats/" + seatName + "/noOfSeats"); - if (this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).IFE) { - writeCpacsXML(this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).massIFE, - massBreakdownToolSpecificPath + "/mOEM/mOperatorItems/mSeats/" + seatName + "/IFE/massDescription/mass"); - } - mSeatsNodes.push_back(&this->cpacs_file->at(mSeatsPath)); - } - } - for (node* aNode : mSeatsNodes) { - aNode->deleteAttrib("uID");//Delete uIDs from seatsNodes (in CPACS, those are only needed within the description) - } + // for (int i = 0; i < this->unicado_pt->theUnicadoAccommodation.noOfSeatTypes; i++) { + // for (int j = 0; j < this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).noOfSeatConfigurations; j++) { + // seatName = this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).seatClassType + "_seat_" + num2Str(j + 1); + // mSeatsPath = massBreakdownPath + "/mOEM/mOperatorItems/mSeats/mSeat@uID=" + this->cpacs_pt->info.uID + + // "_massBreakdown_mSeats_Dummy_" + seatName; + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mSeats").at(seatName).mass, + // mSeatsPath + "/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mSeats_" + seatName + "/mass"); + // writeCpacsXML(this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).theSeatConfiguration.at(j).noOfSeats, + // massBreakdownToolSpecificPath + "/mOEM/mOperatorItems/mSeats/" + seatName + "/noOfSeats"); + // if (this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).IFE) { + // writeCpacsXML(this->unicado_pt->theUnicadoAccommodation.theSeats.at(i).massIFE, + // massBreakdownToolSpecificPath + "/mOEM/mOperatorItems/mSeats/" + seatName + "/IFE/massDescription/mass"); + // } + // mSeatsNodes.push_back(&this->cpacs_file->at(mSeatsPath)); + // } + // } + // for (node* aNode : mSeatsNodes) { + // aNode->deleteAttrib("uID");//Delete uIDs from seatsNodes (in CPACS, those are only needed within the description) + // } /* Systems */ writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").mass, massBreakdownPath + @@ -551,45 +609,45 @@ void UNICADO2CPACS::writeMassBreakdown() { writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").location, massBreakdownPath + "/mOEM/mEM/mSystems/mFlightControls/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mFlightControls/location"); - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mRoll").mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Roll/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mRoll").location, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Roll/massDescription/location"); - - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mYaw").mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Yaw/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mYaw").location, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Yaw/massDescription/location"); - - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mPitch").mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Pitch/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mPitch").location, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Pitch/massDescription/location"); - - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mMovableHorizontalTail").mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/MovableHorizontalTail/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mMovableHorizontalTail").location, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/MovableHorizontalTail/massDescription/location"); - - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mFlaps").mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Flaps/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mFlaps").location, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Flaps/massDescription/location"); - - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mSpoilersAirbrakesLiftdumpers").mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/SpoilersAirbrakesLiftdumpers/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mSpoilersAirbrakesLiftdumpers").location, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/SpoilersAirbrakesLiftdumpers/massDescription/location"); - - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mSlats").mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Slats/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mSlats").location, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Slats/massDescription/location"); - - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mCommonInstallation").mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/CommonInstallation/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mCommonInstallation").location, - massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/CommonInstallation/massDescription/location"); + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mRoll").mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Roll/massDescription/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mRoll").location, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Roll/massDescription/location"); + + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mYaw").mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Yaw/massDescription/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mYaw").location, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Yaw/massDescription/location"); + + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mPitch").mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Pitch/massDescription/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mPitch").location, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Pitch/massDescription/location"); + + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mMovableHorizontalTail").mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/MovableHorizontalTail/massDescription/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mMovableHorizontalTail").location, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/MovableHorizontalTail/massDescription/location"); + + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mFlaps").mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Flaps/massDescription/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mFlaps").location, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Flaps/massDescription/location"); + + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mSpoilersAirbrakesLiftdumpers").mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/SpoilersAirbrakesLiftdumpers/massDescription/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mSpoilersAirbrakesLiftdumpers").location, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/SpoilersAirbrakesLiftdumpers/massDescription/location"); + + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mSlats").mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Slats/massDescription/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mSlats").location, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/Slats/massDescription/location"); + + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mCommonInstallation").mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/CommonInstallation/massDescription/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mFlightControls").at("mCommonInstallation").location, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mSystems/mFlightControls/CommonInstallation/massDescription/location"); writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mSystems").at("mInstrumentPanel").mass, massBreakdownPath + "/mOEM/mEM/mSystems/mInstrumentPanel/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mInstrumentPanel/mass"); @@ -624,28 +682,28 @@ void UNICADO2CPACS::writeMassBreakdown() { writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mFuelSystem").location, massBreakdownPath + "/mOEM/mEM/mPowerUnits/mFuelSystem/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mFuelSystem/location"); - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControls").mass, - massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngineControls/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControls").location, - massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngineControls/massDescription/location"); + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControls").mass, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngineControls/massDescription/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mPowerUnits").at("mEngineControls").location, + // massBreakdownToolSpecificPath + "/mOEM/mEM/mPowerUnits/mEngineControls/massDescription/location"); writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").mass, massBreakdownPath + "/mOEM/mOperatorItems/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mOperatorItems/mass"); writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").location, massBreakdownPath + "/mOEM/mOperatorItems/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mOperatorItems/location"); - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mOperatorEquipment").mass, massBreakdownToolSpecificPath + - "/mOEM/mOperatorItems/mOperatorEquipment/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mOperatorEquipment").location, massBreakdownToolSpecificPath + - "/mOEM/mOperatorItems/mOperatorEquipment/massDescription/location"); + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mOperatorEquipment").mass, massBreakdownToolSpecificPath + + // "/mOEM/mOperatorItems/mOperatorEquipment/massDescription/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mOperatorEquipment").location, massBreakdownToolSpecificPath + + // "/mOEM/mOperatorItems/mOperatorEquipment/massDescription/location"); - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mOperationalEquipment").mass, massBreakdownToolSpecificPath + - "/mOEM/mOperatorItems/mOperationalEquipment/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mOperationalEquipment").location, massBreakdownToolSpecificPath + - "/mOEM/mOperatorItems/mOperationalEquipment/massDescription/location"); + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mOperationalEquipment").mass, massBreakdownToolSpecificPath + + // "/mOEM/mOperatorItems/mOperationalEquipment/massDescription/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mOperatorItems").at("mOperationalEquipment").location, massBreakdownToolSpecificPath + + // "/mOEM/mOperatorItems/mOperationalEquipment/massDescription/location"); - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mNotAllocated").mass, massBreakdownToolSpecificPath + "/mOEM/mNotAllocated/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mNotAllocated").location, massBreakdownToolSpecificPath + "/mOEM/mNotAllocated/massDescription/location"); + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mNotAllocated").mass, massBreakdownToolSpecificPath + "/mOEM/mNotAllocated/massDescription/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mNotAllocated").location, massBreakdownToolSpecificPath + "/mOEM/mNotAllocated/massDescription/location"); @@ -655,54 +713,32 @@ void UNICADO2CPACS::writeMassBreakdown() { "/mOEM/mEM/mSystems/mNavigation/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mNavigation/location"); /* Furnishings */ - if (this->cpacsVersion == "2.2") { - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mFurnishings").mass, - massBreakdownPath + "/mOEM/mEM/mFurnishing/mFurnishings/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mFurnishings").location, - massBreakdownPath + "/mOEM/mEM/mFurnishing/mFurnishings/massDescription/location"); - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mLightning").mass, - massBreakdownPath + "/mOEM/mEM/mFurnishing/mLightning/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mLightning").location, - massBreakdownPath + "/mOEM/mEM/mFurnishing/mLightning/massDescription/location"); - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mWaterSystem").mass, - massBreakdownPath + "/mOEM/mEM/mFurnishing/mWaterSystem/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mWaterSystem").location, - massBreakdownPath + "/mOEM/mEM/mFurnishing/mWaterSystem/massDescription/location"); - } else { - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").mass, massBreakdownPath + - "/mOEM/mEM/mFurnishing/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").location, massBreakdownPath + - "/mOEM/mEM/mFurnishing/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing/location"); - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mFurnishings").mass, massBreakdownPath + - "/mOEM/mEM/mFurnishing/mMiscellaneous/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mMiscellaneous/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mFurnishings").location, massBreakdownPath + - "/mOEM/mEM/mFurnishing/mMiscellaneous/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mMiscellaneous/location"); - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mCabinLightings").mass, - massBreakdownPath + "/mOEM/mEM/mFurnishing/mCabinLightings/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mCabinLightings/mass"); - /**< \todo [T1222] (https://unicado.ilr.rwth-aachen.de/T1222) (Ohm#1#) : revise hardcode - */ - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mCabinLightings").location, - massBreakdownPath + "/mOEM/mEM/mFurnishing/mCabinLightings/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mCabinLightings/location"); - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mFreshWaterSystems").mass, - massBreakdownPath + "/mOEM/mEM/mFurnishing/mFreshWaterSystems/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mFreshWaterSystems/mass"); - /**< \todo [T1223] (https://unicado.ilr.rwth-aachen.de/T1223) (Ohm#1#) : revise hardcode - */ - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mFreshWaterSystems").location, - massBreakdownPath + "/mOEM/mEM/mFurnishing/mFreshWaterSystems/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mFreshWaterSystems/location"); - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mEmergencyOxygenSystems").mass, - massBreakdownPath + "/mOEM/mEM/mFurnishing/mEmergencyOxygenSystems/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mEmergencyOxygenSystems/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mEmergencyOxygenSystems").location, - massBreakdownPath + "/mOEM/mEM/mFurnishing/mEmergencyOxygenSystems/massDescription@uID=" + - this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mEmergencyOxygenSystems/location"); - } - writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").mass, massBreakdownToolSpecificPath + "/mOEM/mEM/mFurnishing/massDescription/mass"); - writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").location, massBreakdownToolSpecificPath + - "/mOEM/mEM/mFurnishing/massDescription/location"); + writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").mass, massBreakdownPath + + "/mOEM/mEM/mFurnishing/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing/mass"); + writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").location, massBreakdownPath + + "/mOEM/mEM/mFurnishing/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing/location"); + writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").mass, massBreakdownPath + + "/mOEM/mEM/mFurnishing/mMiscellaneous/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mMiscellaneous/mass"); + writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").location, massBreakdownPath + + "/mOEM/mEM/mFurnishing/mMiscellaneous/massDescription@uID=" + this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mMiscellaneous/location"); + writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mCabinLightings").mass, + massBreakdownPath + "/mOEM/mEM/mFurnishing/mCabinLightings/massDescription@uID=" + + this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mCabinLightings/mass"); + /**< \todo [T1222] (https://unicado.ilr.rwth-aachen.de/T1222) (Ohm#1#) : revise hardcode + */ + writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mCabinLightings").location, + massBreakdownPath + "/mOEM/mEM/mFurnishing/mCabinLightings/massDescription@uID=" + + this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mCabinLightings/location"); + writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mEmergencyOxygenSystems").mass, + massBreakdownPath + "/mOEM/mEM/mFurnishing/mEmergencyOxygenSystems/massDescription@uID=" + + this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mEmergencyOxygenSystems/mass"); + writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").at("mEmergencyOxygenSystems").location, + massBreakdownPath + "/mOEM/mEM/mFurnishing/mEmergencyOxygenSystems/massDescription@uID=" + + this->cpacs_pt->info.uID + "_massBreakdown_mFurnishing_mEmergencyOxygenSystems/location"); + + // writeCpacsXML(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").mass, massBreakdownToolSpecificPath + "/mOEM/mEM/mFurnishing/massDescription/mass"); + // writeVec3CpacsXml(this->cpacs_pt->theCpacsMassBreakdown.mOEM.at("mEM").at("mFurnishing").location, massBreakdownToolSpecificPath + + // "/mOEM/mEM/mFurnishing/massDescription/location"); } /* Function writes the profile information in the cpacs file */ @@ -1294,13 +1330,13 @@ void UNICADO2CPACS::writePropulsionGeometry() { /* first write Engine Output, but check if the same engine was already specified */ if (i == 0 || this->cpacs_pt->theCpacsEngines.at(i).info.uID != this->cpacs_pt->theCpacsEngines.at(i-1).info.uID) { std::string EnginePath("cpacs/vehicles/engines/engine@uID=" + this->cpacs_pt->theCpacsEngines.at(i).info.uID + "_engine"); - std::string EnginePathToolSpecific("cpacs/toolspecific/tool/UNICADO/vehicles/engines/engine@uID=" + - this->cpacs_pt->theCpacsEngines.at(i).info.uID + "_engine_toolspecific"); + // std::string EnginePathToolSpecific("cpacs/toolspecific/tool/UNICADO/vehicles/engines/engine@uID=" + + // this->cpacs_pt->theCpacsEngines.at(i).info.uID + "_engine_toolspecific"); writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).info.name, EnginePath + "/name"); writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).info.description, EnginePath + "/description"); writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).length, EnginePath + "/geometry/length"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).width, EnginePathToolSpecific + "/geometry/width"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).height, EnginePathToolSpecific + "/geometry/height"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).width, EnginePathToolSpecific + "/geometry/width"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).height, EnginePathToolSpecific + "/geometry/height"); if (this->cpacs_pt->theCpacsEngines.at(i).diameter > 0) { writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).diameter, EnginePath + "/geometry/diameter"); } @@ -1310,81 +1346,18 @@ void UNICADO2CPACS::writePropulsionGeometry() { writeCpacsXML(0.5 * this->cpacs_pt->theCpacsEngines.at(i).fanDiameter, EnginePath + "/geometry/fan/outerRadius"); writeCpacsXML("NaN", EnginePath + "/geometry/fan/innerRadius"); // value is mandatory in CPACS but unknown -> set to NaN - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).scaleEngines, EnginePathToolSpecific + "/geometry/scaleEngines"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).ScaleFuelFlow, EnginePathToolSpecific + "/geometry/ScaleFuelFlow"); - - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theJetEngineData.slst, EnginePathToolSpecific + "/JetEngineData/SeaLevelStaticThrust"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theJetEngineData.fanDiameter, EnginePathToolSpecific + "/JetEngineData/fanDiameter"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).scaleEngines, EnginePathToolSpecific + "/geometry/scaleEngines"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).ScaleFuelFlow, EnginePathToolSpecific + "/geometry/ScaleFuelFlow"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theTurbopropEngineData.P_shp, EnginePathToolSpecific + "/TurbopropEngineData/P_shp"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theTurbopropEngineData.PropBlades, EnginePathToolSpecific + "/TurbopropEngineData/geometry/PropBlades"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theTurbopropEngineData.PropDiameter, EnginePathToolSpecific + "/TurbopropEngineData/geometry/PropDiameter"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theTurbopropEngineData.SegmentPointData, EnginePathToolSpecific + "/TurbopropEngineData/geometry/SegmentPointData"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theTurbopropEngineData.Pitch, EnginePathToolSpecific + "/TurbopropEngineData/geometry/Pitch"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theTurbopropEngineData.Thickness, EnginePathToolSpecific + "/TurbopropEngineData/geometry/Thickness"); - } - } - - /* write Pylon Output */ - //[zumegen, 22.12.20] check if pylons exist - if (this->unicado_pt->theUnicadoGeo.usedElements.Pylons >= 1) { - myRuntimeInfo->debug << "writePylonGeometry" << std::endl; - for (unsigned int i(0); i < this->cpacs_pt->theCpacsPylon.size(); ++i) { - std::string PylonPath = cpacsAcftModelXMLPath + "/enginePylons/enginePylon@uID=" + this->cpacs_pt->theCpacsPylon.at(i).info.uID; - writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).info.name, PylonPath + "/name"); - cpacs_file->at(PylonPath).addAttrib("symmetry", this->cpacs_pt->theCpacsPylon.at(i).info.symmetry); - writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).info.description, PylonPath + "/description"); - writeCpacsXML(this->cpacs_pt->theCpacsFuse.info.uID, PylonPath + "/parentUID"); - - /* Hack from TUHH for Pylon positioning at the wing */ - writeCpacsXML("90", PylonPath + "/transformation/rotation/x"); - - writeVec3CpacsXml(this->cpacs_pt->theCpacsPylon.at(i).trafo.translation, PylonPath + "/transformation/translation"); - - /* sections */ - myRuntimeInfo->debug << "writeSections" << std::endl; - uint8_t aSectionNumber(0); - for (const cpacsAcft::section& aPylonSection : this->cpacs_pt->theCpacsPylon.at(i).pylonSections) { - /* write sections */ - std::string PylonSectionPath = PylonPath + "/sections/section@uID=" + aPylonSection.info.uID; - writeCpacsXML(aPylonSection.info.name, PylonSectionPath + "/name"); - if (aSectionNumber != 0) - writeCpacsXML(aPylonSection.trafo.rotation[0], PylonSectionPath + "/transformation/rotation/x"); - writeCpacsXML(aPylonSection.trafo.rotation[1], PylonSectionPath + "/transformation/rotation/y"); - - /* write Section Elements corresponds to the airfoils */ - std::string PylonSectionElementPath = PylonSectionPath + "/elements/element@uID=" + aPylonSection.sectionElements.at(i).info.uID; - writeCpacsXML(aPylonSection.sectionElements.at(i).info.name, PylonSectionElementPath + "/name"); - writeVec3CpacsXml(aPylonSection.sectionElements.at(i).trafo.scaling, PylonSectionElementPath + "/transformation/scaling"); - - /*Airfoils and Wingprofile*/ - writeCpacsXML(aPylonSection.sectionElements.at(i).profileUID, PylonSectionElementPath + "/airfoilUID"); - - //Frage Aigner was ist mit convertWingDatProfile? - - /*write Wing Segments*/ - if (aSectionNumber != 0) { - std::string PylonSegmentsPath = PylonPath + "/segments/segment@uID=" + this->cpacs_pt->theCpacsPylon.at(i).pylonSegments.at(aSectionNumber - 1).info.uID; - writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonSegments.at(aSectionNumber - 1).info.name, PylonSegmentsPath + "/name"); - writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonSegments.at(aSectionNumber - 1).fromElementUID, PylonSegmentsPath + "/fromElementUID"); - writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonSegments.at(aSectionNumber - 1).toElementUID, PylonSegmentsPath + "/toElementUID"); - } + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theJetEngineData.slst, EnginePathToolSpecific + "/JetEngineData/SeaLevelStaticThrust"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theJetEngineData.fanDiameter, EnginePathToolSpecific + "/JetEngineData/fanDiameter"); - /* write positionings*/ - std::string PylonPositioningPath = PylonPath + "/positionings/positioning@uID=" + this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).uID; - writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).name, PylonPositioningPath + "/name"); - writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).length, PylonPositioningPath + "/length"); - if (aSectionNumber != 0) { - writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).sweepAngle, PylonPositioningPath + "/sweepAngle"); - writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).dihedralAngle, PylonPositioningPath + "/dihedralAngle"); - writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).fromSectionUID, PylonPositioningPath + "/fromSectionUID"); - } else { - writeCpacsXML(0, PylonPositioningPath + "/sweepAngle"); - writeCpacsXML(0, PylonPositioningPath + "/dihedralAngle"); - } - writeCpacsXML(this->cpacs_pt->theCpacsPylon.at(i).pylonPositionings.at(aSectionNumber).toSectionUID, PylonPositioningPath + "/toSectionUID"); - ++aSectionNumber; - } + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theTurbopropEngineData.P_shp, EnginePathToolSpecific + "/TurbopropEngineData/P_shp"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theTurbopropEngineData.PropBlades, EnginePathToolSpecific + "/TurbopropEngineData/geometry/PropBlades"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theTurbopropEngineData.PropDiameter, EnginePathToolSpecific + "/TurbopropEngineData/geometry/PropDiameter"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theTurbopropEngineData.SegmentPointData, EnginePathToolSpecific + "/TurbopropEngineData/geometry/SegmentPointData"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theTurbopropEngineData.Pitch, EnginePathToolSpecific + "/TurbopropEngineData/geometry/Pitch"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theTurbopropEngineData.Thickness, EnginePathToolSpecific + "/TurbopropEngineData/geometry/Thickness"); } } } @@ -2091,7 +2064,6 @@ void UNICADO2CPACS::writeEnginePerformance() { "_engine/analysis/performanceMaps/performanceMap@uID=" + this->cpacs_pt->theCpacsEngines.at(i).info.uID + "_map_N1_" + this->cpacs_pt->theCpacsEngines.at(i).theEnginePerformanceMap.engineRating[j]); std::string engineAnalysisPath("cpacs/vehicles/engines/engine@uID=" + this->cpacs_pt->theCpacsEngines.at(i).info.uID + "_engine/analysis"); - /* Engine analysis */ writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).info.name + " engine", "cpacs/vehicles/engines/engine@uID=" + this->cpacs_pt->theCpacsEngines.at(i).info.uID + "_engine/name"); @@ -2138,39 +2110,40 @@ void UNICADO2CPACS::writeEnginePerformance() { writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).theEnginePerformanceMap.v18[j], enginePerformancePath + "/v18"); this->cpacs_file->at(enginePerformancePath + "/v18", 1).addAttrib("mapType", "std::vector"); } - std::string EnginePathToolSpecific("cpacs/toolspecific/tool/UNICADO/vehicles/engines/engine@uID=" + this->cpacs_pt->theCpacsEngines.at(i).info.uID + "_engine_toolspecific"); - - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).EquivalentThrust, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/EquivalentThrust"); - - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxTakeOff.Thrust, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxTakeOff/Thrust"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxTakeOff.FuelFlow, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxTakeOff/FuelFlow"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxTakeOff.TSFC, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxTakeOff/TSFC"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxTakeOff.N1, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxTakeOff/N1"); - - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxGoAround.Thrust, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxGoAround/Thrust"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxGoAround.FuelFlow, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxGoAround/FuelFlow"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxGoAround.TSFC, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxGoAround/TSFC"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxGoAround.N1, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxGoAround/N1"); - - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousMax.Thrust, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousMax/Thrust"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousMax.FuelFlow, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousMax/FuelFlow"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousMax.TSFC, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousMax/TSFC"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousMax.N1, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousMax/N1"); - - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucket.Thrust, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousBucket/Thrust"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucket.FuelFlow, EnginePathToolSpecific + - "/ScaledPerformanceCharacteristics/maxContinuousBucket/FuelFlow"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucket.TSFC, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousBucket/TSFC"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucket.N1, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousBucket/N1"); - - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucketOfftakes.Thrust, EnginePathToolSpecific + - "/ScaledPerformanceCharacteristics/maxContinuousBucketOfftakes/Thrust"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucketOfftakes.FuelFlow, EnginePathToolSpecific + - "/ScaledPerformanceCharacteristics/maxContinuousBucketOfftakes/FuelFlow"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucketOfftakes.TSFC, EnginePathToolSpecific + - "/ScaledPerformanceCharacteristics/maxContinuousBucketOfftakes/TSFC"); - writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucketOfftakes.N1, EnginePathToolSpecific + - "/ScaledPerformanceCharacteristics/maxContinuousBucketOfftakes/N1"); + //TODO(Gerrit): toolspec -> kick out? + // std::string EnginePathToolSpecific("cpacs/toolspecific/tool/UNICADO/vehicles/engines/engine@uID=" + this->cpacs_pt->theCpacsEngines.at(i).info.uID + "_engine_toolspecific"); + + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).EquivalentThrust, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/EquivalentThrust"); + + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxTakeOff.Thrust, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxTakeOff/Thrust"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxTakeOff.FuelFlow, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxTakeOff/FuelFlow"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxTakeOff.TSFC, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxTakeOff/TSFC"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxTakeOff.N1, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxTakeOff/N1"); + + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxGoAround.Thrust, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxGoAround/Thrust"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxGoAround.FuelFlow, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxGoAround/FuelFlow"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxGoAround.TSFC, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxGoAround/TSFC"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxGoAround.N1, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxGoAround/N1"); + + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousMax.Thrust, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousMax/Thrust"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousMax.FuelFlow, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousMax/FuelFlow"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousMax.TSFC, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousMax/TSFC"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousMax.N1, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousMax/N1"); + + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucket.Thrust, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousBucket/Thrust"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucket.FuelFlow, EnginePathToolSpecific + + // "/ScaledPerformanceCharacteristics/maxContinuousBucket/FuelFlow"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucket.TSFC, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousBucket/TSFC"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucket.N1, EnginePathToolSpecific + "/ScaledPerformanceCharacteristics/maxContinuousBucket/N1"); + + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucketOfftakes.Thrust, EnginePathToolSpecific + + // "/ScaledPerformanceCharacteristics/maxContinuousBucketOfftakes/Thrust"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucketOfftakes.FuelFlow, EnginePathToolSpecific + + // "/ScaledPerformanceCharacteristics/maxContinuousBucketOfftakes/FuelFlow"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucketOfftakes.TSFC, EnginePathToolSpecific + + // "/ScaledPerformanceCharacteristics/maxContinuousBucketOfftakes/TSFC"); + // writeCpacsXML(this->cpacs_pt->theCpacsEngines.at(i).maxContinuousBucketOfftakes.N1, EnginePathToolSpecific + + // "/ScaledPerformanceCharacteristics/maxContinuousBucketOfftakes/N1"); } } } @@ -2766,7 +2739,8 @@ node* UNICADO2CPACS::createCpacsXmlPath(const std::string& xMLPath, const bool& if (uID.size() > 1) { id = split(uID.at(1), '=').at(1); } - if (!cpacs_file->find(current + "/" + aChild, 1) || (compareStrings(aChild, structure.back(), true) && duplicateChild)) { //search depth = 1, only the exact path is searched + if (!cpacs_file->find(current + "/" + aChild, 1) || //search depth = 1, only the exact path is searched + (compareStrings(aChild, structure.back(), true) && duplicateChild)) { node* tmp = new node(split(aChild, '@').at(0), true); if (id.compare("")) { tmp->setAttrib("uID", id); diff --git a/cpacs_interface/src/UNICADO2CPACS/unicado_aircraft/unicado_aircraft.cpp b/cpacs_interface/src/UNICADO2CPACS/unicado_aircraft/unicado_aircraft.cpp index d831cc175789496214e162d179b78e2f6f700942..8f5026a7730ee161e18fc093c8489a3ef6544bac 100644 --- a/cpacs_interface/src/UNICADO2CPACS/unicado_aircraft/unicado_aircraft.cpp +++ b/cpacs_interface/src/UNICADO2CPACS/unicado_aircraft/unicado_aircraft.cpp @@ -28,18 +28,15 @@ UnicadoAircraft::UnicadoAircraft(const std::shared_ptr<RuntimeIO>& rtIO) : rtIO(rtIO), dummy_path("../projects/CSR-CSMR/CSR-02/cleanSheetDesign/CSR-02.xml"), - dummy_engine_path("../projects/CSR-CSMR/CSR-02/cleanSheetDesign/engineData/PW1127G-JM"), unicadoXML(aixml::openDocument(dummy_path)), - myEngine(nullptr), - propulsionAlreadyRead(false), - acftName(rtIO->aircraft_type() + "-" + rtIO->aircraft_model()) {; - engineDataFile = (""); //std::string(unicadoXML.at("/AcftExchangeFile/Propulsion/Engine@1/EngineDataFile")); - engineDataDir = (""); // mySettingsPt->getIoDir() + engineDataFile.substr(0, engineDataFile.rfind("/") + 1); + acftName(rtIO->aircraft_type() + "-" + rtIO->aircraft_model()) { - /* Set default values for nacelle scaling */ - theUnicadoPropulsion.theNacellePositioning.theOuterNacelle.widthRatio = 1.0; - theUnicadoPropulsion.theNacellePositioning.theOuterNacelle.heightRatio = 1.0; - theUnicadoPropulsion.theNacellePositioning.theOuterNacelle.lengthRatio = 1.0; + /* Set default values for nacelle scaling */ // TODO(GErrit): Put this into propulsion reader + for (UnicadoAircraft::unicadoPropulsion engine : theUnicadoPropulsion) { + engine.theNacellePositioning.theOuterNacelle.widthRatio = 1.0; + engine.theNacellePositioning.theOuterNacelle.heightRatio = 1.0; + engine.theNacellePositioning.theOuterNacelle.lengthRatio = 1.0; + } } /* Destructor for UnicadoAircraft object */ @@ -283,15 +280,41 @@ UnicadoAircraft::unicadoPropulsion::nacellePositioning::nacelleLocationType::nac lengthRatio(0.) { } + +/* Initialization of attributes for the enginePerformanceMap object with the constructor */ +UnicadoAircraft::unicadoPropulsion::enginePerformanceMap::enginePerformanceMap() + : + n1Max(), + n2Max(), + thrust(), + mDotFuel(), + mDot8(), + mDot18(), + n2(), + rho8(), + rho18(), + t8(), + t18(), + t2(), + v8(), + v18() { +} + +/* Destructor for enginePerformanceMap object */ +UnicadoAircraft::unicadoPropulsion::enginePerformanceMap::~enginePerformanceMap() { +} + + /* Initialization of attributes for the unicadoPropulsion object with the constructor */ UnicadoAircraft::unicadoPropulsion::unicadoPropulsion() : typeOfEngine(""), engineModel(""), - noOfEngines(0), + ID(0), scaleEngines(0.), scaleFuelFlow(0.), engineFile(""), + engine(nullptr), maxTakeOff(0., 0., 0., 0.), maxGoAround(0., 0., 0., 0.), maxContinuousMax(0., 0., 0., 0.), @@ -621,29 +644,6 @@ UnicadoAircraft::unicadoPerformance::takeOff::takeOff() finalSegmentClimbGradient(0.) { } -/* Initialization of attributes for the enginePerformanceMap object with the constructor */ -UnicadoAircraft::unicadoPerformance::enginePerformanceMap::enginePerformanceMap() - : - n1Max(), - n2Max(), - thrust(), - mDotFuel(), - mDot8(), - mDot18(), - n2(), - rho8(), - rho18(), - t8(), - t18(), - t2(), - v8(), - v18() { -} - -/* Destructor for enginePerformanceMap object */ -UnicadoAircraft::unicadoPerformance::enginePerformanceMap::~enginePerformanceMap() { -} - /* Initialization of attributes for the missionAnalysis object with the constructor */ UnicadoAircraft::unicadoPerformance::missionAnalysis::missionAnalysis() : @@ -702,7 +702,7 @@ UnicadoAircraft::unicadoPerformance::missionAnalysis::trajectory::trajectory() { UnicadoAircraft::unicadoPerformance::missionAnalysis::cruiseStep::cruiseStep() : relStepLength(.0), - flightLevel(0) { + flightLevel(0.) { } /* Initialization of attributes for the tlars object with the constructor */ @@ -1537,24 +1537,22 @@ void UnicadoAircraft::readMassesAndLoadings() { /* PowerUnit */ subpath = "component_design/propulsion/specific"; - readMassBreakdown("component_design/propulsion", this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit); // TODO(Kamyar): Not to be found in new xml yet! + readMassBreakdown("component_design/propulsion", this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit); this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.emplace("Engines", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.emplace("Pylons", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.emplace("Nacelles", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); for (node* propulsor : rtIO->acxml.at(subpath).getVector("propulsion")) { - std::string key_tmp("Engine" + num2Str(propulsor->getIntAttrib("ID"))); + uint16_t ID(propulsor->getIntAttrib("ID")); std::string propulsor_path(subpath + "/" + propulsor->getName() + "@" + num2Str(propulsor->getIntAttrib("ID"))); - this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").emplace(key_tmp, UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); - readMassBreakdown(propulsor_path + "/engine", this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at(key_tmp)); + this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").emplace(num2Str(ID), UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); + readMassBreakdown(propulsor_path + "/engine", this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Engines").at(num2Str(ID))); - key_tmp = "Nacelle" + num2Str(propulsor->getIntAttrib("ID")); - this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Nacelles").emplace(key_tmp, UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); - readMassBreakdown(propulsor_path + "/nacelle", this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Nacelles").at(key_tmp)); + this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Nacelles").emplace(num2Str(ID), UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); + readMassBreakdown(propulsor_path + "/nacelle", this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Nacelles").at(num2Str(ID))); - key_tmp = "Pylon" + num2Str(propulsor->getIntAttrib("ID")); - this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Pylons").emplace(key_tmp, UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); - readMassBreakdown(propulsor_path + "/pylon", this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Pylons").at(key_tmp)); + this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Pylons").emplace(num2Str(ID), UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); + readMassBreakdown(propulsor_path + "/pylon", this->theUnicadoMassesAndLoadings.theMassBreakdown.powerUnit.at("Pylons").at(num2Str(ID))); } subpath = "component_design/systems/specific/geometry/mass_properties"; @@ -1573,7 +1571,7 @@ void UnicadoAircraft::readMassesAndLoadings() { } } this->theUnicadoMassesAndLoadings.theMassBreakdown.systems.emplace("AirConditioning", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); - this->theUnicadoMassesAndLoadings.theMassBreakdown.systems.emplace("APU", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); + this->theUnicadoMassesAndLoadings.theMassBreakdown.systems.emplace("AuxillaryPowerUnit", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); this->theUnicadoMassesAndLoadings.theMassBreakdown.systems.emplace("AutomaticFlightSystem", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); this->theUnicadoMassesAndLoadings.theMassBreakdown.systems.emplace("Communication", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); this->theUnicadoMassesAndLoadings.theMassBreakdown.systems.emplace("DeIcing", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); @@ -1593,7 +1591,7 @@ void UnicadoAircraft::readMassesAndLoadings() { this->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("AirConditioning").mass = mass_tmp; systems_mass += mass_tmp; mass_tmp = EndnodeReadOnly<double>("auxiliary_power_unit").read(rtIO->acxml.at(subpath)).value(); - this->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("APU").mass = mass_tmp; + this->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("AuxillaryPowerUnit").mass = mass_tmp; systems_mass += mass_tmp; mass_tmp = EndnodeReadOnly<double>("automatic_flight_system").read(rtIO->acxml.at(subpath)).value(); this->theUnicadoMassesAndLoadings.theMassBreakdown.systems.at("AutomaticFlightSystem").mass = mass_tmp; @@ -1693,8 +1691,8 @@ void UnicadoAircraft::readMassesAndLoadings() { subpath = "component_design/fuselage/specific/geometry/fuselage/mass_breakdown/fuselage_operator_items"; this->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.emplace("Caterings", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); this->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.emplace("CrewMembers", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); - this->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.emplace("IFEs", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); this->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.emplace("EmergencyEquipments", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); + this->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.emplace("IFEs", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); this->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.emplace("FixedGalleys", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); this->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.emplace("Seats", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); this->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.emplace("Miscellaneous", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); @@ -1734,10 +1732,7 @@ void UnicadoAircraft::readMassesAndLoadings() { /* Masses and loadings which don't belong to MassBreakdown */ subpath = "analysis/masses_cg_inertia"; - std::string massesAndLoadingsPath1("/AcftExchangeFile/MassesAndLoadings"); //OLD PATH FOR unicadoXML - - this->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.emplace("maximumLandingMass", UnicadoAircraft::unicadoMassesAndLoadings::massBreakdown::massElement()); - readMassBreakdown(subpath + "/maximum_landing_mass", this->theUnicadoMassesAndLoadings.theMassBreakdown.operatorsItems.at("maximumLandingMass")); + readMassBreakdown(subpath + "/maximum_landing_mass", this->theUnicadoMassesAndLoadings.maximumLandingMass); readMassBreakdown(subpath + "/maximum_takeoff_mass", this->theUnicadoMassesAndLoadings.maximumTakeOffMass); readMassBreakdown(subpath + "/manufacturer_mass_empty", this->theUnicadoMassesAndLoadings.manufacturingMassEmpty); readMassBreakdown(subpath + "/operating_mass_empty", this->theUnicadoMassesAndLoadings.operatingMassEmpty); @@ -1750,9 +1745,9 @@ void UnicadoAircraft::readMassesAndLoadings() { // this->theUnicadoMassesAndLoadings.powerToWeight = unicadoXML.at(massesAndLoadingsPath1 + "/PowerToWeight"); // TODO(Gerrit): Toolspecific -> kick out? subpath += "/design_mission"; - this->theUnicadoMassesAndLoadings.centreOfGravityRange.trimRefPt = this->readCOGVector(subpath + "/takeoff_mass/mass_properties/center_of_gravity"); - this->theUnicadoMassesAndLoadings.centreOfGravityRange.forwardLimit = this->readCOGVector(subpath + "/most_forward_mass/mass_properties/center_of_gravity"); - this->theUnicadoMassesAndLoadings.centreOfGravityRange.aftLimit = this->readCOGVector(subpath + "/most_afterward_mass/mass_properties/center_of_gravity"); + this->theUnicadoMassesAndLoadings.centreOfGravityRange.trimRefPt = this->readVec3(rtIO->acxml.at(subpath + "/takeoff_mass/mass_properties/center_of_gravity")); + this->theUnicadoMassesAndLoadings.centreOfGravityRange.forwardLimit = this->readVec3(rtIO->acxml.at(subpath + "/most_forward_mass/mass_properties/center_of_gravity")); + this->theUnicadoMassesAndLoadings.centreOfGravityRange.aftLimit = this->readVec3(rtIO->acxml.at(subpath + "/most_afterward_mass/mass_properties/center_of_gravity")); } @@ -1873,7 +1868,6 @@ void UnicadoAircraft::readGeometry() { myRuntimeInfo->err << theUnicadoGeo.usedElements.nameLandingGear.at(i) << "is not a Main nor a Noselandinggear" << std::endl; } } - this->readPropulsion(); //Propulsion block has to be read here to get the propulsion geometry information */ } @@ -2056,177 +2050,150 @@ UnicadoAircraft::unicadoAccommodation::cargo::cargoDeck UnicadoAircraft::readACa } /* Function to read propulsion from UNICADO-file*/ - std::string thePropulsionPath("/aircraft_exchange_file/component_design/propulsion/specific"); - void UnicadoAircraft::readPropulsion() { - for (const node* specific_nodes : this->rtIO->acxml.at(thePropulsionPath).getVector("propulsion")) { - theUnicadoPropulsion.scaleEngines = specific_nodes->at("engine/scale_factor/value"); - theUnicadoPropulsion.engineModel = std::string(specific_nodes->at("model/value")); - break; //TODO(Kamyar): 1st engine defines all since different engines are not defined for CPACS yet - } - - for (const node* specific_nodes : this->rtIO->acxml.at("/aircraft_exchange_file/requirements_and_specifications/design_specification/propulsion").getVector("propulsor")) { - theUnicadoPropulsion.typeOfEngine = std::string(specific_nodes->at("type/value")); - break; //TODO(Kamyar): 1st engine defines all since different engines are not defined for CPACS yet - } - - theUnicadoPropulsion.noOfEngines = rtIO->acxml.getVector("aircraft_exchange_file/requirements_and_specifications/design_specification/propulsion/propulsor").size(); - // theUnicadoPropulsion.scaleFuelFlow = unicadoXML.at(thePropulsionPath + "/ScaleFuelFlow"); // TODO(Kamyar): Warte auf "scale_fuel_flow" in neue XML - std::string engine_name(std::string(rtIO->acxml.at(thePropulsionPath + "/propulsion@0/engine/model/value"))); - theUnicadoPropulsion.engineFile = "engineData/" + engine_name + "/" + engine_name + ".xml"; - - - /* JetEngineData */ - for (const node* specific_nodes : this->rtIO->acxml.at(thePropulsionPath).getVector("propulsion")) { - if (std::string(specific_nodes->at("value")) == "engine/SLST") { - theUnicadoPropulsion.theJetEngineData.slst = specific_nodes->at("value"); + std::string subpath("component_design/propulsion/specific"); + atmosphere myAtm;// Set atmosphere to analyze engine performance + myAtm.setAtmosphere(0., ISA_TEMPERATURE + + checkBoundaries(this->rtIO->acxml.at( + "requirements_and_specifications/requirements/top_level_aircraft_requirements/design_mission/delta_ISA/value"), -288.15, 100.), ISA_PRESSURE); + + for (const node* propulsion_node : this->rtIO->acxml.at(subpath).getVector("propulsion")) { + theUnicadoPropulsion.push_back(UnicadoAircraft::unicadoPropulsion()); + theUnicadoPropulsion.back().scaleEngines = EndnodeReadOnly<double>("engine/scale_factor").read(*propulsion_node).value(); + theUnicadoPropulsion.back().engineModel = EndnodeReadOnly<std::string>("model").read(*propulsion_node).value(); + theUnicadoPropulsion.back().ID = propulsion_node->getIntAttrib("ID"); + theUnicadoPropulsion.back().engineFile = "engineData/" + theUnicadoPropulsion.back().engineModel + "/" + theUnicadoPropulsion.back().engineModel + ".xml"; + theUnicadoPropulsion.back().engine = new Engine(rtIO->getEngineDataDir() + "/" + theUnicadoPropulsion.back().engineModel, theUnicadoPropulsion.back().scaleEngines); + theUnicadoPropulsion.back().engine->calculate_N1_with_penalties(// FL = 0, Ma = 0, current atmosphere, derate = 1, thrustRating = takeoff, bleedAir = 0, shaftPower = 0 + 0.0, 0.0, myAtm, 1.0, "takeoff", 0., 0.); + theUnicadoPropulsion.back().typeOfEngine = EndnodeReadOnly<std::string>("propulsion/propulsor@" + num2Str(theUnicadoPropulsion.back().ID) + "/type").read( + rtIO->acxml.at("requirements_and_specifications/design_specification")).value(); + if (theUnicadoPropulsion.back().typeOfEngine == "jet") { + theUnicadoPropulsion.back().theJetEngineData.slst = EndnodeReadOnly<double>("engine/SLST").read(*propulsion_node).value(); + // theUnicadoPropulsion.back().theJetEngineData.fanDiameter = unicadoXML.at(subpath + "/JetEngineData/FanDiameter"); // TODO(Gerrit): Perhaps soon solved by engine lib } + theUnicadoPropulsion.back().maxContinuousBucket.thrust = EndnodeReadOnly<double>("engine/bucket_point/thrust").read(*propulsion_node).value(); + theUnicadoPropulsion.back().maxContinuousBucket.TSFC = EndnodeReadOnly<double>("engine/bucket_point/tsfc").read(*propulsion_node).value(); + // theUnicadoPropulsion.scaleFuelFlow = unicadoXML.at(subpath + "/ScaleFuelFlow"); // TODO(Kamyar): Warte auf "scale_fuel_flow" in neue XML + this->readEnginePerformanceMap(&theUnicadoPropulsion.back()); } - // theUnicadoPropulsion.theJetEngineData.fanDiameter = unicadoXML.at(thePropulsionPath + "/JetEngineData/FanDiameter"); // TODO(Kamyar): Warte auf "fan_diameter" in neue XML + /* TurbopropEngineData */ /* - if (unicadoXML.find(thePropulsionPath + "/TurbopropEngineData") != 0) { - theUnicadoPropulsion.theTurbopropEngineData.propDiameter = unicadoXML.at(thePropulsionPath + "/TurbopropEngineData/Prop/PropDiameter"); - theUnicadoPropulsion.theTurbopropEngineData.noOfBlades = unicadoXML.at(thePropulsionPath + "/TurbopropEngineData/Prop/PropBlades"); - theUnicadoPropulsion.theTurbopropEngineData.pitch = unicadoXML.at(thePropulsionPath + "/TurbopropEngineData/Prop/Pitch"); - theUnicadoPropulsion.theTurbopropEngineData.engineOutput = unicadoXML.at(thePropulsionPath + "/TurbopropEngineData/P_shp"); - theUnicadoPropulsion.theTurbopropEngineData.thickness = unicadoXML.at(thePropulsionPath + "/TurbopropEngineData/Thickness"); - theUnicadoPropulsion.theTurbopropEngineData.segmentPointData = unicadoXML.at(thePropulsionPath + "/TurbopropEngineData/SegmentPointData"); + if (unicadoXML.find(subpath + "/TurbopropEngineData") != 0) { + theUnicadoPropulsion.theTurbopropEngineData.propDiameter = unicadoXML.at(subpath + "/TurbopropEngineData/Prop/PropDiameter"); + theUnicadoPropulsion.theTurbopropEngineData.noOfBlades = unicadoXML.at(subpath + "/TurbopropEngineData/Prop/PropBlades"); + theUnicadoPropulsion.theTurbopropEngineData.pitch = unicadoXML.at(subpath + "/TurbopropEngineData/Prop/Pitch"); + theUnicadoPropulsion.theTurbopropEngineData.engineOutput = unicadoXML.at(subpath + "/TurbopropEngineData/P_shp"); + theUnicadoPropulsion.theTurbopropEngineData.thickness = unicadoXML.at(subpath + "/TurbopropEngineData/Thickness"); + theUnicadoPropulsion.theTurbopropEngineData.segmentPointData = unicadoXML.at(subpath + "/TurbopropEngineData/SegmentPointData"); } */ - /* EngineDimensions */ -std::vector<UnicadoAircraft::unicadoPropulsion::engineDimensions> engineDimensionsList; -for (const node* specific_nodes : this->rtIO->acxml.at("/aircraft_exchange_file/component_design/propulsion/specific/propulsion/nacelle/sections").getVector("section")) { - UnicadoAircraft::unicadoPropulsion::engineDimensions engineDimensions; - if (std::string(specific_nodes->at("value")) == "width") { - theUnicadoPropulsion.theEngineDimensions.width = specific_nodes->at("value"); - } - if (std::string(specific_nodes->at("value")) == "height") { - theUnicadoPropulsion.theEngineDimensions.height = specific_nodes->at("value"); - } - engineDimensionsList.push_back(engineDimensions); -} - // theUnicadoPropulsion.theEngineDimensions.length = unicadoXML.at(thePropulsionPath + "/EngineDimensions/l_Engine"); // TODO(Kamyar): Warte auf "Length" + /* EngineDimensions */ // TODO(Gerrit): Perhaps solved by engine lib + // std::vector<UnicadoAircraft::unicadoPropulsion::engineDimensions> engineDimensionsList; + // for (const node* specific_nodes : this->rtIO->acxml.at("/aircraft_exchange_file/component_design/propulsion/specific/propulsion/nacelle/sections").getVector("section")) { + // UnicadoAircraft::unicadoPropulsion::engineDimensions engineDimensions; + // if (std::string(specific_nodes->at("value")) == "width") { + // theUnicadoPropulsion.theEngineDimensions.width = specific_nodes->at("value"); + // } + // if (std::string(specific_nodes->at("value")) == "height") { + // theUnicadoPropulsion.theEngineDimensions.height = specific_nodes->at("value"); + // } + // engineDimensionsList.push_back(engineDimensions); + // } + // theUnicadoPropulsion.theEngineDimensions.length = unicadoXML.at(subpath + "/EngineDimensions/l_Engine"); // TODO(Kamyar): Warte auf "Length" /*for (int i = 0; i <= theUnicadoPropulsion.theEngineDimensions.width; i++) theUnicadoPropulsion.theEngineDimensions.push_back(readACabinDeck("/aircraft_exchange_file/component_design/propulsion/specific/propulsion/nacelle/sections/section@" + num2Str(i) + "width"));*/ /* ScaledPerformanceCharacteristics */ - atmosphere myAtm; - myAtm.setAtmosphere(0., ISA_TEMPERATURE + - checkBoundaries(this->rtIO->acxml.at( - "/aircraft_exchange_file/requirements_and_specifications/requirements/top_level_aircraft_requirements/design_mission/delta_ISA/value"), -288.15, 100.), ISA_PRESSURE); - node anEngineNode(rtIO->acxml.at(thePropulsionPath + "/propulsion@0/engine")); - // get all characteristic for its engine - double scale_tmp(EndnodeReadOnly<double>("/propulsion@0/engine/scale_factor").read(rtIO->acxml.at("component_design/propulsion/specific")).value()); - std::string name_tmp = EndnodeReadOnly<std::string>("/propulsion@0/engine/model").read(rtIO->acxml.at("component_design/propulsion/specific")).value(); - - this->myEngine = new Engine(rtIO->getEngineDataDir() + "/" + name_tmp, scale_tmp); // create new engine object - this->myEngine->calculate_N1_with_penalties(// FL = 0, Ma = 0, current atmosphere, derate = 1, thrustRating = takeoff, bleedAir = 0, shaftPower = 0 - 0.0, 0.0, myAtm, 1.0, "takeoff", 0., 0.); - - for (const node* specific_nodes : this->rtIO->acxml.at(thePropulsionPath).getVector("propulsion")) { - theUnicadoPropulsion.EquivalentThrust = specific_nodes->at("engine/SLST/value"); - theUnicadoPropulsion.maxContinuousBucket.thrust = specific_nodes->at("engine/bucket_point/thrust/value"); - theUnicadoPropulsion.maxContinuousBucket.TSFC = specific_nodes->at("engine/bucket_point/tsfc/value"); - break; // TODO(Gerrit): Only one engine defined for CPACS by now - } // theUnicadoPropulsion.maxTakeOff = readAScaledPerformance( - // thePropulsionPath + "/ScaledPerformanceCharacteristics/MaximumTakeOff"); // TODO(Kamyar): warte auf "maximum_take_off" + // subpath + "/ScaledPerformanceCharacteristics/MaximumTakeOff"); // TODO(Kamyar): warte auf "maximum_take_off" // theUnicadoPropulsion.maxGoAround = readAScaledPerformance( - // thePropulsionPath + "/ScaledPerformanceCharacteristics/MaximumGoAround"); // TODO(Kamyar): warte auf "maximum_go_around" + // subpath + "/ScaledPerformanceCharacteristics/MaximumGoAround"); // TODO(Kamyar): warte auf "maximum_go_around" // theUnicadoPropulsion.maxContinuousMax = readAScaledPerformance( - // thePropulsionPath + "/ScaledPerformanceCharacteristics/MaximumContinous/MaxThrust"); // TODO(Kamyar): warte auf "max_thrust" + // subpath + "/ScaledPerformanceCharacteristics/MaximumContinous/MaxThrust"); // TODO(Kamyar): warte auf "max_thrust" // theUnicadoPropulsion.maxContinuousBucketOfftakes = readAScaledPerformance( - // thePropulsionPath + "/ScaledPerformanceCharacteristics/MaximumContinous/BucketThrustOfftakes"); // TODO(Kamyar): warte auf "bucket_thrust_off_take" + // subpath + "/ScaledPerformanceCharacteristics/MaximumContinous/BucketThrustOfftakes"); // TODO(Kamyar): warte auf "bucket_thrust_off_take" - theUnicadoPropulsion.maxTakeOff.OPR = myEngine->get_engine_OPR(); - double p_2(myEngine->get_physical_properties_stage(StageProperties::TotalPressure, EngineStage::St2)); - double m_dot_22(myEngine->get_physical_properties_stage(StageProperties::MassFlow, EngineStage::St22)); - if (p_2 > 0.) { - theUnicadoPropulsion.maxTakeOff.FPR = myEngine->get_physical_properties_stage(StageProperties::TotalPressure, EngineStage::St22) / p_2; - } else { - theUnicadoPropulsion.maxTakeOff.FPR = 0.; - } - if (m_dot_22 > 0.) { - theUnicadoPropulsion.maxTakeOff.BPR = myEngine->get_physical_properties_stage(StageProperties::MassFlow, EngineStage::St13) / m_dot_22; - } else { - theUnicadoPropulsion.maxTakeOff.BPR = 0.; - } - this->propulsionAlreadyRead = true; + // theUnicadoPropulsion.maxTakeOff.OPR = myEngine->get_engine_OPR(); // TODO(Gerrit): Engine.cpp needs update + // theUnicadoPropulsion.maxTakeOff.FPR = myEngine->get_engine_OPR(); + // theUnicadoPropulsion.maxTakeOff.BPR = myEngine->get_engine_BPR(); } /* Function gathers the different engine performances in a map */ -void UnicadoAircraft::readEnginePerformanceMap() { - node& engineXML(aixml::openDocument(dummy_engine_path)); - node& newEngineXML(aixml::openDocument(rtIO->getEngineDataDir())); - theUnicadoPerformance.theEnginePerformanceMap.n1Max = engineXML.at("/EngineDataFile/Deck/N1nominal"); - theUnicadoPerformance.theEnginePerformanceMap.n2Max = engineXML.at("/EngineDataFile/Deck/N2nominal"); - std::string thrustDeckName = engineXML.at("/EngineDataFile/Deck/ThrustDeckName"); - theUnicadoPerformance.theEnginePerformanceMap.thrust = readEnginePerformance(engineDataDir + thrustDeckName, - &theUnicadoPerformance.theEnginePerformanceMap.flightLevel, - &theUnicadoPerformance.theEnginePerformanceMap.spoolSpeed, - &theUnicadoPerformance.theEnginePerformanceMap.machNumber); - std::string fuelDeckName = engineXML.at("/EngineDataFile/Deck/FuelDeckName"); - theUnicadoPerformance.theEnginePerformanceMap.mDotFuel = readEnginePerformance(engineDataDir + fuelDeckName, - &theUnicadoPerformance.theEnginePerformanceMap.flightLevel, - &theUnicadoPerformance.theEnginePerformanceMap.spoolSpeed, - &theUnicadoPerformance.theEnginePerformanceMap.machNumber); - std::string St8MassFlowDeckName = engineXML.at("/EngineDataFile/Deck/St8MassFlowDeckName"); - theUnicadoPerformance.theEnginePerformanceMap.mDot8 = readEnginePerformance(engineDataDir + St8MassFlowDeckName, - &theUnicadoPerformance.theEnginePerformanceMap.flightLevel, - &theUnicadoPerformance.theEnginePerformanceMap.spoolSpeed, - &theUnicadoPerformance.theEnginePerformanceMap.machNumber); - std::string St18MassFlowDeckName = engineXML.at("/EngineDataFile/Deck/St18MassFlowDeckName"); - theUnicadoPerformance.theEnginePerformanceMap.mDot18 = readEnginePerformance(engineDataDir + St18MassFlowDeckName, - &theUnicadoPerformance.theEnginePerformanceMap.flightLevel, - &theUnicadoPerformance.theEnginePerformanceMap.spoolSpeed, - &theUnicadoPerformance.theEnginePerformanceMap.machNumber); - std::string NLimitDeckName = engineXML.at("/EngineDataFile/Deck/NLimitDeckName"); - theUnicadoPerformance.theEnginePerformanceMap.n2 = readEnginePerformance(engineDataDir + NLimitDeckName, - &theUnicadoPerformance.theEnginePerformanceMap.flightLevel, - &theUnicadoPerformance.theEnginePerformanceMap.spoolSpeed, - &theUnicadoPerformance.theEnginePerformanceMap.machNumber); - std::string St8JetDensityDeckName = engineXML.at("/EngineDataFile/Deck/St8JetDensityDeckName"); - theUnicadoPerformance.theEnginePerformanceMap.rho8 = readEnginePerformance(engineDataDir + St8JetDensityDeckName, - &theUnicadoPerformance.theEnginePerformanceMap.flightLevel, - &theUnicadoPerformance.theEnginePerformanceMap.spoolSpeed, - &theUnicadoPerformance.theEnginePerformanceMap.machNumber); - std::string St18JetDensityDeckName = engineXML.at("/EngineDataFile/Deck/St18JetDensityDeckName"); - theUnicadoPerformance.theEnginePerformanceMap.rho18 = readEnginePerformance(engineDataDir + St18JetDensityDeckName, - &theUnicadoPerformance.theEnginePerformanceMap.flightLevel, - &theUnicadoPerformance.theEnginePerformanceMap.spoolSpeed, - &theUnicadoPerformance.theEnginePerformanceMap.machNumber); - std::string St8TotalTemperatureDeckName = engineXML.at("/EngineDataFile/Deck/St8TotalTemperatureDeckName"); - theUnicadoPerformance.theEnginePerformanceMap.t8 = readEnginePerformance(engineDataDir + St8TotalTemperatureDeckName, - &theUnicadoPerformance.theEnginePerformanceMap.flightLevel, - &theUnicadoPerformance.theEnginePerformanceMap.spoolSpeed, - &theUnicadoPerformance.theEnginePerformanceMap.machNumber); - std::string St18TotalTemperatureDeckName = engineXML.at("/EngineDataFile/Deck/St18TotalTemperatureDeckName"); - theUnicadoPerformance.theEnginePerformanceMap.t18 = readEnginePerformance(engineDataDir + St18TotalTemperatureDeckName, - &theUnicadoPerformance.theEnginePerformanceMap.flightLevel, - &theUnicadoPerformance.theEnginePerformanceMap.spoolSpeed, - &theUnicadoPerformance.theEnginePerformanceMap.machNumber); - std::string St2TotalTemperatureDeckName = engineXML.at("/EngineDataFile/Deck/St2TotalTemperatureDeckName"); - theUnicadoPerformance.theEnginePerformanceMap.t2 = readEnginePerformance(engineDataDir + St2TotalTemperatureDeckName, - &theUnicadoPerformance.theEnginePerformanceMap.flightLevel, - &theUnicadoPerformance.theEnginePerformanceMap.spoolSpeed, - &theUnicadoPerformance.theEnginePerformanceMap.machNumber); - std::string St8JetVelocityDeckName = engineXML.at("/EngineDataFile/Deck/St8JetVelocityDeckName"); - theUnicadoPerformance.theEnginePerformanceMap.v8 = readEnginePerformance(engineDataDir + St8JetVelocityDeckName, - &theUnicadoPerformance.theEnginePerformanceMap.flightLevel, - &theUnicadoPerformance.theEnginePerformanceMap.spoolSpeed, - &theUnicadoPerformance.theEnginePerformanceMap.machNumber); - std::string St18JetVelocityDeckName = engineXML.at("/EngineDataFile/Deck/St18JetVelocityDeckName"); - theUnicadoPerformance.theEnginePerformanceMap.v18 = readEnginePerformance(engineDataDir + St18JetVelocityDeckName, - &theUnicadoPerformance.theEnginePerformanceMap.flightLevel, - &theUnicadoPerformance.theEnginePerformanceMap.spoolSpeed, - &theUnicadoPerformance.theEnginePerformanceMap.machNumber); - aixml::closeDocument(engineXML); +void UnicadoAircraft::readEnginePerformanceMap(UnicadoAircraft::unicadoPropulsion* unicado_engine) { + std::string engine_path(rtIO->getEngineDataDir() + "/" + unicado_engine->engineModel); + node& engine_XML(aixml::openDocument(engine_path + "/" + unicado_engine->engineModel + ".xml")); + unicado_engine->theEnginePerformanceMap.n1Max = engine_XML.at("EngineDataFile/Deck/N1nominal"); + unicado_engine->theEnginePerformanceMap.n2Max = engine_XML.at("EngineDataFile/Deck/N2nominal"); + + std::string thrustDeckName = engine_XML.at("/EngineDataFile/Deck/ThrustDeckName"); + unicado_engine->theEnginePerformanceMap.thrust = readEnginePerformance(engine_path + "/" + thrustDeckName, + &unicado_engine->theEnginePerformanceMap.flightLevel, + &unicado_engine->theEnginePerformanceMap.spoolSpeed, + &unicado_engine->theEnginePerformanceMap.machNumber); + std::string fuelDeckName = engine_XML.at("/EngineDataFile/Deck/FuelDeckName"); + unicado_engine->theEnginePerformanceMap.mDotFuel = readEnginePerformance(engine_path + "/" + fuelDeckName, + &unicado_engine->theEnginePerformanceMap.flightLevel, + &unicado_engine->theEnginePerformanceMap.spoolSpeed, + &unicado_engine->theEnginePerformanceMap.machNumber); + std::string St8MassFlowDeckName = engine_XML.at("/EngineDataFile/Deck/St8MassFlowDeckName"); + unicado_engine->theEnginePerformanceMap.mDot8 = readEnginePerformance(engine_path + "/" + St8MassFlowDeckName, + &unicado_engine->theEnginePerformanceMap.flightLevel, + &unicado_engine->theEnginePerformanceMap.spoolSpeed, + &unicado_engine->theEnginePerformanceMap.machNumber); + std::string St18MassFlowDeckName = engine_XML.at("/EngineDataFile/Deck/St18MassFlowDeckName"); + unicado_engine->theEnginePerformanceMap.mDot18 = readEnginePerformance(engine_path + "/" + St18MassFlowDeckName, + &unicado_engine->theEnginePerformanceMap.flightLevel, + &unicado_engine->theEnginePerformanceMap.spoolSpeed, + &unicado_engine->theEnginePerformanceMap.machNumber); + std::string NLimitDeckName = engine_XML.at("/EngineDataFile/Deck/NLimitDeckName"); + unicado_engine->theEnginePerformanceMap.n2 = readEnginePerformance(engine_path + "/" + NLimitDeckName, + &unicado_engine->theEnginePerformanceMap.flightLevel, + &unicado_engine->theEnginePerformanceMap.spoolSpeed, + &unicado_engine->theEnginePerformanceMap.machNumber); + std::string St8JetDensityDeckName = engine_XML.at("/EngineDataFile/Deck/St8JetDensityDeckName"); + unicado_engine->theEnginePerformanceMap.rho8 = readEnginePerformance(engine_path + "/" + St8JetDensityDeckName, + &unicado_engine->theEnginePerformanceMap.flightLevel, + &unicado_engine->theEnginePerformanceMap.spoolSpeed, + &unicado_engine->theEnginePerformanceMap.machNumber); + std::string St18JetDensityDeckName = engine_XML.at("/EngineDataFile/Deck/St18JetDensityDeckName"); + unicado_engine->theEnginePerformanceMap.rho18 = readEnginePerformance(engine_path + "/" + St18JetDensityDeckName, + &unicado_engine->theEnginePerformanceMap.flightLevel, + &unicado_engine->theEnginePerformanceMap.spoolSpeed, + &unicado_engine->theEnginePerformanceMap.machNumber); + std::string St8TotalTemperatureDeckName = engine_XML.at("/EngineDataFile/Deck/St8TotalTemperatureDeckName"); + unicado_engine->theEnginePerformanceMap.t8 = readEnginePerformance(engine_path + "/" + St8TotalTemperatureDeckName, + &unicado_engine->theEnginePerformanceMap.flightLevel, + &unicado_engine->theEnginePerformanceMap.spoolSpeed, + &unicado_engine->theEnginePerformanceMap.machNumber); + std::string St18TotalTemperatureDeckName = engine_XML.at("/EngineDataFile/Deck/St18TotalTemperatureDeckName"); + unicado_engine->theEnginePerformanceMap.t18 = readEnginePerformance(engine_path + "/" + St18TotalTemperatureDeckName, + &unicado_engine->theEnginePerformanceMap.flightLevel, + &unicado_engine->theEnginePerformanceMap.spoolSpeed, + &unicado_engine->theEnginePerformanceMap.machNumber); + std::string St2TotalTemperatureDeckName = engine_XML.at("/EngineDataFile/Deck/St2TotalTemperatureDeckName"); + unicado_engine->theEnginePerformanceMap.t2 = readEnginePerformance(engine_path + "/" + St2TotalTemperatureDeckName, + &unicado_engine->theEnginePerformanceMap.flightLevel, + &unicado_engine->theEnginePerformanceMap.spoolSpeed, + &unicado_engine->theEnginePerformanceMap.machNumber); + //TODO(GErrit): Check if decks are there + // std::string St8JetVelocityDeckName = engine_XML.at("/EngineDataFile/Deck/St8JetVelocityDeckName"); + // unicado_engine->theEnginePerformanceMap.v8 = readEnginePerformance(engine_path + "/" + St8JetVelocityDeckName, + // &unicado_engine->theEnginePerformanceMap.flightLevel, + // &unicado_engine->theEnginePerformanceMap.spoolSpeed, + // &unicado_engine->theEnginePerformanceMap.machNumber); + // std::string St18JetVelocityDeckName = engine_XML.at("/EngineDataFile/Deck/St18JetVelocityDeckName"); + // unicado_engine->theEnginePerformanceMap.v18 = readEnginePerformance(engine_path + "/" + St18JetVelocityDeckName, + // &unicado_engine->theEnginePerformanceMap.flightLevel, + // &unicado_engine->theEnginePerformanceMap.spoolSpeed, + // &unicado_engine->theEnginePerformanceMap.machNumber); + aixml::closeDocument(engine_XML); } /* Function reads engine performance decks */ @@ -2406,60 +2373,47 @@ UnicadoAircraft::unicadoPropulsion::scaledPerformanceCharacteristics UnicadoAirc /* Systems */ /* Function to read Systems from UNICADO-file */ void UnicadoAircraft::readSystems() { - std::string theSystemsPath1("/aircraft_exchange_file/requirements_and_specifications/design_specification/configuration/tank_definition"); - std::string theSystemsPath2("/aircraft_exchange_file/requirements_and_specifications/component_design/tank/specific"); + std::string subpath("/aircraft_exchange_file/component_design/tank"); /* FuelTanks */ - /* FuelTank/CentreTanks */ - for (const node* specific_nodes : this->rtIO->acxml.at(theSystemsPath2).getVector("tank")) { + Vec3 tank_ref_point(readVec3(rtIO->acxml.at(subpath + "/position"))); + subpath += "/specific"; + for (const node* tank_node : this->rtIO->acxml.at(subpath).getVector("tank")) { // Fuselage center tanks - if (std::string(specific_nodes->at("designator/value")) == "fuselage_center") { - theUnicadoSystems.noOfCentreTanks++; - theUnicadoSystems.theCentreTanks = readTanks(specific_nodes->at("maximum_energy_capacity/value"), theUnicadoSystems.noOfCentreTanks); - } - - std::string Wings = specific_nodes->at("designator/value"); - if (Wings == "wing_inner_left" || Wings == "wing_outer_left" || - Wings == "wing_inner_right" || Wings == "wing_outer_right" || - Wings == "wing_center") { - theUnicadoSystems.noOfWingTanks++; - theUnicadoSystems.theWingTanks = readTanks(specific_nodes->at("maximum_energy_capacity/value"), theUnicadoSystems.noOfWingTanks); - } - } - - /* FuelTank/TrimTanks */ - for (const node* specific_nodes : this->rtIO->acxml.at(theSystemsPath1).getVector("tank")) { - if (std::string(specific_nodes->at("location/value")) == "horizontal_stabilizer") { - theUnicadoSystems.noOfTrimTanks++; + std::string tank_position = EndnodeReadOnly<std::string>("designator").read(*tank_node).value(); + if (tank_position == "fuselage_center") { + theUnicadoSystems.theCentreTanks.push_back(readTank(tank_node, tank_ref_point)); + theUnicadoSystems.totalFuelVolume += theUnicadoSystems.theCentreTanks.back().tankVolume; + } else if (tank_position == "wing_inner_left" || tank_position == "wing_outer_left" || tank_position == "wing_inner_right" || + tank_position == "wing_outer_right" || tank_position == "wing_center") { + theUnicadoSystems.theWingTanks.push_back(readTank(tank_node, tank_ref_point)); + theUnicadoSystems.totalFuelVolume += theUnicadoSystems.theWingTanks.back().tankVolume; + } else if (tank_position == "horizontal_stabilizer_total" || tank_position == "horizontal_stabilizer") { + theUnicadoSystems.theTrimTanks.push_back(readTank(tank_node, tank_ref_point)); + theUnicadoSystems.totalFuelVolume += theUnicadoSystems.theTrimTanks.back().tankVolume; } } + theUnicadoSystems.noOfCentreTanks = theUnicadoSystems.theCentreTanks.size(); + theUnicadoSystems.noOfWingTanks = theUnicadoSystems.theWingTanks.size(); + theUnicadoSystems.noOfTrimTanks = theUnicadoSystems.theTrimTanks.size(); - for (const node* specific_nodes : this->rtIO->acxml.at(theSystemsPath2).getVector("tank")) { - if (std::string(specific_nodes->at("designator/value")) == "horizontal_stabilizer_total") { - theUnicadoSystems.theTrimTanks = readTanks(specific_nodes->at("maximum_energy_capacity/value"), theUnicadoSystems.noOfTrimTanks); - } - } - - /* FuelTank/Total Fuel Volume */ - // theUnicadoSystems.totalFuelVolume = theUnicadoSystems.theTrimTanks, theUnicadoSystems.theWingTanks, theUnicadoSystems.theCentreTanks; - - /* Read fuel density for the total fuel mass */ - for (const node* specific_nodes : this->rtIO->acxml.at("/aircraft_exchange_file/requirements_and_specifications/design_specification/energy_carriers").getVector("energy_carrier")) { - if (std::string(specific_nodes->at("value")) == "density/value") { - unicado_design_specs.thePropulsion.fuelDensity = specific_nodes->at("value"); - } - } + /* Read fuel density for the total fuel mass */ // TODO(GErrit): Set to energy carriers + // for (const node* specific_nodes : this->rtIO->acxml.at("/aircraft_exchange_file/requirements_and_specifications/design_specification/energy_carriers").getVector("energy_carrier")) { + // if (std::string(specific_nodes->at("value")) == "density/value") { + // unicado_design_specs.thePropulsion.fuelDensity = specific_nodes->at("value"); + // } + // } - /* ATA Chapters */ - for (size_t i(0); i < theUnicadoSystems.theATAChapters.size(); ++i) { - std::string ATAPath("/aircraft_exchange_file/requirements_and_specifications"); //neu - std::string theAtaChapterPath = ATAPath + "/" + theUnicadoSystems.theATAChapters.at(i).ATAchapter; - theUnicadoSystems.theATAChapters.at(i).electricPower = rtIO->acxml.at( - ATAPath + "/component_design/systems/specific/maximium_power_demand/value"); - // TODO(Kamyar): Electric und Hydraulic sind nicht getrennt - wieder trennen lassen und anpassen! (maximium_power_demand wurde eingesetzt) - theUnicadoSystems.theATAChapters.at(i).hydraulicPower = 0; // TODO(Kamyar): Electric und Hydraulic sind nicht getrennt - wieder trennen lassen und anpassen! - theUnicadoSystems.theATAChapters.at(i).bleedAir = rtIO->acxml.at( - ATAPath + "/component_design/systems/specific/maximium_bleed_air_demand/value"); // TODO(Kamyar): "maximium_bleed_air_demand" wurde eingesetzt + /* ATA Chapters */ //TODO(Gerrit): Toolspec -> kick out? + // for (size_t i(0); i < theUnicadoSystems.theATAChapters.size(); ++i) { + // std::string ATAPath("/aircraft_exchange_file/requirements_and_specifications"); + // std::string theAtaChapterPath = ATAPath + "/" + theUnicadoSystems.theATAChapters.at(i).ATAchapter; + // theUnicadoSystems.theATAChapters.at(i).electricPower = rtIO->acxml.at( + // ATAPath + "/component_design/systems/specific/maximium_power_demand/value"); + // // TODO(Kamyar): Electric und Hydraulic sind nicht getrennt - wieder trennen lassen und anpassen! (maximium_power_demand wurde eingesetzt) + // theUnicadoSystems.theATAChapters.at(i).hydraulicPower = 0; // TODO(Kamyar): Electric und Hydraulic sind nicht getrennt - wieder trennen lassen und anpassen! + // theUnicadoSystems.theATAChapters.at(i).bleedAir = rtIO->acxml.at( + // ATAPath + "/component_design/systems/specific/maximium_bleed_air_demand/value"); // TODO(Kamyar): "maximium_bleed_air_demand" wurde eingesetzt /* if (theUnicadoSystems.theATAChapters.at(i).ATAchapter == "ATA21_EnvironmentalControlSystem") { theUnicadoSystems.theATAChapters.at(i).theSpecifics.paxAirflow_ATA21 = rtIO->acxml.at("/requirements/top_level_aircraft_requirements/study_mission/payload_fractions/passenger_mass_fraction/value"); @@ -2470,18 +2424,15 @@ void UnicadoAircraft::readSystems() { theUnicadoSystems.theATAChapters.at(i).theSpecifics.pressure_ATA29 = unicadoXML.at(theAtaChapterPath + "/Pressure"); //TODO(Kamyar): warte auf "Hydraulik_systems" } */ - } + // } } /* Creates vector with tank information */ -std::vector<UnicadoAircraft::unicadoSystems::fuelTank> UnicadoAircraft::readTanks(const std::string& tanksPath, const int& noOfTanks) { - std::vector<UnicadoAircraft::unicadoSystems::fuelTank> aTankVector; - for (int i = 1; i <= noOfTanks; i++) { - UnicadoAircraft::unicadoSystems::fuelTank aTank; - aTank.tankVolume = unicadoXML.at(tanksPath + "@" + num2Str(i) + "/TankVolume"); - aTankVector.push_back(aTank); - } - return aTankVector; +UnicadoAircraft::unicadoSystems::fuelTank UnicadoAircraft::readTank(const node* tank_node, const Vec3& ref_point) { + UnicadoAircraft::unicadoSystems::fuelTank aTank; + aTank.tankVolume = EndnodeReadOnly<double>("maximum_energy_capacity").read(*tank_node).value(); + aTank.refPoint = readVec3(tank_node->at("position"), ref_point); + return aTank; } @@ -3492,10 +3443,10 @@ void UnicadoAircraft::read_design_specs() { } /*Reads a Center of Gravity Vector from UNICADO-file return Center of Gravity Vector --> Vec3 variable from UNICADO-file */ -Vec3 UnicadoAircraft::readCOGVector(const std::string& vectorpath) { +Vec3 UnicadoAircraft::readVec3(const node& vector_node, const Vec3& ref_point) { Vec3 vec; - vec[0] = rtIO->acxml.at(vectorpath + "/x/value"); - vec[1] = rtIO->acxml.at(vectorpath + "/y/value"); - vec[2] = rtIO->acxml.at(vectorpath + "/z/value"); + vec[0] = EndnodeReadOnly<double>("x").read(vector_node).value() + ref_point[0]; + vec[1] = EndnodeReadOnly<double>("y").read(vector_node).value() + ref_point[1]; + vec[2] = EndnodeReadOnly<double>("z").read(vector_node).value() + ref_point[2]; return vec; } diff --git a/cpacs_interface/src/UNICADO2CPACS/unicado_aircraft/unicado_aircraft.h b/cpacs_interface/src/UNICADO2CPACS/unicado_aircraft/unicado_aircraft.h index 044c072ec24801de86ed301c5f16930541427041..9c7c1cd6a3b6c4124223d57023b66dd7538b9ab2 100644 --- a/cpacs_interface/src/UNICADO2CPACS/unicado_aircraft/unicado_aircraft.h +++ b/cpacs_interface/src/UNICADO2CPACS/unicado_aircraft/unicado_aircraft.h @@ -44,21 +44,10 @@ class UnicadoAircraft { public: const std::shared_ptr<RuntimeIO>& rtIO; /**< Pointer to the RuntimeIO */ std::string dummy_path; - std::string dummy_engine_path; node& unicadoXML;/**< XML Parameter to read and write into UNICADO XML-file*/ - - std::vector<std::string> Input;/**<Vector for input data (to be written in _info.txt & _guiSettings.xml files)<*/ - std::vector<std::string> Output;/**<Vector for output data (to be written in _info.txt & _guiSettings.xml files)<*/ - std::string acftName;/**<Aircraft name i.e. CeRAS CSR-01 */ - std::string engineDataFile;/**<path to the engine xml-file*/ - std::string engineDataDir;/**<directory of the engine data folder*/ //Member variables - Engine *myEngine;/**< Pointer to engine object */ - - bool propulsionAlreadyRead;/**< Switch if propulsion block is already read in */ - /** \struct centreOfGravityRangeStruct * \brief Structure for center of gravity range */ @@ -436,12 +425,13 @@ class UnicadoAircraft { */ class unicadoPropulsion { public: - std::string typeOfEngine;/**< Type of engine i.e. jet or prop */ - std::string engineModel;/**< Engine model i.e. V2527-A5 */ - uint16_t noOfEngines;/**< Number of engines */ + std::string typeOfEngine;/**< Type of engine i.e. jet or prop */ + std::string engineModel;/**< Engine model i.e. V2527-A5 */ + uint16_t ID;/**< ID within the axcml */ double scaleEngines;/**< Scaling factor for engine model */ double scaleFuelFlow;/**< Scaling factor for fuel flow */ std::string engineFile;/**< Name of engine file (contains geometry data and decks) */ + Engine* engine; /** Engine.cpp lib object */ /** \class jetEngineData * \brief Describes jet engine specific data @@ -566,6 +556,37 @@ class UnicadoAircraft { scaledPerformanceCharacteristics maxContinuousBucket;/**< Maximum thrust limit w/o time limit at ISA+0 at FL350, Mach=0.25, w/o offtakes, bucket thrust */ scaledPerformanceCharacteristics maxContinuousBucketOfftakes;/**< Maximum thrust limit w/o time limit: ISA+0, FL350, Mach=0.25, Average Cruise Offtakes, bucket thrust */ + /** \class enginePerformanceMap + *\brief The class contains the parameters and values of an engine deck (csv file) + */ + class enginePerformanceMap { + public: + /** Constructor of class enginePerformanceMap + */ + enginePerformanceMap(); + /** Destructor of class enginePerformanceMap + */ + virtual ~enginePerformanceMap(); + double n1Max; /** Maximum rotational speed for high pressure lotor [1/min] */ + double n2Max; /** Maximum rotational speed for high pressure rotor [1/min] */ + std::vector <double> flightLevel; /**< flight altitude [m]*/ + std::vector <double> spoolSpeed; /**< relative spool speed [-]*/ + std::vector <double> machNumber; /**< Mach number [-]*/ + double ***thrust; /**< thrust [N]*/ + double ***mDotFuel; /**< fuel mass flow [kg/s]*/ + double ***mDot8; /**< mass flow of air-fuel mixture at core exit nozzle [kg/s]*/ + double ***mDot18; /**< air mass flow at the bypass exit nozzle [kg/s]*/ + double ***n2; /**< relative spool speed of high pressure rotor [-]*/ + double ***rho8; /**< density at core exit nozzle [Kkg/m^3]*/ + double ***rho18; /**< density at the bypass exit nozzle [Kkg/m^3]*/ + double ***t8; /**< total temperature at core exit nozzle [K] */ + double ***t18; /**< total temperature at the bypass exit nozzle [K] */ + double ***t2; /**< total temperature at turbine entry [K] */ + double ***v8; /**< velocity at core exit nozzle [m/s] */ + double ***v18; /**< velocity at the bypass exit nozzle [m/s] */ + }; + enginePerformanceMap theEnginePerformanceMap; + double EquivalentThrust;/**< 1.25 * Max-Go-Around (thrust at ISA+15, SL, Ma0.25, N1 100 perc) [kN]*/ /** \brief Constructor unicadoPropulsion @@ -575,7 +596,7 @@ class UnicadoAircraft { */ virtual ~unicadoPropulsion(); }; - unicadoPropulsion theUnicadoPropulsion;/**< class unicadoPropulsion object */ + std::vector<unicadoPropulsion> theUnicadoPropulsion;/**< class unicadoPropulsion object */ /**\class unicadoSystems * \brief Represents the unicado Systems Values-XML-Block @@ -1027,38 +1048,6 @@ class UnicadoAircraft { }; vnDiagram theVnDiagram;/**< class vnDiagram object */ - /** \class enginePerformanceMap - *\brief The class contains the parameters and values of an engine deck (csv file) - */ - class enginePerformanceMap { - public: - /** Constructor of class enginePerformanceMap - */ - enginePerformanceMap(); - /** Destructor of class enginePerformanceMap - */ - virtual ~enginePerformanceMap(); - - double n1Max; /** Maximum rotational speed for high pressure lotor [1/min] */ - double n2Max; /** Maximum rotational speed for high pressure rotor [1/min] */ - std::vector <double> flightLevel; /**< flight altitude [m]*/ - std::vector <double> spoolSpeed; /**< relative spool speed [-]*/ - std::vector <double> machNumber; /**< Mach number [-]*/ - double ***thrust; /**< thrust [N]*/ - double ***mDotFuel; /**< fuel mass flow [kg/s]*/ - double ***mDot8; /**< mass flow of air-fuel mixture at core exit nozzle [kg/s]*/ - double ***mDot18; /**< air mass flow at the bypass exit nozzle [kg/s]*/ - double ***n2; /**< relative spool speed of high pressure rotor [-]*/ - double ***rho8; /**< density at core exit nozzle [Kkg/m^3]*/ - double ***rho18; /**< density at the bypass exit nozzle [Kkg/m^3]*/ - double ***t8; /**< total temperature at core exit nozzle [K] */ - double ***t18; /**< total temperature at the bypass exit nozzle [K] */ - double ***t2; /**< total temperature at turbine entry [K] */ - double ***v8; /**< velocity at core exit nozzle [m/s] */ - double ***v18; /**< velocity at the bypass exit nozzle [m/s] */ - }; - enginePerformanceMap theEnginePerformanceMap; - /** \class missionAnalysis *\brief The class contains general mission data, predefined mission steps and the resulting trajectory */ @@ -2548,7 +2537,7 @@ class UnicadoAircraft { /** \brief Function gathers the different engine performances in a map */ - void readEnginePerformanceMap(); + void readEnginePerformanceMap(UnicadoAircraft::unicadoPropulsion* unicado_engine); /** \brief function reads engine performance decks * \param filename: name of the engine deck csv file @@ -2672,7 +2661,7 @@ class UnicadoAircraft { *\param noOfTanks:number of tanks *\return aTankVektor */ - std::vector<UnicadoAircraft::unicadoSystems::fuelTank> readTanks(const std::string& tanksPath, const int& noOfTanks); + UnicadoAircraft::unicadoSystems::fuelTank readTank(const node* tank_node, const Vec3& ref_point); /* readEcologicalValues*/ /**\brief Function to read a certification point from UNICADO-file @@ -2698,6 +2687,6 @@ class UnicadoAircraft { * \param vectorpath: path to center of gravity vector * \return vec: Center of Gravity Vector --> Vec3 variable from UNICADO-file containing coordinates [m] */ - Vec3 readCOGVector(const std::string& vectorpath); + Vec3 readVec3(const node& vector_node, const Vec3& = {0, 0, 0}); }; #endif // CPACSINTERFACE_CONVERTUNICADO2CPACS_SRC_UnicadoAircraftXML_H_