Ejemplo n.º 1
0
def parasite_drag_fuselage(state,settings,geometry):
    """Computes the parasite drag due to the fuselage

    Assumptions:
    Basic fit

    Source:
    adg.stanford.edu (Stanford AA241 A/B Course Notes)

    Inputs:
    state.conditions.freestream.
      mach_number                                [Unitless]
      temperature                                [K]
      reynolds_number                            [Unitless]
    settings.fuselage_parasite_drag_form_factor  [Unitless]
    geometry.fuselage.       
      areas.front_projected                      [m^2]
      areas.wetted                               [m^2]
      lengths.total                              [m]
      effective_diameter                         [m]

    Outputs:
    fuselage_parasite_drag                       [Unitless]

    Properties Used:
    N/A
    """

    # unpack inputs
    configuration = settings
    form_factor   = configuration.fuselage_parasite_drag_form_factor
    fuselage      = geometry
    
    freestream  = state.conditions.freestream
    Sref        = fuselage.areas.front_projected
    Swet        = fuselage.areas.wetted
    
    l_fus  = fuselage.lengths.total
    d_fus  = fuselage.effective_diameter
    
    # conditions
    Mc  = freestream.mach_number
    Tc  = freestream.temperature    
    re  = freestream.reynolds_number

    # reynolds number
    Re_fus = re*(l_fus)
    
    # skin friction coefficient
    cf_fus, k_comp, k_reyn = compressible_turbulent_flat_plate(Re_fus,Mc,Tc)
    
    # form factor for cylindrical bodies
    d_d = float(d_fus)/float(l_fus)
    D = np.array([[0.0]] * len(Mc))
    a = np.array([[0.0]] * len(Mc))
    du_max_u = np.array([[0.0]] * len(Mc))
    k_fus = np.array([[0.0]] * len(Mc))
    
    D[Mc < 0.95] = np.sqrt(1 - (1-Mc[Mc < 0.95]**2) * d_d**2)
    a[Mc < 0.95] = 2 * (1-Mc[Mc < 0.95]**2) * (d_d**2) *(np.arctanh(D[Mc < 0.95])-D[Mc < 0.95]) / (D[Mc < 0.95]**3)
    du_max_u[Mc < 0.95] = a[Mc < 0.95] / ( (2-a[Mc < 0.95]) * (1-Mc[Mc < 0.95]**2)**0.5 )
    
    D[Mc >= 0.95] = np.sqrt(1 - d_d**2)
    a[Mc >= 0.95] = 2  * (d_d**2) *(np.arctanh(D[Mc >= 0.95])-D[Mc >= 0.95]) / (D[Mc >= 0.95]**3)
    du_max_u[Mc >= 0.95] = a[Mc >= 0.95] / ( (2-a[Mc >= 0.95]) )
    
    k_fus = (1 + form_factor*du_max_u)**2

    fuselage_parasite_drag = k_fus * cf_fus * Swet / Sref  
    
    # dump data to conditions
    fuselage_result = Data(
        wetted_area               = Swet   , 
        reference_area            = Sref   , 
        parasite_drag_coefficient = fuselage_parasite_drag ,
        skin_friction_coefficient = cf_fus ,
        compressibility_factor    = k_comp ,
        reynolds_factor           = k_reyn , 
        form_factor               = k_fus  ,
    )
    try:
        state.conditions.aerodynamics.drag_breakdown.parasite[fuselage.tag] = fuselage_result
    except:
        print("Drag Polar Mode fuse parasite")
    
    return fuselage_parasite_drag
Ejemplo n.º 2
0
def parasite_drag_nacelle(state, settings, nacelle):
    """Computes the parasite drag due to the nacelle

    Assumptions:
    Basic fit

    Source:
    Raymer equation (pg 283 of Aircraft Design: A Conceptual Approach) (subsonic)
    http://aerodesign.stanford.edu/aircraftdesign/drag/BODYFORMFACTOR.HTML (supersonic)

    Inputs:
    state.conditions.freestream.
      mach_number                                [Unitless]
      temperature                                [K]
      reynolds_number                            [Unitless]
    geometry.      
      nacelle.diameter                           [m^2]
             areas.wetted                        [m^2]
             length                              [m]
 
    Outputs:
    nacelle_parasite_drag                      [Unitless]

    Properties Used:
    N/A
    """

    # unpack inputs
    conditions = state.conditions

    low_mach_cutoff = settings.begin_drag_rise_mach_number
    high_mach_cutoff = settings.end_drag_rise_mach_number

    freestream = conditions.freestream

    Sref = nacelle.diameter**2 / 4 * np.pi
    Swet = nacelle.areas.wetted

    l_prop = nacelle.length
    d_prop = nacelle.diameter

    # conditions
    freestream = conditions.freestream
    Mc = freestream.mach_number
    Tc = freestream.temperature
    re = freestream.reynolds_number

    # reynolds number
    Re_prop = re * l_prop

    # skin friction coefficient
    cf_prop, k_comp, k_reyn = compressible_turbulent_flat_plate(
        Re_prop, Mc, Tc)

    # form factor according to Raymer equation (pg 283 of Aircraft Design: A Conceptual Approach)
    k_prop_sub = 1. + 0.35 / (float(l_prop) / float(d_prop))

    # for supersonic flow (http://adg.stanford.edu/aa241/drag/BODYFORMFACTOR.HTML)
    k_prop_sup = 1.

    trans_spline = Cubic_Spline_Blender(low_mach_cutoff, high_mach_cutoff)
    h00 = lambda M: trans_spline.compute(M)

    k_prop = k_prop_sub * (h00(Mc)) + k_prop_sup * (1 - h00(Mc))

    # --------------------------------------------------------
    # find the final result
    nacelle_parasite_drag = k_prop * cf_prop * Swet / Sref
    # --------------------------------------------------------

    # dump data to conditions
    nacelle_result = Data(
        wetted_area=Swet,
        reference_area=Sref,
        parasite_drag_coefficient=nacelle_parasite_drag,
        skin_friction_coefficient=cf_prop,
        compressibility_factor=k_comp,
        reynolds_factor=k_reyn,
        form_factor=k_prop,
    )
    state.conditions.aerodynamics.drag_breakdown.parasite[
        nacelle.tag] = nacelle_result

    return nacelle_parasite_drag
Ejemplo n.º 3
0
def parasite_drag_propulsor(state,settings,geometry):
    """Computes the parasite drag due to the propulsor

    Assumptions:
    Basic fit

    Source:
    adg.stanford.edu (Stanford AA241 A/B Course Notes)

    Inputs:
    state.conditions.freestream.
      mach_number                                [Unitless]
      temperature                                [K]
      reynolds_number                            [Unitless]
    geometry.      
      nacelle_diameter                           [m^2]
      areas.wetted                               [m^2]
      engine_length                              [m]

    Outputs:
    propulsor_parasite_drag                      [Unitless]

    Properties Used:
    N/A
    """

    # unpack inputs
    conditions    = state.conditions
    configuration = settings
    
    propulsor = geometry
    Sref      = propulsor.nacelle_diameter**2. / 4. * np.pi
    Swet      = propulsor.areas.wetted
    
    l_prop = propulsor.engine_length
    d_prop = propulsor.nacelle_diameter
    
    # conditions
    freestream = conditions.freestream
    Mc  = freestream.mach_number
    Tc  = freestream.temperature    
    re  = freestream.reynolds_number

    # reynolds number
    Re_prop = re*l_prop
    
    # skin friction coefficient
    cf_prop, k_comp, k_reyn = compressible_turbulent_flat_plate(Re_prop,Mc,Tc)
    
    ## form factor according to Raymer equation (pg 283 of Aircraft Design: A Conceptual Approach)
    k_prop = 1 + 0.35 / (float(l_prop)/float(d_prop))  
    
   
    # find the final result    
    propulsor_parasite_drag = k_prop * cf_prop * Swet / Sref
    
    # dump data to conditions
    propulsor_result = Data(
        wetted_area               = Swet    , 
        reference_area            = Sref    , 
        parasite_drag_coefficient = propulsor_parasite_drag ,
        skin_friction_coefficient = cf_prop ,
        compressibility_factor    = k_comp  ,
        reynolds_factor           = k_reyn  , 
        form_factor               = k_prop  ,
    )
    conditions.aerodynamics.drag_breakdown.parasite[propulsor.tag] = propulsor_result    
    
    return propulsor_parasite_drag
Ejemplo n.º 4
0
def parasite_drag_fuselage(state, settings, geometry):
    """Computes the parasite drag due to the fuselage

    Assumptions:
    Basic fit

    Source:
    http://aerodesign.stanford.edu/aircraftdesign/aircraftdesign.html (Stanford AA241 A/B Course Notes)

    Inputs:
    state.conditions.freestream.
      mach_number                                [Unitless]
      temperature                                [K]
      reynolds_number                            [Unitless]
    settings.fuselage_parasite_drag_form_factor  [Unitless]
    geometry.fuselage.       
      areas.front_projected                      [m^2]
      areas.wetted                               [m^2]
      lengths.total                              [m]
      effective_diameter                         [m]

    Outputs:
    fuselage_parasite_drag                       [Unitless]

    Properties Used:
    N/A
    """

    # unpack inputs
    configuration = settings
    form_factor = configuration.fuselage_parasite_drag_form_factor
    low_cutoff = configuration.fuselage_parasite_drag_begin_blend_mach
    high_cutoff = configuration.fuselage_parasite_drag_end_blend_mach
    fuselage = geometry

    freestream = state.conditions.freestream
    Sref = fuselage.areas.front_projected
    Swet = fuselage.areas.wetted

    l_fus = fuselage.lengths.total
    d_fus = fuselage.effective_diameter

    # conditions
    Mc = freestream.mach_number
    Tc = freestream.temperature
    re = freestream.reynolds_number

    # reynolds number
    Re_fus = re * (l_fus)

    # skin friction coefficient
    cf_fus, k_comp, k_reyn = compressible_turbulent_flat_plate(Re_fus, Mc, Tc)

    # form factor for cylindrical bodies
    d_d = float(d_fus) / float(l_fus)

    D_low = np.array([[0.0]] * len(Mc))
    a_low = np.array([[0.0]] * len(Mc))
    du_max_u_low = np.array([[0.0]] * len(Mc))

    D_high = np.array([[0.0]] * len(Mc))
    a_high = np.array([[0.0]] * len(Mc))
    du_max_u_high = np.array([[0.0]] * len(Mc))

    k_fus = np.array([[0.0]] * len(Mc))

    low_inds = Mc < high_cutoff
    high_inds = Mc > low_cutoff

    D_low[low_inds] = np.sqrt(1 - (1 - Mc[low_inds]**2) * d_d**2)
    a_low[low_inds] = 2 * (1 - Mc[low_inds]**2) * (d_d**2) * (
        np.arctanh(D_low[low_inds]) - D_low[low_inds]) / (D_low[low_inds]**3)
    du_max_u_low[low_inds] = a_low[low_inds] / ((2 - a_low[low_inds]) *
                                                (1 - Mc[low_inds]**2)**0.5)

    D_high[high_inds] = np.sqrt(1 - d_d**2)
    a_high[high_inds] = 2 * (d_d**2) * (np.arctanh(
        D_high[high_inds]) - D_high[high_inds]) / (D_high[high_inds]**3)
    du_max_u_high[high_inds] = a_high[high_inds] / ((2 - a_high[high_inds]))

    spline = Cubic_Spline_Blender(low_cutoff, high_cutoff)
    h00 = lambda M: spline.compute(M)

    du_max_u = du_max_u_low * (h00(Mc)) + du_max_u_high * (1 - h00(Mc))

    k_fus = (1 + form_factor * du_max_u)**2

    fuselage_parasite_drag = k_fus * cf_fus * Swet / Sref

    # dump data to conditions
    fuselage_result = Data(
        wetted_area=Swet,
        reference_area=Sref,
        parasite_drag_coefficient=fuselage_parasite_drag,
        skin_friction_coefficient=cf_fus,
        compressibility_factor=k_comp,
        reynolds_factor=k_reyn,
        form_factor=k_fus,
    )
    try:
        state.conditions.aerodynamics.drag_breakdown.parasite[
            fuselage.tag] = fuselage_result
    except:
        print("Drag Polar Mode fuse parasite")

    return fuselage_parasite_drag
Ejemplo n.º 5
0
def parasite_drag_propulsor(state,settings,geometry):
    """Computes the parasite drag due to the propulsor

    Assumptions:
    Basic fit

    Source:
    Raymer equation (pg 283 of Aircraft Design: A Conceptual Approach) (subsonic)
    http://adg.stanford.edu/aa241/drag/BODYFORMFACTOR.HTML (supersonic)

    Inputs:
    state.conditions.freestream.
      mach_number                                [Unitless]
      temperature                                [K]
      reynolds_number                            [Unitless]
    geometry.      
      nacelle_diameter                           [m^2]
      areas.wetted                               [m^2]
      engine_length                              [m]
    state.conditions.aerodynamics.drag_breakdown.
      compressible.main_wing.divergence_mach     [Unitless]

    Outputs:
    propulsor_parasite_drag                      [Unitless]

    Properties Used:
    N/A
    """
    
    # unpack inputs
    
    conditions    = state.conditions
    configuration = settings
    propulsor     = geometry
        
    freestream = conditions.freestream
    
    Sref        = propulsor.nacelle_diameter**2 / 4 * np.pi
    Swet        = propulsor.areas.wetted
    
    l_prop  = propulsor.engine_length
    d_prop  = propulsor.nacelle_diameter
    
    # conditions
    freestream = conditions.freestream
    Mc = freestream.mach_number
    Tc = freestream.temperature    
    re = freestream.reynolds_number

    # reynolds number
    Re_prop = re*l_prop
    
    # skin friction coefficient
    cf_prop, k_comp, k_reyn = compressible_turbulent_flat_plate(Re_prop,Mc,Tc)


    k_prop = np.array([[0.0]]*len(Mc))
    # assume that the drag divergence mach number of the propulsor matches the main wing
    Mdiv = state.conditions.aerodynamics.drag_breakdown.compressible.main_wing.divergence_mach
    
    # form factor according to Raymer equation (pg 283 of Aircraft Design: A Conceptual Approach)
    k_prop_sub = 1. + 0.35 / (float(l_prop)/float(d_prop)) 
    
    # for supersonic flow (http://adg.stanford.edu/aa241/drag/BODYFORMFACTOR.HTML)
    k_prop_sup = 1.
    
    sb_mask = (Mc <= Mdiv)
    tn_mask = ((Mc > Mdiv) & (Mc < 1.05))
    sp_mask = (Mc >= 1.05)
    
    k_prop[sb_mask] = k_prop_sub
    # basic interpolation for transonic
    k_prop[tn_mask] = (k_prop_sup-k_prop_sub)*(Mc[tn_mask]-Mdiv[tn_mask])/(1.05-Mdiv[tn_mask]) + k_prop_sub
    k_prop[sp_mask] = k_prop_sup
    
    # --------------------------------------------------------
    # find the final result    
    propulsor_parasite_drag = k_prop * cf_prop * Swet / Sref  
    # --------------------------------------------------------
    
    # dump data to conditions
    propulsor_result = Data(
        wetted_area               = Swet    , 
        reference_area            = Sref    , 
        parasite_drag_coefficient = propulsor_parasite_drag ,
        skin_friction_coefficient = cf_prop ,
        compressibility_factor    = k_comp  ,
        reynolds_factor           = k_reyn  , 
        form_factor               = k_prop  ,
    )
    state.conditions.aerodynamics.drag_breakdown.parasite[propulsor.tag] = propulsor_result    
    
    return propulsor_parasite_drag