-
Compressible test-field method and its application to shear dynamos
Authors:
Maarit J. Käpylä,
Matthias Rheinhardt,
Axel Brandenburg
Abstract:
In this study we present a compressible test-field method (CTFM) for computing $α$ effect and turbulent magnetic diffusivity tensors, as well as those relevant for mean ponderomotive force and mass source, applied to the full MHD equations. We describe the theoretical background of the method, and compare it to the quasi-kinematic test-field method, and to the previously studied variant working in…
▽ More
In this study we present a compressible test-field method (CTFM) for computing $α$ effect and turbulent magnetic diffusivity tensors, as well as those relevant for mean ponderomotive force and mass source, applied to the full MHD equations. We describe the theoretical background of the method, and compare it to the quasi-kinematic test-field method, and to the previously studied variant working in simplified MHD (SMHD). We present several test cases using velocity and magnetic fields of the Roberts geometry, and also compare with the imposed-field method. We show that, for moderate imposed field strengths, the nonlinear CTFM (nCTFM) gives results in agreement with the imposed-field method. Comparison of different flavors of the nCTFM in the shear dynamo case also agree up to equipartition field strengths. Some deviations between the CTFM and SMHD variants exist. As a relevant physical application, we study non-helically forced shear flows, which exhibit large-scale dynamo action, and present a re-analysis of low Reynolds number, moderate shear systems, where we previously neglected the pressure gradient in the momentum equation, and found no coherent shear-current effect. Another key difference is that in the earlier study we used magnetic forcing to mimic small-scale dynamo action, while here it is self-consistently driven by purely kinetic forcing. The kinematic CTFM with general validity forms the core of our analysis. We still find no coherent shear-current effect, but do recover strong large-scale dynamo action that, according to our analysis, is driven through the incoherent effects.
△ Less
Submitted 3 February, 2022; v1 submitted 2 June, 2021;
originally announced June 2021.
-
Investigating global convective dynamos with mean-field models: full spectrum of turbulent effects required
Authors:
Jörn Warnecke,
Matthias Rheinhardt,
Mariangela Viviani,
Frederick Gent,
Simo Tuomisto,
Maarit J. Käpylä
Abstract:
The role of turbulent effects for dynamos in the Sun and stars continues to be debated. Mean-field (MF) theory provides a broadly used framework to connect these effects to fundamental magnetohydrodynamics. While inaccessible observationally, turbulent effects can be directly studied using global convective dynamo (GCD) simulations. We measure the turbulent effects in terms of turbulent transport…
▽ More
The role of turbulent effects for dynamos in the Sun and stars continues to be debated. Mean-field (MF) theory provides a broadly used framework to connect these effects to fundamental magnetohydrodynamics. While inaccessible observationally, turbulent effects can be directly studied using global convective dynamo (GCD) simulations. We measure the turbulent effects in terms of turbulent transport coefficients, based on the MF framework, from an exemplary GCD simulation using the test-field method. These coefficients are then used as an input into an MF model. We find a good agreement between the MF and GCD solutions, which validates our theoretical approach. This agreement requires all turbulent effects to be included, even those which have been regarded as unimportant so far. Our results suggest that simple dynamo models, as are commonly used in the solar and stellar community, relying on very few, precisely fine-tuned turbulent effects, may not be representative of the full dynamics of dynamos in global convective simulations and astronomical objects.
△ Less
Submitted 5 October, 2021; v1 submitted 17 May, 2021;
originally announced May 2021.
-
Modeling the interplay between epidemics and regional socio-economics
Authors:
Jan E. Snellman,
Rafael A. Barrio,
Kimmo K. Kaski,
Maarit J. Käpylä
Abstract:
In this study we present a dynamical agent-based model to investigate the interplay between the socio-economy of and SEIRS-type epidemic spreading over a geographical area, divided to smaller area districts and further to smallest area cells. The model treats the populations of cells and authorities of districts as agents, such that the former can reduce their economic activity and the latter can…
▽ More
In this study we present a dynamical agent-based model to investigate the interplay between the socio-economy of and SEIRS-type epidemic spreading over a geographical area, divided to smaller area districts and further to smallest area cells. The model treats the populations of cells and authorities of districts as agents, such that the former can reduce their economic activity and the latter can recommend economic activity reduction both with the overall goal to slow down the epidemic spreading. The agents make decisions with the aim of attaining as high socio-economic standings as possible relative to other agents of the same type by evaluating their standings based on the local and regional infection rates, compliance to the authorities' regulations, regional drops in economic activity, and efforts to mitigate the spread of epidemic. We find that the willingness of population to comply with authorities' recommendations has the most drastic effect on the epidemic spreading: periodic waves spread almost unimpeded in non-compliant populations, while in compliant ones the spread is minimal with chaotic spreading pattern and significantly lower infection rates. Health and economic concerns of agents turn out to have lesser roles, the former increasing their efforts and the latter decreasing them.
△ Less
Submitted 12 October, 2021; v1 submitted 14 May, 2021;
originally announced May 2021.
-
Scalable communication for high-order stencil computations using CUDA-aware MPI
Authors:
Johannes Pekkilä,
Miikka S. Väisälä,
Maarit J. Käpylä,
Matthias Rheinhardt,
Oskar Lappi
Abstract:
Modern compute nodes in high-performance computing provide a tremendous level of parallelism and processing power. However, as arithmetic performance has been observed to increase at a faster rate relative to memory and network bandwidths, optimizing data movement has become critical for achieving strong scaling in many communication-heavy applications. This performance gap has been further accent…
▽ More
Modern compute nodes in high-performance computing provide a tremendous level of parallelism and processing power. However, as arithmetic performance has been observed to increase at a faster rate relative to memory and network bandwidths, optimizing data movement has become critical for achieving strong scaling in many communication-heavy applications. This performance gap has been further accentuated with the introduction of graphics processing units, which can provide by multiple factors higher throughput in data-parallel tasks than central processing units. In this work, we explore the computational aspects of iterative stencil loops and implement a generic communication scheme using CUDA-aware MPI, which we use to accelerate magnetohydrodynamics simulations based on high-order finite differences and third-order Runge-Kutta integration. We put particular focus on improving intra-node locality of workloads. Our GPU implementation scales strongly from one to $64$ devices at $50\%$--$87\%$ of the expected efficiency based on a theoretical performance model. Compared with a multi-core CPU solver, our implementation exhibits $20$--$60\times$ speedup and $9$--$12\times$ improved energy efficiency in compute-bound benchmarks on $16$ nodes.
△ Less
Submitted 10 May, 2022; v1 submitted 2 March, 2021;
originally announced March 2021.
-
Interaction of large- and small-scale dynamos in isotropic turbulent flows from GPU-accelerated simulations
Authors:
Miikka S. Väisälä,
Johannes Pekkilä,
Maarit J. Käpylä,
Matthias Rheinhardt,
Hsien Shang,
Ruben Krasnopolsky
Abstract:
Magnetohydrodynamical (MHD) dynamos emerge in many different astrophysical situations where turbulence is present, but the interaction between large-scale (LSD) and small-scale dynamos (SSD) is not fully understood. We performed a systematic study of turbulent dynamos driven by isotropic forcing in isothermal MHD with magnetic Prandtl number of unity, focusing on the exponential growth stage. Both…
▽ More
Magnetohydrodynamical (MHD) dynamos emerge in many different astrophysical situations where turbulence is present, but the interaction between large-scale (LSD) and small-scale dynamos (SSD) is not fully understood. We performed a systematic study of turbulent dynamos driven by isotropic forcing in isothermal MHD with magnetic Prandtl number of unity, focusing on the exponential growth stage. Both helical and non-helical forcing was employed to separate the effects of LSD and SSD in a periodic domain. Reynolds numbers (Rm) up to $\approx 250$ were examined and multiple resolutions used for convergence checks. We ran our simulations with the Astaroth code, designed to accelerate 3D stencil computations on graphics processing units (GPUs) and to employ multiple GPUs with peer-to-peer communication. We observed a speedup of $\approx 35$ in single-node performance compared to the widely used multi-CPU MHD solver Pencil Code. We estimated the growth rates both from the averaged magnetic fields and their power spectra. At low Rm, LSD growth dominates, but at high Rm SSD appears to dominate in both helically and non-helically forced cases. Pure SSD growth rates follow a logarithmic scaling as a function of Rm. Probability density functions of the magnetic field from the growth stage exhibit SSD behaviour in helically forced cases even at intermediate Rm. We estimated mean-field turbulence transport coefficients using closures like the second-order correlation approximation (SOCA). They yield growth rates similar to the directly measured ones and provide evidence of $α$ quenching. Our results are consistent with the SSD inhibiting the growth of the LSD at moderate Rm, while the dynamo growth is enhanced at higher Rm.
△ Less
Submitted 16 December, 2020;
originally announced December 2020.
-
Generation of mean flows in rotating anisotropic turbulence: The case of solar near-surface shear layer
Authors:
A. Barekat,
M. J. Käpylä,
P. J. Käpylä,
E. P. Gilson,
H. Ji
Abstract:
The radial gradient of the rotation rate in the near-surface shear layer (NSSL) of the Sun is independent of latitude and radius. Theoretical mean-field models have been successful in explaining this property of the solar NSSL, while global direct convection models have been unsuccessful. We investigate reason for this discrepancy by measuring the mean flows, Reynolds stress, and turbulent transpo…
▽ More
The radial gradient of the rotation rate in the near-surface shear layer (NSSL) of the Sun is independent of latitude and radius. Theoretical mean-field models have been successful in explaining this property of the solar NSSL, while global direct convection models have been unsuccessful. We investigate reason for this discrepancy by measuring the mean flows, Reynolds stress, and turbulent transport coefficients under NSSL conditions. Simulations have minimal ingredients. These ingredients are inhomogeneity due to boundaries, anisotropic turbulence, and rotation. Parameters of the simulations are chosen such they match the weakly rotationally constrained NSSL. The simulations probe locally Cartesian patches of the star at a given depth and latitude. The depth of the patch is varied by changing the rotation rate such that the resulting Coriolis numbers<1. We measure the turbulent transport coefficient relevant for the non-diffusive and diffusive parts of the Reynolds stress and compare them with predictions of current mean-field theories. A negative radial gradient of mean flow similar to the solar NSSL is generated only at the equator where meridional flows are absent. At other latitudes the meridional flow is comparable to the mean flow corresponding to differential rotation. We also find that meridional components of the Reynolds stress cannot be ignored. Additionally, we find that the turbulent viscosity is quenched by rotation by about 50\% from the surface to the bottom of the NSSL. Our local simulations do not validate the explanation for the generation of the NSSL from mean-field theory where meridional stresses are neglected. However, the rotational dependence of turbulent viscosity in our simulations is in good agreement with theoretical prediction. Our results are in qualitative agreement with global convection simulations in that a NSSL obtained near the equator.
△ Less
Submitted 10 December, 2020;
originally announced December 2020.
-
The Pencil Code, a modular MPI code for partial differential equations and particles: multipurpose and multiuser-maintained
Authors:
A. Brandenburg,
A. Johansen,
P. A. Bourdin,
W. Dobler,
W. Lyra,
M. Rheinhardt,
S. Bingert,
N. E. L. Haugen,
A. Mee,
F. Gent,
N. Babkovskaia,
C. -C. Yang,
T. Heinemann,
B. Dintrans,
D. Mitra,
S. Candelaresi,
J. Warnecke,
P. J. Käpylä,
A. Schreiber,
P. Chatterjee,
M. J. Käpylä,
X. -Y. Li,
J. Krüger,
J. R. Aarnes,
G. R. Sarson
, et al. (12 additional authors not shown)
Abstract:
The Pencil Code is a highly modular physics-oriented simulation code that can be adapted to a wide range of applications. It is primarily designed to solve partial differential equations (PDEs) of compressible hydrodynamics and has lots of add-ons ranging from astrophysical magnetohydrodynamics (MHD) to meteorological cloud microphysics and engineering applications in combustion. Nevertheless, the…
▽ More
The Pencil Code is a highly modular physics-oriented simulation code that can be adapted to a wide range of applications. It is primarily designed to solve partial differential equations (PDEs) of compressible hydrodynamics and has lots of add-ons ranging from astrophysical magnetohydrodynamics (MHD) to meteorological cloud microphysics and engineering applications in combustion. Nevertheless, the framework is general and can also be applied to situations not related to hydrodynamics or even PDEs, for example when just the message passing interface or input/output strategies of the code are to be used. The code can also evolve Lagrangian (inertial and noninertial) particles, their coagulation and condensation, as well as their interaction with the fluid.
△ Less
Submitted 17 September, 2020;
originally announced September 2020.
-
On the existence of shear-current effects in magnetized burgulence
Authors:
Maarit J. Käpylä,
Javier Álvarez Vizoso,
Matthias Rheinhardt,
Axel Brandenburg,
Nishant K. Singh
Abstract:
The possibility of explaining shear flow dynamos by a magnetic shear-current (MSC) effect is examined via numerical simulations. Our primary diagnostics is the determination of the turbulent magnetic diffusivity tensor $\boldsymbolη$. In our setup, a negative sign of its component $η_{yx}$ is necessary for coherent dynamo action by the SC effect. To be able to measure turbulent transport coefficie…
▽ More
The possibility of explaining shear flow dynamos by a magnetic shear-current (MSC) effect is examined via numerical simulations. Our primary diagnostics is the determination of the turbulent magnetic diffusivity tensor $\boldsymbolη$. In our setup, a negative sign of its component $η_{yx}$ is necessary for coherent dynamo action by the SC effect. To be able to measure turbulent transport coefficients from systems with magnetic background turbulence, we present an extension of the test-field method (TFM), applicable to our setup where the pressure gradient is dropped from the momentum equation: the nonlinear TFM (NLTFM). Our momentum equation is related to Burgers' equation and the resulting flows are referred to as magnetized burgulence. We use both stochastic kinetic and magnetic forcings to mimic cases without and with simultaneous small-scale dynamo action (SSD). When we force only kinetically, negative $η_{yx}$ are obtained with exponential growth in both the radial and azimuthal mean magnetic field components. Using isotropic magnetic forcing, the field growth is no longer exponential, while NLTFM yields positive $η_{yx}$. By employing an alternative forcing from which wavevectors having small components are removed, the exponential growth is recovered, but the NLTFM results do not change significantly. Analyzing the dynamo excitation conditions for the coherent SC and incoherent $α$ and SC effects shows that the incoherent effects are the main drivers of the dynamo in the majority of cases. We find no evidence for MSC-effect-driven dynamos in our simulations.
△ Less
Submitted 12 January, 2021; v1 submitted 10 June, 2020;
originally announced June 2020.
-
Turbulent viscosity and effective magnetic Prandtl number from simulations of isotropically forced turbulence
Authors:
Petri J. Käpylä,
Matthias Rheinhardt,
Axel Brandenburg,
Maarit J. Käpylä
Abstract:
(abridged) Context: Turbulent diffusion of large-scale flows and magnetic fields play major roles in many astrophysical systems. Aims: Our goal is to compute turbulent viscosity and magnetic diffusivity, relevant for diffusing large-scale flows and magnetic fields, respectively, and their ratio, the turbulent magnetic Prandtl number, ${\rm Pm}_{\rm t}$, for isotropically forced homogeneous turbule…
▽ More
(abridged) Context: Turbulent diffusion of large-scale flows and magnetic fields play major roles in many astrophysical systems. Aims: Our goal is to compute turbulent viscosity and magnetic diffusivity, relevant for diffusing large-scale flows and magnetic fields, respectively, and their ratio, the turbulent magnetic Prandtl number, ${\rm Pm}_{\rm t}$, for isotropically forced homogeneous turbulence. Methods: We use simulations of forced turbulence in fully periodic cubes composed of isothermal gas with an imposed large-scale sinusoidal shear flow. Turbulent viscosity is computed either from the resulting Reynolds stress or from the decay rate of the large-scale flow. Turbulent magnetic diffusivity is computed using the test-field method. The scale dependence of the coefficients is studied by varying the wavenumber of the imposed sinusoidal shear and test fields. Results: We find that turbulent viscosity and magnetic diffusivity are in general of the same order of magnitude. Furthermore, the turbulent viscosity depends on the fluid Reynolds number (${\rm Re}$) and scale separation ratio of turbulence. The scale dependence of the turbulent viscosity is found to be well approximated by a Lorentzian. The results for the turbulent transport coefficients appear to converge at sufficiently high values of ${\rm Re}$ and the scale separation ratio. However, a weak decreasing trend is found even at the largest values of ${\rm Re}$. The turbulent magnetic Prandtl number converges to a value that is slightly below unity for large ${\rm Re}$ whereas for small ${\rm Re}$, we find values between 0.5 and 0.6. Conclusions: The turbulent magnetic diffusivity is in general consistently higher than the turbulent viscosity. The actual value of ${\rm Pm}_{\rm t}$ found from the simulations ($\approx0.9\ldots0.95$) at large ${\rm Re}$ and scale separation ratio is higher than any of the analytic predictions.
△ Less
Submitted 17 February, 2020; v1 submitted 3 January, 2019;
originally announced January 2019.
-
Small-scale dynamos in simulations of stratified turbulent convection
Authors:
Petri J. Käpylä,
Maarit J. Käpylä,
Axel Brandenburg
Abstract:
Small-scale dynamo action is often held responsible for the generation of quiet-Sun magnetic fields. We aim to determine the excitation conditions and saturation level of small-scale dynamos in non-rotating turbulent convection at low magnetic Prandtl numbers. We use high resolution direct numerical simulations of weakly stratified turbulent convection. We find that the critical magnetic Reynolds…
▽ More
Small-scale dynamo action is often held responsible for the generation of quiet-Sun magnetic fields. We aim to determine the excitation conditions and saturation level of small-scale dynamos in non-rotating turbulent convection at low magnetic Prandtl numbers. We use high resolution direct numerical simulations of weakly stratified turbulent convection. We find that the critical magnetic Reynolds number for dynamo excitation increases as the magnetic Prandtl number is decreased, which might suggest that small-scale dynamo action is not automatically evident in bodies with small magnetic Prandtl numbers as the Sun. As a function of the magnetic Reynolds number (${\rm Rm}$), the growth rate of the dynamo is consistent with an ${\rm Rm}^{1/2}$ scaling. No evidence for a logarithmic increase of the growth rate with ${\rm Rm}$ is found.
△ Less
Submitted 26 February, 2018;
originally announced February 2018.
-
Large-scale dynamos in rapidly rotating plane layer convection
Authors:
P. J. Bushby,
P. J. Käpylä,
Y. Masada,
A. Brandenburg,
B. Favier,
C. Guervilly,
M. J. Käpylä
Abstract:
Context: Convectively-driven flows play a crucial role in the dynamo processes that are responsible for producing magnetic activity in stars and planets. It is still not fully understood why many astrophysical magnetic fields have a significant large-scale component. Aims: Our aim is to investigate the dynamo properties of compressible convection in a rapidly rotating Cartesian domain, focusing up…
▽ More
Context: Convectively-driven flows play a crucial role in the dynamo processes that are responsible for producing magnetic activity in stars and planets. It is still not fully understood why many astrophysical magnetic fields have a significant large-scale component. Aims: Our aim is to investigate the dynamo properties of compressible convection in a rapidly rotating Cartesian domain, focusing upon a parameter regime in which the underlying hydrodynamic flow is known to be unstable to a large-scale vortex instability. Methods: The governing equations of three-dimensional nonlinear magnetohydrodynamics (MHD) are solved numerically. Different numerical schemes are compared and we propose a possible benchmark case for other similar codes. Results: In kee** with previous related studies, we find that convection in this parameter regime can drive a large-scale dynamo. The components of the mean horizontal magnetic field oscillate, leading to a continuous overall rotation of the mean field. Whilst the large-scale vortex instability dominates the early evolution of the system, it is suppressed by the magnetic field and makes a negligible contribution to the mean electromotive force that is responsible for driving the large-scale dynamo. The cycle period of the dynamo is comparable to the ohmic decay time, with longer cycles for dynamos in convective systems that are closer to onset. In these particular simulations, large-scale dynamo action is found only when vertical magnetic field boundary conditions are adopted at the upper and lower boundaries. Strongly modulated large-scale dynamos are found at higher Rayleigh numbers, with periods of reduced activity ("grand minima"-like events) occurring during transient phases in which the large-scale vortex temporarily re-establishes itself, before being suppressed again by the magnetic field.
△ Less
Submitted 15 January, 2018; v1 submitted 9 October, 2017;
originally announced October 2017.
-
Methods for compressible fluid simulation on GPUs using high-order finite differences
Authors:
Johannes Pekkilä,
Miikka S. Väisälä,
Maarit J. Käpylä,
Petri J. Käpylä,
Omer Anjum
Abstract:
We focus on implementing and optimizing a sixth-order finite-difference solver for simulating compressible fluids on a GPU using third-order Runge-Kutta integration. Since graphics processing units perform well in data-parallel tasks, this makes them an attractive platform for fluid simulation. However, high-order stencil computation is memory-intensive with respect to both main memory and the cac…
▽ More
We focus on implementing and optimizing a sixth-order finite-difference solver for simulating compressible fluids on a GPU using third-order Runge-Kutta integration. Since graphics processing units perform well in data-parallel tasks, this makes them an attractive platform for fluid simulation. However, high-order stencil computation is memory-intensive with respect to both main memory and the caches of the GPU. We present two approaches for simulating compressible fluids using 55-point and 19-point stencils. We seek to reduce the requirements for memory bandwidth and cache size in our methods by using cache blocking and decomposing a latency-bound kernel into several bandwidth-bound kernels. Our fastest implementation is bandwidth-bound and integrates $343$ million grid points per second on a Tesla K40t GPU, achieving a $3.6 \times$ speedup over a comparable hydrodynamics solver benchmarked on two Intel Xeon E5-2690v3 processors. Our alternative GPU implementation is latency-bound and achieves the rate of $168$ million updates per second.
△ Less
Submitted 27 July, 2017;
originally announced July 2017.
-
Robustness of oscillatory $α^2$ dynamos in spherical wedges
Authors:
E. Cole,
A. Brandenburg,
P. J. Käpylä,
M. J. Käpylä
Abstract:
We study the connection between spherical wedge and full spherical shell geometries using simple mean-field $α^2$ dynamos. We solve the equations for a one-dimensional time-dependent mean-field dynamo to examine the effects of varying the polar angle $θ_0$ between the latitudinal boundaries and the poles in spherical coordinates. We investigate the effects of turbulent magnetic diffusivity and…
▽ More
We study the connection between spherical wedge and full spherical shell geometries using simple mean-field $α^2$ dynamos. We solve the equations for a one-dimensional time-dependent mean-field dynamo to examine the effects of varying the polar angle $θ_0$ between the latitudinal boundaries and the poles in spherical coordinates. We investigate the effects of turbulent magnetic diffusivity and $α$ effect profiles as well as different latitudinal boundary conditions to isolate parameter regimes where oscillatory solutions are found. Finally, we add shear along with a dam** term mimicking radial gradients to study the resulting dynamo regimes. We find that the commonly used perfect conductor boundary condition leads to oscillatory $α^2$ dynamo solutions only if the wedge boundary is at least one degree away from the poles. Other boundary conditions always produce stationary solutions. By varying the profile of the turbulent magnetic diffusivity alone, oscillatory solutions are achieved with models extending to the poles, but the magnetic field is strongly concentrated near the poles and the oscillation period is very long. By introducing radial shear and a dam** term mimicking radial gradients, we again see oscillatory dynamos, and the direction of drift follows the Parker--Yoshimura rule. Oscillatory solutions in the weak shear regime are found only in the wedge case with $θ_0 = 1^\circ$ and perfect conductor boundaries. A reduced $α$ effect near the poles with a turbulent diffusivity concentrated toward the equator yields oscillatory dynamos with equatorward migration and reproduces best the solutions in spherical wedges.
△ Less
Submitted 20 January, 2016;
originally announced January 2016.