Simulation

Chemistry

147 symbols, imported from @driftengine/chemistry.

Explained in Chemistry.

Classes

AtmosphereField
ChemistryEvents
ChemistryWorld
ContactSet
Which parcels are touching, this tick.
ParcelStore
RadiativeSources
The radiating things in a scene this tick: flames and hot surfaces both.
ReactionRegistry
SpeciesElementMatrix
SpeciesRegistry
SubstanceRegistry

Interfaces

AmbientState
AppearanceModel
§17's three numbers: what a material looks like before it burns, after it burns, and how dirty its smoke is on the way.
ArrheniusKinetics
k(T) = A · T^n · exp(−Ea / R·T). Monotonic in temperature, which is right for everything a flame does and wrong for everything an enzyme does.
AtmosphereOptions
CardinalKinetics
A peaked curve: zero below minimum, one at optimum, zero above maximum.
ChemistryWorldOptions
Composition
ConductionModel
Everything about conduction that is a property of the substance, resolved once at registration.
Conductivity
W/(m·K): k0 at the standard state, rising by k1 per kelvin.
DiffusionKinetics
Arrhenius, capped by how fast the reactant can physically reach the surface.
IgnitionModel
Ignition is a criterion, not a flag — and extinction is four of them.
InstantKinetics
As fast as the reactants allow: the clamp in the solver is the only thing limiting it.
ParcelSpec
What a parcel is made of and how big it is. An object rather than seven positional arguments, which is how PhysicsWorld.addBody takes a body and for the same reason.
RateTable
Reaction
ReactionGates
When a reaction is allowed to run at all.
ShellGeometry
SpeciesAmount
SpeciesDefinition
SubstanceLibrary
SubstanceReactions
A substance's reactions, localised and packed.
SubstanceThermal

Functions

ambientCellMass
Mass of each tracked species in one cell of ambient air, kg.
boilingPoint
@param referenceTemperature K, where this liquid boils at referencePressure @param latentHeat J per kilogram of the species that changes phase @param molarMass kg/mol, matching SpeciesRegistry.molarMass @param pressure Pa
cardinalRate
The peaked curve an enzyme-catalysed rate actually follows, normalised to one at the optimum.
compositionElements
Moles of each element in one kilogram of a composition. Writes into out, allocates nothing.
conductShells
Move heat inward one step. enthalpy holds this parcel's shells at offset, in joules.
convectiveCoefficient
Convective heat transfer coefficient from the local gas speed, W/(m²·K).
elementIndex
The index of an element symbol, or -1 for anything this package does not carry.
elementTotals
Reduce kilograms per species into moles per element.
extinguishes
Whether a flame stops, and which of the four reasons it was.
fingerprintChemistry
ignites
Whether all five conditions for flaming ignition hold.
ignitionProgress
How close a parcel is to catching, 0 to 1.
installLibrary
Species, then reactions, then substances — skipping whatever is already registered.
localiseReactions
massFractions
A composition from species ids and mass fractions.
maxElementDrift
How far two element vectors have drifted apart, for the conservation harness.
phaseChange
A phase change, as the reaction it actually is.
radiantFlux
Radiant flux onto a surface, W/m².
rateAt
The rate at a temperature.
reactShell
Run one shell's reactions for dt seconds.
registerStandardSpecies
Register the whole standard set into a registry, in order.
saturationVapourPressure
Saturation vapour pressure of water, Pa, by the Magnus form.
sensibleEnthalpy
Specific enthalpy of a species at a temperature, J/kg, zero at the standard state.
shellGeometry
smoulders
Whether a smoulder can persist: char present, and oxygen above the far lower index it needs.
sourceRange
How far a source of a given power is worth considering, m.
surfaceFuelFraction
The fuel fraction at the surface, which is not the fuel fraction in the room.
tabulateArrhenius
k(T) = A · T^n · exp(−Ea / R·T), sampled once so the tick never evaluates it.
tabulateCardinal
A cardinal curve scaled to a peak rate, tabulated the same way an Arrhenius one is.
temperatureFromCapacity
The temperature a body of heat capacity A + B·ΔT sits at holding joules.
wetComposition
A composition with dry-basis moisture folded into it.

Types

ElementSymbol
Kinetics
OcclusionTest
Whether anything solid stands between two points.
Phase
ReactionKind
Shape
Tier

Constants

ATOMIC_MASS
Conventional atomic weights, g/mol, indexed the way ELEMENTS is.
BLOW_OFF_SPEED
m/s of local gas past a surface, beyond which a flame cannot anchor and is blown off.
CHUNK_CELLS
Cells along one edge of a chunk.
CHUNK_SIZE
Metres along one edge of a chunk, at the default cell size.
DEFAULT_LIMITING_OXYGEN
DEFAULT_LOWER_FLAMMABLE
Volume fractions between which a lumped volatile mixture will carry a flame.
DEFAULT_SMOULDERING_OXYGEN
DEFAULT_UPPER_FLAMMABLE
ELEMENT_COUNT
ELEMENTS
The elements, in the order the design lists them: organic first, then the rest.
EVENT_BOILED
EVENT_BROWNED
EVENT_CALCINED
EVENT_CARAMELISED
EVENT_CHARRED
EVENT_CONDENSED
EVENT_CONSUMED
EVENT_CORRODED
EVENT_DECAYED
EVENT_DENATURED
EVENT_DISSOLVED
EVENT_EXPLODED
A confined deflagration crossed a pressure threshold.
EVENT_EXTINGUISHED
EVENT_FERMENTED
EVENT_FROZEN
EVENT_IGNITED
What happened this tick, as a buffer a caller drains.
EVENT_KIND_COUNT
EVENT_MELTED
EVENT_SMOULDER_END
EVENT_SMOULDER_START
EVENT_STRUCTURAL_FAIL
EVENT_SUBLIMED
EXTINCT_BLOWN_OFF
EXTINCT_COOLED
EXTINCT_FUEL
EXTINCT_NONE
Why a flame went out, or -1 where it did not. The order is the order they are checked in.
EXTINCT_OXYGEN
GAS_CONSTANT
J/(mol·K).
KIND_BIOLOGICAL
KIND_BROWNING
KIND_CALCINATION
KIND_CHAR_OXIDATION
KIND_COMBUSTION
KIND_CORROSION
KIND_DENATURATION
KIND_DISSOLUTION
KIND_DRYING
What a reaction is: stoichiometry, a rate law, and what kind of change it represents.
KIND_PHASE_CHANGE
KIND_PYROLYSIS
MAX_MODEL_TEMPERATURE
K. Above this likewise — past any flame this model produces.
MAX_SHELLS
The most shells a parcel may have.
MAX_SUBSTANCE_REACTIONS
Reactions one substance may declare, and species one substance may hold.
MAX_SUBSTANCE_SPECIES
MIN_MODEL_TEMPERATURE
K. Below this nothing in this engine is modelled, and a reading clamps rather than extrapolates.
PHASE_GAS
PHASE_LIQUID
PHASE_MIXED
A parcel made of more than one phase at once, which is most of them.
PHASE_SOLID
What a species is: a formula, a phase, a formation enthalpy and a heat capacity.
SHAPE_CYLINDER
SHAPE_SLAB
A parcel's depth, as nested shells of equal mass.
SHAPE_SPHERE
STANDARD_AIR
Dry air at 20 °C and one atmosphere, at 50% relative humidity.
STANDARD_FIELD_SPECIES
The gas species a field tracks unless a consumer names its own.
STANDARD_PRESSURE
The pressure every standard state in this package is anchored at, Pa.
STANDARD_PRESSURE_PA
Pa.
STANDARD_SPECIES
STANDARD_TEMPERATURE
The temperature every standard state in this package is anchored at, K.
STEFAN_BOLTZMANN
W/(m²·K⁴).
SUM_TOLERANCE
How far a hand-written composition may be from summing to one.
TIER_CADENCE
Ticks between updates. A parcel skipped for three ticks is stepped with four ticks of dt.
TIER_COUNT
TIER_DISTANT
TIER_FAR
TIER_HERO
Four levels of detail, and every one of them conserves.
TIER_NEAR
TIER_SHELLS
Shells each tier resolves to, capped by what the substance declared.
TIER_SUBSTEPS
The most sub-steps a reaction solve will take at this tier.