S1: Reproducible demonstration code
Supplementary Material for Fire 2019, 2, 41; https://doi.org/10.3390/fire2030041
This appendix describes how the firebehavioR
package was used in Section 3. Demonstration of the accompanying article. To reproduce our results, readers should execute the following code snippets in their R console. The #
character precedes comments and omitted code.
To set up the working environment, this package and others need to be loaded into your environment.
# Install, if needed, and load the firebehavioR package.
# The tidyverse packages simplify wrangling and visualization.
# patchwork is to align multiple plots
# install.packages('firebehavioR')
# install.packages('tidyverse')
# devtools::install_github('thomasp85/patchwork')
library(firebehavioR)
library(tidyverse)
library(patchwork)
Rothermel framework
Running
The data used for the simulations using rothermel()
include surface fuel model 10, the fuel moisture scenario D1L1, arbitrary slope and weather parameters, and seven forest stands measured before and after treatment. Because there are 14 unique forest stands representing the canopy conditions, the fuel model, fuel moisture, and environment data frames must be repeated 13 additional times. The wind adjustment factor was set to 1, which implicitly models the input wind speed as the mid-flame wind speed. Here, rothermel()
is run on our input data using the Scott & Reinhardt approach to solve crown fraction burned. Then the results for crown fraction burned, torching index and crowning index are plotted.
## Data setup
data(coForest, fuelModels, fuelMoisture) #Load data into environment
# help(coForest) # For more information on the forest stands
# help(fuelModels) # For help on surface fuel models
# help(fuelMoisture) # For help on fuel moisture scenarios
# Surface fuels and fuel moistures
surfacefuel = fuelModels['A10',] %>%
slice(rep(1:n(), each=14))
surfacemoisture = fuelMoisture['D1L1',] %>%
slice(rep(1:n(), each=14))
# Only a subset of canopy characteristics are needed,
#canopy bulk density, foliar moisture content, canopy base
#height and canopy fuel load.
# Foliar moisture content is assumed to be 100%.
crownfuels = coForest %>%
mutate(FMC=100) %>%
select(cbd_kgm3, FMC, cbh_m,cfl_kgm2)
# Some example environmental parameters are assumed
environment = data.frame(
slope = 10,
windspeed = 12,
direction = 0,
waf=1) %>%
slice(rep(1:n(), each=14))
rothermelResults = rothermel(
surfFuel = surfacefuel,
moisture = surfacemoisture,
crownFuel = crownfuels,
enviro = environment,
cfbForm='sr')
str(rothermelResults)
## List of 6
## $ fireBehavior :'data.frame': 14 obs. of 13 variables:
## ..$ Type of Fire : Factor w/ 2 levels "passive","surface": 1 1 1 2 1 2 1 2 2 2 ...
## ..$ Crown Fraction Burned [%] : num [1:14] 22.44 14.39 18.05 8.97 29.74 ...
## ..$ Rate of Spread [m/min] : num [1:14] 8.08 8.01 8.05 7.97 8.15 7.96 8.02 7.95 7.97 7.89 ...
## ..$ Heat per Unit Area [kJ/m2] : num [1:14] 20889 19072 26314 20187 29006 ...
## ..$ Fireline Intensity [kW/m] : num [1:14] 2813 2546 3526 2678 3937 ...
## ..$ Flame Length [m] : num [1:14] 3.51 3.16 3.83 3.12 4.43 2.99 3.26 2.93 3.22 2.72 ...
## ..$ Direction of max spread [deg] : num [1:14] 0 0 0 0 0 0 0 0 0 0 ...
## ..$ Scorch height [m] : num [1:14] 22.6 20.8 27.2 21.7 29.8 ...
## ..$ Torching Index [m/min] : num [1:14] 7.15 7.29 8.85 8.36 5.42 ...
## ..$ Crowning Index [km/hr] : num [1:14] 24.7 31.8 23.4 37.5 23.4 ...
## ..$ Surfacing Index [km/hr] : num [1:14] 24.7 31.8 23.4 37.5 23.4 ...
## ..$ Effective Midflame Wind [km/hr]: num [1:14] 10.48 11.06 10.8 11.45 9.96 ...
## ..$ Flame Residence Time [min] : num [1:14] 0.22 0.22 0.22 0.22 0.22 0.22 0.22 0.22 0.22 0.22 ...
## $ detailSurface:'data.frame': 14 obs. of 13 variables:
## ..$ Potential ROS [m/min] : num [1:14] 7.89 7.89 7.89 7.89 7.89 7.89 7.89 7.89 7.89 7.89 ...
## ..$ No wind, no slope ROS [m/min] : num [1:14] 0.43 0.43 0.43 0.43 0.43 0.43 0.43 0.43 0.43 0.43 ...
## ..$ Slope factor [0-1] : num [1:14] 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 ...
## ..$ Wind factor [0-1] : num [1:14] 17.3 17.3 17.3 17.3 17.3 ...
## ..$ Characteristic dead fuel moisture [%]: num [1:14] 3.08 3.08 3.08 3.08 3.08 3.08 3.08 3.08 3.08 3.08 ...
## ..$ Characteristic live fuel moisture [%]: num [1:14] 10.3 10.3 10.3 10.3 10.3 ...
## ..$ Characteristic SAV [m2/m3] : num [1:14] 5789 5789 5789 5789 5789 ...
## ..$ Bulk density [kg/m3] : num [1:14] 8.83 8.83 8.83 8.83 8.83 8.83 8.83 8.83 8.83 8.83 ...
## ..$ Packing ratio [-] : num [1:14] 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 ...
## ..$ Relative packing ratio [-] : num [1:14] 2.35 2.35 2.35 2.35 2.35 2.35 2.35 2.35 2.35 2.35 ...
## ..$ Reaction intensity [kW/m2] : num [1:14] 1331 1331 1331 1331 1331 ...
## ..$ Heat source [kW/m2] : num [1:14] 1187 1187 1187 1187 1187 ...
## ..$ Heat sink [kJ/m3] : num [1:14] 9036 9036 9036 9036 9036 ...
## $ detailCrown :'data.frame': 14 obs. of 13 variables:
## ..$ Potential ROS [m/min] : num [1:14] 8.77 8.77 8.77 8.77 8.77 8.77 8.77 8.77 8.77 8.77 ...
## ..$ No wind, no slope ROS [m/min] : num [1:14] 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 ...
## ..$ Slope factor [0-1] : num [1:14] 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 ...
## ..$ Wind factor [0-1] : num [1:14] 4.66 4.66 4.66 4.66 4.66 4.66 4.66 4.66 4.66 4.66 ...
## ..$ Characteristic dead fuel moisture [%]: num [1:14] 3.08 3.08 3.08 3.08 3.08 3.08 3.08 3.08 3.08 3.08 ...
## ..$ Characteristic live fuel moisture [%]: num [1:14] 5.17 5.17 5.17 5.17 5.17 5.17 5.17 5.17 5.17 5.17 ...
## ..$ Characteristic SAV [m2/m3] : num [1:14] 5788 5788 5788 5788 5788 ...
## ..$ Bulk density [kg/m3] : num [1:14] 8.84 8.84 8.84 8.84 8.84 8.84 8.84 8.84 8.84 8.84 ...
## ..$ Packing ratio [-] : num [1:14] 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 ...
## ..$ Relative packing ratio [-] : num [1:14] 2.35 2.35 2.35 2.35 2.35 2.35 2.35 2.35 2.35 2.35 ...
## ..$ Reaction intensity [kW/m2] : num [1:14] 1399 1399 1399 1399 1399 ...
## ..$ Heat source [kW/m2] : num [1:14] 395 395 395 395 395 ...
## ..$ Heat sink [kJ/m3] : num [1:14] 9050 9050 9050 9050 9050 ...
## $ critInit :'data.frame': 14 obs. of 4 variables:
## ..$ Fireline Intensity [kW/m]: num [1:14] 1165 1194 1528 1419 832 ...
## ..$ Flame length (m) : num [1:14] 1.99 2.02 2.26 2.18 1.71 1.98 1.58 1.91 2.45 3.04 ...
## ..$ Surface ROS [m/min] : num [1:14] 4.02 4.12 5.28 4.9 2.87 ...
## ..$ Canopy base height [m] : num [1:14] 5.69 5.69 5.69 5.69 5.69 5.69 5.69 5.69 5.69 5.69 ...
## $ critActive :'data.frame': 14 obs. of 2 variables:
## ..$ Canopy bulk density [kg/m3] : num [1:14] 0.34 0.34 0.34 0.34 0.34 0.34 0.34 0.34 0.34 0.34 ...
## ..$ ROS, crown (R'active) [m/min]: num [1:14] 21.4 30 20 37.5 20 ...
## $ critCess :'data.frame': 14 obs. of 2 variables:
## ..$ Canopy base height [m]: num [1:14] 6.1 6.1 6.1 6.1 6.1 6.1 6.1 6.1 6.1 6.1 ...
## ..$ O'cessation [km/hr] : num [1:14] 5.43 5.6 7.4 6.84 3.3 ...
str(rothermelResults)
shows what results are output by rothermel()
.
Visualizing
# Create custom plot styling
theme_dotplot = theme_bw(14) +
theme(axis.text = element_text(size = rel(.65)),
axis.ticks.y = element_blank(),
axis.title= element_text(size = rel(.65)),
panel.grid.major.x = element_blank(),
panel.grid.major.y = element_line(size = 0.5),
panel.grid.minor.x = element_blank())
# Extract from results the three output quantities of interest (CFB, TI, CI)
# Then create map a ggplot object onto each quantity
rothermelPlots=
coForest %>%
bind_cols(., rothermelResults$fireBehavior) %>%
select(site, status,
CFB = 'Crown Fraction Burned [%]',
TI = 'Torching Index [m/min]',
CI = 'Crowning Index [km/hr]') %>%
gather(variable,value,-site,-status) %>%
mutate(site=fct_rev(as_factor(site)),
status=fct_rev(as_factor(status))) %>%
group_by(site,status) %>%
split(.$variable) %>%
map2(.y=names(.),
~ggplot(data=.,aes(value,site, group=site,)) +
geom_line() +
geom_point(aes(color=status),size=4) +
theme_dotplot)
# Use patchwork to successively plot the three panels side-by-side
rothermelPlots$TI +
theme(legend.position='none') +
labs(x = 'Torching Index (km/hr)', y='Site') +
xlim(0,15) +
rothermelPlots$CI +
theme(legend.position='none',
axis.title.y=element_blank(),
axis.text.y=element_blank()) +
xlab('Crowning Index (km/hr)') +
rothermelPlots$CFB +
theme(axis.title.y=element_blank(),
axis.text.y=element_blank()) +
labs(x='Crown Fraction Burned (%)',
color='Treatment\nstatus') +
scale_color_discrete(labels=c('Before','After'))
Replica of Figure 1 in original article. Torching index, crowning index and crown fraction burned predicted using the Rothermel modeling system in the firebehavioR
package.
Visualization such as in Figure 1 provides a quick way to make assessments from results and is provided in Section 3 of the accompanying article.
Crown Fire Initiation & Spread
Running
Here we employ the Crown Fire Initiation & Spread modeling system. In this example, the same canopy fuels are used. In addition, the 10-m, open wind speed is be 20 km/hr, 0.3 Mg/ha of surface fuel load consumed, and the estimated fine fuel moisture is 8%.
Visualizing
# Extract from results the three output quantities of interest (pCrown, cROS)
# Then create map a ggplot object onto each quantity
cfisPlots = coForest %>%
bind_cols(., cfisResults) %>%
select(site, status, pCrown, cROS) %>%
gather(variable,value,-site,-status) %>%
mutate(site=fct_rev(as_factor(site)),
status=fct_rev(as_factor(status)),
value = replace_na(value,0)) %>%
group_by(site,status) %>%
split(.$variable) %>%
map2(.y=names(.),
~ggplot(data=.,aes(value,site, group=site,)) +
geom_line() +
geom_point(aes(color=status),size=4) +
theme_dotplot)
# Use patchwork to successively plot the two panels side-by-side
cfisPlots$pCrown +
theme(legend.position='none') +
labs(x = 'Crowning Probability (%)',
y='Site') +
xlim(3,97) +
cfisPlots$cROS +
theme(axis.title.y=element_blank(),
axis.text.y=element_blank()) +
labs(x='Crown Fire ROS (m/min)',
color='Treatment\nstatus') +
scale_color_discrete(labels=c('Before','After'))
Replica of Figure 2 in original article. Probability of crowning and predicted crown fire rate of spread (ROS) predicted using the Crown Fire Initiation & Spread model in the firebehavioR
package.
Figure 2 here is a reproduction of that in Section 3 of the accompanying article.