Physics Reference

Every physical law, model, and theory the CurPay Quantum Universe simulation uses, together with the exact constant values it runs with. All quantities are in simulation units (px, ticks, simulation mass). Values are pulled live from the running simulation, and each entry links to the real-world reference for the law or theory it models.

← Back to the simulation

Loading live values from the running simulation…

Units & time calibration

A tick has no intrinsic duration, so the simulation calibrates one. Lengths are in pixels (px), masses in simulation mass units.

Gravitational constant (simulation)

Tuned so a planet at the habitable-zone mid-radius (~40 px) of a mass-100 star orbits in ~600 ticks.

G_SIM = (2π/600)² · 40³ / 100 ≈ 0.07
SymbolValueMeaning
GSim0.07Gravitational constant in sim units

Simulation calibration constant (no external reference) — derived from Kepler's third law.

Speed of light (simulation)

Keeps post-Newtonian corrections subtle for ordinary orbits but dramatic near black holes. Velocities are clamped so they never exceed it.

c_SIM = √(c_SIM²) ≈ 7.07 px/tick
SymbolValueMeaning
CSim250.0c² in sim units
CSim√50 ≈ 7.071c (speed limit) in px/tick

Simulation calibration constant (no external reference) — models the speed of light as an enforced limit.

Cosmological time mapping

Maps simulation ticks to cosmological years. With the default, the primordial-black-hole window (~400 ticks) sits at ~400 Myr and a mature run (~13,800 ticks) at ~13.8 Gyr.

years = ticks × YearsPerTick Gyr = ticks × YearsPerTick / 1e9
SymbolValueMeaning
YearsPerTick1.0e61 tick = 1,000,000 years (1 Myr)

Reference: Age of the universe (calibrated so a mature run reaches ~13.8 Gyr).

Cosmology — ΛCDM energy budget & expansion

Mirrors the real universe with Planck-like defaults. Only the baryon slice forms stars/planets/gas; dark matter funds galaxy halos; dark energy drives expansion and forms nothing.

ΛCDM density parameters (Ω)

Fractions of the total mass-energy budget. The energy budget for a total is split as (total·Ω).

(darkEnergy, darkMatter, baryon) = (total·ΩΛ, total·Ω_dm, total·Ω_b)
SymbolValueMeaning
OmegaDarkEnergy0.685Λ — cosmological constant
OmegaDarkMatter0.265cold dark matter halos
OmegaBaryon0.050ordinary matter (forms objects)

Reference: ΛCDM model; values from the Planck 2018 results.

Hubble expansion (Hubble's law)

A subtle expansion drift applied per tick that grows recession with distance.

v_recession ∝ H_SIM · distance
SymbolValueMeaning
HSim0.00005Hubble constant in sim units

Reference: Hubble's law.

Dark-energy driven acceleration (cosmological constant)

Extra Hubble-flow rate from vacuum energy, accumulating with cosmic age. The cosmic fate modulates it: a Big Rip applies phantom (×6) acceleration; a Big Crunch zeroes Λ as gravity wins.

Λ(age) = VacuumEnergyDensity · max(0, age) big-rip : Λ ×= 6 (phantom acceleration) big-crunch: Λ = 0 (gravity overwhelms Λ) rate = min(DarkEnergyMax, Λ)
SymbolValueMeaning
VacuumEnergyDensity1.2e-9per-tick vacuum energy accrual
DarkEnergyMax0.00045cap on dark-energy Hubble rate

Reference: Cosmological constant and dark energy; fates from the Big Rip / Big Crunch scenarios.

Cosmic inflation & primordial power spectrum

An exponential early expansion that freezes in quantum density fluctuations. The fluctuations follow a red-tilted, near-scale-invariant power spectrum P(k) ∝ k^(n_s−1) and seed where galaxies later form.

a(t) = e^(N · progress) (scale factor) P(k) = k^(n_s − 1) (primordial power) σ(k) = FluctuationRms · √P(k) (mode amplitude)
SymbolValueMeaning
InflationEfolds60N — number of e-folds
SpectralIndex0.965n_s (red-tilted)
FluctuationRms1.0RMS of frozen-in fluctuations
PrimordialSeedCount64seed overdensities at the Big Bang

Reference: Cosmic inflation and the scalar spectral index n_s (Planck-measured).

Gravity & general relativity

Newtonian gravity plus post-Newtonian, Schwarzschild, and Kerr corrections that become significant near compact objects. Each correction is an acceleration delta added to the Newtonian term per tick.

Newtonian gravitation

The baseline inverse-square attraction between masses.

a_N = G_SIM · M / r²

Reference: Newton's law of universal gravitation.

1PN perihelion precession (post-Newtonian)

First post-Newtonian correction that makes orbits precess, like Mercury's perihelion advance.

pre = G·M / (r²·r·c²) radial = 4·G·M/r − v² tangential = 4·(r·v)

Reference: Post-Newtonian expansion; see relativistic apsidal precession.

Gravitational-wave radiation reaction (Peters)

Energy loss to gravitational waves that shrinks tight binaries and drives inspirals.

a = −(32/5) · G³·M²·m / (c⁵·r⁴) · v c⁵ = c²·c²·c
ConstantValueMeaning
coefficient32/5Peters quadrupole prefactor

Reference: power radiated by orbiting bodies (Peters & Mathews quadrupole formula).

Schwarzschild geodesic (curved spacetime)

Weak-field equatorial expansion of motion around a non-rotating black hole, plus its event-horizon (Schwarzschild) radius.

r_s = 2·G·M / c² (event horizon) factor = 1 + (r_s/r)·(2 − v²/c² + 4·v_r²/c²) a = (G·M/r²) · factor

Reference: Schwarzschild metric and Schwarzschild radius.

Kerr frame-dragging (Lense–Thirring)

A spinning black hole drags spacetime around it, adding a velocity-perpendicular cross term. The same Kerr spin also powers a magnetic Blandford–Znajek jet when the hole is threaded by the MHD field.

J = spin · M · r_s · c · 0.5 (angular momentum) a = 2·G·J / (c²·r³) ⊥ velocity

Reference: Frame-dragging (Lense–Thirring effect) around a Kerr black hole.

Gravitational time dilation

Clocks run slower deep in a gravity well; reaches zero at the horizon.

dτ/dt = √(1 − r_s/r), in [0, 1]

Reference: Gravitational time dilation.

Tidal acceleration

Differential gravity across a body of half-size δ; drives spaghettification and disruption.

a_tidal = 2·G·M·δ / r³

Reference: Tidal force (and spaghettification).

Gravitational lensing

Light bending around a (possibly moving) mass, with velocity-dependent aberration that breaks the symmetry for a moving black hole.

deflection = 4·G·M / c² · strength / r²
ConstantValueMeaning
strength1.0 (default)lensing intensity multiplier

Reference: Gravitational lens (light deflection 4GM/c²r).

Orbital mechanics (Kepler)

Circular and near-circular orbital motion derived from Newtonian gravity.

Keplerian angular velocity

Angular speed of a circular orbit; the basis of orbital periods and the tidal mean motion n.

ω = √(G·M / r³) (rad/tick) T = 2π√(a³ / G·M) (period)

Reference: Kepler's third law (and mean motion).

Galaxy merging threshold

Minimum separation before two galaxies are allowed to merge.

SymbolValueMeaning
GalaxyMergeDist55.0 pxmerge distance threshold

Simulation tuning value (no external reference) — models galaxy mergers.

Quantum limits & degeneracy pressure

Quantum-mechanical mass limits the classical core cannot express: electron and neutron degeneracy set the fate of stellar remnants.

Degeneracy pressure

Qualitative non-relativistic degeneracy pressure supporting white dwarfs and neutron stars.

P ∝ ρ^(5/3), ρ = mass / radius³

Reference: Electron degeneracy pressure.

Chandrasekhar limit

A white dwarf above this mass cannot be supported by electron degeneracy and detonates as a Type Ia supernova.

SymbolValueMeaning
ChandrasekharLimit40.0white dwarf → Type Ia

Reference: Chandrasekhar limit (≈ 1.4 M☉ in reality; scaled here to sim mass units).

Tolman–Oppenheimer–Volkoff (TOV) limit

A neutron star above this mass overcomes neutron degeneracy and collapses into a black hole.

SymbolValueMeaning
TovLimit110.0neutron star → black hole

Reference: Tolman–Oppenheimer–Volkoff limit (≈ 2.2–2.9 M☉ in reality; scaled here to sim mass units).

Quantum entanglement entropy & decoherence

Entangled black-hole pairs (used for wormholes) lose coherence exponentially each tick; the entropy is the von-Neumann form, maximal (ln 2) at p = 0.5.

decohere: e ← e · (1 − rate) entropy : S = −[p·ln p + (1−p)·ln(1−p)]
SymbolValueMeaning
DecoherenceRate0.0008per-tick entanglement erosion

Reference: von Neumann entropy and quantum decoherence.

Quantum random number generator (QRNG)

Randomness is seeded from genuine simulated-qubit sampling rather than a classical PRNG. Each draw prepares a register, mixes the amplitudes (Hadamard / phase rotations), and measures it to collapse out an integer; wider values are assembled from several of these small draws one bit at a time.

draw ∈ [0, 2^QubitsPerDraw) (Born-rule measurement)
SymbolValueMeaning
QubitsPerDraw8 qubits (2^8 = 256 states)qubits measured per quantum draw

Reference: quantum random number generation and qubit measurement (Born rule). Register size is kept small because the state-vector simulator is exponential in qubit count.

Stellar fusion ignition (Gamow)

Quantum tunnelling lets protons fuse; below the hydrogen-burning minimum a collapsing object becomes a brown dwarf instead of a star.

Gamow-factor ignition probability

A logistic turn-on around the burning minimum decides whether a protostar ignites hydrogen fusion.

x = (mass − HydrogenBurningMin) · GamowSharpness P_ignite = 1 / (1 + e^(−x)) ignites if roll < P_ignite (and mass ≥ min)
SymbolValueMeaning
HydrogenBurningMin20.0brown-dwarf / star boundary
GamowSharpness0.5steepness of the ignition turn-on

Reference: Gamow factor (quantum-tunnelling fusion) and the hydrogen-burning minimum mass.

Eddington limit & radiation coupling to the gas grid

A star is not an isolated light bulb — it is coupled to the continuum radiation transport. Each tick every living star samples the local Rosseland-mean opacity κ at its position (the same opacity model the gas / FLD solver uses) and its nominal luminosity L ∝ M3.5 is capped at the Eddington luminosity L_Edd, above which radiation pressure overwhelms gravity and the star sheds its outer layers. The capped effective luminosity is what the rest of the simulation uses (habitable zone, planet irradiation, snapshots), and a fraction of it is injected back into the gas as a radiation-pressure source, so stars genuinely drive the radiation field — photon diffusion, ionization fronts and the build-up to reionization — exactly like the AGN / supernova sources. With no gas grid attached (or no opacity model) the cap and injection vanish and stars shine at their nominal luminosity, so behaviour is unchanged.

κ = κ(ρ, T, Z) (sampled from the radiation opacity model at the star) L_Edd = EddScale · G · M / max(κ, κ_min) (radiation-pressure ceiling) L_eff = min(L, L_Edd) (Eddington-limited luminosity) radiation source += min(L_max, RadPower · L_eff) (star irradiates the gas grid)
SymbolValueMeaning
EddScale (EddingtonScale)6.0sim-normalised Eddington-luminosity scale
M_ref (ReferenceMass)100.0reference stellar mass for normalisation
κ_min (MinOpacity)1.0e-3opacity floor (keeps L_Edd finite in the diffuse IGM)
RadPower (StellarRadiationPower)0.15fraction of L_eff injected as a radiation source
L_max (StellarRadiationMaxPerStar)4.0clamp on a single star's injected power

Reference: Eddington luminosity (radiation-pressure limit), mass–luminosity relation, and radiation pressure.

Planetary physics

Scaled, qualitative surface/interior physics driving temperature, tidal heating, and tidal destruction.

Radiative-equilibrium temperature (airless baseline)

Surface temperature of an airless grey body, scaled so a mid-HZ world (~40 px, L≈1) reads ~1.0. Albedo reflects flux; a greenhouse multiplier warms it further. Used as the fallback when no gas grid is attached — otherwise the radiation-coupled model below applies.

flux = (1 − albedo) · L / r² T = flux^(1/4) · T_K · greenhouse
SymbolValueMeaning
T_K40.0temperature scale factor
albedo0.3 (default)fraction of light reflected
greenhouse1.0 (default)warming multiplier

Reference: Planetary equilibrium temperature.

Radiation-coupled surface temperature (opacity greenhouse & ambient bath)

When the continuum is attached, the planet's surface temperature is computed with real radiation-transport-aware terms layered on the grey-body baseline. (1) Optical-depth greenhouse: the planet's atmosphere has a Rosseland optical depth τ = κ·Σ (local opacity × a mass-scaled column), and a grey atmosphere warms the surface by (1 + ¾τ)1/4 — thicker, more opaque air runs hotter, using the same opacity model the gas solver uses. (2) Ambient radiation bath: a world immersed in the continuum radiation field (energy density E_r sampled at the planet) is heated by it in addition to its star's inverse-square flux, via T4 ∝ flux + w·E_r — negligible in empty space, but dominant inside an HII region or reionised gas. Planets also use each star's effective (Eddington-limited) luminosity. With τ→0 and E_r→0 this reduces exactly to the airless baseline above.

τ = κ · Σ(M, albedo) (atmospheric optical depth; sampled opacity) T_eq = (flux_star + w·E_r)^(1/4) · T_K (stellar flux + ambient radiation bath) greenhouse_τ = (1 + g_τ·τ)^(1/4) (grey-atmosphere greenhouse) T = T_eq · max(greenhouse, greenhouse_τ)
SymbolValueMeaning
g_τ (GreenhouseOpticalDepthGain)0.75optical-depth greenhouse coefficient
τ_max (MaxOpticalDepth)30.0optical-depth cap (no runaway atmosphere)
w (AmbientRadiationWeight)0.5weight of the ambient radiation bath vs. stellar flux

Reference: grey / idealised greenhouse model, optical depth, and radiative transfer.

Tidal heating rate

Per-tick internal heating that spikes close to the star and is amplified on eccentric orbits (drives volcanism, e.g. an Io-like world).

rate = R_body⁵ · M² / r⁶ · (1 + 6·e²) · 1e3
ConstantValueMeaning
eccentricity boost1 + 6·e²eccentric-orbit amplification
scale1e3per-tick rate scaling

Reference: Tidal heating (e.g. tidal heating of Io).

Roche limit

Distance inside which tidal forces overcome a body's self-gravity and shred it into a debris/ring stream.

ratio = ∛(2·M_primary / M_body) Roche = r_primary · ratio · 0.06
ConstantValueMeaning
scale0.06sim-unit Roche scaling

Reference: Roche limit.

Tides & spin evolution (tidal locking)

The star raises a tidal bulge on the planet; friction drags it off the star–planet line and the resulting torque pushes the spin toward synchronous rotation. The steep 1/r⁶ falloff is why only close-in planets ever lock.

Tidal torque

Torque on the planet's spin ω, driving it toward the mean motion n; vanishes when ω = n (tidally locked). Q is the tidal dissipation quality factor. Molten / strongly tidally-heated worlds have a soft, lossy interior, so their torque is boosted (up to MoltenBoost×, ~3e-4 effective) and they lock fastest.

τ = −3·G·M⋆²·Rp⁵ / (Q·r⁶) · (ω − n) · TorqueScale · MeltBoost n = mean motion (Keplerian orbital angular velocity) MeltBoost = 1 … MoltenBoost (volcanic / tidally-heated ⇒ molten regime)
SymbolValueMeaning
TorqueScale1e-4couples physical magnitude to sim time (close-in worlds lock in a few hundred Myr)
factor3tidal-torque prefactor
MoltenBoost3.0extra torque on molten / tidally-heated worlds (~3e-4 effective)

Reference: Tidal locking and tidal acceleration (Q = tidal quality factor).

Dissipation Q, eccentricity damping & sub-stepping

Q is the inverse efficiency of tidal dissipation (torque ∝ 1/Q): small Q (molten) locks fast, huge Q (gas giants) barely changes spin. The body type is inferred from mass/state, Q is suppressed when young (hot, soft interior) and relaxes upward as the planet ages and cools, and far-out rocky worlds get an extra Q multiplier so locking effectively switches off beyond the close-in zone (matching the 1/r⁶ reality). On an eccentric orbit there is no single synchronous spin, so the orbit must circularize first — damping is stronger close-in and at high e. The spin update is integrated in sub-steps so a large tick approaches synchronous smoothly without overshooting.

Q(type): molten < rocky < ice giant < gas giant Q_eff = Q·ageScale·distScale eₘ₁ = e − k_e·dt k_e ∝ EccDampRate·(1 + prox)·(1 + 2·e) sub-steps = clamp(⌈|Δω|/lockBand⌉, 1, 16) locked when |ω−n|/n ≤ 0.02
SymbolValueMeaning
Q molten3molten / volcanic rocky worlds — lock fastest
Q rocky18Earth-like rocky worlds (~12; 15–20)
Q ice giant1200ice giants — locking very slow
Q gas giant12000gas giants — effectively never lock
EccDampRate2e-6base eccentricity damping per tick (×(1+2e) at high e)

Reference: tidal circularization and the tidal quality factor Q by body type.

Supernova mass budget (conservation)

A conserving accounting of where a core-collapse supernova's mass goes. The progenitor splits into eight physical sinks plus the compact remnant; their sum equals the progenitor mass, so strict baryonic conservation is never violated.

Eight sinks + remnant

Sinks 1–4 stay as baryons (return to the interstellar medium); sinks 5–7 leave forever as mass-energy.

ISM return = Ejecta + MetalYield + Dust radiated = NeutrinoLoss + PhotonLoss + CosmicRays + GWLoss Total = ISM return + radiated + RemnantMass ≡ ProgenitorMass
SinkFateMeaning
Ejectabaryon → ISMplasma shells swept into the medium
MetalYieldbaryon → ISMnew heavy elements (O, C, Si, Fe/Ni)
Dustbaryon → ISMgrains condensing from cooling ejecta
CosmicRaysradiatedshock-accelerated nuclei that leave
NeutrinoLossradiatedneutrino burst (bulk of the energy)
PhotonLossradiatedradiated light (visible explosion)
GravitationalWaveLossradiatedGW emission from asymmetric collapse
RemnantMassboundcompact object left behind (NS/BH)
SymbolValueMeaning
conservation tolerance1e-6max allowed accounting drift

Reference: Core-collapse supernova and conservation of mass-energy.

Wormholes — ER=EPR & Casimir traversability

Entangled black holes (ER=EPR) connect via a throat that stays open only while enough exotic (negative) Casimir energy is available.

Casimir exotic energy & traversability

Negative vacuum energy between throat walls a distance d apart props the throat open; the wormhole is traversable while the exotic-energy budget stays above the threshold.

ρ_Casimir = −CasimirCoeff / d⁴ traversable if exoticEnergy ≥ ExoticThreshold
SymbolValueMeaning
CasimirCoeff4.0e6Casimir energy coefficient
ExoticThreshold0.35min exotic energy to stay open

Reference: ER=EPR conjecture, the Casimir effect, and traversable wormholes.

Simulation world configuration

Tunable bounds and population caps for the server-authoritative engine. Not physical laws, but the parameters the physics runs inside. The mass budget and runtime profile are read from appsettings.json (the Simulation section) so they can be changed without recompiling.

World & population parameters

SymbolValueMeaning
Width × Height1280 × 720 pxworld bounds (mirror canvas size)
MaxGalaxies100hard cap on galaxies across clusters
Max_Mass250000total baryon+dark mass budget stamped onto Universe.MassTotal at the Big Bang (Simulation:MaxMass in app config)
SimulationProfileLongRun24x7runtime profile (Scientific = unconstrained emergence; LongRun24x7 = bounded-population guardrails, seeded from Simulation:Profile at startup)
PlanetInnerOrbit40.0 pxinner-orbit threshold for stellar-death exposure
MatterStreamCap1400max accretion-debris particles
MatterParticlesPerEvent24debris particles per disruption event
RogueCaptureRadiusFactor1.6rogue-planet capture radius factor
RogueCaptureMaxSpeed1.4max speed for rogue capture
RogueHitStar4.5rogue-into-star collision radius

Simulation tuning parameters (no external reference) — engine bounds and population caps.

Runtime ownership & app-config seeding

One process-wide SimulationRuntime owns the single server-authoritative universe: it holds the Universe aggregate (all mass, galaxies, stars, planets and the conserved MassTotal), its quantum-seeded RNG and event log, advances the world on the hosted tick loop, and serialises every interaction (tick, snapshot, and client commands) through one lock. Its SimConfig is bound from the Simulation section of appsettings.json at startup, so two settings are established before the first frame: Max_Mass is stamped onto Universe.MassTotal at the Big Bang and split into the ΛCDM dark-energy / dark-matter / baryon budget (only baryons form objects), and SimulationProfile is applied via SetSimulationProfile so a LongRun24x7 selection also enables the public-performance preset and hides the profile selector in the sidebar. Because the mass budget is fixed once at the Big Bang and never changes, mass is conserved for the whole lifetime of a universe.

Universe.MassTotal = Max_Mass (stamped once at Big Bang, then invariant) ΩΛ : Ω_dm : Ω_b split of Max_Mass; FreeMass = baryon budget (forms stars/planets/gas) SimConfig ← appsettings.json "Simulation"{ MaxMass, Profile }; Profile ⇒ SetSimulationProfile() at startup

Engine composition / configuration wiring (no external reference) — SimulationRuntime + Universe + SimConfig.

Continuum physics — gas-grid realism layer

Beyond the N-body entities, the engine runs a structure-of-arrays gas grid through a unified UniversePhysicsPipeline every tick. Ten field-based modules execute in a fixed, physically-ordered sequence and feed one another: hydro moves gas → MHD / radiation / cosmic rays act on it → chemistry enriches it → the ISM classifies its phases → disks transport angular momentum → stars form → feedback injects energy → neutrinos fire during core collapse. These are the same realism domains used by modern astrophysical codes (AREPO, GIZMO, IllustrisTNG, EAGLE), implemented here as fast, qualitative sim-unit models.

Pipeline execution order & shared EOS

Every module operates on the shared ContinuumState grid and reads one ideal-gas equation of state, so all consumers see a consistent thermodynamic state. Modules are dependency-injected as IPhysicsModule and ordered by PhysicsOrder.

P = (γ − 1)·ρ·e T = (γ − 1)·e·μ·m_H / k_B c_s = √(γP/ρ) (adiabatic sound speed) order: Hydro → MHD → Radiation → CosmicRays → Chemistry → ISM → AngularMomentum → StarFormation → Feedback → Neutrinos
SymbolValueMeaning
γ (gas)5/3adiabatic index (monatomic gas)
μ0.6mean molecular weight (ionised H/He)
a_rad1.0e-3radiation constant (sim units)
Z_☉0.014solar metallicity reference
γ_cr4/3cosmic-ray (relativistic) adiabatic index

Reference: ideal-gas EOS and grid-based computational astrophysics.

Two-way coupling: gravity ↔ gas

The gas grid is not a passive backdrop — it is driven directly from the N-body engine every tick and feeds back into it, so structure formation is genuinely hydrodynamic. Inside CosmosSimulation.Tick() (under the simulation lock) the engine first deposits the entity mass distribution onto the gas density field, so the solver sees where the baryons actually are; cooling, shocks, turbulence and angular-momentum transport then act on those overdensities. Stellar deaths and accreting black holes register point feedback sources (supernovae, AGN) and core-collapse events that the feedback and neutrino modules consume. The coupling is fully two-way for magnetism too: each black hole samples the local MHD field the gas solver evolves, so magnetorotational stresses boost its accretion and a spinning, magnetised hole drives a Blandford–Znajek jet whose power is injected back as extra AGN feedback. When the grid cools gas past the star-formation threshold it raises a request that the engine realises as a lightweight collapsing protogalaxy at that site, funded conservatively from the shared baryon budget; gas the grid returns (ejecta, evaporated clouds) is credited back. The whole loop is mass-conserving and tuned to evolve gradually.

gravity → gas: ρ_grid(x)  ±=  Σ f·m_body (galaxies, stars, BHs, protogalaxy gas) gas → gravity: cooled gas > SF threshold ⇒ spawn protogalaxy (mass drawn from FreeMass) gas (B) → BH: sample u_B at BH ⇒ MRI boosts accretion + Blandford–Znajek jet (spin×B²) feedback in: SN / AGN(+jet) → FeedbackSource(power ∝ ejecta / accretion rate); collapse → CoreCollapseEvent budget: FreeMass −= cloud mass spawned; FreeMass += gas returned (closed, audited loop)

The pipeline is driven exactly once per tick by the engine itself (the legacy reflection-based auto-driver is retired), guaranteeing the feedback / core-collapse / star-formation channels are populated from live engine state rather than left empty.

Reference: galaxy formation & evolution and cooling-driven / triggered star formation.

Hydrodynamics (gas physics)

A simplified compressible Navier–Stokes solver: operator-split EOS → shock heating → pressure force + shear viscosity → semi-Lagrangian advection → radiative cooling → floors. It produces the density/pressure/temperature fields every other module consumes, and triggers gravitational collapse into stars.

Momentum & shock heating

Gas accelerates down its pressure gradient with a viscous diffusion term; convergent flow (∇·v < 0) is irreversibly heated by von Neumann–Richtmyer artificial viscosity, reproducing SN blast shells and accretion shocks.

a = −(1/ρ)∇P + ν∇²v q_shock = C·ρ·(∇·v)² (only where ∇·v < 0)
SymbolValueMeaning
ν (ShearViscosity)0.05Navier–Stokes shear diffusion
DensityFloor1.0e-4minimum gas density (stability)

Reference: Navier–Stokes equations and artificial viscosity (von Neumann–Richtmyer shock capturing).

Radiative cooling curve & Jeans instability

A three-channel cooling curve Λ(ρ,T,Z) — molecular (low-T), atomic (Lyman-α bump ~10⁴) and metal-line (∝ Z) — removes thermal energy (∝ n²). Cooling lowers pressure support until a cell exceeds its Jeans length and collapses, feeding star formation.

λ_J = c_s·√(π/(Gρ)) (collapse if cell ≥ λ_J) t_ff = √(3π/(32 G ρ)) (free-fall time)
SymbolValueMeaning
FloorTemperature3.0CMB-like cooling floor
AtomicPeak1.0e4atomic (H/He) cooling-bump centre

Reference: radiative cooling function, the Jeans instability, and free-fall time.

Magnetohydrodynamics (MHD)

Magnetic field vectors are advected with the gas (flux freezing), exert magnetic pressure, brake rotation, and snap/reconnect where the field becomes too tangled — releasing energy into the gas.

Flux freezing, magnetic pressure & reconnection

In the ideal limit field lines are frozen into the flow; a finite resistivity η lets them diffuse and reconnect when |∇×B| exceeds a threshold, converting magnetic energy to heat. Magnetic pressure P_B = B²/2 resists compression, and magnetic braking removes angular momentum.

P_B = B² / 2 (magnetic pressure) reconnect where |∇×B| > threshold ⇒ B relaxes, energy → heat
SymbolValueMeaning
η (Resistivity)0.02reconnection / field diffusion
ReconnectionThreshold0.5|curl B| above which fields snap
BrakingEfficiency0.01magnetic-braking torque coupling
MaxField50.0field-strength clamp (stability)

Reference: magnetohydrodynamics, flux freezing, magnetic reconnection, and magnetic braking.

Magnetic coupling to black holes: Blandford–Znajek jets & MRI accretion

The field the gas solver evolves is not confined to the grid — the N-body black holes feel it too. Each tick a hole samples the local magnetic energy density u_B = ½|B|² at its position (bilinear sampling, matching the flux-frozen advection). Two effects follow. (1) Magnetorotational instability (MRI): magnetic stresses transport angular momentum outward in the disk, removing the centrifugal barrier so gas accretes faster — a small, saturating boost to the accretion rate that can tip a hole into the active/quasar regime. (2) Blandford–Znajek jets: a spinning, magnetised Kerr hole extracts rotational energy electromagnetically, with luminosity P_BZ ∝ a²·B². The jet power is stored on the hole (exposed in snapshots) and injected on top of the AGN feedback. With no field — or a non-spinning (Schwarzschild) hole — both terms vanish and behaviour is unchanged.

u_B = ½|B|² (sampled from the MHD grid at the BH) MRI: Ẑ_acc ×= 1 + ε_MRI · u_B/(u_B + u_sat) (saturating accretion boost) P_BZ = η_BZ · a² · (2·u_B) · M/(M + M_ref) (jet power, clamped to P_max) AGN feedback power += P_BZ (jet dumps energy into the surrounding gas)
SymbolValueMeaning
η_BZ (JetBlandfordZnajekEfficiency)0.05overall Blandford–Znajek jet scale
M_ref (JetMassReference)100.0mass at which the jet mass term ≈ ½
P_max (JetMaxPower)50.0jet-power clamp (stability)
ε_MRI (MriTorqueEfficiency)0.15max fractional accretion boost per tick
u_sat (MriSaturationEnergy)4.0u_B at which the MRI boost saturates

Reference: Blandford–Znajek process (spin-powered relativistic jets) and the magnetorotational instability (disk angular-momentum transport).

Radiation transport

Photon energy diffuses through the gas under an opacity law, exerts radiation pressure on dense regions, and drives ionization fronts. A global reionization-epoch toggle floods the medium with an ionizing background. The sources are not abstract: N-body stars and accreting black holes deposit their luminosity into this field every tick.

Photon diffusion, opacity & ionization fronts

Radiation is transported in the diffusion (flux-limited) approximation with opacity κ = electron-scattering (grey) + Kramers (free-free / bound-free, ∝ ρT⁻³.⁵). Where ionizing flux beats recombination, an ionization front advances; radiation pressure pushes on the gas.

κ = κ_es + κ_Kramers·ρ·T⁻³⋅⁵ ionized if flux > threshold; recombine at rate α_rec·n
SymbolValueMeaning
ElectronScattering0.02grey (Thomson) opacity floor
KramersCoefficient1.0e3Kramers opacity normalisation
IonizationThreshold0.5flux needed to ionize a cell
α_rec (Recombination)0.02recombination rate coefficient
PressureCoupling1.0radiation-pressure strength
ReionizationFloor0.6background x_HII once reionised

Reference: radiative transfer, Kramers’ opacity law, radiation pressure, and the reionization epoch.

Stellar & planetary coupling to the radiation field

The radiation field is two-way coupled to the N-body entities, not just the gas. Stars feed it: each tick a star injects a fraction of its Eddington-limited luminosity as a radiation-pressure source (see Eddington limit & radiation coupling), so populations of stars build up the diffuse radiation background, push ionization fronts outward and contribute to reionization — alongside the AGN and supernova sources. Planets read it: a planet samples the local radiation energy density E_r and Rosseland opacity κ at its position (bilinear sampling, matching the diffusion solver) to drive an opacity-based atmospheric greenhouse and an ambient-radiation heating term (see radiation-coupled surface temperature). The deposit happens before the radiation module runs, so sources are consumed the same tick; planets read the previous tick's field (one-tick lag), matching the explicit coupling used elsewhere. With no gas grid attached every coupling cleanly degrades and entity behaviour is unchanged.

stars → gas: E_r += Σ_stars min(L_max, RadPower·L_eff) (radiation-pressure sources) gas → planets: T uses E_r(planet) and κ(planet) (ambient bath + τ greenhouse)

Reference: H II regions (stellar ionizing radiation), reionization, and stellar feedback.

Cosmic-ray physics

A relativistic (γ_cr = 4/3) non-thermal particle fluid injected by supernovae. Cosmic rays are fully propagated, not just generated: they diffuse largely independently of the gas (faster along magnetic field lines), exert their own pressure that drives smooth galactic winds, heat dense shielded gas that photons cannot reach, and raise the effective Jeans threshold so they regulate star formation. All four feedback channels — pressure, winds, heating and SF regulation — are live.

CR pressure, diffusion, winds, heating & SF regulation

Cosmic rays scatter off magnetic irregularities and diffuse (anisotropically when MHD is active). Their pressure P_cr = (γ_cr−1)E_cr adds a non-thermal force −(1/ρ)∇P_cr that is applied to the gas momentum every tick (driving smooth large-scale winds without radiating away like heat), they deposit energy as the dominant heating channel deep inside molecular clouds, and that same P_cr feeds into the star-formation support term (CrSupport·P_cr/ρ) to suppress runaway collapse.

P_cr = (γ_cr − 1)·E_cr wind force a_cr = −(1/ρ)∇P_cr heating q ∝ E_cr·n (stronger in dense gas) SF support: c_eff² += CrSupport·P_cr/ρ (raises Jeans threshold)
SymbolValueMeaning
Diffusivity0.4baseline CR diffusion coefficient
FieldAlignmentBoost2.0faster diffusion along strong B
HeatingEfficiency0.05fraction of CR energy → gas heat
InjectionEfficiency0.1fraction of SN energy → cosmic rays

Reference: cosmic rays and cosmic-ray feedback / transport (diffusion, pressure, heating).

Chemical evolution (metals)

Tracks the metal mass fraction Z of the gas. Supernovae return newly-synthesised metals to the ISM via yield tables; the enriched gas then cools faster (metal-line cooling), seeds dust, and births metal-richer stars — closing the stars → metals → gas → next-gen stars loop end-to-end.

Metallicity tracking & supernova yields

Each cell carries a composition (H, He, metals). When stars die, a fraction of the processed mass is injected as metals, raising Z. Higher Z strengthens the metal-line branch of the cooling curve consumed by the hydro module.

Z = M_metals / M_gas ΔM_metals = yield·ΔM_* metal-line cooling ∝ (Z / Z_☉)
SymbolValueMeaning
BaseYieldFraction0.1fraction of stellar mass returned as metals
Z_☉0.014solar metallicity normalisation

Reference: metallicity, stellar nucleosynthesis (supernova yields), and galactic chemical evolution.

Entity metal cycle (stars ↔ gas)

The metal field above is wired all the way through the entity layer, so the loop closes both ways. Stars carry a metallicity Z: gas the grid has enriched seeds new clouds, those clouds promote into galaxies and birth stars that inherit the local Z, and when those stars die their supernova feedback reports their real progenitor Z to the yield table (no longer 0). While a star lives, it also mixes a small fraction of the surrounding enriched gas into its envelope each tick, so its Z drifts toward the local interstellar value rather than staying frozen at birth. Z is clamped to a super-solar ceiling so a single hot cell can't spike it.

birth: Z_star = Z_gas(local) death: ΔM_metals = yield(Z_star)·ΔM_* live: Z_star ← Z_star + rate·(Z_gas − Z_star), Z_star ≤ Z_cap
SymbolValueMeaning
EnrichmentRate0.02fraction of the star–gas metallicity gap closed per tick (one-sided, only raises Z)
Z_cap0.1hard ceiling on a star's metal mass fraction

Reference: galactic chemical evolution and stellar populations (Pop III → II → I enrichment sequence).

Multi-phase interstellar medium (ISM)

Each gas cell is classified into a canonical ISM phase by temperature and density. Cooling condenses warm gas into the cold molecular phase; shocks and feedback evaporate/ionize it back to hot. Dust grains form from metals, shield cold cores, and are sputtered away in hot gas.

Phase classification & dust

The five phases — cold molecular, warm neutral, hot ionized, coronal, and the dust component — relax toward a multi-phase pressure equilibrium. Dust tracks (and lags) the metal field, catalyses H₂ formation, and blocks radiation (shielding ∝ 1/(1+ρ_dust)).

cold molecular: T < 100 & ρ ≥ 3 warm neutral : 100 ≤ T < 10⁴ hot ionized : 10⁴ ≤ T < 10⁶ coronal: T ≥ 10⁶ & ρ < 0.1
SymbolValueMeaning
MolecularTemp100.0cold-molecular upper temperature
WarmTemp1.0e4warm/hot boundary temperature
HotTemp1.0e6hot/coronal boundary temperature
MolecularDensity3.0min density for the cold phase
CoronalDensity0.1coronal gas is hot AND tenuous below this
DustToMetalRatio0.4fraction of metals locked in grains
SputteringTemp1.0e6grains destroyed above this T

Reference: phases of the interstellar medium and interstellar dust (grain growth & sputtering).

Phase transitions & dust evolution

Phases are not static labels — they evolve. Dust grains grow toward a metal-set equilibrium and are thermally sputtered in hot gas, while a condensation operator drives dense warm gas down onto the cold molecular phase. Because dust shields the gas, dusty cells cool and condense faster, so the warm→cold transition feeds the cold molecular reservoir that the star-formation module turns into stars — closing the dust–cooling–SF loop.

dust growth: ρ_dust += (DustToMetalRatio·Z·ρ − ρ_dust)·GrowthRate·dt dust sputtering: ρ_dust *= (1 − SputteringRate·dt) (T > SputteringTemp) warm→cold: e += (e_cold − e)·CondensationRate·shield·dt (shield = 1/(1+ρ_dust))
SymbolValueMeaning
GrowthRate0.05rate metals accrete onto grains toward equilibrium
SputteringRate0.2rate grains are destroyed in hot (> SputteringTemp) gas
CondensationRate0.1rate dense warm gas condenses onto the cold phase

Reference: molecular-cloud formation via dust-shielded condensation, feeding star formation.

Angular-momentum transport

Shakura–Sunyaev α-disk viscosity transports angular momentum outward so mass can accrete inward. The same machinery now runs at the entity level too: it spins stars up (accretion) and down (magnetic braking), conserves angular momentum as protogalaxies collapse, and bleeds a little ordered rotation out of formed galaxy discs every tick.

α-disk viscosity & spin evolution

The effective kinematic viscosity ν = α·c_s·H drives radial drift and sets the viscous time r²/ν. On the gas grid it acts as a shear-diffusion of angular momentum; the SpinEvolutionModel / AccretionDiskModel helpers behind it are wired into the live engine in CosmosSimulation.AngularMomentum.

  • Stars — every tick a Skumanich-like magnetic-braking term spins the star down (dΩ/dt ∝ −k·Ω³), additive to the tidal coupling; accreted mass spins it back up by conserving L = I·Ω + δM·j.
  • Protogalaxies — disc collapse spins the cloud up by the L-conserving contraction law Ω′ = Ω₀·(R₀/R)² (replacing the old ad-hoc factor), so the seed spin and the collapse ratio set the final disc rotation.
  • Galaxies — a formed disc loses a tiny fraction of its spin per tick to winds / magnetic braking (floored so it never fully stops), with mergers still the dominant spin change.
ν = α·c_s·H v_drift = −ν/r t_visc = r²/ν star spin-down: ΔΩ ∝ −BrakingCoefficient·StellarBrakingScale·Ω³ star spin-up: Ω′ = (I·Ω + δM·j·f_acc) / (I + δM) collapse: Ω′ = Ω₀·(R₀/R)² disc: Ω′ = Ω·(1 − GalaxyBrakingPerTick)
SymbolValueMeaning
α (disk)0.1dimensionless viscosity parameter
BrakingCoefficient0.01magnetic-braking spin-down rate
StellarBrakingScale0.25per-tick scale on stellar magnetic braking
f_acc (star)0.5share of accreted specific L that spins a star up
GalaxyBrakingPerTick2.0e-5fractional disc spin lost per tick (floored)
Ω₀ (protogalaxy)0.01pre-collapse seed spin (rad/tick) conserved on contraction

Reference: the Shakura–Sunyaev α-disk model and accretion-disk viscosity / angular-momentum transport.

Star formation

Cold, dense, Jeans-unstable gas converts to stars at a rate set by the free-fall time and an efficiency per free-fall (the Kennicutt–Schmidt picture). Thermal, turbulent, magnetic and cosmic-ray pressure all support the gas against collapse and suppress the rate; only gas below a temperature ceiling participates. Each flagged cloud then fragments at the formation site into an IMF-sampled star cluster, with the remainder collapsing as a protogalaxy.

Density-threshold collapse & SFR

A cell forms stars when its density exceeds a threshold, it is colder than the ceiling, and self-gravity beats its total non-thermal support. The effective stabilising speed adds thermal, turbulent, magnetic and cosmic-ray pressure in quadrature, so the Jeans test reflects every pressure that resists collapse. The star-formation rate scales as ε_ff·ρ/t_ff; formed mass is requested back from the entity engine as a star-forming cloud.

c_eff² = c_s² + TurbulenceSupport·σ_turb² + 2·E_B/ρ + CrSupport·P_cr/ρ ρ_SFR = ε_ff · ρ / t_ff forms if ρ > threshold AND T < ceiling AND Jeans-unstable(c_eff)
SymbolValueMeaning
DensityThreshold5.0ρ above which gas can collapse
ε_ff (Efficiency)0.02star-formation rate per free-fall time
TemperatureCeiling200.0only cold gas forms stars
TurbulenceSupport1.0turbulent-pressure suppression scaling
CrSupport1.0cosmic-ray pressure (P_cr/ρ) suppression scaling

Reference: the Kennicutt–Schmidt star-formation law and the physics of star-forming regions (Jeans collapse + free-fall efficiency, with magnetic & cosmic-ray pressure support).

Prompt IMF fragmentation (grid → entity)

When the grid flags a star-forming cell, the cooled cloud doesn't become a single object: a fraction of it is fragmented at the formation site that same tick into a cluster of stars whose masses follow a bottom-heavy initial mass function (the same Salpeter-like law the engine uses everywhere), and only the leftover gas keeps collapsing as a protogalaxy. Each draw's upper bound is the remaining cloud mass, so the cluster self-limits — early massive stars leave less behind, naturally yielding many low-mass and few high-mass stars. Stars are placed at or above the hydrogen-burning minimum (sub-stellar fragments can't ignite, so their mass stays in the gas), and mass is conserved exactly: cloud = stars + protogalaxy gas + refunded remainder.

m_i = m_min + (m_remaining − m_min) · u^γ, u ∈ [0,1), m_min = HydrogenBurningMin stars formed until budget = f_prompt · M_cloud is spent (or N_max reached)
SymbolValueMeaning
γ (ImfExponent)3.5IMF power-law index (higher ⇒ more bottom-heavy)
m_min20.0hydrogen-burning minimum — lightest star that can ignite
f_prompt (PromptStarFraction)0.6share of the cloud fragmented into stars now
N_max (MaxFragments)12cap on stars made per request (keeps the tick bounded)
Scatter6.0 pxpositional spread of the new cluster around the site

Reference: the initial mass function (Salpeter / Kroupa) and star-cluster formation from fragmenting molecular clouds.

Galaxy regulation

The self-regulation loop: young stars and accreting black holes inject energy and momentum back into the gas through stellar winds, radiation pressure, supernova blast waves and AGN jets. AGN coupling is explicit — an accreting hole's power into the gas is its accretion luminosity plus the Blandford–Znajek jet luminosity, so the jet actively regulates the surrounding medium. This drives outflows, blows gas out of dense regions, and quenches runaway cooling/star formation — the high-mass analogue of supernova feedback that keeps galaxies from over-producing stars.

Stellar, supernova & AGN feedback channels

Each feedback source deposits a mix of thermal and kinetic energy over a small radius. Supernovae drive roughly spherical blast shells; AGN couple a fraction of accretion power into a narrow bipolar jet that launches outflows and bubbles. Together they regulate the gas reservoir (blowout → quenching → starburst suppression).

SN: E split thermal/kinetic over a blast radius (cells) AGN jet: bipolar kinetic kick ∝ JetFraction·Ẑ_acc
SymbolValueMeaning
SN BlastRadius2.0 cellssupernova blast-shell radius
SN KineticFraction0.3SN energy delivered as kinetic
AGN JetFraction0.4accretion power coupled to the jet
AGN Radius3.0 cellsAGN coupling radius

Reference: stellar feedback, AGN feedback, and galactic winds / outflows (galaxy self-regulation & quenching).

AGN jet → gas coupling (accretion power + Blandford–Znajek)

The power an accreting hole hands to the gas each tick is not just its accretion luminosity — the magnetically-powered jet is coupled in explicitly. When a hole is classified active or quasar, the engine emits a single AGN FeedbackSource whose power is the sum of two terms: (1) an accretion term proportional to the feed rate Ẑ_acc, scaled up 2.5× in the brighter quasar state; and (2) the Blandford–Znajek jet luminosity P_BZ the MHD coupling computed from the hole's spin and the local magnetic energy. That combined power is then split by the AGN channel into a thermal halo (heats a small sphere, suppressing cooling) and a bipolar kinetic jet (launches outflows/bubbles along the axis). So the jet you already had is now a first-class regulator of the surrounding gas, not just a visual on the hole.

classify: FeedRate ≥ QuasarFeed ⇒ quasar (s = 2.5); ≥ ActiveFeed ⇒ active (s = 1) P_AGN = AgnFeedbackPower · Ẑ_acc · s + P_BZ (only when active/quasar) RecordFeedback(Agn, x, y, P_AGN, M) → thermal halo (1−JetFraction) + bipolar jet (JetFraction)
SymbolValueMeaning
AgnFeedbackPower0.6accretion-power → gas coupling coefficient
Quasar boost (s)2.5×quasar-mode multiplier vs. the weaker active state
AGN JetFraction0.4share of P_AGN delivered as the bipolar kinetic jet
η_BZ (JetBlandfordZnajekEfficiency)0.05Blandford–Znajek jet scale (P_BZ, see MHD)
P_max (JetMaxPower)50.0jet-power clamp applied to P_BZ before coupling

Reference: AGN feedback (quasar & radio/jet modes) and the Blandford–Znajek process (spin-powered jets dumping energy into the medium).

Neutrino physics

Core collapse releases the progenitor’s gravitational binding energy as a neutrino burst (E_ν ∝ GM²/R). A small fraction couples back into the surrounding gas as a neutrino-driven wind that helps launch the explosion, while thermal neutrino cooling drains energy directly from the hottest, densest remnant gas — bypassing the optically-thick photon channel.

Burst energy, ν-driven wind & cooling

The burst radiates over a few ticks (so the wind is not instantaneous) with a ~10–20 MeV thermal spectrum. A fraction (HeatingFraction) of the ν luminosity couples into the gas within a small radius above the proto-neutron star as ν heating — depositing thermal energy and a radial kinetic push that unbinds the overlying gas and drives the outflow (the shock-revival mechanism). Neutrino cooling follows a steep pair-process scaling (∝ T⁹) above a temperature threshold, the dominant cooling channel for proto-neutron stars.

E_ν ∝ G M² / R L_ν = E_ν / BurstDuration ν-wind heating: Δe ∝ L_ν·HeatingFraction·dt·w(r)/ρ (w = 1/(1+r), r ≤ Radius) ν-wind push: Δv ∝ 0.5·Δe along r̂ ν-cooling ∝ T⁹ (above threshold)
SymbolValueMeaning
MeanEnergy15.0 MeVthermal ν spectrum (~10–20 MeV)
BurstDuration3.0 ticksticks over which the burst radiates
HeatingFraction0.01fraction of ν luminosity coupled into the wind
WindRadius2.0 cellsgain-region radius the ν wind acts over
CoolingThreshold1.0e6T above which ν-cooling switches on

Reference: supernova neutrinos, the neutrino-driven wind, and neutrino cooling of proto-neutron stars.

Planetary systems — formation, migration & resonances

Alongside the gas grid, each SolarSystem runs an entity-side PlanetarySystemsPipeline that grows planets from a protoplanetary disc and then sculpts their orbits. Four stages execute in a fixed, physically-ordered sequence every tick: formation (the disc evolves while cores and gas envelopes accrete) → migration (disc torques move planets and damp their e/i) → resonances (capture into mean-motion resonances, libration, secular & Kozai–Lidov cycles) → multi-planet dynamics (a WHFast symplectic integrator plus chaos / stability analysis). These are the realism domains of dedicated planet-formation and N-body codes (REBOUND, GENGA, mercury/SyMBA, FARGO), implemented here as fast, qualitative sim-unit models.

Pipeline execution order & disc lifecycle

A per-system ProtoplanetaryDisc (a radial array of annuli) is created lazily and retained in a ConditionalWeakTable keyed on the SolarSystem, so it is garbage-collected with the system. The formation and migration stages require live gas and naturally fall idle once the disc photoevaporates below its dispersal floor; the resonance and multi-planet stages then take over and shape the gas-free system for the rest of its life. The pipeline runs after the entity planet/tidal update (so masses and orbits are current) and before the continuum drive, inside CosmosSimulation.Tick() under the simulation lock.

order: Formation → Migration → Resonances (+ Secular + Kozai–Lidov) → MultiPlanet (WHFast + chaos) disc dissipates when M_gas / M_gas,0 < DispersalFloor ⇒ formation & migration idle updates: Planet.CoreMass / EnvelopeMass / Mass, OrbitRadius, Eccentricity, Inclination, MigrationRegime, ResonancePartner

All stages update UniverseState in place: planet core/envelope/total mass, orbital radius & speed, eccentricity, inclination, ascending node, migration rate/regime, gap depth, and resonance state (partner, p:q, resonant argument, libration amplitude). Throttled diagnostics log resonance capture/breaking and the onset of dynamical chaos to the event log.

Reference: nebular hypothesis / planet formation and N-body simulation of planetary systems.

Mass-budget regulation pipeline (new)

The planetary layer now runs an explicit PlanetFormationRegulationPipeline around formation to prevent runaway mass creation. Before growth, disc mass and lifetime are clamped to realistic protoplanetary ranges; during growth, pebble/planetesimal conversion is throttled; after growth, per-disc caps, destruction channels, and conservation checks run. This is why discs cannot produce unlimited planets: every stage is constrained by finite source reservoirs and tracked sinks.

pre-step: DiscMassLimiter (disc fraction, metallicity-scaled solids, lifetime depletion) formation: PebbleFluxRegulator + PlanetesimalEfficiency + PlanetFormationLimiter post-step: PlanetDestructionModel + GlobalMassBudgetTracker + MassConservationValidator mass flow: M_disc → M_solids → M_planetesimals → M_planets − (infall + ejection + mergers)
Regulation controlCurrent boundPurpose
DiscMassFraction0.1%–1.0% of host-star masslimits initial reservoir for planet growth
DiscLifetime1–10 Myrshuts down gas-assisted growth in finite time
PlanetesimalEfficiency1%–3%enforces inefficient solids-to-planetesimal conversion
MaxSolidToPlanetFraction45%caps how much disc solids can become planets
CosmicBaryonFraction0.158keeps planetary sinks inside global baryon limits

Reference: observational protoplanetary-disc demographics, pebble-accretion limits, and mass-conservation constraints in coupled N-body + disc models.

Protoplanetary disc (gas & dust)

The birthplace of planets: a Minimum-Mass-Solar-Nebula-like disc with a power-law gas surface density and temperature, a Shakura–Sunyaev α-viscosity that spreads and drains the gas, and a dust population that grows into pebbles and drifts inward. Pressure maxima (bumps) trap solids and halt migration.

Surface density, temperature & α-viscosity

Gas surface density and mid-plane temperature follow power laws in radius; the scale height, sound speed and orbital frequency set the disc thermodynamics. The turbulent α converts to a kinematic viscosity ν = α c_s H that drives viscous spreading (Lynden-Bell & Pringle) and exponential photoevaporative dispersal.

Σ_gas(r) = Σ₀·(r/r₀)^−p T(r) = T₀·(r/r₀)^−q H = c_s/Ω ν = α·c_s·H (Ω = √(G M☉/r³)) ∂Σ/∂t = (3/r)∂_r[√r ∂_r(νΣ√r)] (viscous spreading)
SymbolValueMeaning
RadialBins64number of logarithmic radial annuli
InnerRadius6.0 pxinner truncation (magnetospheric cavity / sublimation edge)
OuterRadius1200.0 pxouter disc radius
p (SigmaSlope)1.0gas surface-density power-law slope
q (TemperatureSlope)0.5temperature power-law slope (irradiated disc)
α4.0e-3Shakura–Sunyaev turbulence parameter
DispersalTime3.0e5e-folding disc lifetime (photoevaporation)
DispersalFloor0.02gas-mass fraction below which the disc is gone

Reference: the minimum-mass solar nebula, the Shakura–Sunyaev α-disc, and viscous disc evolution.

Dust growth & radial drift

Grains coagulate toward a fragmentation/drift barrier; their aerodynamic coupling is measured by the Stokes number. Because the gas is pressure-supported and sub-Keplerian, solids feel a headwind and spiral inward fastest at St ~ 1 — the radial-drift barrier — unless a local pressure maximum (bump) cancels the gradient and traps them.

St = π·ρ_s·a / (2·Σ_gas) (Stokes number) v_drift = −2·St/(1+St²)·η·v_K (η = −½(H/r)² ∂lnP/∂lnr) dust traps where ∂P/∂r = 0 (pressure bump)
SymbolValueMeaning
DustToGas0.012initial dust-to-gas mass ratio (~Solar Z)
MaxGrainSize1.0fragmentation/drift-barrier pebble size

Reference: dust-grain growth and the radial-drift barrier in protoplanetary discs.

Planet formation (core & pebble accretion)

Solids assemble into planets through runaway and oligarchic planetesimal growth, then rapid pebble accretion onto the growing cores. A core that exceeds a critical mass while gas remains undergoes runaway gas-envelope accretion and becomes a giant; smaller cores stall at their isolation mass as rocky/icy worlds.

Planetesimals, pebbles & isolation mass

Below the oligarchic mass, gravitational focusing makes the biggest body grow fastest (runaway); above it, embryos grow in lockstep (oligarchic) until they sweep their feeding zone and reach the isolation mass. Pebble accretion is much faster: pebbles settling through the Hill sphere are captured efficiently until the core reaches the pebble-isolation mass and carves a pressure bump that shuts off the flux.

dM/dt|_pl ∝ Σ_solid·Ω·R_capture²·F_grav (F_grav = 1 + (v_esc/σ)²) M_iso ∝ (2π r·Δr·Σ_solid) (Hill-zone feeding) dM/dt|_pebble ∝ Σ_peb·R_Hill·v_Hill (2-D) or ·R_Hill² (3-D)
SymbolValueMeaning
PebbleEfficiency0.5fraction of drifting pebbles a core captures
PlanetesimalRate1.0global solid-accretion-rate multiplier
OligarchicMass0.1 M⊕mass dividing runaway from oligarchic growth
CoreDensity3.0bulk density (mass → radius conversion)

Reference: planetary accretion, pebble accretion, and the isolation mass.

Pebble/planetesimal regulation & destruction channels (new)

Pebble growth is now capped by flux limits, turbulence damping, pressure-trap bottlenecks, sublimation zones and fragmentation losses; planetesimal growth is gated by streaming-instability thresholds and low conversion efficiency. After accretion, unstable planets are removed via migration infall, scattering/ejection, resonant-chain collapse, tidal/Kozai-assisted infall, and mergers. These sinks are essential to avoid over-retaining mass in long-lived packed systems.

dM_core/dt = min(dM_raw, flux_cap)·f_turbulence·f_trap·f_survival f_survival = (1 - f_sublimation)(1 - f_fragmentation)(1 - f_drift_loss) planetesimal growth allowed only if (dust/gas ≥ SI threshold) post-growth: apply {infall, ejection, merger} sinks before final budget audit
ControlBoundMeaning
PebbleFluxCapFractionPerYear0.15maximum pebble throughput into cores per year
StreamingInstabilityThresholddust/gas ≥ 0.02minimum local solids loading for planetesimal formation
TurbulenceGrowthDampingFloor0.05minimum damping factor under strong turbulence
MaxPlanetGrowthFractionPerStep0.08per-step throttle from remaining disc solids

Reference: streaming instability, radial drift / fragmentation limits, and migration-driven loss channels.

Gas-envelope accretion & the giant-planet threshold

While subcritical, a core binds a slowly-contracting gas envelope whose growth is throttled by Kelvin–Helmholtz cooling. Once the core (plus envelope) passes the critical core mass, the envelope can no longer stay in hydrostatic balance and gas pours on in a runaway, building a gas giant up to the gap-limited supply.

subcritical: dM_env/dt ∝ M_core^κ / τ_KH runaway (M_core > M_crit): dM_env/dt fast, capped by M_env,max
SymbolValueMeaning
CriticalCoreMass10.0 M⊕core mass triggering runaway gas accretion
MaxEnvelopeMass3000.0 M⊕gap-limited envelope-mass ceiling

Reference: the core-accretion model and giant-planet formation (runaway gas accretion).

Planet migration (Type I / II / III)

An embedded planet exchanges angular momentum with the disc and migrates. Low-mass planets feel Lindblad and corotation torques (Type I, usually inward); massive planets open a gap and migrate on the viscous timescale (Type II); intermediate planets with a strong co-orbital mass deficit can migrate explosively fast (Type III).

Type I: Lindblad + corotation torques

The differential Lindblad torque is typically negative (inward) and scales with planet mass squared and the local disc surface density. The corotation torque (from gas executing horseshoe turns) is positive and depends on the surface-density/temperature gradients; it can reverse the net migration in regions of steep gradients, but saturates unless viscosity refreshes the horseshoe region.

Γ ∝ (M_p/M☉)²·(Σ r²/M☉)·(r/H)²·ΣΩ²r⁴ dr/dt ∝ 2Γ/(M_p·v_K) (Type I, reverses where the gradient is steep)
SymbolValueMeaning
RateScale1.0global migration-speed multiplier
TypeICoefficient2.7Lindblad torque normalisation
CorotationStrength1.1corotation torque relative to Lindblad
CorotationSaturation1.0level above which corotation torque saturates

Reference: Type I migration and Lindblad / corotation torques.

Type II (gap-opening) & Type III (runaway)

A planet opens a gap when its Hill radius rivals the disc scale height and its tidal torque beats viscous refilling (Crida criterion). It then drifts with the viscous accretion flow, slowed when it dominates the local disc mass. If a partial gap leaves a large co-orbital mass deficit, the feedback between drift and the asymmetric horseshoe flow runs away — fast Type III migration, inward or outward.

gap opens (Crida): 0.75·H/R_Hill + 50·ν/(M_p/M☉ Ω r²) ≲ 1 Type II: dr/dt ≈ −1.5·ν/r · min(1, 2Σr²/M_p) Type III triggers when co-orbital mass deficit δm > TriggerDeficit·M_p
SymbolValueMeaning
TypeIIICoefficient4.0runaway (Type III) migration strength
TypeIIITriggerDeficit0.5co-orbital mass-deficit fraction to trigger runaway
InnerEdge6.0 pxdisc inner edge where migration halts (planet trap)

Reference: Type II and Type III migration, and the gap-opening (Crida) criterion.

Resonances & secular dynamics

Convergent migration captures planet pairs into mean-motion resonances (2:1, 3:2, 4:3…), where a resonant argument librates instead of circulating. Slower secular interactions exchange eccentricity and inclination and precess the orbits, while a distant inclined perturber can drive large Kozai–Lidov cycles.

Mean-motion resonance: capture, libration & breaking

When two planets' periods approach a ratio of small integers, the resonant argument φ stops circulating and oscillates (librates) about a fixed centre — the pair is locked and migrates together. Resonant forcing pumps the eccentricities; if the libration amplitude or eccentricity grows too large (overlap, perturbation), the lock breaks and φ circulates again.

φ = (p+q)λ_out − p·λ_in − q·ϖ_in (librates in resonance) capture if migration is convergent & |period ratio − (p+q)/p| < CaptureWindow break if libration amplitude ≥ BreakAmplitude or e ≥ BreakEccentricity
SymbolValueMeaning
CaptureWindow0.02max period-ratio offset for capture
BreakAmplitude2.83 rad (~0.9π)libration amplitude that breaks the lock
BreakEccentricity0.3eccentricity that breaks the lock
RestoringStrength0.5pendulum restoring torque driving libration
EccentricityPumping1.0e-4per-tick resonant eccentricity forcing

Reference: mean-motion resonance and resonance capture by convergent migration.

Secular precession & Kozai–Lidov cycles

Away from resonance, the orbit-averaged (secular) interaction precesses the apsides and nodes and exchanges eccentricity/inclination among planets (Laplace–Lagrange theory). A distant, highly-inclined perturber (a wide binary companion or a far giant) drives Kozai–Lidov cycles: above the critical inclination the torque conserves L_z = √(1−e²)·cos i, so falling inclination is traded for rising eccentricity — a channel to extreme e (hot-Jupiter migration, tidal capture, collisions).

apsidal/nodal precession + e/i exchange (Laplace–Lagrange) Kozai–Lidov: L_z = √(1−e²)·cos(i) = const (above i_crit) ω librates about 90°/270° (signature of the cycle)
SymbolValueMeaning
i_crit (CriticalInclination)0.6847 rad (~39.2°)inclination above which KL cycles switch on
MaxEccentricity0.95eccentricity the KL cycle is capped at

Reference: secular dynamics, Laplace–Lagrange theory, and the Kozai–Lidov mechanism.

Multi-planet dynamics & chaos

The mature, gas-free system is integrated with a Wisdom–Holman (WHFast) symplectic scheme that conserves energy and angular momentum over long timescales, so resonances and slow chaos are followed faithfully. The Chirikov resonance-overlap criterion and Hill-stability bounds diagnose when a tightly-packed system will diffuse into instability.

Integrator choice, resonance overlap, Hill stability & chaos verdict

The long-term integrator is selectable: the default Wisdom–Holman (WHFast) symplectic scheme conserves energy/angular momentum over millions of orbits (ideal for resonances and slow chaos), while a cheaper velocity-Verlet leapfrog is available for faster runs. Each pair of planets is surrounded by a web of resonances whose widths grow with planet mass; when neighbouring resonances overlap (Chirikov), orbits wander chaotically and the elements random-walk (chaotic diffusion), ultimately driving orbital crossing and ejection. The overlap parameter scales as the mass ratio to the 2/7 power over the separation in mutual Hill radii; closely-spaced or massive planets are chaotic, widely-spaced low-mass ones are stable. A separation below ~2√3 mutual Hill radii is Hill-unstable. From the overlap the analyzer derives a Lyapunov time (the e-folding time of trajectory divergence; infinite when regular) and a coarse stable / metastable / chaotic verdict.

R_Hill,m = ½(a₁+a₂)·((M₁+M₂)/3M☉)^⅓ Δ = (a₂−a₁)/R_Hill,m overlap ~ C·μ^(2/7) / Δ (> 1 ⇒ chaotic); Hill-unstable if Δ < 2√3 t_Lyapunov ~ 1 / diffusion(overlap) ⇒ stable / metastable / chaotic
SymbolValueMeaning
IntegratorSymplectic (velocity-Verlet | symplectic WHFast)long-term N-body scheme (selectable via settings)
TimeStep0.5 (sim time / sub-step)symplectic sub-step size (smaller = more accurate)
MaxSubSteps8cap on sub-steps per engine tick
Softening1regularises close planet–planet encounters
Δ_crit (two-planet)3.464102 R_H (2 sqrt3, two-planet bound)below this a pair can cross (Hill-unstable)
Δ_crit (multi-planet)8 R_H (empirical multi-planet bound)empirical long-term-stability separation
OverlapThreshold1.0 (Chirikov; >= ⇒ chaotic)resonance-overlap value above which the system is chaotic
StabilityClassStable | Metastable | Chaoticcoarse long-term verdict per system
t_Lyapunov1 / diffusion rate (infinite when regular / non-chaotic)e-folding time of trajectory divergence

Reference: the Chirikov resonance-overlap criterion, Hill stability, the Wisdom–Holman symplectic integrator, and the Lyapunov time.

Binary & multiple-star evolution

Most massive stars live in pairs, and their interaction rewrites their fate. A per-universe BinaryEvolutionPipeline detects every gravitationally bound pair and hierarchical triple, then advances them through a fixed, physically-ordered sequence each tick: tides (synchronisation & circularisation) → mass transfer (Roche-lobe overflow) → common envelope (when transfer runs away) → gravitational-wave inspiral (tight compact pairs) → mergersbinary supernovae (Type Ia, X-ray binaries, stripped-envelope Ib/Ic), with Kozai–Lidov triple dynamics last. These are the realism domains of dedicated binary-population codes (BSE, COSMIC, StarTrack, MESA-binary), implemented here as fast sim-unit models that mutate the live Star masses, orbits, remnant kinds, SN events and ISM enrichment in place.

Detection, classification & hierarchical stability

Each pair of stars sharing a SolarSystem within the bound-separation limit becomes a BinarySystem; a nearby single star can be attached as the outer tertiary of a TripleSystem. Because detection re-runs every tick, a per-universe BinaryRegistry caches each pair (keyed on the unordered Star references) so its evolving orbit and accumulated state survive re-discovery. A triple is only retained if it is hierarchical — the inner and outer orbits must be well separated for the secular approximation to hold — tested with the Mardling–Aarseth stability criterion.

a_out(1−e_out) / a_in > 2.8 [(1 + q_out)(1 + e_out) / √(1−e_out)]^(2/5) (Mardling–Aarseth) stellar kind from mass + age/t_MS: MainSequence | Giant | StrippedHelium | WhiteDwarf | NeutronStar | BlackHole
SymbolValueMeaning
MaxBoundSeparation600 pxwidest separation still treated as a bound pair
GiantAgeFraction0.9fraction of t_MS after which a star is a giant donor
M_WD ceiling80mass below which a dead low-mass star is a white dwarf
M_NS ceiling140mass below which a dead massive star is a neutron star (else BH)
StabilityMargin1 (Mardling-Aarseth a_out/a_in margin)safety factor on the hierarchical-stability bound

Reference: binary stars and the Mardling–Aarseth triple-stability criterion.

Tides — synchronisation, circularisation & spin–orbit coupling

In a close pair each star raises a tidal bulge on the other. Equilibrium-tide (weak-friction) dissipation drives the stellar spins toward the orbital mean motion (synchronisation), damps the eccentricity toward zero (circularisation), and exchanges angular momentum between spin and orbit. The torque scales steeply with the radius-to-separation ratio, so tides matter only for tight binaries — exactly the ones that go on to transfer mass or merge.

dω/dt ∝ (R/a)^6 (ω − n) de/dt ∝ −(R/a)^8 e (weak-friction equilibrium tide)
SymbolValueMeaning
Strength5.0e-3overall tidal dissipation rate (sim units)
SeparationExponent6 ((R/a)^n weak-friction)steepness of the (R/a) falloff
RadiusScale6stellar-radius scale used in (R/a)
CircularizationFloor1.0e-3eccentricity below which circularisation stops

Reference: tidal circularization and equilibrium-tide theory (Hut 1981).

Roche lobe & mass transfer — how mass flows between stars

Each star is bounded by its Roche lobe, the teardrop equipotential around it; the Eggleton formula gives the lobe radius from the mass ratio. When an evolving (expanding) star fills its lobe at pericentre, gas spills through the inner Lagrange point onto the companion — Roche-lobe overflow (RLOF). The transfer is stable if the donor shrinks inside its lobe at least as fast as the lobe shrinks (compared via the mass-radius exponents ζ_star vs ζ_L), giving steady, long-lived transfer; it is unstable (runaway) if the lobe shrinks faster, which triggers a common envelope. Transfer is non-conservative: the accretor takes only a fraction β of the offered mass (capped near an Eddington-like rate for compact objects), the rest leaves the system carrying away angular momentum, so the orbit responds (widening or shrinking) depending on the mass ratio.

R_L/a = 0.49 q^(2/3) / [0.6 q^(2/3) + ln(1 + q^(1/3))] (Eggleton, q = M_donor/M_acc) stable if ζ_star > ζ_L ; ΔM_acc = β·ΔM_donor ; non-conservative J-loss widens/shrinks a
SymbolValueMeaning
RadiusScale6main-sequence stellar-radius scale
MassRadiusExponent0.7 (R ~ M^x)main-sequence mass–radius slope
GiantInflation12xradius boost for an evolved giant donor
FillTolerance0.02R/R_L band counted as “just filling”
TransferRateScale2.0e-3overall RLOF mass-transfer rate (sim units)
ζ_MS0.65mass-radius response of a main-sequence donor
ζ_giant-0.3response of a convective giant (negative ⇒ unstable)
MaxFractionPerStep0.05cap on donor-mass fraction moved per tick
β (accretion eff.)0.5 (accretion efficiency)fraction of offered mass actually accreted
MaxAccretionFraction0.02 (Eddington-like cap)Eddington-like accretion ceiling for compact objects
LuminosityEfficiency1accretion-luminosity conversion efficiency

Reference: Roche lobe (Eggleton 1983) and binary mass transfer.

Common-envelope evolution — the α–λ formalism

When mass transfer is dynamically unstable, the companion is engulfed by the donor's giant envelope and the two cores orbit inside a shared envelope. Drag makes them spiral inward, and the released orbital energy is deposited into the envelope. In the energy (α–λ) formalism the envelope's binding energy is set by λ (its structure), and a fraction α of the orbital energy released during the inspiral is available to unbind it. If that energy exceeds the binding energy the envelope is ejected, leaving a much tighter detached binary (often a compact-object progenitor pair); if not, the cores merge before the envelope clears. This is the key step that hardens wide binaries into the close double-compact systems that later inspiral via gravitational waves.

E_bind = G M_donor M_env / (λ R_donor) α (G M_core M_comp / 2a_f − G M_donor M_comp / 2a_i) = E_bind ⇒ a_f (eject) or merge
SymbolValueMeaning
α_CE1 (orbital energy efficiency)efficiency of orbital energy in unbinding the envelope
λ0.5 (envelope structure)envelope structure / binding-energy parameter
GiantEnvelopeFraction0.7fraction of a giant's mass that is envelope (vs core)

Reference: common-envelope evolution and the α–λ energy formalism (Webbink 1984).

Mergers & merger products — how coalescence happens

A pair merges when its pericentre falls below the sum of the stellar radii (driven there by tides, mass transfer, a failed common envelope, gravitational-wave decay, or a Kozai–Lidov eccentricity spike). The two stars collapse into one object, conserving momentum and shedding a small mass fraction to the ISM. The product is classified from the components' kinds: two main-sequence stars make a rejuvenated, over-massive blue straggler; a compact object sinking into a giant makes a Thorne–Žytkow object; two white dwarfs make a heavier WD (or detonate, see below); two neutron stars make a kilonova leaving a heavy NS or black hole; two black holes make a single larger black hole.

merge if a(1−e) ≤ ContactFactor·(R₁ + R₂) M_remnant = (M₁ + M₂)·(1 − MassLossFraction)
SymbolValueMeaning
ContactFactor1 (pericentre / (R1+R2))pericentre / (R₁+R₂) below which the stars touch
MassLossFraction0.05fraction of total mass ejected during coalescence
M_Ch (WD merger)70Chandrasekhar mass for a WD-merger detonation check
M_NS ceiling140remnant mass above which a merger collapses to a BH

Reference: blue stragglers, Thorne–Žytkow objects and neutron-star mergers.

Binary-specific supernovae — how they differ from single-star SNe

An isolated star's fate is fixed by its birth mass; in a binary the companion changes the outcome. Type Ia is a thermonuclear detonation of a carbon-oxygen white dwarf driven to the Chandrasekhar mass — either single-degenerate (the WD accretes from a companion) or double-degenerate (two WDs merge); a lone WD could never explode this way, and Type Ia dominate the universe's iron enrichment. X-ray binaries are not explosions but persistent states: a compact object accreting from a companion radiates its infalling gas as X-rays, launching relativistic jets (a microquasar) at the highest rates. Stripped-envelope (Type Ib/Ic) core-collapse occurs when a companion removes the hydrogen (Ib) and helium (Ic) envelope before the explosion, so the spectral absence of hydrogen is a direct fingerprint of the binary interaction.

Type Ia: M_WD ≥ M_Ch ⇒ detonation, no remnant, iron-peak ejecta X-ray binary: L_acc = η G M_acc dM/dt / R_acc (jets above a luminosity threshold) Ib/Ic: (M_0 − M)/M_0 ≥ StrippingThreshold & M ≥ M_core,min ⇒ H-poor core collapse
SymbolValueMeaning
M_Ch (Type Ia)70Chandrasekhar detonation mass for a white dwarf
E (Type Ia)1thermonuclear explosion energy (near standard candle)
MetalYield (Ia)0.6 (iron-peak)fraction of ejecta synthesised into iron-peak metals
L_X threshold5accretion luminosity for an X-ray-bright binary
L_jet threshold25 (microquasar jet)luminosity above which relativistic jets launch
M_core,min (Ib/Ic)80minimum mass for a stripped star to core-collapse
StrippingThreshold0.3 (mass-loss fraction for Ib/Ic)mass-loss fraction that makes a SN stripped-envelope
E (Ib/Ic)1.5core-collapse explosion energy for a stripped star

Reference: Type Ia, X-ray binaries and stripped-envelope (Ib/Ic) supernovae.

Triple dynamics — how Kozai–Lidov flips induce mergers

In a hierarchical triple the distant tertiary torques the inner binary. When the mutual inclination exceeds ~39.2°, the inner eccentricity and inclination undergo large, anti-correlated Kozai–Lidov oscillations at fixed inner semi-major axis: as the inclination drops toward the orbital plane the eccentricity is pumped up toward 1, then they swap back (a “flip”). The conserved quantity L_z = √(1−e²)·cos i fixes this trade-off. The eccentricity spikes drive the inner pair to a tiny pericentre where enhanced tides or gravitational-wave emission shrink the orbit rapidly — and at the extreme the inner stars merge. A third star that never touches the inner pair is thus a leading trigger for close-binary mergers, blue stragglers, Type Ia progenitors and compact-object coalescences.

L_z = √(1 − e_in²)·cos i = const (e ↔ i trade-off) t_KL ~ (M_in/M_out)(a_out/a_in)³ P_in (1−e_out²)^(3/2) active for i_crit < i < π−i_crit
SymbolValueMeaning
i_crit0.6847 rad (~39.2 deg)critical mutual inclination for Kozai–Lidov cycles
e_max0.999ceiling on the pumped inner eccentricity
MergerPericentreFactor3pericentre scale at which a KL spike triggers a merger

Reference: the Kozai–Lidov mechanism in hierarchical triples.

Gravitational-wave inspiral — how compact binaries coalesce

Two compact objects (NS/NS, NS/BH, BH/BH, or close WD/WD) radiate orbital energy and angular momentum as gravitational waves, so the orbit shrinks and circularises until the stars coalesce, following the Peters (1964) equations. Two features fall straight out: the orbit circularises as it decays (de/dt drives e→0), and the decay runs away at small separation (da/dt ∝ a^−3), so the final orbits are by far the fastest — the chirp. The circular merger time scales as a⁴, so a wide pair effectively never merges while a tight one (such as the hardened double-compact remnant left by a common envelope) coalesces within the simulation's lifetime; the final merger then builds a heavier, rapidly-spinning Kerr remnant.

da/dt = −(64/5) G³ m₁m₂(m₁+m₂) / (c⁵ a³ (1−e²)^(7/2)) · (1 + 73/24 e² + 37/96 e⁴) t_merge = (5/256) c⁵ a⁴ / (G³ m₁ m₂ (m₁+m₂)) (circular orbit)
SymbolValueMeaning
c (sim)3.0e3speed of light setting the 1/c⁵ inspiral timescale
CoalescenceRadius0.05 pxseparation at which the horizons/surfaces touch
RemnantSpin0.7 (Kerr a*)dimensionless spin a* of the merged compact remnant

Reference: the gravitational-wave inspiral of compact binaries (Peters 1964).

Stellar evolution & remnants

When a star exhausts its fuel, its birth mass and metallicity decide what it leaves behind. A dedicated, pure StellarRemnantPipeline resolves every core-collapse death into a conserving outcome — a white dwarf, neutron star, black hole, or (at the highest masses) nothing at all — then the engine spawns the remnant, enriches the ISM, chooses the feedback channel and resolves the fates of any surviving planets. This is the single-star complement to the binary-evolution channels and the ledger side of the supernova mass budget. The prescriptions mirror those used in modern population-synthesis codes (StarTrack, COSMIC, MESA).

Collapse regime from progenitor mass & metallicity

The decision a star's death makes is fixed first, from its mass at collapse (with metallicity breaking the tie in the transition band). Low-mass stars never reach iron-core collapse: they shed their envelopes as a planetary nebula and leave an electron-degenerate white dwarf. Iron-core collapse of intermediate massive stars halts at nuclear density as a neutron star (Type II supernova). Above the neutron-star maximum the core cannot be supported and collapses to a black hole, either through fallback after a weak explosion or by direct (failed-SN) collapse. At extreme masses electron–positron pair-instability can unbind the entire star, leaving no bound remnant, and beyond that pulsational pair-instability sheds mass in pulses before a final collapse. These bands are exactly the rule table the collapse engine enforces.

M < Chandrasekhar → planetary nebula + white dwarf (no core-collapse SN) 8–25 M☉ → iron-core collapse → neutron star (Type II) 25–40 M☉ → metallicity decides: high Z → NS, low Z / fallback → BH 40–80 M☉ → black hole (direct collapse or SN fallback) 80–140 M☉ → pair-instability SN → NO remnant (total disruption) 140–260 M☉ → pulsational pair-instability → black hole > 260 M☉ → direct collapse → massive (SMBH-seed) black hole
RegimeProgenitor bandOutcome
WhiteDwarfFormation< Chandrasekharplanetary nebula, white dwarf
IronCoreNeutronStar8–25 M☉Type II SN, neutron star
MetallicityDependentNsOrBh25–40 M☉NS (high Z) or BH (low Z / fallback)
BlackHoleCollapse40–80 M☉black hole (fallback or direct)
PairInstabilityNoRemnant80–140 M☉pair-instability SN, no remnant
PulsationalPairInstabilityBlackHole140–260 M☉pulsational PISN, then black hole
DirectCollapseMassiveBlackHole> 260 M☉direct-collapse massive black hole

Reference: stellar evolution, the Chandrasekhar and Tolman–Oppenheimer–Volkoff limits, and pair-instability supernovae.

Remnant-mass prescription — fallback & the NS–BH mass gap

Once the regime is chosen, a remnant-mass model turns the pre-collapse (core) mass into the bound remnant mass. The default is Fryer et al. 2012: the explosion is a proto-neutron-star plus mass-dependent fallback — light cores explode cleanly (neutron stars), heavy cores fail to explode and fall back to black holes. Its delayed engine ramps fallback smoothly (a continuous NS→BH spectrum that fills the “mass gap”), while its rapid engine keeps fallback negligible until a sharp threshold, reproducing the observed ~2–5 M☉ gap between neutron stars and black holes. Two optional modes are provided: Spera et al. 2015 (PARSEC-based, metallicity-sensitive — metal-poor stars keep a heavier core and form black holes more readily), and Belczynski et al. 2016 (a two-regime direct-collapse-above-threshold model common in binary-population synthesis).

delayed: f_fb = clamp((M_core − 6) / (25 − 6), 0, 1) (continuous NS→BH) rapid: f_fb = smoothstep(7, 11, M_core) (sharp NS–BH gap) Spera15: transition shifts to lower M_core as Z drops (up to −4 M☉) Belcz16: M_core ≥ 11 M☉ ⇒ direct collapse; else rapid-like fallback M_remnant = M_core · (1 − f_fb) + f_fb · (fallback-augmented mass)
Model / engineValueMeaning
Fryer2012 (default)delayed enginecontinuous remnant spectrum (mass gap filled)
Fryer delayed band6–25 M☉ coreclean explosion → full fallback range
Fryer rapid band7–11 M☉ coresharp transition → NS–BH mass gap
Spera2015 Z-shiftup to −4 M☉lower Z → heavier remnant / easier BH
Belczynski2016 threshold11 M☉ coredirect-collapse core-mass cutoff
Z☉ reference0.014solar metallicity used in the Z scaling

Reference: Fryer et al. 2012 fallback prescription, Spera et al. 2015 and Belczynski et al. 2016.

Resolution pipeline & exact mass conservation

The pipeline is pure — it computes an outcome and never mutates universe state — and runs six stages in physical order so each feeds the next: (1) metallicity winds (Vink / Wolf–Rayet / AGB / rotation / binary-stripping) shrink the progenitor to a pre-collapse core; (2) binary effects let accretion or a merger raise the core, and neutron-star accretion-induced collapse can force a black hole; (3) the collapse engine selects the regime above from the original mass and metallicity; (4) the remnant-mass model applies fallback; (5) classification finalises NS vs BH vs none; (6) mass accounting partitions the progenitor into the bound remnant, radiated mass and ISM return. The three shares always sum back to the progenitor mass, so a stellar death is exactly mass-conserving before it is handed to the engine adapter.

winds → binary → collapse regime → remnant mass (fallback) → classify → account M_progenitor = M_remnant + M_radiated + M_ISMreturn (conserved, per death) no-remnant (PISN): M_remnant = 0, all baryons return to the ISM (minus radiated)
StageEffectMeaning
1. Metallicity windsM → corelow Z retains mass → heavier core
2. Binary effectscore ± / force BHaccretion, mergers, NS AIC
3. Collapse engineregimethe NS / BH / PISN rule table
4. Remnant massfallbackFryer / Spera / Belczynski
5. ClassificationNS / BH / nonefinal remnant type
6. Mass accountingremnant + radiated + ISMexact conservation

Reference: compact remnants and core-collapse mass accounting; cross-links to the supernova mass-budget ledger and stellar winds.

Stellar winds & mass loss

Line-driven winds — how hot stars blow themselves apart

Hot, luminous OB stars and luminous blue variables drive winds by scattering their own ultraviolet photons in millions of metal absorption lines (the CAK / Vink mechanism). Because the driving is line opacity, the mass-loss rate climbs steeply with luminosity and scales with metallicity as roughly Z^0.85 — metal-poor stars at high redshift lose far less mass and keep more of their birth mass to the end. A bi-stability jump near the recombination of iron sharply increases the rate (and slows the wind) as the star cools below it, so a star crossing that temperature suddenly sheds mass faster.

dM/dt ∝ L^α (Z/Z⊙)^0.85, with a bi-stability jump at T < T_bs
SymbolValueMeaning
α (L exponent)2how steeply the rate rises with luminosity
Z exponent0.85 (Z^0.85 scaling)metallicity dependence of line driving
T_bs0.45 (bi-stability jump)temperature below which the rate jumps up
v_wind6fast terminal speed of the hot-star wind

Reference: line-driven stellar winds (Castor–Abbott–Klein; Vink et al.).

Dust-driven winds — the AGB superwind

Cool, pulsating asymptotic-giant-branch stars levitate their outer layers with shock waves, let the gas cool until dust grains condense, and then push that dust (and the gas dragged along with it) out by radiation pressure. Pulsation greatly enhances the loss, and carbon-rich stars (C/O > 1) form soot more readily and drive an even stronger, dustier wind. This slow, heavy superwind is how intermediate-mass stars return carbon- and dust-enriched gas to the interstellar medium before becoming white dwarfs.

dM/dt enhanced by pulsation; extra boost when C/O > 1; slow dusty outflow
SymbolValueMeaning
Pulsation boost8xmass-loss enhancement from radial pulsation
Carbon-rich boost2x (C/O > 1)extra loss for soot-forming carbon stars
v_wind0.4slow terminal speed of the dusty wind

Reference: AGB dust-driven mass loss and the superwind.

Cool-supergiant winds — Reimers & Blöcker

Red giants and red supergiants lose mass through a cool, dust- and chromosphere-assisted wind described empirically by the Reimers law (dM/dt ∝ LR/M). As a star climbs the giant branch its luminosity soars and the loss accelerates super-linearly — the Blöcker enhancement (∝ L^2.7) — turning the gentle red-giant breeze into the powerful wind that strips a red supergiant before core collapse. Chromospheric activity strengthens the wind further in the coolest stars.

dM/dt = η LR/M · (L/L_thr)^2.7 (Blöcker) · chromospheric factor
SymbolValueMeaning
η (Reimers)0.4Reimers efficiency of the cool-giant wind
Blöcker exponent2.7 (L^2.7 superwind)super-linear luminosity dependence near the tip
Chromospheric1.8xactivity enhancement for the coolest giants

Reference: the Reimers and Blöcker cool-giant mass-loss laws.

Magnetised winds & spin-down — why Sun-like stars slow down

Cool, low-mass stars with convective envelopes run magnetic dynamos and lose a tiny, ionised wind along open field lines. The mass loss is negligible for the budget, but the wind co-rotates out to the Alfvén radius and carries off angular momentum with a long lever arm, so the star magnetically brakes and spins down over its life (the Skumanich law). Below a saturation rotation rate the braking torque flattens off, capping how fast rapid rotators lose spin.

dJ/dt ∝ −Ω³ (unsaturated), ∝ −Ω above Ω_sat
SymbolValueMeaning
v_wind4terminal speed of the magnetised breeze
Ω_sat0.05 (Skumanich/saturated)spin above which the braking torque saturates

Reference: magnetic braking of solar-type stars.

Rotational mass loss & Be decretion discs

A rapidly rotating star is supported partly by centrifugal force, so material near the equator is much easier to eject; as the spin approaches the critical (break-up) rate the equatorial effective gravity falls toward zero and the wind is strongly enhanced there. Past a threshold fraction of critical rotation the star can no longer hold onto its equator and sheds a thin, dense decretion disc — the classical Be-star phenomenon — rather than a fast wind.

enhancement → ∞ as Ω/Ω_crit → 1; decretion disc above the threshold
SymbolValueMeaning
Disc threshold0.7 (Ω/Ω_crit)critical-rotation fraction that forms a Be disc

Reference: Be-star decretion discs and near-critical rotation.

Wolf–Rayet evolution & winds — stripping the envelope

A very massive star that loses its hydrogen envelope — to winds, rotation, or a binary companion — exposes its hot, helium-burning core as a Wolf–Rayet star with an extremely dense, fast, metal-enriched wind. As successive layers are peeled away the surface chemistry marches through the sequence WN (nitrogen) → WC (carbon) → WO (oxygen), and the stripped star is the progenitor of a Type Ib/Ic supernova. The formation mass threshold itself depends on metallicity, since metal-rich stars reach the Wolf–Rayet stage at lower initial mass.

dM/dt ∝ L^1.5 (Z/Z⊙)^0.6; surface chemistry WN → WC → WO
SymbolValueMeaning
Formation mass18 M_sun (solar Z)minimum initial mass to reach the WR stage
L exponent1.5luminosity dependence of the WR wind
Z exponent0.6metallicity dependence of the WR wind
v_wind8fast terminal speed of the dense WR wind

Reference: Wolf–Rayet stars and stripped-envelope evolution.

Binary-wind coupling — capture, X-ray binaries & widening

In a binary the donor's wind does not just escape: the companion sweeps up part of it by Bondi–Hoyle–Lyttleton capture, and when the wind is slow it can be funnelled through the inner Lagrange point as wind Roche-lobe overflow for much more efficient transfer. A compact companion (white dwarf, neutron star, or black hole) accreting a captured wind lights up as a wind-fed X-ray binary. Because mass leaves the system, the orbit responds — isotropic (Jeans-mode) wind loss widens it as a · M_total stays roughly constant.

capture ∝ (GM_acc)² / (v_rel⁴ b²); Jeans widening: a · M = const
SymbolValueMeaning
BHL efficiency1 (Bondi-Hoyle-Lyttleton)efficiency of free-wind gravitational capture
WRLOF capture0.3 (wind-RLOF)captured fraction when a slow wind is funnelled

Reference: Bondi–Hoyle–Lyttleton accretion and wind Roche-lobe overflow.

Circumstellar medium & wind feedback

Every wind returns gas, dust, and freshly-synthesised metals to the surroundings and sweeps the ambient medium into a shell, building the circumstellar medium that a later supernova will slam into. The fast winds of hot and Wolf–Rayet stars also inflate hot, low-density wind-blown bubbles. In the simulation the shed mass (split into gas, dust, and metals) is credited back to the universe's free-mass budget so total mass is conserved, while a fraction is retained as a growing circumstellar shell around the star.

shed mass → gas + dust + metals (returned to free mass); fraction retained as a shell
SymbolValueMeaning
Shell retention0.25fraction of shed mass kept as circumstellar shell

Reference: circumstellar medium and wind-blown bubbles.

Small-body destruction — keeping the planet count realistic

Planet formation locks disc solids into planets, but not every gram of solids is meant to end up in a planet — in real systems a large fraction is trapped in dwarf planets, asteroids, comets, meteoroids, dust and moons that starve their feeding zones and are then ground away. Without that outlet the engine over-produced planets for the mass available. This layer models the small-body population as aggregate, per-system mass reservoirs (there are far too many bodies to track individually) and runs every tick after planet destruction. Each pass seeds a fraction of the disc solids into small bodies, grinds them down a collisional / sublimation cascade to dust, and removes that dust from the system, steadily bleeding solids out of the planet-forming budget. Every gram is credited to a concrete reservoir (star / ISM / planet / disc solids) and a per-system audit confirms reservoirafter = reservoirbefore + in − out, so mass is conserved across every conversion.

Feeding-zone starvation — seeding solids into small bodies

Embryos that never clear their feeding zone leave their local solids behind as belts, comets, dwarf-planet cores and captured moons rather than sweeping them into a planet. Each tick a small fraction of the disc's current solid mass is diverted out of the disc and split across the small-body classes (the moon share is only taken when the system has a planet to host moons; otherwise it is redistributed so the seeded total is exactly preserved). This is the mechanism that removes fuel from the planet-formation pipeline — the seeded solids are conserved every step of the way but are no longer available to grow planets.

seed = fseed · Mdisc,solid → {asteroids, comets, dwarf planets, moons}
SymbolValueMeaning
fseed0.01 / tickfraction of disc solids diverted into small bodies per tick
Asteroid share0.45seeded fraction condensing into the asteroid belt
Comet share0.30seeded fraction forming comets beyond the snow line
Dwarf share0.15seeded fraction forming starved dwarf embryos
Moon share0.10seeded fraction captured as planetary moons

Reference: planetary feeding zones and oligarchic isolation mass.

Dwarf-planet regulation — starved embryos, rarely promoted

A dwarf planet is massive enough to be rounded by self-gravity but has failed to clear its zone, so it is fragile. Promotion to a full planet is allowed only when the shared planet mass-budget has room (the same ceiling the planet-destruction layer enforces); otherwise the dwarf is regulated by destruction — collisionally shattered into an asteroid belt, gravitationally scattered out of the system to the ISM, or tidally stripped into dust on a star-grazing orbit. The more starved the population, the more fragile it is, so destruction runs faster. This diverts solids off the “grow into a planet” track and onto the “ground to dust and removed” track.

dwarf → planet (only if Mplanet < Mallowed), else → asteroids / ISM / dust
SymbolValueMeaning
Starvation eff.0.15feeding-zone clearing efficiency ceiling for dwarfs
Promotion rate0.02 / tickcapped rate of dwarf→planet promotion within budget
Collision rate0.05 / tickdwarf mass shattered into asteroids per tick
Scatter rate0.02 / tickdwarf mass ejected to the ISM per tick
Tidal-strip rate0.01 / tickdwarf mass stripped to dust near the star per tick

Reference: dwarf planets and zone-clearing.

Asteroid collisional cascade — grinding the belt down

Asteroids collide at speeds set by their velocity dispersion; a belt embedded in a planetary system is stirred by mean-motion and secular resonances (the mechanism behind the Kirkwood gaps), so it grinds itself down far faster than an isolated one. Collisions come in two regimes: catastrophic disruptions pulverise both bodies mostly into fine dust, while cratering impacts merely chip off coarser meteoroid ejecta. Over many ticks this is a true Dohnanyi cascade — belt → meteoroids → dust — and the belt's size distribution shifts to the small end and depletes, so its solids cannot re-coagulate into planets.

rate ∝ fcoll · (1 + resonance boost · Nplanets); processed → meteoroids + dust
SymbolValueMeaning
Collision rate0.03 / tickbase fraction of belt mass processed by collisions
Resonance boostup to 3xresonant stirring amplification in a planetary system
Catastrophic frac.0.35share of collisions that are super-catastrophic (→ dust)
Dust yield0.40fine-dust fraction from cratering ejecta

Reference: collisional cascade and the Dohnanyi size distribution.

Comet sublimation — ices to gas, refractories to dust

Comets are volatile-rich icy bodies. When heated by the star their ices sublimate directly to gas, dragging embedded refractory grains off with them — the physical origin of a comet's gas and dust tails. The mass-loss rate rises steeply with insolation, so it scales with stellar luminosity: bright stars and close-in comets lose mass fastest. Thermal stress, spin-up from asymmetric outgassing, and tidal stress also split comets into meteoroid streams (the parents of meteor showers). Because sublimation permanently returns volatiles to the ISM as gas, comets are a net sink of solids: comet → gas + dust, and comet → meteoroids → dust.

dM/dt ∝ L; split into gas (→ ISM) + refractory dust; fragmentation → meteoroids
SymbolValueMeaning
Sublimation rate0.04 / tick · Lcomet mass sublimated per tick, scaled by luminosity
Volatile frac.0.80share of sublimated mass that is volatile gas (rest is dust)
Fragmentation0.01 / tickcomet mass shed into meteoroid streams per tick

Reference: cometary sublimation and outgassing.

Meteoroid fragmentation — the road to dust

Meteoroids (cm–m fragments) are the intermediate rung between coarse bodies and terminal dust. Mutual collisions comminute them, and near-star heating sublimates them — both paths feed the dust reservoir. A small fraction of the flux intersects a planet with an appreciable atmosphere and is ablated by ram-pressure heating, depositing its mass onto the world as micrometeoritic infall (the one meteoroid channel that delivers solids back to a planet rather than to dust). Whole-body tidal shredding near planets or compact objects is handled for macroscopic bodies by the planet-destruction layer; for the aggregate meteoroid population it appears as the same comminution-to-dust captured here.

meteoroid → dust (collisions + sublimation); small fraction → planet (ablation)
SymbolValueMeaning
Fragment rate0.06 / tickmeteoroid mass comminuted to dust by collisions per tick
Sublimation rate0.02 / tick · Lmeteoroid mass sublimated to dust near the star per tick
Ablation rate0.01 / tickfraction ablated onto a planetary atmosphere per tick

Reference: meteoroids and atmospheric ablation.

Dust blowout & Poynting–Robertson drag — the terminal exit

Dust is the end of the cascade and the single most important stage for keeping the planet population realistic, because it is where solids permanently leave the system. For a grain the ratio of radiation pressure to gravity, β = Frad/Fgrav, is independent of distance; grains with β > 0.5 are on unbound orbits the instant they are released and are blown out to the ISM (a larger size range for more luminous stars). Bound grains still absorb and re-emit starlight, and the forward-beamed re-emission robs them of angular momentum — Poynting–Robertson drag — so they spiral inward until they are accreted by the star or sublimate to gas at the dust-destruction radius. Because seeding continuously feeds the cascade and the cascade continuously feeds dust, this stage continuously removes solids (to star + ISM), and that removal rate is the throttle on how much solid mass can remain locked in planets.

β > 0.5 → blowout (ISM); β < 0.5 → PR spiral → star, or sublimate → gas (ISM)
SymbolValueMeaning
Blowout rate0.20 / tick · (L/Lref)fraction of small grains blown out to the ISM per tick
PR-drag rate0.10 / tickbound dust spiralling into the star per tick
Dust sublimation0.05 / tickdust vaporised to gas at the destruction radius per tick

Reference: Poynting–Robertson drag and radiation-pressure blowout.

Moon tidal decay — Roche-limit destruction

A moon raises a tidal bulge on its planet; if it orbits below the synchronous radius the lagging bulge torques it inward until it crosses the Roche limit (the fate awaiting Phobos and Triton). A moon that reaches the Roche limit above the surface is torn into a Saturn-ring-like debris disc; one whose decayed orbit meets the surface first impacts the planet and delivers its whole mass. Resonant scattering can instead eject a moon to the ISM. The debris ring is not permanent: mutual collisions and viscous spreading regrind it into dust, which the dust pipeline then removes — so a destroyed moon flows moon → debris → dust → removed and never becomes a solids store. If a system has no planet to receive an impact, that mass is routed to debris so none is stranded.

moon → debris disc + planet impact (Roche); moon → ISM (ejection); debris → dust
SymbolValueMeaning
Tidal-decay rate0.02 / tickmoon mass decaying across the Roche limit per tick
Ejection rate0.005 / tickmoon mass resonantly scattered to the ISM per tick
Debris frac.0.70share of a disrupted moon torn into debris (rest impacts)
Reprocessing0.10 / tickdebris-ring mass reground into dust per tick

Reference: the Roche limit and tidal orbital decay.

Mass-budget enforcement & conservation — keeping it honest

The small-body reservoir is not allowed to become an unphysical hoard of solids. Its total is anchored to the peak disc solids the system ever had; any excess above the allowed fraction is recondensed back to disc solids in a fixed trim order (debris → dust → meteoroids → comets → asteroids → dwarf planets → moons), so the coarsest, longest-lived bodies are preserved and the finest, most transient material is shed first. After every pass a conservation validator confirms the reservoir change equals exactly the mass that entered from, minus the mass that left to, external reservoirs; any violation is logged. Together with the shared planet mass-budget (which caps dwarf→planet promotion), this guarantees that destruction genuinely removes mass from the planet-formation pipeline, that dust removal reduces the solids available for planets, and that mass is conserved across every conversion — which is what keeps the net planet population realistic for the mass allotted.

Msmall,total ≤ fbudget · Mdisc,solid,peak; reservoirafter = reservoirbefore + in − out
SymbolValueMeaning
Budget frac.0.30max small-body mass as a fraction of peak disc solids
Trim orderdebris → … → moonswhich reservoir is recondensed to disc solids first
Conservation tol.1e-9absolute mass tolerance for the per-tick audit

Reference: mass-conserving debris bookkeeping; mirrors the engine's planet-destruction mass budget.

← Back to the simulation