FireDynamics / fdsreader

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

SCLF Data not Accurate #73

Open briannak7 opened 5 months ago

briannak7 commented 5 months ago

Hey all,

I commented on issue #71 regarding the particle data not showing as expected, but found a similar issue regarding slice data.

Using the same simulation as described in issue #71, I tried to read in the slice data. Using the 'TEMPERATURE' quantity I have the following slice values at z = 0.1, 0.2, and 0.5:

print(sim.slices[1].times)
print(sim.slices[4].times)
print(sim.slices[7].times)

[13.02347] [22.20007] [20.85061]

Each slice only has data for one time step, and I'm looking to grab the data for each time step.

When grabbing the data for the available time step for sim.slices[1], it is outputting an array of size (1, 181, 1001), however, all values are the same: 14.03416252. The same data are seen when pulling this data from the subslices of the slice.

This issue is consistent with all 'TEMPERATURE' and 'HRRPUV' slices.

I'm wondering if perhaps I'm pulling the data incorrectly or if maybe this issue is related to the update in FDS. As a repeat from my comment on issue #71:

I have a suspicion that this error may be related to an update with FDS and found an issue on firemodels/fds that may point to the specific update: https://github.com/firemodels/fds/issues/12529

FDS version used:

Current Date : March 12, 2024 09:58:39 Revision : FDS-6.8.0-1630-gbc9da78-master Revision Date : Tue Feb 27 12:28:41 2024 -0500 Compiler : GCC version 10.2.0 Compilation Date : Feb 28, 2024 08:59:25

I apologize if this is repetitive of the particle data issue. I wanted to be sure to bring it to attention in case it could provide more relevant information.

If this is something that you do not feel is worth it to create a bug report and fix, can we leave the issue open while I/my team look into how to potentially fix this? If you could provide us with any information on where in the files to read in these data, that would be great!

Thank you for all the work you have done on fdsreader!

JanVogelsang commented 5 months ago

What exactly are you not expecting in the output you are seeing? Would you expect that each slice object contains data for multiple timesteps, or would you expect different values per slice? While uniform values per slice are unlikely, it's by no means impossible. Does SmokeView show different results?
I don't think the FDS update you linked actually changed how regular data is output, but just changed debug output, which (I would suppose) is different from regular data and not output unless explicitly specified.
Could you send me the FDS case (.fds file), if possible a minified version of it which still is incorrectly read by the fdsreader? Feel free to debug on your own as well, reading output data from slices is quite simple (compared to particles for example), you can find the corresponding function for SubSlices (data is always output per mesh, thus read in per SubSlice) here: https://github.com/FireDynamics/fdsreader/blob/master/fdsreader/slcf/slice.py#L110

briannak7 commented 5 months ago

I'm expecting to see slice data for each timestep in the simulation. The data itself will be uniform for some timesteps, but once ignition begins I expect to see different temperature values at the fire front.

We have a mini version of the simulation, but it looks like FDS is about to push an update sometime tomorrow. I want to check how the data looks once run on this before giving a detailed update on this issue.

briannak7 commented 5 months ago

After updating to the newest official release of FDS, I've found that the issue still persists. I ran the same mini simulation on FDS 6.8.0 and the new 6.9.0. The slice data from the 6.8.0 version seemed to have data for each timestep as expected. With the new release, I'm seeing data for one timestep like above.

For the mini simulation I've attached, the temperature slice data outputs as follows:

data, coords = slice[5].to_global(return_coordinates=True)

data.shape

(1, 11, 241)

This is consistent with all slices where quantity = 'TEMPERATURE'.

Again, I expect to see temperature data for each timestep in the slices from -30 to 30. The data should begin with uniform values until the fire begins at time = 0.

I know there was another issue regarding boundary file data that was related to the nightly build and closed. However, this issue is seen with FDS 6.9.0.

boundary = sim.meshes[0].get_boundary_data("TOTAL HEAT FLUX")

# fdsreader returns data in (time, x, y) (this makes array operations difficult)
data = boundary.data[boundary.orientations[0]].data

data.shape

(1, 11, 241)

The boundary data also seems to only output data for one timestep rather than all timesteps.

I appreciate any feedback, and once again, I am happy to work on a bug fix for this.

mini_sim_1_mesh.zip