Section 5 Particle Tracking Module
5.1 Minor Enhancements and Fixes
5.1.1 Multiple Particle Groups Fix
A fix has been added that addresses memory overflow errors when running long simulation periods with multiple particle groups.
5.1.2 Spherical Coordinate Particle Position Fix
The calculation of particle location at high latitudes has been improved.
The particle tracking module updates the Lagrangian particle position using the particle velocity components \([u, v, w]\) and the Lagrangian timestep, \(\Delta t\). In the case of a Cartesian coordinate system, the following simple set of equations is used to perform the position update:
\[ x_1 = x_0 + u \Delta t \\ y_1 = y_0 + v \Delta t \\ z_1 = z_0 + w \Delta t \]
In the case of a Spherical coordinate system, spherical trigonometry is applied to update the Lagrangian particle position on the approximate sphere representing the Earth. The following equations are used to update the particle position in spherical coordinates (latitude and longitude, in radians):
\[ \begin{align} \Delta x &= u \Delta t \\ \Delta y &= v \Delta t \\ \delta &= \frac{\sqrt{\Delta x^2 + \Delta y^2}}{R_\text{Earth}} \\ \theta &= \frac{\pi}{2} - \text{atan2}(\Delta y, \Delta x) \\ \text{lat}_1 &= \arcsin \left( \sin(\text{lat}_0) \cos(\delta) + \cos(\text{lat}_0) \sin(\delta) \cos(\theta) \right) \\ \text{lon}_1 &= \text{lon}_0 + \text{atan2} \left( \sin(\theta) \sin(\delta) \cos(\text{lat}_0), \cos(\delta) - \sin(\text{lat}_0) \sin(\text{lat}_1) \right) \\ z_1 &= z_0 + w \Delta t \end{align} \]
Prior to version 2025.1.0, the longitude update was calculated using:
\[ \text{lon}_1 = \text{lon}_0 + \text{atan2} \left( \sin(\theta) \sin(\delta), \cos(\delta) - \sin(\text{lat}_0) \sin(\text{lat}_1) \right) \]
This approximation becomes increasingly inaccurate at high latitudes. This calculation has been corrected in version 2025.1.0.