---
title: 'FLRWSolver: FLRW Perturbation & Dynamo Simulator'
url: https://www.emergentmind.com/topics/flrwsolver
type: topic
---

# FLRWSolver: FLRW Perturbation & Dynamo Simulator

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 [2601.00774].

## 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:

1. 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”).
2. Constructs the exact background FLRW metric in conformal time with analytical expressions.
3. Superimposes a spectrum of first-order scalar metric perturbations in the Newtonian gauge.
4. Registers grid functions for the 3-metric (γ₍ᵢⱼ₎), extrinsic curvature (K₍ᵢⱼ₎), and hydrodynamic variables (e.g., energy density, pressure).
5. 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:
\[
ds^2 = a^2(\tau)\left[-(1+2\Psi)d\tau^2 + (1-2\Phi)\delta_{ij}dx^i dx^j\right]
\]
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 \( b_{(1)}^i \) is
\[
(b_{(1)}^i)'' =
\partial_j\partial^j b_{(1)}^i
- [2\mathcal{H} + 4\pi a^2\sigma](b_{(1)}^i)'
- [\mathcal{H}' + \mathcal{H}^2 + 4\pi a^2\sigma]\,b_{(1)}^i
+ 4\pi a^2\sigma\,\partial_j[b_{(0)}^j v^i - b_{(0)}^i v^j]
\]
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:

1. Evolve the 3+1 metric and velocity field using McLachlan and the Method-of-Lines integrator.
2. Export the computed peculiar velocity \(v^i\) to DynamoSolver.
3. 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:
```
// 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
```
During execution, FLRWSolver computes the scale factor \(a(\tau)\), perturbations Ψ and Φ from the supplied spectrum, creates initial data for all required fields, and iteratively invokes DynamoSolver for field evolution [2601.00774].

## 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 [2601.00774].

## 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 [2601.00774].

Source: https://www.emergentmind.com/topics/flrwsolver