コード例 #1
0
ファイル: Spoiler.py プロジェクト: codingpoets/VAMPzero
def createSpoilerStructure(mySpoiler):
    myUID = mySpoiler.get_uID()

    
    createShell(mySpoiler, myUID, 'spoiler', thickness=0.005)
    createSpars(mySpoiler, myUID, 'spoiler')
    createRibs(mySpoiler, myUID, 'spoiler', thickness=0.001, nRibs=6)
コード例 #2
0
ファイル: trapezoid.py プロジェクト: p-chambers/VAMPzero
def createTrapezoidWing(myWing, id, tcRoot, tcTip, cTip, cRoot, span, phiLE,
                        dihedral, twist, 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()

    createWingSection(mySections, tcRoot / 0.09, 0., 0., 0., cRoot, 1., cRoot,
                      0., 0., 0., 'NACA0009', 1, strUID + '_Sec1',
                      strUID + '_Sec1', strUID + '_Sec1')
    createWingSection(mySections, tcTip / 0.09, 0., 0., 0., cTip, 1., cTip, 0.,
                      twist, 0., 'NACA0009', 1, strUID + '_Sec2',
                      strUID + '_Sec2', strUID + '_Sec2')
    # calc length from span, sweep and dihedral
    sweep_rad = phiLE / 180. * pi
    dihedral_rad = dihedral / 180. * pi
    length = (span / 2.) / cos(sweep_rad) / cos(
        dihedral_rad)  # @todo: provide dihedral

    createPositioning(myPositionings,
                      str(id) + '_Pos1', None,
                      str(id) + '_Sec1', 0., 0., 0., id)
    createPositioning(myPositionings,
                      str(id) + '_Pos2',
                      str(id) + '_Sec1',
                      str(id) + '_Sec2', length, phiLE, dihedral, id)

    myWing.set_sections(mySections)
    myWing.set_positionings(myPositionings)

    createWingSegments(myWing, strUID, 1)

    createComponentSegment(myWing, strUID)
    createSpars(myWing.get_componentSegments().get_componentSegment()[0],
                strUID, 'trapezoid')
    createShell(myWing.get_componentSegments().get_componentSegment()[0],
                strUID, 'trapezoid')
    createRibs(parent=myWing.get_componentSegments().get_componentSegment()[0],
               parentUID=id,
               typeOfSeg='trapezoid')
コード例 #3
0
ファイル: Flap.py プロジェクト: techtronics/VAMPzero
def createFlapStructure(myFlap, maxX=0.4, innerHingeXsi=0.7, outerHingeXsi=0.7, appendInnerCruiseRoller=False, type='flap', innerX=0., outerX=0.):
    myUID = myFlap.get_uID()

    # Structure    
    createShell(myFlap, myUID, type, thickness=0.001)
    createSpars(myFlap, myUID, type)
    createRibs(myFlap, myUID, type, thickness=0.001, nRibs=20)

    # Moveables
    createTracks(myFlap, type, myUID)
    createPath(myFlap, type, myUID, innerX, outerX, innerHingeXsi, outerHingeXsi)
    if appendInnerCruiseRoller:
        createCruiseRollers(myFlap, 'outerFlap', myUID + '_CR1')
コード例 #4
0
ファイル: strut.py プロジェクト: codingpoets/VAMPzero
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)))
コード例 #5
0
def createFlapStructure(myFlap,
                        maxX=0.4,
                        innerHingeXsi=0.7,
                        outerHingeXsi=0.7,
                        appendInnerCruiseRoller=False,
                        type='flap',
                        innerX=0.,
                        outerX=0.):
    myUID = myFlap.get_uID()

    # Structure
    createShell(myFlap, myUID, type, thickness=0.001)
    createSpars(myFlap, myUID, type)
    createRibs(myFlap, myUID, type, thickness=0.001, nRibs=20)

    # Moveables
    createTracks(myFlap, type, myUID)
    createPath(myFlap, type, myUID, innerX, outerX, innerHingeXsi,
               outerHingeXsi)
    if appendInnerCruiseRoller:
        createCruiseRollers(myFlap, 'outerFlap', myUID + '_CR1')
コード例 #6
0
ファイル: trapezoid.py プロジェクト: codingpoets/VAMPzero
def createTrapezoidWing(myWing, id, tcRoot, tcTip, cTip, cRoot, span, phiLE, dihedral, twist, 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()
    
    createWingSection(mySections, tcRoot / 0.09, 0., 0., 0., cRoot, 1., cRoot, 0., 0., 0., 'NACA0009', 1, strUID + '_Sec1', strUID + '_Sec1', strUID + '_Sec1')
    createWingSection(mySections, tcTip / 0.09, 0., 0., 0., cTip, 1., cTip, 0., twist, 0., 'NACA0009', 1, strUID + '_Sec2', strUID + '_Sec2', strUID + '_Sec2')
    # calc length from span, sweep and dihedral
    sweep_rad = phiLE / 180. * pi
    dihedral_rad = dihedral / 180. * pi
    length = (span / 2.) / cos(sweep_rad) / cos(dihedral_rad)  # @todo: provide dihedral
    
    createPositioning(myPositionings, str(id) + '_Pos1', None, str(id) + '_Sec1', 0., 0., 0., id)
    createPositioning(myPositionings, str(id) + '_Pos2', str(id) + '_Sec1', str(id) + '_Sec2', length, phiLE, dihedral, id)

    myWing.set_sections(mySections)
    myWing.set_positionings(myPositionings)
    
    createWingSegments(myWing, strUID, 1)

    createComponentSegment(myWing, strUID)
    createSpars(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'trapezoid')
    createShell(myWing.get_componentSegments().get_componentSegment()[0], strUID, 'trapezoid')
    createRibs(parent=myWing.get_componentSegments().get_componentSegment()[0], parentUID=id, typeOfSeg='trapezoid')
コード例 #7
0
ファイル: strut.py プロジェクト: p-chambers/VAMPzero
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)))
コード例 #8
0
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.)))
コード例 #9
0
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)))
コード例 #10
0
def createSpoilerStructure(mySpoiler):
    myUID = mySpoiler.get_uID()

    createShell(mySpoiler, myUID, 'spoiler', thickness=0.005)
    createSpars(mySpoiler, myUID, 'spoiler')
    createRibs(mySpoiler, myUID, 'spoiler', thickness=0.001, nRibs=6)
コード例 #11
0
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)))
コード例 #12
0
ファイル: aileron.py プロジェクト: techtronics/VAMPzero
def createAileronStructure(myAileron):
    createShell(myAileron, 'aileronUID', 'aileron', thickness=0.001)
    createSpars(myAileron, 'aileronUID', 'aileron')
    createRibs(myAileron, 'aileronUID', 'aileron', thickness=0.001, pitch=0.25)
コード例 #13
0
ファイル: aileron.py プロジェクト: p-chambers/VAMPzero
def createAileronStructure(myAileron):
    createShell(myAileron, 'aileronUID', 'aileron', thickness=0.001)
    createSpars(myAileron, 'aileronUID', 'aileron')
    createRibs(myAileron, 'aileronUID', 'aileron', thickness=0.001, pitch=0.25)
コード例 #14
0
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.)))