def createAdvDoubleTrapezoidWing(myWing, id, cTip, cRoot, span, Sref, dfus, phiLE, dihedral, twist, xMAC25, etakf, strUID, yfus, xRoot, etaEng, tcRoot, tcTip): ''' This method creates a double trapezoid wing geometry in the 'myWing' parameter. ** Introduced a linear twist distribution from *0* at root to *twist* at tip @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 Sref: reference area [m^2] @param dfus: fuselage diameter [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 etakf: dimensionless span coordinate [-] @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() # calc Lvl 1 parameters taperRatio = (cTip / cRoot) cRoot, cKink, cTip = calcWing(span, Sref, taperRatio, phiLE, etakf, dfus) # calc length from span, sweep and dihedral sweep_rad = phiLE / 180. * pi dihedral_rad = dihedral / 180. * pi # trying to correct the commented statement that uses dfus. will try to use yfus # length1 = dfus / 2. length1 = yfus length2 = (etakf * span / 2. - length1) / cos(sweep_rad) / cos(dihedral_rad) length3 = span / 2. * (1 - etakf) / cos(sweep_rad) / cos(dihedral_rad) # Increase (or reduce the twist by 4deg as that is the overall angle of incidence of the wing) twist = twist - 4. twistgrad = twist / (span / 2.) twist1 = twistgrad * length1 twist2 = twistgrad * etakf * (span / 2.) twist3 = twist createWingSection(mySections, tcRoot / 0.09, 0., 0., 0., cRoot, 1., cRoot, 0., 0., 0., 'NACA0009', 1, strUID + '_Sec1', strUID + '_Sec1', strUID + '_Sec1') createWingSection(mySections, tcRoot / 0.18, 0., 0., 0., cRoot, 1., cRoot, 0., 0., 0., 'NACA653218', 1, strUID + '_Sec2', strUID + '_Sec2', strUID + '_Sec2') createWingSection(mySections, tcTip / 0.18, 0., 0., 0., cKink, 1., cKink, 0., twist2, 0., 'NACA653218', 1, strUID + '_Sec3', strUID + '_Sec3', strUID + '_Sec3') createWingSection(mySections, tcTip / 0.18, 0., 0., 0., cTip, 1., cTip, 0., twist3, 0., 'NACA653218', 1, strUID + '_Sec4', strUID + '_Sec4', strUID + '_Sec4') createPositioning(myPositionings, str(id) + '_Pos1', None, str(id) + '_Sec1', 0., 0., 0., id) createPositioning(myPositionings, str(id) + '_Pos2', str(id) + '_Sec1', str(id) + '_Sec2', length1, 0., 0., id) createPositioning(myPositionings, str(id) + '_Pos3', str(id) + '_Sec2', str(id) + '_Sec3', length2, phiLE, dihedral, id) createPositioning(myPositionings, str(id) + '_Pos4', str(id) + '_Sec3', str(id) + '_Sec4', length3, phiLE, dihedral, id) myWing.set_sections(mySections) myWing.set_positionings(myPositionings) createWingSegments(myWing, strUID, 3) createComponentSegment(myWing, strUID) etafus = yfus / (span / 2.) # Ribs outboard of the Fuselage section are placed at 0.8 m distance nouterRibs = int(ceil((0.95 - etafus - 0.05) * span / 2. / 0.8)) createRibs(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'advDoubletrapezoid', etaFus=etafus, nRibs=nouterRibs, etaEng=etaEng, span=span / 2.) createSpars(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'advDoubletrapezoid', length1 / (span / 2.), etakf / cos(dihedral_rad), cTip=cTip, cRoot=cRoot) createShell(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'advDoubletrapezoid') createWingFuselageAttachment( myWing.get_componentSegments().get_componentSegment()[0], strUID, 'advDoubletrapezoid') # Estimate ribNum of outer Rib iRib = int(span * (0.85 - etaEng) / (2 * 0.8)) - 1 createTanks(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'advDoubletrapezoid', nRib=iRib) # calc wing position tauK = cTip / cKink etar = dfus / span # XN25F = calcXN25F(cRoot, span, phiLE, etar, etakf, tauK, taperRatio) # xRoot.py = calcXRoot(xMAC25, XN25F) # set wing x - position and twist myWing.get_transformation().get_translation().set_x( doubleBaseType(None, None, None, str(xRoot))) myWing.get_transformation().get_rotation().set_y( doubleBaseType(None, None, None, str(4.)))
def createStrutBracedWing(myWing, id, cTip, cRoot, span, Sref, phiLE, dihedral, twist, xMAC25, etaFus, etaStrut, tcRoot, tcTip, xRoot, strUID): ''' This method creates a double 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 Sref: reference area [m^2] @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 etakf: dimensionless span coordinate [-] @param strUID: the CPACS-uID of the wing ''' mySections = wingSectionsType() myPositionings = positioningsType() # calc Lvl 1 parameters taperRatio = (cTip/cRoot) #cRoot, cFuselage, cTip = calcWing(span, Sref, taperRatio, phiLE, etaFus) cStrut = cRoot+(cTip-cRoot)*(etaStrut-etaFus)/(1-etaFus) # calc length from span, sweep and dihedral sweep_rad = phiLE/180. * pi dihedral_rad = dihedral/180. * pi length1 = (etaFus*span/2.) length2 = (etaStrut-etaFus)*span/2/cos(sweep_rad)/cos(dihedral_rad) length3 = span/2.*(1-etaStrut)/cos(sweep_rad)/cos(dihedral_rad) # Increase (or reduce the twist by 4deg as that is the overall angle of incidence of the wing) incidenceAngle = 4. twist = twist + incidenceAngle twistgrad = twist / (span / 2.) twist2 = twistgrad * length2 twist3 = twist createWingSection(mySections, tcRoot/0.09, 0.,0.,0., cRoot,1.,cRoot, 0.,incidenceAngle,0., 'NACA0009', 1, strUID + '_Sec1', strUID + '_Sec1', strUID + '_Sec1') createWingSection(mySections, tcRoot / 0.18, 0.,0.,0., cRoot,1.,cRoot, 0.,incidenceAngle,0., 'NACA653218', 1, strUID + '_Sec2', strUID + '_Sec2', strUID + '_Sec2') createWingSection(mySections, tcRoot / 0.18, 0.,0.,0., cStrut,1.,cStrut, 0.,twist2,0., 'NACA653218', 1, strUID + '_Sec3', strUID + '_Sec3', strUID + '_Sec3') createWingSection(mySections, tcTip / 0.18, 0.,0.,0., cTip,1.,cTip, 0.,twist3,0., 'NACA653218', 1, strUID + '_Sec4', strUID + '_Sec4', strUID + '_Sec4') createPositioning(myPositionings,str(id) + '_Pos1',None, str(id) + '_Sec1',0.,0.,0.,id) createPositioning(myPositionings,str(id) + '_Pos2',str(id) + '_Sec1',str(id) + '_Sec2',length1,0.,0.,id) createPositioning(myPositionings,str(id) + '_Pos3',str(id) + '_Sec2',str(id) + '_Sec3',length2,phiLE,dihedral,id) createPositioning(myPositionings,str(id) + '_Pos4',str(id) + '_Sec3',str(id) + '_Sec4',length3,phiLE,dihedral,id) myWing.set_sections(mySections) myWing.set_positionings(myPositionings) createWingSegments(myWing, strUID, 3) createComponentSegment(myWing, strUID) # Ribs outboard of the Fuselage section are placed at 0.8 m distance nouterRibs = int(ceil((0.95 - etaFus - 0.05) * span / 2. / 0.8)) createRibs(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'strutBracedWing', etaFus=etaFus, nRibs=nouterRibs, etaStrut=etaStrut, span=span / 2., phi25 = phiLE) createSpars(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'strutBracedWing', etaFus=etaFus, cTip=cTip, cRoot=cRoot) createShell(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'strutBracedWing') iRib = int(span * (0.9 - etaStrut) / (2 * 0.8)) - 1 if iRib == 1: iRib = 2 createTanks(myWing.get_componentSegments().get_componentSegment()[0], strUID, typeOfSeg='strutBracedWing', nRib=iRib) createWingFuselageAttachment(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'advDoubletrapezoid') # set wing x - position and twist myWing.get_transformation().get_translation().set_x(doubleBaseType(None, None, None, str(xRoot)))
def createStrutBracedWing(myWing, id, cTip, cRoot, span, Sref, phiLE, dihedral, twist, xMAC25, etaFus, etaStrut, tcRoot, tcTip, xRoot, strUID): ''' This method creates a double 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 Sref: reference area [m^2] @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 etakf: dimensionless span coordinate [-] @param strUID: the CPACS-uID of the wing ''' mySections = wingSectionsType() myPositionings = positioningsType() # calc Lvl 1 parameters taperRatio = (cTip/cRoot) cRoot = calcWing(b=span, S=Sref, tau=taperRatio, eF=etaFus) cStrut = cRoot+(cTip-cRoot)*(etaStrut-etaFus)/(1-etaFus) cTip = taperRatio * cRoot # cRoot was updated in the last step # calc length from span, sweep and dihedral sweep_rad = phiLE/180. * pi dihedral_rad = dihedral/180. * pi length1 = (etaFus*span/2.) length2 = (etaStrut-etaFus)*span/2/cos(sweep_rad)/cos(dihedral_rad) length3 = span/2.*(1-etaStrut)/cos(sweep_rad)/cos(dihedral_rad) # Increase (or reduce the twist by 4deg as that is the overall angle of incidence of the wing) incidenceAngle = 4. twist = twist + incidenceAngle twistgrad = twist / (span / 2.) twist2 = twistgrad * length2 twist3 = twist createWingSection(mySections, tcRoot/0.09, 0.,0.,0., cRoot,1.,cRoot, 0.,incidenceAngle,0., 'NACA0009', 1, strUID + '_Sec1', strUID + '_Sec1', strUID + '_Sec1') createWingSection(mySections, tcRoot / 0.18, 0.,0.,0., cRoot,1.,cRoot, 0.,incidenceAngle,0., 'NACA653218', 1, strUID + '_Sec2', strUID + '_Sec2', strUID + '_Sec2') createWingSection(mySections, tcRoot / 0.18, 0.,0.,0., cStrut,1.,cStrut, 0.,twist2,0., 'NACA653218', 1, strUID + '_Sec3', strUID + '_Sec3', strUID + '_Sec3') createWingSection(mySections, tcTip / 0.18, 0.,0.,0., cTip,1.,cTip, 0.,twist3,0., 'NACA653218', 1, strUID + '_Sec4', strUID + '_Sec4', strUID + '_Sec4') createPositioning(myPositionings,str(id) + '_Pos1',None, str(id) + '_Sec1',0.,0.,0.,id) createPositioning(myPositionings,str(id) + '_Pos2',str(id) + '_Sec1',str(id) + '_Sec2',length1,0.,0.,id) createPositioning(myPositionings,str(id) + '_Pos3',str(id) + '_Sec2',str(id) + '_Sec3',length2,phiLE,dihedral,id) createPositioning(myPositionings,str(id) + '_Pos4',str(id) + '_Sec3',str(id) + '_Sec4',length3,phiLE,dihedral,id) myWing.set_sections(mySections) myWing.set_positionings(myPositionings) createWingSegments(myWing, strUID, 3) createComponentSegment(myWing, strUID) # Ribs outboard of the Fuselage section are placed at 0.8 m distance nouterRibs = int(ceil((0.95 - etaFus - 0.05) * span / 2. / 0.8)) createRibs(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'strutBracedWing', etaFus=etaFus, nRibs=nouterRibs, etaStrut=etaStrut, span=span / 2., phi25 = phiLE) createSpars(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'strutBracedWing', etaFus=etaFus, cTip=cTip, cRoot=cRoot) createShell(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'strutBracedWing') iRib = int(span * (0.9 - etaStrut) / (2 * 0.8)) - 1 if iRib == 1: iRib = 2 createTanks(myWing.get_componentSegments().get_componentSegment()[0], strUID, typeOfSeg='strutBracedWing', nRib=iRib) createWingFuselageAttachment(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'advDoubletrapezoid') # set wing x - position and twist myWing.get_transformation().get_translation().set_x(doubleBaseType(valueOf_=str(xRoot)))
def createAdvDoubleTrapezoidWing(myWing, id, cTip, cRoot, span, Sref, dfus, phiLE, dihedral, twist, xMAC25, etakf, strUID, yfus, xRoot, etaEng, tcRoot, tcTip): ''' This method creates a double trapezoid wing geometry in the 'myWing' parameter. ** Introduced a linear twist distribution from *0* at root to *twist* at tip @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 Sref: reference area [m^2] @param dfus: fuselage diameter [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 etakf: dimensionless span coordinate [-] @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() # calc Lvl 1 parameters taperRatio = (cTip / cRoot) cRoot, cKink, cTip = calcWing(span, Sref, taperRatio, phiLE, etakf, dfus) # calc length from span, sweep and dihedral sweep_rad = phiLE / 180. * pi dihedral_rad = dihedral / 180. * pi # trying to correct the commented statement that uses dfus. will try to use yfus # length1 = dfus / 2. length1 = yfus length2 = (etakf * span / 2. - length1) / cos(sweep_rad) / cos(dihedral_rad) length3 = span / 2.*(1 - etakf) / cos(sweep_rad) / cos(dihedral_rad) # Increase (or reduce the twist by 4deg as that is the overall angle of incidence of the wing) twist = twist - 4. twistgrad = twist / (span / 2.) twist1 = twistgrad * length1 twist2 = twistgrad * etakf * (span / 2.) twist3 = twist createWingSection(mySections, tcRoot / 0.09, 0., 0., 0., cRoot, 1., cRoot, 0., 0., 0., 'NACA0009', 1, strUID + '_Sec1', strUID + '_Sec1', strUID + '_Sec1') createWingSection(mySections, tcRoot / 0.18, 0., 0., 0., cRoot, 1., cRoot, 0., 0., 0., 'NACA653218', 1, strUID + '_Sec2', strUID + '_Sec2', strUID + '_Sec2') createWingSection(mySections, tcTip / 0.18, 0., 0., 0., cKink, 1., cKink, 0., twist2, 0., 'NACA653218', 1, strUID + '_Sec3', strUID + '_Sec3', strUID + '_Sec3') createWingSection(mySections, tcTip / 0.18, 0., 0., 0., cTip, 1., cTip, 0., twist3, 0., 'NACA653218', 1, strUID + '_Sec4', strUID + '_Sec4', strUID + '_Sec4') createPositioning(myPositionings, str(id) + '_Pos1', None, str(id) + '_Sec1', 0., 0., 0., id) createPositioning(myPositionings, str(id) + '_Pos2', str(id) + '_Sec1', str(id) + '_Sec2', length1, 0., 0., id) createPositioning(myPositionings, str(id) + '_Pos3', str(id) + '_Sec2', str(id) + '_Sec3', length2, phiLE, dihedral, id) createPositioning(myPositionings, str(id) + '_Pos4', str(id) + '_Sec3', str(id) + '_Sec4', length3, phiLE, dihedral, id) myWing.set_sections(mySections) myWing.set_positionings(myPositionings) createWingSegments(myWing, strUID, 3) createComponentSegment(myWing, strUID) etafus = yfus / (span / 2.) # Ribs outboard of the Fuselage section are placed at 0.8 m distance nouterRibs = int(ceil((0.95 - etafus - 0.05) * span / 2. / 0.8)) createRibs(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'advDoubletrapezoid', etaFus=etafus, nRibs=nouterRibs, etaEng=etaEng, span=span / 2.) createSpars(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'advDoubletrapezoid', length1 / (span / 2.), etakf / cos(dihedral_rad), cTip=cTip, cRoot=cRoot) createShell(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'advDoubletrapezoid') createWingFuselageAttachment(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'advDoubletrapezoid') # Estimate ribNum of outer Rib iRib = int(span * (0.85 - etaEng) / (2 * 0.8)) - 1 createTanks(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'advDoubletrapezoid', nRib=iRib) # calc wing position tauK = cTip / cKink etar = dfus / span # XN25F = calcXN25F(cRoot, span, phiLE, etar, etakf, tauK, taperRatio) # xRoot.py = calcXRoot(xMAC25, XN25F) # set wing x - position and twist myWing.get_transformation().get_translation().set_x(doubleBaseType(valueOf_=str(xRoot))) myWing.get_transformation().get_rotation().set_y(doubleBaseType(valueOf_=str(4.)))