Exemple #1
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')
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)))
Exemple #3
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)))
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)))
Exemple #5
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)
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.)))