コード例 #1
0
ファイル: functions.py プロジェクト: codingpoets/VAMPzero
def createShell(parent, parentUID, typeOfSeg, thickness=0.003, pitch=0.14):
    '''
    Used for generation of wing upper and lower shell within a componentSegment
    @param parent: ComponentSegment object, upper and lower shell-object will be added here

    @param thickness:  thickness of the wing shell
    @param pitch: pitch of the stringers
    @param typeOfSeg: either advDoubleTrapezoid or trapezoid
    '''

    if typeOfSeg != 'strut':
        myAlu2024 = materialDefinitionType(materialUID=stringUIDBaseType(isLink='True', valueOf_='aluminium2024'), thickness=doubleBaseType(valueOf_=str(thickness)))
        myAlu7075 = materialDefinitionType(materialUID=stringUIDBaseType(isLink='True', valueOf_='aluminium7075'), thickness=doubleBaseType(valueOf_=str(thickness)))

        mySkin2024 = wingSkinType(material=myAlu2024)
        mySkin7075 = wingSkinType(material=myAlu7075)

        myStringerUp = wingStringerType(stringerStructureUID=stringUIDBaseType(valueOf_='Stringer_WING_up'), angle=doubleBaseType(valueOf_='0.0'), pitch=doubleBaseType(valueOf_=str(pitch)))
        myStringerLow = wingStringerType(stringerStructureUID=stringUIDBaseType(valueOf_='Stringer_WING_low'), angle=doubleBaseType(valueOf_='0.0'), pitch=doubleBaseType(valueOf_=str(pitch)))

        myShell2024 = wingShellType(uID='', skin=mySkin2024, stringer=myStringerLow)
        myShell7075 = wingShellType(uID='', skin=mySkin7075, stringer=myStringerUp)

        parent.get_structure().set_upperShell(myShell7075)
        parent.get_structure().set_lowerShell(myShell2024)

    elif typeOfSeg == 'strut':
        myComp_Long = materialDefinitionType(compositeUID = stringUIDBaseType(isLink='True',valueOf_='Comp_Long'), orthotropyDirection=doubleBaseType(valueOf_='0.'),\
                                         thicknessScaling=doubleBaseType(valueOf_='0.001'))

        mySkinComp = wingSkinType(material=myComp_Long)
        myShellComp = wingShellType(uID='', skin=mySkinComp)

        parent.get_structure().set_upperShell(myShellComp)
        parent.get_structure().set_lowerShell(myShellComp)
コード例 #2
0
ファイル: cruiseRoller.py プロジェクト: codingpoets/VAMPzero
def createRoller(uID='cruiseRoller1UID', eta=0.02, xsi=0.05, relHeight=0.3, positiv="False", negativ="True"):
    position = cruiseRollerPositionType(eta=doubleBaseType(valueOf_=str(eta)), xsi=doubleBaseType(valueOf_=str(xsi)), relHeight=doubleBaseType(valueOf_=str(relHeight)))
    parentAttachment = materialDefinitionType(materialUID=stringBaseType(valueOf_='aluminium2024'), thickness=doubleBaseType(valueOf_='0.001'))
    controlSurfaceAttachment = materialDefinitionType(materialUID=stringBaseType(valueOf_='aluminium2024'), thickness=doubleBaseType(valueOf_='0.001'))
    blockedDOF = blockedDOFType(positive=booleanBaseType(valueOf_=positiv), negative=booleanBaseType(valueOf_=negativ))
    
    return cruiseRollerType(uID=uID, position=position, parentAttachment=parentAttachment, controlSurfaceAttachment=controlSurfaceAttachment, blockedDOF=blockedDOF)
コード例 #3
0
def createSparSegment(parent,
                      parentUID,
                      targetUID='FS',
                      material='aluminium7075',
                      numOfPoints=3,
                      typeOfSeg='other'):
    '''
    Used for generation of sparSegment within sparSegments
    @param parent: sparSegments, sparSegment will be added here

    @param id:  id of the spar either FS or RS
    @param material: uID of the material to be used
    @param numOfPoint: the number of SparPositions to position the spar
    '''
    myUID = parentUID + '' + targetUID
    myName = stringBaseType(None, None, None, myUID)
    myDescr = stringBaseType(None, None, None, myUID)

    #===========================================================================
    # Spar Position UIDS
    #===========================================================================
    mySparPositionUIDs = sparPositionUIDsType(None, None, None, None)
    for i in range(numOfPoints):
        sparPositionUID = stringUIDBaseType(None, None, None, None,
                                            myUID + '_P' + str(i))
        mySparPositionUIDs.add_sparPositionUID(sparPositionUID)

    #===========================================================================
    # Spar Cross Section
    #===========================================================================
    if typeOfSeg != 'strut':
        myMaterialUID = stringUIDBaseType(isLink='True', valueOf_=material)
        myThickness = doubleBaseType(valueOf_=str(0.003))
        myMaterial = materialDefinitionType(materialUID=myMaterialUID,
                                            thickness=myThickness)

    elif typeOfSeg == 'strut':
        myMaterial = materialDefinitionType(compositeUID = stringUIDBaseType(isLink='True',valueOf_='Comp_Shear'), orthotropyDirection=doubleBaseType(valueOf_='0.'),\
                                         thicknessScaling=doubleBaseType(valueOf_='0.001'))

    myArea = doubleBaseType(None, None, None, str(0.0003))
    myCap = capType(None, None, None, myArea, myMaterial)

    myRelPos = doubleBaseType(None, None, None, str(0.5))
    myWeb = webType(None, None, None, myMaterial, myRelPos)

    myRotation = doubleBaseType(None, None, None, str(90.0))
    mySparCrossSection = sparCrossSectionType(None, None, None, myCap, myCap,
                                              myWeb, None, None, myRotation)

    #===========================================================================
    mySpar = sparSegmentType(None, None, None, myUID, myName, myDescr,
                             mySparPositionUIDs, mySparCrossSection)
    parent.add_sparSegment(mySpar)
コード例 #4
0
def createShell(parent, parentUID, typeOfSeg, thickness=0.003, pitch=0.14):
    '''
    Used for generation of wing upper and lower shell within a componentSegment
    @param parent: ComponentSegment object, upper and lower shell-object will be added here

    @param thickness:  thickness of the wing shell
    @param pitch: pitch of the stringers
    @param typeOfSeg: either advDoubleTrapezoid or trapezoid
    '''

    if typeOfSeg != 'strut':
        myAlu2024 = materialDefinitionType(
            materialUID=stringUIDBaseType(isLink='True',
                                          valueOf_='aluminium2024'),
            thickness=doubleBaseType(valueOf_=str(thickness)))
        myAlu7075 = materialDefinitionType(
            materialUID=stringUIDBaseType(isLink='True',
                                          valueOf_='aluminium7075'),
            thickness=doubleBaseType(valueOf_=str(thickness)))

        mySkin2024 = wingSkinType(material=myAlu2024)
        mySkin7075 = wingSkinType(material=myAlu7075)

        myStringerUp = wingStringerType(
            stringerStructureUID=stringUIDBaseType(
                valueOf_='Stringer_WING_up'),
            angle=doubleBaseType(valueOf_='0.0'),
            pitch=doubleBaseType(valueOf_=str(pitch)))
        myStringerLow = wingStringerType(
            stringerStructureUID=stringUIDBaseType(
                valueOf_='Stringer_WING_low'),
            angle=doubleBaseType(valueOf_='0.0'),
            pitch=doubleBaseType(valueOf_=str(pitch)))

        myShell2024 = wingShellType(uID='',
                                    skin=mySkin2024,
                                    stringer=myStringerLow)
        myShell7075 = wingShellType(uID='',
                                    skin=mySkin7075,
                                    stringer=myStringerUp)

        parent.get_structure().set_upperShell(myShell7075)
        parent.get_structure().set_lowerShell(myShell2024)

    elif typeOfSeg == 'strut':
        myComp_Long = materialDefinitionType(compositeUID = stringUIDBaseType(isLink='True',valueOf_='Comp_Long'), orthotropyDirection=doubleBaseType(valueOf_='0.'),\
                                         thicknessScaling=doubleBaseType(valueOf_='0.001'))

        mySkinComp = wingSkinType(material=myComp_Long)
        myShellComp = wingShellType(uID='', skin=mySkinComp)

        parent.get_structure().set_upperShell(myShellComp)
        parent.get_structure().set_lowerShell(myShellComp)
コード例 #5
0
ファイル: track.py プロジェクト: p-chambers/VAMPzero
def createTrackAileron(uid, eta, trackType):
    eta = doubleBaseType(valueOf_=str(eta))
    trackType = stringBaseType(valueOf_=trackType)
    controlSurfaceAttachment = materialDefinitionType(materialUID=stringBaseType(valueOf_='aluminium2024'), thickness=doubleBaseType(valueOf_='0.001'))
    #parentAttachment = materialDefinitionType(materialUID=stringBaseType(valueOf_='aluminium2024'), thickness=doubleBaseType(valueOf_='0.001'))
    trackStructure = trackStructureType(controlSurfaceAttachment=controlSurfaceAttachment)
    return controlSurfaceTrackTypeType(uID=uid, eta=eta, trackType=trackType, trackStructure=trackStructure)
コード例 #6
0
ファイル: functions.py プロジェクト: techtronics/VAMPzero
def createSparSegment(parent, parentUID, targetUID='FS', material='aluminium7075', numOfPoints=3, typeOfSeg='other'):
    '''
    Used for generation of sparSegment within sparSegments
    @param parent: sparSegments, sparSegment will be added here

    @param id:  id of the spar either FS or RS
    @param material: uID of the material to be used
    @param numOfPoint: the number of SparPositions to position the spar
    '''
    myUID = parentUID + '' + targetUID
    myName = stringBaseType(valueOf_=myUID)
    myDescr = stringBaseType(valueOf_= myUID)
    
    #===========================================================================
    # Spar Position UIDS
    #===========================================================================
    mySparPositionUIDs = sparPositionUIDsType()
    for i in range(numOfPoints):
        sparPositionUID = stringUIDBaseType(valueOf_=myUID + '_P' + str(i))
        mySparPositionUIDs.add_sparPositionUID(sparPositionUID)
    
    #===========================================================================
    # Spar Cross Section
    #===========================================================================
    if typeOfSeg != 'strut':
        myMaterialUID = stringUIDBaseType(isLink='True', valueOf_=material)
        myThickness = doubleBaseType(valueOf_=str(0.003))
        myMaterial = materialDefinitionType(materialUID=myMaterialUID, thickness=myThickness)

    elif typeOfSeg =='strut':
        #myMaterial = materialDefinitionType(compositeUID = stringUIDBaseType(isLink='True',valueOf_='Comp_Shear'), orthotropyDirection=doubleBaseType(valueOf_='0.'),\
        #                                 thicknessScaling=doubleBaseType(valueOf_='0.001'))
        myMaterial = materialDefinitionType(materialUID=stringUIDBaseType(isLink='True', valueOf_='aluminium7075'), thickness=doubleBaseType(valueOf_=str(0.03)))
    myArea = doubleBaseType(valueOf_=str(0.0003))
    myCap = capType(area=myArea, material=myMaterial)
    
    myRelPos = doubleBaseType(valueOf_=str(0.5))
    myWeb = webType(material=myMaterial, relPos=myRelPos)
    
    myRotation = doubleBaseType(valueOf_= str(90.0))
    mySparCrossSection = sparCrossSectionType(upperCap=myCap, lowerCap=myCap, web1=myWeb, rotation=myRotation)
    
    #===========================================================================
    mySpar = sparSegmentType(uID=myUID, name=myName, description=myDescr, sparPositionUIDs=mySparPositionUIDs, sparCrossSection=mySparCrossSection)
    parent.add_sparSegment(mySpar)
コード例 #7
0
ファイル: cruiseRoller.py プロジェクト: p-chambers/VAMPzero
def createRoller(uID='cruiseRoller1UID',
                 eta=0.02,
                 xsi=0.05,
                 relHeight=0.3,
                 positiv="False",
                 negativ="True"):
    position = cruiseRollerPositionType(
        eta=doubleBaseType(valueOf_=str(eta)),
        xsi=doubleBaseType(valueOf_=str(xsi)),
        relHeight=doubleBaseType(valueOf_=str(relHeight)))
    parentAttachment = materialDefinitionType(
        materialUID=stringBaseType(valueOf_='aluminium2024'),
        thickness=doubleBaseType(valueOf_='0.001'))
    controlSurfaceAttachment = materialDefinitionType(
        materialUID=stringBaseType(valueOf_='aluminium2024'),
        thickness=doubleBaseType(valueOf_='0.001'))
    blockedDOF = blockedDOFType(positive=booleanBaseType(valueOf_=positiv),
                                negative=booleanBaseType(valueOf_=negativ))

    return cruiseRollerType(uID=uID,
                            position=position,
                            parentAttachment=parentAttachment,
                            controlSurfaceAttachment=controlSurfaceAttachment,
                            blockedDOF=blockedDOF)
コード例 #8
0
ファイル: actuators.py プロジェクト: p-chambers/VAMPzero
def createActuator(uID='act', actuatorUID='Aileron_Act', etaControlSurface=0.3, parentXsi=0.7, parentHeight=0.1, controlSurfaceXsi=0.7, controlSurfaceHeight=0.1):
    #===============================================================================
    # Create the attachment 
    #===============================================================================
    etaControlSurface = doubleBaseType(valueOf_=str(etaControlSurface))
    material = materialDefinitionType(materialUID=stringBaseType(valueOf_='aluminium2024'), thickness=doubleBaseType(valueOf_='0.001'))

    parentXsi = doubleBaseType(valueOf_=str(parentXsi))
    parentHeight = doubleBaseType(valueOf_=str(parentHeight))
    parentAttachment = actuatorParentAttachmentType(parentXsi=parentXsi, parentHeight=parentHeight, material=material)

    parentXsi = doubleBaseType(valueOf_=str(controlSurfaceXsi))
    parentHeight = doubleBaseType(valueOf_=str(controlSurfaceHeight))
    controlSurfaceAttachment = actuatorControlSurfaceAttachmentType(parentXsi=parentXsi, parentHeight=parentHeight, material=material)
    
    attachment = actuatorAttachmentType(etaControlSurface=etaControlSurface, parentAttachment=parentAttachment, controlSurfaceAttachment=controlSurfaceAttachment)
    
    #===========================================================================
    # Create the actuator
    #===========================================================================
    
    return controlSurfaceActuatorType(uID=uID, actuatorUID=stringUIDBaseType(isLink='True', valueOf_=actuatorUID), attachment=attachment)
コード例 #9
0
ファイル: track.py プロジェクト: p-chambers/VAMPzero
def createTrackFlap(uID, eta, trackType, trackSubType=None, actuatorcounter=1):
    eta = doubleBaseType(valueOf_=str(eta))
    trackType = stringBaseType(valueOf_=trackType)
    if trackSubType is not None:
        trackSubType = stringBaseType(valueOf_=trackSubType)
    
    global nFlapActuators
    trackActuator = trackActuatorType(uID=uID + '_actuatorUID', actuatorUID=stringUIDBaseType(isLink='true', valueOf_='Act_FT'+str(nFlapActuators)), material=materialDefinitionType(materialUID=stringBaseType(valueOf_='aluminium2024'), thickness=doubleBaseType(valueOf_='0.001')))
    nFlapActuators += 1
    controlSurfaceAttachment = materialDefinitionType(materialUID=stringBaseType(valueOf_='aluminium2024'), thickness=doubleBaseType(valueOf_='0.001'))
    #parentAttachment = materialDefinitionType(materialUID=stringBaseType(valueOf_='aluminium2024'), thickness=doubleBaseType(valueOf_='0.001'))
    sidePanels = materialDefinitionType(materialUID=stringBaseType(valueOf_='aluminium2024'), thickness=doubleBaseType(valueOf_='0.001'))
    upperPanel = materialDefinitionType(materialUID=stringBaseType(valueOf_='aluminium2024'), thickness=doubleBaseType(valueOf_='0.001'))
    lowerPanel = materialDefinitionType(materialUID=stringBaseType(valueOf_='titan'), thickness=doubleBaseType(valueOf_='0.001'))
    rollerTrack = materialDefinitionType(materialUID=stringBaseType(valueOf_='titan'), thickness=doubleBaseType(valueOf_='0.001'))
    ribs = materialDefinitionType(materialUID=stringBaseType(valueOf_='aluminium2024'), thickness=doubleBaseType(valueOf_='0.001'))
    car = materialDefinitionType(materialUID=stringBaseType(valueOf_='aluminium2024'), thickness=doubleBaseType(valueOf_='0.001'))
    
    trackStructure = trackStructureType(controlSurfaceAttachment=controlSurfaceAttachment, sidePanels=sidePanels, upperPanel=upperPanel, lowerPanel=lowerPanel, rollerTrack=rollerTrack, ribs=ribs, car=car)
    
    if trackSubType is None:
        return controlSurfaceTrackTypeType(uID=uID, eta=eta, trackType=trackType, trackStructure=trackStructure, actuator=trackActuator)
    else:
        return controlSurfaceTrackTypeType(uID=uID, eta=eta, trackType=trackType, trackSubType=trackSubType, trackStructure=trackStructure, actuator=trackActuator)
コード例 #10
0
ファイル: functions.py プロジェクト: techtronics/VAMPzero
def createRibs(parent, parentUID, typeOfSeg, thickness=0.03, pitch=.8, nRibs=None, etaFus=0.2, etaEng=.3, span=17., fanDiameter=1.9, etaStrut=0.0, phi25 = 0.0):
    '''
    Used for generation of a ribs definition in the wing 

    @param parent: ComponentSegment object, ribsDefinition will be added here
    @param thickness:  thickness of the ribs
    @param pitch: pitch of the ribs
    @param typeOfSeg: either advDoubleTrapezoid or trapezoid
    '''
    myUID = parentUID + '_ribs'
    ribsList = []

    #===============================================================================
    # Advanced Double Trapezoid 
    #===============================================================================
    if typeOfSeg.lower() == 'advdoubletrapezoid':
        myName = stringBaseType(valueOf_='wing_ribs')

        # Rib Cross Section
        #=======================================================================
        myMaterial = materialDefinitionType(materialUID=stringUIDBaseType(valueOf_='aluminium7075'), thickness=doubleBaseType(valueOf_=str(thickness)))
        myCrossSection = wingRibCrossSectionType(material=myMaterial)
        ribReference = stringBaseType(valueOf_=parentUID + '_Spar_FS')
        ribStart = stringBaseType(valueOf_=parentUID + '_Spar_FS')
        ribEnd = stringBaseType(valueOf_=parentUID + '_Spar_RS')
        ribRotation = ribRotationType(ribRotationReference=stringBaseType(valueOf_='globalY'), z=doubleBaseType(valueOf_=str('90.')))
        ribCrossing = ribCrossingBehaviourType(valueOf_='cross')

        #=======================================================================
        # First set of 4 ribs inside the fuselage
        #=======================================================================
        etaStart = doubleBaseType(valueOf_='0.0')
        etaEnd = doubleBaseType(valueOf_=str(etaFus))
        innerRibs = doubleBaseType(valueOf_= 4)
        ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                      numberOfRibs=innerRibs, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)
        
        myUID = parentUID + '_ribs_inner'
        ribsList.append(wingRibsDefinitionType(uID=myUID, name=myName, ribsPositioning=ribsPositioning, ribCrossSection=myCrossSection))

        #===============================================================
        # Second set outside of the fuselage up to the engine
        #===============================================================
        etaPylon = 1. / 10. * fanDiameter / span
        etaStart = doubleBaseType(valueOf_=str(etaFus + pitch / span))
        etaEnd = doubleBaseType(valueOf_=str(etaEng - etaPylon))
        middleRibs = int(ceil((etaEng - etaPylon - etaFus) * span / pitch)) - 1
        if middleRibs < 1:
            middleRibs = 1
        middleRibs = doubleBaseType(valueOf_=middleRibs)
        ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                      numberOfRibs=middleRibs, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)
        
        myUID = parentUID + '_ribs_engine1'
        ribsList.append(wingRibsDefinitionType(uID=myUID, name=myName, ribsPositioning=ribsPositioning, ribCrossSection=myCrossSection))

        #===============================================================
        # Third set one ribs outside of the pylon
        #===============================================================
        etaEnd = doubleBaseType(valueOf_= str(etaEng + etaPylon))
        pylonRibs = doubleBaseType(valueOf_= str(1))
        ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                      numberOfRibs=pylonRibs, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)
        
        myUID = parentUID + '_ribs_engine2'
        ribsList.append(wingRibsDefinitionType(uID=myUID, name=myName, ribsPositioning=ribsPositioning, ribCrossSection=myCrossSection))

        #===============================================================
        # Fourth set outside of the engine
        #===============================================================
        etaStart = doubleBaseType(valueOf_= str(etaEng + etaPylon + pitch / span))
        etaEnd = doubleBaseType(valueOf_= '0.95')
        
        ribCrossing = ribCrossingBehaviourType(valueOf_='end')
        ribRotation = ribRotationType(ribRotationReference=stringBaseType(valueOf_='wing_Spar_FS'), \
                                           z=doubleBaseType(valueOf_='90.'))

        outerRibs = int(ceil((0.95 - etaEng + etaPylon) * span / pitch)) - 1
        outerRibs = doubleBaseType(valueOf_= outerRibs)

        ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                      numberOfRibs=outerRibs, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)
        myUID = parentUID + '_ribs_outer'
        ribsList.append(wingRibsDefinitionType(uID=myUID, name=myName, ribsPositioning=ribsPositioning, ribCrossSection=myCrossSection))

    #===============================================================================
    # Strut Braced Wing
    #===============================================================================
    if typeOfSeg.lower() == 'strutbracedwing':
        myName = stringBaseType(valueOf_='wing_ribs')

        # Rib Cross Section
        #=======================================================================
        myMaterial = materialDefinitionType(materialUID=stringUIDBaseType(valueOf_='aluminium7075'), thickness=doubleBaseType(valueOf_=str(thickness)))
        myCrossSection = wingRibCrossSectionType(material=myMaterial)
        ribReference = stringBaseType(valueOf_=parentUID + '_Spar_FS')
        ribStart = stringBaseType(valueOf_=parentUID + '_Spar_FS')
        ribEnd = stringBaseType(valueOf_=parentUID + '_Spar_RS')
        ribRotation = ribRotationType(ribRotationReference=stringBaseType(valueOf_='globalY'), z=doubleBaseType(valueOf_=str('90.')))
        ribCrossing = ribCrossingBehaviourType(valueOf_='cross')

        #=======================================================================
        # First set of 4 ribs inside the fuselage
        #=======================================================================
        etaStart = doubleBaseType(valueOf_='0.0')
        etaEnd = doubleBaseType(valueOf_=str(etaFus))
        innerRibs = doubleBaseType(valueOf_=4)
        ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                      numberOfRibs=innerRibs, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)

        myUID = parentUID + '_ribs_inner'
        ribsList.append(wingRibsDefinitionType(uID=myUID, name=myName, ribsPositioning=ribsPositioning, ribCrossSection=myCrossSection))

        #===============================================================
        # Second set outside of the fuselage up to the strut
        #===============================================================
        etaStart = doubleBaseType(valueOf_=str(etaFus + pitch / span + phi25 * 0.0002))
        etaEnd = doubleBaseType(valueOf_=str(etaStrut))
        middleRibs = int(ceil((etaStrut - etaFus) * span / pitch)) - 1
        middleRibs = doubleBaseType(valueOf_=middleRibs)
        ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                      numberOfRibs=middleRibs, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)

        myUID = parentUID + '_ribs_strut'
        ribsList.append(wingRibsDefinitionType(uID=myUID, name=myName, ribsPositioning=ribsPositioning, ribCrossSection=myCrossSection))

        #===============================================================
        # Third set outside of the spar
        #===============================================================
        etaStart = doubleBaseType(valueOf_=str(etaStrut + pitch / span))
        etaEnd = doubleBaseType(valueOf_='0.95')

        ribCrossing = ribCrossingBehaviourType(valueOf_='end')
        ribRotation = ribRotationType(ribRotationReference=stringBaseType(valueOf_='wing_Spar_FS'), z=doubleBaseType(valueOf_=str('90.')))

        outerRibs = int(ceil((0.95 - etaStrut) * span / pitch)) - 1
        outerRibs = doubleBaseType(valueOf_=outerRibs)

        ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                      numberOfRibs=outerRibs, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)

        myUID = parentUID + '_ribs_outer'
        ribsList.append(wingRibsDefinitionType(uID=myUID, name=myName, ribsPositioning=ribsPositioning, ribCrossSection=myCrossSection))

    #===============================================================================
    # Strut (And only the strut not the wing that goes along with it)
    #===============================================================================
    if typeOfSeg.lower() == 'strut':
        myName = stringBaseType(valueOf_='strut_ribs')

        # Rib Cross Section
        #=======================================================================
        #myMaterial = materialDefinitionType(compositeUID=stringUIDBaseType(isLink='True',valueOf_='Comp_Shear'), orthotropyDirection=doubleBaseType(valueOf_='0.'),\
        #                                  thicknessScaling=doubleBaseType(valueOf_='0.001'))
        myMaterial = materialDefinitionType(materialUID=stringUIDBaseType(valueOf_='aluminium7075'), thickness=doubleBaseType(valueOf_=str(thickness)))
        myCrossSection = wingRibCrossSectionType(material=myMaterial)
        ribReference = stringBaseType(valueOf_='leadingEdge')
        ribStart = stringBaseType(valueOf_='leadingEdge')
        ribEnd = stringBaseType(valueOf_='trailingEdge')
        ribRotation = ribRotationType(ribRotationReference=stringBaseType(valueOf_='globalY'), z=doubleBaseType(valueOf_=str('90.')))
        ribCrossing = ribCrossingBehaviourType(valueOf_='cross')

        etaStart = doubleBaseType(valueOf_=str(0.))
        etaEnd = doubleBaseType(valueOf_=str(1.))
        middleRibs = doubleBaseType(valueOf_=5.)
        ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                      numberOfRibs=middleRibs, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)

        myUID = parentUID + '_ribs'
        ribsList.append(wingRibsDefinitionType(uID=myUID, name=myName, ribsPositioning=ribsPositioning, ribCrossSection=myCrossSection))

    #===============================================================================
    # Aileron 
    #===============================================================================
    if typeOfSeg.lower() == 'aileron':
        myName = stringBaseType(valueOf_='aileron_ribs')

        # Rib Cross Section
        #=======================================================================
        myMaterial = materialDefinitionType(materialUID=stringUIDBaseType(valueOf_='aluminium7075'), thickness=doubleBaseType(valueOf_=str(thickness)))
        myCrossSection = wingRibCrossSectionType(material= myMaterial)
        
        # Rib Positioning
        #=======================================================================
        etaStart = doubleBaseType(valueOf_='0.')
        etaEnd = doubleBaseType(valueOf_='1.')
        ribReference = stringBaseType(valueOf_=parentUID + '_Spar_FS')
        ribStart = stringBaseType(valueOf_='leadingEdge')
        ribEnd = stringBaseType(valueOf_='trailingEdge')
        ribRotation = ribRotationType(ribRotationReference=stringBaseType(valueOf_='globalY'), z=doubleBaseType(valueOf_=str('90.')))
        ribCrossing = ribCrossingBehaviourType(valueOf_='cross')

        if nRibs is None:
            ribSpacing = doubleBaseType(valueOf_=pitch)
            ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                          spacing=ribSpacing, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)
        else: 
            nRibs = doubleBaseType(valueOf_=nRibs)
            ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                          numberOfRibs=nRibs, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)
        
        ribsList.append(wingRibsDefinitionType(uID=myUID, name=myName, ribsPositioning=ribsPositioning, ribCrossSection=myCrossSection))

    if typeOfSeg.lower() == 'trapezoid':
        myName = stringBaseType(valueOf_='trapezoid_ribs')

        # Rib Cross Section
        #=======================================================================
        myMaterial = materialDefinitionType(materialUID=stringUIDBaseType(valueOf_='aluminium7075'), thickness=doubleBaseType(valueOf_=str(thickness)))
        myCrossSection = wingRibCrossSectionType(material= myMaterial)

        # Rib Positioning
        #=======================================================================
        etaStart = doubleBaseType(valueOf_='0.')
        etaEnd = doubleBaseType(valueOf_='1.')
        ribReference = stringBaseType(valueOf_=parentUID + '_Spar_FS')
        ribStart = stringBaseType(valueOf_='leadingEdge')
        ribEnd = stringBaseType(valueOf_='trailingEdge')
        ribRotation = ribRotationType(ribRotationReference=stringBaseType(valueOf_='globalY'), z=doubleBaseType(valueOf_=str('90.')))
        ribCrossing = ribCrossingBehaviourType(valueOf_='cross')

        middleRibs = doubleBaseType(valueOf_=5.)
        ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                      numberOfRibs=middleRibs, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)

        ribsList.append(wingRibsDefinitionType(uID=myUID, name=myName, ribsPositioning=ribsPositioning, ribCrossSection=myCrossSection))

    #===============================================================================
    # Flap
    #===============================================================================
    if typeOfSeg.lower() == 'flap' or typeOfSeg.lower() == 'innerflap':
        myName = stringBaseType(valueOf_='flap_ribs')

        # Rib Cross Section
        #=======================================================================
        myMaterial = materialDefinitionType(materialUID=stringUIDBaseType(valueOf_='aluminium7075'), thickness=doubleBaseType(valueOf_=str(thickness)))
        myCrossSection = wingRibCrossSectionType(material= myMaterial)
        
        # Rib Positioning
        #=======================================================================
        etaStart = doubleBaseType(valueOf_='0.')
        etaEnd = doubleBaseType(valueOf_='1.')
        ribReference = stringBaseType(valueOf_=parentUID + '_Spar_FS')
        ribStart = stringBaseType(valueOf_='leadingEdge')
        ribEnd = stringBaseType(valueOf_='trailingEdge')
        ribRotation = ribRotationType(ribRotationReference=stringBaseType(valueOf_='globalY'), z=doubleBaseType(valueOf_=str('90.')))
        ribCrossing = ribCrossingBehaviourType(valueOf_='cross')

        if nRibs is None:
            ribSpacing = doubleBaseType(valueOf_=pitch)
            ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                          spacing=ribSpacing, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)
        else:
            nRibs = doubleBaseType(valueOf_=nRibs)
            ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                          numberOfRibs=nRibs, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)

        ribsList.append(wingRibsDefinitionType(uID=myUID, name=myName, ribsPositioning=ribsPositioning, ribCrossSection=myCrossSection))
    #===============================================================================
    # Spoiler
    #===============================================================================
    if typeOfSeg.lower() == 'spoiler':
        myName = stringBaseType(valueOf_='spoiler_ribs')

        # Rib Cross Section
        #=======================================================================
        myMaterial = materialDefinitionType(materialUID=stringUIDBaseType(valueOf_='aluminium7075'), thickness=doubleBaseType(valueOf_=str(thickness)))
        myCrossSection = wingRibCrossSectionType(material= myMaterial)
        
        # Rib Positioning
        #=======================================================================
        etaStart = doubleBaseType(valueOf_='0.')
        etaEnd = doubleBaseType(valueOf_='1.')
        ribReference = stringBaseType(valueOf_='leadingEdge')
        ribStart = stringBaseType(valueOf_='leadingEdge')
        ribEnd = stringBaseType(valueOf_='trailingEdge')
        ribRotation = ribRotationType(ribRotationReference=stringBaseType(valueOf_='globalY'), z=doubleBaseType(valueOf_=str('90.')))
        ribCrossing = ribCrossingBehaviourType(valueOf_='cross')

        if nRibs is None:
            ribSpacing = doubleBaseType(valueOf_=pitch)
            ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                          spacing=ribSpacing, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)
        else:
            nRibs = doubleBaseType(valueOf_=nRibs)
            ribsPositioning = wingRibsPositioningType(ribReference=ribReference, etaStart=etaStart, etaEnd=etaEnd, ribStart=ribStart, ribEnd=ribEnd, \
                                          numberOfRibs=nRibs, ribCrossingBehaviour=ribCrossing, ribRotation=ribRotation)

        ribsList.append(wingRibsDefinitionType(uID=myUID, name=myName, ribsPositioning=ribsPositioning, ribCrossSection=myCrossSection))
        
    #=======================================================================
    # RibsDefinition
    #=======================================================================
    
    myRibsDefinitions = wingRibsDefinitionsType(None, None, None, ribsList)
    
    parent.get_structure().set_ribsDefinitions(myRibsDefinitions)
コード例 #11
0
def createRibs(parent,
               parentUID,
               typeOfSeg,
               thickness=0.03,
               pitch=.8,
               nRibs=None,
               etaFus=0.2,
               etaEng=.3,
               span=17.,
               fanDiameter=1.9,
               etaStrut=0.0,
               phi25=0.0):
    '''
    Used for generation of a ribs definition in the wing 

    @param parent: ComponentSegment object, ribsDefinition will be added here
    @param thickness:  thickness of the ribs
    @param pitch: pitch of the ribs
    @param typeOfSeg: either advDoubleTrapezoid or trapezoid
    '''
    myUID = parentUID + '_ribs'
    ribsList = []

    #===============================================================================
    # Advanced Double Trapezoid
    #===============================================================================
    if typeOfSeg.lower() == 'advdoubletrapezoid':
        myName = stringBaseType(None, None, None, 'wing_ribs')

        # Rib Cross Section
        #=======================================================================
        myMaterial = materialDefinitionType(None, None, None, None, None, None, stringUIDBaseType(None, None, 'True', None, 'aluminium7075'), \
                                              doubleBaseType(None, None, None, str(thickness)))
        myCrossSection = wingRibCrossSectionType(None, None, None, myMaterial,
                                                 None)
        ribReference = stringBaseType(None, None, None, parentUID + '_Spar_FS')
        ribStart = stringBaseType(None, None, None, parentUID + '_Spar_FS')
        ribEnd = stringBaseType(None, None, None, parentUID + '_Spar_RS')
        ribRotation = ribRotationType(None, None, None, stringBaseType(None, None, None, 'globalY'), \
                                           doubleBaseType(None, None, None, '90.'))
        ribCrossing = ribCrossingBehaviourType(None, None, None, 'cross')

        #=======================================================================
        # First set of 4 ribs inside the fuselage
        #=======================================================================
        etaStart = doubleBaseType(None, None, None, '0.0')
        etaEnd = doubleBaseType(None, None, None, str(etaFus))
        innerRibs = doubleBaseType(None, None, None, 4)
        ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                      None, innerRibs, ribCrossing, ribRotation)

        myUID = parentUID + '_ribs_inner'
        ribsList.append(
            wingRibsDefinitionType(None, None, None, myUID, myName, None,
                                   ribsPositioning, myCrossSection))

        #===============================================================
        # Second set outside of the fuselage up to the engine
        #===============================================================
        etaPylon = 1. / 10. * fanDiameter / span
        etaStart = doubleBaseType(None, None, None, str(etaFus + pitch / span))
        etaEnd = doubleBaseType(None, None, None, str(etaEng - etaPylon))
        middleRibs = int(ceil((etaEng - etaPylon - etaFus) * span / pitch)) - 1
        if middleRibs < 1:
            middleRibs = 1
        middleRibs = doubleBaseType(None, None, None, middleRibs)
        ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                      None, middleRibs, ribCrossing, ribRotation)

        myUID = parentUID + '_ribs_engine1'
        ribsList.append(
            wingRibsDefinitionType(None, None, None, myUID, myName, None,
                                   ribsPositioning, myCrossSection))

        #===============================================================
        # Third set one ribs outside of the pylon
        #===============================================================
        etaEnd = doubleBaseType(None, None, None, str(etaEng + etaPylon))
        pylonRibs = doubleBaseType(None, None, None, str(1))
        ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaEnd, etaEnd, ribStart, ribEnd, \
                                      None, pylonRibs, ribCrossing, ribRotation)

        myUID = parentUID + '_ribs_engine2'
        ribsList.append(
            wingRibsDefinitionType(None, None, None, myUID, myName, None,
                                   ribsPositioning, myCrossSection))

        #===============================================================
        # Fourth set outside of the engine
        #===============================================================
        etaStart = doubleBaseType(None, None, None,
                                  str(etaEng + etaPylon + pitch / span))
        etaEnd = doubleBaseType(None, None, None, '0.95')

        ribCrossing = ribCrossingBehaviourType(None, None, None, 'end')
        ribRotation = ribRotationType(None, None, None, stringBaseType(None, None, None, 'wing_Spar_FS'), \
                                           doubleBaseType(None, None, None, '90.'))

        outerRibs = int(ceil((0.95 - etaEng + etaPylon) * span / pitch)) - 1
        outerRibs = doubleBaseType(None, None, None, outerRibs)

        ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                      None, outerRibs, ribCrossing, ribRotation)
        myUID = parentUID + '_ribs_outer'
        ribsList.append(
            wingRibsDefinitionType(None, None, None, myUID, myName, None,
                                   ribsPositioning, myCrossSection))

    #===============================================================================
    # Strut Braced Wing
    #===============================================================================
    if typeOfSeg.lower() == 'strutbracedwing':
        myName = stringBaseType(None, None, None, 'wing_ribs')

        # Rib Cross Section
        #=======================================================================
        myMaterial = materialDefinitionType(None, None, None, None, None, None, stringUIDBaseType(None, None, 'True', None, 'aluminium7075'), \
                                              doubleBaseType(None, None, None, str(thickness)))
        myCrossSection = wingRibCrossSectionType(None, None, None, myMaterial,
                                                 None)
        ribReference = stringBaseType(None, None, None, parentUID + '_Spar_FS')
        ribStart = stringBaseType(None, None, None, parentUID + '_Spar_FS')
        ribEnd = stringBaseType(None, None, None, parentUID + '_Spar_RS')
        ribRotation = ribRotationType(None, None, None, stringBaseType(None, None, None, 'globalY'), \
                                           doubleBaseType(None, None, None, '90.'))
        ribCrossing = ribCrossingBehaviourType(None, None, None, 'cross')

        #=======================================================================
        # First set of 4 ribs inside the fuselage
        #=======================================================================
        etaStart = doubleBaseType(None, None, None, '0.0')
        etaEnd = doubleBaseType(None, None, None, str(etaFus))
        innerRibs = doubleBaseType(None, None, None, 4)
        ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                      None, innerRibs, ribCrossing, ribRotation)

        myUID = parentUID + '_ribs_inner'
        ribsList.append(
            wingRibsDefinitionType(None, None, None, myUID, myName, None,
                                   ribsPositioning, myCrossSection))

        #===============================================================
        # Second set outside of the fuselage up to the strut
        #===============================================================
        etaStart = doubleBaseType(None, None, None,
                                  str(etaFus + pitch / span + phi25 * 0.0002))
        etaEnd = doubleBaseType(None, None, None, str(etaStrut))
        middleRibs = int(ceil((etaStrut - etaFus) * span / pitch)) - 1
        middleRibs = doubleBaseType(None, None, None, middleRibs)
        ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                      None, middleRibs, ribCrossing, ribRotation)

        myUID = parentUID + '_ribs_strut'
        ribsList.append(
            wingRibsDefinitionType(None, None, None, myUID, myName, None,
                                   ribsPositioning, myCrossSection))

        #===============================================================
        # Third set outside of the spar
        #===============================================================
        etaStart = doubleBaseType(None, None, None,
                                  str(etaStrut + pitch / span))
        etaEnd = doubleBaseType(None, None, None, '0.95')

        ribCrossing = ribCrossingBehaviourType(None, None, None, 'end')
        ribRotation = ribRotationType(None, None, None, stringBaseType(None, None, None, 'wing_Spar_FS'), \
                                           doubleBaseType(None, None, None, '90.'))

        outerRibs = int(ceil((0.95 - etaStrut) * span / pitch)) - 1
        outerRibs = doubleBaseType(None, None, None, outerRibs)

        ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                      None, outerRibs, ribCrossing, ribRotation)
        myUID = parentUID + '_ribs_outer'
        ribsList.append(
            wingRibsDefinitionType(None, None, None, myUID, myName, None,
                                   ribsPositioning, myCrossSection))

    #===============================================================================
    # Strut (And only the strut not the wing that goes along with it)
    #===============================================================================
    if typeOfSeg.lower() == 'strut':
        myName = stringBaseType(None, None, None, 'strut_ribs')

        # Rib Cross Section
        #=======================================================================
        myMaterial = materialDefinitionType(compositeUID=stringUIDBaseType(isLink='True',valueOf_='Comp_Shear'), orthotropyDirection=doubleBaseType(valueOf_='0.'),\
                                          thicknessScaling=doubleBaseType(valueOf_='0.001'))
        myCrossSection = wingRibCrossSectionType(None, None, None, myMaterial,
                                                 None)
        ribReference = stringBaseType(None, None, None, 'leadingEdge')
        ribStart = stringBaseType(None, None, None, 'leadingEdge')
        ribEnd = stringBaseType(None, None, None, 'trailingEdge')
        ribRotation = ribRotationType(None, None, None, stringBaseType(None, None, None, 'globalY'), \
                                           doubleBaseType(None, None, None, '90.'))
        ribCrossing = ribCrossingBehaviourType(None, None, None, 'cross')

        etaStart = doubleBaseType(None, None, None, str(0.001))
        etaEnd = doubleBaseType(None, None, None, str(0.999))
        #middleRibs = int(ceil(span / 0.70)) - 1
        middleRibs = doubleBaseType(None, None, None, 5.)
        ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                      None, middleRibs, ribCrossing, ribRotation)

        myUID = parentUID + '_ribs'
        ribsList.append(
            wingRibsDefinitionType(None, None, None, myUID, myName, None,
                                   ribsPositioning, myCrossSection))

    #===============================================================================
    # Aileron
    #===============================================================================
    if typeOfSeg.lower() == 'aileron':
        myName = stringBaseType(None, None, None, 'aileron_ribs')

        # Rib Cross Section
        #=======================================================================
        myMaterial = materialDefinitionType(None, None, None, None, None, None, stringUIDBaseType(None, None, 'True', None, 'aluminium2024'), \
                                              doubleBaseType(None, None, None, str(thickness)))
        myCrossSection = wingRibCrossSectionType(None, None, None, myMaterial,
                                                 None)

        # Rib Positioning
        #=======================================================================
        etaStart = doubleBaseType(None, None, None, '0.')
        etaEnd = doubleBaseType(None, None, None, '1.')
        ribReference = stringBaseType(None, None, None, parentUID + '_Spar_FS')
        ribStart = stringBaseType(None, None, None, 'leadingEdge')
        ribEnd = stringBaseType(None, None, None, 'trailingEdge')
        ribRotation = ribRotationType(None, None, None, stringBaseType(None, None, None, 'globalY'), \
                                           doubleBaseType(None, None, None, '90.'))
        ribCrossing = ribCrossingBehaviourType(None, None, None, 'cross')
        if nRibs is None:
            ribSpacing = doubleBaseType(None, None, None, pitch)
            ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                          ribSpacing, None, ribCrossing, ribRotation)
        else:
            nRibs = doubleBaseType(None, None, None, nRibs)
            ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                          None, nRibs, ribCrossing, ribRotation)

        ribsList.append(
            wingRibsDefinitionType(None, None, None, myUID, myName, None,
                                   ribsPositioning, myCrossSection))

    if typeOfSeg.lower() == 'trapezoid':
        myName = stringBaseType(None, None, None, 'trapezoid_ribs')

        # Rib Cross Section
        #=======================================================================
        myMaterial = materialDefinitionType(None, None, None, None, None, None, stringUIDBaseType(None, None, 'True', None, 'aluminium2024'), \
                                              doubleBaseType(None, None, None, str(thickness)))
        myCrossSection = wingRibCrossSectionType(None, None, None, myMaterial,
                                                 None)

        # Rib Positioning
        #=======================================================================
        etaStart = doubleBaseType(None, None, None, '0.')
        etaEnd = doubleBaseType(None, None, None, '1.')
        ribReference = stringBaseType(None, None, None, parentUID + '_Spar_FS')
        ribStart = stringBaseType(None, None, None, 'leadingEdge')
        ribEnd = stringBaseType(None, None, None, 'trailingEdge')
        ribRotation = ribRotationType(None, None, None, stringBaseType(None, None, None, 'globalY'), \
                                           doubleBaseType(None, None, None, '90.'))
        ribCrossing = ribCrossingBehaviourType(None, None, None, 'cross')

        etaStart = doubleBaseType(None, None, None, str(0.0))
        etaEnd = doubleBaseType(None, None, None, str(0.95))
        middleRibs = doubleBaseType(None, None, None, 5.)
        ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                      None, middleRibs, ribCrossing, ribRotation)

        ribsList.append(
            wingRibsDefinitionType(None, None, None, myUID, myName, None,
                                   ribsPositioning, myCrossSection))

    #===============================================================================
    # Flap
    #===============================================================================
    if typeOfSeg.lower() == 'flap' or typeOfSeg.lower() == 'innerflap':
        myName = stringBaseType(None, None, None, 'flap_ribs')

        # Rib Cross Section
        #=======================================================================
        myMaterial = materialDefinitionType(None, None, None, None, None, None, stringUIDBaseType(None, None, 'True', None, 'aluminium2024'), \
                                              doubleBaseType(None, None, None, str(thickness)))
        myCrossSection = wingRibCrossSectionType(None, None, None, myMaterial,
                                                 None)

        # Rib Positioning
        #=======================================================================
        etaStart = doubleBaseType(None, None, None, '0.')
        etaEnd = doubleBaseType(None, None, None, '1.')
        ribReference = stringBaseType(None, None, None, parentUID + '_Spar_FS')
        ribStart = stringBaseType(None, None, None, 'leadingEdge')
        ribEnd = stringBaseType(None, None, None, 'trailingEdge')
        ribRotation = ribRotationType(None, None, None, stringBaseType(None, None, None, 'globalY'), \
                                           doubleBaseType(None, None, None, '90.'))
        ribCrossing = ribCrossingBehaviourType(None, None, None, 'cross')
        if nRibs is None:
            ribSpacing = doubleBaseType(None, None, None, pitch)
            ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                          ribSpacing, None, ribCrossing, ribRotation)
        else:
            nRibs = doubleBaseType(None, None, None, nRibs)
            ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                          None, nRibs, ribCrossing, ribRotation)

        ribsList.append(
            wingRibsDefinitionType(None, None, None, myUID, myName, None,
                                   ribsPositioning, myCrossSection))
    #===============================================================================
    # Spoiler
    #===============================================================================
    if typeOfSeg.lower() == 'spoiler':
        myName = stringBaseType(None, None, None, 'spoiler_ribs')

        # Rib Cross Section
        #=======================================================================
        myMaterial = materialDefinitionType(None, None, None, None, None, None, stringUIDBaseType(None, None, 'True', None, 'aluminium2024'), \
                                              doubleBaseType(None, None, None, str(thickness)))
        myCrossSection = wingRibCrossSectionType(None, None, None, myMaterial,
                                                 None)

        # Rib Positioning
        #=======================================================================
        etaStart = doubleBaseType(None, None, None, '0.')
        etaEnd = doubleBaseType(None, None, None, '1.')
        ribReference = stringBaseType(None, None, None, 'leadingEdge')
        ribStart = stringBaseType(None, None, None, 'leadingEdge')
        ribEnd = stringBaseType(None, None, None, 'trailingEdge')
        ribRotation = ribRotationType(None, None, None, stringBaseType(None, None, None, 'leadingEdge'), \
                                           doubleBaseType(None, None, None, '90.'))
        ribCrossing = ribCrossingBehaviourType(None, None, None, 'cross')
        if nRibs is None:
            ribSpacing = doubleBaseType(None, None, None, pitch)
            ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                          ribSpacing, None, ribCrossing, ribRotation)
        else:
            nRibs = doubleBaseType(None, None, None, nRibs)
            ribsPositioning = wingRibsPositioningType(None, None, None, ribReference, etaStart, etaEnd, ribStart, ribEnd, \
                                          None, nRibs, ribCrossing, ribRotation)

        ribsList.append(
            wingRibsDefinitionType(None, None, None, myUID, myName, None,
                                   ribsPositioning, myCrossSection))

    #=======================================================================
    # RibsDefinition
    #=======================================================================

    myRibsDefinitions = wingRibsDefinitionsType(None, None, None, ribsList)

    parent.get_structure().set_ribsDefinitions(myRibsDefinitions)