Dispersion scenario
  • 05 Sep 2024
  • 6 Minutes to read

Dispersion scenario


Article summary

The following example walks through the steps required to set up a dispersion simulation. The example is based on a natural gas leak within a module where the geometry file is provided.

Simulation setup

  1. Create a directory and copy the example files

As FLACS-CFD creates a relatively large number of files, it is important to have a good bookkeeping system. It is recommended that you start with an empty directory.

On Linux:

  1. Create a new directory (replacing ‘DIRECTORY_NAME’ with your desired directory name):

    > mkdir DIRECTORY_NAME

  2. Move into this directory:

    > cd DIRECTORY_NAME

  3. Copy the files from the example folder (notice the space before the ”.”):

    > cp /usr/local/Gexcon/FLACS-CFD_24.1/doc/examples/ex04_dispersion/*200001* .

  4. Start up the FLACS-CFD RunManager:

    > run runmanager

On Windows:

  1. Open Windows Explorer

  2. Find the drive and directory where you want to create the working directory, right-click, choose New → Folder, and then type the name of the new directory

  3. Copy the files from C:\Program Files\Gexcon\FLACS-CFD 24.1\doc\examples\ex04_dispersion\∗20001∗ (*00001* means all files containing the text ”00001”).

  4. Start up the FLACS-CFD RunManager by clicking the icon


  1. Open the file in CASD

  1. In RunManager, open CASD by clicking the CASD icon or via Tools → CASD

  2. In CASD open the files via File Open and navigate to the directory you created in the section above

  3. Choose 200001.caj, and click Open


  1. Define monitor points and output variables

Define a regular pattern of 16 monitor points inside the module (X=3, 9, 15, 21; Y=2, 6 and; Z=2, 6). This can quickly be done by using the 'Arrange in grid' functionality.

  1. In Scenario Settings select Dispersion and ventilation in the Simulation type drop-down menu

  2. Expand the Monitor points tab

  3. Right click in the Monitor points tab and select Arrange in grid

  4. Measure MoleFractionFuel and VelocityMagnitude at monitor points by selecting all monitor points, right click, selecting 'Edit' and selecting the variables


  1. Single field 3D output

Measure the fuel mole fraction, velocity magnitude and velocity vectors:

  1. Expand the Single field 3D output tab

  2. Select MoleFractionFuel, VelocityMagnitude and VelocityVector from the list


  1. Simulation and output control

Set the simulation to run for 75 seconds and to output 3D data every 2.5 seconds.

  1. Expand the Simulation and output control tab

  2. Enter the following parameters:

    • NPLOT=-1

    • DTPLOT=2.5

    • CFLC=50

    • CFLV=1

    • TMAX=75



  1. Boundary conditions and wind setup

  1. Open the Wind Wizard via Run Wizard Wind Wizard in the Scenario Settings pane

  2. Set the Wind direction to 225 degrees (equivalent of a south-westerly wind where +Y is the north direction)

  3. Set a Wind speed of 2m/s

  4. Set the Pasquill class to F (stable conditions, usually used to represent calm, stable nighttime conditions)

  5. Set the Ground roughness to 0.01 (alternatively, this can be set in the Initial conditions tab)

  6. Check that Reference height is set to 10

  7. Click Finish

  8. Expand the Boundary conditions tab and check XHI, YHI and ZLO are set to NOZZLE and the remainder are set to WIND (these should be automatically set correctly after using the Wind Wizard)


  1. Initial conditions

  1. Expand the Initial conditions tab

  2. Set the following conditions for low turbulence and reasonable stability:

  • CHARACTERISTIC_VELOCITY=0.1

  • RELATIVE_TURBULENCE_INTENSITY=0.1

  • TURBULENCE_LENGTH_SCALE=0.01


  1. Gas composition and volume

  1. Expand the Gas composition and volume tab

  2. Click Edit volume fractions

  3. Using the Available Species list on the left hand side, select and specify a composition for natural gas (91% Methane, 7% Ethane and 2% Propane). Available species can be searched in the search bar on the top left. Available species can be selected by double clicking or selecting and using the arrow button in the menu.

  4. Set a pure gas release by setting the Equivalence ratios to ER0=1E+30, ER9=0

Note, the fuel region size should be zero (no gas cloud initially)


  1. Leak

  1. Open the Leak Wizard either via Run Wizard → Leak Wizard or by expanding the Leaks tab, right-clicking and selecting Leak wizard

  2. Specify a single leak at the position X=6m, Y=5.05m, Z=2.38m in the positive x direction

  3. Select a manual leak by checking the Manual entry box

  4. Click next and enter the leak parameters manually

  5. Start the leak at T=10 seconds (The start time is chosen so that the wind field can reach steady state prior to the start of the leak)

  6. Enter a leak duration of 40 seconds

  7. Set the leak area to 0.02m2

  8. Use a mass release rate of 4 kg/s

  9. Set the initial turbulence for the leak

  10. Relative turbulence intensity = 0.2

  11. Turbulence length scale = 10% of leak diameter = 0.014

  12. Set the temperature = 20 degrees Celsius


  1. Ignition

Specify an ignition time of 9999 seconds (an arbitrary high value after the end of the simulation so that FLACS-CFD does not try to ignite the gas cloud). Leave the ignition position unspecified.


  1. Gas monitor region

  1. Right-click into the scenario menu and enable the gas monitor region menu.

  2. Define the gas monitor region to cover the module: position (0,0,0) m and size (28, 12, 8) m.


  1. Grid

Firstly, create a grid using the quick grid functionality via Grid → Quick Grid or the shortcut Ctrl+G:

  1. Set the core domain to coincide with the module, i.e., minimum (0,0,0) m and maximum (28,12,8) m

  2. Set the cell size to 1.333 m

  3. Since the grid is uniform, this will lead to 21 × 9 × 6 grid cells in the core domain

  4. Set the stretched domain minimum values to (-32,-28,0) m and maximum as (60,40,32) m

  5. Set a maximum stretch factor at 1.2 (this should be the default value)

The grid needs to be refined around the leak to avoid strong dilution. This can be done using the automatic grid refinement tool in CASD, or can be done manually. The steps below use the automatic grid refinement tool.

  1. Expand the Leaks tab, right-click and select Refine grid

  2. Check the box to refine in the X direction and click OK

The grid cell containing the leak (the 'leak cell'), and one cell either side of it, should each have an area of (1.25 × 0.02)0.5 = 0.1581m2 in the plane of the leak. The leak cell may be elongated in the leak direction, provided that it's length in this direction is not more than 5 times it's length in the other directions. So, in the leak direction, the cell length should be between 0.158 m and 0.790 m (automatic grid refinement will set it to 0.158 m). This should be applied to the cell that contains the leak, and also to two cells in front of it.


  1. Runtime simulation control file (cc-file)

  1. Right-click and select Dump/load settings

  2. Expand the Dump/load settings tab

  3. Set two dump files, the first at 40 seconds and the second at 55 seconds

  4. Set NDUMP 1 TDUMP 40: right-click and add new row, double click on the command to change the type to TDUMP and enter 40

  5. Set NDUMP 2 TDUMP 55: add two new rows and enter the values


Running the simulation

  1. Running the simulation

  1. Open the RunManager window

  2. Select Add directory, then navigate to the location of the simulation files and press Select Folder

  3. Select the check box next to the simulation, press Parameters and check Parallel run to use multiple threads to speed up the computational time (the number of threads that can be used depends on your machine). Press OK.

  4. Select Simulate to run the simulation. Since a porosity file is not present, this will also automatically run the porosity calculator.


Analysing the simulation results

The most important result to analyse for dispersion scenarios is usually the gas cloud distribution. This can be studied in Flowvis by creating a 2D Cut Plane plotted in the flammable range for natural gas (i.e. between 5 % and 15 % natural gas).

  1. Open Flowvis

  2. Select the 2D Cut Plane button

  3. Select Add files and navigate to the .cgns file

  4. In the Variables pane on the right select MoleFractionFuel_3D and click OK

  5. Keep the plane at XY to view the gas concentration across the module from above

  6. Change the Z domain to 2.4 metres

  7. Under Appearance change the value range to LFL/UFL

  8. Drag the time slider to 40 seconds

  9. Using the sliders, change the domain extent for improved visualisation. The plot now shows the concentration of natural gas throughout the module at a height of 2.4m above the ground at a time of 40 seconds. The legend on the right hand side can be used to determine the concentration across the plane.

To find an appropriate ignition location for an explosion scenario, perform the following steps:

  1. Under Data Selection, select EquivalenceRatio_3D

  2. Determine where the gas cloud is close to stoichiometric conditions, i.e., where the equivalence ratio is 1

  3. In this case, the plot suggests an ignition position of (23, 4.5, 2.4) m


Was this article helpful?

What's Next