Exemplo n.º 1
0
    def calc(self):
        '''
        Calculates the landing field length from the wing loading and the maximum lift at landing. 
        All calculations are on sea level
        
        :Source: Airplane Design Part I, J. Roskam, DARCorporation, 2005, Fourth Edition, p.111, eq. 3.15-3.16
        '''
        wsL = self.parent.wsL.getValue()
        cLL = self.parent.cLL.getValue()
        rhoAP = self.parent.atmosphere.rhoAP.getValue()

        #Stall speed Calculation
        Vs = sqrt(2 * wsL * 9.81 / (rhoAP * cLL)) #Eq. 3.1 from Roskam I p-90

        #Approach Speed Calculation
        Va = 1.3 * Vs * 3.6
        self.parent.vAPPR = parameter(Va, name='vAPPR', parent=self.parent)
        #make the Roskam Assumption
        #Roskam assumes ft and kts
        #kts to m is 1,8**2
        return self.setValueCalc(0.3048 * 0.3 * 0.539956803 ** 2 * Va ** 2)

        ###################################################################################################
        #EOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFEOFE#
        ###################################################################################################
Exemplo n.º 2
0
    def cpacsExport(self, CPACSObj):
        '''
        this methods exports all parameters nested in the component. Nested Components will be called as well. 
        cpacsPath must be filled
        '''
        def exportVector(CPACSObj, cpacsPath, value):
            myVector = getObjfromXpath(CPACSObj, cpacsPath)
            myType = "vector"
            myVector.set_valueOf_(str(value))
            myVector.set_mapType(myType)

        exportVector(
            CPACSObj,
            '/cpacs/vehicles/aircraft/model/analyses/aeroPerformanceMap/machNumber',
            self.aircraft.atmosphere.MaCR.getValue())
        exportVector(
            CPACSObj,
            '/cpacs/vehicles/aircraft/model/analyses/aeroPerformanceMap/angleOfAttack',
            '0;2;4')
        exportVector(
            CPACSObj,
            '/cpacs/vehicles/aircraft/model/analyses/aeroPerformanceMap/angleOfYaw',
            '0')
        exportVector(
            CPACSObj,
            '/cpacs/vehicles/aircraft/model/analyses/aeroPerformanceMap/reynoldsNumber',
            self.aircraft.wing.reynoldsNr.getValue())
        self.lilipolint = parameter(
            cpacsPath=
            '/cpacs/toolspecific/liftingLine/toolParameters/usePOLINT',
            value="false")

        super(tool, self).cpacsExport(CPACSObj)
Exemplo n.º 3
0
    def cpacsExport(self, CPACSObj):
        '''
        this methods exports all parameters nested in the component. Nested Components will be called as well. 
        cpacsPath must be filled
        '''

        def exportVector(CPACSObj, cpacsPath, value):
            myVector = getObjfromXpath(CPACSObj, cpacsPath)
            myType = "vector"
            myVector.set_valueOf_(str(value))
            myVector.set_mapType(myType)

        exportVector(CPACSObj, '/cpacs/vehicles/aircraft/model/analyses/aeroPerformanceMap/machNumber',
                     self.aircraft.atmosphere.MaCR.getValue())
        exportVector(CPACSObj, '/cpacs/vehicles/aircraft/model/analyses/aeroPerformanceMap/angleOfAttack', '0;2;4')
        exportVector(CPACSObj, '/cpacs/vehicles/aircraft/model/analyses/aeroPerformanceMap/angleOfYaw', '0')
        exportVector(CPACSObj, '/cpacs/vehicles/aircraft/model/analyses/aeroPerformanceMap/reynoldsNumber',
                     self.aircraft.wing.reynoldsNr.getValue())
        self.lilipolint = parameter(cpacsPath='/cpacs/toolspecific/liftingLine/toolParameters/usePOLINT', value="false")

        super(tool, self).cpacsExport(CPACSObj)
Exemplo n.º 4
0
    def calc(self):
        '''
        Calculates the landing field length from the wing loading and the maximum lift at landing. 
        All calculations are on sea level
        
        :Source: Airplane Design Part I, J. Roskam, DARCorporation, 2005, Fourth Edition, p.111, eq. 3.15-3.16
        '''
        wsL = self.parent.wsL.getValue()
        cLL = self.parent.cLL.getValue()
        rhoAP = self.parent.atmosphere.rhoAP.getValue()

        #Stall speed Calculation
        Vs = sqrt(2 * wsL * 9.81 / (rhoAP * cLL))  #Eq. 3.1 from Roskam I p-90

        #Approach Speed Calculation
        Va = 1.3 * Vs * 3.6
        self.parent.vAPPR = parameter(Va, name='vAPPR', parent=self.parent)
        #make the Roskam Assumption
        #Roskam assumes ft and kts
        #kts to m is 1,8**2
        return self.setValueCalc(0.3048 * 0.3 * 0.539956803**2 * Va**2)
Exemplo n.º 5
0
    def __init__(self, aircraft):
        '''
        will initialize instance mainly used for documentation
        links to the aircraft instance
        initiates the airfoil class
        @Method: Component Constructor
        '''
        component.__init__(self)
        self.id = 'vtp'
        self.aircraft = aircraft
        self.level = 2

        self.UID = uID(cpacsPath='/cpacs/toolspecific/vampZero/vtpUID')

        # Mass
        self.mVtp = mVtp(
            cpacsPath=
            '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[3]/massDescription['
            + self.id + '_mass]/mass')
        self.parentUID = parameter(
            value=self.id,
            cpacsPath=
            '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[3]/massDescription['
            + self.id + '_mass]/parentUID')

        # CoG
        self.posCoG = posCoG(
            cpacsPath=
            '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[3]/massDescription['
            + self.id + '_mass]/location/x')

        # Geometry
        self.refArea = refArea()
        self.refAreaTakeOff = refAreaTakeOff()
        self.refAreaLanding = refAreaLanding()
        self.expArea = expArea()
        self.wetArea = wetArea()
        self.aspectRatio = aspectRatio()
        self.span = span()
        self.taperRatio = taperRatio()
        self.tcAVG = tcAVG()
        self.cRoot = cRoot()
        self.cTip = cTip()
        self.cMAC = cMAC()
        self.yMAC = yMAC()
        self.xMAC = xMAC()
        self.phiLE = phiLE()
        self.phiTE = phiTE()
        self.phi25 = phi25()
        self.phi50 = phi50()
        self.xRoot = xRoot()
        self.zRoot = zRoot()
        self.lVT = lVT()
        self.cVT = cVT()
        self.LoD = LoD()

        # Aerodynamics
        self.cLalpha = cLalpha()
        self.cLMAX = cLMAX()
        self.formFactor = formFactor()
        self.reynoldsNr = reynoldsNr()
        self.cfLAM = cfLAM()
        self.cfTURB = cfTURB()
        self.cD0c = cD0c()
        self.nLam = nLam()

        # Airfoil
        self.airfoilr = airfoil(self)  # Root Airfoil
        self.airfoilt = airfoil(self)  # Tip  Airfoil

        # Rudder
        self.rudder = rudder(self)
Exemplo n.º 6
0
    def __init__(self):
        '''
        will initialize all values upon creation of the instance. Mainly used for documentation
        '''
        component.__init__(self)
        self.id = 'aircraft'
        self.level = 1

        self.modelUID = uID(cpacsPath='/cpacs/toolspecific/vampZero/aircraftModelUID')
        self.version  = parameter(value=0.1, cpacsPath='/cpacs/header/version')

        # Mass Data
        self.mLM = mLM(cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/designMasses/mMLM/mass')
        self.mTOM = mTOM(cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/designMasses/mTOM/mass')
        self.mZFW = mZFW(cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/designMasses/mZFM/mass')
        self.oEM = oEM(cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/massDescription/mass')
        self.oIM = oIM(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mOperatorItems/massDescription/mass')

        # CoG
        self.posCoG = posCoG(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/designMasses/mTOM/location/x')
        self.posNP = posNP()
        self.posCoGOEM = posCoGOEM()
        self.posCoGMIN = posCoGMIN()
        self.posCoGMAX = posCoGMAX()
        self.static_margin = static_margin()

        # Inertia
        self.massIXmTOM = massIXmTOM(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/designMasses/mTOM/massInertia/Jxx')
        self.massIYmTOM = massIYmTOM(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/designMasses/mTOM/massInertia/Jyy')
        self.massIZmTOM = massIZmTOM(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/designMasses/mTOM/massInertia/Jzz')
        self.massIXmZFW = massIXmZFW(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/designMasses/mZFM/massInertia/Jxx')
        self.massIYmZFW = massIYmZFW(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/designMasses/mZFM/massInertia/Jyy')
        self.massIZmZFW = massIZmZFW(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/designMasses/mZFM/massInertia/Jzz')
        self.massIXoEM = massIXoEM(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/massDescription/massInertia/Jxx')
        self.massIYoEM = massIYoEM(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/massDescription/massInertia/Jyy')
        self.massIZoEM = massIZoEM(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/massDescription/massInertia/Jzz')

        # Performance Data
        self.desRange = desRange() #@todo: set correct xpath (cpacsPath='/cpacs/vehicles/aircraft/model/global/designRange')
        self.machCR = machCR(cpacsPath='/cpacs/vehicles/aircraft/model/global/machCruise')
        self.altCR = altCR()
        self.sTOFL = sTOFL()
        self.sTOFLISA = sTOFLISA()
        self.sLFL = sLFL() #@todo: set correct xpath (cpacsPath='/cpacs/vehicles/aircraft/model/global/sFL')
        self.rangeType = rangeType()
        self.timeRES = timeRES()
        self.timeDESCENT = timeDESCENT()
        self.timeCLIMB = timeCLIMB()
        self.timeCR = timeCR()
        self.distRES = distRES()
        self.distDESCENT = distDESCENT()
        self.distCLIMB = distCLIMB()
        self.distCR = distCR()
        self.gammaCLIMB = gammaCLIMB()
        self.gammaDESCENT = gammaDESCENT()
        self.IASCLIMB = IASCLIMB()
        self.IASDESCENT = IASDESCENT()

        # Crew Data
        self.nPilot = nPilot()
        self.nCabinCrew = nCabinCrew()

        # Sizing Data
        self.wsTO = wsTO()
        self.wsL = wsL()
        self.wsMAX = wsMAX()
        self.twTO = twTO()
        self.twFAR20121a = twFAR25121a()
        self.twFAR20121b = twFAR25121b()
        self.twTOP25 = twTOP25()

        # Aerodynamics Data
        self.cLCR = cLCR()
        self.cLMAX = cLMAX()
        self.cLTO = cLTO()
        self.cLL = cLL()
        self.cDCR = cDCR()
        self.cDTO = cDTO()
        self.cDL = cDL()
        self.cD0 = cD0()
        self.loDCR = loDCR()
        self.loDTO = loDTO()
        self.loDLOI = loDLOI()
        self.loDCLIMB = loDCLIMB()
        self.oswald = oswald()
        self.cLROLL = cLROLL()

        # DOC
        self.aFactor = aFactor()
        self.inflation = inflation()
        self.USDexchangeEURO = USDexchangeEURO()
        self.tBlock = tBlock()
        self.tFlight = tFlight()
        self.utilization = utilization()
        self.costDepreciation = costDepreciation()
        self.costFuel = costFuel()
        self.costMaintenance = costMaintenance()
        self.costAircraftMaintenance = costAircraftMaintenance()
        self.costEngineMaintenance = costEngineMaintenance()
        self.costCrew = costCrew()
        self.costCap = costCap()
        self.costGround = costGround()
        self.costNavigation = costNavigation()
        self.costLanding = costLanding()
        self.costInterest = costInterest()
        self.costInsurance = costInsurance()
        self.costEmissionTrade = costEmissionTrade()
        self.flightCycles = flightCycles()
        self.priceFuel = priceFuel()
        self.priceAircraft = priceAircraft()
        self.DOC = DOC()
        self.COC = COC()
        self.COO = COO()
        self.C1 = C1()
        self.C2 = C2()
        self.aFactor = aFactor()
        self.costCap = costCap()
        self.flightCycles = flightCycles()

        #Stability
        #self.staticMargin = staticMargin()
        
        #Controllability
        #self.refAreaHtpMIN = refAreaHtpMIN()

        # Component Objects
        self.wing = wing(self)
        self.strut = strut(self)
        self.fuselage = fuselage(self)
        self.vtp = vtp(self)
        self.htp = htp(self)
        self.engine = engine(self)
        self.landingGear = landingGear(self)
        self.systems = systems(self)
        self.payload = payload(self)
        self.pylon = pylon(self)
        self.fuel = fuel(self)
        self.atmosphere = atmosphere(self)
        self.tool = tool(self)
Exemplo n.º 7
0
    def __init__(self, aircraft):
        '''
        will initialize instance mainly used for documentation
        links to the aircraft instance
        initiates the airfoil class
        '''
        component.__init__(self)
        self.id = 'htp'
        self.aircraft = aircraft
        self.level = 2

        self.UID = uID(cpacsPath='/cpacs/toolspecific/vampZero/htpUID')

        # Mass
        self.mHtp = mHtp(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[2]/massDescription['+self.id+'_mass]/mass')
        self.parentUID = parameter(value=self.id, 
			cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[2]/massDescription['+self.id+'_mass]/parentUID')

        # CoG
        self.posCoG = posCoG(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[2]/massDescription['+self.id+'_mass]/location/x')

        # Geometry
        self.refArea = refArea()
        self.refAreaTakeOff = refAreaTakeOff() 
        self.refAreaCruise = refAreaCruise() 
        self.refAreaLanding = refAreaLanding()        
        self.expArea = expArea()
        self.wetArea = wetArea()
        self.aspectRatio = aspectRatio()
        self.span = span()
        self.taperRatio = taperRatio()
        self.tcAVG = tcAVG()
        self.cRoot = cRoot()
        self.cTip = cTip()
        self.cMAC = cMAC()
        self.yMAC = yMAC()
        self.xMAC = xMAC()
        self.xMAC25 = xMAC25()
        self.phiLE = phiLE()
        self.phiTE = phiTE()
        self.phi25 = phi25()
        self.phi50 = phi50()
        self.xRoot = xRoot()
        self.zRoot = zRoot()
        self.lHT = lHT()
        self.cHT = cHT()
        self.dihedral = dihedral()
        self.LoD = LoD()
        self.location = location()

        # Aerodynamic
        self.cLalpha = cLalpha()
        self.cLMAX = cLMAX()
        #self.cLMIN = cLMIN()
        self.cLMAXht = cLMAXht()
        self.CLalphaHTP_TO = CLalphaHTP_TO()
        self.CLalphaHTP_CR = CLalphaHTP_CR()
        self.CLalphaHTP_L = CLalphaHTP_L()
        self.formFactor = formFactor()
        self.reynoldsNr = reynoldsNr()
        self.cfLAM = cfLAM()
        self.cfTURB = cfTURB()
        self.cD0c = cD0c()
        self.nLam = nLam()
        self.detadalpha = detadalpha()
        self.DPR = DPR()

        # Airfoil
        self.airfoilr = airfoil(self)  # Root Airfoil
        self.airfoilt = airfoil(self)  # Tip  Airfoil

        # Elevator
        self.elevator = elevator(self)
Exemplo n.º 8
0
    def __init__(self, aircraft):
        '''
        will initialize instance mainly used for documentation
        links to the aircraft instance
        initiates the airfoil class
        '''
        component.__init__(self)
        self.id = 'htp'
        self.aircraft = aircraft
        self.level = 2

        self.UID = uID(cpacsPath='/cpacs/toolspecific/vampZero/htpUID')

        # Mass
        self.mHtp = mHtp(
            cpacsPath=
            '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[2]/massDescription['
            + self.id + '_mass]/mass')
        self.parentUID = parameter(
            value=self.id,
            cpacsPath=
            '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[2]/massDescription['
            + self.id + '_mass]/parentUID')

        # CoG
        self.posCoG = posCoG(
            cpacsPath=
            '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[2]/massDescription['
            + self.id + '_mass]/location/x')

        # Geometry
        self.refArea = refArea()
        self.refAreaTakeOff = refAreaTakeOff()
        self.refAreaCruise = refAreaCruise()
        self.refAreaLanding = refAreaLanding()
        self.expArea = expArea()
        self.wetArea = wetArea()
        self.aspectRatio = aspectRatio()
        self.span = span()
        self.taperRatio = taperRatio()
        self.tcAVG = tcAVG()
        self.cRoot = cRoot()
        self.cTip = cTip()
        self.cMAC = cMAC()
        self.yMAC = yMAC()
        self.xMAC = xMAC()
        self.xMAC25 = xMAC25()
        self.phiLE = phiLE()
        self.phiTE = phiTE()
        self.phi25 = phi25()
        self.phi50 = phi50()
        self.xRoot = xRoot()
        self.zRoot = zRoot()
        self.lHT = lHT()
        self.cHT = cHT()
        self.dihedral = dihedral()
        self.LoD = LoD()
        self.location = location()

        # Aerodynamic
        self.cLalpha = cLalpha()
        self.cLMAX = cLMAX()
        #self.cLMIN = cLMIN()
        self.cLMAXht = cLMAXht()
        self.CLalphaHTP_TO = CLalphaHTP_TO()
        self.CLalphaHTP_CR = CLalphaHTP_CR()
        self.CLalphaHTP_L = CLalphaHTP_L()
        self.formFactor = formFactor()
        self.reynoldsNr = reynoldsNr()
        self.cfLAM = cfLAM()
        self.cfTURB = cfTURB()
        self.cD0c = cD0c()
        self.nLam = nLam()
        self.detadalpha = detadalpha()
        self.DPR = DPR()

        # Airfoil
        self.airfoilr = airfoil(self)  # Root Airfoil
        self.airfoilt = airfoil(self)  # Tip  Airfoil

        # Elevator
        self.elevator = elevator(self)
Exemplo n.º 9
0
    def __init__(self, aircraft):
        '''
        will initialize instance mainly used for documentation
        links to the aircraft instance
        initiates the airfoil class
        @Method: Component Constructor
        '''
        component.__init__(self)
        self.id = 'tool'
        self.aircraft = aircraft
        self.level = 2

        #===============================================================================
        #Aircraft stuff
        #===============================================================================
        self.aircraftName = parameter(
            cpacsPath='/cpacs/vehicles/aircraft/model/name', value='VAMPzero')
        self.aircraftDES = parameter(
            cpacsPath='/cpacs/vehicles/aircraft/model/description',
            value='VAMPzero')
        #commented out due to introduction of xMAC25
        #self.refX             = parameter(cpacsPath = '/cpacs/vehicles/aircraft/model/reference/point/x',value='0.0')
        self.refY = parameter(
            cpacsPath='/cpacs/vehicles/aircraft/model/reference/point/y',
            value='0.0')
        self.refZ = parameter(
            cpacsPath='/cpacs/vehicles/aircraft/model/reference/point/z',
            value='0.0')

        #=======================================================================
        # Lifting Line
        #=======================================================================
        self.liliname = parameter(
            cpacsPath='/cpacs/toolspecific/liftingLine/tool/name',
            value='LIFTING_LINE')
        self.liliversion = parameter(
            cpacsPath='/cpacs/toolspecific/liftingLine/tool/version',
            value='2.3.1')
        self.liliuID = parameter(
            cpacsPath='/cpacs/toolspecific/liftingLine/aircraftModelUID',
            value='A320modelID'
        )  #@todo: Model ID is not available at Time of Construction
        self.liliSpaneling = parameter(
            cpacsPath=
            '/cpacs/toolspecific/liftingLine/toolParameters/wingPanelings/wingPaneling[1]/spanwise',
            value='5')
        self.liliCpaneling = parameter(
            cpacsPath=
            '/cpacs/toolspecific/liftingLine/toolParameters/wingPanelings/wingPaneling[1]/chordwise',
            value='5')

        self.lilimode = parameter(
            cpacsPath=
            '/cpacs/toolspecific/liftingLine/toolParameters/archiveMode',
            value='1')
        #self.lilipolars       = parameter(cpacsPath = '/cpacs/toolspecific/liftingLine/performanceMaps',value='')

        #=======================================================================
        #Header Information
        #=======================================================================
        self.name = parameter(cpacsPath='/cpacs/header/name',
                              value='Export from')
        self.creator = parameter(cpacsPath='/cpacs/header/creator',
                                 value='VAMPzero')
        self.timestamp = parameter(cpacsPath='/cpacs/header/timestamp',
                                   value='2010-12-31T12:00:00')
        self.version = parameter(cpacsPath='/cpacs/header/version',
                                 value='0.1')
        self.version = parameter(cpacsPath='/cpacs/header/cpacsVersion',
                                 value='2.0')
Exemplo n.º 10
0
def createFlapsSBW(parentWingCPACS, parentWingVAMPzero, myFlap):
    '''
    This is the main export method for the wings flaps for the strut braced wing.

    The SBW does not feature any inner flaps as no kink exists

    @todo: it is possible that the inner flap overlaps the kink area
    '''
    cpacsPath = '/cpacs/vehicles/aircraft/model/wings/wing[' + parentWingVAMPzero.id + ']'
    cpacsWing = getObjfromXpath(parentWingCPACS, cpacsPath)
    cpacsComponentSegment = cpacsWing.get_componentSegments().get_componentSegment()[0]
    myFlaps = []

    # Initialization, i.e. fetching values throughout the code
    xsis = []
    etas = []
    for i in range(3,7):
        try:
            xsis.append(eval(cpacsComponentSegment.get_structure().get_spars().get_sparPositions().get_sparPosition()[i].get_xsi().valueOf_))
            etas.append(eval(cpacsComponentSegment.get_structure().get_spars().get_sparPositions().get_sparPosition()[i].get_eta().valueOf_))
        except IndexError:
            pass

    xsiSpar_interp = scipy.interpolate.interp1d(etas, xsis)

    yFus = parentWingVAMPzero.yFuselage.getValue()
    span = parentWingVAMPzero.span.getValue() / 2.
    etaFus = yFus / span
    etaKink = parentWingVAMPzero.etaKink.getValue()
    cRoot = parentWingVAMPzero.cRoot.getValue()
    cKink = calcChordLengthAtEta(etaKink, parentWingVAMPzero, cpacsWing)

    innerFlapArea = myFlap.refAreaInnerFlap.getValue()
    outerFlapArea = myFlap.refAreaOuterFlap.getValue()

    # OuterFlap
    sparOffset = 0.08

    # maxX is the maximum extension of the flap
    maxX = cRoot * (1. - (xsis[0] + sparOffset)) /2.
    newOuterFlapArea = innerFlapArea + outerFlapArea
    cRootOuterFlap = cRoot * (1. - (xsis[0] + sparOffset))

    # Determine the total flap span by iteration
    calcArea = 0.
    spanOuterFlap = 0.
    absSparOffset = sparOffset * cKink

    # Obtain the maxEtaValue. This is forwarded from the ailerons export routine.
    maxEta = myFlap.maxEta.getValue() - 0.02

    # the tip root length is a function of the span (as the xsi location of the spar changes)
    while abs(calcArea - newOuterFlapArea) > 0.1:
        spanOuterFlap += .01
        cTipOuterFlap = calcChordLengthAtEta(etaFus + spanOuterFlap / span, parentWingVAMPzero, cpacsWing) * (1 - xsiSpar_interp(etaFus + spanOuterFlap / span)) - absSparOffset
        oldcalcArea = calcArea
        calcArea = spanOuterFlap * (cRootOuterFlap + cTipOuterFlap) / 2.

        if calcArea < oldcalcArea:
            log.warning('VAMPzero FLAP: Outer Flap Area can not be established decreasing spar offset by 2% chord!')
            sparOffset = sparOffset - 0.02
            calcArea = 0.
            spanOuterFlap = 0.
            absSparOffset = sparOffset * cKink
            break

        if spanOuterFlap / span + etaFus > maxEta:
            log.warning('VAMPzero FLAP: Outer Flap overlaps with the aileron decreasing spar offset by 2% chord!')
            sparOffset = sparOffset - 0.02
            calcArea = 0.
            spanOuterFlap = 0.
            absSparOffset = sparOffset * cRoot
            break

    while abs(calcArea - newOuterFlapArea) > 0.1:
        spanOuterFlap += .01
        cTipOuterFlap = calcChordLengthAtEta(etaFus + spanOuterFlap / span, parentWingVAMPzero, cpacsWing) * (1 - xsiSpar_interp(etaFus + spanOuterFlap / span)) - absSparOffset
        oldcalcArea = calcArea
        calcArea = spanOuterFlap * (cRootOuterFlap + cTipOuterFlap) / 2.

        if calcArea < oldcalcArea:
            log.warning('VAMPzero FLAP: Outer Flap Area can not be established! Continuing with outerArea = %s' % str(calcArea))
            newOuterFlapArea = calcArea
            break

        if spanOuterFlap / span + etaFus + 0.06 > maxEta:
            log.warning('VAMPzero FLAP: Outer Flap overlaps with the aileron! Continuing with outerArea = %s' % str(calcArea))
            newOuterFlapArea = calcArea
            break

    # Determine the number of flaps
    # The aspect ratio of a flap should not be higher than 6.
    nOuterFlaps = spanOuterFlap ** 2. / (newOuterFlapArea * 6.)
    log.debug('VAMPzero FLAP: Exporting %s Flaps outboard of the engine for an area of %s m2.' % (str(nOuterFlaps), str(newOuterFlapArea)))

    # 1 Flap
    if nOuterFlaps <= 1.:
        # the inner border eta is located at the kink
        innerEtaLE = etaFus + 0.05
        innerXsiLE = xsis[0] + sparOffset
        # the outer border eta is determined from the span of the outer flap
        outerEtaLE = etaFus + 0.05 + spanOuterFlap / span
        outerXsiLE = 1 - (cTipOuterFlap / calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing))

        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(createFlap('outerFlap1', parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, appendInnerCruiseRoller=True, type='flap', innerX=innerX, outerX=outerX))

    # 2 Flaps
    elif nOuterFlaps > 1. and nOuterFlaps <= 2.:
        # the inner border eta is located at the kink
        innerEtaLE = etaFus + 0.05
        innerXsiLE = xsis[2] + sparOffset
        # the outer border eta is determined from the half span of the total outer flap
        outerEtaLE = etaFus + 0.05 + spanOuterFlap / (2*span)
        outerXsiLE = xsiSpar_interp(outerEtaLE) + absSparOffset / calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing)
        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(createFlap('outerFlap1', parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, type='flap', innerX=innerX, outerX=outerX))

        # new inner is the old outer
        innerEtaLE = outerEtaLE
        innerXsiLE = outerXsiLE
        # the outer border eta is determined from the full span of the total outer flap
        outerEtaLE = etaFus + 0.05 + spanOuterFlap / span
        outerXsiLE = 1 - (cTipOuterFlap / calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing))

        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(createFlap('outerFlap2', parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, appendInnerCruiseRoller=True, type='flap', innerX=innerX, outerX=outerX))

    # n Flaps
    elif nOuterFlaps > 2. :
        n = int(ceil(nOuterFlaps))
        # First Flap
        # the inner border eta is located at the kink
        innerEtaLE = etaFus + 0.05
        innerXsiLE = xsis[2] + sparOffset
        # the outer border eta is determined from the half span of the total outer flap
        outerEtaLE = etaFus + 0.05 + spanOuterFlap / (n*span)
        outerXsiLE = xsiSpar_interp(outerEtaLE) + absSparOffset / calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing)

        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(createFlap('outerFlap1', parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, type='flap', innerX=innerX, outerX=outerX))

        for i in range(2, n):
            # nth Flap
            # new inner is the old outer
            innerEtaLE = outerEtaLE
            innerXsiLE = outerXsiLE
            # the outer border eta is determined from the full span of the total outer flap
            outerEtaLE = innerEtaLE + spanOuterFlap / n / span
            outerXsiLE = xsiSpar_interp(outerEtaLE) + absSparOffset / calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing)

            #Fowler Motion is restricted to 75% of the flap depth
            innerX = (1. - innerXsiLE) * calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
            outerX = (1. - outerXsiLE) * calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
            myFlaps.append(createFlap('outerFlap' + str(i), parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, appendInnerCruiseRoller=True, type='flap', innerX=innerX, outerX=outerX))

        # Last Flap
        # new inner is the old outer
        innerEtaLE = outerEtaLE
        innerXsiLE = outerXsiLE
        # the outer border eta is determined from the full span of the total outer flap
        outerEtaLE = etaFus + 0.05 + spanOuterFlap / span
        outerXsiLE = 1 - (cTipOuterFlap / calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing))

        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(createFlap('outerFlap' + str(n), parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, appendInnerCruiseRoller=True, type='flap', innerX=innerX, outerX=outerX))

    # Output to Spoiler
    # as the spoiler is relying on data of the flaps some basic information is written
    # back to the the VAMPzero components
    parentWingVAMPzero.spoiler.outerEta = parameter(parent=parentWingVAMPzero.spoiler, value=outerEtaLE, unit='', status='calc', doc='The outermost eta coordinate of all flaps. This overlaps with the outer eta coordinate of the spoiler')
    spoilerChord = maxX
    parentWingVAMPzero.spoiler.chord = parameter(spoilerChord, 'm', 'calc', 'The absolute chord of the spoiler: 5% of the kink chord length + 50% of the innerFlap Chord length', parent=parentWingVAMPzero.spoiler)

    # Output to CPACS
    if type(cpacsComponentSegment.get_controlSurfaces()) == NoneType:
        cpacsComponentSegment.set_controlSurfaces(controlSurfacesType())
    if type(cpacsComponentSegment.get_controlSurfaces().get_trailingEdgeDevices()) == NoneType:
        cpacsComponentSegment.get_controlSurfaces().set_trailingEdgeDevices(trailingEdgeDevicesType())

    log.debug('VAMPzero SLAT: Exporting %s Flaps to CPACS.' % (str(len(myFlaps))))
    for flap in myFlaps:
        cpacsComponentSegment.get_controlSurfaces().get_trailingEdgeDevices().add_trailingEdgeDevice(flap)
Exemplo n.º 11
0
    def __init__(self, aircraft):
        '''
        will initialize instance mainly used for documentation
        links to the aircraft instance
        initiates the airfoil class
        @Method: Component Constructor
        '''
        component.__init__(self)
        self.id = 'strut'
        self.aircraft = aircraft
        self.level = 2

        # Mass
        self.mStrut = mStrut(
            cpacsPath=
            '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[4]/massDescription['
            + self.id + '_mass]/mass')
        self.parentUID = parameter(
            value=self.id,
            cpacsPath=
            '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[4]/massDescription['
            + self.id + '_mass]/parentUID')

        # Geometry
        self.refArea = refArea()
        self.expArea = expArea()
        self.wetArea = wetArea()
        self.aspectRatio = aspectRatio()
        self.span = span()
        self.depth = depth()
        self.active = active()
        self.taperRatio = taperRatio()
        self.tcAVG = tcAVG()
        self.cRoot = cRoot()
        self.cTip = cTip()
        self.cMAC = cMAC()
        self.yMAC = yMAC()
        self.xMAC = xMAC()
        self.xMAC25 = xMAC25()
        self.phiLE = phiLE()
        self.phiTE = phiTE()
        self.phi25 = phi25()
        self.phi50 = phi50()
        self.dihedral = dihedral()
        self.twist = twist()
        self.etaStrut = etaStrut()

        self.xRoot = xRoot()
        self.yRoot = yRoot()
        self.zRoot = zRoot()

        self.xTip = xTip()
        self.yTip = yTip()
        self.zTip = zTip()

        # Aerodynamics
        self.formFactor = formFactor()
        self.reynoldsNr = reynoldsNr()
        self.cfLAM = cfLAM()
        self.cfTURB = cfTURB()
        self.cD0c = cD0c()
        self.nLam = nLam()

        # Airfoil
        self.airfoilr = airfoil(self, position='root')
        self.airfoilt = airfoil(self, position='tip')
Exemplo n.º 12
0
    def __init__(self, aircraft):
        '''
        will initialize instance mainly used for documentation
        links to the aircraft instance
        initiates the airfoil class
        @Method: Component Constructor
        '''
        component.__init__(self)
        self.id = 'wing'
        self.aircraft = aircraft
        self.level = 2
        self.UID = uID(cpacsPath='/cpacs/toolspecific/vampZero/wingUID')

        # Mass
        self.mWing = mWing(
            cpacsPath=
            '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[1]/massDescription['
            + self.id + '_mass]/mass')
        self.parentUID = parameter(
            value=self.id,
            cpacsPath=
            '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[1]/massDescription['
            + self.id + '_mass]/parentUID')

        # CoG
        self.posCoG = posCoG(
            cpacsPath=
            '/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[1]/massDescription['
            + self.id + '_mass]/location/x')

        # Geometry
        self.location = location()
        self.refArea = refArea(
            cpacsPath='/cpacs/vehicles/aircraft/model/reference/area')
        self.expArea = expArea()
        self.wetArea = wetArea()
        self.aspectRatio = aspectRatio()
        self.span = span()
        self.taperRatio = taperRatio()
        self.tcAVG = tcAVG()
        self.cRoot = cRoot()
        self.cTip = cTip()
        self.cMAC = cMAC(
            cpacsPath='/cpacs/vehicles/aircraft/model/reference/length')
        self.yMAC = yMAC()
        self.xMAC = xMAC()
        self.xMAC25 = xMAC25(
            cpacsPath='/cpacs/vehicles/aircraft/model/reference/point/x')
        self.phiLE = phiLE()
        self.phiTE = phiTE()
        self.phi25 = phi25()
        self.phi50 = phi50()
        self.dihedral = dihedral()
        self.twist = twist()
        self.xRoot = xRoot()
        self.zRoot = zRoot()
        self.LoD = LoD()
        self.etaKink = etaKink()
        self.etaEngine = etaEngine()

        # Aerodynamics
        self.cLalpha = cLalpha()
        self.cLMAX = cLMAX()
        self.formFactor = formFactor()
        self.reynoldsNr = reynoldsNr(
        )  # cpacsPath='/cpacs/vehicles/aircraft/model/global/aeroPerformanceMap/reynoldsNumber')
        self.cfLAM = cfLAM()
        self.cfTURB = cfTURB()
        self.cD0c = cD0c()
        self.oswald = oswald()
        self.cDMINoffset = cDMINoffset()
        self.nLam = nLam()
        self.cDw = cDw()
        self.machDD = machDD()
        self.machCrit = machCrit()
        self.cM0CR = cM0CR()
        self.cM0TO = cM0TO()
        self.cM0L = cM0L()

        # Airfoil
        self.airfoilr = airfoil(self, position='root')
        self.airfoilt = airfoil(self, position='tip')

        # Aileron
        self.aileron = aileron(self)

        # Slat
        self.slat = slat(self)

        # Flap
        self.flap = flap(self)

        # Spoiler
        self.spoiler = spoiler(self)

        # CPACS Stuff for Export to higher Level
        self.xFuselage = xFuselage()
        self.yFuselage = yFuselage()
        self.zFuselage = zFuselage()
        self.cFuselage = cFuselage()

        self.xKink = xKink()
        self.yKink = yKink()
        self.zKink = zKink()
        self.cKink = cKink()

        self.xTip = xTip()
        self.zTip = zTip()
Exemplo n.º 13
0
def createAileron(parentWingCPACS, parentWingVAMPzero, myAileron):
    '''
    This is the main export method for the wings aileron
    '''
    cpacsPath = '/cpacs/vehicles/aircraft/model/wings/wing[' + parentWingVAMPzero.id + ']'
    cpacsWing = getObjfromXpath(parentWingCPACS, cpacsPath)
    cpacsComponentSegment = cpacsWing.get_componentSegments().get_componentSegment()[0]

    # Header
    myName = stringBaseType(None, None, None, 'aileron')
    myDescription = stringBaseType(None, None, None, 'aileron from VAMPzero')
    myParentUID = stringUIDBaseType(None, None, 'True', None, 'wing_Cseg')

    # Initialization, i.e. fetching values throughout the code
    xsis = []
    etas = []
    for i in range(3,7):
        try:
            xsis.append(eval(cpacsComponentSegment.get_structure().get_spars().get_sparPositions().get_sparPosition()[i].get_xsi().valueOf_))
            etas.append(eval(cpacsComponentSegment.get_structure().get_spars().get_sparPositions().get_sparPosition()[i].get_eta().valueOf_))
        except IndexError:
            pass

    xsiSpar_interp = scipy.interpolate.interp1d(etas, xsis)
    
    sparOffset = 0.1
    wingSpan = parentWingVAMPzero.span.getValue() / 2.

    # Outer Shape
    # The outer border eta station is set to 96 percent
    outerEtaLE = 0.96
    # The outer chord station is determined from the wing's chord at eta = 0.96
    # and the rear spar location + the spar offset
    outerXsiLE = xsiSpar_interp(0.96) + sparOffset
    outerWingChord = calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing)
    
    cTip = (1 - outerXsiLE) * outerWingChord
    
    # now we need to determine the necessary span for the aileron by gently increasing the span
    # this is an iterative process as the chord of the aileron is a function of the inbound span
    aileronArea = parentWingVAMPzero.aileron.refArea.getValue()
    delta = 0.01
    calcArea = 0.
    while abs(calcArea - aileronArea) > 0.1:
        if delta > outerEtaLE:
            parentWingVAMPzero.log.warning('VAMPzero EXPORT: Cannot determine the span of the aileron')
            parentWingVAMPzero.log.warning('VAMPzero EXPORT: aileronArea= '+str(aileronArea))
            parentWingVAMPzero.log.warning('VAMPzero EXPORT: Decreasing Spar Offset')
            sparOffset = sparOffset - 0.02
            delta = 0.01
            
        innerEtaLE = outerEtaLE - delta
        innerXsiLE = xsiSpar_interp(innerEtaLE) + sparOffset        
        innerWingChord = calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero, cpacsWing)
        cRoot = (1 - innerXsiLE) * innerWingChord

        calcArea = (cTip + cRoot) / 2 * (outerEtaLE - innerEtaLE) * wingSpan
        delta += 0.005
 
    # start outer shape
    myleadingEdgeShape = leadingEdgeShapeType(relHeightLE=doubleBaseType(valueOf_=str(0.5)), xsiUpperSkin=doubleBaseType(valueOf_=str(0.85)), xsiLowerSkin=doubleBaseType(valueOf_=str(0.85)))
    innerBorder = controlSurfaceBorderTrailingEdgeType(etaLE=doubleBaseType(valueOf_=str(innerEtaLE)), etaTE=doubleBaseType(valueOf_=str(innerEtaLE)), xsiLE=doubleBaseType(valueOf_=str(innerXsiLE)), leadingEdgeShape=myleadingEdgeShape)
    outerBorder = controlSurfaceBorderTrailingEdgeType(etaLE=doubleBaseType(valueOf_=str(outerEtaLE)), etaTE=doubleBaseType(valueOf_=str(outerEtaLE)), xsiLE=doubleBaseType(valueOf_=str(outerXsiLE)), leadingEdgeShape=myleadingEdgeShape)
    myOuterShape = controlSurfaceOuterShapeTrailingEdgeType(innerBorder=innerBorder, outerBorder=outerBorder)
    
    # structure
    myStructure = wingComponentSegmentStructureType()
    cpacsAileron = trailingEdgeDeviceType(uID='aileronUID', name=myName, description=myDescription, parentUID=myParentUID, outerShape=myOuterShape, structure=myStructure)
    createAileronStructure(cpacsAileron)
    
    # Forward information about innerEtaLE to the flap
    parentWingVAMPzero.flap.maxEta = parameter(value=innerEtaLE, doc='This it the inner position of the aileron, the flap may not exceed it')
    
    # moveables
    deltaEta = outerEtaLE - innerEtaLE 
    innerParentXsi = xsiSpar_interp(innerEtaLE + 0.3 * deltaEta) + 0.02
    outerParentXsi = xsiSpar_interp(innerEtaLE + 0.7 * deltaEta) + 0.02

    createPath(cpacsAileron, 'aileron')
    createTracks(cpacsAileron, 'aileron')
    createActuators(cpacsAileron, 'aileron', [innerParentXsi, outerParentXsi])

    if type(cpacsComponentSegment.get_controlSurfaces()) == NoneType:
        cpacsComponentSegment.set_controlSurfaces(controlSurfacesType())
    if type(cpacsComponentSegment.get_controlSurfaces().get_trailingEdgeDevices()) == NoneType:
        cpacsComponentSegment.get_controlSurfaces().set_trailingEdgeDevices(trailingEdgeDevicesType())
    
    cpacsComponentSegment.get_controlSurfaces().get_trailingEdgeDevices().add_trailingEdgeDevice(cpacsAileron)
Exemplo n.º 14
0
def createAileron(parentWingCPACS, parentWingVAMPzero, myAileron):
    '''
    This is the main export method for the wings aileron
    '''
    cpacsPath = '/cpacs/vehicles/aircraft/model/wings/wing[' + parentWingVAMPzero.id + ']'
    cpacsWing = getObjfromXpath(parentWingCPACS, cpacsPath)
    cpacsComponentSegment = cpacsWing.get_componentSegments(
    ).get_componentSegment()[0]

    #===========================================================================
    # Header
    #===========================================================================
    myName = stringBaseType(None, None, None, 'aileron')
    myDescription = stringBaseType(None, None, None, 'aileron from VAMPzero')
    myParentUID = stringUIDBaseType(None, None, 'True', None, 'wing_Cseg')

    #===========================================================================
    # Initialization, i.e. fetching values throughout the code
    #===========================================================================
    xsiSparRoot = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[3].get_xsi().valueOf_)
    xsiSparFuselage = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[4].get_xsi().valueOf_)
    xsiSparKink = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[5].get_xsi().valueOf_)
    xsiSparTip = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[6].get_xsi().valueOf_)

    etaSparRoot = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[3].get_eta().valueOf_)
    etaSparFuselage = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[4].get_eta().valueOf_)
    etaSparKink = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[5].get_eta().valueOf_)
    etaSparTip = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[6].get_eta().valueOf_)

    xsiSpar_interp = scipy.interpolate.interp1d(
        [etaSparRoot, etaSparFuselage, etaSparKink, etaSparTip],
        [xsiSparRoot, xsiSparFuselage, xsiSparKink, xsiSparTip])

    sparOffset = 0.1
    wingSpan = parentWingVAMPzero.span.getValue() / 2.
    #===========================================================================
    # Outer Shape
    #===========================================================================
    # The outer border eta station is set to 96 percent
    outerEtaLE = 0.96
    # The outer chord station is determined from the wing's chord at eta = 0.96
    # and the rear spar location + the spar offset
    outerXsiLE = xsiSpar_interp(0.96) + sparOffset
    outerWingChord = calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero,
                                          cpacsWing)

    cTip = (1 - outerXsiLE) * outerWingChord

    # now we need to determine the necessary span for the aileron by gently increasing the span
    # this is an iterative process as the chord of the aileron is a function of the inbound span
    aileronArea = parentWingVAMPzero.aileron.refArea.getValue()
    delta = 0.01
    calcArea = 0.
    while abs(calcArea - aileronArea) > 0.1:
        if delta > outerEtaLE:
            parentWingVAMPzero.log.warning(
                'VAMPzero EXPORT: Cannot determine the span of the aileron')
            parentWingVAMPzero.log.warning('VAMPzero EXPORT: aileronArea= ' +
                                           str(aileronArea))
            parentWingVAMPzero.log.warning(
                'VAMPzero EXPORT: Decreasing Spar Offset')
            sparOffset = sparOffset - 0.02
            delta = 0.01

        innerEtaLE = outerEtaLE - delta
        innerXsiLE = xsiSpar_interp(innerEtaLE) + sparOffset
        innerWingChord = calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero,
                                              cpacsWing)
        cRoot = (1 - innerXsiLE) * innerWingChord

        calcArea = (cTip + cRoot) / 2 * (outerEtaLE - innerEtaLE) * wingSpan
        delta += 0.005

    # start outer shape
    myleadingEdgeShape = leadingEdgeShapeType(
        relHeightLE=doubleBaseType(valueOf_=str(0.5)),
        xsiUpperSkin=doubleBaseType(valueOf_=str(0.85)),
        xsiLowerSkin=doubleBaseType(valueOf_=str(0.85)))
    innerBorder = controlSurfaceBorderTrailingEdgeType(
        etaLE=doubleBaseType(valueOf_=str(innerEtaLE)),
        etaTE=doubleBaseType(valueOf_=str(innerEtaLE)),
        xsiLE=doubleBaseType(valueOf_=str(innerXsiLE)),
        leadingEdgeShape=myleadingEdgeShape)
    outerBorder = controlSurfaceBorderTrailingEdgeType(
        etaLE=doubleBaseType(valueOf_=str(outerEtaLE)),
        etaTE=doubleBaseType(valueOf_=str(outerEtaLE)),
        xsiLE=doubleBaseType(valueOf_=str(outerXsiLE)),
        leadingEdgeShape=myleadingEdgeShape)
    myOuterShape = controlSurfaceOuterShapeTrailingEdgeType(
        innerBorder=innerBorder, outerBorder=outerBorder)

    # structure
    myStructure = wingComponentSegmentStructureType()
    cpacsAileron = trailingEdgeDeviceType(uID='aileronUID',
                                          name=myName,
                                          description=myDescription,
                                          parentUID=myParentUID,
                                          outerShape=myOuterShape,
                                          structure=myStructure)
    createAileronStructure(cpacsAileron)

    # Forward information about innerEtaLE to the flap
    parentWingVAMPzero.flap.maxEta = parameter(
        value=innerEtaLE,
        doc=
        'This it the inner position of the aileron, the flap may not exceed it'
    )

    # moveables
    deltaEta = outerEtaLE - innerEtaLE
    innerParentXsi = xsiSpar_interp(innerEtaLE + 0.3 * deltaEta) + 0.02
    outerParentXsi = xsiSpar_interp(innerEtaLE + 0.7 * deltaEta) + 0.02

    createPath(cpacsAileron, 'aileron')
    createTracks(cpacsAileron, 'aileron')
    createActuators(cpacsAileron, 'aileron', [innerParentXsi, outerParentXsi])

    if type(cpacsComponentSegment.get_controlSurfaces()) == NoneType:
        cpacsComponentSegment.set_controlSurfaces(controlSurfacesType())
    if type(cpacsComponentSegment.get_controlSurfaces().
            get_trailingEdgeDevices()) == NoneType:
        cpacsComponentSegment.get_controlSurfaces().set_trailingEdgeDevices(
            trailingEdgeDevicesType())

    cpacsComponentSegment.get_controlSurfaces().get_trailingEdgeDevices(
    ).add_trailingEdgeDevice(cpacsAileron)
Exemplo n.º 15
0
    def __init__(self, aircraft):
        """
        will initialize instance mainly used for documentation
        links to the aircraft instance
        initiates the airfoil class
        @Method: Component Constructor
        """
        component.__init__(self)
        self.id = "strut"
        self.aircraft = aircraft
        self.level = 2

        # Mass
        self.mStrut = mStrut(
            cpacsPath="/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[4]/massDescription["
            + self.id
            + "_mass]/mass"
        )
        self.parentUID = parameter(
            value=self.id,
            cpacsPath="/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[4]/massDescription["
            + self.id
            + "_mass]/parentUID",
        )

        # Geometry
        self.refArea = refArea()
        self.expArea = expArea()
        self.wetArea = wetArea()
        self.aspectRatio = aspectRatio()
        self.span = span()
        self.depth = depth()
        self.active = active()
        self.taperRatio = taperRatio()
        self.tcAVG = tcAVG()
        self.cRoot = cRoot()
        self.cTip = cTip()
        self.cMAC = cMAC()
        self.yMAC = yMAC()
        self.xMAC = xMAC()
        self.xMAC25 = xMAC25()
        self.phiLE = phiLE()
        self.phiTE = phiTE()
        self.phi25 = phi25()
        self.phi50 = phi50()
        self.dihedral = dihedral()
        self.twist = twist()
        self.etaStrut = etaStrut()

        self.xRoot = xRoot()
        self.yRoot = yRoot()
        self.zRoot = zRoot()

        self.xTip = xTip()
        self.yTip = yTip()
        self.zTip = zTip()

        # Aerodynamics
        self.formFactor = formFactor()
        self.reynoldsNr = reynoldsNr()
        self.cfLAM = cfLAM()
        self.cfTURB = cfTURB()
        self.cD0c = cD0c()
        self.nLam = nLam()

        # Airfoil
        self.airfoilr = airfoil(self, position="root")
        self.airfoilt = airfoil(self, position="tip")
Exemplo n.º 16
0
    def __init__(self, aircraft):
        '''
        will initialize instance mainly used for documentation
        links to the aircraft instance
        initiates the airfoil class
        @Method: Component Constructor
        '''
        component.__init__(self)
        self.id = 'vtp'
        self.aircraft = aircraft
        self.level = 2

        self.UID = uID(cpacsPath='/cpacs/toolspecific/vampZero/vtpUID')
		
        # Mass
        self.mVtp = mVtp(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[3]/massDescription['+self.id+'_mass]/mass')
        self.parentUID = parameter(value=self.id, 
			cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[3]/massDescription['+self.id+'_mass]/parentUID')

        # CoG
        self.posCoG = posCoG(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[3]/massDescription['+self.id+'_mass]/location/x')
		
        # Geometry
        self.refArea = refArea()
        self.refAreaTakeOff = refAreaTakeOff()
        self.refAreaLanding = refAreaLanding()
        self.expArea = expArea()
        self.wetArea = wetArea()
        self.aspectRatio = aspectRatio()
        self.span = span()
        self.taperRatio = taperRatio()
        self.tcAVG = tcAVG()
        self.cRoot = cRoot()
        self.cTip = cTip()
        self.cMAC = cMAC()
        self.yMAC = yMAC()
        self.xMAC = xMAC()
        self.phiLE = phiLE()
        self.phiTE = phiTE()
        self.phi25 = phi25()
        self.phi50 = phi50()
        self.xRoot = xRoot()
        self.zRoot = zRoot()
        self.lVT = lVT()
        self.cVT = cVT()
        self.LoD = LoD()

        # Aerodynamics
        self.cLalpha = cLalpha()
        self.cLMAX = cLMAX()
        self.formFactor = formFactor()
        self.reynoldsNr = reynoldsNr()
        self.cfLAM = cfLAM()
        self.cfTURB = cfTURB()
        self.cD0c = cD0c()
        self.nLam = nLam()

        # Airfoil
        self.airfoilr = airfoil(self)  # Root Airfoil
        self.airfoilt = airfoil(self)  # Tip  Airfoil

        # Rudder
        self.rudder = rudder(self)
Exemplo n.º 17
0
def createFlapsAdvDoubleTrapezoid(parentWingCPACS, parentWingVAMPzero, myFlap):
    '''
    This is the main export method for the wings flaps
    
    @todo: it is possible that the inner flap overlaps the kink area
    '''
    cpacsPath = '/cpacs/vehicles/aircraft/model/wings/wing[' + parentWingVAMPzero.id + ']'
    cpacsWing = getObjfromXpath(parentWingCPACS, cpacsPath)
    cpacsComponentSegment = cpacsWing.get_componentSegments().get_componentSegment()[0]
    myFlaps = []
    
    # Initialization, i.e. fetching values throughout the code
    xsiSparRoot = eval(cpacsComponentSegment.get_structure().get_spars().get_sparPositions().get_sparPosition()[3].get_xsi().valueOf_)
    xsiSparFuselage = eval(cpacsComponentSegment.get_structure().get_spars().get_sparPositions().get_sparPosition()[4].get_xsi().valueOf_)
    xsiSparKink = eval(cpacsComponentSegment.get_structure().get_spars().get_sparPositions().get_sparPosition()[5].get_xsi().valueOf_)
    xsiSparTip = eval(cpacsComponentSegment.get_structure().get_spars().get_sparPositions().get_sparPosition()[6].get_xsi().valueOf_)

    etaSparRoot = eval(cpacsComponentSegment.get_structure().get_spars().get_sparPositions().get_sparPosition()[3].get_eta().valueOf_)
    etaSparFuselage = eval(cpacsComponentSegment.get_structure().get_spars().get_sparPositions().get_sparPosition()[4].get_eta().valueOf_)
    etaSparKink = eval(cpacsComponentSegment.get_structure().get_spars().get_sparPositions().get_sparPosition()[5].get_eta().valueOf_)
    etaSparTip = eval(cpacsComponentSegment.get_structure().get_spars().get_sparPositions().get_sparPosition()[6].get_eta().valueOf_)

    xsiSpar_interp = scipy.interpolate.interp1d([etaSparRoot, etaSparFuselage, etaSparKink, etaSparTip], [xsiSparRoot, xsiSparFuselage, xsiSparKink, xsiSparTip])
    
    yFus = parentWingVAMPzero.yFuselage.getValue()
    span = parentWingVAMPzero.span.getValue() / 2.
    etaFus = yFus / span
    etaKink = parentWingVAMPzero.etaKink.getValue()
    cRoot = parentWingVAMPzero.cRoot.getValue()
    cKink = calcChordLengthAtEta(etaKink, parentWingVAMPzero, cpacsWing)
    phiLE = parentWingVAMPzero.phiLE.getValue()
    
    innerFlapArea = myFlap.refAreaInnerFlap.getValue()
    outerFlapArea = myFlap.refAreaOuterFlap.getValue()

    # InnerFlap
    # Determine the number of flaps
    # The aspect ratio of a flap should not be higher than 9.
    sparOffset = 0.08
    if phiLE > 0.:
        # if the wing is backward swept the chord of the inner flap equals the chord at kink behind the rear spar + sparOffset
        cInnerFlap = cKink * (1. - (xsiSparKink + sparOffset))
    elif phiLE < 0.:
        # if the wing is forward swept the chord of the inner flap is similar to the chord of the root section behind the spar + 20%
        cInnerFlap = cRoot * (1. - (xsiSparFuselage + 0.2))
    
    # maxX is the maximum extension of the flap
    maxX = cInnerFlap / 2.
    
    # The area of the innerFlap is determined by the chord and span 
    # The difference in the area will be substituted by the outerFlap Area
    spanInnerFlap = (etaKink - etaFus) * span
    newInnerFlapArea = cInnerFlap * spanInnerFlap
    deltaArea = innerFlapArea - newInnerFlapArea
    nInnerFlaps = spanInnerFlap ** 2. / (newInnerFlapArea * 9.)
    log.debug('VAMPzero FLAP: Exporting %s Flaps inside of the engine for an area of %s m2.' % (str(nInnerFlaps), str(innerFlapArea)))
        
    if nInnerFlaps < 1.:
        # the inner border eta is located at the intersection with the fuselage 
        innerEtaLE = etaFus
        # the inner border xsi is determined from the wing chord at the fuselage station (which equals CRoot)
        innerXsiLE = 1. - (cInnerFlap / cRoot)
        # the outer border eta is determined from the span of the inner flap
        outerEtaLE = etaKink
        # the outer xsi location is found from the avg chord and the chord length at that station
        outerXsiLE = 1. - (cInnerFlap / cKink)

        myFlaps.append(createFlap('innerFlap', parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, type='innerFlap', innerX=maxX, outerX=maxX))
    
    elif nInnerFlaps > 1. and nInnerFlaps <= 2.:
        # First Flap
        # the inner border eta is located at the intersection with the fuselage
        innerEtaLE = etaFus
        # the inner border xsi is determined from the wing chord at the fuselage station (which equals CRoot)
        innerXsiLE = 1. - (cInnerFlap / cRoot)
        # the outer border eta is determined from the span of the inner flap
        outerEtaLE = etaFus + (etaKink - etaFus) / 2.
        # the outer xsi location is found from the avg chord and the chord length at that station
        outerXsiLE = 1. - (cInnerFlap / calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing))

        myFlaps.append(createFlap('innerFlap1', parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, type='innerFlap', innerX=maxX, outerX=maxX))
        
        # Second Flap
        # new inner is old outer
        innerEtaLE = outerEtaLE
        # new outer is kink
        outerEtaLE = etaKink
        # new inner is old outer
        innerXsiLE = outerXsiLE
        # new outer is kink
        outerXsiLE = 1. - (cInnerFlap / cKink)

        myFlaps.append(createFlap('innerFlap2', parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, type='flap', innerX=maxX, outerX=maxX))

    # OuterFlap
    newOuterFlapArea = outerFlapArea + deltaArea
    cRootOuterFlap = cKink * (1. - (xsiSparKink + sparOffset))
    
    # Determine the total flap span by iteration
    calcArea = 0.
    spanOuterFlap = 0.
    absSparOffset = sparOffset * cKink
    
    # Obtain the maxEtaValue. This is forwarded from the ailerons export routine.
    maxEta = myFlap.maxEta.getValue() - 0.02
    
    # the tip root length is a function of the span (as the xsi location of the spar changes)
    while abs(calcArea - newOuterFlapArea) > 0.1:
        spanOuterFlap += .01
        cTipOuterFlap = calcChordLengthAtEta(etaKink + spanOuterFlap / span, parentWingVAMPzero, cpacsWing) * (1 - xsiSpar_interp(etaKink + spanOuterFlap / span)) - absSparOffset
        oldcalcArea = calcArea
        calcArea = spanOuterFlap * (cRootOuterFlap + cTipOuterFlap) / 2.
        
        if calcArea < oldcalcArea:
            log.warning('VAMPzero FLAP: Outer Flap Area can not be established decreasing spar offset by 2% chord!')
            sparOffset = sparOffset - 0.02
            calcArea = 0.
            spanOuterFlap = 0.
            absSparOffset = sparOffset * cKink
            break
        
        if spanOuterFlap / span + etaKink > maxEta:
            log.warning('VAMPzero FLAP: Outer Flap overlaps with the aileron decreasing spar offset by 2% chord!')
            sparOffset = sparOffset - 0.02
            calcArea = 0.
            spanOuterFlap = 0.
            absSparOffset = sparOffset * cKink
            break
            
    while abs(calcArea - newOuterFlapArea) > 0.1:
        spanOuterFlap += .01
        cTipOuterFlap = calcChordLengthAtEta(etaKink + spanOuterFlap / span, parentWingVAMPzero, cpacsWing) * (1 - xsiSpar_interp(etaKink + spanOuterFlap / span)) - absSparOffset
        oldcalcArea = calcArea
        calcArea = spanOuterFlap * (cRootOuterFlap + cTipOuterFlap) / 2.
        
        if calcArea < oldcalcArea:
            log.warning('VAMPzero FLAP: Outer Flap Area can not be established! Continuing with outerArea = %s' % str(calcArea))
            newOuterFlapArea = calcArea
            break

        if spanOuterFlap / span + etaKink > maxEta:
            log.warning('VAMPzero FLAP: Outer Flap overlaps with the aileron! Continuing with outerArea = %s' % str(calcArea))
            newOuterFlapArea = calcArea
            break
        
    # Determine the number of flaps
    # The aspect ratio of a flap should not be higher than 9. 
    nOuterFlaps = spanOuterFlap ** 2. / (newOuterFlapArea * 9.)
    log.debug('VAMPzero FLAP: Exporting %s Flaps outboard of the engine for an area of %s m2.' % (str(nOuterFlaps), str(newOuterFlapArea)))
    
    # 1 Flap
    if nOuterFlaps <= 1.:
        # the inner border eta is located at the kink 
        innerEtaLE = etaKink
        innerXsiLE = xsiSparKink + sparOffset
        # the outer border eta is determined from the span of the outer flap
        outerEtaLE = etaKink + spanOuterFlap / span
        outerXsiLE = 1 - (cTipOuterFlap / calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing))
        
        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(createFlap('outerFlap1', parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, appendInnerCruiseRoller=True, type='flap', innerX=innerX, outerX=outerX))
    
    # 2 Flaps
    elif nOuterFlaps > 1. and nOuterFlaps <= 2.:
        # the inner border eta is located at the kink 
        innerEtaLE = etaKink
        innerXsiLE = xsiSparKink + sparOffset
        # the outer border eta is determined from the half span of the total outer flap
        outerEtaLE = etaKink + spanOuterFlap / (2. * span)
        outerXsiLE = xsiSpar_interp(outerEtaLE) + absSparOffset / calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing)
        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(createFlap('outerFlap1', parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, type='flap', innerX=innerX, outerX=outerX))
        
        # new inner is the old outer 
        innerEtaLE = outerEtaLE
        innerXsiLE = outerXsiLE
        # the outer border eta is determined from the full span of the total outer flap
        outerEtaLE = etaKink + spanOuterFlap / span
        outerXsiLE = 1 - (cTipOuterFlap / calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing))

        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(createFlap('outerFlap2', parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, appendInnerCruiseRoller=True, type='flap', innerX=innerX, outerX=outerX))
    
    # n Flaps
    elif nOuterFlaps > 2. :
        n = int(ceil(nOuterFlaps))
        # First Flap
        # the inner border eta is located at the kink 
        innerEtaLE = etaKink
        innerXsiLE = xsiSparKink + sparOffset
        # the outer border eta is determined from the half span of the total outer flap
        outerEtaLE = etaKink + spanOuterFlap / n / span
        outerXsiLE = xsiSpar_interp(outerEtaLE) + absSparOffset / calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing)
        
        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(createFlap('outerFlap1', parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, type='flap', innerX=innerX, outerX=outerX))
        
        for i in range(2, n):
            # nth Flap
            # new inner is the old outer 
            innerEtaLE = outerEtaLE
            innerXsiLE = outerXsiLE
            # the outer border eta is determined from the full span of the total outer flap
            outerEtaLE = innerEtaLE + spanOuterFlap / n / span
            outerXsiLE = xsiSpar_interp(outerEtaLE) + absSparOffset / calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing)
            
            #Fowler Motion is restricted to 75% of the flap depth
            innerX = (1. - innerXsiLE) * calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
            outerX = (1. - outerXsiLE) * calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
            myFlaps.append(createFlap('outerFlap' + str(i), parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, appendInnerCruiseRoller=True, type='flap', innerX=innerX, outerX=outerX))

        # Last Flap
        # new inner is the old outer 
        innerEtaLE = outerEtaLE
        innerXsiLE = outerXsiLE
        # the outer border eta is determined from the full span of the total outer flap
        outerEtaLE = etaKink + spanOuterFlap / span
        outerXsiLE = 1 - (cTipOuterFlap / calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing))
        
        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(createFlap('outerFlap' + str(n), parentWingVAMPzero.id, innerEtaLE, innerXsiLE, outerEtaLE, outerXsiLE, maxX, appendInnerCruiseRoller=True, type='flap', innerX=innerX, outerX=outerX))

    # Output to Spoiler
    # as the spoiler is relying on data of the flaps some basic information is written 
    # back to the the VAMPzero components  
    parentWingVAMPzero.spoiler.outerEta = parameter(outerEtaLE, '', 'calc', 'The outermost eta coordinate of all flaps. This overlaps with the outer eta coordinate of the spoiler', parent=parentWingVAMPzero.spoiler)
    spoilerChord = 0.05 * cKink + 0.5 * cInnerFlap
    parentWingVAMPzero.spoiler.chord = parameter(spoilerChord, 'm', 'calc', 'The absolute chord of the spoiler: 5% of the kink chord length + 50% of the innerFlap Chord length', parent=parentWingVAMPzero.spoiler)
    
    # Output to CPACS
    if type(cpacsComponentSegment.get_controlSurfaces()) == NoneType:
        cpacsComponentSegment.set_controlSurfaces(controlSurfacesType())
    if type(cpacsComponentSegment.get_controlSurfaces().get_trailingEdgeDevices()) == NoneType:
        cpacsComponentSegment.get_controlSurfaces().set_trailingEdgeDevices(trailingEdgeDevicesType())
    
    log.debug('VAMPzero SLAT: Exporting %s Flaps to CPACS.' % (str(len(myFlaps))))
    for flap in myFlaps:
        cpacsComponentSegment.get_controlSurfaces().get_trailingEdgeDevices().add_trailingEdgeDevice(flap)
Exemplo n.º 18
0
    def __init__(self, aircraft):
        '''
        will initialize instance mainly used for documentation
        links to the aircraft instance
        initiates the airfoil class
        @Method: Component Constructor
        '''
        component.__init__(self)
        self.id = 'wing'
        self.aircraft = aircraft
        self.level = 2
        self.UID = uID(cpacsPath='/cpacs/toolspecific/vampZero/wingUID')

        # Mass
        self.mWing = mWing(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[1]/massDescription['+self.id+'_mass]/mass')
        self.parentUID = parameter(value=self.id, 
			cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[1]/massDescription['+self.id+'_mass]/parentUID')

        # CoG
        self.posCoG = posCoG(
            cpacsPath='/cpacs/vehicles/aircraft/model/analyses/massBreakdown/mOEM/mEM/mStructure/mWingsStructure/mWingStructure[1]/massDescription['+self.id+'_mass]/location/x')

        # Geometry
        self.location = location()		
        self.refArea = refArea(cpacsPath='/cpacs/vehicles/aircraft/model/reference/area')
        self.expArea = expArea()
        self.wetArea = wetArea()
        self.aspectRatio = aspectRatio()
        self.span = span()
        self.taperRatio = taperRatio()
        self.tcAVG = tcAVG()
        self.cRoot = cRoot()
        self.cTip = cTip()
        self.cMAC = cMAC(cpacsPath='/cpacs/vehicles/aircraft/model/reference/length')
        self.yMAC = yMAC()
        self.xMAC = xMAC()
        self.xMAC25 = xMAC25(cpacsPath='/cpacs/vehicles/aircraft/model/reference/point/x')
        self.phiLE = phiLE()
        self.phiTE = phiTE()
        self.phi25 = phi25()
        self.phi50 = phi50()
        self.dihedral = dihedral()
        self.twist = twist()
        self.xRoot = xRoot()
        self.zRoot = zRoot()
        self.LoD = LoD()
        self.etaKink = etaKink()
        self.etaEngine = etaEngine()

        # Aerodynamics
        self.cLalpha = cLalpha()
        self.cLMAX = cLMAX()
        self.formFactor = formFactor()
        self.reynoldsNr = reynoldsNr()  # cpacsPath='/cpacs/vehicles/aircraft/model/global/aeroPerformanceMap/reynoldsNumber')
        self.cfLAM = cfLAM()
        self.cfTURB = cfTURB()
        self.cD0c = cD0c()
        self.oswald = oswald()
        self.cDMINoffset = cDMINoffset()
        self.nLam = nLam()
        self.cDw = cDw()
        self.machDD = machDD()
        self.machCrit = machCrit()
        self.cM0CR = cM0CR()
        self.cM0TO = cM0TO()
        self.cM0L = cM0L()

        # Airfoil
        self.airfoilr = airfoil(self, position='root')
        self.airfoilt = airfoil(self, position='tip')

        # Aileron
        self.aileron = aileron(self)

        # Slat
        self.slat = slat(self)

        # Flap
        self.flap = flap(self)

        # Spoiler
        self.spoiler = spoiler(self)

        # CPACS Stuff for Export to higher Level
        self.xFuselage = xFuselage()
        self.yFuselage = yFuselage()
        self.zFuselage = zFuselage()
        self.cFuselage = cFuselage()

        self.xKink = xKink()
        self.yKink = yKink()
        self.zKink = zKink()
        self.cKink = cKink()

        self.xTip = xTip()
        self.zTip = zTip()
Exemplo n.º 19
0
def createFlapsSBW(parentWingCPACS, parentWingVAMPzero, myFlap):
    '''
    This is the main export method for the wings flaps

    @todo: it is possible that the inner flap overlaps the kink area
    '''
    cpacsPath = '/cpacs/vehicles/aircraft/model/wings/wing[' + parentWingVAMPzero.id + ']'
    cpacsWing = getObjfromXpath(parentWingCPACS, cpacsPath)
    cpacsComponentSegment = cpacsWing.get_componentSegments(
    ).get_componentSegment()[0]
    myFlaps = []

    #===========================================================================
    # Initialization, i.e. fetching values throughout the code
    #===========================================================================
    xsiSparRoot = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[3].get_xsi().valueOf_)
    xsiSparFuselage = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[4].get_xsi().valueOf_)
    xsiSparKink = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[5].get_xsi().valueOf_)
    xsiSparTip = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[6].get_xsi().valueOf_)

    etaSparRoot = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[3].get_eta().valueOf_)
    etaSparFuselage = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[4].get_eta().valueOf_)
    etaSparKink = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[5].get_eta().valueOf_)
    etaSparTip = eval(cpacsComponentSegment.get_structure().get_spars(
    ).get_sparPositions().get_sparPosition()[6].get_eta().valueOf_)

    xsiSpar_interp = scipy.interpolate.interp1d(
        [etaSparRoot, etaSparFuselage, etaSparKink, etaSparTip],
        [xsiSparRoot, xsiSparFuselage, xsiSparKink, xsiSparTip])

    yFus = parentWingVAMPzero.yFuselage.getValue()
    span = parentWingVAMPzero.span.getValue() / 2.
    etaFus = yFus / span
    etaKink = parentWingVAMPzero.etaKink.getValue()
    cRoot = parentWingVAMPzero.cRoot.getValue()
    cKink = calcChordLengthAtEta(etaKink, parentWingVAMPzero, cpacsWing)
    phiLE = parentWingVAMPzero.phiLE.getValue()

    innerFlapArea = myFlap.refAreaInnerFlap.getValue()
    outerFlapArea = myFlap.refAreaOuterFlap.getValue()

    #===========================================================================
    # OuterFlap
    #===========================================================================
    sparOffset = 0.08

    # maxX is the maximum extension of the flap
    maxX = cRoot * (1. - (xsiSparRoot + sparOffset)) / 2.
    newOuterFlapArea = innerFlapArea + outerFlapArea
    cRootOuterFlap = cRoot * (1. - (xsiSparRoot + sparOffset))

    #===========================================================================
    # Determine the total flap span by iteration
    #===========================================================================
    calcArea = 0.
    spanOuterFlap = 0.
    absSparOffset = sparOffset * cKink

    # Obtain the maxEtaValue. This is forwarded from the ailerons export routine.
    maxEta = myFlap.maxEta.getValue() - 0.02

    # the tip root length is a function of the span (as the xsi location of the spar changes)
    while abs(calcArea - newOuterFlapArea) > 0.1:
        spanOuterFlap += .01
        cTipOuterFlap = calcChordLengthAtEta(
            etaFus + spanOuterFlap / span, parentWingVAMPzero, cpacsWing
        ) * (1 - xsiSpar_interp(etaFus + spanOuterFlap / span)) - absSparOffset
        oldcalcArea = calcArea
        calcArea = spanOuterFlap * (cRootOuterFlap + cTipOuterFlap) / 2.

        if calcArea < oldcalcArea:
            log.warning(
                'VAMPzero FLAP: Outer Flap Area can not be established decreasing spar offset by 2% chord!'
            )
            sparOffset = sparOffset - 0.02
            calcArea = 0.
            spanOuterFlap = 0.
            absSparOffset = sparOffset * cKink
            break

        if spanOuterFlap / span + etaFus > maxEta:
            log.warning(
                'VAMPzero FLAP: Outer Flap overlaps with the aileron decreasing spar offset by 2% chord!'
            )
            sparOffset = sparOffset - 0.02
            calcArea = 0.
            spanOuterFlap = 0.
            absSparOffset = sparOffset * cRoot
            break

    while abs(calcArea - newOuterFlapArea) > 0.1:
        spanOuterFlap += .01
        cTipOuterFlap = calcChordLengthAtEta(
            etaKink + spanOuterFlap / span, parentWingVAMPzero, cpacsWing) * (
                1 -
                xsiSpar_interp(etaKink + spanOuterFlap / span)) - absSparOffset
        oldcalcArea = calcArea
        calcArea = spanOuterFlap * (cRootOuterFlap + cTipOuterFlap) / 2.

        if calcArea < oldcalcArea:
            log.warning(
                'VAMPzero FLAP: Outer Flap Area can not be established! Continuing with outerArea = %s'
                % str(calcArea))
            newOuterFlapArea = calcArea
            break

        if spanOuterFlap / span + etaFus > maxEta:
            log.warning(
                'VAMPzero FLAP: Outer Flap overlaps with the aileron! Continuing with outerArea = %s'
                % str(calcArea))
            newOuterFlapArea = calcArea
            break

    #===========================================================================
    # Determine the number of flaps
    # The aspect ratio of a flap should not be higher than 6.
    #===========================================================================
    nOuterFlaps = spanOuterFlap**2. / (newOuterFlapArea * 6.)
    log.debug(
        'VAMPzero FLAP: Exporting %s Flaps outboard of the engine for an area of %s m2.'
        % (str(nOuterFlaps), str(newOuterFlapArea)))

    #===========================================================================
    # 1 Flap
    #===========================================================================
    if nOuterFlaps <= 1.:
        # the inner border eta is located at the kink
        innerEtaLE = etaFus + 0.05
        innerXsiLE = xsiSparRoot + sparOffset
        # the outer border eta is determined from the span of the outer flap
        outerEtaLE = etaFus + 0.05 + spanOuterFlap / span
        outerXsiLE = 1 - (cTipOuterFlap / calcChordLengthAtEta(
            outerEtaLE, parentWingVAMPzero, cpacsWing))

        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(
            innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(
            outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(
            createFlap('outerFlap1',
                       parentWingVAMPzero.id,
                       innerEtaLE,
                       innerXsiLE,
                       outerEtaLE,
                       outerXsiLE,
                       maxX,
                       appendInnerCruiseRoller=True,
                       type='flap',
                       innerX=innerX,
                       outerX=outerX))

    #===========================================================================
    # 2 Flaps
    #===========================================================================
    elif nOuterFlaps > 1. and nOuterFlaps <= 2.:
        # the inner border eta is located at the kink
        innerEtaLE = etaFus + 0.05
        innerXsiLE = xsiSparKink + sparOffset
        # the outer border eta is determined from the half span of the total outer flap
        outerEtaLE = etaFus + 0.05 + spanOuterFlap / (2 * span)
        outerXsiLE = xsiSpar_interp(
            outerEtaLE) + absSparOffset / calcChordLengthAtEta(
                outerEtaLE, parentWingVAMPzero, cpacsWing)
        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(
            innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(
            outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(
            createFlap('outerFlap1',
                       parentWingVAMPzero.id,
                       innerEtaLE,
                       innerXsiLE,
                       outerEtaLE,
                       outerXsiLE,
                       maxX,
                       type='flap',
                       innerX=innerX,
                       outerX=outerX))

        # new inner is the old outer
        innerEtaLE = outerEtaLE
        innerXsiLE = outerXsiLE
        # the outer border eta is determined from the full span of the total outer flap
        outerEtaLE = etaFus + 0.05 + spanOuterFlap / span
        outerXsiLE = 1 - (cTipOuterFlap / calcChordLengthAtEta(
            outerEtaLE, parentWingVAMPzero, cpacsWing))

        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(
            innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(
            outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(
            createFlap('outerFlap2',
                       parentWingVAMPzero.id,
                       innerEtaLE,
                       innerXsiLE,
                       outerEtaLE,
                       outerXsiLE,
                       maxX,
                       appendInnerCruiseRoller=True,
                       type='flap',
                       innerX=innerX,
                       outerX=outerX))

    #===========================================================================
    # n Flaps
    #===========================================================================
    elif nOuterFlaps > 2.:
        n = int(ceil(nOuterFlaps))
        # First Flap
        # the inner border eta is located at the kink
        innerEtaLE = etaFus + 0.05
        innerXsiLE = xsiSparKink + sparOffset
        # the outer border eta is determined from the half span of the total outer flap
        outerEtaLE = etaFus + 0.05 + spanOuterFlap / (n * span)
        outerXsiLE = xsiSpar_interp(
            outerEtaLE) + absSparOffset / calcChordLengthAtEta(
                outerEtaLE, parentWingVAMPzero, cpacsWing)

        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(
            innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(
            outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(
            createFlap('outerFlap1',
                       parentWingVAMPzero.id,
                       innerEtaLE,
                       innerXsiLE,
                       outerEtaLE,
                       outerXsiLE,
                       maxX,
                       type='flap',
                       innerX=innerX,
                       outerX=outerX))

        for i in range(2, n):
            # nth Flap
            # new inner is the old outer
            innerEtaLE = outerEtaLE
            innerXsiLE = outerXsiLE
            # the outer border eta is determined from the full span of the total outer flap
            outerEtaLE = innerEtaLE + spanOuterFlap / n / span
            outerXsiLE = xsiSpar_interp(
                outerEtaLE) + absSparOffset / calcChordLengthAtEta(
                    outerEtaLE, parentWingVAMPzero, cpacsWing)

            #Fowler Motion is restricted to 75% of the flap depth
            innerX = (1. - innerXsiLE) * calcChordLengthAtEta(
                innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
            outerX = (1. - outerXsiLE) * calcChordLengthAtEta(
                outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
            myFlaps.append(
                createFlap('outerFlap' + str(i),
                           parentWingVAMPzero.id,
                           innerEtaLE,
                           innerXsiLE,
                           outerEtaLE,
                           outerXsiLE,
                           maxX,
                           appendInnerCruiseRoller=True,
                           type='flap',
                           innerX=innerX,
                           outerX=outerX))

        # Last Flap
        # new inner is the old outer
        innerEtaLE = outerEtaLE
        innerXsiLE = outerXsiLE
        # the outer border eta is determined from the full span of the total outer flap
        outerEtaLE = etaFus + 0.05 + spanOuterFlap / span
        outerXsiLE = 1 - (cTipOuterFlap / calcChordLengthAtEta(
            outerEtaLE, parentWingVAMPzero, cpacsWing))

        #Fowler Motion is restricted to 75% of the flap depth
        innerX = (1. - innerXsiLE) * calcChordLengthAtEta(
            innerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        outerX = (1. - outerXsiLE) * calcChordLengthAtEta(
            outerEtaLE, parentWingVAMPzero, cpacsWing) * 0.5
        myFlaps.append(
            createFlap('outerFlap' + str(n),
                       parentWingVAMPzero.id,
                       innerEtaLE,
                       innerXsiLE,
                       outerEtaLE,
                       outerXsiLE,
                       maxX,
                       appendInnerCruiseRoller=True,
                       type='flap',
                       innerX=innerX,
                       outerX=outerX))

    #===============================================================================
    # Output to Spoiler
    # as the spoiler is relying on data of the flaps some basic information is written
    # back to the the VAMPzero components
    #===============================================================================
    parentWingVAMPzero.spoiler.outerEta = parameter(
        parent=parentWingVAMPzero.spoiler,
        value=outerEtaLE,
        unit='',
        status='calc',
        doc=
        'The outermost eta coordinate of all flaps. This overlaps with the outer eta coordinate of the spoiler'
    )
    spoilerChord = maxX
    parentWingVAMPzero.spoiler.chord = parameter(
        spoilerChord,
        'm',
        'calc',
        'The absolute chord of the spoiler: 5% of the kink chord length + 50% of the innerFlap Chord length',
        parent=parentWingVAMPzero.spoiler)

    #===========================================================================
    # Output to CPACS
    #===========================================================================
    if type(cpacsComponentSegment.get_controlSurfaces()) == NoneType:
        cpacsComponentSegment.set_controlSurfaces(controlSurfacesType())
    if type(cpacsComponentSegment.get_controlSurfaces().
            get_trailingEdgeDevices()) == NoneType:
        cpacsComponentSegment.get_controlSurfaces().set_trailingEdgeDevices(
            trailingEdgeDevicesType())

    log.debug('VAMPzero SLAT: Exporting %s Flaps to CPACS.' %
              (str(len(myFlaps))))
    for flap in myFlaps:
        cpacsComponentSegment.get_controlSurfaces().get_trailingEdgeDevices(
        ).add_trailingEdgeDevice(flap)
Exemplo n.º 20
0
    def __init__(self, aircraft):
        '''
        will initialize instance mainly used for documentation
        links to the aircraft instance
        initiates the airfoil class
        @Method: Component Constructor
        '''
        component.__init__(self)
        self.id = 'tool'
        self.aircraft = aircraft
        self.level = 2

        #===============================================================================
        #Aircraft stuff 
        #===============================================================================
        self.aircraftName = parameter(cpacsPath='/cpacs/vehicles/aircraft/model/name', value='VAMPzero')
        self.aircraftDES = parameter(cpacsPath='/cpacs/vehicles/aircraft/model/description', value='VAMPzero')
        #commented out due to introduction of xMAC25
        #self.refX             = parameter(cpacsPath = '/cpacs/vehicles/aircraft/model/reference/point/x',value='0.0')
        self.refY = parameter(cpacsPath='/cpacs/vehicles/aircraft/model/reference/point/y', value='0.0')
        self.refZ = parameter(cpacsPath='/cpacs/vehicles/aircraft/model/reference/point/z', value='0.0')

        #=======================================================================
        # Lifting Line
        #=======================================================================
        self.liliname = parameter(cpacsPath='/cpacs/toolspecific/liftingLine/tool/name', value='LIFTING_LINE')
        self.liliversion = parameter(cpacsPath='/cpacs/toolspecific/liftingLine/tool/version', value='2.3.1')
        self.liliuID = parameter(cpacsPath='/cpacs/toolspecific/liftingLine/aircraftModelUID',
                                 value='A320modelID')#@todo: Model ID is not available at Time of Construction
        self.liliSpaneling = parameter(
            cpacsPath='/cpacs/toolspecific/liftingLine/toolParameters/wingPanelings/wingPaneling[1]/spanwise',
            value='5')
        self.liliCpaneling = parameter(
            cpacsPath='/cpacs/toolspecific/liftingLine/toolParameters/wingPanelings/wingPaneling[1]/chordwise',
            value='5')

        self.lilimode = parameter(cpacsPath='/cpacs/toolspecific/liftingLine/toolParameters/archiveMode', value='1')
        #self.lilipolars       = parameter(cpacsPath = '/cpacs/toolspecific/liftingLine/performanceMaps',value='')


        #=======================================================================
        #Header Information 
        #=======================================================================
        self.name = parameter(cpacsPath='/cpacs/header/name', value='Export from')
        self.creator = parameter(cpacsPath='/cpacs/header/creator', value='VAMPzero')
        self.timestamp = parameter(cpacsPath='/cpacs/header/timestamp', value='2010-12-31T12:00:00')
        self.version = parameter(cpacsPath='/cpacs/header/version', value='0.1')
        self.version = parameter(cpacsPath='/cpacs/header/cpacsVersion', value='2.0')