FLRWSolver: FLRW Perturbation & Dynamo Simulator
- FLRWSolver is a numerical relativity module that simulates scalar perturbations and magnetic field dynamics in perturbed FLRW spacetimes.
- It integrates as a Cactus thorn with McLachlan, Carpet, and MoL to compute grid-based evolution using first-order upwind finite differences.
- Simulations demonstrate that, under zero conductivity, seed magnetic fields can amplify by up to five orders of magnitude, emphasizing parameter sensitivity.
FLRWSolver is a specialized numerical relativity software module developed for the Einstein Toolkit, designed to simulate the evolution of cosmological perturbations and magnetogenesis within perturbed Friedmann–Lemaître–Robertson–Walker (FLRW) spacetimes. It provides a computational framework for solving the 3+1 decomposed equations of the perturbed FLRW metric, explicitly including evolution of seed magnetic fields via the cosmic dynamo equation in the kinematic-dynamo approximation. FLRWSolver is implemented as a Cactus “thorn” tightly integrated with the established relativistic gravity toolchain, using first-order perturbation theory in the Newtonian gauge and supporting structured, grid-based computations of primordial magnetic field (PMF) amplification in expanding universes (Bravo et al., 2 Jan 2026).
1. Architecture and Integration
FLRWSolver is architected as a Cactus thorn for direct integration within the Einstein Toolkit (ET) release ET_2019_10. It relies on several core ET modules: McLachlan for BSSN metric evolution, Carpet for mesh refinement, and MoL for Method-of-Lines (MoL) time integration.
Upon initialization, FLRWSolver:
- Reads cosmological and physical parameters from the Cactus parameter file, supporting configurable values for matter/radiation densities (Ω_M, Ω_R), Hubble constant (H₀), equation-of-state parameter (w), electrical conductivity (σ), seed field amplitude (B₀), grid spacing, time horizon, and time integration method (“RK3” or “RK2”).
- Constructs the exact background FLRW metric in conformal time with analytical expressions.
- Superimposes a spectrum of first-order scalar metric perturbations in the Newtonian gauge.
- Registers grid functions for the 3-metric (γ₍ᵢⱼ₎), extrinsic curvature (K₍ᵢⱼ₎), and hydrodynamic variables (e.g., energy density, pressure).
- Delegates metric and velocity field evolution to the McLachlan+MoL stack, while DynamoSolver (a dedicated, stand-alone MoL integrator) advances the magnetic field according to the derived cosmic dynamo equation.
The software employs dedicated parameter, initial data, velocity extraction, and I/O modules and exchanges numerical data between Cactus and DynamoSolver using HDF5.
2. Mathematical and Numerical Foundations
FLRWSolver operates in the 3+1 decomposition of spacetime. The perturbed FLRW metric is encoded as: with gauge variables mapped to Cactus grid functions: α = a(1+Ψ), βi=0, and γ{ij} = a²(1-2Φ)δ_{ij}.
The cosmic dynamo evolution—the numerical centerpiece—is derived by combining Maxwell’s equations and Ohm’s law in a perturbed, expanding background under the kinematic (fixed-flow) approximation. The full evolution for the perturbed magnetic field is
where all expansion, damping, and source terms are explicit.
Spatial derivatives are approximated using first-order upwind finite differences. Time stepping leverages MoL with RK3 or optional RK2; second- and fourth-order central stencils were found to be numerically unstable for this problem class, requiring first-order for stability. A Courant-Friedrichs-Lewy (CFL) condition, Δτ ≤ C_CFL min(Δx, Δy, Δz) with C_CFL ≲ 0.5, guarantees the time-step stability. No artificial dissipation is required under these schemes.
3. Simulation Workflow and Performance Metrics
FLRWSolver requires mesh-based simulations, typically on uniform Cartesian computational grids (64³ up to 256³). Initial data are constructed analytically for the background and by sampling a specified power spectrum for scalar perturbations. Periodic boundary conditions are imposed for the metric, velocity, and magnetic fields.
At each time step, the workflow is:
- Evolve the 3+1 metric and velocity field using McLachlan and the Method-of-Lines integrator.
- Export the computed peculiar velocity to DynamoSolver.
- DynamoSolver advances the magnetic field by integrating the cosmic dynamo equation using upwind finite differences and the specified Runge–Kutta scheme.
Electrical conductivity σ enters as a damping term and modulates the efficacy of the cosmic dynamo. Output data are stored using HDF5 for checkpointing and analysis.
Performance on an eight-core workstation for 64³ grids is as follows: each dynamo step (inc. dual RK3 sub-steps) requires ~0.03 s of wall time, a full background + 2000 dynamo steps to τ ~ 5 requires ~3 hours, and the memory footprint scales linearly with grid size (~1 GB per 64³ grid).
4. Typical Usage and Configuration
A minimal Cactus parameter input for launching a simulation is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
// Thorn and driver selection ActiveThorns = "Carpet MoL McLachlan FLRWSolver DynamoSolver" Carpet::domain_from = "FLRW" Carpet::domain_to = "FLRW" // Cosmology and physics parameters FLRWSolver::Omega_M = 0.315 FLRWSolver::Omega_R = 8.4e-5 FLRWSolver::H0 = 67.4 FLRWSolver::w = 0.0 FLRWSolver::sigma = 0.0 FLRWSolver::B0 = 1e-22 FLRWSolver::GridSpacing = 0.1 // Time integration MoL::ODE_Method = "RK3" MoL::MoL_CFLFraction = 0.4 Cactus::sou = 0.0 Cactus::evol_time = 10.0 |
5. Scientific Results: Magnetogenesis and Parameter Dependence
FLRWSolver has been used to quantitatively analyze the amplification of primordial magnetic fields (PMFs) during cosmic evolution under the influence of scalar perturbation-driven velocity fields. In the regime of zero conductivity (σ=0), FLRWSolver simulations show seed fields (B ~ 10⁻²²) growing up to ∼10⁻¹⁷ purely by dynamo action from the velocity field extracted from the perturbed Einstein–Bianchi system. As σ increases, Ohmic damping dominates, eventually suppressing net amplification. These results establish the software as a tool for probing the parameter dependence of early-universe magnetogenesis (Bravo et al., 2 Jan 2026).
6. Limitations, Stability, and Ongoing Development
Current limitations are set by numerical and model-theoretic constraints: only first-order upwind stencils are stable (higher-order finite differencing induces unphysical mode growth); the kinematic (fixed-flow) treatment neglects Lorentz force back-reaction on the velocity field; only scalar modes in the Newtonian gauge are supported. Ongoing development includes:
- Generalizing to include vector/tensor perturbations.
- Supporting alternative gauge choices.
- Implementing fully coupled MHD (as in GRHydro).
- Exploring fast Fourier-space solvers for the dynamo equation.
A plausible implication is that, by bridging analytic perturbative cosmology and scalable numerical relativity machinery, FLRWSolver enables large-scale, grid-based studies of magnetogenesis and the associated cosmic velocity couplings in the early universe, supporting theoretical and computational studies of PMF origin and evolution (Bravo et al., 2 Jan 2026).