# Your first FDS Simulation

The following FDS guide will teach you how to run your first FDS simulation.

Here is a list of the main chapters of this tutorial:

## 1. Introduction

This video shows the results of the Fire Dynamics Simulator job you are about to execute:

This Fire Dynamics Simulator tutorial is about the basic functions of the program. If you are an experienced user this guide will constitute a useful recap.

The aim of the FDS simulation we are about to create is to measure the air temperature near the ceiling during a room fire.

Input data:

• Room dimensions:                          3 x 4 x 3 m
• Door dimensions:                           1 x 2 m
• Window dimensions:                      1 x 1 m
• Burning object location:                 middle of the room
• Heat release rate:                            750 kW

## 2. Creation of the input file – FDS simulation

The first thing to do is to create an empty FDS input file.

Navigate to an empty folder, then create a new document by:

“Right click” -> New -> Text Document

Give the job a simple name.

We will use the name “job1” for this tutorial. The extension of the file will need to be “.fds”, not “.txt”, so make sure to change it.

##### 2.1. Setting up the file structure

Let’s now open the .fds file with a text editor (Notepad on Windows).

The first thing to do when setting up an input file is to give the job a name (it’s convenient to use the same name as the input file): you have to name the job by writing the following string at the very beginning of the file:

`&HEAD CHID='job1', TITLE='job1' /`

Press enter a few times and write the ending string of the file, which is the same for every FDS job:

`&TAIL /`

The rest of the FDS input file will be written between the &HEAD CHID line and the &TAIL line, as shown in the picture below.

##### 2.2. Setting the computational domain

Let’s model the grid in which our simulation will take place:

As you may already know, FDS needs to operate within a domain that is made up of rectilinear volumes.

For our FDS simulation, we will divide our 3 x 4 x 3 m domain into cubes with 0.1 m side.

The line that defines the domain is the following:

`&MESH XB= 0, 3, 0, 4, 0, 3, IJK= 30, 40, 30 /`

The volume is a parallelepiped defined by its 2 opposites corners; the coordinates of the first point are x, y, z; the second ones are x’, y’, z’.

The XB command defines the dimensions of the volume in meters, in the format of XB= x, x’, y, y’, z, z’.

The IJK command specifies the number of parts in which you want to divide the three dimensions (x, y, z), in the format of IJK= n(x), n(y), n(z).

In our simulation we want to have 0.1 m cubes, so we deduced the IJK values by dividing each dimension by 0.1 m.

Example for dimension y (lenght = 4 m):
4 m / 0.1 m = 40     —>     n(y)= 40 —> IJK= 30, 40, 30

##### 2.3. Setting up the duration of the FDS simulation

To define the duration of the simulation we will use the &TIME parameter:

`&TIME T_END=60. /`

The line will instruct FDS to end the simulation at 60 s.

We will add the following line right after the TIME one:

`&DUMP NFRAMES=60 /`

The NFRAMES parameter controls the rate at which output files are written. By setting it to 60, just like the number of seconds of our job, FDS will write to the output file every second of the simulation.

##### 2.4. Modelling the openings

Let’s now model the openings of the room (a door and a window).

To create the openings on the surfaces of your domain we will need to use the &VENT command:

`&VENT XB= 1, 2, 4, 4, 0, 2, SURF_ID='OPEN' / door &VENT XB= 3, 3, 2, 3, 1, 2, SURF_ID='OPEN' / window`

In a similar way to the &MESH line (see the previous chapter), the vent dimensions are defined via the XB command.

The command SURF_ID=’OPEN’ applied to the exterior boundary of the computational domain indicates a passive opening to the outside.

If you want to check that the geometry is ok, you can save the file and run the simulation for a few seconds, even if it is not complete.

To run the job you will have to:

• save the file
• open the special CMDfds prompt on your desktop (generated during the FDS-SMV installation
• navigate to the folder of your input file
• run the command “fds_local job1.fds”

See this tutorial for detailed instructions on how to run a FDS job on Windows.

Running the job will produce the outputs files (in the same folder as the input file), among which you will find the .smv file. If you open it (with Smokeview), you will be able to check if you set up the domain correctly.

##### 2.5. Modelling the combustion

It is now time to set up the burning object in the room.

This is probably the most interesting part of this Fire Dynamics Simulator tutorial.

We’ll set up the combustion model by creating an obstruction and then applying a Heat Release Rate Per Unit of Area (HRRPUA) to the surfaces of that obstruction.

But first, we have to define the fuel of the simulation via the &REAC line. We will choose propane for this example:

`&REAC FUEL = 'PROPANE'`

Then we will need to write the &OBST line, and we’ll have to specify:

• the obstruction dimensions (with the XB command)
• the surface that we want to apply to the obstruction surfaces (with the SURF_ID command )
• (optional) the color of the obstruction (with the COLOR command )

`&OBST XB= 1, 2, 1.5, 2.5, 0, 0.5, COLOR='RED', SURF_ID='fire1' /`

FDS will now scan the input file looking for the surface with the ID “fire1”; we need to provide that surface with the following line:

`&SURF ID='fire1', HRRPUA=250 /`

The HRRPUA is the value of Heat Release Rate Per Unit of Area expressed in kW/m2.

If we run the simulation and then open the Smokeview file, we can see the fire animation by loading the HRRPUV parameter:

##### 2.6. Outputs selection

The combustion has been modeled, but for now, apart from the visual output of the “flames”, we have no other output.

For the purposes of this FDS guide we just want to calculate the temperature of the air near the ceiling, and we are going to obtain that in two different ways:

• with a device (&DEVC) that will output the temperature of the air in a single position over time (in a .csv file)
• with a slice file (&SLCF) that will calculate the temperature over time on each point of a selected plane (the output will be color-mapped in Smokeview).

Device output line:

`&DEVC ID='T air 1', XYZ=1, 2, 2.8, QUANTITY='TEMPERATURE'  /`

• ID is the name of the device, and the user can choose the name he prefers;
• XYZ indicates the coordinates (x,y,z) in which we want to measure the temperature (in the middle of the room at 2,8 m from the ground;
• the QUANTITY command indicates which quantity we want to output with our device ( for a complete list of the available output quantities, read the user guide)

Slice file output line:

`&SLCF PBY = 2,  QUANTITY='TEMPERATURE'/`

• PBY = 2 tells FDS to calculate the quantity on the entire plane y=2
• the QUANTITY command indicates which quantity we want to output on the slice.

The FDS input file is now complete, and will look like this:

`&HEAD CHID='job1', TITLE='job1' / &MESH XB= 0, 3, 0, 4, 0, 3, IJK= 30, 40, 30 / &TIME T_END=60. / &DUMP NFRAMES=60 / &VENT XB= 1, 2, 4, 4, 0, 2, SURF_ID='OPEN' / door &VENT XB= 3, 3, 2, 3, 1, 2, SURF_ID='OPEN' / window &REAC FUEL = 'PROPANE' &OBST XB= 1, 2, 1.5, 2.5, 0, 0.5, COLOR='RED', SURF_ID='fire1' / &SURF ID='fire1', HRRPUA=250 / &DEVC ID='T air 1', XYZ=1, 2, 2.8, QUANTITY='TEMPERATURE' / &SLCF PBY = 2, QUANTITY='TEMPERATURE'/ &TAIL /`

You can also directly download the file by clicking the following download button.

## 3. Outputs review

Premise: for the purpose of this FDS guide, we will not go into detail for every single output generated by the calculation, but we will focus only o the most useful ones.

After you’ve finished the compilation of the input file you have to run the FDS simulation (this time let it finish).

To run the job you will have to save the file, open the special CMDfds prompt, navigate to the folder of your input file and run the command “fds_local job1.fds”

See this tutorial for detailed instructions on how to run a FDS job on Windows.

Running the job will produce the outputs files in the same folder as the input file.

Usually, the most useful outputs files are:

• the “job1.smv” file
• the “job1_devc.csv” file
##### 3.1. The “.smv” file

This file allows the user to see the visual results of the simulation in the Smokeview file.

By opening this file, you can see the geometry of the simulation and load the available visual outputs.

An output that is always present in a combustion scenario is the HRRPUV (Heat Release Rate Per Unit of Volume), which is the visualization of the “flames”. You can load this output by right-clicking in the Smokeview window and selecting:

Load/Unload -> 3D smoke -> HRRPUV

The animation of the fire will automatically start.

You can pause/resume the animation by pressing “t” on your keyboard.

You can restart the animation by pressing “0” on your keyboard.

You can unload the animation by:

Right click -> Load/Unload -> Unload all

The other loadable Smokeview output is a Slice that we’ve created by writing the &SLCF line in the input file.

You can load this output with:

Right click -> Load/Unload -> Slice file -> TEMPERATURE -> Y=2

this slice maps the air temperature in a range of colors.

##### 3.2. The “_devc.csv” file

This .csv file contains the numerical values that we asked FDS to calculate with the &DEVC line.

In a .csv file the values are separated with commas “,” , so, in order to utilize the data you may need to reorganize it by separating the data with a specific function of the spreadsheet you use (for Microsoft Excel: Data ->Text to column)

In the first column of this file is always indicated the time.

Each of the following columns reports the values over time of each device that we’ve set up in the input file.

In our example, we only have one device columns because we only set up one &DEVC line in the input file.

As you can see our device reports the temperature of the air (expressed in °C) overtime in the specified point selected with the XYZ parameter in the DEVC line.

## 4. Where to run the simulation

You might want to start your simulation directly onto your PC at first, but FDS simulation can require hours and even days to compute.

In the future, once you will start making large and more complex situation you might want to start to run your simulations on a Cloud Computing service.

## FDS guides and examples

For more guides and tutorials, check out the complete FDS guides and FDS example.