Ejemplo n.º 1
0
def c_f_m_flap(wing, control, mach, cg):
    """return flap force and moment coefficient derivatives, empirical method."""
    y_scalar = control['b_2'] / abs(control['b_2'])
    s = wing['planform']
    b = span(wing['aspect_ratio'], s)
    taper = wing['taper']
    c_r = root_chord(wing['aspect_ratio'], s, taper)
    if y_scalar > 0:
        y_w = b * control['b_2'] / 2
        x_w = abs(y_w) * tan(deg2rad(wing['sweep_LE']))
        c_r_f = y_chord(abs(control['b_1']) * b / 2, c_r, b, taper)
        c_t_f = y_chord(abs(control['b_2']) * b / 2, c_r, b, taper)
    else:
        y_w = b * control['b_1'] / 2
        x_w = abs(y_w) * tan(deg2rad(wing['sweep_LE']))
        c_r_f = y_chord(abs(control['b_2']) * b / 2, c_r, b, taper)
        c_t_f = y_chord(abs(control['b_1']) * b / 2, c_r, b, taper)
    s_f = flap_area(wing, control)
    b_f = flap_span(wing, control)
    ar_f = (b_f**2) / s_f
    taper_f = c_t_f / c_r_f
    y_f = y_mac(ar_f, s_f, taper_f)
    cbar_f = mac(ar_f, s_f, taper_f)
    ac_f = array(
        [y_f * tan(deg2rad(wing['sweep_LE'])) + cbar_f / 4, y_f * y_scalar, 0])
    ac = (ac_f + array([x_w, y_w, 0]) +
          array([wing['station'], wing['buttline'], wing['waterline']]))
    r = (ac - cg) * array([-1, 1, -1])
    f = c_f_delta_flap(wing, control, mach)
    m = cross(r, f)
    c = concatenate((f, m))
    return c
Ejemplo n.º 2
0
def avl_section(y, cs, wing, mirror, cs_name, duplicate_sign=1):
    """create avl wing section."""
    b = span(wing['aspect_ratio'], wing['planform'], mirror=mirror)
    c_r = root_chord(wing['aspect_ratio'],
                     wing['planform'],
                     wing['taper'],
                     mirror=mirror)
    wing_root_le_pnt = avl.Point(wing['station'], wing['buttline'],
                                 wing['waterline'])
    if mirror:
        le_point = avl.Point(
            x=wing_root_le_pnt.x + y * tan(deg2rad(wing['sweep_LE'])),
            y=y,
            z=wing_root_le_pnt.z + y * tan(deg2rad(wing['dihedral'])))
        chord = y_chord(y, c_r, b, wing['taper'])
    else:
        le_point = avl.Point(x=wing_root_le_pnt.x +
                             y * tan(deg2rad(wing['sweep_LE'])),
                             y=wing_root_le_pnt.y,
                             z=wing_root_le_pnt.z + y)
        chord = y_chord(y, c_r, b * 2, wing['taper'])
    if cs == 0:
        section = avl.Section(leading_edge_point=le_point,
                              chord=chord,
                              airfoil=avl.NacaAirfoil(wing['airfoil']))
    else:
        control = avl.Control(name=cs_name,
                              gain=1,
                              x_hinge=1 - cs['cf_c'],
                              duplicate_sign=duplicate_sign)
        section = avl.Section(leading_edge_point=le_point,
                              chord=chord,
                              airfoil=avl.NacaAirfoil(wing['airfoil']),
                              controls=[control])
    return section
Ejemplo n.º 3
0
def flap_area(wing, control):
    """return flapped area."""
    s = wing['planform']
    b = span(wing['aspect_ratio'], s)
    taper = wing['taper']
    c_r = root_chord(wing['aspect_ratio'], s, taper)
    s_a = ((control['b_2'] - control['b_1']) * b / 4 *
           (y_chord(abs(control['b_2']) * b / 2, c_r, b, taper) +
            y_chord(abs(control['b_1']) * b / 2, c_r, b, taper)))
    return s_a
Ejemplo n.º 4
0
def print_vt(wing):
    b = span(wing['aspect_ratio'], wing['planform'], mirror=0)
    c_r = root_chord(wing['aspect_ratio'], wing['planform'], wing['taper'])
    c_t = c_r * wing['taper']
    x = wing['station'] + array([
        0, b / 2 * tan(deg2rad(wing['sweep_LE'])),
        b / 2 * tan(deg2rad(wing['sweep_LE'])) + c_t, c_r, 0
    ])
    z = array([0, b, b, 0, 0]) + wing['waterline']
    y = array([0, 0, 0, 0, 0])
    return x, y, z
Ejemplo n.º 5
0
 def d_epsilon_d_alpha(self, ht, mach):
     """return downwash gradient wrt angle of attack, empirical method."""
     ar = self.wing['aspect_ratio']  # []
     taper = self.wing['taper']  # []
     root_chord_wing = root_chord(ar, self.wing['planform'], taper)  # [ft]
     root_chord_ht = root_chord(ht['aspect_ratio'], ht['planform'],
                                ht['taper'])  # [ft]
     x_wh = (ht['station'] + root_chord_ht / 4) - (
         self.wing['station'] + root_chord_wing / 4)  # [ft]
     z_wh = ht['waterline'] - self.wing['waterline']  # [ft]
     b = span(ar, self.wing['planform'])  # [ft]
     r = 2 * x_wh / b  # []
     m = 2 * z_wh / b  # []
     k_ar = (1 / ar) - 1 / (1 + ar**1.7)  # []
     k_taper = (10 - 3 * taper) / 7  # []
     k_mr = (1 - (m / 2)) / (r**0.333)  # []
     sweep_25 = sweep_x(ar, taper, self.wing['sweep_LE'], 0.25)  # [deg]
     beta = sqrt(1 - mach**2)  # []
     de_da = 4.44 * beta * (k_ar * k_taper * k_mr *
                            sqrt(cos(deg2rad(sweep_25))))**1.19  # []
     return de_da
Ejemplo n.º 6
0
def print_wing(wing):
    b = span(wing['aspect_ratio'], wing['planform'])
    c_r = root_chord(wing['aspect_ratio'], wing['planform'], wing['taper'])
    c_t = c_r * wing['taper']
    x = wing['station'] + array([
        0, b / 2 * tan(deg2rad(wing['sweep_LE'])),
        b / 2 * tan(deg2rad(wing['sweep_LE'])) + c_t, c_r,
        b / 2 * tan(deg2rad(wing['sweep_LE'])) + c_t,
        b / 2 * tan(deg2rad(wing['sweep_LE'])), 0
    ])
    y = array([0, b / 2, b / 2, 0, -b / 2, -b / 2, 0])
    z = wing['waterline'] + array([
        0, b / 2 * tan(deg2rad(wing['dihedral'])),
        b / 2 * tan(deg2rad(wing['dihedral'])), 0,
        b / 2 * tan(deg2rad(wing['dihedral'])),
        b / 2 * tan(deg2rad(wing['dihedral'])), 0
    ])
    return x, y, z
Ejemplo n.º 7
0
from src.modeling.trapezoidal_wing import mac, root_chord, span, sweep_x, x_mac, y_chord, y_mac
from test.test_library import is_close
ar = 5
s = 10
sweep_le = 30
taper = 0.5

c_bar = mac(ar, s, taper)
cr = root_chord(ar, s, taper)
b = span(ar, s)
sweep = sweep_x(ar, taper, sweep_le, 0.5)
y = y_mac(ar, s, taper)
x = x_mac(3, sweep_le)
c = y_chord(0.25, cr, b, taper)

out = list()
out.append((is_close(c_bar, 1.46659)))
out.append(is_close(b, 7.071067))
out.append(is_close(cr, 1.8856))
out.append(is_close(c, 1.81895))
out.append(is_close(x, 1.73205))
out.append(is_close(y, 1.5713))
out.append(is_close(sweep, 23.942))

if any(out):
    print("trapezoidal wing test passed!")
else:
    print("trapezoidal wing test failed")