firemodels / fds

Fire Dynamics Simulator
https://pages.nist.gov/fds-smv/
Other
671 stars 626 forks source link

EVAC SmokeView output #9571

Closed JanVogelsang closed 3 years ago

JanVogelsang commented 3 years ago

@tkorhon1 @gforney Currently I am working on the evac-reader for the FDSReader python package. I stumbled across the code-fragment below in the dump.f90 file in the FDS source code while trying to figure out how to read in the binary prt5 files. The code seems to write all "classes of humans" in the SmokeView file (.smv), however when defining and using 3 different classes (e.g. adults, children, students) such as in the attached fds-case I only get a single "class of humans" entry in the SmokeView file, why is that?

stairs_evss_meshes.smv

CLASS_OF_HUMANS
 Human % % Human_props
      0.15294      0.25098      0.54510
  3
 HUMAN_COLOR
 color

 HUMAN_SPEED
 speed
 m/s
 HUMAN_DENSITY
 density
 1/m2

dump.f90

! Write out info about human types for evacuation

EVAC_ONLY4: IF (ANY(EVACUATION_ONLY)) THEN
   WRITE(LU_SMV,'(/A)') 'CLASS_OF_HUMANS'
   WRITE(LU_SMV,'(1X,A,A,A)') TRIM(EVAC_CLASS_NAME(1)),' % % ',TRIM(EVAC_CLASS_NAME(1)) // '_props'
   WRITE(LU_SMV,'(3F13.5)') REAL(EVAC_CLASS_RGB(:,1),FB)/255._EB
   WRITE(LU_SMV,'(I3)') EVAC_N_QUANTITIES
   DO NN=1,EVAC_N_QUANTITIES
      WRITE(LU_SMV,'(1X,A)') TRIM(OUTPUT_QUANTITY(EVAC_QUANTITIES_INDEX(NN))%NAME)
      WRITE(LU_SMV,'(1X,A)') TRIM(OUTPUT_QUANTITY(EVAC_QUANTITIES_INDEX(NN))%SHORT_NAME)
      WRITE(LU_SMV,'(1X,A)') TRIM(OUTPUT_QUANTITY(EVAC_QUANTITIES_INDEX(NN))%UNITS)
   ENDDO
   DO N=2,N_EVAC
      WRITE(LU_SMV,'(/A)') 'CLASS_OF_HUMANS'
      WRITE(LU_SMV,'(1X,A,A,A)') TRIM(EVAC_CLASS_NAME(N)),' % % ',TRIM(EVAC_CLASS_PROP(N))
      WRITE(LU_SMV,'(3F13.5)') REAL(EVAC_CLASS_RGB(:,N),FB)/255._EB
      WRITE(LU_SMV,'(I3)') EVAC_N_QUANTITIES
      DO NN=1,EVAC_N_QUANTITIES
         WRITE(LU_SMV,'(1X,A)') TRIM(OUTPUT_QUANTITY(EVAC_QUANTITIES_INDEX(NN))%NAME)
         WRITE(LU_SMV,'(1X,A)') TRIM(OUTPUT_QUANTITY(EVAC_QUANTITIES_INDEX(NN))%SHORT_NAME)
         WRITE(LU_SMV,'(1X,A)') TRIM(OUTPUT_QUANTITY(EVAC_QUANTITIES_INDEX(NN))%UNITS)
      ENDDO
   ENDDO
   [...]
ENDIF EVAC_ONLY4

stairs_evss_meshes.fds.txt stairs_evss_meshes.smv.txt

gforney commented 3 years ago

fds thinks you have errors in your input file. make changes so that fds doesn't say it is improperly setup. then we can go from there (or is there some other file that should be included?)

C:\Users\gforney\Downloads>fds stairs_evss_meshes.fds 6.67.6

Starting FDS ...

MPI Process 0 started on DESKTOP-KS6QUTG

Reading FDS input file ...

EVAC: Emesh 1 GroundFloor has 1 door flow fields EVAC: Emesh 2 FirstFloor has 1 door flow fields FDS+Evac pressure method : FFT FDS+Evac: Phase 3 in evacuation drill mode (EFF file is read in)

Fire Dynamics Simulator

Current Date : June 18, 2021 12:01:10 Revision : FDS6.7.6-0-g5064c500c-release Revision Date : Thu May 27 12:19:10 2021 -0400 Compiler : Intel ifort 2021.1 Compilation Date : Fri 05/28/2021 03:58 PM

MPI Enabled; Number of MPI Processes: 1 OpenMP Enabled; Number of OpenMP Threads: 4

MPI version: 3.1 MPI library version: Intel(R) MPI Library 2021.1 for Windows* OS

Job TITLE : case Job ID string : stairs_evss_meshes

ERROR: READ ERROR in CHID_evac.eff (MPI Process: 0, CHID: stairs_evss_meshes)

ERROR: FDS was improperly set-up - FDS stopped (CHID: stairs_evss_meshes)

gjaeger commented 3 years ago

There is no error. It's the input file for second run of an evacuation drill case.

The following settings are required for the first run (stairs_evss_meshes_first_run.fds as zip-file):

&MISC NO_EVACUATION             = .FALSE.,
      EVACUATION_INITIALIZATION = .TRUE.,
      EVACUATION_MC_MODE        = .FALSE.,
      EVACUATION_DRILL          = .FALSE.,
      EVACUATION_WRITE_FED      = .FALSE.,
      EVAC_TIME_ITERATIONS      = 50,
      EVAC_PRESSURE_ITERATIONS  = 50 /

The following settings are required for the second run (stairs_evss_meshes_second_run.fds als zip-file):

&MISC NO_EVACUATION             = .FALSE.,
      EVACUATION_INITIALIZATION = .FALSE.,
      EVACUATION_MC_MODE        = .TRUE.,
      EVACUATION_DRILL          = .TRUE.,
      EVACUATION_WRITE_FED      = .FALSE.,
      EVAC_TIME_ITERATIONS      = 50,
      EVAC_PRESSURE_ITERATIONS  = 50 /

Then it should run.

gforney commented 3 years ago

timo, can you take a look at this. fds should be outputting a CLASS_OF_HUMANS entry for each class defined in the input file

tkorhon1 commented 3 years ago

Hi!

I was really busy before the summer holidays. Now the work load is better and I have time to make FDS+Evac stuff up-to-date (FDS 6.7.6, Evac 2.6.0).

CLASS_OF_HUMANS is usually appearing just once in the .smv file. If you have some special avatars, like in the evac_smv_testcase1.fds, see below. Well, "class_of_humans" is not the best string for this, a better would have been "class_of_avatars" or something like that.

&EVAC ID = 'Human2ndFloor', NUMBER_INITIAL_PERSONS = 50, XB = 0.5,9.5, 0.5,9.5, 3.0,4.2 AVATAR_COLOR = 'BLACK', AVATAR_TYPE='Firefighter', PROP_ID='Firemen_props', KNOWN_DOOR_NAMES = 'LeftDoor2nd','RightDoor2nd','RightExit', KNOWN_DOOR_PROBS = 0.5,1.0,1.0, PERS_ID = 'Adult' /

&PROP ID='Firemen_props', SMOKEVIEW_ID(1:4)='human_fixed','human_altered_with_data', 'fire_fighter_with_gear','disk' /

Then you have in the .smv file:

CLASS_OF_HUMANS Human % % Human_props 0.15294 0.25098 0.54510 3 HUMAN_COLOR color

HUMAN_FED_DOSE FED

HUMAN_SPEED speed m/s

CLASS_OF_HUMANS Firefighter % % Firemen_props 0.15294 0.25098 0.54510 3 HUMAN_COLOR color

HUMAN_FED_DOSE FED

HUMAN_SPEED speed m/s

Wbr, Timo

tkorhon1 commented 3 years ago

And on other thing with the new Evac 2.6.0 and Smokeview: How to show the fire and evacuation results at the same time, when the calculation is done using 3 phases. You should hack the phase 2 (the fire calculation with MISC EVACUATION_WRITE_FED=.TRUE.) .smv file after you have done alse the step 3 run (MISC EVACUATION_MC_MODE=.TRUE.): Add (copy from the phase 3 smv file, see the place where they are in phase 3 file and put them in the same place in the phase 2 smv file: Well, I do not know if the place should be correct or not, I have not tested, I just put it there and it seemed to work there).

CLASS_OF_HUMANS Human % % Human_props 0.15294 0.25098 0.54510 3 HUMAN_COLOR color

HUMAN_FED_DOSE FED

HUMAN_SPEED speed m/s

AVATAR_COLOR 5 0 0 0 0 0 255 255 0 0 0 255 0 0 255 255

And the at the end of the phase 2 smv file: SLCC 1 # STRUCTURED & 0 100 0 80 4 4 ! 2 1 DoorAlgo_Db_1_2.sf SOOT DENSITY rho_C0.9H0.1 kg/m3 EVA5 1 0.5000 DoorAlgo_Dc_evac_1.prt5 1 1

I.e., add the phase 3 evacuation .prt5 files to the end of the file list in the phase 2 .smv file. And then you just open the phase 2 smv file using Smokeview and you should see the evacuation stuff there (the loading of evacuation etc.).

Well, this is in my ToDo list: Check that the 3 phase calculation can be made using same input file (having same CHID). One just changes the MISC accordingly for the 3 runs. So, I should check that the phase 1 and phase 3 uses file names that do not overwrite the phase 2 (fire calc.) files. The evacuation runs (phase 1+3) should have "CHID_evac" in their file names. It seems, that many files have this name already, but should check that all will have it, so no fire calculation file will be overwritten. Afte this, I'll check if I could modify the phase 3 .smv file so that it reads also the fire data (or modify the phase 2 file to read the evacuation prt5 files).

Wbr, Timo

JanVogelsang commented 3 years ago

Hello Timo, thanks for your answer. It's quite unfortunate that the class_of_humans refer to avatars, would it be possible that you also output all human classes in the .smv-file? I need some way to get all "PERS" defined in the .fds-file without having to can the fds-file itself (as there is no guarantee the fds-file has not been modified since running the simulation).

tkorhon1 commented 3 years ago

Well, would it be enough, if the PERS properties are written to the text file CHID_evac.out? The PERS namelist contains many values that are not used by Smokeview. Well, Smokeview does not need practically any PERS namelist values, so no need to put these in the .smv file. Better is to print out the person data in the CHID_evac.out file.

Now the initial positions and some other information of the agents (speed v0, diameter, Tpre, Tdet, etc.) are printed in the CHID_evac.out file. I could also put there an output on the PERS id (evac/entr have PERS_ID). This would be an ordinal number. And I'll print out the PERS line information (so that you can see the ordinal numbers of the PERS lines, that are, probably, in the order that the PERS lines are in the input file).

TimoK

JanVogelsang commented 3 years ago

The only reason why I need information of all defined PERS is to properly read in the prt5-file, as there output is written for each PERS individually and right now I do not have any information what data refers to which PERS. So pretty much all I need to interpret the prt5-files correctly is the order in which the PERS were defined in the fds-file as well as the name. All other information are completely optional. For me it doesn't really matter if I have to read in the information from the .smv-file or the _evac.out file, so sure, just output them there.

tkorhon1 commented 3 years ago

See evac.f90: N_EVAC = MAX(1,N_AVATAR_TYPE) I.e., N_EVAC is typically equal to one. It is the number of different AVATARS.

and dump_evac subroutine: ! Write the current time to the prt5 file, then start looping through the particle classes WRITE(LU_PART(NM)) REAL(T,FB)

WRITE(LU_PART(NM+NMESHES),'(ES13.6,1X,I4,1X,I4)')T, N_EVAC, PART_BOUNDFILE_VERSION

HUMAN_CLASS_LOOP: DO N = 1, N_EVAC
   ! Count the number of humans to dump out

This is loop over different AVATAR classes. Typically, one has just one avatar. The usage of many different avatars is not, probably, documented in the fds+evac manual. So, most users are just using the default avatar type.

      TA(NPP) = HR%ILABEL

The ILABEL is an unique ID number of the agent:

      WRITE (LU_EVACOUT,FMT='(I6,5F8.2,3F6.2,I6,I4,I4)') HR%ILABEL, &
           HR%X, HR%Y, HR%Z, HR%TPRE, HR%TDET,2.0_EB*HR%RADIUS, &
           HR%SPEED, HR%TAU, HR%GROUP_ID, HR%I_FFIELD, HR%COLOR_INDEX

So, you can find the agent information in the CHID_evac.out file using the ILABEL. If there are some agent properties missing in the above write statement (chid_evac.out), one can easily add them there. Well, the output might not be looking nicely (long lines), but this should not matter too much.

TimoK

tkorhon1 commented 3 years ago

I just committed Evac version 2.6.1. It has a keyword EVACUATION_ALL_STEPS=.TRUE. (or .FALSE.) on the MISC namelist. This way you need just one input file for a full fire+evacuation calculation. And you need not to edit the input file between the fire and evacuation runs. You just put that keyword in the input file and the run the same command line three times. The first time is evacuation initialization and it will write files named like CHID_evac (the CHID in the input file is change inside the source code to CHID_evac). Second run is the fire run (reads CHID_evac.xyz, writes CHID_evac.fed) and it uses just the CHID given in the input file. The third run is the evacuation calculation that uses the smoke information (CHID_evac.fed is read, also CHID_evac.eff is read). And its CHID is changed inside the source code to CHID_evmc. This way files of different steps do not overwrite each others. And also there is (after the 3rd run) the CHID_evmc.smv file that loads both the evacuation reults, also the fire results.

Note: It is now in the source code, so it will be in the next maintenance release.

tkorhon1 commented 3 years ago

Just a fast comment: The "old CHID_evac.out" evacuation related text output is renamed: 1) initialization phase: CHID_evac_info.out 3) evacuation MC phase: CHID_evmc_info.out

And a comment for " It's quite unfortunate that the class_of_humans refer to avatars, would it be possible that you also output all human classes in the .smv-file? I need some way to get all "PERS" defined in the .fds-file without having to can the fds-file itself (as there is no guarantee the fds-file has not been modified since running the simulation)."

Well, I could add a write of the (used) PERS namelist in the evacuation text output and also write there other information from the CHID.fds file that are read in and processed in the evac.f90. I just added this to my evac-todo-list. But this does not mean much, I do not have too much time to update fds+evac and there are many things on that todo-list waiting.

TimoK

tkorhon1 commented 3 years ago

FDS 6.7.7 maintenance realease will have the three Phase evacuation+fire calculation. There the Phase 3 ("MC evacuation run using CHID_evac.fed smoke information) generates CHID_evmc.smv that shows also the fire results.