5 March 2025 in Journal of Open Source Software
In the last decade, machine learning (ML) and deep learning (DL) techniques have revolutionised many fields within science, industry, and beyond. Researchers across domains are increasingly seeking to combine ML with numerical modelling to advance research. This typically brings about the challenge of programming language interoperation. PyTorch (Paszke et al., 2019) is a popular framework for designing and training ML/DL models whilst Fortran remains a language of choice for many high-performance computing (HPC) scientific models. The FTorch library provides an easy-to-use, performant, cross-platform method for coupling the two, allowing users to call PyTorch models from Fortran. FTorch is open-source, open-development, and well-documented with minimal dependencies. A central tenet of its design, in contrast to other approaches, is that FTorch removes dependence on the Python runtime (and virtual environments). By building on the LibTorch backend (written in C++ and accessible via an API), it allows users to run ML models on both CPU and GPU architectures without needing to port code to device-specific languages.
6 July 2022 in Physical Review Fluids
We investigate the flow within a liquid-metal battery induced by an externally imposed magnetic field, . An analytical model for laminar flow is proposed and this is found to be in excellent agreement with numerical simulations, not only for weakly forced steady flow, but also for the time-averaged velocity in more strongly forced flows where the motion is either unsteady (but laminar) or else weakly turbulent. Our primary conclusion is that surprisingly weak magnetic fields are capable of destabilizing the flow and inducing turbulence, with turbulence first appearing at . By comparison, the earth's magnetic field is ∼0.5 G. This extreme sensitivity of liquid-metal pools carrying current to an external magnetic field has long been known in the context of other industrial processes.
8 June 2024 in Journal of Geophysical Research: Space Physics
As the number of satellites on orbit grows it is increasingly important to understand their operating environment. Physics‐based models can simulate the behavior of the Earth's radiation belts by solving a Fokker‐Planck equation. Three‐dimensional models use diffusion coefficients to represent the interactions between electromagnetic waves and the electrons. One‐dimensional radial diffusion models neglect the effects of energy diffusion and represent the losses due to the waves with a loss timescale. Both approaches may use pitch angle distributions (PADs) to create boundary conditions, to map observations from low to high equatorial pitch angles and to calculate phase‐space density from observations. We present a comprehensive set of consistent PADs and loss timescales for 2 ≤ L* ≤ 7, 100 keV ≤ E ≤ 5 MeV and all levels of geomagnetic activity determined by the Kp index. These are calculated from drift‐averaged diffusion coefficients that represent all the VLF waves that typically interact with radiation belt electrons and show good agreement with data. The contribution of individual waves is demonstrated; magnetosonic waves have little effect on loss timescales when lightning‐generated whistlers are present, and chorus waves contribute to loss even in low levels of geomagnetic activity. The PADs vary in shape depending on the dominant waves. When chorus is dominant the distributions have little activity dependence, unlike the corresponding loss timescales. Distributions peaked near 90° are formed by plasmaspheric hiss for L* ≤ 3 and E < 1 MeV, and by EMIC waves for L* > 3 and E > 1 MeV. When hiss dominates, increasing activity broadens the distribution but when EMIC waves dominate increasing activity narrows the distribution.
18 September 2019 in Journal of Fluid Mechanics
We consider the life cycle of an axisymmetric laminar thermal starting from the initial condition of a Gaussian buoyant blob. We find that, as time progresses, the thermal transitions through a number of distinct stages, undergoing several morphological changes before ending up as a vortex ring. Whilst each stage is interesting in its own right, one objective of this study is to set out a consistent mathematical framework under which the entire life cycle can be studied. This allows examination of the transition between the different stages, as well as shedding light on some unsolved questions from previous works. We find that the early stages of formation are key in determining the properties of the final buoyant vortex ring and that, since they occur on a time scale where viscosity has little effect, the final properties of the ring display an independence above a critical Reynolds number. We also find that rings consistently contain the same proportion of the initial heat and have a consistent vorticity flux. By considering the effect of Prandtl number, we show that thermal diffusion can have a significant impact on development, smoothing out the temperature field and inhibiting the generation of vorticity. Finally, by considering the wake left behind as well as the vortex ring that is generated, we observe that the wake can itself roll up to form a second mushroom cap and subsequently a secondary vortex ring that follows the first.
3 July 2019 in Physical Review Fluids
We consider axisymmetric rotating convection in a cylindrical domain, focusing on the eye that can form at the center of a cyclonic vortex. Upon increasing the thermal forcing we observe that the system undergoes a Hopf bifurcation from a state with a steady eye to one in which the eye oscillates. For an aspect ratio, Ekman number, and Prandtl number of 0.1 we find that the critical Reynolds number at which this transition occurs is 398.
23 June 2024 in Journal of Open Source Education