\end{equation}\]</p><p>where <span>$x_i$</span> are the coordinates and <span>$v_i$</span> the corresponding velocity components.</p><h2 id="Discretization-Schemes"><a class="docs-heading-anchor" href="#Discretization-Schemes">Discretization Schemes</a><a id="Discretization-Schemes-1"></a><a class="docs-heading-anchor-permalink" href="#Discretization-Schemes" title="Permalink"></a></h2><p>Although simple in form, the advection equation is challenging to solve numerically. The choice of discretization and interpolation schemes can introduce numerical artifacts such as diffusion, dispersion, or instability.</p><p>To promote clarity and modularity, <code>GeoModBox.jl</code> employs an <strong>operator-splitting</strong> strategy. This approach decouples the advective and diffusive terms of the temperature conservation equation and solves them sequentially. First, the advective (convective) term is solved, followed by the diffusive term. The latter is handled using the schemes described in the <a href="../DiffMain/">Diffusion Equation documentation</a>. </p><blockquote><p><strong>Note:</strong> The energy equation can also be solved for diffusion and advection simultaneously using combined schemes. Interestingly, the <em>Forward in Time and Centered in Space (FTCS)</em> scheme—although unstable for pure advection—can exhibit numerical stability due to diffusion when both processes are active.</p></blockquote><p>For the advection term, <code>GeoModBox.jl</code> includes the following numerical schemes:</p><ul><li>Upwind </li><li>Lax </li><li>Staggered leapfrog </li><li>Semi-Lagrangian </li><li>Passive tracer/marker method</li></ul><p>The first four schemes work for any scalar field defined at <strong>centroids</strong>, including ghost nodes, and use centroid-defined velocity fields.</p><p><strong>Passive tracers</strong> can be used to advect temperature or phase identifiers. When advecting phase IDs, the tracer data must also include material parameters such as viscosity or density. These values are interpolated either to centroids or to vertices, depending on the quantity (e.g., viscosity at vertices). The <strong>tracer or marker-in-cell (MIC) method</strong> tracks material properties along particle paths and solves the associated ODE system using standard time integration methods, including:</p><ul><li>Euler method </li><li>Runge–Kutta methods</li></ul><p>The <code>GeoModBox.jl</code> focuses on the tracer advection using a fourth-order Runge–Kutta method, with velocities from the staggered grid.</p><p>An important consideration in advection is the <strong>preservation of amplitude and shape</strong>, especially in problems involving rigid body rotation. Numerical diffusion and interpolation artifacts can significantly affect the solution quality depending on the chosen scheme, making the selection of an appropriate method crucial.</p><h2 id="Advection-Stability-Criterion"><a class="docs-heading-anchor" href="#Advection-Stability-Criterion">Advection Stability Criterion</a><a id="Advection-Stability-Criterion-1"></a><a class="docs-heading-anchor-permalink" href="#Advection-Stability-Criterion" title="Permalink"></a></h2><p>To avoid spurious oscillations in the advected field between adjacent grid points, the <em>Courant–Friedrichs–Lewy (CFL)</em> criterion must be satisfied:</p><p class="math-container">\[\begin{equation}
0 commit comments