Chemistry · interface

SpeciesDefinition

Explained in Chemistry.

interface SpeciesDefinition
import type { SpeciesDefinition } from '@driftengine/chemistry';

Properties

NameTypeDescription
idreadonlystringUnique, and it is what a substance and a reaction name. Phase is part of it: H2O(l).
formulareadonlyReadonly<Record<string, number>>Moles of each element per mole of species, keyed by symbol.
More

Fractional subscripts are allowed and are not a compromise: an average protein residue is C4.4H7.7N1.2O1.4S0.04, and rounding those to integers breaks element balance by percent-scale amounts across a whole body.

phasereadonlyPhase
formationEnthalpyreadonlynumberStandard enthalpy of formation at 298.15 K, J/mol.
More

Every reaction's ΔH is derived from these by Hess's law rather than typed in, so a wrong value here is wrong in every reaction that touches the species at once — which is a bug that can be found, unlike a single reaction quietly disagreeing with its own species.

cpAreadonlynumberSpecific heat at 298.15 K, J/(kg·K).
cpBreadonlyoptionalnumberLinear coefficient, J/(kg·K²). Absent means a constant heat capacity.
pseudoreadonlyoptionalbooleanA lumped repeat unit or an average composition rather than a real molecule.