Skip to content

Commit fe868d6

Browse files
authored
Merge pull request #15442 from rmcdermo/master
Python: turn on Backwards_Facing_Step in python validation
2 parents 0a8f2a3 + 20db280 commit fe868d6

File tree

3 files changed

+44
-21
lines changed

3 files changed

+44
-21
lines changed

Utilities/Matlab/FDS_validation_script.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,4 @@
5454

5555
% Miscellaneous other scripts for special cases
5656

57-
backward_facing_step
58-
5957
display('validation scripts completed successfully!')

Utilities/Python/FDS_validation_script.py

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

6060

6161
# Special cases
62+
print("Backwards_Facing_Step..."); runpy.run_path("./scripts/Backward_Facing_Step.py", run_name="__main__")
6263
print("Beyler_Hood..."); runpy.run_path("./scripts/Beyler_Hood.py", run_name="__main__")
6364
print("BRE_LEMTA_Sprays..."); runpy.run_path("./scripts/BRE_LEMTA_Sprays.py", run_name="__main__")
6465
print("catchpole_spread_rates..."); runpy.run_path("./scripts/catchpole_spread_rates.py", run_name="__main__")

Utilities/Python/scripts/backwards_facing_step.py renamed to Utilities/Python/scripts/Backwards_Facing_Step.py

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import matplotlib.pyplot as plt
1313
import fdsplotlib
1414

15+
1516
def tight_subplot(Nh, Nw, gap=(0.01, 0.01), marg_h=(0.13, 0.08), marg_w=(0.11, 0.019)):
1617
'''
1718
Creates a grid of subplot axes with adjustable gaps and margins.
@@ -102,11 +103,11 @@ def tight_subplot(Nh, Nw, gap=(0.01, 0.01), marg_h=(0.13, 0.08), marg_w=(0.11, 0
102103

103104
error = 0.0005 * np.ones_like(Cf_exp)
104105

105-
fig = fdsplotlib.plot_to_fig(x_data=xoh_cf, y_data=Cf_exp, y_error=error,marker_style='ko--',
106+
fig = fdsplotlib.plot_to_fig(x_data=xoh_cf, y_data=Cf_exp, y_error=error,marker_style='ko',
106107
revision_label=version_string,x_min=0,x_max=20,y_min=-0.004,y_max=0.004,
107108
data_label='J&D',
108-
x_label='$x/h$',
109-
y_label='$C_f$')
109+
x_label=r'$x/h$',
110+
y_label=r'$C_f$')
110111

111112
# FDS Data
112113
h_leg = []
@@ -149,8 +150,8 @@ def tight_subplot(Nh, Nw, gap=(0.01, 0.01), marg_h=(0.13, 0.08), marg_w=(0.11, 0
149150
fig = fdsplotlib.plot_to_fig(x_data=xoh_cp, y_data=Cp_exp, marker_style='ko',
150151
revision_label=version_string,x_min=0,x_max=20,y_min=-0.1,y_max=0.25,
151152
data_label='J&D',
152-
x_label='$x/h$',
153-
y_label='$C_p$')
153+
x_label=r'$x/h$',
154+
y_label=r'$C_p$')
154155

155156
# FDS Data
156157
h_leg2 = []
@@ -236,8 +237,13 @@ def tight_subplot(Nh, Nw, gap=(0.01, 0.01), marg_h=(0.13, 0.08), marg_w=(0.11, 0
236237
ax.text(0.01, 3.2, f'$x/h$={x_l}', transform=ax.transData, fontsize=14)
237238

238239
if i == 0:
239-
ax.set_ylabel('$z/h$', fontsize=16)
240-
ax.set_xlabel('<$u$>/$U_0$', fontsize=16)
240+
ax.set_ylabel(r'$z/h$', fontsize=16)
241+
ax.set_xlabel(r'$\langle u \rangle/U_0$', fontsize=16)
242+
# Add legend only to the first plot in this set
243+
legend_labels = ['J&D']
244+
for k in fds_key:
245+
legend_labels.append(k)
246+
ax.legend(legend_labels, loc='best', frameon=False, fontsize=10)
241247
else:
242248
ax.set_yticklabels([])
243249
ax.set_xticklabels([])
@@ -302,8 +308,13 @@ def tight_subplot(Nh, Nw, gap=(0.01, 0.01), marg_h=(0.13, 0.08), marg_w=(0.11, 0
302308
ax.text(0.01, 3.2, f'$x/h$={x_l}', transform=ax.transData, fontsize=14)
303309

304310
if i == 0:
305-
ax.set_ylabel('$z/h$', fontsize=16)
306-
ax.set_xlabel('<$w$>/$U_0$', fontsize=16)
311+
ax.set_ylabel(r'$z/h$', fontsize=16)
312+
ax.set_xlabel(r'$\langle w \rangle/U_0$', fontsize=16)
313+
# Add legend only to the first plot in this set
314+
legend_labels = ['J&D']
315+
for k in fds_key:
316+
legend_labels.append(k)
317+
ax.legend(legend_labels, loc='best', frameon=False, fontsize=10)
307318
else:
308319
ax.set_yticklabels([])
309320
ax.set_xticklabels([])
@@ -369,8 +380,13 @@ def tight_subplot(Nh, Nw, gap=(0.01, 0.01), marg_h=(0.13, 0.08), marg_w=(0.11, 0
369380
ax.text(0.01, 3.2, f'$x/h={x_l}$', transform=ax.transData, fontsize=14)
370381

371382
if i == 0:
372-
ax.set_ylabel('$z/h$', fontsize=16)
373-
ax.set_xlabel('<$uu$>/$U_0^2$', fontsize=16)
383+
ax.set_ylabel(r'$z/h$', fontsize=16)
384+
ax.set_xlabel(r'$\langle uu \rangle/U_0^2$', fontsize=16)
385+
# Add legend only to the first plot in this set
386+
legend_labels = ['J&D']
387+
for k in fds_key:
388+
legend_labels.append(k)
389+
ax.legend(legend_labels, loc='best', frameon=False, fontsize=10)
374390
else:
375391
ax.set_yticklabels([])
376392
ax.set_xticklabels([])
@@ -435,8 +451,13 @@ def tight_subplot(Nh, Nw, gap=(0.01, 0.01), marg_h=(0.13, 0.08), marg_w=(0.11, 0
435451
ax.text(0.01, 3.2, f'$x/h$={x_l}', transform=ax.transData, fontsize=14)
436452

437453
if i == 0:
438-
ax.set_ylabel('$z/h$', fontsize=16)
439-
ax.set_xlabel('<$ww$>/$U_0^2$', fontsize=16)
454+
ax.set_ylabel(r'$z/h$', fontsize=16)
455+
ax.set_xlabel(r'$\langle ww \rangle/U_0^2$', fontsize=16)
456+
# Add legend only to the first plot in this set
457+
legend_labels = ['J&D']
458+
for k in fds_key:
459+
legend_labels.append(k)
460+
ax.legend(legend_labels, loc='best', frameon=False, fontsize=10)
440461
else:
441462
ax.set_yticklabels([])
442463
ax.set_xticklabels([])
@@ -447,7 +468,9 @@ def tight_subplot(Nh, Nw, gap=(0.01, 0.01), marg_h=(0.13, 0.08), marg_w=(0.11, 0
447468

448469
fig, sp1 = tight_subplot(1, 4, gap=(0.01, 0.01), marg_h=(0.142, 0.055), marg_w=(0.108, 0.01))
449470
fig.suptitle(version_string,x=0.8,y=0.98,fontsize=14)
471+
450472
# --- 7. Wall-normal uw profiles ($\langle uw \rangle$) ---
473+
451474
for i in range(4):
452475
ax = sp1[i]
453476
x_l = x_loc[i]
@@ -502,12 +525,13 @@ def tight_subplot(Nh, Nw, gap=(0.01, 0.01), marg_h=(0.13, 0.08), marg_w=(0.11, 0
502525
ax.text(0.01, 3.2, f'$x/h$={x_l}', transform=ax.transData, fontsize=14)
503526

504527
if i == 0:
505-
ax.set_ylabel('$z/h$', fontsize=16)
506-
ax.set_xlabel('<$uw$/$U_0^2$', fontsize=16)
507-
# Add legend only to the first plot in this set (f7)
508-
legend_handles = ax.get_lines()[0:1] + h_leg
509-
legend_labels = ['J&D'] + fds_key
510-
ax.legend(legend_handles, legend_labels, loc='upper right', frameon=False, fontsize=10)
528+
ax.set_ylabel(r'$z/h$', fontsize=16)
529+
ax.set_xlabel(r'$\langle uw \rangle/U_0^2$', fontsize=16)
530+
# Add legend only to the first plot in this set
531+
legend_labels = ['J&D']
532+
for k in fds_key:
533+
legend_labels.append(k)
534+
ax.legend(legend_labels, loc='best', frameon=False, fontsize=10)
511535
else:
512536
ax.set_yticklabels([])
513537
ax.set_xticklabels([])

0 commit comments

Comments
 (0)