Skip to content

Commit 3eabffd

Browse files
authored
Merge pull request #15519 from mcgratta/master
FDS Validation scripts: Minor edits
2 parents 17066d9 + 1cb290d commit 3eabffd

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed
Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,43 @@
1-
"""
2-
McGrattan
3-
10-29-2019
4-
Crown_Fires.py
51

6-
Read the Crown_Fires *_cat_devc.csv files and determine the rate of spread based on the time history of front position.
7-
Write the results to a file that will be plotted via dataplot.m.
8-
"""
2+
# Read the Crown_Fires *_cat_devc.csv files and determine the rate of spread based on the time history of front position.
3+
# Write the results to a file that will be plotted via dataplot.py.
94

105
import numpy as np
116
import pandas as pd
127
import os
138

14-
# Parameters
159
outdir = '../../../out/Crown_Fires/'
1610

17-
# Get only *_cat_devc.csv files (like MATLAB dir)
1811
file_list = [f for f in os.listdir(outdir) if f.endswith('_cat_devc.csv')]
19-
file_list.sort() # optional, to keep consistent ordering with MATLAB
12+
file_list.sort()
2013

2114
wind_speed = []
2215
slope = []
2316

2417
for fname in file_list:
2518
full_path = os.path.join(outdir, fname)
2619

27-
# Read CSV (skip 2 header rows like MATLAB importdata)
28-
M = pd.read_csv(full_path, skiprows=2)
20+
M = pd.read_csv(full_path, skiprows=2, header=None)
2921
M_data = M.to_numpy()
3022

31-
# Extract rows satisfying conditions (700<=col2<=900, 30<col1<300)
23+
# Extract rows satisfying conditions (700<=x<=900, 30<Time<300)
3224
indices = np.where(
3325
(M_data[:, 1] >= 700) &
3426
(M_data[:, 1] <= 900) &
3527
(M_data[:, 0] > 30) &
3628
(M_data[:, 0] < 300)
3729
)[0]
3830

39-
# Mean wind speed (col3)
31+
# Mean wind speed (U10)
4032
wind_speed.append(np.mean(M_data[indices, 2]))
4133

42-
# Polyfit slope for col2 vs col1
34+
# Polyfit slope for x vs Time
4335
p = np.polyfit(M_data[indices, 0], M_data[indices, 1], 1)
4436
slope.append(p[0])
4537

46-
# Write output file
4738
with open(os.path.join(outdir, 'ROS.csv'), 'w') as fid:
4839
fid.write('km/h,m/min\n')
4940
fid.write('U,ROS\n')
5041
for u, s in zip(wind_speed, slope):
5142
fid.write(f'{3.6*u:4.1f},{60*s:6.2f}\n')
43+

Utilities/Python/scripts/FHWA_Tunnel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
# For each experiment, make a contour plot of the extent of a single temperature contour at each time during the experiment
3+
24
import numpy as np
35
import pandas as pd
46
import matplotlib.pyplot as plt
@@ -21,8 +23,6 @@
2123
single_level = [50]
2224
setpoint = [10000, 400, 399, 338, 240, 322, 390, 420, 360, 10000, 10000]
2325

24-
# For each experiment, make a contour plot of the extent of a single temperature contour at each time during the experiment
25-
2626
for k in range(11): # Experiments
2727

2828
fig = fdsplotlib.plot_to_fig(x_data=[5.5,5.5], y_data=[0,15], marker_style='k--',

Utilities/Python/scripts/Heskestad_Flame_Height_2.py

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

2+
# Plot results of the Heskestad_Flame_Height cases against various experimental correlations
3+
24
import numpy as np
35
import matplotlib.pyplot as plt
46
import pandas as pd

0 commit comments

Comments
 (0)