def createHTP(CPACSObj, id, xRoot, zRoot, tcRoot, tcTip, cRoot, cTip, span, phiLE, dihedral, LoD=0, location=True): if LoD == WING_LOD.NONE: return # just for now cpacsPath = '/cpacs/vehicles/aircraft/model/wings/wing[' + id + ']' # the next line is the one to use later on # cpacsPath = '/cpacs/vehicles/aircraft/model[model]/wings/wing[' + self.id + ']' # get the wing object from given cpacs path myWing = getObjfromXpath(CPACSObj, cpacsPath) myWing.set_name(stringBaseType(valueOf_='htp')) strUID = createHeader(myWing, id) myWing.set_symmetry('x-z-plane') if location: myWing.set_parentUID(stringUIDBaseType(isLink=True, valueOf_='fuselage')) createTransformation(myWing, 'absGlobal', xRoot, 0., zRoot) else: myWing.set_parentUID(stringUIDBaseType(isLink=True, valueOf_='vtp')) createTransformation(myWing, 'absGlobal', xRoot, 0., zRoot) # call corresponding wing creation method if LoD == WING_LOD.SINGLE: createTrapezoidWing(myWing, id, tcTip, tcRoot, cTip, cRoot, span, phiLE, dihedral, 0., strUID) if not location: createWingWingAttachment(myWing.get_componentSegments().get_componentSegment()[0], strUID, targetUID='vtp_Cseg', typeOfSeg='ttail')
def createStrut(myWing, id, tcRoot, tcTip, cTip, cRoot, span, phiLE, dihedral, twist, xRoot, yRoot, etaStrut, strUID): ''' This method creates a trapezoid wing geometry in the 'myWing' parameter. @author: Jonas Jepsen @param myWing: wings CPACS object @param id: the VAMPzero-id of the wing @param cTip: length of chord at wing tip [m] @param cRoot: length of chord at wing root [m] @param span: span of the wing [m] @param phiLE: sweep angle at the leading edge [deg] @param dihedral: dihedralangle of the wing [deg] @param twist: twist of the outer wing section [deg] @param strUID: the CPACS-uID of the wing ''' # sections and positionings will be created, all existing sections and positionings will be deleted mySections = wingSectionsType() myPositionings = positioningsType() incidence_angle = 2. createWingSection(mySections, tcRoot / 0.09, 0., 0., 0., cRoot, 1., cRoot, 0., incidence_angle, 0., 'NACA0009', 1, strUID + '_Sec1', strUID + '_Sec1', strUID + '_Sec1') createWingSection(mySections, tcRoot / 0.09, 0., 0., 0., cRoot, 1., cRoot, dihedral, incidence_angle, 0., 'NACA0009', 1, strUID + '_Sec2', strUID + '_Sec2', strUID + '_Sec2') createWingSection(mySections, tcTip / 0.09, 0., 0., 0., cTip, 1., cTip, dihedral, incidence_angle, 0., 'NACA0009', 1, strUID + '_Sec3', strUID + '_Sec3', strUID + '_Sec3') createPositioning(myPositionings, str(id) + '_Pos1', None, str(id) + '_Sec1', 0., 0., 0., id) createPositioning(myPositionings, str(id) + '_Pos2', str(id) + '_Sec1', str(id) + '_Sec2', yRoot, 0., 0., id) createPositioning(myPositionings, str(id) + '_Pos3', str(id) + '_Sec2', str(id) + '_Sec3', span, phiLE, dihedral, id) myWing.set_sections(mySections) myWing.set_positionings(myPositionings) createWingSegments(myWing, strUID, 2) createComponentSegment(myWing, strUID, fromElement='_Sec2_Elem1') createRibs(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'strut', etaStrut=etaStrut) createSpars(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'strut') createShell(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'strut') createWingFuselageAttachment(myWing.get_componentSegments().get_componentSegment()[0], strUID, typeOfSeg='strut') createWingWingAttachment(myWing.get_componentSegments().get_componentSegment()[0], strUID, typeOfSeg='strut') # set wing x - position and twist myWing.get_transformation().get_translation().set_x(doubleBaseType(None, None, None, str(xRoot))) #myWing.get_transformation().get_translation().set_y(doubleBaseType(None, None, None, str(yRoot)))
def createHTP(CPACSObj, id, xRoot, zRoot, tcRoot, tcTip, cRoot, cTip, span, phiLE, dihedral, LoD=0, location=True): if LoD == WING_LOD.NONE: return # just for now cpacsPath = '/cpacs/vehicles/aircraft/model/wings/wing[' + id + ']' # the next line is the one to use later on # cpacsPath = '/cpacs/vehicles/aircraft/model[model]/wings/wing[' + self.id + ']' # get the wing object from given cpacs path myWing = getObjfromXpath(CPACSObj, cpacsPath) myWing.set_name(stringBaseType(valueOf_='htp')) strUID = createHeader(myWing, id) myWing.set_symmetry('x-z-plane') if location: myWing.set_parentUID( stringUIDBaseType(isLink=True, valueOf_='fuselage')) createTransformation(myWing, 'absGlobal', xRoot, 0., zRoot) else: myWing.set_parentUID(stringUIDBaseType(isLink=True, valueOf_='vtp')) createTransformation(myWing, 'absGlobal', xRoot, 0., zRoot) # call corresponding wing creation method if LoD == WING_LOD.SINGLE: createTrapezoidWing(myWing, id, tcTip, tcRoot, cTip, cRoot, span, phiLE, dihedral, 0., strUID) if not location: createWingWingAttachment( myWing.get_componentSegments().get_componentSegment()[0], strUID, targetUID='vtp_Cseg', typeOfSeg='ttail')
def createStrut(myWing, id, tcRoot, tcTip, cTip, cRoot, span, phiLE, dihedral, twist, xRoot, yRoot, etaStrut, strUID): ''' This method creates a trapezoid wing geometry in the 'myWing' parameter. @author: Jonas Jepsen @param myWing: wings CPACS object @param id: the VAMPzero-id of the wing @param cTip: length of chord at wing tip [m] @param cRoot: length of chord at wing root [m] @param span: span of the wing [m] @param phiLE: sweep angle at the leading edge [deg] @param dihedral: dihedralangle of the wing [deg] @param twist: twist of the outer wing section [deg] @param strUID: the CPACS-uID of the wing ''' # sections and positionings will be created, all existing sections and positionings will be deleted mySections = wingSectionsType() myPositionings = positioningsType() incidence_angle = 2. createWingSection(mySections, tcRoot / 0.09, 0., 0., 0., cRoot, 1., cRoot, 0., incidence_angle, 0., 'NACA0009', 1, strUID + '_Sec1', strUID + '_Sec1', strUID + '_Sec1') createWingSection(mySections, tcRoot / 0.09, 0., 0., 0., cRoot, 1., cRoot, dihedral, incidence_angle, 0., 'NACA0009', 1, strUID + '_Sec2', strUID + '_Sec2', strUID + '_Sec2') createWingSection(mySections, tcTip / 0.09, 0., 0., 0., cTip, 1., cTip, dihedral, incidence_angle, 0., 'NACA0009', 1, strUID + '_Sec3', strUID + '_Sec3', strUID + '_Sec3') createPositioning(myPositionings, str(id) + '_Pos1', None, str(id) + '_Sec1', 0., 0., 0., id) createPositioning(myPositionings, str(id) + '_Pos2', str(id) + '_Sec1', str(id) + '_Sec2', yRoot, 0., 0., id) createPositioning(myPositionings, str(id) + '_Pos3', str(id) + '_Sec2', str(id) + '_Sec3', span, phiLE, dihedral, id) myWing.set_sections(mySections) myWing.set_positionings(myPositionings) createWingSegments(myWing, strUID, 2) createComponentSegment(myWing, strUID, fromElement='_Sec2_Elem1') createRibs(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'strut', etaStrut=etaStrut) createSpars(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'strut') createShell(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'strut') createWingFuselageAttachment( myWing.get_componentSegments().get_componentSegment()[0], strUID, typeOfSeg='strut') createWingWingAttachment( myWing.get_componentSegments().get_componentSegment()[0], strUID, typeOfSeg='strut') # set wing x - position and twist myWing.get_transformation().get_translation().set_x( doubleBaseType(None, None, None, str(xRoot)))