A Julia Implementation of the ELMFIRE Wildfire Simulation Model
Overview
Elmfire.jl is a pure Julia implementation of the ELMFIRE (Eulerian Level Set Model of FIRE spread) wildfire simulation model. It provides high-performance fire spread modeling with support for:
Rothermel Surface Fire Spread Model - Industry-standard fire behavior calculations
Level Set Method - Efficient fire front propagation using the Eulerian approach
Crown Fire Modeling - Passive and active crown fire transitions
Ember Transport (Spotting) - Stochastic ember generation and transport
Weather Interpolation - Spatially and temporally varying weather conditions
Monte Carlo Ensembles - Probabilistic fire forecasting with parallel execution
WUI (Wildland-Urban Interface) Models - Building ignition and urban fire spread
Suppression Models - Fire containment line construction and resource management
Geospatial I/O - GeoTIFF reading/writing for integration with GIS workflows
Features
Multi-Precision Support
Elmfire.jl supports both Float64 (default) and Float32 precision throughout the entire codebase, allowing you to trade off numerical precision for memory efficiency and potentially faster computation on certain hardware.
High Performance
Narrow Band Method - Only computes fire spread near the active fire front
Multi-threaded Ensemble Runs - Parallel execution of Monte Carlo simulations
Efficient Memory Layout - Column-major arrays optimized for Julia
Comprehensive Fire Behavior
13 standard FBFM (Fire Behavior Fuel Models) included, with Scott & Burgan models loadable from CSV
Custom fuel model support
Dynamic fuel moisture effects
Slope and aspect terrain effects
Wind-driven elliptical spread patterns
Quick Start
usingElmfire# Create a fire simulation state (100x100 grid, 30ft cells)state =FireState{Float64}(100, 100, 30.0)# Create standard fuel model tablefuel_table =create_standard_fuel_table(Float64)# Set weather conditionsweather =ConstantWeather{Float64}( wind_speed_mph =15.0, wind_direction =270.0, # From west M1 =0.06, # 6% 1-hr fuel moisture M10 =0.08, M100 =0.10, MLH =0.60, MLW =0.90)# Ignite at centerignite!(state, 50, 50, 0.0)# Run for 60 minutes on fuel model 1 (short grass), flat groundsimulate_uniform!(state, 1, fuel_table, weather, 0.0, 0.0, 0.0, 60.0)# Get resultsprintln("Burned area: ", round(get_burned_area_acres(state), digits =1), " acres")
Burned area: 24.5 acres
state carries the outcome on the grid. Mapping the time of arrival shows the fire front’s progress: the wind blows from the west, so the fire runs east in the elongated ellipse the Rothermel and Richards models predict, with slow backing spread upwind.
usingPlots# Unburned cells are flagged with -1; mask them so they render as backgroundtoa = [t <0 ? NaN: t for t in state.time_of_arrival]# Grid is indexed [x, y], so transpose to put east on the horizontal axisxs = (1:state.ncols) .* state.cellsizeys = (1:state.nrows) .* state.cellsizeheatmap( xs, ys, toa'; aspect_ratio =1, color =:inferno, xlabel ="Distance east (ft)", ylabel ="Distance north (ft)", title ="Time of arrival after 60 minutes", colorbar_title ="minutes", background_color_inside =:gray95,)