Skip to content

Commit c545bd8

Browse files
authored
Merge pull request #15652 from rmcdermo/master
Python: updates to atmospheric_boundary_layer.py
2 parents 9a14a33 + e83cd1f commit c545bd8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

Utilities/Python/scripts/atmospheric_boundary_layer.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
outdir = '../../Verification/Atmospheric_Effects/'
1414
pltdir = '../../Manuals/FDS_User_Guide/SCRIPT_FIGURES/'
1515

16-
git_file = outdir + 'atmospheric_boundary_layer_1_git.txt'
17-
version_string = fdsplotlib.get_version_string(git_file)
18-
1916
basein = outdir + 'atmospheric_boundary_layer'
2017
baseout = pltdir + 'atmospheric_boundary_layer'
2118

2219
for i in range(1, 5): # Loop from 1 to 4 (inclusive)
2320

21+
git_file = outdir + f'atmospheric_boundary_layer_{i}_git.txt'
22+
version_string = fdsplotlib.get_version_string(git_file)
23+
2424
datafile = basein + '_' + str(i)
2525
outfile = baseout + '_' + str(i)
2626

@@ -52,6 +52,7 @@
5252
theta_star = u_star**2 * theta_0 / (g * kappa * L)
5353

5454
z = np.array([z_0[i], 10*z_0[i], 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 50, 100])
55+
z = np.sort(z)
5556

5657
# Create figure 1 for velocity
5758

@@ -63,7 +64,7 @@
6364
psi_m = -5*z/L
6465
psi_h = psi_m
6566

66-
u = (u_star/kappa) * (np.log(z/z_0[i]) - psi_m)
67+
u = (u_star/kappa) * np.maximum(np.log(z/z_0[i]) - psi_m, 0.)
6768
theta = theta_0 + (theta_star/kappa) * (np.log(z/z_0[i]) - psi_h)
6869
T = theta * (p_0 / (p_0 - rho_0*g*(z - z_0[i])))**(-0.285)
6970

@@ -75,7 +76,9 @@
7576

7677
fig = fdsplotlib.plot_to_fig(x_data=M2.iloc[:, 1].values, y_data=M2.iloc[:, 0].values, marker_style='k-', data_label='FDS',
7778
x_label='Velocity (m/s)', y_label='Height (m)',
78-
x_min=0, x_max=u_high[i], y_min=0, y_max=100)
79+
x_min=0, x_max=u_high[i], y_min=0, y_max=100,
80+
revision_label=version_string,
81+
legend_location='lower right')
7982

8083
fdsplotlib.plot_to_fig(x_data=u, y_data=z, figure_handle=fig, marker_style='ko', data_label='M-O Theory')
8184

@@ -100,7 +103,9 @@
100103

101104
fig = fdsplotlib.plot_to_fig(x_data=M2.iloc[:,2].values, y_data=M2.iloc[:,0].values, marker_style='k-', data_label='FDS',
102105
x_label='Temperature (°C)', y_label='Height (m)',
103-
x_min=T_low[i], x_max=T_high[i], y_min=0, y_max=100)
106+
x_min=T_low[i], x_max=T_high[i], y_min=0, y_max=100,
107+
revision_label=version_string,
108+
legend_location='lower left')
104109

105110
fdsplotlib.plot_to_fig(x_data=T - 273.15, y_data=z, figure_handle=fig, marker_style='ko', data_label='M-O Theory')
106111

0 commit comments

Comments
 (0)