Working with CFAST

Despite its name, xFDS can render any text file as a template. It can handle CFAST files just as easily as FDS or PBS files.

Defining a fire in the CFAST editor can be tedious, especially if the area or product yields need to be altered over time. With xFDS, these parameters can be programatically set. The example below shows how the fire can easily be changed from a medium growth (tg = 300 s) to a slow growth (tg = 600 s) fire.

Tip

If a project requires both CFAST and FDS models, they can be managed from the same pbd.yml configuration file!

examples/cfast/pbd.yml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
xfds:
  render:
    - name: t2-fire_tg-{{ tg }}s
      files:
        - cfast.in
      variables:
        qmax: 1000
        tmax: 800
        # Compartment dimensions
        dx: 20 # ft
        dy: 15 # ft
        dz: 8 # ft
        # Vent Dimensions
        H_v: 7 # ft
        W_v: 3 # ft
        offset: 5 # ft
      parameters:
        tg: [300, 600]
examples/cfast/cfast.in
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
&HEAD VERSION = 7700, TITLE = 'CFAST Simulation' /

!! Scenario Configuration
&TIME SIMULATION = {{ tmax }} PRINT = 60 SMOKEVIEW = 15 SPREADSHEET = 15 /
&INIT PRESSURE = 101325 RELATIVE_HUMIDITY = 50 INTERIOR_TEMPERATURE = 20 EXTERIOR_TEMPERATURE = 20 /

!! Compartments
&COMP ID = 'Comp 1'
      DEPTH = {{ dx|str_convert('ft', 'm', '%.4f') }} HEIGHT = {{ dz|str_convert('ft', 'm', '%.4f') }} WIDTH = {{ dy|str_convert('ft', 'm', '%.4f') }}
      ORIGIN = 0, 0, 0 GRID = 50, 50, 50 /

!! Wall Vents
&VENT TYPE = 'WALL'
      ID = 'WallVent_1'
      COMP_IDS = 'Comp 1' 'OUTSIDE' ,
      BOTTOM = 0
      HEIGHT = {{ H_v|str_convert('ft', 'm', '%.4f') }}
      WIDTH = {{ W_v|str_convert('ft', 'm', '%.4f') }}
      FACE = 'FRONT'
      OFFSET = {{ offset|str_convert('ft', 'm', '%.4f') }} /

!! Fires
&FIRE ID = 'New Fire 1'  COMP_ID = '', FIRE_ID = 'New Fire 1'  LOCATION = 0, 0 /
&CHEM ID = 'New Fire 1' CARBON = 1 CHLORINE = 0 HYDROGEN = 4 NITROGEN = 0 OXYGEN = 0 HEAT_OF_COMBUSTION = 50000 RADIATIVE_FRACTION = 0.35 /
&TABL ID = 'New Fire 1' LABELS = 'TIME', 'HRR' , 'HEIGHT' , 'AREA' , 'CO_YIELD' , 'SOOT_YIELD' , 'HCN_YIELD' , 'HCL_YIELD' , 'TRACE_YIELD'  /

!! Growth Phase
{% for t in 15|arange(0, tg) %}
&TABL ID = 'New Fire 1', DATA = {{ "%3d"|format(t) }}, {{ "%6.1f"|format(t|hrr(tg)) }}, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
{% endfor %}
!! Steady State Phase
&TABL ID = 'New Fire 1', DATA = {{ tg }}, {{ "%6.1f"|format(tg|hrr(tg)) }}, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = {{ tmax }}, {{ "%6.1f"|format((tmax - 1)|hrr(tg)) }}, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = {{ tmax + 1 }}, {{ "%6.1f"|format(0) }}, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TAIL /

Note

This model uses a custom filter to get the heat release rate as a function of time

examples/cfast/filters.py
1
2
3
4
5
6
def hrr(t: int, tg: int) -> float:
    """Get the heat release rate at time t following a t-squared growth curve."""
    if t < tg:
        return 1000.0 * (t / tg) ** 2
    else:
        return 1000.0
examples/cfast/output/t2-fire_tg-300s/t2-fire_tg-300s.in
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
&HEAD VERSION = 7700, TITLE = 'CFAST Simulation' /

!! Scenario Configuration
&TIME SIMULATION = 800 PRINT = 60 SMOKEVIEW = 15 SPREADSHEET = 15 /
&INIT PRESSURE = 101325 RELATIVE_HUMIDITY = 50 INTERIOR_TEMPERATURE = 20 EXTERIOR_TEMPERATURE = 20 /

!! Compartments
&COMP ID = 'Comp 1'
      DEPTH = 6.0960 HEIGHT = 2.4384 WIDTH = 4.5720
      ORIGIN = 0, 0, 0 GRID = 50, 50, 50 /

!! Wall Vents
&VENT TYPE = 'WALL'
      ID = 'WallVent_1'
      COMP_IDS = 'Comp 1' 'OUTSIDE' ,
      BOTTOM = 0
      HEIGHT = 2.1336
      WIDTH = 0.9144
      FACE = 'FRONT'
      OFFSET = 1.5240 /

!! Fires
&FIRE ID = 'New Fire 1'  COMP_ID = '', FIRE_ID = 'New Fire 1'  LOCATION = 0, 0 /
&CHEM ID = 'New Fire 1' CARBON = 1 CHLORINE = 0 HYDROGEN = 4 NITROGEN = 0 OXYGEN = 0 HEAT_OF_COMBUSTION = 50000 RADIATIVE_FRACTION = 0.35 /
&TABL ID = 'New Fire 1' LABELS = 'TIME', 'HRR' , 'HEIGHT' , 'AREA' , 'CO_YIELD' , 'SOOT_YIELD' , 'HCN_YIELD' , 'HCL_YIELD' , 'TRACE_YIELD'  /

!! Growth Phase
&TABL ID = 'New Fire 1', DATA =   0,    0.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA =  15,    2.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA =  30,   10.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA =  45,   22.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA =  60,   40.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA =  75,   62.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA =  90,   90.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 105,  122.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 120,  160.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 135,  202.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 150,  250.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 165,  302.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 180,  360.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 195,  422.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 210,  490.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 225,  562.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 240,  640.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 255,  722.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 270,  810.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 285,  902.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
!! Steady State Phase
&TABL ID = 'New Fire 1', DATA = 300, 1000.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 800, 1000.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 801,    0.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TAIL /
examples/cfast/output/t2-fire_tg-600s/t2-fire_tg-600s.in
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
&HEAD VERSION = 7700, TITLE = 'CFAST Simulation' /

!! Scenario Configuration
&TIME SIMULATION = 800 PRINT = 60 SMOKEVIEW = 15 SPREADSHEET = 15 /
&INIT PRESSURE = 101325 RELATIVE_HUMIDITY = 50 INTERIOR_TEMPERATURE = 20 EXTERIOR_TEMPERATURE = 20 /

!! Compartments
&COMP ID = 'Comp 1'
      DEPTH = 6.0960 HEIGHT = 2.4384 WIDTH = 4.5720
      ORIGIN = 0, 0, 0 GRID = 50, 50, 50 /

!! Wall Vents
&VENT TYPE = 'WALL'
      ID = 'WallVent_1'
      COMP_IDS = 'Comp 1' 'OUTSIDE' ,
      BOTTOM = 0
      HEIGHT = 2.1336
      WIDTH = 0.9144
      FACE = 'FRONT'
      OFFSET = 1.5240 /

!! Fires
&FIRE ID = 'New Fire 1'  COMP_ID = '', FIRE_ID = 'New Fire 1'  LOCATION = 0, 0 /
&CHEM ID = 'New Fire 1' CARBON = 1 CHLORINE = 0 HYDROGEN = 4 NITROGEN = 0 OXYGEN = 0 HEAT_OF_COMBUSTION = 50000 RADIATIVE_FRACTION = 0.35 /
&TABL ID = 'New Fire 1' LABELS = 'TIME', 'HRR' , 'HEIGHT' , 'AREA' , 'CO_YIELD' , 'SOOT_YIELD' , 'HCN_YIELD' , 'HCL_YIELD' , 'TRACE_YIELD'  /

!! Growth Phase
&TABL ID = 'New Fire 1', DATA =   0,    0.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA =  15,    0.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA =  30,    2.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA =  45,    5.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA =  60,   10.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA =  75,   15.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA =  90,   22.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 105,   30.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 120,   40.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 135,   50.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 150,   62.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 165,   75.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 180,   90.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 195,  105.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 210,  122.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 225,  140.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 240,  160.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 255,  180.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 270,  202.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 285,  225.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 300,  250.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 315,  275.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 330,  302.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 345,  330.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 360,  360.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 375,  390.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 390,  422.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 405,  455.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 420,  490.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 435,  525.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 450,  562.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 465,  600.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 480,  640.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 495,  680.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 510,  722.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 525,  765.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 540,  810.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 555,  855.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 570,  902.5, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 585,  950.6, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
!! Steady State Phase
&TABL ID = 'New Fire 1', DATA = 600, 1000.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 800, 1000.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TABL ID = 'New Fire 1', DATA = 801,    0.0, 0, 0.001, 0.01, 0.01, 0, 0, 0 /
&TAIL /