<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing with OASIS Tables v3.0 20080202//EN" "https://jats.nlm.nih.gov/nlm-dtd/publishing/3.0/journalpub-oasis3.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:oasis="http://docs.oasis-open.org/ns/oasis-exchange/table" xml:lang="en" dtd-version="3.0" article-type="research-article">
  <front>
    <journal-meta><journal-id journal-id-type="publisher">GMD</journal-id><journal-title-group>
    <journal-title>Geoscientific Model Development</journal-title>
    <abbrev-journal-title abbrev-type="publisher">GMD</abbrev-journal-title><abbrev-journal-title abbrev-type="nlm-ta">Geosci. Model Dev.</abbrev-journal-title>
  </journal-title-group><issn pub-type="epub">1991-9603</issn><publisher>
    <publisher-name>Copernicus Publications</publisher-name>
    <publisher-loc>Göttingen, Germany</publisher-loc>
  </publisher></journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.5194/gmd-18-7389-2025</article-id><title-group><article-title>On stabilisation of compositional density jumps  in compressible mantle convection simulations</article-title><alt-title>On stabilisation of compositional density jumps</alt-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author" corresp="yes" rid="aff1">
          <name><surname>Tackley</surname><given-names>Paul James</given-names></name>
          <email>ptackley@ethz.ch</email>
        <ext-link>https://orcid.org/0000-0003-4878-621X</ext-link></contrib>
        <aff id="aff1"><label>1</label><institution>Department of Earth and Planetary Sciences, ETH Zurich, 8092 Zurich, Switzerland</institution>
        </aff>
      </contrib-group>
      <author-notes><corresp id="corr1">Paul James Tackley (ptackley@ethz.ch)</corresp></author-notes><pub-date><day>17</day><month>October</month><year>2025</year></pub-date>
      
      <volume>18</volume>
      <issue>20</issue>
      <fpage>7389</fpage><lpage>7397</lpage>
      <history>
        <date date-type="received"><day>31</day><month>March</month><year>2025</year></date>
           <date date-type="rev-request"><day>9</day><month>April</month><year>2025</year></date>
           <date date-type="rev-recd"><day>18</day><month>August</month><year>2025</year></date>
           <date date-type="accepted"><day>19</day><month>August</month><year>2025</year></date>
      </history>
      <permissions>
        <copyright-statement>Copyright: © 2025 Paul James Tackley</copyright-statement>
        <copyright-year>2025</copyright-year>
      <license license-type="open-access"><license-p>This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this licence, visit <ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</ext-link></license-p></license></permissions><self-uri xlink:href="https://gmd.copernicus.org/articles/18/7389/2025/gmd-18-7389-2025.html">This article is available from https://gmd.copernicus.org/articles/18/7389/2025/gmd-18-7389-2025.html</self-uri><self-uri xlink:href="https://gmd.copernicus.org/articles/18/7389/2025/gmd-18-7389-2025.pdf">The full text article is available as a PDF file from https://gmd.copernicus.org/articles/18/7389/2025/gmd-18-7389-2025.pdf</self-uri>
      <abstract><title>Abstract</title>

      <p id="d2e80">Large density jumps in numerical simulations of solid Earth dynamics can cause numerical “drunken sailor” oscillations. An implicit method has previously been shown to be very effective in stabilising the density jump that occurs at a free surface against such instabilities (Kaus et al., 2010; Duretz et al., 2011). Here the use of this to prevent oscillations of compositional layers deeper in the mantle is examined. If the stabilisation algorithm uses the total density field including the steady increase of density with depth due to adiabatic compression and jumps due to phase transitions, then a severe artificial reduction in convective vigour occurs because the algorithm assumes that density is advected with the flow but these density gradients are not. This artificial vigour reduction increases with Rayleigh number but decreases with decreasing grid spacing. Thus, it is essential to use only composition-related density gradients in the stabilisation algorithm, and a simple method for isolating these is presented. Once this is done, the stabilisation method works effectively for internal compositional layers as well as a free surface.</p>
  </abstract>
    </article-meta>
  </front>
<body>
      

<sec id="Ch1.S1" sec-type="intro">
  <label>1</label><title>Introduction</title>
      <p id="d2e92">Density jumps due to treatment of a free surface by the “sticky air” method (e.g. Crameri et al., 2012), in which the surface is represented as an abrupt interface between rock and low-density, low-viscosity “air”, can induce numerical “drunken sailor” instabilities, in which the free surface oscillates up and down on successive time steps, overshooting its equilibrium position. To cure this problem, an implicit free-surface stabilisation algorithm was introduced, initially for the finite-element discretisation (Kaus et al., 2010; Andrés-Martínez et al., 2015) and then for the staggered-grid finite-difference (equivalent to finite-volume) discretisation (Duretz et al., 2011). The basis of this scheme is that when calculating the flow field, the change in buoyancy due to advection of density during a time step is treated implicitly; while this is applied throughout the domain, by far the largest correction comes from advection of the free surface. It is very effective in stabilising the free surface, allowing a normal (e.g. Courant condition limited) time step to be used (Kaus et al., 2010; Duretz et al., 2011). A subsequent rigorous stability analysis led to an alternative approach using an explicit scheme based on nonstandard finite differences (Rose et al., 2017). Fully implicit time stepping in the entire domain is another alternative (Popov and Sobolev, 2008; Kramer et al., 2012).</p>
      <p id="d2e95">In global mantle convection simulations, compositional density jumps can also arise inside in the mantle, typically due to a primordial layer of dense material above the core–mantle boundary (CMB) (e.g. Gurnis, 1986; Tackley, 1998; Davaille, 1999; Deschamps et al., 2011) or a layer of dense subducted basaltic crust above the CMB (e.g. Christensen and Hoffmann, 1994; Ogawa, 2000; Nakagawa and Tackley, 2015), and although the associated density difference is much smaller than that at a free surface, it can sometimes be enough to also induce numerical “drunken sailor” oscillations. Thus, it is tempting to apply the implicit density-jump stabilisation (DJS) algorithm throughout the domain. However, a key assumption of the algorithm is that density is advected with the flow, but this is not the case for the steady density increase with depth (pressure) due to adiabatic compression or density jumps due to solid–solid phase transitions, the most important of which cause the 410 and 660 km seismic discontinuities. According to the most commonly used Earth model PREM (Preliminary Reference Earth Model) (Dziewonski and Anderson, 1981), the density jump at 660 km is about 10 %, while the density increase due to combined compression and phase transitions from the surface to the CMB is about 65 %. If the DJS algorithm is applied to these density gradients, then a substantial artificial reduction in convective vigour results, as shown later. Thus, it is important to apply the DJS algorithm only to density gradients or jumps due to compositional gradients and not density gradients/jumps due to adiabatic compression or phase transitions.</p>
      <p id="d2e98">In this paper, a test code written in the Julia programming language (Bezanson et al., 2017) is used first to again demonstrate the effectiveness of the DJS algorithm for stabilising a free surface, to additionally show its effectiveness in preventing oscillations of a dense layer above the CMB, and then to quantify the artificial reduction in convective vigour when applying it to total density in a setup that includes adiabatic compression and/or a phase transition. A way of separating composition-related density gradients from the total density gradient for arbitrary density functions is then presented.</p>
</sec>
<sec id="Ch1.S2">
  <label>2</label><title>Mathematical background</title>
<sec id="Ch1.S2.SS1">
  <label>2.1</label><title>Momentum equation with density-jump stabilisation</title>
      <p id="d2e116">Here the basics of the algorithm are reviewed, following Duretz et al. (2011). The equation of motion (force balance) for highly viscous flow in Earth's mantle and crust is the Stokes equations, which neglect inertial terms in the Navier–Stokes equations.

            <disp-formula id="Ch1.E1" content-type="numbered"><label>1</label><mml:math id="M1" display="block"><mml:mrow><mml:mo>-</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>p</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:munder><mml:munder><mml:mi mathvariant="italic">τ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold-italic">g</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          where <inline-formula><mml:math id="M2" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula> is pressure,  <inline-formula><mml:math id="M3" display="inline"><mml:mi mathvariant="italic">ρ</mml:mi></mml:math></inline-formula> is density, <inline-formula><mml:math id="M4" display="inline"><mml:mi mathvariant="bold-italic">g</mml:mi></mml:math></inline-formula> is gravity and <inline-formula><mml:math id="M5" display="inline"><mml:munder><mml:munder><mml:mi mathvariant="italic">τ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo mathvariant="normal">¯</mml:mo></mml:munder></mml:math></inline-formula> is the deviatoric stress tensor, given by

            <disp-formula id="Ch1.E2" content-type="numbered"><label>2</label><mml:math id="M6" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:mfenced open="(" close=")"><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>v</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>v</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="italic">δ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">2</mml:mn><mml:mi>n</mml:mi></mml:mfrac></mml:mstyle><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mrow></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          where <inline-formula><mml:math id="M7" display="inline"><mml:mi mathvariant="italic">η</mml:mi></mml:math></inline-formula> is the dynamic viscosity and <inline-formula><mml:math id="M8" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula> is the number of spatial dimensions (2 or 3). For incompressible flow, the last term is zero.</p>
      <p id="d2e287">During a time step, advection of composition in the vicinity of a density gradient/jump can substantially change the density on the right-hand side of Eq. (1), approximately as

            <disp-formula id="Ch1.E3" content-type="numbered"><label>3</label><mml:math id="M9" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>new</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>-</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          where <inline-formula><mml:math id="M10" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:math></inline-formula> is the time step. These density changes can be treated implicitly by substituting <inline-formula><mml:math id="M11" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>new</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> for <inline-formula><mml:math id="M12" display="inline"><mml:mi mathvariant="italic">ρ</mml:mi></mml:math></inline-formula> in Eq. (1) and moving the velocity term to the left-hand side:

            <disp-formula id="Ch1.E4" content-type="numbered"><label>4</label><mml:math id="M13" display="block"><mml:mrow><mml:mo>-</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>p</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:munder><mml:munder><mml:mi mathvariant="italic">τ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>-</mml:mo><mml:mi mathvariant="italic">θ</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow></mml:mfenced><mml:mi mathvariant="bold-italic">g</mml:mi><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold-italic">g</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          where <inline-formula><mml:math id="M14" display="inline"><mml:mi mathvariant="italic">θ</mml:mi></mml:math></inline-formula> is a factor between 0 (explicit) and 1 (implicit). The finite-difference stencil for velocity components is modified accordingly, based on <inline-formula><mml:math id="M15" display="inline"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow></mml:math></inline-formula> calculated at the beginning of the time step. In practice, in the vicinity of a near-horizontal layer interface, it is vertical motions that change the density, so a simplified version considering only vertical (<inline-formula><mml:math id="M16" display="inline"><mml:mi>z</mml:mi></mml:math></inline-formula>) velocities and assuming that <inline-formula><mml:math id="M17" display="inline"><mml:mi>g</mml:mi></mml:math></inline-formula> is vertical has almost the same stabilisation effect:

            <disp-formula id="Ch1.E5" content-type="numbered"><label>5</label><mml:math id="M18" display="block"><mml:mrow><mml:mo>-</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>p</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:munder><mml:munder><mml:mi mathvariant="italic">τ</mml:mi><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo mathvariant="normal">¯</mml:mo></mml:munder><mml:mo>-</mml:mo><mml:mi mathvariant="italic">θ</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mi>z</mml:mi></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mfenced><mml:mi>g</mml:mi><mml:mover accent="true"><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mo mathvariant="normal" stretchy="true">^</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi>g</mml:mi><mml:mover accent="true"><mml:mi mathvariant="bold-italic">z</mml:mi><mml:mo stretchy="true" mathvariant="normal">^</mml:mo></mml:mover><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
</sec>
<sec id="Ch1.S2.SS2">
  <label>2.2</label><title>Continuity equation</title>
      <p id="d2e523">The full continuity (conservation of mass) equation can be written in Eulerian form as

            <disp-formula id="Ch1.E6" content-type="numbered"><label>6</label><mml:math id="M19" display="block"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:math></disp-formula>

          or Lagrangian form as

            <disp-formula id="Ch1.E7" content-type="numbered"><label>7</label><mml:math id="M20" display="block"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">D</mml:mi><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">D</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>

          These equations are commonly approximated bearing in mind that thermally induced density differences are of order 1 %, which is much smaller than density differences due to adiabatic compression <inline-formula><mml:math id="M21" display="inline"><mml:mo>+</mml:mo></mml:math></inline-formula> phase transitions over the depth of the mantle (<inline-formula><mml:math id="M22" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">65</mml:mn></mml:mrow></mml:math></inline-formula> %) or due to compositional differences such as a free surface (discussed above) or iron diapirs (e.g. Samuel and Tackley, 2008; Lin et al., 2011) (<inline-formula><mml:math id="M23" display="inline"><mml:mrow><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">100</mml:mn></mml:mrow></mml:math></inline-formula> %). Furthermore, for whole-mantle studies, dynamic (i.e. related to the flow) pressure is much smaller than hydrostatic pressure, so its effect on density is typically ignored. Thus, Eq. (7) is often approximated as

            <disp-formula id="Ch1.E8" content-type="numbered"><label>8</label><mml:math id="M24" display="block"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>

          This is valid when density is advected with the flow but invalid when there are significant non-advected density variations such as those due to pressure or phase transitions. In this study it is necessary to model flow with both large pressure-related density variations and large composition-related density variations, so a modified form of Eq. (7) is considered, decomposing the Lagrangian density time derivative into components related to temperature (<inline-formula><mml:math id="M25" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula>), pressure (<inline-formula><mml:math id="M26" display="inline"><mml:mi>P</mml:mi></mml:math></inline-formula>) and composition (<inline-formula><mml:math id="M27" display="inline"><mml:mi>C</mml:mi></mml:math></inline-formula>):

            <disp-formula id="Ch1.E9" content-type="numbered"><label>9</label><mml:math id="M28" display="block"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">D</mml:mi><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">D</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:msub><mml:mfenced close=")" open="("><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">D</mml:mi><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">D</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mi>T</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mfenced open="(" close=")"><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">D</mml:mi><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">D</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mi>P</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mfenced open="(" close=")"><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">D</mml:mi><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">D</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mi>C</mml:mi></mml:msub><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>

          <inline-formula><mml:math id="M29" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula>-induced variations are assumed to be negligible, consistent with the Boussinesq or compressible anelastic approximations (additionally, <inline-formula><mml:math id="M30" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula> changes slowly in the Lagrangian frame). The compositional component is zero in the Lagrangian frame, and, ignoring dynamic pressure as in the Boussinesq or anelastic approximation, the pressure component is due only to vertical motion as

            <disp-formula id="Ch1.E10" content-type="numbered"><label>10</label><mml:math id="M31" display="block"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:msub><mml:mfenced open="(" close=")"><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">D</mml:mi><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">D</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mi mathvariant="normal">P</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:msub><mml:mi>v</mml:mi><mml:mi>z</mml:mi></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>

          This can be satisfied using a <inline-formula><mml:math id="M32" display="inline"><mml:mi>z</mml:mi></mml:math></inline-formula>-dependent density that increases due only to hydrostatic compression:

            <disp-formula id="Ch1.E11" content-type="numbered"><label>11</label><mml:math id="M33" display="block"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>⋅</mml:mo><mml:mfenced open="(" close=")"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi>z</mml:mi></mml:msub><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mrow></mml:mfenced><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          where <inline-formula><mml:math id="M34" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi>z</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is a depth-dependent reference density that depends only on hydrostatic compression, not composition. It would be possible to implement a more accurate version of the continuity equation that includes temperature and dynamic pressure effects (e.g. Gassmöller et al., 2020), but the current level of approximation suffices for the tests presented and is consistent with the commonly used anelastic approximation (King et al., 2010).</p>
</sec>
<sec id="Ch1.S2.SS3">
  <label>2.3</label><title>Energy equation</title>
      <p id="d2e870">For the tests performed, here a simple form of energy conservation is assumed:

            <disp-formula id="Ch1.E12" content-type="numbered"><label>12</label><mml:math id="M35" display="block"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:msub><mml:mi>C</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mi>k</mml:mi><mml:msup><mml:mi mathvariant="normal">∇</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mi>T</mml:mi><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:msub><mml:mi>C</mml:mi><mml:mi>p</mml:mi></mml:msub><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>T</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          where <inline-formula><mml:math id="M36" display="inline"><mml:mi>T</mml:mi></mml:math></inline-formula> is temperature, <inline-formula><mml:math id="M37" display="inline"><mml:mi>t</mml:mi></mml:math></inline-formula> is time, <inline-formula><mml:math id="M38" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mi>p</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is specific heat capacity and <inline-formula><mml:math id="M39" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> is thermal conductivity. Normally, when taking compressibility into account, terms for adiabatic heating/cooling and viscous dissipation would appear in this equation. This version corresponds to the limit of zero Grüneisen parameter (<inline-formula><mml:math id="M40" display="inline"><mml:mrow><mml:mi mathvariant="italic">γ</mml:mi><mml:mo>=</mml:mo><mml:mo>∂</mml:mo><mml:mi>ln⁡</mml:mi><mml:mi>T</mml:mi><mml:mo>/</mml:mo><mml:mo>∂</mml:mo><mml:mi>ln⁡</mml:mi><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow></mml:math></inline-formula>) or, in nondimensional terms, having a zero dissipation number but finite compressibility number (Tackley, 1996). The concept is to make the test program as simple as possible to demonstrate what is discussed in this paper.</p>
</sec>
<sec id="Ch1.S2.SS4">
  <label>2.4</label><title>Test program</title>
      <p id="d2e994">The associated test program CConv2dDJS.jl posted on Zenodo (Tackley and ETH Zurich, 2025) is written in the Julia programming language (Bezanson et al., 2017) and solves a nondimensional version of the equations above in two dimensions, <inline-formula><mml:math id="M41" display="inline"><mml:mi>x</mml:mi></mml:math></inline-formula> (horizontal) and <inline-formula><mml:math id="M42" display="inline"><mml:mi>z</mml:mi></mml:math></inline-formula> (vertical). The continuity equation is identical to Eq. (11) above, with <inline-formula><mml:math id="M43" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi>z</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> being 1.0 at the surface and increasing linearly to a specified value at the CMB. The two components of the momentum equation are

            <disp-formula id="Ch1.E13" content-type="numbered"><label>13</label><mml:math id="M44" display="block"><mml:mtable columnspacing="1em" class="aligned" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>x</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>x</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>p</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>z</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>z</mml:mi><mml:mi>x</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>x</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>-</mml:mo><mml:msub><mml:mi>v</mml:mi><mml:mi>z</mml:mi></mml:msub><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>t</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:msub><mml:mi>B</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:mtext mathvariant="italic">Ra</mml:mtext></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mtext mathvariant="italic">Ra</mml:mtext><mml:mfenced close=")" open="("><mml:mrow><mml:mi>T</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mi>B</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>B</mml:mi><mml:mtext>DL</mml:mtext></mml:msub><mml:msub><mml:mi>C</mml:mi><mml:mtext>DL</mml:mtext></mml:msub></mml:mrow></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>

          where <italic>Ra</italic> is the Rayleigh number; <inline-formula><mml:math id="M45" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mtext>air</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M46" display="inline"><mml:mrow><mml:msub><mml:mi>C</mml:mi><mml:mtext>DL</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> are the fraction (0–1) of air and dense layer, respectively; and <inline-formula><mml:math id="M47" display="inline"><mml:mrow><mml:msub><mml:mi>B</mml:mi><mml:mtext>air</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M48" display="inline"><mml:mrow><mml:msub><mml:mi>B</mml:mi><mml:mtext>DL</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> are the compositional buoyancy ratios for air and dense layer, respectively (<inline-formula><mml:math id="M49" display="inline"><mml:mrow><mml:msub><mml:mi>B</mml:mi><mml:mi>X</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi>X</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:mo>(</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="italic">α</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>T</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M50" display="inline"><mml:mi mathvariant="italic">α</mml:mi></mml:math></inline-formula> is thermal expansivity and <inline-formula><mml:math id="M51" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>T</mml:mi></mml:mrow></mml:math></inline-formula> is the temperature drop across the layer). <inline-formula><mml:math id="M52" display="inline"><mml:mi mathvariant="italic">θ</mml:mi></mml:math></inline-formula> in Eq. (5) is assumed to be 1.0. For air, the buoyancy parameter is negative (air being less dense than rock) and has a value <inline-formula><mml:math id="M53" display="inline"><mml:mrow><mml:msub><mml:mi>B</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:mo>(</mml:mo><mml:mi mathvariant="italic">α</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>T</mml:mi><mml:mo>)</mml:mo><mml:mo>≈</mml:mo><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:mo>(</mml:mo><mml:msup><mml:mn mathvariant="normal">2.10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:msup><mml:mo>×</mml:mo><mml:mn mathvariant="normal">2500</mml:mn><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mn mathvariant="normal">20</mml:mn></mml:mrow></mml:math></inline-formula>, whereas <inline-formula><mml:math id="M54" display="inline"><mml:mrow><mml:msub><mml:mi>B</mml:mi><mml:mtext>DL</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> is positive and has a much smaller magnitude. The mechanical boundary conditions are impermeable and free slip (zero shear stress) on all boundaries.</p>
      <p id="d2e1405">The nondimensional energy equation is

            <disp-formula id="Ch1.E14" content-type="numbered"><label>14</label><mml:math id="M55" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>tot</mml:mtext></mml:msub><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>T</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:msup><mml:mi mathvariant="normal">∇</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mi>T</mml:mi><mml:mo>-</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi>T</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>

          Thermal boundary conditions are insulating side boundaries and isothermal top and bottom boundaries (<inline-formula><mml:math id="M56" display="inline"><mml:mrow><mml:mi>T</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> and 1, respectively). The equivalent equation for composition lacks the diffusion term.</p>
      <p id="d2e1464">Density is the sum of pressure-related, composition-related and phase transition-related components:

            <disp-formula id="Ch1.E15" content-type="numbered"><label>15</label><mml:math id="M57" display="block"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>tot</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi>z</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="normal">C</mml:mi></mml:msub><mml:mo>+</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>PT</mml:mtext></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          where <inline-formula><mml:math id="M58" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi>z</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is 1.0 at the surface and increases linearly to a specified value at the CMB. The compositional component is given by

            <disp-formula id="Ch1.E16" content-type="numbered"><label>16</label><mml:math id="M59" display="block"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="normal">C</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:mo>+</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mtext>DL</mml:mtext></mml:msub><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>DL</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mtext>DL</mml:mtext></mml:msub><mml:msub><mml:mi>B</mml:mi><mml:mtext>DL</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>B</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          (noting that <inline-formula><mml:math id="M60" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> nondimensional and <inline-formula><mml:math id="M61" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>DL</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:msub><mml:mi>B</mml:mi><mml:mtext>DL</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>B</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:msub><mml:mi>B</mml:mi><mml:mtext>DL</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>B</mml:mi><mml:mtext>air</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>) where <inline-formula><mml:math id="M62" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>PT</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> is zero above the phase transition depth and the specified density increase below the phase transition depth, corresponding to a sharp phase transition with zero Clapeyron slope.</p>
      <p id="d2e1672">The continuity equation uses <inline-formula><mml:math id="M63" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi>z</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> as explained above, while the energy equation uses <inline-formula><mml:math id="M64" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>tot</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>. The DJS algorithm can either correctly use <inline-formula><mml:math id="M65" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="normal">C</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> or incorrectly use <inline-formula><mml:math id="M66" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>tot</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> in order to illustrate the bad artefacts that result.</p>
      <p id="d2e1722">The equations are discretised using a standard staggered-grid finite-volume discretisation (e.g. Harlow and Welch 1965; Patankar, 1980), as used by many codes in the geodynamical modelling community (e.g. Ogawa et al., 1991; Tackley, 1993, 2008; Trompert and Hansen, 1996; Gerya and Yuen, 2007; Kameyama et al., 2008; Kaus et al., 2016). The velocity–pressure solution is solved with a direct solver utilising the built-in <bold>“</bold><inline-formula><mml:math id="M67" display="inline"><mml:mo>\</mml:mo></mml:math></inline-formula><bold>”</bold> operator. Advection of temperature and composition is performed using an upwind donor-cell technique, which is very diffusive but suffices for the tests here. Temperature diffusion is calculated using explicit finite differences.</p>

      <fig id="F1" specific-use="star"><label>Figure 1</label><caption><p id="d2e1738">Stabilisation of a sticky-air layer with viscosity contrast 0.001 and thickness 0.1 on a <inline-formula><mml:math id="M68" display="inline"><mml:mrow><mml:mn mathvariant="normal">32</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">32</mml:mn></mml:mrow></mml:math></inline-formula> grid with <inline-formula><mml:math id="M69" display="inline"><mml:mrow><mml:mtext mathvariant="italic">Ra</mml:mtext><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>. Oscillations occur when density-jump stabilisation is switched off <bold>(a)</bold> but not when it is switched on <bold>(b)</bold>.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/18/7389/2025/gmd-18-7389-2025-f01.png"/>

        </fig>

</sec>
</sec>
<sec id="Ch1.S3">
  <label>3</label><title>Results</title>
<sec id="Ch1.S3.SS1">
  <label>3.1</label><title>Surface or dense layer stabilisation</title>
      <p id="d2e1796">First, it is verified that the implementation of the DJS algorithm in the attached program eliminates “drunken sailor” oscillations. Figure 1 shows the effectiveness of the algorithm for preventing oscillations of a free surface with a sticky air layer. Detailed tests are not performed here because they have been already been reported elsewhere (Duretz et al., 2011). Figure 2 shows the effectiveness of the algorithm for stabilising a dense layer above the CMB. In both cases, oscillations occur with the algorithm switched off, but a smooth evolution is obtained with the algorithm switched on. When oscillations occur, the compositional interface (free surface or top of layer) becomes smeared out due to the numerical diffusion inherent in the upwind donor cell advection algorithm. In contrast, when the interface barely moves, there is negligible numerical diffusion, so the interface remains fairly sharp.</p>

      <fig id="F2" specific-use="star"><label>Figure 2</label><caption><p id="d2e1801">Stabilisation of a dense layer with <inline-formula><mml:math id="M70" display="inline"><mml:mrow><mml:msub><mml:mi>B</mml:mi><mml:mtext>DL</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:math></inline-formula> and thickness 0.3 at <inline-formula><mml:math id="M71" display="inline"><mml:mrow><mml:mtext mathvariant="italic">Ra</mml:mtext><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">6</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> and grid resolution <inline-formula><mml:math id="M72" display="inline"><mml:mrow><mml:mn mathvariant="normal">32</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">32</mml:mn></mml:mrow></mml:math></inline-formula> by the DJS algorithm. Algorithm switched off <bold>(a, c, e)</bold> or on <bold>(b, d, f)</bold>.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/18/7389/2025/gmd-18-7389-2025-f02.png"/>

        </fig>

</sec>
<sec id="Ch1.S3.SS2">
  <label>3.2</label><title>Convection with depth-dependent density</title>
      <p id="d2e1866">Steady-state convection solutions are calculated for various density increases with depth (<inline-formula><mml:math id="M73" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>cmb</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>surf</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>), various Rayleigh numbers from <inline-formula><mml:math id="M74" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> to <inline-formula><mml:math id="M75" display="inline"><mml:mrow><mml:mn mathvariant="normal">3</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">5</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> and two grid resolutions (<inline-formula><mml:math id="M76" display="inline"><mml:mrow><mml:mn mathvariant="normal">32</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">32</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M77" display="inline"><mml:mrow><mml:mn mathvariant="normal">64</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula>). The calculations are run until the top and bottom Nusselt numbers are identical and the rms velocity has stopped changing, which typically requires 1000 s of time steps. These tests do not have any compositional density variations, so the DJS algorithm is not needed; their purpose is to demonstrate the problems that occur when it is applied to non-compositional density variations.</p>
      <p id="d2e1937">The influence of compressibility is tested first, varying the density increase with depth (<inline-formula><mml:math id="M78" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>cmb</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>surf</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>) from factor 1.0 to 2.0, bearing in mind that on Earth this ratio is about 1.65 (including compressibility and phase transitions). Correct solutions (using only non-existent composition-dependent density gradients in the DJS algorithm) are compared to those using the full density field (Fig. 3 left column). Solutions indicate that the correct Nusselt number (top left) and <inline-formula><mml:math id="M79" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mtext>rms</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> (middle left) change slightly with <inline-formula><mml:math id="M80" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>cmb</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>surf</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>, slightly increasing and decreasing, respectively. Resolution makes little difference to the correct values. With DJS using the full density field, however, the Nusselt number and <inline-formula><mml:math id="M81" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mtext>rms</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> decrease substantially as <inline-formula><mml:math id="M82" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>cmb</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>surf</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> is increased. Ratios are plotted in the lower left. In the worst case (<inline-formula><mml:math id="M83" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>cmb</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>surf</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2.0</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M84" display="inline"><mml:mrow><mml:mn mathvariant="normal">32</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">32</mml:mn></mml:mrow></mml:math></inline-formula> grid), the Nusselt number is decreased by 35 % and <inline-formula><mml:math id="M85" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mtext>rms</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> by about 65 %. This magnitude of reduction depends on grid resolution: with a <inline-formula><mml:math id="M86" display="inline"><mml:mrow><mml:mn mathvariant="normal">64</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula> grid, the effect is about half as much as with a <inline-formula><mml:math id="M87" display="inline"><mml:mrow><mml:mn mathvariant="normal">32</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">32</mml:mn></mml:mrow></mml:math></inline-formula> grid. This is because the effect is proportional to the time step, which is about a factor of 2 smaller with the <inline-formula><mml:math id="M88" display="inline"><mml:mrow><mml:mn mathvariant="normal">64</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula> grid.</p>

      <fig id="F3" specific-use="star"><label>Figure 3</label><caption><p id="d2e2100">Influence of using DJS on full density for experiments with <bold>(a, d, g)</bold> varying density increase with depth, <bold>(b, e, h)</bold> varying Rayleigh number and <bold>(c, f, i)</bold> a phase transition with different density jumps.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/18/7389/2025/gmd-18-7389-2025-f03.png"/>

        </fig>

      <p id="d2e2119">Increasing Rayleigh number (Fig. 3 centre column) results in an increased Nusselt number and <inline-formula><mml:math id="M89" display="inline"><mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mtext>rms</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>, as expected, but the increase is lower when DJS is applied to the full density field. The resolution is <inline-formula><mml:math id="M90" display="inline"><mml:mrow><mml:mn mathvariant="normal">64</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula> cells. The ratio (stabilised / correct) (Fig. 3 bottom centre) indicates that the problem gets worse with increasing Rayleigh number. The values used here are still far below Earth's effective Rayleigh number of around <inline-formula><mml:math id="M91" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">7</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>–<inline-formula><mml:math id="M92" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">8</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> (Schubert et al., 2001), at which the flow reduction would be much worse. This is because with higher <italic>Ra</italic> the buoyant upwellings and downwellings become narrower, but the fake advected density correction still occurs everywhere. Higher Rayleigh number solutions are not plotted here because a steady state cannot be obtained when DJS is applied to the full density field: there are oscillating boundary-layer instabilities.</p>
</sec>
<sec id="Ch1.S3.SS3">
  <label>3.3</label><title>Convection with a phase transition</title>
      <p id="d2e2178">In the final set of experiments (Fig. 3 right column), a phase transition with zero Clapeyron slope is inserted at mid-depth, and its density jump is varied from 0 to 0.5, bearing in mind that the relevant jump for Earth is about 0.1. The resolution is <inline-formula><mml:math id="M93" display="inline"><mml:mrow><mml:mn mathvariant="normal">32</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">32</mml:mn></mml:mrow></mml:math></inline-formula> cells. The correct solution does not change, as the phase change density perturbation is applied in a Boussinesq-like manner, affecting the buoyancy term but nothing else. Solutions indicate that incorrectly applying DJS to the phase change density-jump results in a reduction in convective vigour of a slightly lower magnitude than that obtained with a gradual density increase but still large enough that the effect should be avoided.</p>
</sec>
<sec id="Ch1.S3.SS4">
  <label>3.4</label><title>Correct functioning of DJS with all density contributions</title>
      <p id="d2e2202">Figure 4 shows a convection result with all density variations switched on. The air layer and deep dense layer interfaces are stable with no oscillations, and convection is not inhibited. Two-layered convection is established due to the thick dense layer. The middle row contrasts the total density field (middle left) with the compositional-only density perturbation used in the DJS algorithm (middle right).</p>

      <fig id="F4" specific-use="star"><label>Figure 4</label><caption><p id="d2e2207">A test with all density variations included (sticky air, dense layer, compressibility and a phase transition). On a <inline-formula><mml:math id="M94" display="inline"><mml:mrow><mml:mn mathvariant="normal">64</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula> grid with <inline-formula><mml:math id="M95" display="inline"><mml:mrow><mml:mtext mathvariant="italic">Ra</mml:mtext><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">6</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>, air thickness 0.1, dense layer thickness 0.3, <inline-formula><mml:math id="M96" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>cmb</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>surf</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M97" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mtext>phase</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.1</mml:mn></mml:mrow></mml:math></inline-formula>.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/18/7389/2025/gmd-18-7389-2025-f04.png"/>

        </fig>

</sec>
</sec>
<sec id="Ch1.S4">
  <label>4</label><title>Isolating the composition-dependent density gradient</title>
      <p id="d2e2291">The results above demonstrate the importance of using only the composition-related density gradient, not the full density gradient, in the DJS algorithm. For a simple convection program like the one used here, the composition-related density gradient is straightforward to isolate. However, if the code has been written in such a manner that compositional, pressure, phase and temperature effects are combined in a single density (<inline-formula><mml:math id="M98" display="inline"><mml:mrow><mml:mi>T</mml:mi><mml:mo>,</mml:mo><mml:mi>p</mml:mi><mml:mo>,</mml:mo><mml:mi>C</mml:mi></mml:mrow></mml:math></inline-formula>) function, such as the StagYY code (Tackley, 2008), then this is more difficult. A practical solution is to perform twice as many density evaluations for each grid cell, as detailed below.</p>
      <p id="d2e2310">The composition-related density gradient may be calculated by subtracting the density gradient for a fixed composition from the total density gradient:

          <disp-formula id="Ch1.E17" content-type="numbered"><label>17</label><mml:math id="M99" display="block"><mml:mrow><mml:msub><mml:mfenced close=")" open="("><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mi>C</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mfenced open="(" close=")"><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mtext>total</mml:mtext></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mfenced close=")" open="("><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mrow><mml:mtext>fixed</mml:mtext><mml:mi>C</mml:mi></mml:mrow></mml:msub><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>

        Using finite differences, the total density gradient is approximated as 

          <disp-formula id="Ch1.E18" content-type="numbered"><label>18</label><mml:math id="M100" display="block"><mml:mrow><mml:msub><mml:mfenced open="(" close=")"><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mtext>total</mml:mtext></mml:msub><mml:mo>≈</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo mathsize="1.1em">(</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo mathsize="1.1em">)</mml:mo><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

        where “u” denotes the upper cell, “l” denotes the lower cell and <inline-formula><mml:math id="M101" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:math></inline-formula> is the grid spacing. As the upper and lower cells can have different compositions, when calculating the density gradient for fixed composition, it is best to calculate it for both compositions and average:

          <disp-formula id="Ch1.E19" content-type="numbered"><label>19</label><mml:math id="M102" display="block"><mml:mtable rowspacing="0.2ex" columnspacing="1em" class="aligned" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mfenced open="(" close=")"><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mrow><mml:mtext>fixed</mml:mtext><mml:mi>C</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>≈</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo mathsize="1.1em">(</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathsize="1.1em">(</mml:mo><mml:msubsup><mml:mi>T</mml:mi><mml:mi mathvariant="normal">u</mml:mi><mml:mo>′</mml:mo></mml:msubsup><mml:mo>,</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo mathsize="1.1em">)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle displaystyle="true" class="stylechange"/><mml:mo>+</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathsize="1.1em">(</mml:mo><mml:msubsup><mml:mi>T</mml:mi><mml:mi mathvariant="normal">l</mml:mi><mml:mo>′</mml:mo></mml:msubsup><mml:mo>,</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub><mml:mo mathsize="1.1em">)</mml:mo><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo mathsize="1.1em">)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>

        Subtracting Eq. (19) from Eq. (18) leads to 

          <disp-formula id="Ch1.E20" content-type="numbered"><label>20</label><mml:math id="M103" display="block"><mml:mtable class="aligned" columnspacing="1em" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:msub><mml:mfenced close=")" open="("><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mi>C</mml:mi></mml:msub></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>≈</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo mathsize="1.1em">(</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathsize="1.1em">(</mml:mo><mml:msubsup><mml:mi>T</mml:mi><mml:mi mathvariant="normal">u</mml:mi><mml:mo>′</mml:mo></mml:msubsup><mml:mo>,</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo mathsize="1.1em">)</mml:mo></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mstyle class="stylechange" displaystyle="true"/></mml:mtd><mml:mtd><mml:mrow><mml:mstyle class="stylechange" displaystyle="true"/><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo mathsize="1.1em">(</mml:mo><mml:msubsup><mml:mi>T</mml:mi><mml:mi mathvariant="normal">l</mml:mi><mml:mo>′</mml:mo></mml:msubsup><mml:mo>,</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub><mml:mo mathsize="1.1em">)</mml:mo><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>(</mml:mo><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub><mml:mo>)</mml:mo><mml:mo mathsize="1.1em">)</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>

        This expression has been found to work well in recent tests of the StagYY convection code (Tackley, 2008).</p>
      <p id="d2e2821">In these expressions, primes on temperatures denote that they are extrapolated adiabatically to the required locations; i.e. <inline-formula><mml:math id="M104" display="inline"><mml:mrow><mml:msubsup><mml:mi>T</mml:mi><mml:mi mathvariant="normal">u</mml:mi><mml:mo>′</mml:mo></mml:msubsup></mml:mrow></mml:math></inline-formula> is <inline-formula><mml:math id="M105" display="inline"><mml:mrow><mml:msub><mml:mi>T</mml:mi><mml:mi mathvariant="normal">u</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> extrapolated adiabatically to <inline-formula><mml:math id="M106" display="inline"><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mi mathvariant="normal">l</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>. This is because, while the focus of Eq. (20) is on composition, it also works on temperature; i.e. it subtracts the density gradient at fixed temperature, leaving the density gradient that is due to a temperature gradient. This is appropriate, as density differences due to temperature differences are advected with the flow, but generally they are much smaller than the composition-based density gradients that are of concern here.</p>
      <p id="d2e2859">If one wishes to include horizontal density gradients in the DJS algorithm as in Eq. (4), the procedure is the same as that above (Eqs. 17–20) for each horizontal direction.</p>
</sec>
<sec id="Ch1.S5" sec-type="conclusions">
  <label>5</label><title>Conclusions</title>
      <p id="d2e2871">The density-jump stabilisation algorithm of Duretz et al. (2011) is an effective method of preventing numerical oscillations of internal compositional layers as well as of a free surface. However, it is essential that the density gradient used in the algorithm is that for compositional density variations only, otherwise severe artefacts result. If the density gradient used incorrectly includes the steady density increase with depth due to adiabatic compression and/or density jumps due to phase transitions, a severe reduction in convective vigour results. This reduction increases with Rayleigh number but decreases with increasing numerical resolution. Isolating the compositional component of the density gradient can be straightforwardly done using the approach presented in this paper.</p>
</sec>

      
      </body>
    <back><notes notes-type="codeavailability"><title>Code availability</title>

      <p id="d2e2878">The exact version of the Julia code used to produce the results and figures in this paper is archived on Zenodo under the MIT licence under <ext-link xlink:href="https://doi.org/10.5281/zenodo.15115816" ext-link-type="DOI">10.5281/zenodo.15115816</ext-link>  (Tackley and ETH Zurich, 2025). No input data or additional scripts are required. The Julia script used to produce the graphs in Fig. 3 is also archived there.</p>
  </notes><notes notes-type="dataavailability"><title>Data availability</title>

      <p id="d2e2887">No data sets were used in this manuscript.</p>
  </notes><notes notes-type="competinginterests"><title>Competing interests</title>

      <p id="d2e2893">The author has declared that there are no competing interests.</p>
  </notes><notes notes-type="disclaimer"><title>Disclaimer</title>

      <p id="d2e2899">Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims made in the text, published maps, institutional affiliations, or any other geographical representation in this paper. While Copernicus Publications makes every effort to include appropriate place names, the final responsibility lies with the authors. Views expressed in the text are those of the authors and do not necessarily reflect the views of the publisher.</p>
  </notes><ack><title>Acknowledgements</title><p id="d2e2905">The process of identifying and fixing these problems at this point in time was motivated by dense layer oscillations identified by Elena Zaharia and Maxim Ballmer. Helpful reviews were provided by Mingming Li and Boris Kaus. Albert de Montserrat Navarro helped the author to improve the plotting in the final version.</p></ack><notes notes-type="reviewstatement"><title>Review statement</title>

      <p id="d2e2910">This paper was edited by Ludovic Räss and reviewed by Mingming Li and Boris Kaus.</p>
  </notes><ref-list>
    <title>References</title>

      <ref id="bib1.bib1"><label>1</label><mixed-citation>Andrés-Martínez, M., Morgan, J. P., Pérez-Gussinyé, M., and Rüpke, L.: A new free-surface stabilization algorithm for geodynamical modelling: Theory and numerical tests, Phys. Earth Planet. Int., 246, 41–51, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2015.07.003" ext-link-type="DOI">10.1016/j.pepi.2015.07.003</ext-link>, 2015.</mixed-citation></ref>
      <ref id="bib1.bib2"><label>2</label><mixed-citation>Bezanson, J., Edelman, A., Karpinski, S., and Shah, V. B.: Julia: A fresh approach to numerical computing, SIAM Review, 59, 65–98, <ext-link xlink:href="https://doi.org/10.1137/141000671" ext-link-type="DOI">10.1137/141000671</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bib3"><label>3</label><mixed-citation>Christensen, U. R., and Hofmann, A. W.: Segregation of subducted oceanic crust in the convecting mantle, J. Geophys. Res., 99, 19867–19884, <ext-link xlink:href="https://doi.org/10.1029/93JB03403" ext-link-type="DOI">10.1029/93JB03403</ext-link>, 1994.</mixed-citation></ref>
      <ref id="bib1.bib4"><label>4</label><mixed-citation>Crameri, F., Schmeling, H., Golabek, G. J., Duretz, T., Orendt, R., Buiter, S. J. H., May, D. A., Kaus, B. J. P., Gerya, T. V., and Tackley, P. J.: A comparison of numerical surface topography calculations in geodynamic modelling: an evaluation of the “sticky air” method, Geophysical Journal International, 189, 38–54, <ext-link xlink:href="https://doi.org/10.1111/j.1365-246X.2012.05388.x" ext-link-type="DOI">10.1111/j.1365-246X.2012.05388.x</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bib5"><label>5</label><mixed-citation>Davaille, A.: Simultaneous generation of hotspots and superswells by convection in a heterogeneous planetary mantle, Nature, 402, 756–760, <ext-link xlink:href="https://doi.org/10.1038/45461" ext-link-type="DOI">10.1038/45461</ext-link>, 1999.</mixed-citation></ref>
      <ref id="bib1.bib6"><label>6</label><mixed-citation>Deschamps, F., Kaminski, E., and Tackley, P. J.: A deep mantle origin for the primitive signature of ocean island basalt, Nature Geosci., 4, 879–882, <ext-link xlink:href="https://doi.org/10.1038/ngeo1295" ext-link-type="DOI">10.1038/ngeo1295</ext-link>, 2011.</mixed-citation></ref>
      <ref id="bib1.bib7"><label>7</label><mixed-citation>Duretz, T., May, D. A., Gerya, T. V., and Tackley, P. J.: Discretisation errors and free surface stabilization in the finite difference and marker-in-cell method in geodynamic applications: A numerical study, Geochem. Geophys. Geosyst., 12, <ext-link xlink:href="https://doi.org/10.1029/2011GC003567" ext-link-type="DOI">10.1029/2011GC003567</ext-link>, 2011. </mixed-citation></ref>
      <ref id="bib1.bib8"><label>8</label><mixed-citation>Dziewonski, A. M. and Anderson, D. L.: Preliminary reference Earth model, Phys. Earth Planet. Inter, 25, 297–356, <ext-link xlink:href="https://doi.org/10.1016/0031-9201(81)90046-7" ext-link-type="DOI">10.1016/0031-9201(81)90046-7</ext-link>, 1981.</mixed-citation></ref>
      <ref id="bib1.bib9"><label>9</label><mixed-citation>Gassmöller, R., Dannberg, J., Bangerth, W., Heister, T., and Myhill, R.: On formulations of compressible mantle convection, Geophys. J. Int., 221, 1264–1280, <ext-link xlink:href="https://doi.org/10.1093/gji/ggaa078" ext-link-type="DOI">10.1093/gji/ggaa078</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bib10"><label>10</label><mixed-citation>Gerya, T. V. and Yuen, D. A.: Robust characteristics method for modelling multiphase visco-elasto-plastic thermo-mechanical problems, Physics of the Earth and Planetary Interiors, 163, 83–105, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2007.04.015" ext-link-type="DOI">10.1016/j.pepi.2007.04.015</ext-link>, 2007.</mixed-citation></ref>
      <ref id="bib1.bib11"><label>11</label><mixed-citation>Gurnis, M.: The effects of chemical density differences on convective mixing in the Earth's mantle, J. Geophys. Res., 91, 1407–1419, <ext-link xlink:href="https://doi.org/10.1029/JB091iB11p11407" ext-link-type="DOI">10.1029/JB091iB11p11407</ext-link>, 1986.</mixed-citation></ref>
      <ref id="bib1.bib12"><label>12</label><mixed-citation>Harlow, F. H. and Welch, J. E.: Numerical calculation of time-dependent viscous incompressible flow of fluid with free surface, Phys. Fluids A, 8, 2182–2189, <ext-link xlink:href="https://doi.org/10.1063/1.1761178" ext-link-type="DOI">10.1063/1.1761178</ext-link>, 1965.</mixed-citation></ref>
      <ref id="bib1.bib13"><label>13</label><mixed-citation>Kameyama, M., Kageyama, A., and Sato, T.: Multigrid-based simulation code for mantle convection in spherical shell using yin-yang grid, Phys. Earth Planet. Int., 171, 19–32, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2008.06.025" ext-link-type="DOI">10.1016/j.pepi.2008.06.025</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bib14"><label>14</label><mixed-citation>Kaus, B. J. P., Mühlhaus, H., and May, D. A.: A stabilization algorithm for geodynamic numerical simulations with a free surface, Phys. Earth Planet. Int., 181, 12–20, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2010.04.007" ext-link-type="DOI">10.1016/j.pepi.2010.04.007</ext-link>, 2010.</mixed-citation></ref>
      <ref id="bib1.bib15"><label>15</label><mixed-citation> Kaus, B. J. P., Popov, A. A., Baumann, T. S., Püsök, A. E., Bauville, A., Fernandez, N., and Collignon, M.: Forward and inverse modelling of lithospheric deformation on geological timescales, NIC Series, 48, 299, ISBN 978-3-95806-109-5, 2016.</mixed-citation></ref>
      <ref id="bib1.bib16"><label>16</label><mixed-citation>King, S. D., Lee, C., van Keken, P. E., Leng, W., Zhong, S., Tan, E., Tosi, N., and Kameyama, M. C.: A community benchmark for 2-D Cartesian compressible convection in the Earth's mantle, Geophysical Journal International, 180, 73–87, <ext-link xlink:href="https://doi.org/10.1111/j.1365-246X.2009.04413.x" ext-link-type="DOI">10.1111/j.1365-246X.2009.04413.x</ext-link>, 2010.</mixed-citation></ref>
      <ref id="bib1.bib17"><label>17</label><mixed-citation>Kramer, S. C., Wilson, C. R., and Davies, D. R.: An implicit free surface algorithm for geodynamical simulations, Physics of the Earth and Planetary Interiors, 194–195, 25–37, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2012.01.001" ext-link-type="DOI">10.1016/j.pepi.2012.01.001</ext-link>, 2012.</mixed-citation></ref>
      <ref id="bib1.bib18"><label>18</label><mixed-citation>Lin, J., Gerya, T. V., Tackley, P. J., Yuen, D. A., and Golabek, G. J.: Numerical modeling of protocore destabilization during planetary accretion: Feedbacks from non-Newtonian rheology and energy dissipation, Icarus, 213, 24–42, <ext-link xlink:href="https://doi.org/10.1016/j.icarus.2009.06.035" ext-link-type="DOI">10.1016/j.icarus.2009.06.035</ext-link>, 2011.</mixed-citation></ref>
      <ref id="bib1.bib19"><label>19</label><mixed-citation>Nakagawa, T. and Tackley, P. J.: Influence of plate tectonic mode on the coupled thermochemical evolution of Earth's mantle and core, Geochem. Geophys. Geosys., 16, 3400–3413, <ext-link xlink:href="https://doi.org/10.1002/2015gc005996" ext-link-type="DOI">10.1002/2015gc005996</ext-link>, 2015.</mixed-citation></ref>
      <ref id="bib1.bib20"><label>20</label><mixed-citation>Ogawa, M.: Numerical models of magmatism in convecting mantle with temperature-dependent viscosity and their implications for Venus and Earth, J. Geophys. Res., 105, 6997–7012, <ext-link xlink:href="https://doi.org/10.1029/1999JE001162" ext-link-type="DOI">10.1029/1999JE001162</ext-link>, 2000.</mixed-citation></ref>
      <ref id="bib1.bib21"><label>21</label><mixed-citation>Ogawa, M., Schubert, G., and Zebib, A.: Numerical simulations of 3-dimensional thermal convection in a fluid with strongly temperature-dependent viscosity, J. Fluid Mech., 233, 299–328, <ext-link xlink:href="https://doi.org/10.1017/S0022112091000496" ext-link-type="DOI">10.1017/S0022112091000496</ext-link>, 1991.</mixed-citation></ref>
      <ref id="bib1.bib22"><label>22</label><mixed-citation>Patankar, S. V.: Numerical Heat Transfer and Fluid Flow, CRC Press, <ext-link xlink:href="https://doi.org/10.1201/9781482234213" ext-link-type="DOI">10.1201/9781482234213</ext-link>, 1980.</mixed-citation></ref>
      <ref id="bib1.bib23"><label>23</label><mixed-citation>Popov, A. A. and Sobolev, S. V.: SLIM3D: A tool for three-dimensional thermomechanical modeling of lithospheric deformation with elasto-visco-plastic rheology, Physics of the Earth and Planetary Interiors, 171, 55–75, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2008.03.007" ext-link-type="DOI">10.1016/j.pepi.2008.03.007</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bib24"><label>24</label><mixed-citation>Rose, I., Buffett, B., and Heister, T.: Stability and accuracy of free surface time integration in viscous flows, Physics of the Earth and Planetary Interiors, 262, 90–100, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2016.11.007" ext-link-type="DOI">10.1016/j.pepi.2016.11.007</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bib25"><label>25</label><mixed-citation>Samuel, H. and Tackley, P. J.: Dynamics of core formation and equilibrium by negative diapirism, Geochem. Geophys. Geosyst., 9, <ext-link xlink:href="https://doi.org/10.1029/2007GC001896" ext-link-type="DOI">10.1029/2007GC001896</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bib26"><label>26</label><mixed-citation>Schubert, G., Turcotte, D. L., and Olson, P.: Mantle Convection in the Earth and Planets, Cambridge University Press, <ext-link xlink:href="https://doi.org/10.1017/CBO9780511612879" ext-link-type="DOI">10.1017/CBO9780511612879</ext-link>, 2001.</mixed-citation></ref>
      <ref id="bib1.bib27"><label>27</label><mixed-citation>Tackley, P. J.: Effects of strongly temperature-dependent viscosity on time-dependent, 3-dimensional models of mantle convection, Geophys. Res. Lett., 20, 2187–2190, <ext-link xlink:href="https://doi.org/10.1029/93GL02317" ext-link-type="DOI">10.1029/93GL02317</ext-link>, 1993.</mixed-citation></ref>
      <ref id="bib1.bib28"><label>28</label><mixed-citation>Tackley, P. J.: Effects of strongly variable viscosity on three-dimensional compressible convection in planetary mantles, J. Geophys. Res., 101, 3311–3332, <ext-link xlink:href="https://doi.org/10.1029/95JB03211" ext-link-type="DOI">10.1029/95JB03211</ext-link>, 1996. </mixed-citation></ref>
      <ref id="bib1.bib29"><label>29</label><mixed-citation>Tackley, P. J.: Three-dimensional simulations of mantle convection with a thermochemical CMB boundary layer: D”?, in: The Core-Mantle Boundary Region, edited by: Gurnis, M., Wysession, M. E., Knittle, E., and Buffett, B. A., American Geophysical Union, 231–253, <ext-link xlink:href="https://doi.org/10.1029/GD028" ext-link-type="DOI">10.1029/GD028</ext-link>, 1998.</mixed-citation></ref>
      <ref id="bib1.bib30"><label>30</label><mixed-citation>Tackley, P. J.: Modelling compressible mantle convection with large viscosity contrasts in a three-dimensional spherical shell using the yin-yang grid, Phys. Earth Planet. Int., <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2008.08.005" ext-link-type="DOI">10.1016/j.pepi.2008.08.005</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bib31"><label>31</label><mixed-citation>Tackley, P. J. and ETH Zurich: Software for manuscript “On stabilisation of compositional density jumps in compressible mantle convection simulations” (1.1), Zenodo [code], <ext-link xlink:href="https://doi.org/10.5281/zenodo.15115816" ext-link-type="DOI">10.5281/zenodo.15115816</ext-link>, 2025.</mixed-citation></ref>
      <ref id="bib1.bib32"><label>32</label><mixed-citation>Trompert, R. A. and Hansen, U.: The application of a finite-volume multigrid method to 3-dimensional flow problems in a highly viscous fluid with a variable viscosity, Geophys. Astrophys. Fluid Dyn., 83, 261–291, <ext-link xlink:href="https://doi.org/10.1080/03091929608208968" ext-link-type="DOI">10.1080/03091929608208968</ext-link>, 1996.</mixed-citation></ref>

  </ref-list></back>
    <!--<article-title-html>On stabilisation of compositional density jumps  in compressible mantle convection simulations</article-title-html>
<abstract-html/>
<ref-html id="bib1.bib1"><label>1</label><mixed-citation>
      
Andrés-Martínez, M., Morgan, J. P., Pérez-Gussinyé, M., and Rüpke, L.: A new free-surface stabilization algorithm for geodynamical modelling: Theory and numerical tests, Phys. Earth Planet. Int., 246, 41–51, <a href="https://doi.org/10.1016/j.pepi.2015.07.003" target="_blank">https://doi.org/10.1016/j.pepi.2015.07.003</a>, 2015.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib2"><label>2</label><mixed-citation>
       Bezanson, J., Edelman, A., Karpinski, S., and Shah, V. B.:
Julia: A fresh approach to numerical computing, SIAM Review, 59,
65–98, <a href="https://doi.org/10.1137/141000671" target="_blank">https://doi.org/10.1137/141000671</a>, 2017.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib3"><label>3</label><mixed-citation>
      
Christensen, U. R., and Hofmann, A. W.: Segregation of subducted oceanic crust in the convecting mantle, J. Geophys. Res., 99, 19867–19884, <a href="https://doi.org/10.1029/93JB03403" target="_blank">https://doi.org/10.1029/93JB03403</a>, 1994.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib4"><label>4</label><mixed-citation>
       Crameri, F., Schmeling, H., Golabek, G. J., Duretz, T.,
Orendt, R., Buiter, S. J. H., May, D. A., Kaus, B. J. P., Gerya,
T. V., and Tackley, P. J.: A comparison of numerical surface topography calculations in geodynamic modelling: an evaluation of the “sticky air” method, Geophysical Journal International, 189, 38–54, <a href="https://doi.org/10.1111/j.1365-246X.2012.05388.x" target="_blank">https://doi.org/10.1111/j.1365-246X.2012.05388.x</a>, 2012.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib5"><label>5</label><mixed-citation>
       Davaille, A.: Simultaneous generation of hotspots and superswells by convection in a heterogeneous planetary mantle, Nature, 402, 756–760, <a href="https://doi.org/10.1038/45461" target="_blank">https://doi.org/10.1038/45461</a>, 1999.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib6"><label>6</label><mixed-citation>
       Deschamps, F., Kaminski, E., and Tackley, P. J.: A deep mantle origin for the primitive signature of ocean island basalt, Nature Geosci., 4, 879–882, <a href="https://doi.org/10.1038/ngeo1295" target="_blank">https://doi.org/10.1038/ngeo1295</a>, 2011.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib7"><label>7</label><mixed-citation>
       Duretz, T., May, D. A., Gerya, T. V., and Tackley, P. J.: Discretisation errors and free surface stabilization in the finite difference and marker-in-cell method in geodynamic applications: A numerical study, Geochem. Geophys. Geosyst., 12, <a href="https://doi.org/10.1029/2011GC003567" target="_blank">https://doi.org/10.1029/2011GC003567</a>, 2011.


    </mixed-citation></ref-html>
<ref-html id="bib1.bib8"><label>8</label><mixed-citation>
       Dziewonski, A. M. and Anderson, D. L.: Preliminary reference Earth model, Phys. Earth Planet. Inter, 25, 297–356, <a href="https://doi.org/10.1016/0031-9201(81)90046-7" target="_blank">https://doi.org/10.1016/0031-9201(81)90046-7</a>, 1981.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib9"><label>9</label><mixed-citation>
       Gassmöller, R., Dannberg, J., Bangerth, W., Heister, T., and Myhill, R.: On formulations of compressible mantle convection, Geophys. J. Int., 221, 1264–1280, <a href="https://doi.org/10.1093/gji/ggaa078" target="_blank">https://doi.org/10.1093/gji/ggaa078</a>, 2020.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib10"><label>10</label><mixed-citation>
       Gerya, T. V. and Yuen, D. A.: Robust characteristics
method for modelling multiphase visco-elasto-plastic
thermo-mechanical problems, Physics of the Earth and Planetary
Interiors, 163, 83–105, <a href="https://doi.org/10.1016/j.pepi.2007.04.015" target="_blank">https://doi.org/10.1016/j.pepi.2007.04.015</a>, 2007.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib11"><label>11</label><mixed-citation>
       Gurnis, M.: The effects of chemical density differences on convective mixing in the Earth's mantle, J. Geophys. Res., 91, 1407–1419, <a href="https://doi.org/10.1029/JB091iB11p11407" target="_blank">https://doi.org/10.1029/JB091iB11p11407</a>, 1986.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib12"><label>12</label><mixed-citation>
       Harlow, F. H. and Welch, J. E.: Numerical calculation of time-dependent viscous incompressible flow of fluid with free surface, Phys. Fluids A, 8, 2182–2189, <a href="https://doi.org/10.1063/1.1761178" target="_blank">https://doi.org/10.1063/1.1761178</a>, 1965.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib13"><label>13</label><mixed-citation>
       Kameyama, M., Kageyama, A., and Sato, T.: Multigrid-based simulation code for mantle convection in spherical shell using yin-yang grid, Phys. Earth Planet. Int., 171, 19–32, <a href="https://doi.org/10.1016/j.pepi.2008.06.025" target="_blank">https://doi.org/10.1016/j.pepi.2008.06.025</a>, 2008.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib14"><label>14</label><mixed-citation>
       Kaus, B. J. P., Mühlhaus, H., and May, D. A.: A stabilization algorithm for geodynamic numerical simulations with a free surface, Phys. Earth Planet. Int., 181, 12–20, <a href="https://doi.org/10.1016/j.pepi.2010.04.007" target="_blank">https://doi.org/10.1016/j.pepi.2010.04.007</a>, 2010.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib15"><label>15</label><mixed-citation>
       Kaus, B. J. P., Popov, A. A., Baumann, T. S.,
Püsök, A. E., Bauville, A., Fernandez, N., and Collignon,
M.: Forward and inverse modelling of lithospheric deformation on
geological timescales, NIC Series, 48, 299, ISBN 978-3-95806-109-5, 2016.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib16"><label>16</label><mixed-citation>
       King, S. D., Lee, C., van Keken, P. E., Leng, W., Zhong,
S., Tan, E., Tosi, N., and Kameyama, M. C.: A community benchmark for 2-D Cartesian compressible convection in the Earth's mantle, Geophysical Journal International, 180, 73–87, <a href="https://doi.org/10.1111/j.1365-246X.2009.04413.x" target="_blank">https://doi.org/10.1111/j.1365-246X.2009.04413.x</a>, 2010.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib17"><label>17</label><mixed-citation>
       Kramer, S. C., Wilson, C. R., and Davies, D. R.: An implicit free surface algorithm for geodynamical simulations, Physics of the Earth and Planetary Interiors, 194–195, 25–37, <a href="https://doi.org/10.1016/j.pepi.2012.01.001" target="_blank">https://doi.org/10.1016/j.pepi.2012.01.001</a>, 2012.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib18"><label>18</label><mixed-citation>
       Lin, J., Gerya, T. V., Tackley, P. J., Yuen, D. A., and Golabek, G. J.: Numerical modeling of protocore destabilization during planetary accretion: Feedbacks from non-Newtonian rheology and energy dissipation, Icarus, 213, 24–42, <a href="https://doi.org/10.1016/j.icarus.2009.06.035" target="_blank">https://doi.org/10.1016/j.icarus.2009.06.035</a>, 2011.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib19"><label>19</label><mixed-citation>
       Nakagawa, T. and Tackley, P. J.: Influence of plate
tectonic mode on the coupled thermochemical evolution of Earth's
mantle and core, Geochem. Geophys. Geosys., 16, 3400–3413,
<a href="https://doi.org/10.1002/2015gc005996" target="_blank">https://doi.org/10.1002/2015gc005996</a>, 2015.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib20"><label>20</label><mixed-citation>
       Ogawa, M.: Numerical models of magmatism in convecting mantle with temperature-dependent viscosity and their implications for Venus and Earth, J. Geophys. Res., 105, 6997–7012, <a href="https://doi.org/10.1029/1999JE001162" target="_blank">https://doi.org/10.1029/1999JE001162</a>, 2000.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib21"><label>21</label><mixed-citation>
       Ogawa, M., Schubert, G., and Zebib, A.: Numerical simulations of 3-dimensional thermal convection in a fluid with strongly temperature-dependent viscosity, J. Fluid Mech., 233, 299–328, <a href="https://doi.org/10.1017/S0022112091000496" target="_blank">https://doi.org/10.1017/S0022112091000496</a>, 1991.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib22"><label>22</label><mixed-citation>
       Patankar, S. V.: Numerical Heat Transfer and Fluid Flow, CRC Press, <a href="https://doi.org/10.1201/9781482234213" target="_blank">https://doi.org/10.1201/9781482234213</a>, 1980.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib23"><label>23</label><mixed-citation>
       Popov, A. A. and Sobolev, S. V.: SLIM3D: A tool for three-dimensional thermomechanical modeling of lithospheric deformation with elasto-visco-plastic rheology, Physics of the Earth and Planetary Interiors, 171, 55–75, <a href="https://doi.org/10.1016/j.pepi.2008.03.007" target="_blank">https://doi.org/10.1016/j.pepi.2008.03.007</a>, 2008.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib24"><label>24</label><mixed-citation>
       Rose, I., Buffett, B., and Heister, T.: Stability and accuracy of free surface time integration in viscous flows, Physics of the Earth and Planetary Interiors, 262, 90–100, <a href="https://doi.org/10.1016/j.pepi.2016.11.007" target="_blank">https://doi.org/10.1016/j.pepi.2016.11.007</a>, 2017.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib25"><label>25</label><mixed-citation>
       Samuel, H. and Tackley, P. J.: Dynamics of core formation and equilibrium by negative diapirism, Geochem. Geophys. Geosyst., 9, <a href="https://doi.org/10.1029/2007GC001896" target="_blank">https://doi.org/10.1029/2007GC001896</a>, 2008.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib26"><label>26</label><mixed-citation>
       Schubert, G., Turcotte, D. L., and Olson, P.: Mantle Convection in the Earth and Planets, Cambridge University Press, <a href="https://doi.org/10.1017/CBO9780511612879" target="_blank">https://doi.org/10.1017/CBO9780511612879</a>, 2001.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib27"><label>27</label><mixed-citation>
       Tackley, P. J.: Effects of strongly temperature-dependent viscosity on time-dependent, 3-dimensional models of mantle convection, Geophys. Res. Lett., 20, 2187–2190, <a href="https://doi.org/10.1029/93GL02317" target="_blank">https://doi.org/10.1029/93GL02317</a>, 1993.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib28"><label>28</label><mixed-citation>
       Tackley, P. J.: Effects of strongly variable viscosity on
three-dimensional compressible convection in planetary mantles,
J. Geophys. Res., 101, 3311–3332, <a href="https://doi.org/10.1029/95JB03211" target="_blank">https://doi.org/10.1029/95JB03211</a>,
1996.


    </mixed-citation></ref-html>
<ref-html id="bib1.bib29"><label>29</label><mixed-citation>
       Tackley, P. J.: Three-dimensional simulations of mantle
convection with a thermochemical CMB boundary layer: D”?, in: The
Core-Mantle Boundary Region, edited by: Gurnis, M., Wysession,
M. E., Knittle, E., and Buffett, B. A., American Geophysical Union, 231–253, <a href="https://doi.org/10.1029/GD028" target="_blank">https://doi.org/10.1029/GD028</a>, 1998.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib30"><label>30</label><mixed-citation>
      
Tackley, P. J.: Modelling compressible mantle convection with large viscosity contrasts in a three-dimensional spherical shell using the yin-yang grid, Phys. Earth Planet. Int., <a href="https://doi.org/10.1016/j.pepi.2008.08.005" target="_blank">https://doi.org/10.1016/j.pepi.2008.08.005</a>, 2008.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib31"><label>31</label><mixed-citation>
      
Tackley, P. J. and ETH Zurich: Software for manuscript “On
stabilisation of compositional density jumps in compressible mantle
convection simulations” (1.1), Zenodo [code],
<a href="https://doi.org/10.5281/zenodo.15115816" target="_blank">https://doi.org/10.5281/zenodo.15115816</a>, 2025.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib32"><label>32</label><mixed-citation>
       Trompert, R. A. and Hansen, U.: The application of a finite-volume multigrid method to 3-dimensional flow problems in a highly viscous fluid with a variable viscosity, Geophys. Astrophys. Fluid Dyn., 83, 261–291, <a href="https://doi.org/10.1080/03091929608208968" target="_blank">https://doi.org/10.1080/03091929608208968</a>, 1996.

    </mixed-citation></ref-html>--></article>
