Example #1
0
 def _mass_wing(self,wing):
     # by Raymer - fighter weights
     Sw = convert.sqm_to_sqft(wing.area)
     A  = wing.aspectRatio
     tcRoot = wing.airfoils[1].thickness #FIXME: assume thickness of 2nd section
     # --- own corrections ---
     eqArea = (wing.chords[0]+wing.chords[-1])*wing.span/2.0
     corr = wing.area/eqArea
     Kms = 1.1 # correction for multisegment wings
     TR = wing.taperRatio
     sweepC4 = wing.equivSweepC4rad
     Scsw  = wing.csArea
     m = 0.0103*self.Kdw*self.Kvs* (self.Wdg*self.Nz)**0.5* Sw**0.622* A**0.785 *tcRoot**(-0.4)* (1+TR)**0.5*np.cos(sweepC4)**(-1.0)* Scsw**0.04
     m = corr*Kms*m
     wingCGratio = self.constMass['wingCGratio']
     xCG = self.ac.wing.MAClocation[0] + self.ac.wing.MAC*wingCGratio
     zCG = self.ac.wing.secApex[0,2]
     if wing.material=='composite':
         m = m*self.constMass['compositeWing']
     self._add_mass1('wing',m,np.array([xCG,0.0,zCG]))
Example #2
0
def get_parasite_drag_fw(ac,altitude=0.0):
    
    path1 = pth.aeroCD0in
    path2 = pth.aeroCD0inWave
    
    W = ac.designGoals.grossMass*9.81
    rho = ac.designGoals.fc.atm.density
    V = ac.designGoals.cruiseSpeed
    Sref = ac.wing.area
    CL=W/(0.5*rho*V*V*Sref)

    # --- friction + form drag input ---
    fid1 = open(path1,'wt')
    #h = ac.designGoals.cruiseAltitude
    #h = convert.m_to_ft(h)
    h = float(altitude)
    Sref = convert.sqm_to_sqft(Sref)
    Abase = 0.095
    Dexit = 0.0
    Ewdd = 1.8
    prleak = 10.0
    fid1.write('%d %.0f %.0f %.4f %.1f %.1f %.1f\n'%(1,h,Sref,Abase, Dexit, Ewdd, prleak))

    ale = ac.wing.equivSweepLEdeg
    aqc = ac.wing.equivSweepC4deg
    ahc = ac.wing.equivSweepC2deg
    a4 = ac.wing.span
    a4 = convert.m_to_ft(a4)
    # ---
    t1 = ac.wing.airfoils[0].thickness*ac.wing.chords[0]
    t2 = ac.wing.airfoils[1].thickness*ac.wing.chords[1]
    Amax = (t1+t2)*ac.wing.segSpans[0]
    # ---
    ttc = ac.wing.equivThickness
    fc = ac.wing.equivCamber
    cld = CL
    xa = 1.02
    fid1.write('%.4f %.4f %.4f %.4f %.4f %.4f %.6f %.4f %.2f\n'%(ale,aqc,ahc,a4,Amax,ttc,fc,cld,xa))

    wSwet = ac.wing.wettedArea
    wSwet = convert.sqm_to_sqft(wSwet)
    wRefL = convert.m_to_ft(ac.wing.MAC)

    fid1.write('Wing %.4f %.4f 1 '%(wSwet,wRefL))
    wtc = ac.wing.equivThickness
    wc4 = ac.wing.equivSweepC4deg
    wxtc = ac.wing.equivThicknessLoc
    q = 1.0 #???
    fid1.write('%.4f %.4f %.4f %.4f'%(wtc,wc4,wxtc,q))
    fid1.close()

    # --- wave drag input ---
    fid2 = open(path2,'wt')
    fid2.write('1 0 0 0 0 0 0 0\n')
    wrle = ac.wing.equivLEradius
    cam = ac.wing.equivCamber
    fid2.write('%.4f %.4f %.4f %.4f %d\n'%(wtc,wxtc,wrle,cam, 1))
    fid2.write('0.0394 0.5 0. 0. 0\n')
    fid2.write('0. 0. 0. 0. 1\n')
    fid2.write('0.04 0.5 0. 0. 0\n')
    wte = ac.wing.equivSweepTEdeg
    lref = convert.m_to_ft(ac.wing.MAC)
    AR = ac.wing.aspectRatio
    fid2.write('%.4f %.4f %.4f %.4f %.4f\n'%(ale,wte,lref,AR,Sref))
    fid2.write('44.56 0. 0.29 2.24\n')
    fid2.write('0. 0. 0. 0.\n')
    fid2.write('44. 3. 0.277 2.48\n')
    fid2.write('0. 0. 0. 0. 0.\n')
    fid2.write('2\n')
    fid2.write('21.08 20.92 19.364 4.97 2.9\n')
    fid2.write('0.35 0.45 0.47 0.9339\n')
    fid2.close()
    os.system(pth.aeroCD0)

    data = read_tabulated_data_without_header(pth.aeroCD0out,3)
    pth.clean_drag_files()
    CD = data[:-1,-1]
    M = data[:-1,0]
    Mdd = data[-1,0]
    CDdd = data[-1,-1]
    return M, CD, Mdd, CDdd