Simulation
Chemistry
147 symbols, imported from @driftengine/chemistry.
Explained in Chemistry.
Classes
AtmosphereFieldChemistryEventsChemistryWorldContactSet- Which parcels are touching, this tick.
ParcelStoreRadiativeSources- The radiating things in a scene this tick: flames and hot surfaces both.
ReactionRegistrySpeciesElementMatrixSpeciesRegistrySubstanceRegistry
Interfaces
AmbientStateAppearanceModel§17's three numbers: what a material looks like before it burns, after it burns, and how dirty its smoke is on the way.ArrheniusKineticsk(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.AtmosphereOptionsCardinalKinetics- A peaked curve: zero below
minimum, one atoptimum, zero abovemaximum. ChemistryWorldOptionsCompositionConductionModel- Everything about conduction that is a property of the substance, resolved once at registration.
Conductivity- W/(m·K):
k0at the standard state, rising byk1per 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.addBodytakes a body and for the same reason. RateTableReactionReactionGates- When a reaction is allowed to run at all.
ShellGeometrySpeciesAmountSpeciesDefinitionSubstanceLibrarySubstanceReactions- 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, matchingSpeciesRegistry.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.
enthalpyholds this parcel's shells atoffset, in joules. convectiveCoefficient- Convective heat transfer coefficient from the local gas speed, W/(m²·K).
elementIndex- The index of an element symbol, or
-1for 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.
fingerprintChemistryignites- 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.
localiseReactionsmassFractions- 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
dtseconds. 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.
shellGeometrysmoulders- 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.
tabulateArrheniusk(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·ΔTsits at holdingjoules. wetComposition- A composition with dry-basis moisture folded into it.
Types
ElementSymbolKineticsOcclusionTest- Whether anything solid stands between two points.
PhaseReactionKindShapeTier
Constants
ATOMIC_MASS- Conventional atomic weights, g/mol, indexed the way
ELEMENTSis. 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_OXYGENDEFAULT_LOWER_FLAMMABLE- Volume fractions between which a lumped volatile mixture will carry a flame.
DEFAULT_SMOULDERING_OXYGENDEFAULT_UPPER_FLAMMABLEELEMENT_COUNTELEMENTS- The elements, in the order the design lists them: organic first, then the rest.
EVENT_BOILEDEVENT_BROWNEDEVENT_CALCINEDEVENT_CARAMELISEDEVENT_CHARREDEVENT_CONDENSEDEVENT_CONSUMEDEVENT_CORRODEDEVENT_DECAYEDEVENT_DENATUREDEVENT_DISSOLVEDEVENT_EXPLODED- A confined deflagration crossed a pressure threshold.
EVENT_EXTINGUISHEDEVENT_FERMENTEDEVENT_FROZENEVENT_IGNITED- What happened this tick, as a buffer a caller drains.
EVENT_KIND_COUNTEVENT_MELTEDEVENT_SMOULDER_ENDEVENT_SMOULDER_STARTEVENT_STRUCTURAL_FAILEVENT_SUBLIMEDEXTINCT_BLOWN_OFFEXTINCT_COOLEDEXTINCT_FUELEXTINCT_NONE- Why a flame went out, or
-1where it did not. The order is the order they are checked in. EXTINCT_OXYGENGAS_CONSTANT- J/(mol·K).
KIND_BIOLOGICALKIND_BROWNINGKIND_CALCINATIONKIND_CHAR_OXIDATIONKIND_COMBUSTIONKIND_CORROSIONKIND_DENATURATIONKIND_DISSOLUTIONKIND_DRYING- What a reaction is: stoichiometry, a rate law, and what kind of change it represents.
KIND_PHASE_CHANGEKIND_PYROLYSISMAX_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_SPECIESMIN_MODEL_TEMPERATURE- K. Below this nothing in this engine is modelled, and a reading clamps rather than extrapolates.
PHASE_GASPHASE_LIQUIDPHASE_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_CYLINDERSHAPE_SLAB- A parcel's depth, as nested shells of equal mass.
SHAPE_SPHERESTANDARD_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_SPECIESSTANDARD_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_COUNTTIER_DISTANTTIER_FARTIER_HERO- Four levels of detail, and every one of them conserves.
TIER_NEARTIER_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.