- 05 Sep 2024
- 6 Minutes to read
Dispersion scenario
- Updated on 05 Sep 2024
- 6 Minutes to read
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
Create a directory and copy the example files
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:
Create a new directory (replacing ‘DIRECTORY_NAME’ with your desired directory name):
> mkdir DIRECTORY_NAME
Move into this directory:
> cd DIRECTORY_NAME
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* .
Start up the FLACS-CFD RunManager:
> run runmanager
On Windows:
Open Windows Explorer
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
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”).Start up the FLACS-CFD RunManager by clicking the icon
Open the file in CASD
Open the file in CASD
In RunManager, open CASD by clicking the CASD icon or via Tools → CASD
In CASD open the files via File → Open and navigate to the directory you created in the section above
Choose 200001.caj, and click Open
Define monitor points and output variables
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.
In Scenario Settings select Dispersion and ventilation in the Simulation type drop-down menu
Expand the Monitor points tab
Right click in the Monitor points tab and select Arrange in grid
Measure MoleFractionFuel and VelocityMagnitude at monitor points by selecting all monitor points, right click, selecting 'Edit' and selecting the variables
Single field 3D output
Single field 3D output
Measure the fuel mole fraction, velocity magnitude and velocity vectors:
Expand the Single field 3D output tab
Select MoleFractionFuel, VelocityMagnitude and VelocityVector from the list
Simulation and output control
Simulation and output control
Set the simulation to run for 75 seconds and to output 3D data every 2.5 seconds.
Expand the Simulation and output control tab
Enter the following parameters:
NPLOT=-1
DTPLOT=2.5
CFLC=50
CFLV=1
TMAX=75
Boundary conditions and wind setup
Boundary conditions and wind setup
Open the Wind Wizard via Run Wizard → Wind Wizard in the Scenario Settings pane
Set the Wind direction to 225 degrees (equivalent of a south-westerly wind where +Y is the north direction)
Set a Wind speed of 2m/s
Set the Pasquill class to F (stable conditions, usually used to represent calm, stable nighttime conditions)
Set the Ground roughness to 0.01 (alternatively, this can be set in the Initial conditions tab)
Check that Reference height is set to 10
Click Finish
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)
Initial conditions
Initial conditions
Expand the Initial conditions tab
Set the following conditions for low turbulence and reasonable stability:
CHARACTERISTIC_VELOCITY=0.1
RELATIVE_TURBULENCE_INTENSITY=0.1
TURBULENCE_LENGTH_SCALE=0.01
Gas composition and volume
Gas composition and volume
Expand the Gas composition and volume tab
Click Edit volume fractions
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.
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)
Leak
Leak
Open the Leak Wizard either via Run Wizard → Leak Wizard or by expanding the Leaks tab, right-clicking and selecting Leak wizard
Specify a single leak at the position X=6m, Y=5.05m, Z=2.38m in the positive x direction
Select a manual leak by checking the Manual entry box
Click next and enter the leak parameters manually
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)
Enter a leak duration of 40 seconds
Set the leak area to 0.02m2
Use a mass release rate of 4 kg/s
Set the initial turbulence for the leak
Relative turbulence intensity = 0.2
Turbulence length scale = 10% of leak diameter = 0.014
Set the temperature = 20 degrees Celsius
Ignition
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.
Gas monitor region
Gas monitor region
Right-click into the scenario menu and enable the gas monitor region menu.
Define the gas monitor region to cover the module: position (0,0,0) m and size (28, 12, 8) m.
Grid
Grid
Firstly, create a grid using the quick grid functionality via Grid → Quick Grid or the shortcut Ctrl+G
:
Set the core domain to coincide with the module, i.e., minimum (0,0,0) m and maximum (28,12,8) m
Set the cell size to 1.333 m
Since the grid is uniform, this will lead to 21 × 9 × 6 grid cells in the core domain
Set the stretched domain minimum values to (-32,-28,0) m and maximum as (60,40,32) m
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.
Expand the Leaks tab, right-click and select Refine grid
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.
Runtime simulation control file (cc-file)
Runtime simulation control file (cc-file)
Right-click and select Dump/load settings
Expand the Dump/load settings tab
Set two dump files, the first at 40 seconds and the second at 55 seconds
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
Set NDUMP 2 TDUMP 55: add two new rows and enter the values
Running the simulation
Running the simulation
Running the simulation
Open the RunManager window
Select Add directory, then navigate to the location of the simulation files and press Select Folder
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.
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).
Open Flowvis
Select the 2D Cut Plane button
Select Add files and navigate to the .cgns file
In the Variables pane on the right select MoleFractionFuel_3D and click OK
Keep the plane at XY to view the gas concentration across the module from above
Change the Z domain to 2.4 metres
Under Appearance change the value range to LFL/UFL
Drag the time slider to 40 seconds
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:
Under Data Selection, select EquivalenceRatio_3D
Determine where the gas cloud is close to stoichiometric conditions, i.e., where the equivalence ratio is 1
In this case, the plot suggests an ignition position of (23, 4.5, 2.4) m