FireDynamics / fdsreader

Python reader for FDS data
GNU General Public License v3.0
44 stars 18 forks source link

Averaging FDS SLCF data #76

Open AlanZandie opened 4 months ago

AlanZandie commented 4 months ago

Good day,

I need to get the average velocity contour at a particular height across a car park from 200s to 300s, meaning I need to output averaged values rather than instantaneous data. Normally you can do that with DEVC using the STATISTICS_START/STATISTICS_END option in FDS then output it using fdsreader, but it does not work on SLCF which makes sense because they are an array of floating points. Could you please help me if you know a way to do so? P.S: I need the SLCF to be averaged because I need the cell-centred values, so I cannot go for other options like using DEVC. I have attached a screenshot of the code I'm using, could you please help me if you've got an idea? Screenshot (3227)

thank you

JanVogelsang commented 4 months ago

Hi Alan, I'm afraid I don't understand your problem. gsliuce_u (etc.) are arrays of values, so you can just average those values: np.mean(gsclice_u[200:300]).
Of course you would want to replace "200" and "300" with values that make sense in your case. For example:

start = slc_u.get_nearest_timestep(time=200)
end = slc_u.get_nearest_timestep(time=300)
average = np.mean(gslice_u[start:end])