Excellent reviews on the subject are those by Subramanian (2010, 2016):
One often thinks that magnetic field generation involves charge separation, but this is mostly not true. An exception are battery mechanisms such as the Biermann battery. (The term battery refers to a growth that is linear in time, as opposed to an exponential growth, for example.) The following handout discusses this in more detail.
As Ratra mechanism, one
Brandenburg, A., & Protiti, N. N.: 2023, “Electromagnetic conversion into kinetic and thermal energies,” Entropy 25, 1270
(arXiv:2308.00662, ADS, DOI, HTML, PDF)
Brandenburg, A., & Protiti, N. N.: 2023, Datasets for “Electromagnetic conversion into kinetic and thermal energies” v2023.08.01. Zenodo, DOI:10.5281/zenodo.8203242
(HTML, DOI)
The Klein-Gordon equation governs the evolution of scalar or pseudoscalar fields. The cosine potential plays a special role for axion inflation. This form of the potential make the equation nonlinear and can lead to very interesting solutions in their own right. To check how the code solves such cases, we begin with a 1+1 dimensional example, the
Try an run the code with slightly modified parameters. An experiment of general interest is to run the code with lower or higher time discretization that the standard 6th order one.
Iarygina, O., Sfakianakis, E. I., & Brandenburg, A.: 2025, “Schwinger effect in axion inflation on a lattice,” Phys. Rev. Lett., submitted
(arXiv:2506.20538, ADS, HTML, PDF)
Iarygina, O., Sfakianakis, E. I., & Brandenburg, A.: 2025, Datasets for “Schwinger effect in axion inflation on a lattice” v2025.06.24.
(HTML).
Roper Pol, A., Brandenburg, A., Kahniashvili, T., Kosowsky, A., & Mandal, S.: 2020, “The timestep constraint in solving the gravitational wave equations sourced by hydromagnetic turbulence,” Geophys. Astrophys. Fluid Dyn. 114, 130–161 (arXiv:1807.05479, ADS, HTML, DOI, PDF)
Brandenburg, A., Neronov, A., & Vazza, F.: 2024, “Resistively controlled primordial magnetic turbulence decay,” Astron. Astrophys. 687, A186 (arXiv:2401.08569, ADS, DOI, HTML, PDF, ad)
Dynamos generally convert kinetic energy into magnetic energy. This is possible through the dynamo instability, which refers to an instability of the zero magnetic field state (B=0). It is clear that this requires the existence of a seed magnetic field, but the existence of a perturbation (here of the B=0 state) is true of any instability.
Brandenburg, A., & Subramanian, K.: 2005, “Astrophysical magnetic fields and nonlinear dynamo theory,” Phys. Rep. 417, 1–209 (astro-ph/0405052, ADS, DOI, PDF)
Rheinhardt, M., Devlen, E., Rädler, K.-H., & Brandenburg, A.: 2014, “Mean-field dynamo action from delayed transport,” Mon. Not. Roy. Astron. Soc. 441, 116–126 (arXiv:1401.5026, ADS, DOI, PDF)
Shchutskyi, N., Schaller, M., Karapiperis, O. A., Stasyszyn, F. A., & Brandenburg, A.: 2025, “Kinematic dynamos and resolution limits for Smoothed Particle Magnetohydrodynamics,” Mon. Not. Roy. Astron. Soc. 541, 3427–3444 (arXiv:2505.13305, ADS, DOI, HTML, PDF)
The Pencil Code (Pencil Code Collaboration 2021) is constantly developing since it started. The organic growth is reflected in the style of the manual (link below), where new things are constantly being added, but old things are hardly deleted. It is important to watch the autotests (link below) to make sure nothing bad has happened.
Pencil Code Collaboration: Brandenburg, A., Johansen, A., Bourdin, P. A., Dobler, W., Lyra, W., Rheinhardt, M., Bingert, S., Haugen, N. E. L., Mee, A., Gent, F., Babkovskaia, N., Yang, C.-C., Heinemann, T., Dintrans, B., Mitra, D., Candelaresi, S., Warnecke, J., Käpylä, P. J., Schreiber, A., Chatterjee, P., Käpylä, M. J., Li, X.-Y., Krüger, J., Aarnes, J. R., Sarson, G. R., Oishi, J. S., Schober, J., Plasson, R., Sandin, C., Karchniwy, E., Rodrigues, L. F. S., Hubbard, A., Guerrero, G., Snodin, A., Losada, I. R., Pekkilä, J., & Qian, C.: 2021, “The Pencil Code, a modular MPI code for partial differential equations and particles: multipurpose and multiuser-maintained,” J. Open Source Softw. 6, 2807 (arXiv:2009.08231, ADS, DOI, HTML, PDF)