Skip to content

Commit 55264a5

Browse files
authored
Merge pull request #15305 from mcgratta/master
FDS Verification: convert jet_decay.m
2 parents b9defe5 + be67d3e commit 55264a5

File tree

4 files changed

+93
-104
lines changed

4 files changed

+93
-104
lines changed

Utilities/Matlab/FDS_verification_script.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262

6363
% Special cases
6464

65-
disp('jet_decay...'); jet_decay
6665
disp('wall_model...'); wall_model
6766
disp('pulsating...'); pulsating
6867
disp('compression_wave...'); compression_wave

Utilities/Matlab/scripts/jet_decay.m

Lines changed: 0 additions & 103 deletions
This file was deleted.

Utilities/Python/FDS_verification_script.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
# Special cases
3232

33+
print("jet_decay..."); subprocess.run(["python","./scripts/jet_decay.py"])
3334
print("pyrolysis..."); subprocess.run(["python","./scripts/pyrolysis.py"])
3435
print("turb_model..."); subprocess.run(["python","./scripts/turb_model.py"])
3536

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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

Comments
 (0)