|
| 1 | + |
| 2 | +# Verification Guide, Jet Centerline Velocity Decay |
| 3 | + |
| 4 | +import numpy as np |
| 5 | +import pandas as pd |
| 6 | +import matplotlib.pyplot as plt |
| 7 | +from matplotlib import rc |
| 8 | +import os |
| 9 | +import fdsplotlib |
| 10 | + |
| 11 | +plot_style = fdsplotlib.get_plot_style('fds') |
| 12 | + |
| 13 | +outdir = '../../../out/Turbulent_Jet/' |
| 14 | +pltdir = '../../Manuals/FDS_Verification_Guide/SCRIPT_FIGURES/' |
| 15 | + |
| 16 | +git_file = outdir + 'jet_csmag_dx10cm_git.txt' |
| 17 | +version_string = fdsplotlib.get_version_string(git_file) |
| 18 | + |
| 19 | +# gather FDS results |
| 20 | + |
| 21 | +M = pd.read_csv(outdir + 'jet_csmag_dx10cm_line.csv', skiprows=2) |
| 22 | +u_csmag_10 = M.iloc[:, 1].values |
| 23 | + |
| 24 | +M = pd.read_csv(outdir + 'jet_dsmag_dx10cm_line.csv', skiprows=2) |
| 25 | +u_dsmag_10 = M.iloc[:, 1].values |
| 26 | + |
| 27 | +M = pd.read_csv(outdir + 'jet_deardorff_dx10cm_line.csv', skiprows=2) |
| 28 | +u_deardorff_10 = M.iloc[:, 1].values |
| 29 | + |
| 30 | +M = pd.read_csv(outdir + 'jet_vreman_dx10cm_line.csv', skiprows=2) |
| 31 | +u_vreman_10 = M.iloc[:, 1].values |
| 32 | + |
| 33 | +M = pd.read_csv(outdir + 'jet_csmag_dx5cm_line.csv', skiprows=2) |
| 34 | +u_csmag_5 = M.iloc[:, 1].values |
| 35 | + |
| 36 | +M = pd.read_csv(outdir + 'jet_dsmag_dx5cm_line.csv', skiprows=2) |
| 37 | +u_dsmag_5 = M.iloc[:, 1].values |
| 38 | + |
| 39 | +M = pd.read_csv(outdir + 'jet_deardorff_dx5cm_line.csv', skiprows=2) |
| 40 | +u_deardorff_5 = M.iloc[:, 1].values |
| 41 | + |
| 42 | +M = pd.read_csv(outdir + 'jet_vreman_dx5cm_line.csv', skiprows=2) |
| 43 | +u_vreman_5 = M.iloc[:, 1].values |
| 44 | + |
| 45 | +# analytical solutions |
| 46 | + |
| 47 | +x = M.iloc[:, 0].values |
| 48 | +u_0 = 2.1 |
| 49 | +h = 0.8 |
| 50 | +b = 0.8 |
| 51 | +m_1 = 0.12 |
| 52 | +m_2 = 0.20 |
| 53 | + |
| 54 | +u_1 = np.zeros(len(x)) |
| 55 | +for j in range(len(x)): |
| 56 | + if x[j] < h/m_1: |
| 57 | + u_1[j] = u_0 |
| 58 | + else: |
| 59 | + u_1[j] = u_0/(m_1*x[j])*np.sqrt(b*h) |
| 60 | + |
| 61 | +u_2 = np.zeros(len(x)) |
| 62 | +for j in range(len(x)): |
| 63 | + if x[j] < h/m_2: |
| 64 | + u_2[j] = u_0 |
| 65 | + else: |
| 66 | + u_2[j] = u_0/(m_2*x[j])*np.sqrt(b*h) |
| 67 | + |
| 68 | +# Create figure |
| 69 | + |
| 70 | +fig = fdsplotlib.plot_to_fig(x_data=[-1,-1], y_data=[-1,-1], |
| 71 | + x_min=0, x_max=25, y_min=0, y_max=1.2, |
| 72 | + revision_label=version_string, |
| 73 | + plot_title='Jet Centerline Velocity Decay', |
| 74 | + legend_location='upper right', |
| 75 | + legend_fontsize=8, |
| 76 | + x_label='$x/h$', |
| 77 | + y_label='$u_{\\hbox{\\tiny max}}/u_0$') |
| 78 | + |
| 79 | +fdsplotlib.plot_to_fig(x_data=x/h, y_data=u_1/u_0, figure_handle=fig, marker_style='k--', data_label='analytical, $m=0.12$') |
| 80 | +fdsplotlib.plot_to_fig(x_data=x/h, y_data=u_2/u_0, figure_handle=fig, marker_style='k-' , data_label='analytical, $m=0.20$') |
| 81 | +fdsplotlib.plot_to_fig(x_data=x/h, y_data=u_csmag_10/u_0, figure_handle=fig, marker_style='g--', data_label='csmag, $h/\\delta x=8$') |
| 82 | +fdsplotlib.plot_to_fig(x_data=x/h, y_data=u_csmag_5 /u_0, figure_handle=fig, marker_style='g-' , data_label='csmag, $h/\\delta x=16$') |
| 83 | +fdsplotlib.plot_to_fig(x_data=x/h, y_data=u_dsmag_10/u_0, figure_handle=fig, marker_style='c--', data_label='dsmag, $h/\\delta x=8$') |
| 84 | +fdsplotlib.plot_to_fig(x_data=x/h, y_data=u_dsmag_5 /u_0, figure_handle=fig, marker_style='c-' , data_label='dsmag, $h/\\delta x=16$') |
| 85 | +fdsplotlib.plot_to_fig(x_data=x/h, y_data=u_deardorff_10/u_0, figure_handle=fig, marker_style='b--', data_label='Deardorff, $h/\\delta x=8$') |
| 86 | +fdsplotlib.plot_to_fig(x_data=x/h, y_data=u_deardorff_5 /u_0, figure_handle=fig, marker_style='b-' , data_label='Deardorff, $h/\\delta x=16$') |
| 87 | +fdsplotlib.plot_to_fig(x_data=x/h, y_data=u_vreman_10/u_0, figure_handle=fig, marker_style='r--', data_label='Vreman, $h/\\delta x=8$') |
| 88 | +fdsplotlib.plot_to_fig(x_data=x/h, y_data=u_vreman_5 /u_0, figure_handle=fig, marker_style='r-' , data_label='Vreman, $h/\\delta x=16$') |
| 89 | + |
| 90 | +plt.savefig(pltdir + 'jet_decay.pdf', format='pdf') |
| 91 | +plt.close() |
| 92 | + |
0 commit comments