Disclaimer : under construction

Tags :

  • open_source: PyPI, Gitlab.com, Readthedocs
  • tool: Social Distancing tool
  • CFD: Uses BARBATRUC CFD software for the airborne port of the project
  • Python package: available on PyPI

Muxu project

This project is embedded in the context of the epidemic of COVID-19 which is continuing to spread severely. Buildings, firms, subways, stores want to settle down rules for circulation of people to cut down the R0 coefficient of the epidemic. Studies are starting to show that the COID-19 might be born by micro drops emitted by people, which stay in the air and don’t fall on the floor:

The aim of the Muxu project is to bring together an agent based modeling open source software with a CFD software to be able to provide an open-source software, easy to install, ready for use on a standard machine without GPU.

How to adapt the ABM software into a software able to model social distancing?

Agent based modeling (ABM) softwares are usually for applications of evacuations of buildings following fires, explosions, accidents of various buildings or stadiums for example. During evacuation, all agents aim at the exit, which can be unique, they will therefore follow different trajectories which will at some meeting point merge and then follow the same trajectory towards the following exit.

In our context, we do not want to model evacuation, but standard circulation of people in a building and try to set up ground rules that can help diminish the rate of chance of being contaminated by a potential sick person and its wake, since it has been recently proven that COVID-19 can be airborne.

The idea is therefore to bring the following modifications into the CROMOSIM software to turn it into a distancing software: - Add the notion of temporary walls such as soft barriers - impose a maximum flow rate of particles at a checkpoint sector - Add the “one-way” notion

Choice of the the Agent based modeling software

The software chosen for the first applications is CROMOSIM, a full open-source and easy to install software for Agent Base Modeling, coded in Python.

CROMOSIM is able to output the positions, speeds, and gradients of particles particles going from a point A to a point B, thus representing the movement of a crowd evacuating from a stadium, crossing a busy neighborhood pathway (checkout this nice case study, here.

The geometry in which it studies the movement of the particles has to be in a png format, and it can be as complex as we want since there is a color code making the difference between walls and doors. It is as simple as that!

For example, a geometry as the old CERFACS building, with all its offices, patio, and hallways, can be input inCROMOSIM like this, and doors can be specified by their coordinates. After a first processing by the code, doors will have been understood and added on the png input.

Test case on CROMOSIM

To get things moving on a CROMOSIM test case, you need an image, preferably in the .png format as a background. For each group of people, you are going to specify a destination, each group can have a different destination.

The python module is based on the micro_social.py routine by Cromosim. It takes as input a background image and an input file in json or yml. This file is going to be read as a dictionary in the module, each dictionary key is a parameter of the run:

  • initialization of people
  • definition of groups
  • domains to define different spaces in the background image by their coordinates as shown here:

This configuration will lead to a configuration with a group of 10 people and a group of 1 people leaving the same initial location to aim at the exit door:

Parameters you can play with for the movement of your particles are:

  • for each group

    • nb: the number of people in the group,
    • domain: name of departure location
    • radius_distribution
    • velocity_distribution: normal or uniform
    • box: coordinates of the initial location of the group
    • destination: name of arrival location (defined in domains)
  • for people in a group

    • mass of a person
    • forces for defining repulsion and avoid overlapping
    • drag
    • velocity (you can input a uniform or normal distribution centered on a specified value)
  • for domains:

    • boundary coordinates
    • 2D lines based on the Matplotlib object to define doors (exits for example)

Choice of CFD software for coupling with the ABM software

The CFD software chosen so far for the project is Barbatruc, a computational fluid dynamics (CFD) package dedicated to training).

The CFD software is going to add the notion that each particle/person : - is emitting continuously an airborne marker, equivalent to a “smell”. - it putting the flow in motion through its drag.

The fluid mechanics will transport all the “smells” in the building according to the motions created either by the persons or, if any,the air conditioning system (not included in the present results).

What do we get from this?

During the simulation, each person is exposed to the “smell” of the others. By adding instantaneous expositions during the calculus, we obtain the cross exposition for each person, this looks like a matrix.

If we sum the exposition in one direction we get “How much a specific person was exposed?”. In the other direction “How much a specific person has exposed others?”.

The units are important. Here we choose an equivalent full exposition in vented area: If a person shows an exposition of 1 during the simulation, this was equivalent to walk into the footsteps of another person, very closely (less than 1 meter) in open air.

On one reference configuration, we can identify “super-exposers” and “super-exposed” persons. In other words, this analysis identify the persons who created the biggest risks.

By comparing two configurations, we can see if the modified version is improving the exposition.

In the following example, the mean equivalent exposition goes down from 0.868 to 0.272 for this single realization. This would mean, in this case, that the risk induced by one-ways circulation is 70% lower than the reference circulation.

Around the project


This prototype has not been validated and was created to study the feasibility and illustrate the approach. We do not claim any expertise in ABMs and will contact experts on the field if this project goes further. The CFD solver is extremely barebones and should only be seen as the reduced order model of a real CFD that will need to be tuned. Both drag and sources terms will require further investigations. Finally, the CFD part will require high fidelity 3D computation to validate the approach and feed the reduced order model.

Our added value to this kind of project

  • Being able to bring the fluid motion part to an ABM software to create the prototype of a decision-making software for social distancing rules.
  • Our knowledge of Python packaging, code coupling and CFD
  • Our ability to create practical tools for post-processing.

Potential clients of this software

Any client running a closed environment, basically.

  • City halls
  • Stores
  • Aircraft companies
  • Public transport companies
  • Any private company

The Muxu team

The Muxu project did not benefit from a specific funding : it was a recreational pet project during 2020 summer.

the muxu repository is ultra short : - 80 lines (cfd) - 46 lines (analysis) - 500 lines (ABM)

The Muxu team gathers people from the COOP team at CERFACS: The Project is paused, waiting for future research initiative inside or outside Cerfacs.

  • Antoine Dauptain, Senior Researcher/Engineer at CERFACS,
  • Théo Defontaine, Research Engineer at CERFACS,
  • Thibault Duranton, Research Engineer at CERFACS,
  • Thibault Gioud, Research Engineer at CERFACS,
  • Elsa Gullaud, PostDoctoral Researcher at CERFACS,
  • Corentin Lapeyre, Research Scientist at CERFACS,
  • Tamon Nakano, Postdoctoral Researcher at CERFACS
  • Gabriel Staffelbach, Senior Researcher at CERFACS.

Many thanks to B. Maury (ENS Ulm & Univ. Paris-Saclay) and S. Faure (CNRS) for providing such a nicely packaged ABM tool to the community.

Like this post? Share on: TwitterFacebookEmail

Elsa Gullaud After a phD in Acoustics, she is now doing a postdoc in data science at CERFACS-

Keep Reading



Work In Progress


Stay in Touch