コード例 #1
0
# x_range = 'all'
# y_range = 'all'
x_range = [1, 8]
cl_range = [0.9, 1.7]
cd_range = [1.0, 2.8]
pf_range = [0.4, 1.0]
y_range = [cl_range, cd_range, pf_range]
y_label = [r'$\bar{C_L}$', r'$\bar{C_D}$', r'$\frac{1}{P^\ast}$']
#---------------------------------------
cwd = os.getcwd()
kinematics_dir = os.path.join(
    os.path.dirname(os.path.dirname(os.path.dirname(cwd))),
    'geometry_effect_fw_data/1_kinematic_cases/3dbm_kinematic_cases')
data_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(cwd))),
                        'geometry_effect_fw_data/5_SIM_RESULTS')
image_out_path = cwd
#---------------------------------------
CF_file_names = [f.name for f in os.scandir(data_dir) if f.is_file()]
mcf_array = []
for cfi in cfd_data_list:
    for CF_name in CF_file_names:
        if CF_name.startswith(cfi):
            kinematics_datai = os.path.join(kinematics_dir, CF_name)
            cfd_datai = os.path.join(data_dir, CF_name)
            u2, karr, dkarr, ddkarr = read_kinematics_data(kinematics_datai)
            mcf_arrayi = read_cfd_data(cfd_datai, u2, karr, dkarr)
            mcf_array.append(mcf_arrayi)
#---------------------------------------
cf_plotter(x_data, mcf_array, legends, x_range, y_range, y_label,
           image_out_path, title, x_label)
コード例 #2
0
rd_range = [-1.55, 0.6]
y_range = [cl_range, cd_range, rl_range, rd_range]
y_label = [
    r'$\bar{C}_{lw}$', r'$\bar{C}_{dw}$', r'$\bar{C}_{lw}/\bar{C}_{ls}$',
    r'$\bar{C}_{dw}/\bar{C}_{ds}$'
]
#---------------------------------------
cwd = os.getcwd()
data_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(cwd))),
                        'wake_convection_data/3_SIM_RESULTS')
image_out_path = cwd
#---------------------------------------
mcf_array = []
for cfi in cfd_data_list:
    cfd_datai = os.path.join(data_dir, cfi)
    mcf_arrayi = read_cfd_data(cfd_datai)
    mcf_array.append(mcf_arrayi)
#---------------------------------------
with open('meancf_all.dat', 'w') as f:
    for data_name, mvalues in zip(cfd_data_list, mcf_array):
        f.write("%s:\n" % data_name)
        f.write(
            "mcl_s = %s, mcl_w = %s, ratio_l = %s, mcd_s = %s, mcd_w = %s, ratio_d = %s, ratio_ld = %s\n"
            % (
                '{0:.8g}'.format(mvalues[0]),
                '{0:.8g}'.format(mvalues[1]),
                '{0:.8g}'.format(mvalues[2]),
                '{0:.8g}'.format(mvalues[3]),
                '{0:.8g}'.format(mvalues[4]),
                '{0:.8g}'.format(mvalues[5]),
                '{0:.8g}'.format(mvalues[6]),