Skip to content

Commit 8df4f69

Browse files
committed
Python: add git revision and legend location to atmospheric_boundary_layer.py
1 parent 9a14a33 commit 8df4f69

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

Utilities/Python/scripts/atmospheric_boundary_layer.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@
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)
16+
# git_file = outdir + 'atmospheric_boundary_layer_1_git.txt'
17+
# version_string = fdsplotlib.get_version_string(git_file)
1818

1919
basein = outdir + 'atmospheric_boundary_layer'
2020
baseout = pltdir + 'atmospheric_boundary_layer'
2121

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

24+
git_file = outdir + f'atmospheric_boundary_layer_{i}_git.txt'
25+
version_string = fdsplotlib.get_version_string(git_file)
26+
2427
datafile = basein + '_' + str(i)
2528
outfile = baseout + '_' + str(i)
2629

@@ -52,6 +55,7 @@
5255
theta_star = u_star**2 * theta_0 / (g * kappa * L)
5356

5457
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])
58+
z = np.sort(z)
5559

5660
# Create figure 1 for velocity
5761

@@ -63,7 +67,7 @@
6367
psi_m = -5*z/L
6468
psi_h = psi_m
6569

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

@@ -75,7 +79,9 @@
7579

7680
fig = fdsplotlib.plot_to_fig(x_data=M2.iloc[:, 1].values, y_data=M2.iloc[:, 0].values, marker_style='k-', data_label='FDS',
7781
x_label='Velocity (m/s)', y_label='Height (m)',
78-
x_min=0, x_max=u_high[i], y_min=0, y_max=100)
82+
x_min=0, x_max=u_high[i], y_min=0, y_max=100,
83+
revision_label=version_string,
84+
legend_location='lower right')
7985

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

@@ -100,7 +106,9 @@
100106

101107
fig = fdsplotlib.plot_to_fig(x_data=M2.iloc[:,2].values, y_data=M2.iloc[:,0].values, marker_style='k-', data_label='FDS',
102108
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)
109+
x_min=T_low[i], x_max=T_high[i], y_min=0, y_max=100,
110+
revision_label=version_string,
111+
legend_location='lower left')
104112

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

0 commit comments

Comments
 (0)