% template.tex, dated April 5 2013
% This is a template file for Annual Reviews 1 column Journals
%
% Compilation using ar-1col.cls' - version 1.0, Aptara Inc.
% (c) 2013 AR
%
% Steps to compile: latex latex latex
%
% For tracking purposes => this is v1.0 - Apr. 2013

\documentclass{ar-1col}


\usepackage[comma]{natbib}
\usepackage{url,bm}
\usepackage[utf8]{inputenc}
\usepackage{fourier} 
\usepackage{array}
\usepackage{makecell}
\usepackage[makeroom]{cancel}
\usepackage{amssymb}
\usepackage[flushleft]{threeparttable}

\renewcommand\theadalign{bc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}

\graphicspath{{./fig/}{./png/}}

\input macros
\def\red{\textcolor{red}}
\def\blue{\textcolor{blue}}

\setcounter{secnumdepth}{4}

% Metadata Information
%\jname{Xxxx. Xxx. Xxx. Xxx.}
%put date (for now)
\jname{\today}
\jvol{AA}
\jyear{YYYY}
\doi{10.1146/((please add article doi))}


% Document starts
\begin{document}
% Page header
\markboth{Brandenburg \& Ntormousi}{Galactic Dynamos}

% Title
\title{Galactic Dynamos}

\author{Axel Brandenburg$^{1,2,3,4}$ \& Evangelia Ntormousi$^{5,6}$
%[0000-0002-7304-021X]{Axel Brandenburg}
\affil{$^1$Nordita, KTH Royal Institute of Technology and Stockholm University,
Hannes Alfv\'ens v\"ag 12, SE-10691 Stockholm, Sweden}
\affil{$^2$The Oskar Klein Centre, Department of Astronomy,
Stockholm University, AlbaNova, SE-10691 Stockholm, Sweden}
\affil{$^3$McWilliams Center for Cosmology \& Department of Physics,
Carnegie Mellon University, Pittsburgh, PA 15213, USA}
\affil{$^4$School of Natural Sciences and Medicine, Ilia State University,
3-5 Cholokashvili Avenue, 0194 Tbilisi, Georgia}
\affil{$^5$Scuola Normale Superiore, Piazza dei Cavalieri 7, I-56126 Pisa, Italy}
\affil{$^6$Institute of Astrophysics, Foundation for Research and Technology-Hellas, Vasilika Vouton, GR-70013 Heraklion, Greece}
}

\begin{abstract}
Spiral galaxies, including the Milky Way, have large-scale magnetic
fields with significant energy densities.
The dominant theory attributes these magnetic fields to a large-scale dynamo.
We review the current status of dynamo theory and discuss various
numerical simulations designed to explain either particular aspects
of the problem or to reproduce galactic magnetic fields globally.
Our main conclusions can be summarized as follows.
\parbox{10cm}{
\begin{itemize}
\item 
Idealized direct numerical simulations produce mean magnetic fields,
whose saturation energy density tends to decline with
increasing magnetic Reynolds number.
This is a manifestation of catastrophic quenching, which is still
an unsolved problem.
\item
Small-scale dynamos, which create magnetic fields at the resistive scale,
are important throughout a galaxy's life, and probably provide strong
seed fields at early stages.
\item 
Large-scale galactic magnetic fields of microGauss strengths
can probably only be explained if helical magnetic fields of small or
moderate length scales can rapidly be ejected or destroyed.
\item 
The circumgalactic medium (CGM) may play an important role
in driving dynamo action at small and large length scales.
These interactions between the galactic disk and the CGM
may be a key aspect in understanding galactic dynamos.
\end{itemize}}
We expect future research in galactic dynamos to focus on the cosmological
history of galaxies and the interaction with the CGM as
means of replacing the idealized boundary conditions used in earlier work.
\end{abstract}

\begin{keywords}
Spiral galaxies, Milky Way, large-scale magnetic fields, circumgalactic medium,
magnetic Reynolds number
\end{keywords}
\maketitle

\tableofcontents

\section{INTRODUCTION}

Many spiral galaxies have microgauss magnetic fields, so that their
magnetic energy densities are comparable to the thermal, kinetic, and
cosmic ray energy densities; see \cite{RSS88} for an early textbook on
the subject, and \cite{SS22} for a recent one.
Similar magnetic field strengths have also been detected in galaxies at
larger redshifts ($z\simeq$1) \citep{Bernet_2008,Mao2017}.

Galactic magnetic fields often also show large-scale coherence.
The first evidence for a global Galactic magnetic field comes from
optical polarization \citep{Hiltner49, Hall49}.
The existence of magnetic fields was later confirmed for other galaxies
using synchrotron emission \citep{Segalovitz+76}, which showed systematic
large-scale magnetic fields roughly in the direction of the galactic
spiral arms.
There has long been a debate about the origin of such magnetic fields: are
they primordial or dynamo-generated, or perhaps a combination of the two?
Over the past few decades, there has been a shift of attention from a
primordial to a dynamo-generated origin.
In the meantime, however, there have also been significant developments
in dynamo theory, and global numerical simulations are now becoming
more realistic.
They tend to show that large-scale magnetic fields can be generated by
a dynamo, but the amplitudes may be insufficient or the time scales for
their generation too long for the simulations presented so far.

The broader problem of galactic magnetism that was addressed in
\cite{Beck+96}, will not be reviewed; we refer here to other excellent
reviews by \cite{Beck01,Beck15} and \cite{Han17}, as well as the recent
textbook by \cite{SS22}.
Regarding small-scale turbulent dynamos in partially ionized plasmas,
we refer to the recent review by \cite{XL21}.
In the present review, we focus on galactic dynamos and highlight some
of the main developments since the time of the review of \cite{Beck+96}.
At that time, there were results suggesting that the dynamo effect in
mean-field theory is ``catastrophically'' quenched, i.e., it goes
to zero as the magnetic Reynolds number ($\Rm$) becomes large \citep{VC92,CH96}.
Specifically, the mean-field effect in question is what is referred
to as the $\alpha$ effect, which quantifies the component of the mean
electromagnetic force in the direction of the mean magnetic field.
``Catastrophic'' can mean that the coefficient $\alpha$ goes to zero
as $\Rm$ goes to infinity.
More generally, however, it means that the resulting mean (or large-scale)
magnetic field cannot be generated at the expected amplitudes or time
scales.
%%%%%%%%%%%%%%%
\begin{marginnote}[]
\entry{Catastrophic quenching}{limits the large-scale field at large $\Rm$.}
\end{marginnote}
%%%%%%%%%%%%%
This led to a major crisis in dynamo theory, questioning the
possibility of an $\alpha$ effect dynamo in the nonlinear regime beyond
just infinitesimally weak kinematic dynamo-generated magnetic fields.

Although there are still unresolved questions in nonlinear dynamo
theory today, there have also been major developments in this field: the
importance of magnetic helicity fluxes has been recognized, mean-field
dynamo coefficients can now be determined from simulations without the
restrictions imposed by analytic techniques, and new dynamo mechanisms
beyond just the $\alpha$ effect have been identified.
At the same time, there has been significant progress in performing
realistic three-dimensional magnetohydrodynamic (MHD) simulations of
galaxy formation, allowing a new theoretical view of the problem, where
the circumgalactic medium (CGM) plays an integral part.
All these developments motivate a new review on galactic dynamos.

\begin{textbox}[t]\section{Observational tracers of galactic magnetic fields}
\paragraph*{Dust extinction / emission polarization}

Elongated dust grains in the interstellar medium tend to align their minor
axes with the mean magnetic field direction
\citep{davis_Greenstein_1951}.
As a result, the light they emit in infrared wavelengths is polarized,
with the polarization direction perpendicular to the mean direction of
the magnetic field.
Only recently has it been possible to trace extragalactic magnetic fields
with this method \citep[e.g.,the recent survey by][]{LR2022}.

Since starlight emission is unpolarized, we can also measure dust
polarization in absorption against stellar sources.
If the distances to the stars are known, it is possible to map
the magnetic field at different locations along the line-of-sight
\citep[e.g., the PASIPHAE survey,][]{Tassis2018}.

\paragraph*{Synchrotron emission}

Ultra-relativistic cosmic ray particles emit polarized synchrotron
radiation in radio wavelengths as they gyrate around the galactic
magnetic field.
Synchrotron emission, which yields the plane-of-the-sky magnetic field
component in the warm/hot ISM, has been the tracer of choice for studying
extragalactic magnetic fields \citep[see, e.g.,][for a review]{Beck_2012}.

In general, polarization is measured through the Stokes parameters $I$,
$Q$, and $U$.
Then the angle of the magnetic field with respect to an arbitrarily
chosen axis is calculated from the expression
\begin{equation}
    \frac{1}{2}\arctan{\chi} = \frac{U}{Q}
\end{equation}
and the polarization fraction $p=\sqrt{Q^2+U^2}/I$.

\paragraph*{Faraday Rotation}

When polarized radiation passes through an ionized magnetized medium,
the plane of polarization is rotated by an angle $\psi = RM\lambda^2$,
where $\lambda$ the observed wavelength and
\begin{equation}
    RM=0.81 \int_0^D n_e B_{\parallel} dl
\end{equation}
in units of radians/$m^2$, where $D$ is the distance to the source in pc,
$n_{\rm e}$ is the electron density in $\cm^{-3}$, and $B_{\parallel}$
the line-of-sight magnetic field of the medium in Gauss \citep{Burn_1966,
Brentjens_deBruyn2005}.
If we have an estimate of the electron density, then 
% EN removed
%we can `
Faraday
Rotation can yield the line-of-sight magnetic field.

\end{textbox}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{DYNAMOS}

We begin by discussing historical and theoretical aspects of MHD and
dynamos that are of particular importance in connection with the new
developments in galactic dynamo research over the past few decades.
The presence of a microphysical magnetic diffusivity plays here an
important role.
We begin with a historical perspective.

\subsection{Historical remarks}
\label{sec:history}

In \Sec{sec:mean-field_models} we will discuss the observational
signatures of dynamo models in detail.
Here, we will only briefly mention some observational results that
were significant for the development of dynamo models.
For later reference, we provide here a short overview of the existing
galactic magnetic field tracers in the text box on ``Observational
tracers of galactic magnetic fields''.

In the late 1970s, synchrotron radiation from spiral galaxies began
to reveal the presence of large-scale ordered magnetic fields broadly
aligned with the galactic spiral pattern.
At the time, an obvious possibility was that these magnetic fields were
the result of winding up a pre-existing, large-scale field. 
This idea goes back to \cite{Pid64} and \cite{Oki+64}, and is now
commonly referred to as primordial origin of the magnetic field.
The resulting magnetic field is then expected to have the form of a
bisymmetric spiral (BSS).
The BSS form has a characteristic signature in the Faraday Rotation
Measure (RM): when we observe an external galaxy almost, but not exactly,
face-on, the line-of-sight magnetic field measured through RM probes
the azimuthal component of the galactic field -- see \Fig{sketch_aas_bss}
for a sketch.
Using this technique, \citet{TF78} found evidence for a BSS in M51.
In an early review on galactic magnetic fields, \cite{SFW86} contrasted
this with the axisymmetric spiral (ASS), expected from mean-field dynamo
theory.
\Fig{sketch_aas_bss} also sketches the expected ASS signature.

\begin{figure}[t]
\includegraphics[width=\textwidth]{sketch_aas_bss}
\caption{
Sketch of the rotation measure (RM) signature of a tilted galaxy with
a ring, axisymmetric, or bisymmetric magnetic field.
Here, $i$ stands for the inclination angle of the observed galaxy with
respect to a completely face-on view.
Adapted from \cite{TF78}.
}\label{sketch_aas_bss}
\end{figure}


However, a purely primordial origin of galactic magnetic fields implies
that a tremendous amount of winding has occurred over the past $14\Gyr$
For example, in the solar neighborhood, the angular velocity of the
Galaxy is $\approx30\Gyr^{-1}$, i.e., the rotation period is
$(2\pi/30)\Gyr\approx0.2\Gyr$.
This yields 70 revolutions in $14\Gyr$, so we would expect the magnetic
field to be strongly wound up.
\FFig{psavss} gives a quantitative illustration of this wind-up process.
It shows color scale images of $|\BB|$ together with field lines
corresponding to the contours of the normal component of the magnetic
vector potential, $A_z(x,y)$, so that the magnetic field in the plane
is given by $\BB=\nab\times(\zzz A_z)$.
To obtain the result shown in \Fig{psavss}, we solved the two-dimensional
induction equation, which corresponds to an advection--diffusion equation
of the form
\begin{equation}
\frac{\DD A_z}{\DD t}=\eta\nabla^2 A_z,
\label{InductEq2D}
\end{equation}
where $\DD/\DD t=\partial/\partial t+\uu\cdot\nab$. 
Here, we assumed that $\uu=\Omega(x,y)\pom$, where
$\pom=(x,y,0)$ is the cylindrical position vector and
$\Omega=\Omega_0/[1+(\varpi/\varpi_0)^{2n}]^{1/n}$ is the angular velocity
with $\varpi_0=5\kpc$, $n=3$, and $\Omega_0=40\Gyr^{-1}$.
This experiment demonstrates the extreme winding of the magnetic field.
The turbulent magnetic diffusivity is here $5\times10^{-4}\kpc\km\s^{-1}$,
corresponding to $1.5\times10^{23}\cm^2\s^{-1}$, which is three orders
of magnitude below the canonical estimates.
We see about six windings at $1\Gr$ with a thirty-fold increase of $|\BB|$.
This amount of winding is not observed in any galaxy.

Mean-field dynamo theory was originally developed in the solar context
\citep{SK69} and is able to predict both axisymmetric and nonaxisymmetric
magnetic fields.
For ASS and BSS magnetic fields, one sometimes talks about $m=0$ and
$m=1$ magnetic fields, respectively, which means that they vary with
azimuth $\phi$ like $e^{\ii m\phi}$.
\cite{Par71} was the first to show that the most easily excited
axisymmetric large-scale magnetic fields in oblate bodies such as galaxies
have an azimuthal component that is symmetric about the midplane, i.e.,
the fields have quadrupolar symmetry -- in contrast to the dipolar
symmetry that is often found in spherical bodies.

\begin{figure}[t]
\includegraphics[width=\textwidth]{psavss}
\caption{
Snapshots of field lines together with representations of $|\BB|$
color-coded (in units of its original value) at $0.1$ and $1\Gyr$
for the wind-up problem described in the text.
The inset in the upper left corner shows the field lines at the time
$0.01\Gr$.
}\label{psavss}
\end{figure}

While dynamo theory can also produce BSS-type fields, 
it was shown that they are not the most easily excited modes
\citep{Elstner+90, BTK90}, unless the turbulence is strongly
anisotropic or the dynamo is controlled by strongly anisotropic
flow structures \citep{Moss+93}.
Today, the significance of primordial magnetic fields is still
not resolved, and global three-dimensional numerical simulations
suggest that both primordial and magnetic fields of astrophysical
origin may be present in typical galaxies \citep[e.g.,][see
\Fig{fig:martinalvarez}]{MartinAlvarez2021}.

\begin{figure}\centering\includegraphics[width=\textwidth]{fig/martin_alvarez_galaxies.png}
\caption{Figure~1 from \citet{MartinAlvarez2021}, showing cosmological
galaxy models evolved with different magnetic field seeds: primordial,
or ``injected'' on small scales by stellar feedback.
In this visualization, the first two rows show models including both
primordial and injected fields, while the last two correspond to only
primordial, or only injected fields.
The last column color-codes the total magnetic energy according to its
origin: green for the primordial, red for the injected, and blue for
the cross-term field.}
\label{fig:martinalvarez}
\end{figure}
 
\subsection{The need for magnetic diffusivity: a clear case for steady flows}
\label{NeedMagneticDiffusivity}

The evolution of the magnetic field $\BB$ is governed by the
usual induction equation,
\begin{equation}
\frac{\partial\BB}{\partial t}=\nab\times\left(\UU\times\BB-\JJ/\sigma\right),
\label{InductEq}
\end{equation}
where $\UU$ is the velocity and $\JJ=\nab\times\BB/\mu_0$ is the current
density with $\mu_0$ being the vacuum permeability.
\EEq{InductEq} also includes an electric conductivity $\sigma$, because
the mean-free path of the electrons in the interstellar medium (of the
order of a few thousand astronomical units) is much smaller that the
scales under study here.
The magnetic diffusivity is then given by $\eta=1/\sigma\mu_0$.

%%%%% Text box %%%%%%%
\begin{textbox}[t]\section{Characteristic nondimensional numbers}
Fluid and magnetic Reynolds numbers and their ratio, the magnetic
Prandtl number, are defined as
\begin{equation}
\Rey=\urms/\nu\kf,\quad
\Rm=\urms/\eta\kf,\quad
\Pm=\nu/\eta.
\label{Numbers}
\end{equation}
Note that the Reynolds numbers are sometimes based on the length scale,
$2\pi/\kf$, which leads to about six times larger values.
The present definition is commonly used in numerical simulations of
turbulence.
As a rule of thumb, the number of mesh points needed in a numerical
simulation is similar to the value of the Reynolds number.
In simulations with partial ionization, the ionization ratio
$\rho_{\rm i}/\rho_{\rm n}$, i.e., the density ratio of ions
and neutrals, enters as another nondimensional number.
\end{textbox}
%%%%%%%%%%%%%%%%

Dynamos convert kinetic energy into magnetic energy through what is
called the dynamo instability.
It occurs when the magnetic Reynolds number, $\Rm$,
\begin{marginnote}[]
\entry{Dynamos}{convert kinetic energy into magnetic energy}
\end{marginnote}
exceeds a certain critical value (see the text box on ``Characteristic
nondimensional numbers'' for a definition of $\Rm$).
Here, $\kf$ is the typical wavenumber of the flow.
A rigorous definition of this instability is only possible for steady flows.
Then an eigenvalue problem can be expressed through:
$\BB(\xx,t)=\BB_\lambda(\xx)\,e^{\lambda t}$, where $\lambda$ is the
eigenvalue and $\BB_\lambda(\xx)$ the eigenfunction.
For steady, mass conserving, compressible flows, \cite{MP85} proved
that dynamos (i.e., $\lambda>0$) cannot exist for $\eta=0$, i.e., in
the strictly ideal case.
This does not preclude dynamos in the astrophysically relevant limit
$\eta\to0$, which are called fast dynamos \citep{Sow87}, but it is
important to stress that the {\em limit} $\eta\to0$ is quite different
from the {\em case} $\eta=0$.

The case $\eta=0$ is arguably pathological, 
because without resistivity, there is no Joule heating
and the field line topology cannot change.
This case is therefore only of academic interest,
because with zero dissipation, there can be no turbulence
like that observed in real astrophysical systems.
In principle, the case $\eta=0$ can be described using
Euler potentials, $\Phi(\xx,t)$ and $\Psi(\xx,t)$, such that
$\BB(\xx,t)=\nab\Phi\times\nab\Psi$, where $\Phi(\xx,t)$ and
$\Psi(\xx,t)$ obey \citep[e.g.,][]{RP07},
\begin{equation}
\frac{\DD\Phi}{\DD t}=
\frac{\DD\Psi}{\DD t}=0\quad
\Longleftrightarrow\quad
\frac{\partial\BB}{\partial t}=\nab\times\left(\UU\times\BB\right).
\end{equation}
We see that in the special case of 2-D, this equation agrees with
the advection--diffusion equation \Eq{InductEq2D}, where $\Phi=A_z$
and $\Psi=z$ has been assumed.
In this special case, it is possible to recover the induction equation
in the presence of microphysical magnetic diffusion.

Dynamos have {\em not} been found in this formulation -- even for
three-dimensional turbulent or other flows that allow for dynamo action
in the limit $\eta\to0$ \citep{Bra10}.
The method forbids even a very weakly diffusive advection of $\Phi$
and $\Psi$, which is needed in any numerical simulation to prevent the
formation of infinitely sharp gradients.

\begin{marginnote}[]
\entry{Dynamos}{have not been found with Euler potentials}
\end{marginnote}

The tangling of a pre-existing magnetic field for $\eta\to0$ {\em can}
convert kinetic energy into magnetic energy for some period of time, but
it is then not through a dynamo instability, and can happen for a purely
two-dimensional field, $\BB=\BB(x,y)$, as we have seen in \Fig{psavss}.
The magnetic field is amplified by perpetual stretching, so it
continuously develops smaller scale structures. 
This continuous change in the field structure makes it impossible to 
describe the evolving field
by an eigenfunction of the form $\BB_\lambda(\xx)$, which is
independent of time.
The actual solution $\BB(\xx,t)$ to the case $\eta=0$ would continuously
develop smaller length scales as time goes on.
Thus, even though the growth may still be exponential, the solution
cannot be separated into a purely temporal and a purely spatial part.

\subsection{Turbulence and time-dependence}

All astrophysically relevant flows are time-dependent.
Turbulent flows can be statistically steady, so one can still determine
an eigenvalue problem by averaging over the fluctuations; see \cite{SB14}
for detailed studies of kinematic dynamos in helical and fractionally
helical turbulence at large magnetic Reynolds numbers.
Even in those turbulent time-dependent flows, when eigenvalues and
statistical eigenfunctions with certain energy spectra are obtained
empirically for finite $\eta$ by suitable averaging, no dynamos have
been found in the case $\eta=0$, when Euler potentials can be used,
as discussed above.

In practice, we are often also interested in decaying or collapsing
turbulent flows.
Dynamos may occur in those cases, but they are hard to define
rigorously.
Nevertheless, amplification suggestive of dynamo action has been
reported both for decaying turbulence \citep{Bran+19} and for turbulent
gravitational collapse \citep{Sur+12, XL20}, as will be discussed later
in \Sec{sec:grav_collapse} of this review.

\subsection{Early examples of dynamos}
\label{SimpleDynamos}

\citet{Cow33} formulated an anti-dynamo theorem, concluding that
``The theory proposed by Sir Joseph Larmor, that
the magnetic field of a sunspot is maintained by the currents it induces
in moving matter, is examined and shown to be faulty.''
At that time, there was no
hint that the solution to the problem could lie in the third dimension.
It was only later that the use of a two-dimensional analysis in the work
of \cite{Cow33} was understood as not just a simplification, but as a
crucial restriction precluding dynamo action.
Even after Parker's discovery \citep{Par55} of what is now called the
$\alpha$ effect, it was not generally accepted that dynamos could work
even in principle.
For example, \cite{Cha56} found that particular flow geometries could
prolong the resistive decay time to half a billion years when using the
magnetic diffusivity of the Earth's outer core.
He speculated that the Earth's magnetic field could be explained in
that way, rather than by a dynamo.
This suggests that the existence of dynamos was far from being widely
accepted at that time.

\begin{marginnote}[]
\entry{Small-scale dynamos}{generate magnetic fields at the resistive scale}
\end{marginnote}

The first rigorous examples of dynamos were presented by
\cite{Herzenberg58} and \cite{Backus58}.
The former, consisting of two rotors (eddies) with an oblique angle
between them, was also realized experimentally \citep{Lowes+Wilkinson63}.
However, the length scale of those magnetic fields was only comparable
to that of the rotors.
This property could classify the Herzenberg result as a small-scale dynamo.
During the kinematic phase, small-scale dynamos produce a field at the
resistive scale and can later grow to the scale of turbulent eddies as
the dynamo saturates.
They do not possess a mean field.
However, the Herzenberg dynamo is not a typical example of a small-scale
dynamo, because it does not involve turbulence, and laminar dynamos cease to exist for large
values of $\Rm$.
A typical example would be isotropic homogeneous turbulence, which can
generate magnetic fields at the resistive scale, as will be described
later.

In the early 1970s, \citet{Rob72} showed that several two-dimensional,
spatially periodic steady flows can exhibit dynamo action.
These flows are now called Roberts flows~I--IV.
They are large-scale dynamos and their properties have been investigated
with modern tools \citep{RDRB14}.
The expressions for the four Roberts flows are included in a dedicated
text box.
Flow~I has maximum kinetic helicity with $\bra{\oo\cdot\uu}=\kf\bra{\uu^2}$,
where angle brackets denote volume averaging.
Flow~II to has $\oo\cdot\uu=0$ pointwise, while flows~III and IV
have vanishing helicity only on average ($\bra{\oo\cdot\uu}=0$), but not pointwise.
%%%%----Margin note----%%%%%
\begin{marginnote}[]
\entry{Kinetic helicity}{$\bra{\oo\cdot\uu}$, where $\oo=\nab\times\uu$
is the vorticity.}
\end{marginnote}
%%%%-------------------%%%%%

%%%%%%%%----Textbox----%%%%%%%%
\begin{textbox}[t]\section{The four Roberts flows}
The four Roberts flows are classic examples of large-scale dynamos.
They serve as simple benchmarks and highlight the existence of completely
different mechanisms.
Only the first one corresponds to the classical $\alpha$ effect, which
is traditionally believed to operate in galaxies.
All four flows have the following $x$ and $y$ components:
\begin{equation}
u_x =  v_0 \, \sin k_0x \, \cos k_0y, \quad
u_y = -v_0 \, \cos k_0x \, \sin k_0y,
\label{KH21}
\end{equation}
but the $z$ components are different for each flow:
\begin{equation}
u_z=w_0 \left\{
\begin{array}{ll}
\sin k_0x \, \sin k_0y
\quad\mbox{(for flow I)},
\\
\cos k_0x \, \cos k_0y
\quad\mbox{(for flow II)},
\\
(\cos 2 k_0x + \cos 2 k_0y)/2
\quad\mbox{(for flow III)},
\\
\sin k_0x
\quad\mbox{(for flow IV)},
\label{KH29}
\end{array}
\right.
\end{equation}
where $v_0$, $w_0$, and $k_0$ are constants.
Particular solutions are obtained by specifying the
magnetic Reynolds number $\Rm=v_0/\eta k_0$ and
the ratio $w_0/v_0$.
The magnetic field must always be three-dimensional and
varies in the $z$ direction like $e^{\ii k_z z}$, where
$k_z$ is sometimes chosen such that it maximizes the growth rate.
\end{textbox}
%%%%-------------------%%%%%

We summarize the essential features of flows~I--IV in \Tab{TRob}.
The resulting mean fields for flow~I can be interpreted in terms of an
$\alpha$ effect.
The mean field for flow~IV was identified to be due to a
negative turbulent magnetic diffusivity \citep{DBM13}.
The origin of the mean field for flows~II and III involves two different
effects: turbulent pumping, which acts like an advection velocity
without actual material motion, and a memory effect, which means that
the electromotive force also involves the mean magnetic field from
earlier times.

These classifications can be formalized once we define an averaged magnetic
field $\meanBB$, which can here be an $xy$ planar average, so
$\meanBB=\meanBB(z,t)$ depends just on time and on one spatial coordinate.
This defines what we call the fluctuating field $\bb\equiv\BB-\meanBB$.
For the Roberts flows, there is no mean flow, i.e., $\meanuu=0$, so the
evolution of $\meanBB$ is only governed by the mean electromotive force
$\meanEMF\equiv\overline{\uu\times\bb}$, consisting of fluctuations only.

%%%%-----Margin note------%%%%%
\begin{marginnote}[]
\entry{The evolution of $\meanBB$}{is governed by the mean electromotive
force $\meanEMF\equiv\overline{\uu\times\bb}$}
\end{marginnote}
%%%%-------------------%%%%%
In all cases, the mean magnetic field along the $z$ axis,
$\meanBB_\|\equiv (0,0,\meanB_z)$, vanishes.
The perpendicular components, $\meanBB_\perp\equiv(\meanB_x,\meanB_y,0)$
are finite and we only need to focus on the components $\meanEMF_\perp$,
$\meanBB_\perp$, and $\meanJJ_\perp$.
For flow~I, we have
\begin{equation}
\meanEMF=\alpha\meanBB-\etat\mu_0\meanJJ,
\label{meanEMF}
\end{equation}
which is a prototype of an $\alpha$ effect dynamo. 
In Eq. \ref{meanEMF}, $\etat$ is the turbulent magnetic diffusivity,
because it adds to the microphysical magnetic diffusivity $\eta$ to give
the total magnetic diffusivity $\etaT=\etat+\eta$.
For flows~II--IV, the situation is more complicated in that $\alpha$
is now a tensor with vanishing diagonal components (flows~II and III),
or it is zero and $\etat$ is negative and can thus lead to exponential
growth (flow~IV).
For all those flows, it is important to realize that $\alpha$ and
$\etat$ are in general scale-dependent, and $\etat$ becomes positive
when $\meanBB(z,t)$ has high spatial Fourier components, i.e., for mean
fields of smaller scale in the $z$ direction.
The dependence of $\meanEMF$ on the mean magnetic field $\meanBB$ and
its associated mean current density, $\meanJJ=\nab\times\meanBB/\mu_0$,
will be discussed below.

%%%%-----Margin note------%%%%%
\begin{marginnote}[]
\entry{Scale dependence}{$\alpha$ and $\etat$ decrease for small scales.}
\end{marginnote}
%%%%----------------------%%%%%

To determine all components of the tensors
$\alpha_{ij}$ and $\eta_{ijk}$ in the representation
$\meanemf_i=\alpha_{ij}\meanB_j+\eta_{ijk}\meanB_{j,k}$ with a rank-3
tensor $\eta_{ijk}$, one must solve the equation for the fluctuations
in terms of the mean magnetic field.
Here, a comma denotes partial differentiation.
In \Tab{TRob}, we indicate the form of $\meanEMF_\perp$ for each of the
four flows.
%%%%-----Margin note------%%%%%
\begin{marginnote}[]
\entry{Magnetic Reynolds number}{$\Rm=\urms/\eta\kf$, where $\kf$ is
the wavenumber of velocity fluctuations}
\end{marginnote}
%%%%----------------------%%%%%
We also indicate the critical values of the magnetic
Reynolds number $\Rmc$, above which dynamo action occurs.
Here, $\Rmc$ is defined with $\kf=k_0$, and we have fixed $w_0=v_0$
and $k_z=k_0/2$ to ensure that dynamos are possible for all four flows.
For flows~II and III, for example, no dynamos are possible for $k_z=k_0$.

\begin{table}[t]
\tabcolsep7.5pt
\caption{
Robert flows~I--IV as simple benchmarks, and their dynamo properties.
}
\label{TRob}
\begin{center}
\begin{tabular}{@{}c|c|c|c|c@{}}
\hline
Flow & helicity & interpretation & $\meanEMF_\perp$ & $\Rmc$ \\ 
\hline
I   & yes, and constant & $\alpha$ effect & $\alpha\meanBB_\perp-\etat\meanJJ_\perp$ & 1.99 \\
II  & pointwise zero $\alpha$ & \makecell{off-diagonal $\alpha$ tensor \\ with memory effect}
    & $\pmatrix{0&a\cr a&0}\meanBB_\perp-\etat\meanJJ_\perp$ & 6.86 \\
III & zero only on average    & \makecell{pumping effect \\ with memory effect}
    & $\pmatrix{0&\gamma\cr-\gamma&0}\meanBB_\perp-\etat\meanJJ_\perp$ & 3.92 \\
IV  & zero only on average & \makecell{negative ``turbulent'' \\ diffusion}
    & \makecell{$-\etat\meanJJ_\perp$ with $\etat<0$ \\ on large length scales} & 4.55 \\
\hline
\end{tabular}
\end{center}
\begin{tabnote}
In all cases, $k_z=k_0/2$ was used.
The values of $\urms$ are 0.866 for flows~I--III and unity for flow~IV.
\end{tabnote}
\end{table}

\subsection{Large-scale dynamos and averaging}

As already alluded to above, an important feature of the four Roberts
flow dynamos is that all of them are examples of large-scale dynamos,
i.e., one can define an average (here an $xy$ average) under which
the magnetic field retains most of its energy and still captures its
essential spatio-temporal evolution.
%%%%-----Margin note------%%%%%
\begin{marginnote}[]
\entry{Large-scale dynamos}{Create coherent structures on large spatial and temporal scales.}
\end{marginnote}
%%%%----------------------%%%%%
The most suitable type of averaging depends on the type of the mean
magnetic field that can emerge in certain geometries and in certain
parameter regimes; see \cite{Gent2013} for a discussion. 
%%%%-----Margin note------%%%%%
\begin{marginnote}[]
\entry{The type of averaging}{depends on the magnetic field that can
emerge in certain geometries and in certain parameter regimes}
\end{marginnote}
%%%%----------------------%%%%%
For example, in the context of disk galaxies, the azimuthally averaged
magnetic field plays an important role.
In cylindrical coordinates, $(\varpi,\phi,z)$, such a field depends --
not necessarily smoothly -- on the cylindrical radius $\varpi$ and the
height $z$ above the midplane.
This variability can easily lead to a confusing terminology when we want
to split the magnetic field into mean and fluctuations, $\BB=\meanBB+\bb$.
To avoid the temptation to refer to the non-smoothness of $\meanBB$ as
fluctuations, we sometimes refer to ordered and random fields instead
\citep{SS22}.

An azimuthal average has obviously no azimuthal dependence and cannot
describe nonaxisymmetric magnetic fields.
On the other hand, in a mean-field model, one can always just assume
that $\meanBB$ does also depend on $\phi$.
A slight problem may then only occur if one wants to make direct
comparisons with observations or simulations, because there is no
spatial average that describes nonaxisymmetric magnetic fields
under which self-consistent mean-field equations can be derived.
For Fourier filtering, for example, the product of a mean and a
fluctuation vanishes only approximately under averaging if the scales
of mean fields and fluctuations are sufficiently different.

Regarding the periodic flow patterns in Cartesian coordinates discussed
in \Sec{SimpleDynamos}, it is important to stress that there can be
examples where planar $xy$ averaging is not suitable.
An example is the Taylor--Green flow, where a one-dimensional average
(here a $z$ average) must be taken to demonstrate the existence of a
large-scale dynamo due to a negative turbulent magnetic diffusivity
\citep{ABNZ15}.
In that case, the mean field depends on $x$, $y$, and $t$.

\subsection{Types of large-scale dynamos}

Historically, the $\alpha$ effect was the first distinct dynamo effect
that was discovered.
It emerged in the derivation of mean-field effects in stratified
rotating turbulence \citep{SKR66}, but in its essence, it was
already obtained by \cite{Par55} using a more phenomenological approach.
It is intrinsically connected with the presence of kinetic helicity.
Dynamos can work with an $\alpha$ effect alone, in which case one
talks about an $\alpha^2$ dynamo.
Astrophysical dynamos often have strong shear, but shear alone cannot
produce a dynamo.
When shear is complemented by an $\alpha$ effect, one talks about an
$\alpha\Omega$ dynamo, or even an $\alpha^2\Omega$ dynamo if one wants
to emphasize that both $\alpha$ and $\Omega$ effects play a role.

At the moment, we do not know for sure whether galactic dynamos are
of $\alpha\Omega$ type, as is generally believed, or of some other,
possibly as yet unknown type of large-scale dynamo.
To demonstrate the range of possibilities, we summarize in \Tab{TDynType}
the different large-scale dynamos known so far.
Here we also indicate whether a small-scale dynamo might operate and
whether the dynamo is expected to be fast, i.e., to grow even for very
large values of $\Rm$.
This is usually not the case for laminar flows, unless the flow has
chaotic streamlines.\footnote{The Galloway--Proctor flow is an
example of a laminar flow that may be fast.
It is a Roberts flow with time-dependent phases in the trigonometric
functions, which causes its streamlines to be chaotic.}

\begin{table}
\tabcolsep7.5pt
\caption{
Summary of different types of dynamos.
}
\label{TDynType}
\begin{center}
\begin{tabular}{@{}l|c|c|c@{}}
\hline
Flow & main dynamo effect & small-scale & fast \\
\hline
isotropic turbulence (nonhelical) & small-scale dynamo & \checkmark & \checkmark \\
isotropic turbulence (helical)    & $\alpha^2$ dynamo & \checkmark & \checkmark \\
Roberts flow-I (laminar, helical) & \checkmark &    ---     &    ---     \\
Roberts flows-II and III (laminar, nonhelical) & time delay &    ---     &    ---     \\
Roberts flows-IV                  &neg turb diff&   ---     &    ---     \\
R\"adler effect with shear        &$\OO\times\meanJJ$ effect&    ---    & \checkmark \\
Shear--current effect             &$\SSSS\meanJJ$ effect    &    ---    & \checkmark \\
Incoherent $\alpha$--shear effect &fluctuating $\alpha$ effect& \checkmark & \checkmark \\
\hline
\end{tabular}
\end{center}
\begin{tabnote}
`Small-scale' refers to possibility that a small-scale dynamo would operate.
`Fast' refers to the possibility that the dynamo works in the limit
$\eta\to0$, as discussed in \Sec{NeedMagneticDiffusivity}.
\end{tabnote}
\end{table}

\subsubsection{Helical dynamos}

The first of the four Roberts flows is maximally helical.
It is a prototype of an $\alpha^2$ dynamo, whereby the two nonvanishing
horizontally averaged mean-field components, $\meanB_x$ and $\meanB_y$,
are being amplified by the $\alpha$ effect.
%%%%%%%----Margin note----%%%%%%%
\begin{marginnote}[]
\entry{Roberts flow I}{this is a prototype of an $\alpha^2$ dynamo}
\end{marginnote}
%%%%%%%-------------------%%%%%%%
If shear is important, and we have an $\alpha\Omega$ dynamo,
the dynamo is often oscillatory and can exhibit traveling wave
solutions.
In oblate bodies such as galaxies, however, $\alpha\Omega$ dynamos
are usually non-oscillatory \citep{Par79,Stix75}.

\subsubsection{Nonhelical large-scale dynamos}

There are various examples of large-scale dynamos that do not involve
magnetic helicity.
Three of the four Roberts flows have clearly demonstrated that large-scale dynamos
do not have to be helical and they can even have pointwise zero helicity.
Common to all three examples of Roberts flows II--IV is the fact that
the two components, $\meanB_x$ and $\meanB_y$, evolve independently of
each other.
In these examples, they have the same growth rate, but there are other
flows, such as the Willis flow \citep{Wil12}, where the growth rates
of $\meanB_x$ and $\meanB_y$ are different and only one of the two
components grows.
This is unusual and different from conventional dynamos of $\alpha\Omega$
or $\alpha^2$ type, where the two components have strictly the same
growth rate.
Mathematically, the coupling of the two mean field components is caused
by the cross product in the expression $\nab\times(\alpha\meanBB)$
on the right-hand side of the evolution equation for $\meanBB$.
In the presence of shear, for example by a mean flow with constant
shear $S=\partial\meanU_y/\partial x$, one has
$\partial\meanB_y/\partial t=S\meanB_x+...$, where the ellipsis denotes
further terms not relevant to the present discussion.

The reason for the decoupling of the two magnetic field components in 
some examples is the fact that the dynamo-active
terms operate on each field component separately, i.e.,
$\partial\meanB_x/\partial t=-\ggamma\cdot\nab\meanB_x$ and
$\partial\meanB_y/\partial t=-\ggamma\cdot\nab\meanB_y$
for dynamos where the pumping velocity $\ggamma$ has a memory effect.
In its simplest form, a memory effect has an exponential kernel
proportional to $e^{-(t-t')/\tau}$ for $t>t'$, and zero otherwise.
Here, $t$ is the current time and $t'$ the integration variable.
In Fourier space, it leads to a factor
$1/(1-\ii\omega\tau)$ in Fourier space, where $\omega$ is the
frequency and $\tau$ is the turnover time.
When $\gamma\omega\tau>(\eta+\etat)k$, dynamo action becomes possible.

\subsubsection{R\"adler and shear--current effects}

Early in the history of mean-field dynamo theory, R\"adler found a novel
large-scale dynamo effect for rotating, but unstratified bodies, whereby
$\meanEMF$ has an extra term proportional to $\OO\times\meanJJ$.
Here, $\OO$ is a pseudovector pointing along the rotation axis.
The azimuthal velocity is then $\uu_\phi=\pom\times\OO$.
However, it is easy to see that the $\OO\times\meanJJ$ term in $\EMF$
does not contribute to the generation of mean-field energy proportional
to $\meanBB^2$, because the dot product with $\meanJJ$ vanishes.
Therefore, additional effects are needed to achieve an actual dynamo.
Shear is one such effect, which can also generate another large-scale
dynamo, similar to the  R\"adler dynamo: the shear--current effect.
Most of the numerical evidence today shows that this effect does not
have a favorable sign for dynamo action \citep{BRRK08}.
There is the possibility that this finding would change when 
the shear-current effect
is strongly controlled by the
magnetic field from a small-scale dynamo \citep{SB15c}.
While it is true that large-scale magnetic fields can be generated, it
is possible that the real reason behind this is actually the incoherent
$\alpha$ effect, as will be discussed below; see also \cite{ZB21}
for a detailed assessment of the different possibilities.

\subsubsection{Incoherent and shear dynamo effects}

There is another important class of large-scale dynamos that may explain
the phenomenon of large-scale magnetic field generation in shear flows
without helicity.
Such nonhelical dynamo action was first found in a more complex shear
flow geometry, relevant to the solar tachocline at mid to low latitudes
\citep{Bra05}.
In this environment, it was found that large-scale fields can be generated
both with and without helicity in the driving of the turbulence.
Subsequent studies by \cite{You+08} and \cite{BRRK08} produced such
dynamos in simpler shearing box simulations, but gave different
interpretations, which we discuss below.

One interpretation involves helicity fluctuations, which lead to what
is known as an incoherent $\alpha$ effect and, in conjunction with shear,
to large-scale dynamo action \citep{VB97}.
\begin{marginnote}[]
\entry{An incoherent $\alpha$ effect}{implies negative turbulent magnetic
diffusivity}
\end{marginnote}
An incoherent $\alpha$ effect leads to a negative turbulent magnetic
diffusivity \citep{Kra76}.
In that sense, the incoherent $\alpha$ effect is actually similar to
the dynamo effect in Roberts flow IV.

Another interpretation is what is sometimes called the shear dynamo.
Attempts to interpret this as a mean-field effect amounts to invoking
the shear-current effect.
The magnetic sheer current effect, by contrast, is based on correlated
fluctuations of the magnetic field from a small-scale dynamo, which is
assumed to operate in the background.

The role of the incoherent $\alpha$ effect in galactic dynamos is
uncertain and may have been underestimated in the past.
It might be important if the net kinetic helicity above and below
the midplane is small.
This may well be the case, especially when there is significant
interaction with the CGM.
Such interactions can generate strong fluctuations of opposite sign in
the kinetic helicity, which would cancel out.

\subsection{Small-scale dynamos}

\subsubsection{Early work on the subject}

Under fully isotropic conditions and without helicity, dynamo action is
still possible---both for large and small values of the magnetic Prandtl
number $\Pm$.
This was first shown by \cite{Kaz68}.
Earlier work suggested dynamo action only for $\Pm>1$, but this turns out
to be incorrect; see the detailed discussion by \cite{Scheko+04}.
%%% --- Margin note--- %%%
\begin{marginnote}[]
\entry{Nonmagnetic Kolmogorov turbulence}{hardly exists in astrophysics}
\end{marginnote}
The existence of small-scale dynamos under isotropic conditions implies
that the concept of nonmagnetic Kolmogorov turbulence hardly exists in
astrophysics, where the medium is usually always highly conducting.

In the early kinematic regime, when the magnetic field is still weak and
exponentially growing, its energy spectrum increases with wavenumber
$k$ proportional to $k^{3/2}$ and has a peak at the resistive
wavenumber, provided $\Pm\gg1$.
\cite{KA92} found that the peak occurs at a wavenumber $k_\eta$ that depends on
the growth rate $\lambda$ through $k_\eta=\sqrt{\gamma/10\eta}$.
This is demonstrated in \Fig{pspec_comp_kinsat_Pm1_kf4_rev}, where we plot
magnetic and kinetic energy spectra during the kinematic and saturated phases.

\begin{figure}[t]
\includegraphics[width=.7\textwidth]{pspec_comp_kinsat_Pm1_kf4_rev}
\caption{
Magnetic (red lines) and kinetic (blue lines) energy spectra
during the kinematic (dashed lines) and saturated (solid lines) phases.
Adapted from \cite{Bra+22}.
}\label{pspec_comp_kinsat_Pm1_kf4_rev}
\end{figure}

More recent work on small-scale dynamos is numerical, and will be covered
in detail in the following sections.

\subsubsection{Effect of ambipolar diffusion}

\cite{XL16} found a strong similarity between the regime of large magnetic
Prandtl numbers and the regime of partial ionization.
Their results have been confirmed in numerical simulations \citep{Xu+19}.
In those simulations, the microphysical magnetic Prandtl number remained
undetermined, because no explicit viscosity or magnetic diffusivity
were used.
Two-fluid direct numerical simulations \citep{Bra19} showed that at
large magnetic Prandtl number, the kinetic energy spectra for neutrals
and ions show different slopes.
The energy spectra of ions and neutrals depart from each other only a
small scales when $k/k_\nu>1$.
For larger ambipolar diffusion coupling, the kinetic energy spectra of
neutrals decrease further while those of the ions increase slightly.

\section{CATASTROPHIC QUENCHING AND MAGNETIC HELICITY FLUXES}

\subsection{Catastrophic quenching for uniform magnetic fields}

As long as the magnetic field is weak, the Lorenz force
plays no significant role.
Many dynamo effects, including those discussed in \Sec{SimpleDynamos},
can then be fully described by a given velocity field, because the
induction equation \eq{InductEq} is linear in $\BB$.
However, as soon as the velocity field is determined or modified by the
magnetic field, the dynamo problem becomes nonlinear.
Eventually, the growing effect of the Lorenz force on the flow can limit
(or quench) the magnetic field growth.

\begin{marginnote}[]
\entry{Catastrophic quenching means}{$\alpha\to0$ as $\Rm\to\infty$}
\end{marginnote}
The term catastrophic quenching was coined by \cite{BF00} to denote any
type of detrimental $\Rm$ dependence of the nonlinear feedback.
Ignoring the effect of turbulent diffusion, i.e., the term
$-\etat\mu_0\meanJJ$ in \Eq{meanEMF}, \cite{CH96} found numerically
that $\alpha\propto(1+\Rm\meanBB^2/\Beq^2)$.
This dependence was originally anticipated
by \cite{VC92} based on earlier analogous results by \cite{CV91} for
the suppression of just $\etat$ in two dimensions.
\cite{GD96} explained these results as a consequence of the
conservation of magnetic helicity $\bra{\AAA\cdot\BB}$ in 3-D and of
$\bra{\AAA^2}$ in 2-D, respectively.
However, the dependence of $\alpha$ on $\Rm$ is
a peculiar property of the magnetic helicity
equation in the presence of a mean magnetic field $\BB_0$.
In that case, the magnetic helicity corresponding to the 
departure from the imposed field, $\bb$,
yields, in the steady state, $0=\bra{(\uu\times\BB_0)\cdot\bb}-
2\eta\mu_0\bra{\jj\cdot\bb}$.
Using $\bra{(\uu\times\BB_0)\cdot\bb}
=-(\bra{\uu\times\bb})\cdot\BB_0=-\alpha\BB_0^2$,
we have $\alpha=-\eta\mu_0\bra{\jj\cdot\bb}/\BB_0^2$,
so $\alpha\to0$ as $\eta\to0$ or $\Rm\to\infty$.

Much of the original work on catastrophic quenching adopted
periodic domains.
This is clearly only of limited value when thinking about galaxies.
This result for $\alpha$ in the nonlinear regime was first obtained
by \cite{Keinigs+83}.
However, it is not really relevant in practice, because it assumes that
the magnetic field can meaningfully be described by volume averages.
This is not the case, because a volume-averaged magnetic field is always
constant in a periodic domain.

A relevant mean field for this kind of problem can be defined as 
planar averages, as discussed in \Sec{SimpleDynamos}.
We denote that by overbars.
The diffusion term $\etat\meanJJ$ can then not be neglected and
the relation of \cite{Keinigs+83} can then be written in the form
$\alpha-\etat k_{\rm m}=-\eta\mu_0\bra{\jj\cdot\bb}/\BB_0^2$, where
$k_{\rm m}=\meanJJ\cdot\meanBB/\meanBB^2$.

\subsection{Catastrophically slow saturation in closed domains}

In reality, even if the restriction to closed or periodic domains is
retained, neither $\alpha$ nor $\etat$ are quenched in such a catastrophic
fashion \citep{BRRS08}.
%%%%----Margin note----%%%
\begin{marginnote}[]
\entry{In a closed domain}{final saturation is catastrophically slow}
\end{marginnote}
%%%%%%--------%%%%%%
Instead, the time scale for reaching ultimate saturation is
``catastrophically'' prolonged, i.e., the final saturation obeys
\citep{Bra01}
\begin{equation}
\meanBB^2\approx\bra{\bb^2}\,(\kf/k_1)^2\,
\left[1-e^{-2\eta k_1^2(t-t_{\rm sat})}\right]
\quad\mbox{(for $t>t_{\rm sat}$)},
\label{FinalSat}
\end{equation}
where $\kf$ is the typical wavenumber of the turbulence, $k_1=2\pi/L$
is the lowest wavenumber of the cubic domain of size $L^3$, and
$t_{\rm sat}$ marks the end of the early kinematic growth phase and
the beginning of the slow saturation phase.
Let us emphasize once again that in \Eq{FinalSat}, the value of $\eta$
is the microphysical value, which is extremely small in galaxies.
This motivates the characterization as ``catastrophically slow''.


\begin{textbox}[t]\section{Derivation of \Eq{FinalSat}}
The slow saturation behavior after $t=t_{\rm sat}$ is governed by magnetic
helicity conservation.
The uncurled induction equation reads, $\partial\AAA/\partial t=\UU\times\BB
-\eta\mu_0\JJ-\nab\varphi$, where $\varphi$ is the electrostatic potential.
The evolution of $\AAA\cdot\BB$ is then given by
\begin{equation}
\frac{\partial}{\partial t}(\AAA\cdot\BB)=\cancel{2(\UU\times\BB)\cdot\BB}
-2\eta\mu_0\JJ\cdot\BB-\nab\cdot\FFF,
\label{dABdt}
\end{equation}
where $\FFF=\EE\times\AAA+\varphi\BB$ is the magnetic helicity flux density.
(Note the analogy with the Poynting flux $\EE\times\BB/\mu_0$ of magnetic
energy density.)
The equations involving $\AAA$ and $\FFF$ depend on the gauge, i.e.,
on the form of $\varphi$, which can be chosen freely.
One frequently adopts the Weyl gauge, $\varphi=0$.

Next, we consider spatial averages $\meanBB=\nab\times\meanAA$ and
$\meanJJ=\nab\times\meanBB/\mu_0$, along with the resulting fluctuations,
$\aaaa=\AAA-\meanAA$, $\bb=\BB-\meanBB$, and $\jj=\JJ-\meanJJ$, so,
after averaging, \Eq{dABdt} becomes
\begin{equation}
\frac{\partial}{\partial t}(\meanAA\cdot\meanBB+\overline{\aaaa\cdot\bb})
=-2\eta\mu_0\left(\meanJJ\cdot\meanBB+\overline{\jj\cdot\bb}\right)
-\nab\cdot\meanFFFF.
\label{dAmBmdt}
\end{equation}
Our analysis concerns only the phase when the small-scale
dynamo has already saturated (for $t>t_{\rm sat}$), so
$\overline{\aaaa\cdot\bb}=\const$ and $\overline{\jj\cdot\bb}=\const$.
Assuming the field to be helical with negative helicity at small
scales and positive at large scales, we have
$\mu_0\overline{\jj\cdot\bb}\approx-\kf\overline{\bb^2}$ and
$\meanAA\cdot\meanBB\approx\overline{\BB^2}/k_1
\approx\mu_0\meanJJ\cdot\meanBB/k_1^2$.
Inserting this into \Eq{dAmBmdt} and performing volume averaging
over the periodic domain, indicated by angle brackets, so
that the flux divergence term vanishes, one obtains
\begin{equation}
\frac{\dd}{\dd t}\bra{\meanBB^2}
=-2\eta k_1^2\bra{\meanBB^2}+2\eta k_1\kf\bra{\bb^2},
\label{dBm2dt}
\end{equation}
the solution of which for $\bra{\bb^2}=\const$ is given by \Eq{FinalSat}.
\end{textbox}

\EEq{FinalSat} has been derived based on just the magnetic helicity
equation, i.e., no mean field theory was involved; see the derivation
in the relevant text box.
However, a phenomenological mean field theory can be formulated where
the $\alpha$ effect has an extra magnetic contribution related to the
magnetic helicity at small scales, which, in turn, is computed based on
the large-scale magnetic helicity that is being being produced by the
mean-field dynamo under the assumption that the total magnetic helicity
is conserved.
The $\alpha$ effect itself is then not catastrophically quenched
\citep{BB02}, so the magnetic field (in a periodic or closed domain)
can still be strong, but only after a resistively long time.
A detailed account of these developments is reviewed in \cite{BS05}.

\subsection{Alleviating catastrophic quenching by magnetic helicity fluxes}
\label{sec:helicityflux}

It has long been anticipated that the catastrophically or resistively
slow saturation phase can be sped up by magnetic helicity fluxes.
While the idea is simple and convincing, there is as yet no conclusive
demonstration that this actually works.
The decisive equation 
is the one
for the magnetic helicity of the fluctuating
field, $\overline{\aaaa\cdot\bb}$. 
The fluctuating field can be determined from the equation for the
mean field, which, under the Weyl gauge, can be written as
\begin{equation}
\frac{\partial\meanAA}{\partial t}=\meanUU\times\meanBB+\meanEMF
-\eta\mu_0\meanJJ,
\label{dAmdt}
\end{equation}
This expression results in the following equation for the magnetic
helicity of the mean magnetic field:
\begin{equation}
\frac{\partial}{\partial t}(\meanAA\cdot\meanBB)=\bra{2\meanEMF\cdot\BB}
-2\eta\mu_0\meanJJ\cdot\meanBB-\nab\cdot\meanFFFFm.
\label{dAmBmdt}
\end{equation}
The equation for $\overline{\aaaa\cdot\bb}$ must also have corresponding
$\meanEMF$ terms, but with $\bra{2\meanEMF\cdot\BB}$ being replaced by
$-\bra{2\meanEMF\cdot\BB}$, i.e.,
\begin{equation}
\frac{\partial}{\partial t}(\aaaa\cdot\bb)=-2\meanEMF\cdot\meanBB
-2\eta\mu_0\overline{\jj\cdot\bb}-\nab\cdot\meanFFFFf.
\label{dabdt}
\end{equation}

\begin{figure}[t]
\includegraphics[width=.8\textwidth]{presults2b}
\caption{
$\Rm$ dependence of terms on the RHS of the small-scale magnetic helicity
equation \eq{dabdt}.
Note that $\nab\cdot\meanFFFFf$ becomes comparable to $2\meanEMF\cdot\meanBB$
and $2\eta\bra{\jj\cdot\bb}$ only for $\Rm>1000$.
Adapted from \cite{DSGB13}.
}\label{presults2b}
\end{figure}

In the steady state, there are three terms on the right hand side,
$2\meanEMF\cdot\meanBB$, $2\eta\mu_0\overline{\jj\cdot\bb}$, and
$\nab\cdot\meanFFFFf$.
Simulations by \cite{DSGB13} and \cite{Rin21} showed that only at magnetic
Reynolds numbers of the order of 1000, the helicity flux divergence begins
to become more important than the resistive terms; see \Fig{presults2b}.
Thus, one could expect the saturation behavior to become independent of
$\Rm$.
However, simulations still show that $\meanBB^2$ declines with increasing $\Rm$.
This could mean that $\Rm$ needs to be much larger than 1000, but
probing this regime requires larger simulations.
It remains then to be seen if future simulations with different setups
can result in situations where $\eta\overline{\jj\cdot\bb}$ does become
clearly subdominant.

\section{TEST-FIELD METHOD AND NONLOCALITY IN SPACE AND TIME}

\subsection{Parameterization of the mean electromotive force}

The mean electromotive force, $\meanEMF$, in \Eq{dAmdt} can be
expressed in terms of the mean magnetic field as
\begin{equation}
\meanemf_i=\alpha_{ij}\ast\meanB_j+\eta_{ijk}\ast\partial\meanB_j/\partial x_k,
\label{EMFi}
\end{equation}
where the asterisks denote a convolution over space and time, and
$\alpha_{ij}$ and $\eta_{ijk}$ are integral kernels and $x_k$ is the
$k$th component of the spatial coordinate, i.e.,
$\partial\meanB_j/\partial x_k=\meanB_{j,k}$.
For planar averages that depend on just one direction, we can write
$\meanemf_i=\alpha_{ij}\meanB_j-\eta_{ij}\meanJ_j$,
where $\alpha_{ij}$ and $\eta_{ij}$ would each only have four components.
For the rest of this review, we restrict ourselves to this simpler case,
but refer to the work of \cite{Warnecke+18} for a study in the context
of three-dimensional convection in a sphere.

Most of the published literature ignores the fact that $\alpha_{ij}$
and $\eta_{ij}$ are integral kernels, and approximate the convolution
by a multiplication.
This approximation then assumes a local connection between $\meanEMF$
and the mean fields.
Replacing the convolution by a multiplication is often not a good
approximation that can easily be avoided.
The convolution models the effects of nonlocality in space and/or time
can play important roles, as we will see below.

\subsection{Mean-field coefficients}

One of the major advances in mean-field dynamo theory is the development
of numerical methods to avoid the limitations imposed by using analytic
approaches.
This concerns mainly the linearization of the evolution equations for
the magnetic and velocity fluctuations in a turbulent flow.

To obtain expressions for $\alpha_{ij}$ and $\eta_{ijk}$, one has to
solve the equations for the fluctuations $\uu$ and $\bb$.
The evolution equation for $\bb$ is the most important one and is obtained
by subtracting the evolution equation for $\meanBB$ from that for $\BB$.
The equations are nonlinear in the fluctuations.
In analytic approaches, those nonlinear terms are often ignored, which
is referred to as the second order correlation approximation,
but this restriction is no longer required in the numerical evaluations
of $\meanEMF\equiv\overline{\uu\times\bb}$.
This approximation is only valid when $\Rm\ll1$, or when the correlation time
$\tau_{\rm cor}$ is extremely short, i.e., when
$\tau_{\rm cor}\urms\kf\ll1$.
Neither of the two is relevant to astrophysics, so we will focus
here on the nonlinear approach, where no approximation is used.

When the linearization is abandoned, most of the changes in the
coefficients $\alpha_{ij}$ and $\eta_{ijk}$ are of quantitative nature,
especially when the mean field is weak.
There are a few examples where new effects emerge (turbulent pumping
in the Galloway--Proctor flow, or the effect of helicity on the turbulent
magnetic diffusivity, although those effects remain mainly of academic interest;
\citep[see][for a review]{Bran18}.

\subsection{Methods for measuring $\alpha$ and other effects}

One approach is to use a nonlinear simulation to obtain $\uu$ and
$\bb$ in the presence of an additional imposed magnetic field.
The resulting $\overline{\uu\times\bb}$ can be related to $\meanBB$
by ignoring $\eta_{ij}$ and $\meanJJ$.
This is referred to as the imposed-field method, but it can only
be used when $\meanJJ$ vanishes, for example when the averages are
zero-dimensional, i.e., volume averages.

Another approach is to relate $\overline{\uu\times\bb}$ to the
actual $\meanBB$ and $\meanJJ$ by correlating them to each other and
computing $\alpha_{ij}$ and $\eta_{ij}$ as correlation coefficients.
This approach has been applied both for the integral kernels in the
nonlocal approach \citep{BS02,Bendre+22} and the coefficients in the
local version \citep{Simard+16}.
The reliability of this approach is unclear and it has not yet been
verified for the simple examples of the Roberts flow mean-field dynamos
discussed in \Sec{SimpleDynamos}.
This method is sometimes referred to as the correlation method.
The occurrence of unphysical results with this method can sometimes be
alleviated by using the singular value decomposition \citep{Simard+16}.

The most reliable method for calculating $\alpha_{ij}$ and $\eta_{ij}$
is the test-field method (TFM), where one solves the equations for the
fluctuations numerically for a sufficiently big set of test fields.
In the following, we only describe its essence in a few words.
A more detailed description can be found in the review of \cite{Bran+10}.

\subsection{Using test fields}

The TFM was originally applied by \cite{Sch05,Sch07} to determine the
dependence of all transport coefficients in a sphere using longitudinal
averages.
In that case, one has 9 coefficients for $\alpha_{ij}$ and 18 nonvanishing
coefficients for rank three tensor $\eta_{ijk}$ in the representation
$\meanemf_i=\alpha_{ij}\meanB_j+\eta_{ijk}\meanB_{j,k}$.
(The nine coefficients $\eta_{ij\phi}$ do not enter the problem, because
$\phi$ derivatives of $\phi$ averages vanish.)
For systems in Cartesian coordinates, planar $xy$ averages are often
the most suitable; see \cite{Bra05} and \cite{BRRK08,BRS08} for the
first applications.
The number of relevant coefficients is then four for
$\alpha_{ij}$, because only $i,j=1,2$ are relevant, and four
for the rank two tensor $\eta_{ij}$ in the representation
$\meanemf_i=\alpha_{ij}\meanB_j-\eta_{ij}\mu_0\meanJ_j$, because
there are only two nonvanishing components of $\meanB_{j,k}$ that can
be expressed as the two components of the mean current density with
$\mu_0\meanJ_x=-\meanB_{y,z}$ and $\mu_0\meanJ_y=\meanB_{x,z}$.
In that case, one can use four sinusoidal test fields $(\sin kz,0,0)$,
$(\cos kz,0,0)$, as well as $(0,\sin kz,0)$, $(0,\cos kz,0)$.

\begin{figure}[t]
\includegraphics[width=.7\textwidth]{Gressel}
\caption{
Dynamo coefficients from supernova-driven turbulence.
The top panel shows the diagonal components of $\alpha$, the middle
panel shows the off-diagonal components, $\alpha_{\phi R}$ and
$-\alpha_{R\phi}$, contributing to the pumping velocity
$\gamma_z=(\alpha_{\phi R}-\alpha_{R\phi})/2$.
The bottom panel shows the diagonal components of $\eta_{ij}$,
which are seen to increase away from the midplane.
Courtesy \cite{Gressel+08AN}
}\label{Gressel}
\end{figure}

In \Fig{Gressel} we reproduce results from the work of
\cite{Gressel+08AN}, who performed simulations of dynamos from
supernova-driven turbulence in a stratified portion of a galactic disk.
Using the TFM, they found that $\etat$ increases away from the midplane
and that this leads to turbulent pumping toward the midplane, which is
given by $\ggamma\approx-(\tau/2)\nab\etat$.
The pumping velocity $\ggamma$ corresponds to off-diagonal components
of the $\alpha$ tensor, which they confirmed.
In particular, the pumping velocity in the $z$ direction is given by
$\gamma_z=(\alpha_{\phi R}-\alpha_{R\phi})/2$, where $R$ denotes the
cylindrical radius.

\subsection{Nonlocality}

It was soon realized that the results for $\alpha_{ij}$ and
$\eta_{ij}$ always depend on the wavenumber $k$.
This is explained in the box ``Dynamos from the memory effect''.
For many turbulent flows, it was found that the components of both
$\alpha_{ij}$ and $\eta_{ij}$ decline with increasing values of $k$ in
a Laplacian fashion approximately like $[1+(ak/\kf)^2]^{-1}$, where $a$
is found to depend on details of the flow.
In this relation, the value of the empirical coefficient $a$ was found to
vary between 0.1 and 0.5, depending on the nature of the turbulent flow
\citep{BRS08, RB12}.

The significance of nonlocality is that the transport coefficients
become effectively quenched when the mean field is of
small scale, i.e., smaller than the integral scale of the turbulence.
Especially near boundaries, where sharp boundary layers may occur in
calculations that ignore nonlocality, the actual field would be smoother.
In fact, sharp contrasting structures have been found in earlier galactic
dynamo simulations \citep{Moss96}.
Such results would need to be revisited in view of the importance of
nonlocality effects.

Even more important than spatial nonlocality is temporal nonlocality.
It is also referred to as memory effect, because it implies that the
electromotive force depends not just on the magnetic field at the current
time, but also on the field at earlier times.
To leading order, the Fourier-transformed kernel of temporal nonlocality
is proportional to $(1-\ii\omega\tau)^{-1}$, where $\tau$ is the turbulent
turnover time.
Thus, the electromotive force diminishes with increasing frequency
$\omega$, but there is also a new imaginary component that was absent
otherwise.
This can lead to new dynamo effects such as that responsible in the
dynamos for the Roberts flows~II and III.
Whether those effects play a role in any turbulent dynamos is unclear,
however.

\begin{textbox}[t]\section{Evolution equation for nonlocality in space and time}
In Fourier space, the spatial and temporal nonlocalities can be combined
to a single expression, which reads
\begin{equation}
\tilde{\cal E}_i(k,\omega)=\frac
{\tilde{\alpha}_{ij}(k,\omega)\tilde{B}_j(k,\omega)
-\tilde{\eta}_{ij}(k,\omega)\mu_0\tilde{J}_j(k,\omega)}
{1-\ii\omega\tau+\ell^2k^2},
\label{EMFifrac}
\end{equation}
where $\ell^2=a/\kf^2$.
Moving the denominator to the left-hand side, the equation becomes
\begin{equation}
\left(1-\ii\omega\tau+\ell^2k^2\right)\tilde{\cal E}_i(k,\omega)=
\tilde{\alpha}_{ij}(k,\omega)\tilde{B}_j(k,\omega)
-\tilde{\eta}_{ij}(k,\omega)\mu_0\tilde{J}_j(k,\omega),
\label{EMFifrac2}
\end{equation}
which, back in real space, becomes a simple evolution equation with a
diffusion term on the right inside:
\begin{equation}
\tau\frac{\partial\meanemf_i}{\partial t}
=\alpha_{ij}\meanB_j+\eta_{ij}\mu_0\meanJ_j
+\ell^2\nabla^2\meanemf_i-\meanemf_i.
\label{EMFi_nonloc}
\end{equation}
This equation for the electromotive force is still only an approximation,
because there are in general also larger powers of $\omega$ and $k$,
but it provides a substantial improvement over the local formulations.
\end{textbox}

Although the memory effect may not be strong enough to produce new dynamo
effects in turbulent flows, it can be strong enough to produce significant
phase shifts between the generation of magnetic field in galactic arm
and interarm regions.
This has been studied in detail by \cite{Shukurov98} and \cite{Chamandy+13}.
Including a memory effect in numerical simulations is, in general, very
cumbersome, because it requires storing the full spatial form of the
mean field for many earlier times in order to evaluate the convolution
integral in \Eq{EMFi}.
In the present case, however, and to leading order, the convolution integral
can be converted into an evolution equation for the electromotive
force, which is computationally much easier to solve; see \Eq{EMFi_nonloc}.
This approach was first proposed by \cite{RB12} and was applied to
dynamos in spheres \citep{BC18}.
This formalism also reproduces the dynamo effect from time delay for the
Roberts flows~II and III; see \Sec{SimpleDynamos}, as was demonstrated
by \cite{RDRB14}.
This is explained in the box ``Dynamos from the memory effect''.

\begin{textbox}[t]\section{Dynamos from the memory effect}

We emphasize, again, that dynamos from the memory effect are so far only
known to occur for the Roberts flow, so the effect may be special.
At this point, however, we can not exclude that it plays a role
in galaxies, for example in connection with the strong vertical
stratification leading to a pumping effect toward the midplane.
With the tools now at hand, it is not easy to explain this effect.

The dispersion relation for a problem with turbulent pumping
$\gamma$ and turbulent magnetic diffusion $\etat$ is given by
$\lambda=-\ii k\gamma-\etat k^2$.
Since $\Rey\lambda<0$, the solution can only decay, but it is
oscillating with the frequency $\omega=\Imag\lambda=\gamma$.
In the presence of a memory effect, $\gamma$ is replaced by
$\gamma/(1-\ii\omega\tau)$, where $\tau$ is the memory time.
Then, $\lambda\approx-\ii k\gamma\,(1-\ii\omega\tau)-\etat k^2$,
and $\Rey\lambda$ can be positive if total.
This is the case for the Roberts flow discussed in
\Sec{SimpleDynamos}.
\end{textbox}

%boundary condition

\section{SETTING THE SCENE FOR DYNAMO ACTION IN REAL GALAXIES}

\subsection{Possibilities for seed magnetic fields}
\subsubsection{The need for sufficiently strong seed magnetic fields}

In \Sec{sec:history} we calculated an average of 70 revolutions in the
Galaxy's lifetime.
This is not very much, so we have to be concerned about possible effects
of the strength and shape of the initial magnetic field.
Typical estimates for the growth rate of the Galactic dynamo are of the
order of $\Gamma\approx2\Gyr^{-1}$ \citep{Beck+96}.
This means that the mean magnetic field could be amplified by up to
12 orders of magnitude in about $14\Gyr$.
To reach the current level of the mean magnetic field of about $3\uG$,
we would need a seed magnetic field of about $10^{-18}\G$.
This is just about the level that can be expected from
the Biermann battery mechanism \citep{Rees87}.
The text box ``Battery mechanisms'' provides some more information about
the Biermann battery and other mechanisms that can generate magnetic
fields in an un-magnetized plasma.
%%%%---- Margin note----%%%%
\begin{marginnote}[]
\entry{Cosmic battery}{A mechanism that can generate magnetic field even when there is none initially.}
\end{marginnote}
%%%%--------%%%% 

Even though the growth rate of a galactic large-scale dynamo may just
be large enough for explaining the current level of the mean field of
$\approx3\uG$ at the present time, it would not be sufficient for
explaining large-scale magnetic fields in very young galaxies.
In fact, it is very likely that galaxies were hosting strong,
large-scale magnetic fields already by redshift $z=1$.
\cite{Kronberg+92} found evidence of strong magnetic fields in a
$z=0.395$ galaxy.
In a more systematic search, \citet{Bernet_2008} found strong RMs in
quasar sightlines passing from $z\simeq 1$ galaxy haloes.
More recently, \citet{Mao2017} estimated a $\mu$G, kpc-coherent magnetic
field in a lensing galaxy at $z\simeq0.46$.

To explain smaller-scale magnetic fields at equipartition levels of $3\uG$
would still require dynamo action, but that may just be a small-scale
dynamo.
Since the typical dynamo growth rates scale with the turbulence turnover
time, which is shorter at small scales, a small-scale dynamo is a viable
seed-field mechanism, as we discuss next.

\begin{textbox}[t]\section{Battery mechanisms}
\paragraph*{The Biermann battery.}
When the density and the temperature gradient in a plasma are misaligned,
the electrons move down the pressure gradient, generating an electromotive
force that gives rise to a magnetic field.
The resulting time derivative of the magnetic vector potential is then
\begin{equation}
    \frac{\partial\AAA}{\partial t} = \frac{c}{q n_{\rm e}}\nab p_{\rm e}
\end{equation}
where $n_e$ and $p_e$ are the electron number density and pressure,
$c$ the speed of light, and $q$ the electron charge.

\paragraph*{The Durrive battery.}
Massive stars are surrounded by a region of ionized gas.
\citet{Durrive_Langer_2015} proposed that an electromotive force should
be created by the surplus momentum transferred to the electron after
the ionization of an atom.
Then, the uncurled induction equation for zero initial magnetic field becomes:
\begin{equation}
    \frac{\partial\AAA}{\partial t} = \frac{c}{q n_{\rm e}}\nab p_{\rm e}
    -\frac{c}{qn_{\rm e}}\dot{\bf{p}}_{\rm e}
    \label{eq:durrive}
\end{equation}
where $\dot{\bf{p_e}}$ is the rate of momentum transfer to the electrons
and \Eq{eq:durrive} also includes the Biermann battery.

In the early Universe, the Biermann battery can appear around rippled
shocks, while both battery mechanisms should operate around ionization
fronts \citep{Subramanian_1994,Kulsrud+97,Gnedin2000}.

\end{textbox}

\subsubsection{Small-scale dynamos as a seed for the large-scale dynamo}

All dynamos require seed magnetic fields --- even the small-scale one.
However, a small-scale dynamo grows much faster than a large-scale one.
It would therefore be able to produce equipartition strength magnetic
fields from much weaker magnetic fields.
The idea has been discussed by \cite{Beck+94}.

Another related idea is to produce galactic seed magnetic fields
in the first stars.
The simplest form of this idea is that stars could pick up a Biermann
seed, which would then be amplified though a stellar dynamo and get
ejected with the supernova explosion at the end of the star's life.
This scenario has been explored in many numerical cosmological models
\citep{beck2013,Katz2019,Vazza2017,MartinAlvarez2021}, and shows that
it can, in fact, magnetize galaxies very efficiently. However, these
simulations use unrealistically high values for the supernova-injected
magnetic field.
Those fields could then well be large-scale ones, i.e., on the scale of
stars, but those would grow on an even shorter time scale, because stars
are much smaller than the envisaged turbulent eddies in the interstellar
medium.
Young stars and also their surrounding accretion disks can host powerful
dynamos that also drive magnetized winds; see the estimates
in \cite{Bra00} and corresponding mean-field simulations in
\cite{vonRekowski+03}.
Those winds could magnetize the surrounding interstellar medium and could
well produce much more efficient seeds for the galactic dynamo than any
battery mechanism.
The wind-based injection model would be a viable alternative to the
rather uncertain supernova seeding often used in cosmological simulations.

\subsubsection{Battery versus plasma instabilities}

When the electron distribution is anisotropic and the magnetic field
is not too weak, the Weibel instability can amplify the magnetic field,
Typically, the Weibel instability generates very small-scale fields.
Nevertheless, it could play a role in an intermediate regime when the
Biermann battery has generated a sufficiently strong magnetic field.
Interestingly, this is also in an agreement with recent laser plasma
experiments that have been able to access a regime relevant to
astrophysical dynamos \citep{Schoeffler+16}.

%%%%---- Margin note----%%%%
\begin{marginnote}[]
\entry{Weibel instability}{Occurs in a nearly homogeneous plasma when there is an anisotropy in velocity space \citep{weibel1959}.}
\end{marginnote}
%%%%--------%%%% 

\subsubsection{Primordial seed magnetic fields}
\label{subs:bigbangturb}

In the early Universe, inflation and phase transitions, such as the
decoupling of the weak and electromagnetic forces, or the formation
of hadrons from quarks may have produced hydromagnetic turbulence
\citep{Widrow02}.
Owing to the lack of further energy input, any magnetic field generated
at that time would be slowly decaying.
The dilution of the magnetic field due to the expansion of the Universe
is always scaled out by talking about the comoving magnetic field, which
is $\tilde{\BB}=a^2\BB$, where $a$ is the scale factor of the Universe.
When time is being replaced by conformal time, $\tilde{t}=\int\dd
t/a(t)$, the MHD equations have their usual form without expansion
factors \citep{BEO96}.
In the following, the tildes are therefore dropped.

Not much is known about the strength of the comoving magnetic field today.
There are only constraints.
Upper limits can be derived from Big Bang nucleosynthesis (BBN)
constraints; see \cite{Grasso+Rubinstein95} and \cite{Kahniashvili+22}
for recent work taking into account the decay of the magnetic field
between the moment of generation and the time of BBN.
A lower limit on the present-day magnetic field strength has been proposed
on the grounds that magnetic fields would prevent the reconnection
of pair-created electrons and positrons when the TeV photons from
powerful blazars interact with the extragalactic background light
\citep[e.g.,][]{neronov}.
It should be noted, however, that the validity of this technique
may have a systematic uncertainty in that plasma instabilities could
potentially also provide an explanation for the non-observation of GeV
halos \citep{Broderick+12}.

Simulations by \cite{Sironi14}, confirm that plasma instabilities do
indeed operate, but they can only account for about 90\% of the loss of
GeV photons and the suppression of the remaining 10\% would still need
to be explained by the presence of magnetic fields.
Similar conclusions were reached by \cite{AlvesBatista+19}, who performed
more detailed simulations for individual blazars.

The lower limits derived by \cite{neronov}, which become less stringent
for larger length scales, provide an exciting motivation for primordial
magnetogenesis scenarios.
At the present time, those primordial magnetic fields
may have strengths in the range
of $10^{-16}\G$ to $10^{-9}\G$ \citep[see][for a review]{subramanian2016},
and could act as seed magnetic fields for any subsequent dynamo processes
-- once sufficient kinetic energy becomes available.
\Fig{IGMF_hints} shows the expected magnetic field ranges as a function
of the typical scale $\lambda_B$ of the magnetic field.
Here, the white solid lines describe the decay of a helical magnetic field
($\BB^2\sim t^{-2/3}$) along with the increase of its typical length scale
($\lambda_B\sim t^{2/3}$), so that $\BB^2\lambda_B=\const$.
For a nonhelical magnetic field, there are still magnetic
helicity fluctuations, which constrain the decay such that the
correlation integral of the local magnetic helicity is conserved
\citep{Hosking_Schekochihin_2022}.
This leads to a decay with $\BB^2\sim t^{-10/9}$ and
$\lambda_B\sim t^{4/9}$, so that $\BB^4\lambda_B^5=\const$.

The first stars are expected to form about $10^{8}\yr$ after the Big Bang,
marking the beginning of the reionization epoch.
The first galaxies should form at
about $10^{9}\yr$ after the Big Bang.
Since dynamo action is fastest at small length scales, the magnetic field
generation during the formation of the first collapsing structures is
potentially important and may have produced a stronger seed magnetic
field for the subsequent global galactic dynamo.
Strong magnetic fields may also affect galaxy and large-scale structure
formation of the Universe \citep{Kahniashvili+13}.

\begin{figure}[t]
\includegraphics[width=\textwidth]{fig/IGMF_hints_addedhosking2.png}
\caption{
Summary of lower and upper magnetic field limits as a function of
correlation length.
Only the narrowly hashed region indicates permissible a few strength.
Courtesy \cite{Korochkin+21}, in which we have added the prediction of
\citet{Hosking_Schekochihin_2022} $B\propto\lambda_{B}^{-5/4}$.
The asterisk shows the scale where \citet{Hosking_Schekochihin_2022}
stop the line in their work, since they assumed that the relevant time
scale is determined by magnetic reconnection and not by the Alfv\'en time.
}\label{IGMF_hints}
\end{figure}

\subsubsection{Primordial fields during structure formation}
\label{sec:cosmosims}

Modern numerical simulations of cosmological large-structure
formation are taking into account the evolution of the magnetic field,
seeded by the various mechanisms outlined above.
A central question in these studies is whether the topology and strength
of these primordial fields leave measurable signatures on the cluster or
galaxy structures.

\citet{Vazza2017} performed a comprehensive suite of cosmological
simulations using different magnetogenesis mechanisms: a uniform
seed, meant to simulate the magnetic field created by inflation,
a seed that follows the distribution of density perturbations to
approximate the magnetic field generation by a Biermann battery,
a seed that approximates the turbulent dynamo amplification, and an
astrophysical seed that simulates the injection of magnetic fields by
stellar sources.
They find that, at $z=0$, all mechanisms agree on the cluster
magnetization (which they were designed to reproduce).
However, there are large differences in the magnetic field structure
both on galaxy scales and in the voids.
More recently, \citet{Mtchedlidze+22} explored different initial
topologies for the primordial magnetic field, including uniform and
scale-invariant inflationary fields, as well as helical and non-helical
fields from the radiation-dominated epoch.
They also reported that the final magnetic field distribution retained
a memory of the initial seed.
This can be seen from \Fig{Salome}, where we show maps of the Faraday
rotation at the present time starting at a redshift of $z=60$ with any
one of the four initial conditions discussed above.

\begin{figure}[t]
\includegraphics[width=\textwidth]{Salome}
\caption{
Faraday rotation maps from four cosmological simulations of
\cite{Mtchedlidze+22} using inflationary uniform and scale-invariant
fields (upper and lower left), as well as phase-transitional helical
and nonhelical initial fields (upper and lower right).
Courtesy of \cite{Mtchedlidze+22}.
}\label{Salome}
\end{figure}

The above works use a uniform spatial resolution, which offers the
advantage of an unbiased view of cosmological magnetic field evolution.
However, models with adaptive resolution can give a more detailed view of
the magnetic field on galaxy scales, while following their cosmological
history.
One recent example is the work of \citet{Garaldi2021}, who explored the evolution
of cosmological volumes and zoom-ins using four different mechanisms for
magnetic field generation: primordial, Biermann battery, Durrive battery,
and stellar seeds.
Contrary to the findings of the uniform-resolution, large-volume works
mentioned above, they report that the initial conditions are forgotten
by redshift $z\sim2$.
However, none of their initial conditions contained magnetic helicity,
which should not have decayed.

\citet{Marinacci2016} and \citet{MartinAlvarez2020} focused on the
effects of cosmological magnetic fields on galaxy formation.
They found that fewer, smaller galaxies form for stronger primordial
fields.
A very interesting approach was employed by \citet{MartinAlvarez2021},
who traced the evolution of the primordial field and the field injected
by stellar sources separately.
They achieved this by adding two tracer induction equations to the code,
one for each seed.
These induction equations are not connected to the gas evolution, but
only follow the evolution of the two fields as it would be if they were
independent of each other.
They found that their evolved galaxies contain a mixture of both:
metal-poor gas at the galaxy's outskirts containing mostly primordial
fields with large-scale coherence and SN-enriched gas containing mostly
fields of stellar origin, coherent on small scales.
The cold, star-forming gas contains a mixture of the two.
However, in agreement with the \citet{Garaldi2021} result, the origin
of the galactic magnetic field becomes practically indistinguishable
very early on without the tracers.
All these simulations result in microgauss magnetic fields, but their
length scales are typically too small to explain the fields seen in
actual galaxies.

The results of these comprehensive simulations
point to a complex picture in which various seeding
mechanisms combine to give the initial and boundary conditions for
dynamos on different scales and different epochs.
Interestingly, they also point to cluster scales -- rather than galaxy
scales for an answer regarding the origin of cosmic magnetic fields.

\subsubsection{Possible importance of cluster mergers}

Mergers of galaxy clusters could amplify large-scale magnetic fields
quickly to near-equipartition strengths.
The merger itself could stretch a pre-existing field and amplify it in
conjunction with the existing (possibly helical) background turbulence.
One could then think of this as some kind of $\alpha\Omega$ dynamo,
where the $\Omega$ effect is associated with the large-scale shear
generated during the merger.
Such simulations were produced by \cite{Roettiger+99}.

The study of the relevance of cluster mergers to dynamos has not been
followed up in recent years.
In the meantime, there have been many relevant advances in dynamo theory
in connection with time dependence of the flow and in the context of
measuring field transport coefficients.
In view of these advances, this approach might deserve more detailed
follow-up studies in the future.
However, there are similarities with recent studies of gravitational
collapse dynamos that will be discussed next.

\subsection{Gravitational collapse dynamos}
\label{sec:grav_collapse}

By the time the first gravitationally bound structures (stars or galaxies)
formed, any primordial turbulence from the processes we mention in
\Sec{subs:bigbangturb} had probably already decayed.
However, the assembly onto these first structures  certainly generated
large amounts of turbulent kinetic energy, which could have triggered
dynamo action.

A number of numerical works show that the formation of the first stars is
an ideal laboratory for amplifying nG \citep{Sur+10,Sur+12,Federrath+11b},
or even $10^{-20}\G$ \citep{Schober+12} fields to equipartition values
through a small-scale dynamo.
Gravitational compression can amplify the field further, although in the
presence of turbulence, the resulting dependence of the magnetic field
on the density is weaker than the prediction of ideal flux freezing
\citep{Sur+12}.
While flux freezing predicts $|\BB|\propto\rho^{2/3}$, the theory
of \citet{XL20}, which includes the turbulent dynamo, predicts that
$|\BB|/\rho^{2/3} \propto \rho^{-2\alpha/57-1/6}\approx\rho^{-0.13}$,
where $\alpha=-1$ was assumed for the scaling coefficient of their
small-scale dynamo.
This remarkable agreement with the theory is taken to be suggestive of the
importance of reconnection diffusion and the breakdown of flux-freezing
\citep{XL20}, which makes compressional amplification less efficient.

However, the present results still leave some questions unanswered.
For example, is it possible to explain the slow-down of
compressional field amplification even in the absence of
dynamo action?
Although this may be an academic question, it could be answered by
performing collapse simulations in two dimensions, when dynamo action
is impossible.
Also, it would be interesting to see the early magnetic field growth
starting from a much smaller initial magnetic field.
In fact, the theory of \cite{XL20} does not really address the question
of when the dynamo is excited, but discusses instead the nonlinear
regime of a supercritical dynamo.

\subsubsection{Nature of collapse dynamos}

An important tool in characterizing dynamo action in time-dependent flows
such as decaying turbulence or gravitational collapse, is to compare
the work done against the Lorentz force with the Joule dissipation rate,
and to look at different contributions to the Lorentz work term.
These work and dissipation terms emerge when deriving the evolution
equation for the magnetic energy density.
Taking the dot product of \Eq{InductEq} with $\BB$, averaging, and
ignoring surface terms, we obtain
\begin{equation}
\frac{\dd}{\dd t}\bra{\BB^2/2\mu_0}=
\bra{\JJ\cdot(\UU\times\BB)}-\eta\mu_0\bra{\JJ^2}.
\label{dB2dt}
\end{equation}
Using $\JJ\cdot(\UU\times\BB)=-\UU\cdot(\JJ\times\BB)$,
the first term on the right-hand side of \Eq{dB2dt}
can be written as the work against the Lorentz force.
Two further refinements can then be employed \citep{BN22}.
First, one can decompose
$(\UU\times\BB)_i=-U_j\partial_j A_i+U_j\partial_i A_j$
to write $W_{\rm L}=W_{\rm L}^{\rm2D}+W_{\rm L}^{\rm3D}$,
where $W_{\rm L}^{\rm2D}=\bra{J_i U_j\partial_j A_i}$ and
$W_{\rm L}^{\rm3D}=-\bra{J_i U_j\partial_i A_j}$.
The second term, $W_{\rm L}^{\rm3D}$, vanishes for two-dimensional
magnetic fields oriented in the plane and describes therefore the work
term associated with two-dimensional compression, stretching, compression,
and bending.
Second, one can decompose $\JJ\times\BB$ into contributions from
the magnetic pressure force, the tension force, and curvature force.
The corresponding work terms are then referred to as $W_{\rm L}^{\rm c}$
(for compression), $W_{\rm L}^\|$ (for tension force, i.e., along
the field), and $W_{\rm L}^\perp$ (for the curvature force, i.e.,
perpendicular to the field).

To determine the reality and nature of dynamo action during a turbulent
self-gravitational collapse more carefully, \cite{BN22} computed
the aforementioned terms that enter the magnetic energy balance.
The basic conclusion is that there is indeed dynamo action during the
early phase of the collapse while the initial turbulence is slowly
decaying, but that dynamo action diminishes when the flow becomes
dominated by three-dimensional compression toward the various collapsing
potential minima, where only the irrotational flow component gains in
strength, which, however, does not (or not much) contribute to dynamo
action in their simulations.
In \Fig{bb3_0020} we show a 
visualization of the collapsing magnetic field,
the diminishing of the vorticity, expressed here as a wavenumber
$k_{\oo}=\orms/\urms$, the gain of compressive motions, here expressed through
$k_{\,\nab\cdot\uu}=(\nab\cdot\uu)_{\rm rms}/\urms$, along with several
other quantities, $k_{p\nab\cdot\uu}=-\bra{p\nab\cdot\uu}/p_0\urms$
and $k_{\oo\cdot\uu}=|\bra{\oo\cdot\uu}|/\urms^2$, characterizing the
work done by compression and the amount of kinetic helicity, respectively.
A potential problem with the simulations of \cite{BN22} is the relatively
short collapse time compared with the turnover time of the turbulence.

\begin{figure*}\begin{center}
\includegraphics[width=\textwidth]{fig/magfield_wavenumbers_combined.jpeg}
\end{center}\caption[]{
Left: Visualization of the magnetic field.
Right: Characteristic wavenumbers $k_\omega$ (blue),
$k_{\oo\cdot\uu}$ (red), $k_{\,\nab\cdot\uu}$ (solid black),
and $k_{p\nab\cdot\uu}$ (dotted black).
}\label{bb3_0020}\end{figure*}

\section{GALACTIC MEAN-FIELD DYNAMOS}
\label{sec:mean-field_models}

\subsection{Global magnetic field structure}

\subsubsection{Early analytic approaches}

The idea that the large-scale magnetic field of galaxies could be
explained through an $\alpha\Omega$ dynamo was formulated early on
\citep{VR71,Par71}, just after the first successful mean-field models
were proposed for the Sun and the Earth.
An important early result was the finding that the most preferred
magnetic field mode in flat geometries like galaxies is quadrupolar,
i.e., the toroidal field is even about the midplane.
(Here and elsewhere, quadrupolar means not just a quadrupole, but all
modes of even symmetry about the midplane.)

In view of many early claimed discoveries of BSS fields \citep[for
a review, see][]{SFW86}, an important question in those early days
concerned the possibility of preferred nonaxisymmetric magnetic fields.
Such models were never found.
However, when the assumption of what is known as the pure $\alpha\Omega$
approximation was made, i.e., the toroidal field is only generated
by differential rotation ($\Omega$ effect) and the $\alpha$ effect is
neglected in the generation of the toroidal magnetic field, spurious
nonaxisymmetric modes where found.
This approximation turned out to be not permissible, when the
magnetic field is nonaxisymmetric.

\subsubsection{Boundary conditions}

Standard dynamo problems are usually formulated with vacuum
boundary conditions, i.e., the magnetic field is current-free
and extends to infinity outside the domain \citep{KR80}.
However, such boundary conditions can only be formulated for
spheres or ellipsoids, but not for cylinders, for example.
\cite{Stix75} employed ellipsoidal coordinates and obtained an
axisymmetric solution.
Contrary to \cite{Par71}, he found that oscillatory solutions
occur only at substantially larger dynamo numbers.
\begin{marginnote}
\entry{Dynamo number}{Defined as $D=R_\omega~R_\alpha$, where $R_\omega$
and $R_\alpha$ are mean-field magnetic Reynolds numbers associated with
differential rotation and $\alpha$-effect, respectively \citep{Stix75}.}
\end{marginnote}
Unfortunately, the implementation of ellipsoidal coordinates in a
numerical code is rather cumbersome.
This led to the approach of embedding the galaxy in a sufficiently
large poorly conducting halo, which itself is then contained either
in a cylinder with perfectly conducting boundaries \citep{Elstner+90},
or in a sphere with vacuum boundaries \citep{BTK90}.
These two alternatives are rather different from each other, but the hope
is that those boundaries are far enough away from the physical ones that
those differences are without consequence.

\subsection{Dynamo models for specific galaxies}

Various attempts have been made to produce dynamo models of individual
galaxies.
One such example is M31, i.e., the Andromeda nebula.
Its magnetic field is often described as a ring field.
It is also often regarded as an analog of the Milky Way.
Corresponding models have been presented by \cite{Poezd+93} using
nonlinear $\alpha$ quenching.
An important challenge here is to reproduce the right pitch angle
of the magnetic field.


Another interesting case is M81, whose magnetic field is known to be
predominantly nonaxisymmetric.
This was difficult to explain.
\cite{Moss+93} showed however that such a field could result from an
initial magnetic field that might have survived for long enough times,
at least in the outer parts of the galaxy.
Yet another very different case is NGC~6946, whose field may consist of
what is called magnetic arms.
Those are structures that are interlaced with the stellar arms, but
could also be phase shifted relative to them; see \cite{Shukurov98} and
\cite{Chamandy+15} for a more detailed discussion and references therein.

\subsection{Galactic models with magnetic helicity flux}

In \Sec{sec:helicityflux} we have discussed the potential importance of
magnetic helicity fluxes.
It is often believed that they would be required to explain strong
magnetic fields in galaxies.
Here, we demonstrate the effect of magnetic helicity fluxes in specific
models.
\cite{SSSB06} have presented nonlinear models in a one-dimensional
geometry using the flux associated with a galactic fountain flow.
The main nonlinearity was here given through the dynamical quenching
formalism with advective magnetic helicity fluxes included.
The authors found that a magnetic helicity flux does indeed lead to
larger magnetic field amplitudes provided the magnetic helicity flux
is strong enough.
In their model, the helicity flux was accomplished through a galactic
fountain flow with a speed of at least $300\m\s^{-1}$.
More detailed studies have been performed by \cite{Prasad+16}.

\begin{figure*}\begin{center}
\includegraphics[width=\textwidth]{fig/pcompsat2_Hl232_f1_combined.jpeg}
\end{center}\caption[]{
Left: Evolution of the energy of the mean magnetic field in a model with
a shear-induced magnetic helicity flux for different values of $\Rm$
(here denoted by $R_{\rm m}$).
Adapted from \cite{Bra+05}.
Right: Magnetic field evolution in models with advective magnetic helicity
fluxes for $\Rm=10^5$ and different values strength of advection.
The advection velocity is characterized by the parameters $C_U$.
Courtesy of \cite{SSSB06}.
}\label{Hl232_f1}\end{figure*}

There is some uncertainty regarding the main contributors to the magnetic
helicity flux; see the more recent study by \cite{Vishniac+Shapovalov14}.
In addition to advection, shear could modify the turbulent correlations
in such a way as to transport magnetic helicity efficiently outward.
This was first proposed by \cite{Vishniac+Cho01} and can lead to episodic
magnetic field amplification, especially as $\Rm$ is increased; see
\cite{Bra+05} and the left-hand side of \Fig{Hl232_f1}.
On the right-hand side of \Fig{Hl232_f1}, we reproduce the simulation
result of \cite{SSSB06} with an advective magnetic helicity flux.
In the models with insufficient advective flux, the magnetic energy
decreases to very small values.
The earlier simulations \cite[by][their Figure~7]{Bra+05} with somewhat
smaller values of the magnetic Reynolds number showed that the magnetic
field can recover after some time, but then, again, it begins to fall off,
just like what is seen in \Fig{Hl232_f1}.

\subsection{Rotation Measure signature of mean-field models}

In \Sec{sec:history} we mentioned the historical importance of
RM studies for distinguishing between an ASS, characteristic of dynamo
models, and a BSS, characteristic of a wound-up primordial fields.
The varied findings of RM studies indicate that galactic magnetic field
evolution might be more complex than this simple dichotomy.

At the time of the review of \cite{SFW86}, the majority of galaxies were
thought to be of BSS type; the authors listed seven out of 11 galaxies
as having a BSS field.
However, more accurate subsequent surveys confirmed a predominantly BSS
type structure only for M81 \citep{KBH89}.
In a later review, \cite{Beck+96} listed the field structures for 33
galaxies.
The picture became more complicated, with four examples primarily of
ASS fields (albeit two where marked as uncertain).
The dominance of ASS over BSS continues to persist even today.
For M33, \citet{Tabatabaei+2008} found an axisymmetric field in the
inner regions and a superposition of axisymmetric and bisymmetric fields
in the outer regions.
\citet{Beck_2015} observed a weak ($0.5\uG$) axisymmetric field in
IC~342, and \citet{Beck_2020} found a dominating ASS field in M31
combined with a six-times weaker BSS component.

\begin{figure}
    \centering
    \includegraphics[width=\textwidth]{fig/RM_synchrotron_sky.png}
    \caption{Full-sky view of the Galactic magnetic field in (A) RM of
    extragalactic sources \citep{Hutschenreuter2022} and (B) synchrotron
    emission \citep{Bennett2013}.}
    \label{fig:MWobservations}
\end{figure}

Classifying the Milky Way's magnetic field structure is much harder.
The existing parametric models of the Galactic magnetic field
are largely based on full-sky RM maps of extragalactic sources
\citep[e.g.,][]{oppermann2015,Hutschenreuter2022} and synchrotron
emission maps of the Milky Way \citep[mainly from WMAP;][-- see
\Fig{fig:MWobservations}]{Page2007,Bennett2013}.
The model of \citet{sun2008} assumes an axisymmetric spiral with a
reversal in the inner 5~kpc.  \citet{Jansson_Farrar_2012} include
magnetic spiral arms and an X-shaped field in the halo (see also the
following section for the observational motivation).  \citet{Jaffe2010}
also fit magnetic spiral arms to the disk data, also including the random
magnetic field component.
\citet{Terral_Ferriere_2017}, using analytic forms for the
three-dimensional field, conclude that a bisymmetric (m1) halo field
best fits the RM data.
However, \citet{West2020} found evidence for an axisymmetric ($m=0$)
quadrupolar magnetic field with a small net vertical component in RM.
A newer analysis \citep{Dickey+22} shows that a combination of an
axisymmetric and a bisymmetric mode, based on analytical galactic
dynamo models from \citet{Henriksen_2018}, best explains the large-scale
morphology of the Galactic RM data.
As the quality of the observational data improves, a complex picture
of galactic magnetic field morphology emerges, including that of the
Milky Way.

\subsection{Synchrotron emission from mean-field models}

Synchrotron emission provides an important means of measuring the magnetic
field in galaxies and comparing models with simulations \citep[see][for
a review on bridging dynamo models and observations]{Beck_2019}.

Early attempts of computing the polarized synchrotron emission from
models were presented by \cite{DB90}, who computed the linearly
polarized emission from a galactic mean-field models, which contained
both axisymmetric and nonaxisymmetric magnetic fields.
They confirmed the idea of distinguishing these modes by measuring
the RM along a ring around the galaxy.
Another example was the computation of linear polarization from the
magnetic field on both sides of the midplane in edge-on galaxies.
In galaxies seen edge-on, synchrotron
emission reveals X-shaped halo magnetic fields
\citep[e.g.,][]{Golla_hummel_1994,Tullmann2000,Krause2006,stein2019,krause2020}.
Although the three-dimensional morphology of these fields is unknown,
the X-shaped signature can be reproduced by dynamo models that include
an outflow \citep{BDMSST93,Elstner+95}.
The resulting magnetic fields have a quadrupole symmetry both in the
disk and the halo.
An alternative would be a dynamo in the halo itself, which could produce
dominant dipole modes \citep{BDMSST92,Moss_sokoloff_2008}.


The synchrotron intensity gives an indication about the magnetic field
strength.
It is proportional to the product of the density of relativistic cosmic
ray electrons and a power close to 2 of the local magnetic field component
perpendicular to the line of sight.
However, the relativistic cosmic ray electron density may itself depend
on the local magnetic energy density, because cosmic rays and magnetic
fields have supernova explosions as a common source of energy.
These arguments have been reviewed by \cite{Seta+Beck19}, who also
compare with numerical simulations of cosmic ray confinement by a local
dynamo-generated magnetic field, similar to what was done earlier by
\cite{Snodin+06}.
\cite{Seta+Beck19} conclude that the commonly made assumption of an
equipartition between cosmic ray and magnetic energy densities is not
valid on scales smaller than at least $100\pc$.
They argue that earlier estimates based on the equipartition assumption
may have overestimated the actual magnetic field by a factor of about 1.5.

An interesting comparison between radio synchrotron and dust polarization
in emission can be found in \citet{Borlaff2021} for the M51 galaxy.
They find that the magnetic pitch angles of the two tracers differ, with
the dust polarization showing a more tightly wound spiral than the radio.
In light of this and forthcoming comparisons, predictions from dynamo
models should take into account the multi-phase nature of the ISM.

\subsection{$E$ and $B$ polarizations}

The linear polarization described by Stokes $Q$ and $U$ can also
be expressed in terms of the rotationally invariant parity-even $E$
polarization and the parity-odd $B$ polarization, as is commonly done
in cosmology \citep{Seljak+97,Kamionkowski+97}.
Here, the symbols $E$ and $B$ have nothing to do with electric and
magnetic fields, except that both can qualitatively be described by as
gradient-like and curl-like fields.
It is important to stress, however, that $E$ and $B$ are only defined
on a two-dimensional surface.
Therefore, the parity-odd $B$ polarization has no immediate correspondence
with the helicity of the underlying magnetic field.

Mathematically, $E$ and $B$ are obtained as the real and imaginary parts of
a quantity $R(\theta,\phi)$ with
\begin{equation}
R\equiv E+\ii B=\sum_{\ell=2}^{N_\ell}\sum_{m=-\ell}^{\ell}
\tilde{R}_{\ell m} Y_{\ell m}(\theta,\phi).
\end{equation}
and $\tilde{R}_{\ell m}$ are coefficients that have been computed as
\begin{equation}
\tilde{R}_{\ell m}=\int_{4\pi}
(Q+\ii U)\,_2 Y_{\ell m}^\ast(\theta,\phi)\,
\sin\theta\,\dd\theta\,\dd\phi,
\label{EBfromQU}
\end{equation}
with $_2 Y_{\ell m}(\theta,\phi)$ being the spin-2 spherical harmonics
and the asterisk denoting the complex conjugate.

\begin{figure}[t]
\begin{center}
\includegraphics[width=\textwidth]{RfromP_shift_last}
\end{center}
\caption{Left: Galactic $B$ mode polarization.
Right: longitudinally averaged $B$ mode polarization.
Here, $\theta$ and $\phi$ are Galactic colatitude
($=90\degr-\mbox{latitude}$) and longitude.
}\label{RfromP_shift_last}
\end{figure}

\cite{BB20b} found that the $B$ polarization averaged over Galactic
longitude is very small owing to longitudinal cancelation, but there is
a small hemispheric antisymmetry.
This is shown in \Fig{RfromP_shift_last}, where we plot the
Galactic $B$ mode polarization together with the
longitudinally averaged $B$ mode polarization.
It may be tempting to associate this hemispheric dependence with that
anticipated for the $\alpha$ effect, which is also a parity-odd quality
with hemispheric same change.
However, it turned out that the observed hemispheric antisymmetry
is actually explained by the spiral nature of the magnetic field.
Looking toward northern and southern galactic latitudes yields
mirror images of each other, which explains the observed hemispheric
antisymmetry of the mean $B$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{TURBULENCE SIMULATIONS OF GALACTIC DYNAMOS}

\subsection{Physical parameters of the ISM}

The interstellar gas can be found in various phases, characterized by different temperatures, densities, and degrees of ionization.
The neutral, atomic gas is found in a cold ($50\K<T<100\K$) and a warm
($10^3\K<T<10^4\K$) phase, usually referred to as the cold and warm
neutral media (CNM and WNM).
The ionized gas is also found in a hot ($T\simeq10^6\K$) and a warm
($T\simeq10^4\K$) phase (HIM and WIM, respectively).
Finally, the densest and coldest ($10\K<T<20\K$) gas is mostly
molecular (MM), with a very low ionization fraction.

Dynamos can easily be excited in the interstellar medium, since
all phases (apart from the MM) are characterized by large values of
$\Rey$, $\Rm$, and $\Pm$, although these vary greatly between phases;
see \Tab{Tinterstellar}, with order-of-magnitude values taken from
\citet{Ferriere2020} and \citet{Draine_2011}.
This vast range of parameters also poses a challenge for accurately
modeling interstellar turbulence.

\begin{table}
\tabcolsep7.5pt
\caption{
Parameters of the interstellar medium. 
}
\label{Tinterstellar}
\begin{center}
\begin{tabular}{@{}c|c|c|c@{}}
\hline
Phase & $\Rey$ & $\Rey_m$ & $P_m$ \\
\hline
HIM & $10^2$    & $10^{23}$ & $10^{21}$ \\
WIM & $10^7$    & $10^{19}$ & $10^{11}$ \\
WIM & $10^7$    & $10^{18}$ & $10^{11}$ \\
CNM & $10^{10}$ & $10^{11}$ & $10^{4}$  \\
WNM & $10^7$    & $10^{18}$ & $10^{11}$ \\
MM  & $10^7$    & $10^4$    & $10^{5}$  \\
\hline
\end{tabular}
\end{center}
\end{table}

Most of the numerical work on ISM turbulent dynamos so far has been
isothermal \citep[e.g.,][]{Scheko+04,Seta+2020}.
In an interesting extension, \citet{Seta+Federrath22} modelled a
small-scale dynamo in driven turbulence simulations of a two-phase ISM
and identified the processes responsible for vorticity generation in
each phase.
They found that the magnetic to turbulent kinetic energy ratio is lower
in the cold phase.
This will be discussed in more detail further below.

\subsection{Numerical approaches}
\label{NumericalApproaches}

Including magnetic fields in simulations of astrophysical systems is a
non-trivial task because the chosen discretization must obey the zero
divergence constraint.
In Eulerian codes, a commonly used approach is the Constrained Transport
(CT) scheme \citep{Evans_Hawley1988}, which ensures $\nabla\cdot\BB=0$
by defining the magnetic field components on cell faces.
However, no similar scheme is applicable to Lagrangian codes such
as Smoothed Particle Hydrodynamics (SPH), which 
rely on
divergence-cleaning algorithms
\citep[e.g.,][]{Brackbill_Barnes_1980,Powell1999,dedner_2002}.

\begin{table}
\tabcolsep7.5pt
\caption{
Overview of the numerical codes mentioned in this review.
}
\label{Tcodes}
\begin{center}
\begin{threeparttable}
\begin{tabular}{@{}l|l|l@{}}
\hline

Code name & Approach & Other properties \\
\hline
AREPO\tnote{1} & $\nab\cdot\BB$-clean & 
\begin{tabular}{@{}l@{}}
Finite volume \\ Unstructured moving mesh 
\end{tabular} \\
\hline
ENZO\tnote{2}  & CT or $\nab\cdot\BB$-clean & 
\begin{tabular}{@{}l@{}}
AMR, Riemann, \\ split and unsplit schemes 
\end{tabular}\\
\hline
FLASH\tnote{3} & CT or $\nab\cdot\BB$-clean & 
\begin{tabular}{@{}l@{}}
AMR, Riemann, \\ split and unsplit schemes 
\end{tabular} \\
\hline
Gadget\tnote{4} & $\nab\cdot\BB$-clean & SPH \\
\hline
Nirvana\tnote{5} & CT & AMR, Godunov (Riemann) \\
\hline
{\sc Pencil Code}\tnote{6} & $\BB=\nab\times\AAA$ & centered finite diff., sixth order \\
\hline
RAMSES \tnote{7} & CT & AMR, Godunov (Riemann) \\
\hline
\end{tabular}
\begin{tablenotes}
\footnotesize
    \item[1] \citet{Pakmor2017,vdv2021,Whittingham2021}
    \item[2] \citet{Vazza2017}, \cite{Mtchedlidze+22}
    \item[3] \citet{Sur+10,Federrath+11b,Sur+12}
    \item[4] \citet{Steinwandel2019}
    \item[5] \citet{Gressel2008}
    \item[6] \citet{Bra01,Bra05,Bra10,Bran+10,Bra17,Bra19,Bran_etal17,BB20,Gent2021,BN22}
    \item[7] \citet{Rieder_Teyssier_2016,Rieder_Teyssier_2017a,Rieder_Teyssier_2017b,Ntormousi+20}
  \end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}

\begin{figure}
    \centering
    \includegraphics[width=\textwidth]{fig/balsara_kim_divclean} 
    \caption{Figure~2 from \citet{Balsara_Kim_2004}, where different
    divergence-cleaning algorithms:
    (a) Scalar divergence cleaning scheme from \citet{Kim1999};
    (b) scalar divergence cleaning scheme from \citet{Balsara_1998};
    (c) vector divergence cleaning scheme from \citet{Balsara_1998}
were compared to a divergence-conserving scheme, (d).}
\label{balsara_divclean}
\end{figure}

\begin{figure}
    \centering
    \includegraphics[width=\textwidth]{fig/moczetal.jpeg}
    \caption{Figure~7 from \citet{Mocz2016}, where the same disk is evolved with CT and a Powell-like divergence cleaning scheme. The winding pattern of the magnetic field is better captured with CT, while an artifact is formed at the center with divergence cleaning.}
\label{divclean_mocz}
\end{figure}

Lagrangian codes are particularly well-suited for MHD modeling of galaxies and
cosmological volumes due to the natural adaptation of the resolution to
areas of interest.
They are also naturally Galilean-invariant.
However, their dependence on divergence cleaning poses a significant
drawback when modeling astrophysical dynamos.
This was clearly demonstrated by
\citet{Mocz2016}, who compared CT and divergence cleaning
approaches, both implemented on the moving-mesh code AREPO.
They found that divergence cleaning systematically creates artifacts
that mimic physical effects. Some of these artifacts are illustrated
in \Figs{balsara_divclean}{divclean_mocz}.

Out of these effects, particularly notorious for dynamo studies
is an artificial increase of the magnetic energy when using scalar
divergence-cleaning schemes, as pointed out by \citet{Balsara_Kim_2004}
for supernova-driven turbulence.
Another very relevant example of an artifact caused by divergence cleaning
is the spontaneous production of magnetic helicity, which has been found
by \cite{BS2020}, who compared simulations that employed a divergence
cleaning algorithm with one that advances instead the magnetic vector
potential, $\AAA$, so that $\BB=\nab\times\AAA$ is always divergence-free.
They found that, for a helically driven flow in a periodic domain,
spurious net magnetic helicity is generated on dynamical time scales.
An interesting experiment by \citet{Tricco_2016} compared an SPH code
to the FLASH grid code, both using divergence cleaning, in simulations
of turbulent dynamos.
They found very good agreement between the codes, both in the growth
rates and the saturation level of the dynamo.

Yet another method of dealing with the $\nab\cdot\BB=0$ constraint is
to employ the Euler or Clebsch potentials.
However, this method only works in the strictly ideal case
when the microphysical magnetic diffusivity vanishes; see
\Sec{NeedMagneticDiffusivity}.
As we have stressed above, even the addition of an almost negligibly
small diffusivity in the evolution equations for the Euler potentials
does not correspond to any physical magnetic diffusivity and leads to
wrong results where no dynamo is possible -- even for flows that are
known to be either fast or slow dynamos \citep{B2010}.

\Tab{Tcodes} outlines some characteristics of the codes mentioned
in this review.
Next to each code we have mentioned the works cited in this review that use it.
The fact that many of them have to rely on divergence cleaning methods
is evidence of the difficulty in dealing with the divergence problem,
but also a sign to use caution when interpreting the results in the
context of dynamo action.

\subsection{Local dynamo simulations of galaxy portions}

Simulating the magnetic field evolution over an entire galactic disk is
another challenging task, due to the vast range of dynamical scales of
the problem and the large shearing velocities involved.
One approach to this challenge that can successfully capture many aspects
of the problem is simulating galaxy portions.
The local approach has been rather successful in the context of accretion
disks, where simulations have been performed in what is known as
shearing boxes.
This means that the radial boundary is ``shearing-periodic'', i.e., it
is periodic with respect to an azimuthal position that shifts in time
following the background shear flow.

Using a shearing box, \citet{Gressel2008} performed the first
simulation of a galactic dynamo, including supernova-induced turbulence.
It was similar to earlier multiphase simulations of supernova-driven
turbulence of \cite{Korpi+99}, where the magnetic Reynolds number was
still too low to permit dynamo action.
\cite{Gressel2008} found that the rotation frequency of the considered
galaxy portion is the dominant factor in determining the dynamo
efficiency, while the supernova rate did not significantly affect the
efficiency of the dynamo.
This finding suggests that the simulations were able to capture
large-scale dynamo action, but not the small-scale dynamo.
Using the {\sc Pencil Code} and a similar setup, \citet{Gent2013}
showed that the mean and fluctuating fields have different growth rates,
indicating a co-existence of small- and large-scale dynamos.
Theoretically, however, the possibility of large-scale and small-scale
dynamos having different growth rates in one and the same system is not
well understood \citep{SB14}.

Recently, \citet{Gent2021} sought to derive criteria for the appearance of
a small-scale dynamo in simulations of interstellar turbulence.
By not employing a shearing-box setup or stratification, they
focused only on the effects of the supernova-driven turbulence.
They confirm that a small-scale dynamo is easily excited by ISM
turbulence at sufficiently high resolution and magnetic Reynolds number.

\cite{Seta+Federrath22} have shown that the multiphase aspect of the
ISM tends to have a detrimental effect on the small-scale dynamo.
This is mostly because of the stronger Lorentz force in the
cold regions.
Their simulations show that with solenoidal forcing, the magnetic
field is mostly decoupled from the density behavior; see 
\Fig{fig:Seta+Federrath22}.
Simple Compression along magnetic field lines ($\rho^{0}$),
perpendicular to to magnetic field lines ($b \propto \rho^{1/2}$
for cylindrical/filamentary geometry and $b \propto \rho^{1}$ for disc-like/slab geometry),
and spherical compression ($b \propto \rho^{2/3}$) hardly occur.
One might argue, however, that in the compressive case, the cold phase
shows a higher slope than the warm phase.

\begin{figure}
\includegraphics[width=\textwidth]{fig/rhob_sol_comp_combined.jpeg}
\caption{
2D PDFs of magnetic field and density for (a) solenoidal and (b) compressive forcing.
The dashed black lines show various $b$--$\rho$ relations for simple gas compressions.
Especially the solenoidal shows very little similarity with any of the simple relations.
}\label{fig:Seta+Federrath22}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\subsection{Global isolated galaxy simulations}

The increasing efficiency and complexity of numerical codes and the
availability of resources have led to a number of works studying the
magnetic field evolution in global galaxy models.
In contrast to the shearing-box approach, such models more naturally allow
for the study of the large-scale dynamo.
However, the limited resolution is still problematic for simultaneously
capturing the small-scale dynamo, as outlined above.

\citet{Wang_Abel_2009} performed disk galaxy simulations including $\nG$
ordered seeds with a code similar to Enzo, using \citet{dedner_2002}
divergence-cleaning.
They found that the tiny seed was amplified to $\mu$G levels over 500~Myr.
They also noticed that the magnetic field in the cold gas saturates first.
Their setup did not include stellar feedback, so the amplification
process was driven by differential rotation only.

In a series of papers, \citet{Rieder_Teyssier_2016, Rieder_Teyssier_2017a,
Rieder_Teyssier_2017b} performed multi-component simulations of the
magnetic field evolution in dwarf and Milky-Way-like galaxies using the
RAMSES code and including supernova feedback.
Their setup includes dark matter and stars as collisionless particles,
coupled to an Adaptive Mesh Refinement (AMR) grid on which the MHD
equations are solved.
In the first paper of the series, the authors found signatures of
\begin{marginnote}
\entry{(Stellar) Feedback}{The energy and momentum deposited to the ISM by stars through radiation, winds, and supernova explosions.}
\end{marginnote}
small-scale dynamo amplification during intense feedback epochs, followed
by a large-scale dynamo at later, more quiescent evolution times.
In the second paper, they examined the saturation of the dynamo, which
occurs at only a small fraction of the turbulent kinetic energy.
They observed that, if the feedback efficiency is artificially lowered
after saturation, the turbulence decays and the galaxy settles in a thin
disk with an equipartition field.
Finally, in \citet{Rieder_Teyssier_2017b} they studied the magnetic
field evolution in a cosmological context.

Using a similar setup and separating the mean from the fluctuating
component using a median filter, \citet{EN2020} found large-scale
dynamo action in a model of a massive spiral.
However, their result was insensitive to the inclusion of supernova
feedback. 
Since supernova feedback is considered an important driver of small-scale
turbulence, this could mean that a small-scale dynamo was never captured
in their models.

This result is consistent with the \citet{Rieder_Teyssier_2016} results
for the quiescent phase of galaxy evolution.
However, as shown by \cite{Gent2021}, the limited resolution of the
simulation could be preventing the formation of a small-scale dynamo
action in this quiescent phase.

\citet{Pakmor2017} performed a suite of zoom-in cosmological
simulations that includes 30 galaxies using the AREPO code 
(called the Auriga simulations).
Similarly to \citet{Rieder_Teyssier_2017b}, they reported an early
exponential growth of the magnetic field, saturating at redshift $z\simeq2-3$
at a few percent of the turbulent kinetic energy.
\citet{Steinwandel2019} also claimed significant small-scale dynamo
action in isolated galaxy models using an MHD version of the Gadget code.
However, these simulations rely on the divergence-cleaning scheme that could
suffer from the problems summarized in \Sec{NumericalApproaches}.

A very different approach was adopted by \citet{Rodriguesetal2019},
who modeled galactic magnetic fields by post-processing cosmological
simulation data.
Specifically, they inserted galaxy parameters such as shear rate and
turbulence into a parameter-fitting package that returns a suitable
dynamo solution \citep{Shukurov2019}.
Although this approach cannot capture the back-reaction of the magnetic
field on the gas, it can give estimates on the cosmological conditions
that favor mean-field dynamo action, which the authors find sets in
around redshift $z<3$.

While each numerical approach presents certain limitations, the tentative
picture painted by global numerical simulations is that the small-scale
and large-scale dynamos co-exist during galaxy evolution.
Taking into account the large-scale gravitational collapse of the halo,
as well as internal galactic processes such as star formation, appears
to be fundamental for reconstructing the observed magnetic field evolution.

\section{INTERACTION WITH THE CGM}

It was already suggested in the previous sections that the galactic
environment must play an important role in the behavior of the dynamo,
because it defines the boundary conditions for its operation.
The immediate environment of a galaxy is 
its halo, which contains large amounts of diffuse gas, and is usually referred
to as the CGM. 

The CGM is a powerful probe of galaxy evolution processes, because it
contains traces of the cold ($T<10^5\K$) and hot ($T>10^5\K$) galactic
inflows, as well as the hot ($T\simeq10^6\K$), metal-enriched outflows
from feedback events \citep{Putman2012}.

The CGM also contains colder gas ($T<10^4\K$) that can co-exist with
these hotter phases for long periods of time.
This observation has led to theories involving magnetic fields and
cosmic rays in the dynamics of the CGM.

This cold gas was studied in the context of cosmological simulations by
\citet{Nelson2020}, who found small-scale cool ($T<10^4$ K) structures
in massive ($M\simeq10^{13}-10^{13.5}M_\odot$) galaxy haloes.
In these simulations, the cloudlets are created by thermal instability,
seeded by tidally stripped gas from in-falling haloes.
In many cases, these structures are dominated by magnetic pressure.
However, it is not clear whether these properties would persist at
higher resolution.
In spite of the dominant magnetic pressure, an otherwise identical
simulation of a massive halo with the magnetic field set to zero
showed essentially no change in the distribution and morphology of
these cloudlets.

\subsection{Magnetization of the galaxy by inflows}

The classical picture of gas accretion onto a galaxy halo predicts that the gas
should shock and heat up to high temperatures
\citep[e.g.][]{White_rees1978}.
However, cosmological simulations of galaxy formation
\citep[e.g.,][]{dekel2009} showed that a high fraction of the in-flowing
gas in high-redshift galaxies and present-day dwarfs is organized in cool
($T\simeq10^5\K$) streams.

RM observations suggest that this gas carries a $nG$-level magnetic
field \citep[e.g.,][]{Caretti2022}.
These estimates are compatible with the predictions of cosmological
magnetic field evolution models, which predict detectable intergalactic
magnetic fields from the evolution of primordial seeds \citep[e.g.,][--see
also \Sec{sec:cosmosims}]{vazza2015,Vazza2017}.
Then a primordial galaxy might receive a strong seed for its own
magnetic field.
However, at the time of this review, the possible effect of magnetized
inflowing gas on the galactic dynamo remains unexplored.
As we have seen in \Sec{sec:mean-field_models}, some models invoke a
large-scale dynamo in galactic halos to explain the observed X-shaped
magnetic fields therein.
If there is really large-scale dynamo action in the halo, it may be
predominantly of dipolar parity \citep{SS90}.
This can lead to an interaction and competition with the quadrupolar
magnetic field in the disk.
\cite{BDMSST92} found that, during certain time intervals, the RM
of these models shows a doubly peaked azimuthal variation,
which could be falsely interpreted as an indication of a bisymmetric
field structure.
The galactic halo may also act as a buffer for the dynamo in the disk
to dispose of excess magnetic helicity.

Galaxy mergers are a particular form of inflow, which can influence the
entire structure of the galaxy.
As the galaxies approach each other, their star formation rate is enhanced
and shocks form in their interstellar media.
Both shocks and small-scale flows associated with feedback from young stars
can strongly amplify the magnetic field.
This highly non-linear type of interaction requires numerical modeling.

Most numerical models of galaxy mergers with magnetization so far were
done using Lagrangian codes, which have an obvious advantage in adapting their resolution in this setup.
The first numerical simulation of a galaxy merger with magnetic fields was
performed by \citet{Kotarba2010}, who modeled the Antennae using an MHD
version of the Gadget code that subtracts the Lorenz force associated
with magnetic divergence.
They confirmed the expected amplification of the magnetic field during
the galaxy encounters.
However, the amplification was also accompanied by a surge in numerical
magnetic divergence.
The subsequent cosmological merger models of \citet{Beck+2012} suffered
from the same issue.
\citet{Whittingham2021} showed more sophisticated merger models,
modeled in a cosmological context using the AREPO code.
They found a significant impact of the magnetic field on the morphology
of the remnant galaxy.
Specifically, a comparison between MHD and hydro models showed the
presence of extended disks and spiral structure in the magnetized mergers,
as opposed to compact remnants with a ring morphology in unmagnetized
mergers. 
The right panel of \Fig{fig:magnetized_outflow}, taken from their
work, shows the evolution of the galaxy post-merger.

\begin{figure}
\includegraphics[width=\linewidth]{fig/auriga_cgm_mergers_combined.jpeg}
\caption{
Left: Figure~2 from \citet{vdv2021}, showing a magnetized galactic outflow.
The figure includes a slice through the middle of the central galaxy in
magnetic field strength (top) and plasma $\beta$ (bottom).
Right: Adapted Figure~3 from \citet{Whittingham2021}, showing a galaxy
re-arranging after a merger event.
The top two rows show density and the bottom two magnetic field strength.
Both sets of simulations are part of the Auriga project \citep{grand2017}.
}\label{fig:magnetized_outflow}
\end{figure}

One exception to the Lagrangian models is the work of
\citet{Rodenbeck2016}, who performed a grid simulation of
a galaxy merger, using a simplified model without stellar
feedback or a collisionless component.
They found that the enhancement of the magnetic field is
particularly pronounced in the central regions of the galaxy.

\subsection{Magnetization of the CGM by outflows}

Galactic outflows are fundamental in any theory of galaxy evolution.
In starburst and dwarf galaxies they are powered by stellar feedback
\citep[e.g.,][]{Zhang2018}, while a few galaxies host AGN-powered winds
\citep{Fabian2012,Kormendy_Ho2013,Martin1998,Veilleux2005}.
Recent work has indicated that, in some cases, galactic winds can be
driven by cosmic ray (CR) pressure \citep{Hanasz2013,girichidis2016}.
The material carried by these outflows can magnetize the CGM.

In a recent study, \citet{vdv2021} performed direct galaxy evolution simulations
while resolving the magnetized CGM, as part of the Auriga project.
They found that, while the CGM remained a high-beta plasma, magnetic fields
can noticeably change its structure around galaxies, indirectly affecting
numerous galactic processes (see left panel of \Fig{fig:magnetized_outflow}).
For instance, galactic outflows become more collimated, resulting in
less efficient mixing between enriched and un-enriched gas.
Outflow speeds are also reduced in the presence of magnetization,
which means that more metals remain in the halo with respect to the
un-magnetized situation.
The overall structure of the CGM is smoother, due to the additional
magnetic pressure.

\citet{Aramburo-Garcia2021} studied the magnetization of haloes by AGN
and SN-driven outflows in the Illustris-TNG simulations.
They found that both types of outflows contributed to the creation
of over-magnetized bubbles, with the AGN-driven bubbles playing the
dominant role.

\subsection{The impact of the environment on the galactic dynamo}

The interaction of the galaxy with the CGM can have a crucial impact
on the development of a dynamo.
The loss of helicity flux through a galactic wind or fountain can
help avoid catastrophic quenching and sustain a dynamo for longer
(see \Sec{sec:helicityflux}), eventually reaching higher values of
the saturated field.
However, winds can also interfere with the dynamo itself if they are
acting within the dynamo-active region.
On the other hand, a strong magnetic field can suppress the galactic
outflow.

Whether we are considering inflows, outflows, or a galactic fountain, the
galaxy is always embedded in a current system that will have an impact on
the evolution of the dynamo.
This is a non-trivial complication of the effective boundary conditions
because the level of magnetization of the inflowing or outflowing gas
is unknown, and the extent of these flows can be much larger than the
virial radius of the galaxy.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{CONCLUSIONS}

After 70 years of inquiry into the possibility of dynamos in galaxies,
several important questions can now be answered.
First of all, in virtually all astrophysical settings, there is turbulence
and this turbulence is always magnetized because of small-scale dynamo
action.
Dynamos also work in decaying and otherwise nonstationary turbulence
and can produce equipartition-strength magnetic fields exponentially on
a turbulent turnover time scale.
This realization makes the question of {\em cosmological} seed magnetic fields
for galaxies and galaxy clusters almost obsolete, because it would always
be overpowered by small-scale dynamos that can operate very rapidly when
the scales are sufficiently small.
While primordial magnetic fields may still be present and interesting in
their own rights, the simple idea of them being wound up to explain the
bisymmetric spiral of nonaxisymmetric magnetic fields in some galaxies
is essentially ruled out.

While global numerical simulations are now beginning to show
the production of magnetic fields in galaxies, there remains a big
uncertainty regarding the question of what actually produces
large-scale dynamo action.
Is it really the $\alpha$ effect or some other mechanisms at play?
In this review, we have outlined several known mechanisms that could
produce large-scale magnetic fields, but this question remains a major
research topic in the years to come.
One reason behind this is that the problem of
catastrophic quenching is still not fully resolved.
Low resolution simulations of relatively diffusive dynamos may have been
promising in terms of field strength and structure, but have so far not
survived the test of higher resolution.
It will remain important to continue investigating this.
At the same time, it is important to open ones mind and think about
dynamos beyond just the immediate proximity of a galaxy.
The interaction with the CGM may be of crucial importance, and not all
of the different processes, which are important, may qualify as a dynamo.

\begin{summary}[SUMMARY POINTS]
\begin{enumerate}
\item Small-scale dynamos work in all turbulent astrophysical environments.
\item Simulations suggest that the efficiency of large-scale dynamos decreases with increasing resolution.
\item The relevance of an $\alpha$ effect dynamo in galaxies remains unclear.
\item Modern numerical simulations of galactic magnetic fields tend to take the past evolution of and the interaction with the environment into account.
\end{enumerate}
\end{summary}

\begin{issues}[FUTURE ISSUES]
\begin{enumerate}
\item
The problem of catastrophic quenching remains relevant and will need to
be addressed in high-resolution models with realistic boundary conditions.
\item
Numerical codes of galaxy evolution should take special care of the
accurate treatment of magnetic fields, especially on the solenoidality
constraint, a problem that is accentuated through the sub-grid modeling
of star formation and feedback.
\item The next generation of numerical models should make an effort to identify observables related to the galactic dynamo that go beyond the BSS/ASS signature in the RM of galaxies.
\item Future numerical models will have to quantify the importance of dynamo action in different stages of a galaxy's evolution. 
\end{enumerate}
\end{issues}

\section*{DISCLOSURE STATEMENT}

The authors are not aware of any affiliations, memberships, funding, or
financial holdings that might be perceived as affecting the objectivity
of this review.

\section*{ACKNOWLEDGMENTS}

We acknowledge support for the Nordita program on ``Magnetic field
evolution in low density or strongly stratified plasmas'' in May 2022,
when part of this work was done.
EN also acknowledges Interstellar Institute's program "With Two Eyes"
and the Paris-Saclay University's Institut Pascal for hosting fruitful
discussions that nourished some ideas included in this work.
We acknowledge very useful discussions with Fabio Del Sordo, Frederick Gent, Sergio Martin-Alvarez, and Jennifer West.
EN acknowledges funding from the ERC Grant ”Interstellar” (Grant agreement 740120) and the Hellenic Foundation for Research and Innovation (Project number 224). 
This work was supported by the Swedish Research Council
(Vetenskapsr{\aa}det, 2019-04234).
Nordita is sponsored by Nordforsk.
We acknowledge the allocation of computing resources provided by the
Swedish National Allocations Committee at the Center for Parallel
Computers at the Royal Institute of Technology in Stockholm and
Link\"oping.

\bibliography{ref}{}
\bibliographystyle{ar-style2}
\end{document}
