Coder Social home page Coder Social logo

aamks / aamks Goto Github PK

View Code? Open in Web Editor NEW
13.0 5.0 6.0 24.53 MB

Probabilistic fire risk assessment framework

Home Page: https://aamks.apoz.edu.pl

License: GNU General Public License v3.0

Python 67.53% CSS 0.80% Shell 1.42% PHP 15.37% JavaScript 11.44% PLpgSQL 0.43% Dockerfile 0.06% HTML 2.95%
fire safety evacuation evacuation-planning simulation fire-safety monte-carlo-simulation risk-assessment risk-models cfast

aamks's Introduction

alt text

Aamks is an open source, web-based platform for assessing the fire safety of humans in buildings. Basic concept relies on combined Mont-Carlo simulations of fire and evacuation. Aamks runs multiple fire simulations (CFAST) and evacuation simulations (Aamks.Evac) and then evaluates the results. In each simulation humans are moving across the building and are affected by fire and smoke.

Aamks workflow:

- user defines the project variables

	- NUMBER_OF_SIMULATIONS=N
	- BUILDING_CATEGORY="office"
	- ...

- user creates the geometry with Aamks.Apainter in Google Chrome
- Aamks creates N of CFAST and Aamks.Evac input files 
- Aamks dispatches and manages the simulations in a network
- Aamks collects the simulations results in a Postgres database
- Aamks compiles the N results into distributions for the report
- Aamks.Animator displays the animations based on the simulations

For the user Aamks is web-based so doesn't need to be installed. On the backend Aamks requires Linux, Postgres, Apache and Python. Aamks uses such technologies as Navmesh and RVO2.

More information can be found on wiki.

You can test Aamks on Fire Univerity's server. No computational resources are available there, so you can go through the preprocess only and get familiar with the tool.

Feel free to contact us.

aamks's People

Contributors

akrasuski avatar aleksanderkamienski avatar fliszer avatar gdzieniegdzie avatar kamil0301 avatar kowalskiw avatar mimooh avatar mmackiewicz97 avatar stanley998 avatar tomaszmwrobel avatar zarooba01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aamks's Issues

Cfast freezes

Cfast freezes. As a result, the simulations do not run and, for example, when I set the number of simulations to 50 simulations, Aamks will stop at, say, the tenth simulation. This makes it difficult to perform a large number of simulations, because, for example, with 160 simulations done, I have 260 empty ones (they didn't run because of CFASTA suspension).

problem when running many symulations at once

When you run many simulations at once (e.g. 300) it happens that the worker simulations complete successfully and the _anim.zip file is uploaded to the server, but the simulations table in the postgres database is updated incorrectly or not updated at all ( dcbe_time is still null, so the view generated by simulations.php does not consider the end of this simulation at "Complete: xxx of yyyy ").

Nn my case there were 12 workers available on 2 computers and the above happened 2 times.

RVO2 - broken cmake (instalation)

File "/Python-RVO2/setup.py", line 20, in run
subprocess.check_call(['cmake', '--build', '.'], cwd=build_dir)
File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.']' returned non-zero exit status 1.

Network manager

gearman is a complex network manager. The goal is to switch to an easier solution (external or our own) that provides fast and reliable communication within the cluster network. Detailed tasks to be specified.

Staircase module

Implement staircase module (some progress has been already done by @mmackiewicz97). Main goals:

  • fix smoke transfer function;
  • introduce vertical evacuation in staircase (mixing flows and compatibility with existing evac module).

OUTPUT, SLICE

Addition of SLCF in Autocad and export is working properly.
But there is an error at the website. It is possible to use "Add SLCF" and add SLCF1, SLCF2... But the slices are located only in one place in the 3d model (Autocad). Also there is no possibility of editing the slices from the website.

Alarming time from CFAST

How long should the pre-evac time last? Pre-evacuation time is based on two factors here: detection time and alarming time. Detection time should be taken from CFAST. Alarming time should be taken from distribution.

Wrong z-coordinate for fire in cfast

Z-coordinate for firein cfast.in (line FIRE) is badly calculated. Z should be calculated with relation to local room coordinates, instead of global building coordinates.
Please change also the ids for staircases.

Cfast on stairs and partition_query.py problem

When running fire simulation in a staircase, partition_query.py divides the staircase into cuboids for each floor. partition_query.py returns zero concentrations of poisonous substances for staircases located on levels higher than the first above-ground level (sX.1, sX.2, ....). The principle of operation of the program should be improved so that the smoke spreads properly throughout the staircase and it is possible to collect the right concentrations of gases using partition_query.py.

Errors logging by workers

Error logging by workers. I do not have error logs in /tmp/aamks when the worker works locally and how to make it log errors somewhere? This is needed to determine what went wrong in the workers.

Endless loop

worker.py :284 time.sleep(1) probably couses freezing simulations

problem with envvariables in worker.py

image

There is a problem with environment variables AAMKS_WORKER, AAMKS_PATH, AAMKS_SERVER in worker.py.

The program has a problem with downloading environment variables from ~/.bashrc as user aamks (gearman processes on workers are started by aamks user) . Therefore, the values ​​at the moment are entered in the program code.

Placing virtual compartments into CFAST

In cfast.in virutal compartments are defined. Is it new problem or I lost something during migration to CFAST 7.5?

!! SECTION DOORS AND HOLES
&VENT TYPE = 'WALL', ID = 'd21', COMP_IDS = 'c7', 's5.1', WIDTH = 0.9, TOP = 5.5, BOTTOM = 3.5, OFFSET = 22.89, FACE = '1', CRITERION = 'TIME' T = 0 F = 1 /
&VENT TYPE = 'WALL', ID = 'd27', COMP_IDS = 'c9', 's5.2', WIDTH = 0.9, TOP = 9.0, BOTTOM = 7.0, OFFSET = 22.88, FACE = '1', CRITERION = 'TIME' T = 0 F = 1 /
&VENT TYPE = 'WALL', ID = 'd25', COMP_IDS = 'c9', 'r10', WIDTH = 0.9, TOP = 2.0, BOTTOM = 0.0, OFFSET = 14.75, FACE = '1', CRITERION = 'TIME' T = 0 F = 1 /

41 !! SECTION NATURAL VENT
&VENT TYPE = 'CEILING', ID = 'b1', COMP_IDS = 'OUTSIDE', 's1.1', AREA = 6.0, SHAPE = 'SQUARE', OFFSETS = 3.4, 2.85, CRITERION = 'TIME' T = 0,90 F = 0,0 /
&VENT TYPE = 'CEILING', ID = 'b2', COMP_IDS = 'OUTSIDE', 's5.2', AREA = 6.12, SHAPE = 'SQUARE', OFFSETS = 3.62, 5.05, CRITERION = 'TIME' T = 0,90 F = 0,1 /

Feature requests

Just to document the features we discussed this week:
0) Identify test runs (1 simulation) and give higher priority.

  1. Project / scenario copy-to-new (avoid using text saves and typing)
  2. Project / scenario download / upload
  3. Scenario reset = remove previous calculations from the database
  4. Button for stopping the calculation (this is big task with Gearman)
  5. Scenario 'Submit' could be just 'Save'
  6. Indication that the job is running. Now students press 'Launch' again when they think that they failed to start the simulation.
  7. Simulation results database download (.csv)
  8. Event tree FED branch logic revisiting. No suggestion yet.
  9. Animator should default to the latest finalized simulation, not OnEnd()
  10. Scenario setup parameters could be grouped under sub-headings (General, Safety systems, Evacuation, Fire)
  11. Move indoor temperature and humidiy under 'Advanced' inputs.

Worker cannot use os.environ parameters

Worker doesn't use environmental parameters for project definition. It obtains this as an argument (URL) for worker.py file. Hence such a definition of conf.json doesn' t work.

partition_query.py:
self.project_conf=self.json.read('{}/conf.json'.format(os.environ['AAMKS_PROJECT']))

If it is necessary worker.py file has defined conf.json. The question is whether it should be passed or not.

Apainter is not loading properly

Warning: file_get_contents(../../inc.json): failed to open stream: No such file or directory in /var/www/html/aamks/apainter/index.php on line 6

Notice: Trying to access array offset on value of type null in /var/www/html/aamks/apainter/index.php on line 11

Warning: Invalid argument supplied for foreach() in /var/www/html/aamks/apainter/index.php on line 11

Notice: Trying to access array offset on value of type null in /var/www/html/aamks/apainter/index.php on line 14

Warning: Invalid argument supplied for foreach() in /var/www/html/aamks/apainter/index.php on line 14

The error was raised while trying to access Apainter after fresh local installation of Aamks. I was following this instruction: https://blogs.aalto.fi/fire/aamks/installing-aamks/ and run both server and worker installation on my Ubuntu 20.04.5 machine.

It seems like Apainter script is looking for this inc.json file in /var/www/ rather than in /usr/local/aamks/ (where it actually is). Linking seems was done according to the instruction I mentioned.

COMPA sorting for vents association

There is something wrong with cfast_importe.py function _recalculate_vents_from_to
As the output from this function should be vent_from vent_to configuration, where vent_from should have lower id that vent_to, i.e.:
r1, c3
However the output from this function is:
&VENT TYPE = 'WALL', ID = 'd13', COMP_IDS = 'a6', 's1', WIDTH = 0.9, TOP = 5.5, BOTTOM = 3.5, OFFSET = 6.08, FACE = 'RIGHT', CRITERION = 'TIME' T = 0 F = 1 /
This makes the further problem that TOP and BOTTOM of the vent is associated to wrong compartment. In the example above, the vent TOP and BOTTOM is relative to a6 compartment and should be relative to s1

Recast compilation terminated

Calling bash worker_install.sh -i results in the following error:

In file included from Recast/Detour/Source/DetourNavMesh.cpp:27:
Recast/Detour/Include/DetourAssert.h:35:10: fatal error: boost/python.hpp: No such file or directory
   35 | #include <boost/python.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
mkdir: cannot create directory ‘/home/aamks_users’: File exists

I also give a try to launch calculations from GUI. Obviously it finished with missing recast module:

Aamks is halting on error:
Traceback (most recent call last): File "/usr/local/aamks/aamks.py", line 5, in from manager.init import OnInit, OnEnd File "/usr/local/aamks/manager/init.py", line 16, in from geom.nav import Navmesh File "/usr/local/aamks/geom/nav.py", line 10, in import _recast as dt ModuleNotFoundError: No module named '_recast'

That installation was made on Ubuntu 22.04.1 LTS set up on VMware Workstation 16.

levels

In FDS, I can't add more than 2 extra levels

Wall thickness problem.

It seems that thick walls cause problem with agent movement. Agents go between two part of a wall and stack. Below some example with an agent stacked between wall parts.
zrzut ekranu z 2018-06-29 19-08-42

List of doors

A list of exit doors needs to be added to the evac.json file. The list should distinguish at least two types of exit doors: main and alternative. I need this list in order to point the navmesh destination points.

Bad fire definition in cfast.in

Cfast does not work in cm. It requires meters. Problem with cm I can fix myself, however, in the fire definition, the absolute coordinates were used instead of relative to the room of fire origin.

!! FIRE,compa,x,y,z,fire_number,ignition_type,ignition_criterion,ignition_target,?,?,name
FIRE,1,79700,153000,5000,1,TIME,0,0,0,0,medium

Apainter allows drawing on negative coordinates

Apainter allows elements to be drawn in negative coordinates, which then passes negative compartment position values to CFAST, causing errors (CFAST does not allow negative position values)

Wrong value of heat of combustion is passed to CFAST; the value specified in the Aamks simulation parameters by default is a continuous distribution between 16400 and 27000 (kJ/kg) but the value in the cfast.in files is 1/1000 of the value specified i.e. between 16.4 and 27

Attached are two input files with wrong parameters generated by Aamks.

sim2_cfast.txt
sim9_cfast.txt

Aamks loses evac_cluster variable

After updating or just saving the parameters of the project, Aamks loses the evac_cluster variable. It is no more available in conf.json file.
Zrzut ekranu z 2019-10-08 14-46-22

KeyError: 'HGT'

Normal exit from CFAST
Traceback (most recent call last):
File "/usr/local/aamks/evac/worker.py", line 486, in
w.local_worker()
File "/usr/local/aamks/evac/worker.py", line 475, in local_worker
self.do_simulation()
File "/usr/local/aamks/evac/worker.py", line 271, in do_simulation
i.do_simulation(step)
File "/usr/local/aamks/evac/rvo2_dto.py", line 338, in do_simulation
self.set_goal()
File "/usr/local/aamks/evac/rvo2_dto.py", line 178, in set_goal
goal = self.nav.nav_query(src=position, dst=self._find_closest_exit(e), maxStraightPath=32)
File "/usr/local/aamks/evac/rvo2_dto.py", line 82, in _find_closest_exit
if self._next_room_in_smoke(evacuee, path) is not True:
File "/usr/local/aamks/evac/rvo2_dto.py", line 112, in _next_room_in_smoke
od_next_room = self.smoke_query.get_visibility(path[1])
File "/usr/local/aamks/fire/partition_query.py", line 264, in get_visibility
hgt = conditions['HGT']
KeyError: 'HGT'

LAYERS (FDS)

I think it is worthwhile to implement layer: !FDS_OBST [gate_fire] ()
Fire gates are closed after fire alarm system activation like smoke curtains. But they have different thermal properties.
If there is to many default layers, the removal of: !FDS_OBST [glass_fire] () and !FDS_OBST [door_wood] () may be considered.

Removing a project while simulations are running locks user out of account

Two students reported the described problem: if they launched simulations, but did not wait for all simulations to finish (or end by other means) before deleting the project, they were unable to access their Aamks account on the server after logging out. One student tried to reset their password , but it did not work.

The reason for deleting the project after launching the simulations is that the students erroneously believed the simulations to have crashed, while the simulations were actually either stuck or simply took a long time to finish.

As an interim solution, I advised students to not delete any projects after launching simulations, unless I had restarted Gearman first and terminated all jobs on the workers.

Testing environment

To create (or fix) and maintain testing environment. Just a general issue, to be specified.

Index out of range rvo2dto.py

Index out of range problem in rvo2dto.py file. It appeared in random simulations and it happened when I added a lot of obstacles in geometry. An empty list was passed to the function and then there was a reference to the index of the first element of the list that was not there. Unfortunately, I do not have a saved line of code in which the program crashed or screenshots showing the problem.

NAVMESH error

The path is suddenly cut when it goes through the wall in some cases. It happens when the path is expected to lead outside the building.

Reported by @akrasuski

rvo2 not respecting navmesh?

After m.aamksClearProjects launch navmesh demo. Notice how the evacuees prefer d5 over d6, which is a not what navmesh suggests.

Results presentation (GUI)

Results presentation should be improved. Main goals:

  • design user-friendly layout;
  • introducing sensitivity analysis to results ("Simulations") section in GUI;
  • #135
  • #134
  • #133

Greedy cut in openning

Increasing the width of doors used for cutting in walls caused the problem of gaps in walls. You forgot that HOLE uses the same schema. Finally when holes cut in walls they make a gap and agents use this gap to escape from building :). See attached screen.
zrzut ekranu z 2018-07-12 11-46-52

Scaling doesn't work

Scaling the pdf regarding the instruction in help doesn't work. You can draw a rectangle, however, it doesn't react to changes in scaling, opacity or invert color.

MVENT room_from

Information needed in aamks_geom regarding the room where the MVENT is paced. Currently all values related to room are set to None

broken matplotlib

Matplotlib created a temporary config/cache directory at /tmp/matplotlib-pzs4ts9h because the default path (/var/www/.config/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing. Traceback (most recent call last): File "/usr/local/aamks/results/beck.py", line 14, in from ete3 import Tree #, TreeStyle, TextFace ModuleNotFoundError: No module named 'ete3'

What is the use of the mdoule ete3?

Terminal doors

Termination of the doors doesn't work. Termination is neither automatically defined nor by manual selection as primary or secondary.

polygon obstacles

Worker.py fails at processing polygon obstacles. See navmesh demo.

Broken recast (instalation)

File "/usr/local/aamks/evac/rvo2_dto.py", line 78, in _find_closest_exit
path = self.nav.nav_query(src=self.evacuees.get_position_of_pedestrian(evacuee), dst=(x, y), maxStraightPath=999)
File "/usr/local/aamks/geom/nav.py", line 121, in nav_query
status, out = query.findNearestPoly(startPos, polyPickExt, filtr)
AssertionError: m_nav

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.