Model/Simulation
Core types for setting up and running AURORA simulations.
AuroraModel
AURORA.AuroraModel — Type
AuroraModel{AG, EG, PAG, SD, IO, SP, FT, V}Container for the grids, atmosphere, and collision data used by an AURORA simulation.
AuroraSimulation
AURORA.AuroraSimulation — Type
AuroraSimulation{M<:AuroraModel, F<:InputFlux, S<:AbstractMode}A complete simulation configuration, bundling the physical model, input flux, mode strategy, output configuration, resolved time configuration, and lazy simulation cache.
Use initialize! to allocate the workspace explicitly, or call run! directly to auto-initialize and execute the simulation.
Examples
# Single-step steady-state
sim = AuroraSimulation(model, flux, "my_run"; mode=SteadyStateMode())
# Multi-step steady-state
sim = AuroraSimulation(model, flux, "my_run"; mode=SteadyStateMode(duration=0.5, dt=0.01))
# Time-dependent
sim = AuroraSimulation(model, flux, "my_run";
mode=TimeDependentMode(duration=0.5, dt=0.001, CFL_number=128))
# Full output control via AuroraOutputManager
out = AuroraOutputManager("my_run"; overwrite=true, compress=false)
sim = AuroraSimulation(model, flux, out; mode=SteadyStateMode())Mode/Solver types
AURORA.AbstractMode — Type
AbstractModeAbstract supertype for simulation modes.
Concrete subtypes:
SteadyStateMode: solves each time step independently as a steady-state problemTimeDependentMode: time-stepping with a Crank-Nicolson scheme
The mode controls both the numerical scheme used at each energy step and how time parameters (if any) are resolved into an internal time configuration.
AURORA.SteadyStateMode — Type
SteadyStateMode()
SteadyStateMode(; duration, dt)Solve each time step independently as a steady-state (time-independent) transport problem.
When called without arguments, a single steady-state solve is performed.
When called with duration and dt, a UniformTimeGrid is built and each point is solved independently. This enables, e.g., a flickering input where each time step is solved in steady-state.
Examples
# Single-step steady-state
sim = AuroraSimulation(model, flux, savedir; mode=SteadyStateMode())
# Multi-step steady-state (each time point solved independently)
sim = AuroraSimulation(model, flux, savedir; mode=SteadyStateMode(duration=0.5, dt=0.01))AURORA.TimeDependentMode — Type
TimeDependentMode(; duration, dt, CFL_number=64, max_memory_gb=8.0, n_loop=nothing)Solve the transport equation in a time-dependent manner with a Crank-Nicolson scheme.
Keyword Arguments
duration: total simulation time (s)dt: time step for saving data (s). The internal time step may be finer to satisfy the CFL condition.CFL_number = 64: CFL stability factor. Crank-Nicolson is unconditionally stable, so large values are acceptable (it will affect the accuracy though).max_memory_gb = 8.0: memory budget (GB) used to auto-split the simulation into loops.n_loop = nothing: manually specify the number of loops. Overridesmax_memory_gb.
Examples
sim = AuroraSimulation(model, flux, savedir;
mode=TimeDependentMode(duration=0.5, dt=0.001, CFL_number=128))Simulation execution
AURORA.initialize! — Function
initialize!(model::AuroraModel; verbose=true, policy=CachePolicy())Perform all heavy setup for model:
- Compute
s_fieldandionospherefrom the current altitude grid. - Compute (or load from cache) the scattering matrices.
- For each species: sample the density profile, load cross sections and excitation levels (skipped if already pre-populated), build phase functions, and load/compute cascading transfer matrices.
Called internally by initialize!(sim) and/or run!(sim).
initialize!(sim::AuroraSimulation;
force_recompute=false,
save_cache=true,
cache_root=default_cache_root())Allocate or re-allocate the working cache for sim.
Keywords
force_recompute: ignore compatible on-disk cascading caches and rebuild themsave_cache: iffalse, skip writing newly computed cascading caches to diskcache_root: parent directory that contains the cascading and scattering cache folders
AURORA.run! — Function
run!(sim::AuroraSimulation)Execute the simulation described by sim.
Automatically calls initialize! when needed, then dispatches to the appropriate execution path based on the selected mode.
Examples
sim = AuroraSimulation(model, flux, savedir;
mode=TimeDependentMode(duration=0.5, dt=0.001, CFL_number=128))
run!(sim)