Network Configuration (jaff.toml)
A jaff.toml carries network-scoped settings that belong to a network
rather than to a code-generation run — the per-reaction and global
temperature-cutoff behaviour and the duplicate policy. It lives alongside the network file and is
independent of jaffgen.toml, which
configures the jaffgen pipeline.
JAFF loads it from, in order:
- the
config=argument toNetwork(or--network-configonjaffgen); - otherwise a
jaff.tomlauto-detected in the network file's directory.
All keys live under the [network] table.
Temperature cutoffs
Every reaction carries a temperature validity range [Tmin, Tmax]. What happens
when the gas temperature tgas falls outside that range is controlled by the
reaction's temperature cutoff behaviour:
| Cutoff | Behaviour outside [Tmin, Tmax] |
|---|---|
clip |
tgas is clamped to the nearest bound, so the rate is frozen at its boundary value |
extrapolate |
tgas is left untouched, so the rate expression is evaluated (extrapolated) as-is |
clip is the default. Under clip, tgas in each rate expression is replaced by
max(min(tgas, Tmax), Tmin) (only the bounds that are defined are applied). Under
extrapolate, no clamp is inserted and the raw tgas symbol survives into the
generated code.
# Global default applied to every reaction
[network.rates]
T_cutoff = "clip" # "clip" (default) or "extrapolate"
# Per-reaction override, keyed by the reaction's serialized form
[network.reactions."CO._PHOTON__C.O"]
T_cutoff = "extrapolate"
Values are case-insensitive; anything other than clip or extrapolate raises a
ParserError.
Reaction keys are serialized names
The per-reaction key is the reaction's serialized form:
<reactants>__<products>, where each side is a .-joined list of species
names sorted alphabetically. Special pseudo-species keep their underscore
prefix (e.g. _PHOTON, _CR). For CO + PHOTON -> C + O this is
CO._PHOTON__C.O. The . separators mean the key must be quoted in the
TOML table header. The cutoff is baked into the rate expression at load
time, so a .jaff file saved afterwards already carries the resolved
behaviour and does not need the config on reload.
For a reaction defined over a single temperature range, clip replaces
tgas with max(min(tgas, Tmax), Tmin) as above. When a reaction is defined
over multiple disjoint ranges (merged into a piecewise rate — see
Temperature ranges and piecewise rates),
T_cutoff governs only the outer edges: below the first range and above the
last, clip holds the boundary rate while extrapolate lets the end segments
run on. Gaps between adjacent ranges are always interpolated between the two
boundary rates (linearly in \(\log k\) when both are positive, linearly in \(k\)
otherwise), independent of T_cutoff.
Photoionization database
Photoionization reactions may override the global database:
The key is only valid on photoionization reactions (any other reaction raises a
ParserError); a value from jaffgen.toml wins over jaff.toml.
jaff.toml has no [network.radiation] table. The global choice lives in
jaffgen.toml
([network.radiation] pi_database) or, in Python, in
RadiationProps(bands=[...], pi_database="verner"). The default is norad.
Custom photo rates under radiation
With radiation enabled, a photo reaction with a .jfunc chemRate<N> keeps that
custom rate by default. A custom rate does not depend on the transported field, so
the reaction is not coupled to the radiation bands: it removes no photons, and
JAFF logs a warning naming it. To couple it, either replace the chemRate<N> with
a
photoCrossSection<N>,
or set override_custom_rate = true, which recomputes its rate from the database
cross sections and ignores the chemRate<N> without editing the .jfunc:
The key takes true or false and is only valid on photo reactions (any other
reaction raises a ParserError); a value from jaffgen.toml wins over
jaff.toml, and a per-reaction value wins over the global flag. Without
radiation it has no effect: there is no cross-section rate to use.
The global flag lives in
jaffgen.toml
([network.radiation] override_custom_rate) or, in Python, in
RadiationProps(bands=[...], override_custom_rate=True). The default is false.
Custom photo cross sections
A photo reaction with a .jfunc
photoCrossSection<N>
uses that cross section instead of the database one. Setting
override_custom_cross_section = true ignores the function and uses the
database cross section:
The key takes true or false and is only valid on photo reactions (any other
reaction raises a ParserError); a value from jaffgen.toml wins over
jaff.toml, and a per-reaction value wins over the global flag. Unlike
override_custom_rate it applies with or without radiation, since it decides
which cross section the reaction stores.
The global flag lives in
jaffgen.toml
([network.radiation] override_custom_cross_section) or, in Python, in
RadiationProps(bands=[...], override_custom_cross_section=True). The default is
false.
Resolution order
The same settings can also appear in jaffgen.toml
under an identical [network.rates] / [network.reactions."<srxn>"] schema.
When both files supply a value, they are resolved per reaction as (highest wins):
jaffgen.tomlper-reactionT_cutoffjaff.tomlper-reactionT_cutoffjaffgen.tomlglobal ([network.rates])T_cutoffjaff.tomlglobal ([network.rates])T_cutoff- built-in default
clip
A per-reaction setting always wins over any global one; within the same
scope, jaffgen.toml overrides jaff.toml. In short: jaffgen.toml lets a
particular code-generation run override the network's own defaults, without
editing jaff.toml.
Duplicate policy
When two rate coefficients share the same reaction, mechanism (type), and
temperature range [Tmin, Tmax], duplicate_policy decides how the clash is
resolved during network construction:
| Policy | Behaviour |
|---|---|
preserve-first |
Keep the first coefficient seen; drop later duplicates (default) |
preserve-last |
Keep the last coefficient seen; discard earlier ones |
error |
Raise a ParserError — the clash must be fixed in the source network |
Resolution order (highest wins):
--duplicate-policyCLI flag (jaffgen/jaffx)jaffgen.toml[network].duplicate_policy(jaffgenonly)jaff.toml[network].duplicate_policy- built-in default
preserve-first
Unlike T_cutoff, this is a single network-wide key — there is no per-reaction
form.