Пример #1
0
def createFuselagePositionings(parent, nose,cabin,tail, lnose,lcabin,ltail, strUID, strName):
    '''
    This method is used to create the positioning of the sections of a fuselage.
    It calculates the sweep and length.
    @author: Jonas Jepsen
    @param parent: could be any Type holding a positioningsType. Here [fuselageType]
    @param myRQSi: crosssection data
    @param strUID:  UID of this Positioning [string]
    @param strName: Name of this Positioning [string]
    '''
    myPositionings = positioningsType()
    # countAll counts the total amount of cross sections for this fuselage
    countAll = 0
    for part in [[nose,lnose],[cabin,lcabin],[tail,ltail]]: 
        # lastPos is used to calc the lenght of a Segment from the absolute position
        # reset lastPos to 0 after each part because positions are given in relative koordinates from 0 to 1 in each part (nose,cabine and tail)
        lastPos = 0.
        # create positionings
        for cs in part[0]:
            countAll += 1
            pos = cs[0]*part[1]
            # create Positionings
            if countAll <= 1:
                createPositioning(myPositionings, strUID+'_Pos'+str(countAll),None,strUID+'_Sec'+str(countAll),pos,90.,0.,strName+'_Position'+str(countAll))
            else:
                createPositioning(myPositionings, strUID+'_Pos'+str(countAll),strUID+'_Sec'+str(countAll-1),strUID+'_Sec'+str(countAll),pos-lastPos,90.,0.,strName+'_Position'+str(countAll))
            lastPos = pos
    
    parent.set_positionings(myPositionings)
Пример #2
0
def createFuselage(CPACSObj, id, dfus, lnose, lcabin, ltail, LoD=0):
    # just for now
    if LoD==FUSE_LOD.NONE:
        return

    cpacsPath = '/cpacs/vehicles/aircraft/model/fuselages/fuselage[' + id + ']'
    # the next line is the one to use later on
    #cpacsPath = '/cpacs/vehicles/aircraft/model[model]/fuselages/fuselage[' + self.id + ']'
    # gets a list of all wing elements
    myFuse = getObjfromXpath(CPACSObj,cpacsPath)
    
    strUID       = myFuse.get_uID()
    myUID        = strUID
    myName       = stringBaseType(valueOf_=id)
    myDescr      = stringBaseType(valueOf_=strUID)
    myFuse.set_uID(myUID)
    myFuse.set_name(myName)
    myFuse.set_description(myDescr)
    
    createTransformation(myFuse, 'absGlobal',0.,0.,0.)
    
    if LoD==FUSE_LOD.A320:
        nose = list(NOSE)
        cabin = list(CABIN)
        tail = list(TAIL)
        # remove double values
        cabin.pop(0)
        tail.pop(0)
        # sections will be created, all existing sections will be deleted
        createFuselageSections(myFuse, nose,cabin,tail, dfus, strUID, strUID, strUID)
        createFuselagePositionings(myFuse, nose,cabin,tail, lnose,lcabin,ltail, strUID, strUID)
        
        createFuselageSegments(myFuse, strUID, len(nose)+len(cabin)+len(tail)-1)
    
    elif LoD==FUSE_LOD.ZYL:
        # sections will be created, all existing sections will be deleted
        mySections = fuselageSectionsType()
        #calc fuselage radius
        #rfus = dfus/2.
        # make fuselage configuration data [x_rel,z-dist,height/2,width/2]]
        fuseConf = [0.,0.,0.5,0.5]
        createFuselageSection(mySections, dfus, fuseConf, 'Circle', strUID+'_Sec1', strUID+'_Sec1', strUID+'_Sec1')
        createFuselageSection(mySections, dfus, fuseConf, 'Circle', strUID+'_Sec2', strUID+'_Sec2', strUID+'_Sec2')
        createFuselageSection(mySections, dfus, fuseConf, 'Circle', strUID+'_Sec3', strUID+'_Sec3', strUID+'_Sec3')
        createFuselageSection(mySections, dfus, fuseConf, 'Circle', strUID+'_Sec4', strUID+'_Sec4', strUID+'_Sec4')
        myFuse.set_sections(mySections)
                
        myPositionings = positioningsType()
        createPositioning(myPositionings,str(id) + '_Pos1',None, str(id) + '_Sec1',0.,90.,0.,id + '_Pos1')
        createPositioning(myPositionings,str(id) + '_Pos2',str(id) + '_Sec1',str(id) + '_Sec2',lnose,90.,0,id + '_Pos2')
        createPositioning(myPositionings,str(id) + '_Pos3',str(id) + '_Sec2',str(id) + '_Sec3',lcabin,90.,0,id + '_Pos3')
        createPositioning(myPositionings,str(id) + '_Pos4',str(id) + '_Sec3',str(id) + '_Sec4',ltail,90.,0,id + '_Pos4')
        myFuse.set_positionings(myPositionings)
        
        createFuselageSegments(myFuse, strUID, 3)
Пример #3
0
def createDoubleTrapezoidWing(myWing, id, cTip, cRoot, span, Sref, phiLE, dihedral, twist, xMAC25, etakf, 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
    '''
    # 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)
    createWingSection(mySections, 0.,0.,0., cRoot,1.,cRoot, 0.,0.,0., 'NACA653218', 1, strUID + '_Sec1', strUID + '_Sec1', strUID + '_Sec1')
    createWingSection(mySections, 0.,0.,0., cKink,1.,cKink, 0.,0.,0., 'NACA653218', 1, strUID + '_Sec2', strUID + '_Sec2', strUID + '_Sec2')
    createWingSection(mySections, 0.,0.,0., cTip,1.,cTip, 0.,twist,0., 'NACA653218', 1, strUID + '_Sec3', strUID + '_Sec3', strUID + '_Sec3')

    # calc length from span, sweep and dihedral
    sweep_rad = phiLE/180. * pi
    dihedral_rad = dihedral/180. * pi
    length1 = (etakf*span/2.)/cos(sweep_rad)/cos(dihedral_rad)
    length2 = span/2.*(1-etakf)/cos(sweep_rad)/cos(dihedral_rad)
    
    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,phiLE,dihedral,id)
    createPositioning(myPositionings,str(id) + '_Pos3',str(id) + '_Sec2',str(id) + '_Sec3',length2,phiLE,dihedral,id)
    
    myWing.set_sections(mySections)
    myWing.set_positionings(myPositionings)

    createWingSegments(myWing, strUID, 2)
    
    createComponentSegment(myWing, strUID)

    # calc wing position
    tauk = cTip/cKink
    myLambda = span**2/Sref
    sweep_rad = 35./180.*pi
    tanPhi25a = calcPhi25a(sweep_rad, taperRatio, tauk, etakf, span, cRoot)
    tanPhi25i = calcPhi25i(sweep_rad, taperRatio, tauk, etakf, span, cRoot)
    Xef = calcXef(cRoot, myLambda, tanPhi25i, tanPhi25a, etakf, taperRatio, tauk)
    xRoot = calcXRoot(xMAC25, Xef, cRoot)
    # set wing x - position
    myWing.get_transformation().get_translation().set_x(doubleBaseType(None, None, None,str(xRoot)))
Пример #4
0
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')
Пример #5
0
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)))
Пример #6
0
def createUCAVWing(myWing, id, cTip, cRoot, span, Sref, phiLE, dihedral, etakf, strUID):
    '''
    This method creates a ucav wing geometry in the 'myWing' parameter.
    @param myWing: wings CPACS object
    @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 etakf: dimensionless span coordinate [-]
    @param strUID: 
    '''
    # sections and positionings will be created, all existing sections and positionings will be deleted
    mySections = wingSectionsType()
    myPositionings = positioningsType()
    # calc Lvl 1 parameters
    cRoot, cKink, cTip,etaD = calcWing(span, Sref, phiLE, etakf)
    createWingSection(mySections, 0.,0.,0., cRoot,1.,cRoot, 0.,0.,0., 'NACA0000', 1, strUID + '_Sec1', strUID + '_Sec1', strUID + '_Sec1')
    createWingSection(mySections, 0.,0.,0., cKink,1.,cKink, 0.,0.,0., 'NACA0000', 1, strUID + '_Sec2', strUID + '_Sec2', strUID + '_Sec2')
    createWingSection(mySections, 0.,0.,0., cTip,1.,cTip, 0.,0.,0., 'NACA0000', 1, strUID + '_Sec3', strUID + '_Sec3', strUID + '_Sec3')
    #Tip Section rather short
    createWingSection(mySections, 0.,0.,0., 0.01,1.,0.01, 0.,0.,0., 'NACA0000', 1, strUID + '_Sec4', strUID + '_Sec4', strUID + '_Sec4')
    # calc length from span, sweep and dihedral
    sweep_rad = phiLE/180. * pi
    dihedral_rad = dihedral/180. * pi
    length1 = (etakf*span/2.)/cos(sweep_rad)/cos(dihedral_rad)          # @todo: provide dihedral
    length2 = span/2.*(1-etakf-etaD)/cos(sweep_rad)/cos(dihedral_rad)        # @todo: provide dihedral
    length3 = span/2.*etaD/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',length1,phiLE,dihedral,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)
Пример #7
0
def createFuselagePositionings(parent, nose, cabin, tail, lnose, lcabin, ltail,
                               strUID, strName):
    '''
    This method is used to create the positioning of the sections of a fuselage.
    It calculates the sweep and length.
    @author: Jonas Jepsen
    @param parent: could be any Type holding a positioningsType. Here [fuselageType]
    @param myRQSi: crosssection data
    @param strUID:  UID of this Positioning [string]
    @param strName: Name of this Positioning [string]
    '''
    myPositionings = positioningsType()
    # countAll counts the total amount of cross sections for this fuselage
    countAll = 0
    for part in [[nose, lnose], [cabin, lcabin], [tail, ltail]]:
        # lastPos is used to calc the lenght of a Segment from the absolute position
        # reset lastPos to 0 after each part because positions are given in relative koordinates from 0 to 1 in each part (nose,cabine and tail)
        lastPos = 0.
        # create positionings
        for cs in part[0]:
            countAll += 1
            pos = cs[0] * part[1]
            # create Positionings
            if countAll <= 1:
                createPositioning(myPositionings,
                                  strUID + '_Pos' + str(countAll), None,
                                  strUID + '_Sec' + str(countAll), pos, 90.,
                                  0., strName + '_Position' + str(countAll))
            else:
                createPositioning(myPositionings,
                                  strUID + '_Pos' + str(countAll),
                                  strUID + '_Sec' + str(countAll - 1),
                                  strUID + '_Sec' + str(countAll),
                                  pos - lastPos, 90., 0.,
                                  strName + '_Position' + str(countAll))
            lastPos = pos

    parent.set_positionings(myPositionings)
Пример #8
0
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')
Пример #9
0
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)))
Пример #10
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.)))
Пример #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 = 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)))
Пример #12
0
def createFuselage(CPACSObj, id, dfus, lnose, lcabin, ltail, LoD=0):
    # just for now
    if LoD == FUSE_LOD.NONE:
        return

    cpacsPath = '/cpacs/vehicles/aircraft/model/fuselages/fuselage[' + id + ']'
    # the next line is the one to use later on
    #cpacsPath = '/cpacs/vehicles/aircraft/model[model]/fuselages/fuselage[' + self.id + ']'
    # gets a list of all wing elements
    myFuse = getObjfromXpath(CPACSObj, cpacsPath)

    strUID = myFuse.get_uID()
    myUID = strUID
    myName = stringBaseType(None, None, None, id)
    myDescr = stringBaseType(None, None, None, strUID)
    myFuse.set_uID(myUID)
    myFuse.set_name(myName)
    myFuse.set_description(myDescr)

    createTransformation(myFuse, 'absGlobal', 0., 0., 0.)

    if LoD == FUSE_LOD.A320:
        nose = list(NOSE)
        cabin = list(CABIN)
        tail = list(TAIL)
        # remove double values
        cabin.pop(0)
        tail.pop(0)
        # sections will be created, all existing sections will be deleted
        createFuselageSections(myFuse, nose, cabin, tail, dfus, strUID, strUID,
                               strUID)
        createFuselagePositionings(myFuse, nose, cabin, tail, lnose, lcabin,
                                   ltail, strUID, strUID)

        createFuselageSegments(myFuse, strUID,
                               len(nose) + len(cabin) + len(tail) - 1)

    elif LoD == FUSE_LOD.ZYL:
        # sections will be created, all existing sections will be deleted
        mySections = fuselageSectionsType()
        #calc fuselage radius
        #rfus = dfus/2.
        # make fuselage configuration data [x_rel,z-dist,height/2,width/2]]
        fuseConf = [0., 0., 0.5, 0.5]
        createFuselageSection(mySections, dfus, fuseConf, 'Circle',
                              strUID + '_Sec1', strUID + '_Sec1',
                              strUID + '_Sec1')
        createFuselageSection(mySections, dfus, fuseConf, 'Circle',
                              strUID + '_Sec2', strUID + '_Sec2',
                              strUID + '_Sec2')
        createFuselageSection(mySections, dfus, fuseConf, 'Circle',
                              strUID + '_Sec3', strUID + '_Sec3',
                              strUID + '_Sec3')
        createFuselageSection(mySections, dfus, fuseConf, 'Circle',
                              strUID + '_Sec4', strUID + '_Sec4',
                              strUID + '_Sec4')
        myFuse.set_sections(mySections)

        myPositionings = positioningsType()
        createPositioning(myPositionings,
                          str(id) + '_Pos1', None,
                          str(id) + '_Sec1', 0., 90., 0., id + '_Pos1')
        createPositioning(myPositionings,
                          str(id) + '_Pos2',
                          str(id) + '_Sec1',
                          str(id) + '_Sec2', lnose, 90., 0, id + '_Pos2')
        createPositioning(myPositionings,
                          str(id) + '_Pos3',
                          str(id) + '_Sec2',
                          str(id) + '_Sec3', lcabin, 90., 0, id + '_Pos3')
        createPositioning(myPositionings,
                          str(id) + '_Pos4',
                          str(id) + '_Sec3',
                          str(id) + '_Sec4', ltail, 90., 0, id + '_Pos4')
        myFuse.set_positionings(myPositionings)

        createFuselageSegments(myFuse, strUID, 3)
Пример #13
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)))
Пример #14
0
def createUCAVWing(myWing, id, cTip, cRoot, span, Sref, phiLE, dihedral, etakf, strUID):
    """
    This method creates a ucav wing geometry in the 'myWing' parameter.
    @param myWing: wings CPACS object
    @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 etakf: dimensionless span coordinate [-]
    @param strUID: 
    """
    # sections and positionings will be created, all existing sections and positionings will be deleted
    mySections = wingSectionsType()
    myPositionings = positioningsType()
    # calc Lvl 1 parameters
    cRoot, cKink, cTip, etaD = calcWing(span, Sref, phiLE, etakf)
    createWingSection(
        mySections,
        0.0,
        0.0,
        0.0,
        cRoot,
        1.0,
        cRoot,
        0.0,
        0.0,
        0.0,
        "NACA0000",
        1,
        strUID + "_Sec1",
        strUID + "_Sec1",
        strUID + "_Sec1",
    )
    createWingSection(
        mySections,
        0.0,
        0.0,
        0.0,
        cKink,
        1.0,
        cKink,
        0.0,
        0.0,
        0.0,
        "NACA0000",
        1,
        strUID + "_Sec2",
        strUID + "_Sec2",
        strUID + "_Sec2",
    )
    createWingSection(
        mySections,
        0.0,
        0.0,
        0.0,
        cTip,
        1.0,
        cTip,
        0.0,
        0.0,
        0.0,
        "NACA0000",
        1,
        strUID + "_Sec3",
        strUID + "_Sec3",
        strUID + "_Sec3",
    )
    # Tip Section rather short
    createWingSection(
        mySections,
        0.0,
        0.0,
        0.0,
        0.01,
        1.0,
        0.01,
        0.0,
        0.0,
        0.0,
        "NACA0000",
        1,
        strUID + "_Sec4",
        strUID + "_Sec4",
        strUID + "_Sec4",
    )
    # calc length from span, sweep and dihedral
    sweep_rad = phiLE / 180.0 * pi
    dihedral_rad = dihedral / 180.0 * pi
    length1 = (etakf * span / 2.0) / cos(sweep_rad) / cos(dihedral_rad)  # @todo: provide dihedral
    length2 = span / 2.0 * (1 - etakf - etaD) / cos(sweep_rad) / cos(dihedral_rad)  # @todo: provide dihedral
    length3 = span / 2.0 * etaD / cos(sweep_rad) / cos(dihedral_rad)  # @todo: provide dihedral

    createPositioning(myPositionings, str(id) + "_Pos1", None, str(id) + "_Sec1", 0.0, 0.0, 0.0, id)
    createPositioning(
        myPositionings, str(id) + "_Pos2", str(id) + "_Sec1", str(id) + "_Sec2", length1, phiLE, dihedral, 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)
Пример #15
0
def createDoubleTrapezoidWing(myWing, id, cTip, cRoot, span, Sref, phiLE,
                              dihedral, twist, xMAC25, etakf, 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
    '''
    # 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)
    createWingSection(mySections, 0., 0., 0., cRoot, 1., cRoot, 0., 0., 0.,
                      'NACA653218', 1, strUID + '_Sec1', strUID + '_Sec1',
                      strUID + '_Sec1')
    createWingSection(mySections, 0., 0., 0., cKink, 1., cKink, 0., 0., 0.,
                      'NACA653218', 1, strUID + '_Sec2', strUID + '_Sec2',
                      strUID + '_Sec2')
    createWingSection(mySections, 0., 0., 0., cTip, 1., cTip, 0., twist, 0.,
                      'NACA653218', 1, strUID + '_Sec3', strUID + '_Sec3',
                      strUID + '_Sec3')

    # calc length from span, sweep and dihedral
    sweep_rad = phiLE / 180. * pi
    dihedral_rad = dihedral / 180. * pi
    length1 = (etakf * span / 2.) / cos(sweep_rad) / cos(dihedral_rad)
    length2 = span / 2. * (1 - etakf) / cos(sweep_rad) / cos(dihedral_rad)

    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, phiLE, dihedral, id)
    createPositioning(myPositionings,
                      str(id) + '_Pos3',
                      str(id) + '_Sec2',
                      str(id) + '_Sec3', length2, phiLE, dihedral, id)

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

    createWingSegments(myWing, strUID, 2)

    createComponentSegment(myWing, strUID)

    # calc wing position
    tauk = cTip / cKink
    myLambda = span**2 / Sref
    sweep_rad = 35. / 180. * pi
    tanPhi25a = calcPhi25a(sweep_rad, taperRatio, tauk, etakf, span, cRoot)
    tanPhi25i = calcPhi25i(sweep_rad, taperRatio, tauk, etakf, span, cRoot)
    Xef = calcXef(cRoot, myLambda, tanPhi25i, tanPhi25a, etakf, taperRatio,
                  tauk)
    xRoot = calcXRoot(xMAC25, Xef, cRoot)
    # set wing x - position
    myWing.get_transformation().get_translation().set_x(
        doubleBaseType(None, None, None, str(xRoot)))
Пример #16
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.)))