Skip to content

Items 8, 4 and 5: gas radiation, an oxygen limit and CO in two steps, all off by default - #31

Merged
libishm1 merged 3 commits into
mainfrom
flamescapes/radiation-chemistry
Nov 29, 2026
Merged

libishm1 merged 3 commits into
mainfrom
flamescapes/radiation-chemistry

Conversation

@libishm1

Copy link
Copy Markdown
Owner

This pull request brings three solver items of the calibration plan to main, each in one commit and each behind its own switch, off by default: gas radiation from CO2 and H2O (item 8, gasRadiation), an oxygen limit in gas combustion (item 4, oxygenLimit) and CO in two steps (item 5, twoStepCO). All three run on the CPU only; with any of them on, supported() sends the scene off the GPU. With every switch off the output is the same as main's.

Item 8 (plan 16.43, second attempt, with the decisions of 16.44) lets the gas's CO2 and H2O emit and absorb beside its soot by the rank correlated spectral line weighted sum of gray gases, eight gray gases and a clear one. It acts only with surfaceRayStart and, for a radiating burner, flameRadiantOnce, and the solver refuses to start without them or without the tables. The tables are the values of Pearson, Webb, Solovjov and Ma (2014) as RadLib (Stephens, Jensen, Wheeler and Lignell 2022) ships them at commit 583e0fe, under RadLib's MIT licence; they are committed as public/gas-radiation/gas-radiation-tables.f32 with a NOTICE.md that gives the source, the licence text in full and the source files' SHA-256, as the user decided on 2026-11-16. Nothing of RadCal is committed. The app fetches the tables only with the switch on. The commit also brings the item's check tool, the tables' conversion script and tools/calibration/item8-loose-ends.mjs, which PR 2 left for this one.

Item 4 (plan 16.61) is FDS's simplest extinction rule with FDS's default constants: no gas fuel burns where the oxygen mass fraction is under Y_min (T_c - T) / (T_c - T_ambient), and gas at or above 600 C burns freely. It acts on the fuel vapour, on the burner and, with item 5, on step 2.

Item 5 (plan 16.61) follows the method of FDS's simple chemistry with two reactions: gas fuel burns first to CO (two thirds of its carbon), soot and water, and a second step burns the intermediate products to CO2 with the oxygen left, at once in a burner's cell and elsewhere at a mixing rate. With air in excess it gives the fuel's own yields and heat. It departs from FDS's method in two ways, which the user accepted on 2026-11-26. First, the intermediate products are carried as two scalars per cell, the CO and the soot that step 2 will burn, not as one lumped species. Second, where step 2 burns a burner's intermediate products away from the burner's own cells, the radiant fraction of that heat is held back and cast through the burner's rays on the next step, instead of radiating from the cells where step 2 burns.

Each item has a unit test in src/core that runs with npm test, with the switch off (set to 0, a run is the default's bit for bit) and on (its effect): flamescapes.gasRadiation.test.mjs (about 0.3 s alone), flamescapes.oxygenLimit.test.mjs (about 0.9 s) and flamescapes.twoStep.test.mjs (about 1.7 s). The source branches' checks that run the whole solver for many steps of a room (two of item 4's, three of item 5's) are unchanged in tools/chemistry-checks and run by hand with node --test; all five pass. The run cache keys all three switches when a run sets them, as it keys every other solver switch; the source branches of items 4 and 5 did not, and that line is added here.

Checks against main 300612b, recorded before the branch was built. npm test passes 672 of 673 on the branch and 655 of 656 on main; the one failure on both is the wall clock test of 100 ms with 200 heads and 1000 obstructions, which fails under load and passes alone 9 of 9. Lint and build pass and leave the tree clean. With every switch off, the identity digests (the app's run path and the bare solver, with and without embers), the validation digests of fsri 100kWSB_Open_Back_1 and atf 050 at 0.34 m (180 s cap and full horizon) and the fingerprints (d62b581d and 29793d1a) are the same as main's.

The verification suite with every switch off gives main's result case for case: 2 of the 9 judged cases pass, the sealed box reads 20.8 kPa against 24 kPa and 0.59 kg of the 1 kg injected is found. Run on scratch copies with one item on by default: the oxygen limit changes no case; CO in two steps moves case 7 (largest residual 5.82 to 5.86 % sealed, 3.47 to 3.42 % open) and case 8 (1090.2 to 1090.3 kW against 1200 kW), every verdict unchanged; gas radiation, beside its two prerequisite switches, moves case 6 (0.589 to 0.586 kg), case 7 (5.14 % sealed, 3.17 % open) and case 8 (745 kW, 38 % low against 9 % without it), every verdict unchanged, and refuses case 9, whose default reading sets surfaceRayStart 0, as item 8 requires.

Item 8's check tool on this branch judged 742 lines and none failed, and every judged line reads as the builder's run at 98ca598, digit for digit. Its GPU check (i) ran before this pull request was opened: tools/flamescapes-gpu-check.mjs, all phases, alternately on main and on the branch, two rounds each; of 4970 leaves, 93 timings were set apart and 4696 were judged bit for bit against main's two runs, and none differs, for each of the branch's runs. With the switches off the GPU runs main's kernels, and the GPU file differs from main's only by three lines in supported() that are false then. One observation is not explained: the GPU's sprinkler runs with water vary from run to run on main itself, and over nine pairs of runs alternated with main the branch's Evans runs read 3.7 % higher on average (34.70 against 33.46 MJ; Mann Whitney p 0.024) and its wetting runs 4.2 % lower (30.94 against 32.31 MJ; p 0.015), while the spray runs agree (p 0.40); the ranges overlap, and no way in which the branch could reach those runs has been found. The GPU heptane spill with no suppression is bimodal on main, as known (main 25.6 MJ with a 496 kW peak and 39.7 MJ; the branch 34.7 and 40.2 MJ).

The full 0.34 m runs of items 4 and 5 were made before this pull request was opened, as the plan fixes them (16.61): the eight series and the chairs on the solver on the site (wall layers and leakage), storing species, with the oxygen limit, with CO in two steps, and with neither, all from this branch's solver. The arm with neither reproduces the saved 13.B storing runs made at 98ca598 run for run, 178 and 13 runs, every pair and stored series. No run stopped in any arm. The results, as measured and not adopted:

Item 4. UL FSRI's oxygen at 1.84 m, the model's drop over the measured drop, moves from a bias of 2.00 (scatter 0.60) to 1.97 (0.63), and the chairs' from 1.74 to 1.72: about 2 % of the distance to 1 in the logarithm, where the plan asks a fifth. FSE's oxygen, read through the asphyxiant dose at its analysers, does not move. The oxygen limit changes 52 of the 178 runs. No word of the eight series or of the chairs moves; in the nine series together, the ceiling jet's pooled word goes from indicative to not calibrated (scatter at the 0.50 bound), its final word staying not calibrated.

Item 5. FSE's heptane CO peaks, model over measured, go from between 0.012 and 0.70 to between 0.53 and 2.81 (ISOHept26 front 2.81 and rear 1.23, ISOHept25 front 0.81 and rear 0.53), all within a factor of 3 of measured; NIST/NRC's stay within their present range (0.69 to 2.89 before, 0.67 to 2.85 after). FSE's methane test has almost no CO measured (26 ppm at the rear), and there the model now gives 30 times as much. In the eight series the final words of the layer temperature and the head height temperature go from not calibrated to indicative, and in the nine series that of the head height temperature; none goes down. In the chairs alone the ceiling jet's pooled and weighted words go from indicative to not calibrated (bias 0.69 to 0.67), its final word staying not calibrated.

Wall times on 0.34 m, eight series and chairs, 8 jobs, beside other work on the machine: 2276 and 240 s with the oxygen limit, 2457 and 217 s with CO in two steps, 2035 and 217 s with neither.

Item 8's loose ends tool and the tenability, O2 by height and species tools, rerun with this branch's code on the saved R8 and R8b results, reproduce their recorded outputs; the tenability JSON differs only in a provenance list of harness data files changed since those runs.

Not included: the result files of these runs and the plan's text, which stay out of main; item 6 (gas radiation at less cost), which was stopped.

Plan 16.43 (second attempt) with the coordinator's decisions 16.44. With
gasRadiation 1 the gas's CO2 and H2O emit and absorb beside its soot by
the rank correlated spectral line weighted sum of gray gases: eight gray
gases and a clear one, from the tables of Pearson, Webb, Solovjov and Ma
(2014) at 1 atm (src/core/gasRadiation.js; radiationBands, marchBands and
burnerBands in flamescapes.js). It acts only with surfaceRayStart 1, with
a radiating burner only with flameRadiantOnce 1, and with the tables
passed to createSolver as gasTables; otherwise the solver refuses to start
and says why. CPU only: supported() in flamescapesGpu.js sends such a
scene to the CPU.

The switch defaults to 0; at 0 every output is as before and no table is
read. The run cache keys gasRadiation only when a run sets it, so
RUN_CACHE_VERSION does not rise. The worker fetches the tables only with
the switch on. The validation suite takes --gas-radiation (and
--gas-tables) and records the item's tallies in its ledger; backend-bench
passes the tables. Tools: tools/gas-radiation-check.mjs (the item's
checks), tools/gas-radiation-tables.mjs (builds the table file from
RadLib's two text files after checking their SHA-256) and
tools/calibration/item8-loose-ends.mjs (plan 16.50 point 10, 16.52 and
16.54 part D: ledgers, tallies and head height by series from saved
results; it runs no solver).

The tables: public/gas-radiation/gas-radiation-tables.f32 (2 226 560
bytes, float32, SHA-256 451d2caf...66e254e6), the values of RadLib
(Stephens, Jensen, Wheeler and Lignell 2022) at commit 583e0fe, files
data/rcslw_data/co2_p1_0.txt and h2o_p1_0.txt, under RadLib's MIT
licence. NOTICE.md beside the file gives the source, the licence text in
full and the two source files' SHA-256. Nothing of RadCal is in this
commit: the check tool reads RadCal's 72 reference values from the
results file already on main. The user decided on 2026-11-16 that the
tables are kept in the repository and credited (plan 16.44).

Source: flamescapes/gas-radiation-2 at 98ca598, which sits on
flamescapes/burner-rays 385dbec (items 12 and 14, already on main),
squashed as the diff 385dbec..98ca598; that diff holds no wiki change.
Conflicts with main's items 16 to 19 and 13, each resolved by keeping
both sides: the run cache's KEYED_SWITCHES (gasRadiation appended),
supported() (the timber line kept and the gas radiation line added),
flamescapes.js's header, imports, DEFAULTS and stats initialiser (item
8's tallies spread last), and eight places in validation-suite.mjs (the
option beside flameRadiantOnce, its tallies after the floor's). Item 8
had exported solidCapacity at its definition while main exports it at
the end of flamescapes.js; main's form is kept. Item 8's own lines in
every file are the source's, line for line.

Added: a unit test, src/core/flamescapes.gasRadiation.test.mjs (off by
default; set to 0 a run is the default's bit for bit and the tables'
reader is not called; the two refusals; on, a soot-free hot gas in a box
radiates to the walls, cools, and each step's emission is accounted for
within 1e-9 of it). It runs in about 0.3 s.

Checks on the branch's final tree (items 8, 4 and 5, every switch off
unless named). tools/gas-radiation-check.mjs judged 742 lines and none
failed: 739 in parts (a) to (m), the burner runs and (i)'s CPU part
against main's src/core at 300612b, and 3 in (k) 2 against main's suite;
every judged line reads as the builder's run at 98ca598, digit for
digit. (i)'s GPU part: tools/flamescapes-gpu-check.mjs, all phases, run
alternately on main and on the branch, two rounds; of 4970 leaves, 93
timings set apart and 4696 judged bit for bit against main's two runs,
0 differ, for each of the branch's two runs. The fingerprints stay
d62b581d and 29793d1a.
Plan 16.61, item 4: FDS's simplest extinction rule with FDS's default
constants, named with their source. With oxygenLimit 1 no gas fuel burns
in a cell whose oxygen mass fraction is under
Y_min (T_c - T) / (T_c - T_ambient); at or above 600 C it burns freely.
T_c and Y_min are the fuel's (FLAME_LIMITS: FDS's default, 1427 C and
0.135; methane, 1507 C and 0.139; heptane, 1497 C and 0.134; oxygen
volume fractions, turned into mass fractions). It acts on the fuel
vapour's combustion, on the burner (fuel a cell may not burn goes on to
the next and then waits, as fuel that finds no oxygen does) and, with
twoStepCO, on step 2. A solid's surface oxidation is left as it was. CPU
only: supported() sends such a scene to the CPU. The validation suite
takes --oxygen-limit.

The switch defaults to 0; at 0 every output is as before. The run cache
keys oxygenLimit when a run sets it, as it keys every other solver
switch; the source branch did not, and the line is added here.

Source: flamescapes/oxygen-limit-two-step-co at 0dab183, which sits on
item 8's 98ca598, squashed; no wiki change. Five conflicts in
validation-suite.mjs with main's items 16 and 18 and the storing
options, each resolved by keeping both sides. Item 4's own lines in the
solver and the GPU file are the source's, line for line.

Unit tests: src/core/flamescapes.oxygenLimit.test.mjs keeps the source's
fast checks (FDS's constants and the formula; no limit kept without the
switch, each fuel's and the burner's with it; a sealed volume held at
one temperature stops burning at the limit and keeps the oxygen the
formula gives; fuel vapour under the limit, over it and at or above
600 C) and adds one: set to 0, a burner room's run is the default's bit
for bit. It runs in about 0.9 s. The source's two checks that run the
whole solver for minutes of a room (a sealed room in which the burner
stops with oxygen left, and air in excess with an open door, the heat
released unchanged within 1 %; about 11 s together) moved unchanged to
tools/chemistry-checks/oxygen-limit.test.mjs, run by hand with
node --test. All pass on the branch's final tree.
Plan 16.61, item 5: the method of FDS's simple chemistry with two
reactions. With twoStepCO 1 gas fuel burns first to CO (two thirds of
its carbon, FDS's default), soot (the rest) and water, with the oxygen
that needs; the CO and soot beyond the fuel's final yields are the
intermediate products, carried with the gas and burnt to CO2 by the
oxygen left: at once in a burner's cell, elsewhere at the mixing rate
1 - exp(-dt / tau), tau the smaller of sqrt(2 h / g) and h^2 / D. Step
2's heats are the enthalpies of formation of CO and CO2. Complete
combustion gives the fuel's own yields and heat. It acts on the fuel
vapour's combustion and on the burner; a solid's surface oxidation burns
in one step as before. CPU only: supported() sends such a scene to the
CPU. The validation suite takes --two-step-co.

Two departures from FDS's method, accepted by the user on 2026-11-26
and disclosed here:
1. The intermediate products are two transported scalars per cell
   (sim.Yi: the CO and the soot that step 2 will burn), not one lumped
   intermediate species.
2. Where step 2 burns a burner's intermediate products away from the
   burner's own cells, the radiant fraction of that heat is held back
   and cast through the burner's rays on the next step
   (burner.lateRadiant), instead of radiating from the cells where
   step 2 burns.

The switch defaults to 0; at 0 every output is as before and sim.Yi is
null. The run cache keys twoStepCO when a run sets it (added here, as
for item 4).

Source: flamescapes/oxygen-limit-two-step-co at b46671d (3564043 and
b46671d, which corrects two FDS line numbers in comments), on 0dab183,
squashed; no wiki change. Four conflicts in validation-suite.mjs with
main's items 16 and 18 and the storing options, each resolved by keeping
both sides. Item 5's own lines in the solver and the GPU file are the
source's, line for line.

Unit tests: src/core/flamescapes.twoStep.test.mjs keeps the source's
fast checks (FDS's two thirds and the heats of formation; a fuel's two
steps close mass, carbon, oxygen and heat; changeGas and deposition keep
the intermediate products; with no oxygen left for step 2 the CO is step
1's; with air in excess the burner's fuel burns to its own yields and
heat within 1 %; carbon, oxygen and energy close on a sealed volume and
for fuel vapour short of oxygen; with the oxygen limit on, step 2 stops
under it) and adds one: set to 0, a burner room's run is the default's
bit for bit. It runs in about 1.7 s. The source's three checks that run
the whole solver for many steps of a room (air in excess in a sealed
room, a sealed room where the burner runs out of oxygen, and fuel vapour
in two steps; about 14 s together) moved unchanged to
tools/chemistry-checks/two-step-co.test.mjs, run by hand with
node --test. All pass on the branch's final tree.
@libishm1
libishm1 merged commit b3dec1d into main Nov 29, 2026
1 check passed
@libishm1
libishm1 deleted the flamescapes/radiation-chemistry branch November 29, 2026 19:32
@libishm1

Copy link
Copy Markdown
Owner Author

The GPU sprinkler observation did not replicate. Ten new rounds alternated with main 300612b, judged only among themselves by a rule fixed before the runs (real only if Evans reads higher and wetting lower on the branch, both Mann Whitney p < 0.05): Evans 33.99 MJ on main against 34.60 on the branch (p 0.36), wetting 31.80 against 31.63 (p 0.76), spray 36.18 against 36.93 (p 0.10). It is the run to run variation of the GPU sprinkler runs on main.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant