Skip to content

Arrival-time map fills the whole domain when the front reaches the edge #233

Closed

Description

@HugoFara

What should happen when a front reaches the domain edge? On real terrain, the whole arrival map gets filled.

Mineral Fire 2016 (near Coalinga, CA), 12 × 15 km at 30 m, Farsite with LANDFIRE fuels and HRRR wind. At t = 48.5 h the front is 15 m from the east edge. Half an hour later:

  • the kernel prints WARNING: trashing a fire front with inner fronts (FireFront.cpp:1108) nine times;
  • no fire node is left;
  • 70.9% of the arrival map has one identical time, and no cell is left unburnt, barren ones included.

Repro: repro_edge_flood.py with mineral_inputs.npz (740 KB, available on request), about a minute.

I couldn't reproduce it on a flat synthetic domain: there the front slows down near the edge and stops. A few cells near the ignition do get a negative arrival time (−13 s) in both cases.

Side note: FireDomain.cpp:1128 (singlePolygonAreaBurningScan) reads SWCornerY()/burningMatrixResY where the X line above has +.

repro_edge_flood.py
"""Real terrain (Mineral Fire, 2016): the arrival-time map floods when the front reaches the domain edge.

Needs mineral_inputs.npz (30 m grid, 400 x 500, row 0 south): FBFM40 fuel, elevation,
half-hourly wind (already in the Farsite model's units) and 1 h fuel moisture.
"""
import re, numpy as np, pyforefire as pyff

d = np.load("mineral_inputs.npz")
NY, NX = d["fuel"].shape
Lx, Ly = NX * 30.0, NY * 30.0
with pyff.ForeFireRunner(stdout=None) as ff:
    ff["propagationModel"] = "Farsite"; ff["fuelsTable"] = "STDfarsiteFuelsTable"; ff["minSpeed"] = 0
    ff["spatialIncrement"] = 3; ff["perimeterResolution"] = 30; ff["minimalPropagativeFrontDepth"] = 30
    ff["relax"] = 0.5; ff["bmapLayer"] = 1
    ff.execute(f"FireDomain[sw=(0,0,0);ne=({Lx},{Ly},0);t=0]")
    ff.addLayer("propagation", "Farsite", "propagationModel")
    ff.addIndexLayer("table", "fuel", 0, 0, 0, Lx, Ly, 0, d["fuel"].astype(np.int32)[None, None].copy())
    ff.addScalarLayer("data", "altitude", 0, 0, 0, Lx, Ly, 0, d["altitude"].astype(float)[None, None].copy())
    for name, k in (("windU", 0), ("windV", 1)):
        w = np.zeros((1, 2, 4, 4)); w[0, k] = 1
        ff.addScalarLayer("windScalDir", name, 0, 0, 0, Lx, Ly, 0, w)
    x, y = d["ignition"]
    ff.execute(f"startFire[loc=({x},{y},0);t=0]")
    for h, (u, v), m in zip(d["hours"], d["wind"], d["m1"]):
        ff.execute(f"trigger[wind;loc=(0,0,0);vel=({u},{v},0)]")
        for name, val in (("ones", m), ("tens", m + .01), ("hundreds", m + .02), ("liveh", .3), ("livew", .75)):
            ff[f"moistures.{name}"] = float(val)
        ff.execute(f"goTo[t={(h + 0.5) * 3600}]")
        a = pyff.arrival_time(ff, "/tmp/arrival.asc")
        vals, counts = np.unique(a[np.isfinite(a)], return_counts=True)
        xs = [float(s.split(",")[0]) for s in re.findall(r"loc=\(([^)]*)\)", ff.execute("print[]"))]
        if h >= 46:
            print(f"t={h + 0.5:5.1f} h  nodes={len(xs):5d}  max x={max(xs, default=float('nan')):7.0f} of {Lx:.0f}  "
                  f"unburnt={np.isinf(a).mean():5.1%}  largest same-time patch={counts.max() / a.size:5.1%} of the map", flush=True)
        if not xs:
            break

Drafted with Claude Opus 5.5.

Activity

  1. added theissue type on Oct 29, 2026
  2. changed the issue type fromtoon Oct 29, 2026
  3. filippi commented on Oct 30, 2026

    @filippi
    Contributor

    hi @HugoFara the far site emulation really is a work in small progress, but if it works (including the reading of original files) it may be a fantastic inter-comparison set.. and the best addition ever for adoption of ForeFire.. thanks a lot
    a version of Farsite can be found here
    https://github.com/mbedward/farsite/
    I know the original Author, Mark Finney, and he is cool with us re-using the code for reproducibility purposes

  4. HugoFara commented on Oct 30, 2026

    @HugoFara
    CollaboratorAuthor

    Hi, yes I was trying to compare wildfires but unable to use farsite, hence the current developments. It is hard, but no reason we can't get there :)

  5. antonio-leblanc commented on Oct 31, 2026

    @antonio-leblanc
    Collaborator

    fixed by #240, merged into dev. closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed incorrect behavior

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions