Exemple #1
0
def main():
    # 計算条件
    size = 100
    center_x = -0.08
    center_y = 1.0
    naca4 = "6633"
    inflow = 1.0
    alpha = 0.0
    type = 0

    # 一様流の複素速度
    complex_U = get_complex_U(inflow_velocity=inflow,
                              attack_angle_degree=alpha)

    z, size = get_complex_coords(type, size, center_x, center_y,
                                 naca4)  # 離散的な物体形状(パネル端点)の複素座標の取得(論文中の添字j)

    path = "D:\\Toyota\\Data\\DVM_v_mk2\\"
    fname = "dvm_v_mk1_test_type_" + str(type).zfill(2)

    # print(invQ)
    controller = VortexControl(z, complex_U, path, fname)
    # controller.plot_object()

    controller.test_case()
Exemple #2
0
def calc_lift_coef_NACA5DIGIT(number,
                              inflow,
                              type,
                              fixed_size,
                              kind_of_wing,
                              kind_of_angle,
                              step_of_angle,
                              min_angle=None):
    # save_data[id, 0] = wing_type  # 1:joukowski, 2:karman-trefftz, 3:naca4digit
    # save_data[id, 1] = shape_data_1 : if type=1 or type=2 => center_x, elseif type=3 => NACA-4-DigitNumber
    # save_data[id, 2] = shape_data_2 : if type=1 or type=2 => center_y, elseif type=3 => Not use
    # save_data[id, 3] = attack_angle
    # save_data[id, 4] = lift_coefficient
    if min_angle == None:
        min_angle = -(2.0 * kind_of_angle) / step_of_angle

    save_data = np.zeros((kind_of_wing * kind_of_angle, number), dtype=float)
    save_data[:, 0] = type

    angle_and_lift = np.zeros((kind_of_angle, 2))
    head_int3 = [210, 220, 230, 240, 250, 221, 231, 241, 251]
    data_id = 0
    for int3 in head_int3:
        for int2 in range(1, 100):
            naca5 = str(int3) + str(int2).zfill(2)
            save_data[data_id:data_id + kind_of_angle, 1] = int(naca5)

            z, size = dvm.get_complex_coords(type=type,
                                             size=fixed_size,
                                             naca4=naca5)

            copy_data_id = data_id
            for angle in range(kind_of_angle):
                angle_and_lift[
                    angle,
                    0] = step_of_angle * angle - min_angle  # attack_angle_deg
                complex_U = dvm.get_complex_U(
                    inflow_velocity=inflow,
                    attack_angle_degree=angle_and_lift[angle, 0])
                circulation = dvm.get_circulation(z,
                                                  complex_U,
                                                  gamma_output=False)
                angle_and_lift[angle, 1] = dvm.get_lift_coefficient(
                    z, circulation, complex_U)
                data_id += 1

            save_data[copy_data_id:copy_data_id + kind_of_angle,
                      3:5] = angle_and_lift

    fname = path + "NACA5\\s21001_e25199_a" + str(kind_of_angle).zfill(
        3) + ".csv"
    np.savetxt(fname, save_data, delimiter=",")
Exemple #3
0
def main():
    # 計算条件
    size = 100
    center_x = -0.08
    center_y = 1.0
    naca4 = "6633"
    inflow = 1.0
    alpha = 0.0
    type = 0

    # 一様流の複素速度
    complex_U = get_complex_U(inflow_velocity=inflow,
                              attack_angle_degree=alpha)

    z, size = get_complex_coords(type, size, center_x, center_y,
                                 naca4)  # 離散的な物体形状(パネル端点)の複素座標の取得(論文中の添字j)

    # print(invQ)
    controller = VortexControl(z, complex_U)

    controller.main_process()
Exemple #4
0
def validation_joukowski(path):
    size = 500
    center_x = -0.08
    center_y = 0.08
    inflow = 1.0
    density = 1.0
    type = 1
    z, size = dvm.get_complex_coords(type, size, center_x, center_y)

    number = 181
    save_data = np.zeros((number, 7))
    for angle in range(number):
        attack_angle_deg = angle - 90

        complex_U = dvm.get_complex_U(inflow, attack_angle_deg)

        gamma, circulation = dvm.get_circulation(z, complex_U)
        lift = dvm.get_lift(density, circulation, complex_U)
        lift_coef = dvm.get_lift_coefficient(z, circulation, complex_U)
        exact_lift, exact_lift_coef = dvm.validation(type, center_x, center_y,
                                                     complex_U)
        if ((angle == 12 + 90) and (size == 500)):
            fname = "joukowski_valid_" + str(size).zfill(4) + "_" + str(
                center_x) + "_" + str(center_y) + "attack_angle_12_sample"
            velocity = dvm.get_velocity(z, gamma, complex_U, path, fname)

        save_data[angle, 0] = attack_angle_deg
        save_data[angle, 1] = lift
        save_data[angle, 2] = exact_lift
        save_data[angle, 3] = lift_coef
        save_data[angle, 4] = exact_lift_coef
        save_data[angle, 5] = np.sqrt((lift - exact_lift)**2)
        save_data[angle, 6] = np.sqrt((lift_coef - exact_lift_coef)**2)

    fname = path + "joukowski_valid_" + str(size).zfill(4) + "_" + str(
        center_x) + "_" + str(center_y) + ".csv"
    np.savetxt(fname, save_data, delimiter=",")
Exemple #5
0
def calc_lift_coef(odd,
                   number,
                   inflow,
                   type,
                   fixed_size,
                   kind_of_wing,
                   kind_of_angle,
                   step_of_angle,
                   min_angle=None):
    # save_data[id, 0] = wing_type  # 1:joukowski, 2:karman-trefftz, 3:naca4digit
    # save_data[id, 1] = shape_data_1 : if type=1 or type=2 => center_x, elseif type=3 => NACA-4-DigitNumber
    # save_data[id, 2] = shape_data_2 : if type=1 or type=2 => center_y, elseif type=3 => Not use
    # save_data[id, 3] = attack_angle
    # save_data[id, 4] = lift_coefficient

    if min_angle == None:
        min_angle = -(2.0 * kind_of_angle) / step_of_angle

    if odd == True:
        nextnum = odd_number
        endword = "_odd"
    elif odd == False:
        nextnum = even_number
        endword = "even"
        kind_of_wing = int(0.9 * kind_of_wing)  # NACAxx00の分を除外
    """
    else:
        nextnum = original_number
        endword = "mixed"
        startnum = 1
    """
    split = 1
    split_kind_of_wing = int(kind_of_wing / split)
    split_pattern = split_kind_of_wing * kind_of_angle
    save_data = np.zeros((split_pattern, number), dtype=float)
    save_data[:, 0] = type

    angle_and_lift = np.zeros((kind_of_angle, 2))
    for file in range(split):
        data_id = 0
        start = split_kind_of_wing * file

        end = split_kind_of_wing * (file + 1)
        print("split " + str(file).zfill(3) + " / " + str(split) + " started")
        for wing in range(start, end):
            if ((odd == True) or (nextnum(wing) % 100 != 0)):
                save_data[data_id:data_id + kind_of_angle, 1] = nextnum(wing)
                naca4 = str(nextnum(wing)).zfill(4)  # only use odd number
                z, size = dvm.get_complex_coords(type=type,
                                                 size=fixed_size,
                                                 naca4=naca4)
                copy_data_id = data_id
                for angle in range(kind_of_angle):
                    # save_data[data_id, 3] = step_of_angle * angle - kind_of_angle  # attack_angle_deg
                    angle_and_lift[
                        angle,
                        0] = step_of_angle * angle - min_angle  # attack_angle_deg
                    complex_U = dvm.get_complex_U(
                        inflow_velocity=inflow,
                        attack_angle_degree=angle_and_lift[angle, 0])
                    circulation = dvm.get_circulation(z,
                                                      complex_U,
                                                      gamma_output=False)
                    # save_data[data_id, 4] = dvm.get_lift_coefficient(z, circulation, complex_U)
                    angle_and_lift[angle, 1] = dvm.get_lift_coefficient(
                        z, circulation, complex_U)
                    data_id += 1

                save_data[copy_data_id:copy_data_id + kind_of_angle,
                          3:5] = angle_and_lift

        fname = path + "NACA4\\s" + str(start).zfill(4) + "_e" + str(
            end).zfill(4) + "_a" + str(kind_of_angle).zfill(
                3) + endword + ".csv"
        np.savetxt(fname, save_data, delimiter=",")