<?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-19-8839-2026</article-id><title-group><article-title>Variational Stokes method applied to free surface boundaries  in numerical geodynamical models using the  staggered-grid finite-difference discretisation</article-title><alt-title>Variational Stokes method applied to free surface boundaries</alt-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author" corresp="yes" rid="aff1">
          <name><surname>Gray</surname><given-names>Timothy S.</given-names></name>
          <email>timothy.gray@eaps.ethz.ch</email>
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Tackley</surname><given-names>Paul J.</given-names></name>
          
        <ext-link>https://orcid.org/0000-0003-4878-621X</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Gerya</surname><given-names>Taras V.</given-names></name>
          
        </contrib>
        <aff id="aff1"><label>1</label><institution>Institute of Geophysics, Department of Earth and Planetary Sciences,  ETH Zürich, Sonneggstrasse 5, 8092 Zurich, Switzerland</institution>
        </aff>
      </contrib-group>
      <author-notes><corresp id="corr1">Timothy S. Gray (timothy.gray@eaps.ethz.ch)</corresp></author-notes><pub-date><day>21</day><month>September</month><year>2026</year></pub-date>
      
      <volume>19</volume>
      <issue>18</issue>
      <fpage>8839</fpage><lpage>8854</lpage>
      <history>
        <date date-type="received"><day>18</day><month>December</month><year>2025</year></date>
           <date date-type="rev-request"><day>28</day><month>December</month><year>2025</year></date>
           <date date-type="rev-recd"><day>22</day><month>June</month><year>2026</year></date>
           <date date-type="accepted"><day>21</day><month>July</month><year>2026</year></date>
      </history>
      <permissions>
        <copyright-statement>Copyright: © 2026 Timothy S. Gray et al.</copyright-statement>
        <copyright-year>2026</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/19/8839/2026/gmd-19-8839-2026.html">This article is available from https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026.html</self-uri><self-uri xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026.pdf">The full text article is available as a PDF file from https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026.pdf</self-uri>
      <abstract><title>Abstract</title>

      <p id="d2e102">Accurately and efficiently modelling topographic evolution is a key challenge in geodynamic modelling, which requires the solution of the Stokes equations with free surface boundary conditions. While finite difference methods on staggered grids, as used in geodynamic modelling codes such as StagYY, I3ELVIS and LaMEM, offer strong computational performance and compatibility with multigrid solvers, the use of fixed Eulerian grids complicates the implementation of realistic, deformable free surfaces. Two existing methods are available to model free surface boundary conditions in such codes: the commonly used sticky-air method, which suffers from limitations relating to high viscosity contrasts, and the “staircase” method, which improves upon the sticky air method by imposing free surface boundary conditions at cell boundaries.</p>

      <p id="d2e105">To address the limitations of existing methods of implementing free surface boundary conditions, this study investigates an alternative variational discretisation of the Stokes equations that uses volume fractions to represent a smooth surface within a fixed Eulerian grid, allowing the imposition of accurate free surface boundary conditions while allowing it to bypass the limitations of existing free surface discretisation methods.</p>

      <p id="d2e108">The variational Stokes method is demonstrated to be an accurate and computationally efficient alternative to existing methods. It reproduces results comparable to existing methods while reducing computational cost and enabling broader applications, including non-zero surface tractions, complex surface loading, and compatibility with 3D spherical geometries.</p>
  </abstract>
    
<funding-group>
<award-group id="gs1">
<funding-source>Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung</funding-source>
<award-id>192296</award-id>
</award-group>
</funding-group>
</article-meta>
  </front>
<body>
      

<sec id="Ch1.S1" sec-type="intro">
  <label>1</label><title>Introduction</title>
      <p id="d2e120">The Stokes equations are the governing equations of mantle convection, and their solution is the key goal of numerical geodynamic models. Numerous discretisation methods exist for solving these equations numerically, including the finite difference method, finite volume method, finite element method, and spectral element method. Among these, the finite difference method on a staggered grid, which is equivalent to the finite volume method, is often used in geodynamic modelling codes (e.g. <xref ref-type="bibr" rid="bib1.bibx21 bib1.bibx20 bib1.bibx27 bib1.bibx29 bib1.bibx10 bib1.bibx28 bib1.bibx11 bib1.bibx18 bib1.bibx8" id="altparen.1"/>) due to its simplicity in discretising the governing equations and compatibility with efficient multigrid solvers in both 2D and 3D.</p>
      <p id="d2e126">A key component of the finite difference method is the transformation of continuous differential equations into a discretised system that can be solved numerically on a fixed Eulerian grid. However, while the finite difference method offers computational efficiency and stability, it introduces challenges when modelling free surface boundary conditions, which are essential for the accurate modelling of topographic evolution on planets. The fixed grids used by the above geodynamical modelling codes are not readily adaptable to modelling surface deformation, necessitating alternative techniques to account for free surface boundary conditions.</p>
      <p id="d2e129">Modelling free surface boundary conditions on a fixed Eulerian grid requires two key components: a method for tracking the location of the surface over time, and a method of discretising the Stokes equations in a way that incorporates the free surface boundary condition, with this study focussing on the latter.</p>
      <p id="d2e132">The most straightforward approach for achieving this is the so-called sticky air method. In this method, a relatively low-viscosity layer is added above the rock layer of interest to represent the air (<xref ref-type="bibr" rid="bib1.bibx9" id="text.2"/> and references therein). The presence of this low viscosity layer allows the surface to deform relatively freely and thus approximate a true free surface boundary condition; however, computational limitations on viscosity contrast mean that the air layer is unable to be set to the extremely low viscosity of actual air. Hence, the use of a higher viscosity “sticky” air layer. Although conceptually simple, this method presents several drawbacks, which are discussed in Sect. <xref ref-type="sec" rid="Ch1.S2.SS1"/> below.</p>
      <p id="d2e141">To address the limitations of the sticky air method, <xref ref-type="bibr" rid="bib1.bibx8" id="text.3"/> introduced a novel discretisation method, henceforth referred to as the “staircase” method. This approach eliminates the need for modelling a sticky air layer by applying zero Dirichlet boundary conditions on pressures and velocities within the air layer, while allowing the surface itself to deform freely via alternative boundary conditions in the interfacial cells. Although this method improves numerical performance by allowing for a relatively thinner air layer and avoiding the viscosity contrast inherent in the sticky air method, it introduces its own set of challenges, which are discussed in Sect. <xref ref-type="sec" rid="Ch1.S2.SS2"/> below.</p>
      <p id="d2e149">Given these challenges, there is a need for a more robust and efficient method to discretise the Stokes equations for the modelling of free surfaces. Such a method should satisfy several key criteria: <list list-type="bullet"><list-item>
      <p id="d2e154">Remove or minimise the viscosity contrast dependence inherent in the sticky air method.</p></list-item><list-item>
      <p id="d2e158">Remove or minimise the necessity for a thick air layer.</p></list-item><list-item>
      <p id="d2e162">Enable efficient and stable solutions in both 2D and 3D, using both direct and iterative (multigrid) solvers, and on both Cartesian and non-Cartesian grids.</p></list-item></list></p>
      <p id="d2e165">A promising direction in this field is the variational Stokes method, introduced by <xref ref-type="bibr" rid="bib1.bibx19" id="text.4"/>. This method is conceptually similar to the aforementioned staircase method in that it eliminates the need to explicitly model a low viscosity sticky air layer. However, instead of a discrete staircase representation of the free surface, this method proposes a smooth representation of free surfaces through the use of volume fractions, which can be readily computed in one of several ways, including a volume of fluid method or a direct Lagrangian representation of the surface. We discuss the implementation of this method (using StagYY <xref ref-type="bibr" rid="bib1.bibx28" id="text.5"/> as an example code), the comparison of this method to the existing sticky air and staircase methods, and the potential applications of such methods to global scale numerical geodynamical models. While <xref ref-type="bibr" rid="bib1.bibx19" id="text.6"/> model viscous animal-shaped objects and falling streams/blocks/layers of viscous fluid, we here demonstrate the applicability of the method to geodynamical modelling of the solid Earth with a free outer surface using a staggered-grid finite difference discretisation and a multigrid Stokes solver, with systematic tests showing that it has some advantages to the currently-used sticky air and staircase methods.</p>
      <p id="d2e177"><xref ref-type="bibr" rid="bib1.bibx19" id="text.7"/> provide an extensive review of related methods. Furthermore, in the (finite Prantl number) fluid dynamics community, a commonly used approach is the immersed boundary method (for a review see <xref ref-type="bibr" rid="bib1.bibx30" id="altparen.8"/>), in which volumetric forces are added to enforce the boundary conditions at the interface. For finite element discretisations the CutFEM method (see <xref ref-type="bibr" rid="bib1.bibx5" id="text.9"/> for a review and comparison to other methods) results in a modified weak form of the equations accounting for the interface conditions inside cut elements.</p>
</sec>
<sec id="Ch1.S2">
  <label>2</label><title>Existing methods</title>
      <p id="d2e196">Two methods for numerically modelling a free surface in an Eulerian staggered finite-difference grid are currently used in the geodynamical community: the sticky air method <xref ref-type="bibr" rid="bib1.bibx24 bib1.bibx6" id="paren.10"/>), and the staircase method <xref ref-type="bibr" rid="bib1.bibx8" id="paren.11"/>.</p>
<sec id="Ch1.S2.SS1">
  <label>2.1</label><title>Sticky air method</title>
      <p id="d2e212">The sticky air method involves the use of a layer of low viscosity material at the top of the model domain, which represents an air layer within which the surface can freely deform. At standard temperature and pressure, real air has a viscosity of approximately 1.8 <inline-formula><mml:math id="M1" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 10<sup>−5</sup> <inline-formula><mml:math id="M3" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">Pa</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mi mathvariant="normal">s</mml:mi></mml:mrow></mml:math></inline-formula>, over 20 orders of magnitude lower than typical mantle rock viscosities, which typically range between 10<sup>19</sup>–10<sup>20</sup> <inline-formula><mml:math id="M6" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">Pa</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mi mathvariant="normal">s</mml:mi></mml:mrow></mml:math></inline-formula>. However, the naive solution of applying such a large viscosity contrast to a numerical model would cause the resulting linear system to become extremely poorly conditioned, resulting in low quality results and poor numerical performance <xref ref-type="bibr" rid="bib1.bibx9" id="paren.12"/>.</p>
      <p id="d2e278">For this reason, an effective air viscosity is used that is significantly higher than that of actual air, typically on the order of 1000 times lower then the viscosity of rock in the model, resulting in a modelled viscosity on the order of 10<sup>16</sup>–10<sup>18</sup> <inline-formula><mml:math id="M9" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">Pa</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mi mathvariant="normal">s</mml:mi></mml:mrow></mml:math></inline-formula>. This enhances numerical performance significantly, while still approximating free deformations of the surface. However, the sticky air approach suffers from limitations in cases when the viscosity contrast or the thickness of the air layer is insufficient. For certain analytical cases, simple criteria can be derived which can be used to determine whether the surface will be traction free as a function of the model geometry and viscosity contrast <xref ref-type="bibr" rid="bib1.bibx6" id="paren.13"/>. These criteria take the form:

            <disp-formula id="Ch1.E1" content-type="numbered"><label>1</label><mml:math id="M10" display="block"><mml:mrow><mml:mi>A</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mtext>air</mml:mtext></mml:msub></mml:mrow><mml:mrow><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mtext>rock</mml:mtext></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:msup><mml:mfenced close=")" open="("><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mi>L</mml:mi><mml:mrow><mml:msub><mml:mi>h</mml:mi><mml:mtext>air</mml:mtext></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mn mathvariant="normal">3</mml:mn></mml:msup><mml:mo>≪</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          where <inline-formula><mml:math id="M11" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mtext>air</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M12" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mtext>rock</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> are the characteristic viscosities of the sticky air and underlying rock, <inline-formula><mml:math id="M13" display="inline"><mml:mrow><mml:msub><mml:mi>h</mml:mi><mml:mtext>air</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> is the sticky air layer thickness, <inline-formula><mml:math id="M14" display="inline"><mml:mi>L</mml:mi></mml:math></inline-formula> is a characteristic length (typically the mantle thickness in global scale models). The constant <inline-formula><mml:math id="M15" display="inline"><mml:mi>A</mml:mi></mml:math></inline-formula> is a model-dependent parameter which can be derived analytically for a number of simple scenarios <xref ref-type="bibr" rid="bib1.bibx6" id="paren.14"/>. From this relation, it can be concluded that both air layer thickness and viscosity contrast must be sufficiently high in order to approximate a traction-free surface.</p>
      <p id="d2e406">The presence of a sticky air layer introduces several issues. The first issue is the requirement to have a thick layer of low viscosity material. This inherently increases the model domain size, and thus decreases numerical performance by having to solve for a greater number of degrees of freedom than are otherwise necessary <xref ref-type="bibr" rid="bib1.bibx8" id="paren.15"/>. Furthermore, as the fluid velocities within the low-viscosity air layer are often higher than the high-viscosity rock, timesteps may be limited unnecessarily in order to accommodate deformation of the air layer. As the air layer itself is uninteresting for researchers, serving only to enable a free surface boundary condition, this implies that computational effort is wasted.</p>
      <p id="d2e412">The second and most prominent issue relates to the sharp viscosity contrast necessary to obtain accurate solutions when using the sticky air method. The introduction of viscosity contrasts into a model makes the discretised form of the Stokes equations poorly conditioned, and generally more difficult to solve. While direct solvers, which are more commonly used in 2D models, are not as sensitive to sharp viscosity contrasts, iterative solvers including the iterative multigrid approach used for solving 3D models are strongly affected by them. This increase in computational cost has contributed to making use of the sticky air method, and due to the ubiquity of the method, free surface modelling in general less desirable when using 3D models.</p>
</sec>
<sec id="Ch1.S2.SS2">
  <label>2.2</label><title>Staircase method</title>
      <p id="d2e423">Seeking to overcome the limitations of the sticky air approach, <xref ref-type="bibr" rid="bib1.bibx8" id="text.16"/> proposed an alternative method of modelling surfaces in finite-difference Stokes models, referred to here as the staircase method. This approach eliminates the need for a sticky air layer by avoiding equations in the air domain and instead modelling a free surface boundary condition using modified boundary conditions at interfacial cells. In this way, it is possible to model a true free surface boundary condition without the need for a thick, low-viscosity sticky air layer.</p>
      <p id="d2e429">The method requires a method of tracking the location of the free surface. While <xref ref-type="bibr" rid="bib1.bibx8" id="text.17"/> use a simple marker chain to directly track the interface location over time, in principle any method of tracking free surfaces, which also inclulde the marker-in-cell method and volume of fluid method, could be used. For a comparison of the performance of these methods see <xref ref-type="bibr" rid="bib1.bibx14 bib1.bibx15" id="text.18"/>.</p>
      <p id="d2e438">In the staircase method, computational cells with a centre point that is below the location of the surface are considered to be fluid (i.e. rock for geodynamic applications) cells, while cells above are considered to be air cells. These two cell classifications imply the existence of an interface between the cells which follows cell boundaries, and which therefore follows a staircase pattern when using a Cartesian grid (Fig. <xref ref-type="fig" rid="F1"/>). In air cells that are not directly adjacent to the interface, no equations are solved and the pressure and velocities are set to zero through Dirichlet boundary conditions. In rock cells not directly adjacent to the surface, the Stokes equations are discretised as they would be normally, with no additional modifications required. At interfacial cells, the equations are modified to ensure that tractions are zero at the boundaries, thus imposing free surface boundary conditions directly at the interfacial cell boundaries.</p>

      <fig id="F1"><label>Figure 1</label><caption><p id="d2e447">In the staircase method, cells are divided into rock (blue) and air (white). Between them is an interface, at which normal and shear stresses are set to zero in order to create free surface boundary conditions.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f01.png"/>

        </fig>

      <p id="d2e456">The staircase method comes with some limitations. The first limitation is one of accuracy. By imposing free surface boundary conditions at a staircase boundary between cells, it approximates the solution to the free surface problem. Unlike the sticky air method, which implicitly accounts for surface position at a sub-grid level through the viscosity field, the staircase method's discrete interface is less accurate, especially at coarser resolutions such as those used in global models.</p>
      <p id="d2e459">While <xref ref-type="bibr" rid="bib1.bibx8" id="text.19"/> did not demonstrate this issue explicitly, their study compared the staircase method to a similarly discretised sticky air method that also used a discrete viscosity jump between air and rock layers. When comparing the staircase method to a sticky air method with a smooth viscosity transition that accounts for the sub-grid location of the surface, the staircase method performs less favourably, introducing a systematic error that persists across all resolutions. These results can be seen in Sect. <xref ref-type="sec" rid="Ch1.S5.SS1"/>.</p>
      <p id="d2e467">Another limitation of the staircase method is the absence of explicit velocity solutions above the surface. This creates challenges when using Lagrangian tracers near the surface, as velocity interpolation from the Eulerian grid requires contributions from neighbouring grid points. When air layer velocities are set to zero, inaccuracies arise in the advection of tracers near the surface.</p>
      <p id="d2e470">A further limitation of the staircase method is that when using a multigrid solver, the location of the surface on the coarser grids may not match the location of the surface on the finer grid levels, which introduces some complexity to the restriction and prolongation operators, potentially reducing iteration convergence, as discussed after the test results.</p>
</sec>
</sec>
<sec id="Ch1.S3">
  <label>3</label><title>Variational Stokes method</title>
      <p id="d2e482">A discretisation of the Stokes equations on staggered grids that implicitly models free surface boundary conditions was proposed by <xref ref-type="bibr" rid="bib1.bibx19" id="text.20"/>, henceforth referred to as the variational method. The method is conceptually similar to the staircase method in that it does not involve the solution of any equations within the air layer, instead modelling the free surface boundary condition through the use of alternative boundary conditions at the interface. The two methods differ in how they implement these alternative boundary conditions. While the staircase method used a discrete staircase representation of the surface at cell boundaries, the variational method constructs a smooth representation of the free surface boundary condition at the interface by using volume fractions.</p>
<sec id="Ch1.S3.SS1">
  <label>3.1</label><title>Variational form of the Stokes equations</title>
      <p id="d2e495">The variational form of the Stokes equations considers the steady-state, incompressible Stokes equations with variables: velocity <inline-formula><mml:math id="M16" display="inline"><mml:mi mathvariant="bold-italic">v</mml:mi></mml:math></inline-formula>, pressure <inline-formula><mml:math id="M17" display="inline"><mml:mi>p</mml:mi></mml:math></inline-formula>, deviatoric stress tensor <inline-formula><mml:math id="M18" display="inline"><mml:mi mathvariant="bold-italic">τ</mml:mi></mml:math></inline-formula>, density <inline-formula><mml:math id="M19" display="inline"><mml:mi mathvariant="italic">ρ</mml:mi></mml:math></inline-formula>, and gravitational acceleration <inline-formula><mml:math id="M20" display="inline"><mml:mi mathvariant="bold">g</mml:mi></mml:math></inline-formula>. The continuity and momentum equations are, respectively:

            <disp-formula id="Ch1.E2" content-type="numbered"><label>2</label><mml:math id="M21" 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:mtext>     </mml:mtext><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:mi mathvariant="bold-italic">τ</mml:mi><mml:mo>+</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold">g</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="bold">0</mml:mn><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          where the deviatoric stress tensor <inline-formula><mml:math id="M22" display="inline"><mml:mi mathvariant="bold-italic">τ</mml:mi></mml:math></inline-formula> is related to velocities by the constitutive law for an incompressible Newtonian viscous fluid:

            <disp-formula id="Ch1.E3" content-type="numbered"><label>3</label><mml:math id="M23" display="block"><mml:mrow><mml:mi mathvariant="bold-italic">τ</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="italic">η</mml:mi><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi><mml:msup><mml:mo>)</mml:mo><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mfenced><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d2e620">These equations can be reformulated in a variational form, where the problem is expressed as a functional for which a stationary point is sought in order to recover the original equations. Following <xref ref-type="bibr" rid="bib1.bibx19" id="text.21"/>, the variational formulation including body forces is given by:

            <disp-formula id="Ch1.E4" content-type="numbered"><label>4</label><mml:math id="M24" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:munder><mml:mo movablelimits="false">max⁡</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold-italic">τ</mml:mi></mml:mrow></mml:munder><mml:munder><mml:mo movablelimits="false">min⁡</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi></mml:munder><mml:munder><mml:mo movablelimits="false">∭</mml:mo><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi mathvariant="normal">F</mml:mi></mml:msub></mml:mrow></mml:munder></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mi>p</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:mi mathvariant="bold-italic">τ</mml:mi><mml:mo>:</mml:mo><mml:mfenced open="(" close=")"><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>+</mml:mo><mml:mo>(</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi><mml:msup><mml:mo>)</mml:mo><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle></mml:mfenced></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><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">4</mml:mn><mml:mi mathvariant="italic">η</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>|</mml:mo><mml:mi mathvariant="bold-italic">τ</mml:mi><mml:msubsup><mml:mo>|</mml:mo><mml:mi>F</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msubsup><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold">g</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>V</mml:mi><mml:mo>.</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula></p>
      <p id="d2e742">This continuous variational formulation may be discretised on a staggered grid following <xref ref-type="bibr" rid="bib1.bibx19" id="text.22"/>. The key step is to approximate the continuous volume integrals over the fluid domain <inline-formula><mml:math id="M25" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi mathvariant="normal">F</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> cellwise: each term in the integrand is evaluated at the discrete sample point of the relevant variable (cell centre for pressure, cell face for velocity, and cell centre or vertex for stress components), and the integral over that variable's control volume is approximated by multiplying the discretised term by the fractional volume of fluid material within that control volume. This fractional volume is the volume fraction <inline-formula><mml:math id="M26" display="inline"><mml:mi mathvariant="italic">ϕ</mml:mi></mml:math></inline-formula>, discussed further in Sect. <xref ref-type="sec" rid="Ch1.S3.SS3"/>. For cells entirely within the fluid domain <inline-formula><mml:math id="M27" display="inline"><mml:mrow><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> and the standard finite difference stencil is recovered exactly; for cells entirely outside the fluid <inline-formula><mml:math id="M28" display="inline"><mml:mrow><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> and those equations are excluded from the system; and for interfacial cells <inline-formula><mml:math id="M29" display="inline"><mml:mrow><mml:mn mathvariant="normal">0</mml:mn><mml:mo>&lt;</mml:mo><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>&lt;</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula>, giving a smooth approximation of the free surface boundary condition at sub-grid resolution. The discrete operators <inline-formula><mml:math id="M30" display="inline"><mml:mi mathvariant="bold">G</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M31" display="inline"><mml:mi mathvariant="bold">D</mml:mi></mml:math></inline-formula>, and <inline-formula><mml:math id="M32" display="inline"><mml:mi mathvariant="bold">M</mml:mi></mml:math></inline-formula> introduced below are therefore identical to those used in the standard staggered-grid Stokes discretisation – no new operators are required – and the entire effect of the free surface is encoded in the volume fraction weights that scale each term. The resulting discrete variational problem is:

            <disp-formula id="Ch1.E5" content-type="numbered"><label>5</label><mml:math id="M33" display="block"><mml:mrow><mml:munder><mml:mo movablelimits="false">max⁡</mml:mo><mml:mrow><mml:mi>p</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="bold-italic">τ</mml:mi></mml:mrow></mml:munder><mml:munder><mml:mo movablelimits="false">min⁡</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi></mml:munder><mml:msup><mml:mi mathvariant="bold">p</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>+</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">τ</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:mi mathvariant="bold">D</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">4</mml:mn></mml:mfrac></mml:mstyle><mml:msup><mml:mi mathvariant="bold-italic">τ</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:msup><mml:mi mathvariant="bold">M</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup><mml:mi mathvariant="bold-italic">τ</mml:mi><mml:mo>-</mml:mo><mml:msup><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold">g</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          where the continuous integrals of Eq. (<xref ref-type="disp-formula" rid="Ch1.E4"/>) have been replaced by their discrete analogues: the matrix <inline-formula><mml:math id="M34" display="inline"><mml:mi mathvariant="bold">G</mml:mi></mml:math></inline-formula> is the discrete gradient operator, with <inline-formula><mml:math id="M35" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mrow></mml:math></inline-formula> representing the discrete divergence by the adjoint relationship between the two; <inline-formula><mml:math id="M36" display="inline"><mml:mi mathvariant="bold">D</mml:mi></mml:math></inline-formula> is the discrete symmetric gradient operator <inline-formula><mml:math id="M37" display="inline"><mml:mrow><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle><mml:mo>(</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>+</mml:mo><mml:msup><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>; and <inline-formula><mml:math id="M38" display="inline"><mml:mi mathvariant="bold">M</mml:mi></mml:math></inline-formula> is a diagonal matrix of viscosity coefficients at the stress locations corresponding to the structure of <inline-formula><mml:math id="M39" display="inline"><mml:mi mathvariant="bold-italic">τ</mml:mi></mml:math></inline-formula>. The body force term <inline-formula><mml:math id="M40" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold">g</mml:mi></mml:mrow></mml:math></inline-formula> is the discrete counterpart of the volume integral <inline-formula><mml:math id="M41" display="inline"><mml:mrow><mml:msub><mml:mo>∭</mml:mo><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi mathvariant="normal">F</mml:mi></mml:msub></mml:mrow></mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold">g</mml:mi><mml:mo>⋅</mml:mo><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mi mathvariant="normal">d</mml:mi><mml:mi>V</mml:mi></mml:mrow></mml:math></inline-formula> in Eq. (<xref ref-type="disp-formula" rid="Ch1.E4"/>). Differentiating Eq. (<xref ref-type="disp-formula" rid="Ch1.E5"/>) with respect to <inline-formula><mml:math id="M42" display="inline"><mml:mi mathvariant="bold-italic">v</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M43" display="inline"><mml:mi mathvariant="bold-italic">τ</mml:mi></mml:math></inline-formula>, and <inline-formula><mml:math id="M44" display="inline"><mml:mi mathvariant="bold">p</mml:mi></mml:math></inline-formula> then recovers the discretised Stokes equations, which after stress elimination yield Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>).</p>
</sec>
<sec id="Ch1.S3.SS2">
  <label>3.2</label><title>Stress elimination in the variational Stokes discretisation</title>
      <p id="d2e1059">Differentiating the discretised variational formulation with respect to velocity <inline-formula><mml:math id="M45" display="inline"><mml:mi mathvariant="bold-italic">v</mml:mi></mml:math></inline-formula>, deviatoric stress <inline-formula><mml:math id="M46" display="inline"><mml:mi mathvariant="bold-italic">τ</mml:mi></mml:math></inline-formula>, and pressure <inline-formula><mml:math id="M47" display="inline"><mml:mi mathvariant="bold">p</mml:mi></mml:math></inline-formula> produces the block system:

            <disp-formula id="Ch1.E6" content-type="numbered"><label>6</label><mml:math id="M48" display="block"><mml:mrow><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center center center" framespacing="0em"><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mrow><mml:msup><mml:mi mathvariant="bold">D</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mtd><mml:mtd><mml:mi mathvariant="bold">G</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi mathvariant="bold">D</mml:mi></mml:mtd><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mstyle displaystyle="false"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle></mml:mstyle><mml:msup><mml:mi mathvariant="bold">M</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi mathvariant="bold-italic">τ</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi mathvariant="bold">p</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>=</mml:mo><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold">g</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d2e1179">Rearranging the central row gives the constitutive relation:

            <disp-formula id="Ch1.E7" content-type="numbered"><label>7</label><mml:math id="M49" display="block"><mml:mrow><mml:mi mathvariant="bold-italic">τ</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="bold">MD</mml:mi><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          which can be substituted into the remaining rows to eliminate <inline-formula><mml:math id="M50" display="inline"><mml:mi mathvariant="bold-italic">τ</mml:mi></mml:math></inline-formula>, yielding the discretised Stokes equations:

            <disp-formula id="Ch1.E8" content-type="numbered"><label>8</label><mml:math id="M51" display="block"><mml:mrow><mml:mfenced open="[" close="]"><mml:mtable class="matrix" columnalign="center center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:msup><mml:mi mathvariant="bold">D</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:mi mathvariant="bold">MD</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mi mathvariant="bold">G</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mfenced open="[" close="]"><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi mathvariant="bold">p</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>=</mml:mo><mml:mfenced open="[" close="]"><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold">g</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          where <inline-formula><mml:math id="M52" display="inline"><mml:mi mathvariant="bold">G</mml:mi></mml:math></inline-formula> is the discrete gradient operator (with <inline-formula><mml:math id="M53" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> the discrete divergence), <inline-formula><mml:math id="M54" display="inline"><mml:mi mathvariant="bold">D</mml:mi></mml:math></inline-formula> is the discrete symmetric gradient operator <inline-formula><mml:math id="M55" display="inline"><mml:mrow><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle><mml:mo>(</mml:mo><mml:mi mathvariant="normal">∇</mml:mi><mml:mo>+</mml:mo><mml:msup><mml:mi mathvariant="normal">∇</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, and <inline-formula><mml:math id="M56" display="inline"><mml:mi mathvariant="bold">M</mml:mi></mml:math></inline-formula> is a diagonal matrix of viscosity coefficients at the stress locations. With appropriate discrete operators <inline-formula><mml:math id="M57" display="inline"><mml:mi mathvariant="bold">G</mml:mi></mml:math></inline-formula> and <inline-formula><mml:math id="M58" display="inline"><mml:mi mathvariant="bold">D</mml:mi></mml:math></inline-formula>, this recovers an identical set of equations to the velocity-pressure Stokes system solved by StagYY and many other geodynamic codes. Where prescribed traction boundary conditions are required at the free surface, for instance when an external load is not explicitly modelled by the Stokes solver, an additional right-hand side contribution can be derived from the energy required to push against a surface stress field <inline-formula><mml:math id="M59" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="bold-italic">σ</mml:mi><mml:mtext>BC</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>p</mml:mi><mml:mtext>BC</mml:mtext></mml:msub><mml:mi mathvariant="bold">I</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="bold-italic">τ</mml:mi><mml:mtext>BC</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula>. Applying the divergence theorem over the air portion of the domain <inline-formula><mml:math id="M60" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>A</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and introducing the air fraction <inline-formula><mml:math id="M61" display="inline"><mml:mrow><mml:mi mathvariant="italic">ξ</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ϕ</mml:mi></mml:mrow></mml:math></inline-formula>, the discretised traction contribution to the right-hand side is:

            <disp-formula id="Ch1.E9" content-type="numbered"><label>9</label><mml:math id="M62" display="block"><mml:mrow><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:mi mathvariant="bold">G</mml:mi><mml:msup><mml:mi mathvariant="italic">ξ</mml:mi><mml:mi>p</mml:mi></mml:msup><mml:msub><mml:mi>p</mml:mi><mml:mtext>BC</mml:mtext></mml:msub><mml:mo>-</mml:mo><mml:msup><mml:mi mathvariant="italic">ξ</mml:mi><mml:mi>v</mml:mi></mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:msub><mml:mi>p</mml:mi><mml:mtext>BC</mml:mtext></mml:msub><mml:mo>+</mml:mo><mml:msup><mml:mi mathvariant="bold">D</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:msup><mml:mi mathvariant="italic">ξ</mml:mi><mml:mi mathvariant="italic">τ</mml:mi></mml:msup><mml:msub><mml:mi mathvariant="bold-italic">τ</mml:mi><mml:mtext>BC</mml:mtext></mml:msub><mml:mo>-</mml:mo><mml:msup><mml:mi mathvariant="italic">ξ</mml:mi><mml:mi>v</mml:mi></mml:msup><mml:msup><mml:mi mathvariant="bold">D</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:msub><mml:mi mathvariant="bold-italic">τ</mml:mi><mml:mtext>BC</mml:mtext></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          which is simply added to the right-hand side of Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>). This contribution is nonzero only within interfacial cells where the appropriate volume fractions and air fractions are simultaneously nonzero.</p>
</sec>
<sec id="Ch1.S3.SS3">
  <label>3.3</label><title>Volume fractions</title>
      <p id="d2e1483">Further progress on the free surface problem requires the use of cellwise volume fractions. The volume fraction function, denoted by <inline-formula><mml:math id="M63" display="inline"><mml:mi mathvariant="italic">ϕ</mml:mi></mml:math></inline-formula>, is defined as the fraction of material (rock, for geodynamic applications) occupying a given computational cell, and therefore satisfies <inline-formula><mml:math id="M64" display="inline"><mml:mrow><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> for a completely empty cell and <inline-formula><mml:math id="M65" display="inline"><mml:mrow><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> for a completely full cell (Fig. <xref ref-type="fig" rid="F2"/>). Partially filled cells arise in the vicinity of the free surface.</p>

      <fig id="F2"><label>Figure 2</label><caption><p id="d2e1521">The volume fraction function <inline-formula><mml:math id="M66" display="inline"><mml:mi mathvariant="italic">ϕ</mml:mi></mml:math></inline-formula> for a given control volume is defined as 0 if the cell is completely empty, and 1 if it is completely full.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f02.png"/>

        </fig>

      <p id="d2e1537">On a staggered grid, variables are located at cell centres, faces, edges, and nodes. Volume fractions are therefore defined at the corresponding locations: <inline-formula><mml:math id="M67" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> for pressure points (cell centres), and <inline-formula><mml:math id="M68" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi mathvariant="italic">τ</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> for stresses, which may be located at cell vertices or cell centres. For example, <inline-formula><mml:math id="M69" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><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:msup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M70" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>y</mml:mi><mml:mi>y</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> are located at cell centres and are identical to <inline-formula><mml:math id="M71" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula>, while <inline-formula><mml:math id="M72" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>x</mml:mi><mml:mi>y</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> is located at cell vertices in 2D (edge centres in 3D).</p>
      <p id="d2e1629">A key result of <xref ref-type="bibr" rid="bib1.bibx19" id="text.23"/> is that the free surface problem can be treated by multiplying the terms in the discretised variational formulation by their corresponding volume fractions, motivated by the fact that the continuous volume integrals over <inline-formula><mml:math id="M73" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi mathvariant="normal">F</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> are approximated cellwise using <inline-formula><mml:math id="M74" display="inline"><mml:mi mathvariant="italic">ϕ</mml:mi></mml:math></inline-formula>. Applying this to Eq. (<xref ref-type="disp-formula" rid="Ch1.E8"/>) yields the full free-surface pressure-velocity system:

            <disp-formula id="Ch1.E10" content-type="numbered"><label>10</label><mml:math id="M75" display="block"><mml:mrow><mml:mfenced open="[" close="]"><mml:mtable class="matrix" columnalign="center center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:msup><mml:mi mathvariant="bold">D</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:mi mathvariant="bold">M</mml:mi><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi mathvariant="italic">τ</mml:mi></mml:msup><mml:mi mathvariant="bold">D</mml:mi></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mi mathvariant="bold">G</mml:mi><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:msup></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mrow><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:msup><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup></mml:mrow></mml:mtd><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mi mathvariant="bold-italic">v</mml:mi></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mi mathvariant="bold">p</mml:mi></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>=</mml:mo><mml:mfenced close="]" open="["><mml:mtable class="matrix" columnalign="center" framespacing="0em"><mml:mtr><mml:mtd><mml:mrow><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">v</mml:mi><mml:mi>z</mml:mi></mml:msub></mml:mrow></mml:msup><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi mathvariant="bold">g</mml:mi></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd><mml:mn mathvariant="normal">0</mml:mn></mml:mtd></mml:mtr></mml:mtable></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>

          where <inline-formula><mml:math id="M76" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mrow><mml:msub><mml:mi mathvariant="normal">v</mml:mi><mml:mi>z</mml:mi></mml:msub></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> is the volume fraction evaluated at vertical velocity points, and <inline-formula><mml:math id="M77" display="inline"><mml:mi mathvariant="italic">ρ</mml:mi></mml:math></inline-formula> is the density field evaluated at the same locations. For consistency with the volume-fraction weighting of the left-hand side, the density is taken as the product of a background density and the appropriate volume fraction, so that the body force vanishes automatically in cells outside the fluid domain. This approach introduces minor errors near lateral density variations, discussed further in Sect. <xref ref-type="sec" rid="Ch1.S4.SS2"/>.</p>

      <fig id="F3"><label>Figure 3</label><caption><p id="d2e1770">The continuity equation is solved in a given cell if the volume fraction centred on the central pressure point is nonzero, i.e. <inline-formula><mml:math id="M78" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:msub><mml:mo>&gt;</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula>.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f03.png"/>

        </fig>

      <fig id="F4"><label>Figure 4</label><caption><p id="d2e1796">In 2D, the <inline-formula><mml:math id="M79" display="inline"><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mi>x</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M80" display="inline"><mml:mrow><mml:msub><mml:mi>v</mml:mi><mml:mi>z</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> momentum equations are solved only if at least one of the pictured volume fractions surrounding the velocity point is nonzero.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f04.png"/>

        </fig>

      <p id="d2e1827">Since <inline-formula><mml:math id="M81" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:msup><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> for cells entirely outside the fluid domain, the discretised continuity equation <inline-formula><mml:math id="M82" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:msup><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">T</mml:mi></mml:msup><mml:mi mathvariant="bold-italic">v</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="bold">0</mml:mn></mml:mrow></mml:math></inline-formula> is solved only where fluid is present. Likewise, momentum equations are omitted where both <inline-formula><mml:math id="M83" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi mathvariant="italic">τ</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M84" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> are simultaneously zero. In these cases the system becomes singular, and the corresponding pressure or velocity degrees of freedom are set to zero. The control volumes governing equation activation in 2D are illustrated in Figs. <xref ref-type="fig" rid="F3"/> and <xref ref-type="fig" rid="F4"/>.</p>

      <fig id="F5"><label>Figure 5</label><caption><p id="d2e1897">The discretised Stokes equations on a simplified domain using the variational method. Cell-centred volume fractions <inline-formula><mml:math id="M85" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϕ</mml:mi><mml:mi mathvariant="normal">P</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> dictate where the continuity equation is solved; cells with zero volume fraction (white) are excluded.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f05.png"/>

        </fig>

      <p id="d2e1917">The result is a system that excludes pressure unknowns in cells with no fluid content and excludes velocity unknowns more than 1.5 cell widths from the surface. A benefit over the staircase method is that velocities are explicitly computed within 1.5 cell distances of the surface, making direct interpolation of surface velocities possible without extrapolation. The discretisation for the same domain shown in Fig. <xref ref-type="fig" rid="F1"/> is illustrated for the variational method in Fig. <xref ref-type="fig" rid="F5"/>.</p>
</sec>
</sec>
<sec id="Ch1.S4">
  <label>4</label><title>Implementation using staggered-grid finite differences</title>
      <p id="d2e1933">The implementation of the variational Stokes method in a finite-difference numerical geodynamical modelling code such as StagYY involves several steps: determination of volume fractions, the treatment of boundary conditions, the treatment of near-surface densities and viscosities, and the application of the method to the multigrid solver.</p>
<sec id="Ch1.S4.SS1">
  <label>4.1</label><title>Obtaining volume fractions</title>
      <p id="d2e1943">Volume fractions <inline-formula><mml:math id="M86" display="inline"><mml:mi mathvariant="italic">ϕ</mml:mi></mml:math></inline-formula> are a prerequisite for implementing the variational Stokes method. There are several possible methods for obtaining volume fractions, such as Lagrangian surface tracking or the volume of fluid method <xref ref-type="bibr" rid="bib1.bibx14 bib1.bibx15" id="paren.24"/>. In this study, Lagrangian surface tracking was used exclusively to track the surface.</p>
      <p id="d2e1956">When using a Lagrangian tracking method to track the location of the surface, such as the surface marker chain or mesh, it is possible to obtain the volume fractions required for the variational method by integrating underneath the surface. In 2D, volume fractions may be determined by iterating over the piecewise linear representation of the surface, and determining whether each given cell is fully beneath the surface, fully above, or partially below and above. In all cases tested, the computational effort required to obtain volume fractions scales linearly <inline-formula><mml:math id="M87" display="inline"><mml:mrow><mml:mi>O</mml:mi><mml:mo>(</mml:mo><mml:mi>n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> with number of surface markers, and computational cost of determining them was experimentally found to be small in comparison to the total runtime of the models <xref ref-type="bibr" rid="bib1.bibx14" id="paren.25"/>.</p>
</sec>
<sec id="Ch1.S4.SS2">
  <label>4.2</label><title>Near-surface densities and viscosities</title>
      <p id="d2e1985">In order to capture near-surface densities and viscosities, a reference value must be chosen for density and viscosity near the surface, to which the appropriate volume fraction is multiplied in order to obtain a fractional value. This approach works for situations in which density and viscosity are constant, as the reference values are known. However, in situations where there are lateral hetereogeneities in near-surface density and viscosity, it can result in minor errors as the reference values may not correspond to the actual density near-surface values at all points.</p>
      <p id="d2e1988">A potential solution to this problem is to copy reference values from cells immediately below the surface, i.e. the closest cell that does not contain air. In testing, while this approach appeared to provide more accurate results for the density field, testing with the 2D subduction benchmark presented by <xref ref-type="bibr" rid="bib1.bibx24" id="text.26"/> resulted in differing subduction behaviour as a consequence of subtle variations in the viscosity field near the air-mantle-slab triple junction. In some cases due to the copying of these viscosities, slab break-off was made impossible as it became impossible to create a mantle wedge. As a consequence of this negative result, the results shown consider the use of fixed reference densities and viscosities. Finding the correct treatment for near-surface viscosities is a key future research direction.</p>

      <fig id="F6"><label>Figure 6</label><caption><p id="d2e1996">Restriction of the volume fraction function can be achieved by combining neighbouring volume fractions on the fine grid to form the coarse grid.</p></caption><alt-text>Volume fraction restriction to coarse grids when using the multigrid method</alt-text>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f06.png"/>

        </fig>

</sec>
<sec id="Ch1.S4.SS3">
  <label>4.3</label><title>Multigrid solver</title>
      <p id="d2e2015">A key feature of the variational Stokes method is its ability to be applied to multigrid solvers. The application of volume fraction based methods to multigrid solvers has been demonstrated in the past. For example, <xref ref-type="bibr" rid="bib1.bibx23" id="text.27"/> demonstrated the use of a volume fraction based on the solver developed by <xref ref-type="bibr" rid="bib1.bibx4" id="paren.28"/> for solving Poisson equations with a multigrid solver.</p>
      <p id="d2e2024">The multigrid implementation can be achieved by restricting the volume fraction field to a coarse grid through simple averaging of fine grid volume fractions (Fig. <xref ref-type="fig" rid="F6"/>). In contrast, in the staircase method the volume fraction is either 1 or 0.</p>
      <p id="d2e2029">This coarse grid restriction can easily be achieved in 2D and 3D by averaging 4 or 8 fine grid cells, respectively. The extension to 3D is particularly important, as 3D models in StagYY require the use of iterative multigrid solvers.</p>
</sec>
</sec>
<sec id="Ch1.S5">
  <label>5</label><title>Test results</title>
      <p id="d2e2042">Results are demonstrated in both 2D and 3D for the three free surface modelling methods: the sticky air method, staircase method, and the newly implemented variational method. These benchmarks aim to demonstrate the accuracy and efficiency of the new variational method in comparison to the existing free surface modelling methods.</p>
      <p id="d2e2045">Unless stated otherwise, the surface is tracked for all methods using Lagrangian surface tracking with a bilinear interpolation step, similar to that described in <xref ref-type="bibr" rid="bib1.bibx8" id="text.29"/>. This method was found to be able to accurately track free surfaces with minimal additional computational cost.</p>
<sec id="Ch1.S5.SS1">
  <label>5.1</label><title>2D inclusion benchmark</title>
      <p id="d2e2058">Analytical solutions to simple problems involving the Stokes equation exist for benchmarking our methods. An analytical solution was employed by <xref ref-type="bibr" rid="bib1.bibx8" id="text.30"/> to benchmark the staircase method and examine its performance when scaling with resolution.</p>
      <p id="d2e2064">The test involves Stokes flow around a viscous inclusion in a 2D Cartesian domain, for which there exists an analytical solution <xref ref-type="bibr" rid="bib1.bibx25" id="paren.31"/>. In the case of a vanishing inclusion viscosity, the boundary conditions at the interface are identical to free surface boundary conditions (i.e. zero normal and shear stress at the interface). Dirichlet boundary conditions are imposed at the other edges of the model, which correspond to the analytical solution. This test was implemented in code written in Julia, based on the original MATLAB version presented in <xref ref-type="bibr" rid="bib1.bibx8" id="text.32"/>.</p>

      <fig id="F7" specific-use="star"><label>Figure 7</label><caption><p id="d2e2075">Errors in pressure (top row), <inline-formula><mml:math id="M88" display="inline"><mml:mi>x</mml:mi></mml:math></inline-formula>-velocity (middle row), and <inline-formula><mml:math id="M89" display="inline"><mml:mi>y</mml:mi></mml:math></inline-formula>-velocity (bottom row) for the sticky air method with <inline-formula><mml:math id="M90" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mtext>rock</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> (left column), the staircase method (centre column), and the variational method (right column), each run at a resolution of 100 <inline-formula><mml:math id="M91" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 100. The sticky air method produces significant errors at and near the interface; these near-boundary errors are caused by the viscosity discontinuity itself and persist regardless of the viscosity contrast <xref ref-type="bibr" rid="bib1.bibx7 bib1.bibx16" id="paren.33"/>. The staircase method reduces far-field errors but exhibits elevated errors near the surface owing to its discrete boundary representation. The variational method achieves the closest agreement with the analytical solution, reducing both near- and far-field errors across all fields.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f07.png"/>

        </fig>

      <p id="d2e2134">An improved version of the sticky-air method was implemented, differing from the results presented in <xref ref-type="bibr" rid="bib1.bibx8" id="paren.34"/>. The results of that paper considered viscosity as a step function, where a cell whose midpoint was below the surface had the rock viscosity, and the cells whose midpoint was above had the air viscosity. This resulted in an unrealistic representation of viscosity, especially compared to how viscosity is typically computed in numerical geodynamic models. In these results, viscosity near the surface is multiplied with the appropriate volume fraction in order to obtain a smooth representation of viscosity near the surface, providing more accurate sticky air results than the original paper. This approach also highlights the limitations of the staircase discretisation arising from a discrete staircase representation of the surface.</p>
      <p id="d2e2140">The three surface modelling methods are compared against the analytical solution in terms of pressure and velocity errors. Figure <xref ref-type="fig" rid="F7"/> shows the absolute errors of the sticky air method (with <inline-formula><mml:math id="M92" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mtext>rock</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>), the staircase method, and the variational method with respect to the analytical solution when run with a model resolution of 100 <inline-formula><mml:math id="M93" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 100. Only cells entirely within the fluid domain are compared, as cells within the air layer do not correspond to physical values for this case.</p>
      <p id="d2e2177">The results qualitatively show that the variational method reduces errors in solution in comparison to both the sticky air method and the staircase method. The difference is most apparent when considering the pressure error. The sticky air method, as a result of its large viscosity contrast that cuts across grid cells, produces large errors in pressure at the boundary <xref ref-type="bibr" rid="bib1.bibx7 bib1.bibx16" id="paren.35"/> and an offset throughout the domain. While the staircase method is able to reduce the error far from the surface, this comes at the cost of high errors close to the surface arising from the discrete nature of the staircase approach. The variational method appears to be able to overcome many of these near- and far-field errors, and provide a visibly closer fit to the analytical solution overall. A similar situation exists for the velocity errors.</p>
      <p id="d2e2183">In order to quantitatively analyse the performance of each method, models were run at a range of resolutions ranging from 10 <inline-formula><mml:math id="M94" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 10 to 1200 <inline-formula><mml:math id="M95" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 1200 cells. The errors in pressure and velocities using the <inline-formula><mml:math id="M96" display="inline"><mml:mrow><mml:msub><mml:mi>L</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> norm can then be compared and plotted as a function of grid spacing to investigate the scaling performance of each method. As the sticky air method is viscosity dependent, three viscosity contrasts were compared, namely <inline-formula><mml:math id="M97" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mtext>rock</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>, 5 <inline-formula><mml:math id="M98" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 10<sup>−3</sup>, and <inline-formula><mml:math id="M100" display="inline"><mml:mrow><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d2e2273">Figure <xref ref-type="fig" rid="F8"/> considers the pressure errors in the <inline-formula><mml:math id="M101" display="inline"><mml:mrow><mml:msub><mml:mi>L</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> norm over the <inline-formula><mml:math id="M102" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula> cells in the model. The definition of these errors is given by:

            <disp-formula id="Ch1.E11" content-type="numbered"><label>11</label><mml:math id="M103" display="block"><mml:mrow><mml:mo>|</mml:mo><mml:mo>|</mml:mo><mml:mi>P</mml:mi><mml:mo>-</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mi mathvariant="normal">a</mml:mi></mml:msub><mml:mo>|</mml:mo><mml:msub><mml:mo>|</mml:mo><mml:mrow><mml:msub><mml:mi>L</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mi>V</mml:mi></mml:mfrac></mml:mstyle><mml:munder><mml:mo movablelimits="false">∑</mml:mo><mml:mrow><mml:mi>i</mml:mi><mml:mo>∈</mml:mo><mml:mi mathvariant="normal">Ω</mml:mi></mml:mrow></mml:munder><mml:mo>|</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>P</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">a</mml:mi></mml:mrow></mml:msub><mml:mo>|</mml:mo><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula>

          where <inline-formula><mml:math id="M104" display="inline"><mml:mi mathvariant="normal">Ω</mml:mi></mml:math></inline-formula> denotes the fluid domain, <inline-formula><mml:math id="M105" display="inline"><mml:mi>V</mml:mi></mml:math></inline-formula> is the volume of the fluid domain, and <inline-formula><mml:math id="M106" display="inline"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mi mathvariant="normal">a</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is the analytical solution.</p>

      <fig id="F8"><label>Figure 8</label><caption><p id="d2e2397">The <inline-formula><mml:math id="M107" display="inline"><mml:mrow><mml:msub><mml:mi>L</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> error in pressure <inline-formula><mml:math id="M108" display="inline"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mtext>err</mml:mtext></mml:msub></mml:mrow></mml:math></inline-formula> follows a first order scaling with increasing grid resolution <inline-formula><mml:math id="M109" display="inline"><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>/</mml:mo><mml:mi>h</mml:mi></mml:mrow></mml:math></inline-formula>. The sticky air method quickly fails depending on viscosity, and the staircase method also achieves first order scaling but is overall less accurate.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f08.png"/>

        </fig>

      <p id="d2e2440">These pressure error tests reveal that the pressure errors with the variational method have first order scaling with resolution in the <inline-formula><mml:math id="M110" display="inline"><mml:mrow><mml:msub><mml:mi>L</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> norm, similarly to the staircase method.</p>

      <fig id="F9" specific-use="star"><label>Figure 9</label><caption><p id="d2e2456">The <inline-formula><mml:math id="M111" display="inline"><mml:mrow><mml:msub><mml:mi>L</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> error in velocity for the variational method achieves first order scaling with grid spacing, as does the staircase method. The scaling of the sticky air method is viscosity contrast dependent. The variational method is overall more accurate than the staircase method.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f09.png"/>

        </fig>

      <p id="d2e2476">In Fig. <xref ref-type="fig" rid="F9"/>, the errors in velocity in each dimension are compared using the <inline-formula><mml:math id="M112" display="inline"><mml:mrow><mml:msub><mml:mi>L</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> norm, with definitions similar to those of the pressure errors.</p>
      <p id="d2e2492">The results from this analytical test reveal that the variational Stokes method is overall more accurate than the staircase method, and does not suffer from the viscosity contrast dependence of the sticky air method which becomes apparent at higher resolution.</p>

      <fig id="F10" specific-use="star"><label>Figure 10</label><caption><p id="d2e2498">2D surface relaxation benchmark based on Case 1 presented by <xref ref-type="bibr" rid="bib1.bibx6" id="text.36"/>. An initially non-flat surface in a three-layer model relaxes until equilibrium is reached after approximately 100 <inline-formula><mml:math id="M113" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">ky</mml:mi></mml:mrow></mml:math></inline-formula>.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f10.png"/>

        </fig>

</sec>
<sec id="Ch1.S5.SS2">
  <label>5.2</label><title>2D relaxation benchmark</title>
      <p id="d2e2526">The 2D surface relaxation benchmark (Fig. <xref ref-type="fig" rid="F10"/>) is based on Case 1 as presented by <xref ref-type="bibr" rid="bib1.bibx6" id="text.37"/>. It considers the time dependent relaxation of an initially non-flat surface with initial topography <inline-formula><mml:math id="M114" display="inline"><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mtext>init</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> given by the function:

            <disp-formula id="Ch1.E12" content-type="numbered"><label>12</label><mml:math id="M115" display="block"><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mtext>init</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">7</mml:mn><mml:mi>cos⁡</mml:mi><mml:mfenced open="(" close=")"><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:mi>x</mml:mi></mml:mrow><mml:mrow><mml:mn mathvariant="normal">2800</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d2e2596">The model domain is a 2800 <inline-formula><mml:math id="M116" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M117" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 800 <inline-formula><mml:math id="M118" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> Cartesian box consisting of three compositional layers: a 600 <inline-formula><mml:math id="M119" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> thick mantle layer, a more viscous 100 <inline-formula><mml:math id="M120" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> thick lithosphere, and a 100 <inline-formula><mml:math id="M121" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> thick air layer. This problem is simple enough to have an analytical solution for surface position as a function of time as derived using a three-layer model <xref ref-type="bibr" rid="bib1.bibx22" id="paren.38"/>. Starting from an initial maximum of 7 <inline-formula><mml:math id="M122" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula>, the maximum topography as a function of time <inline-formula><mml:math id="M123" display="inline"><mml:mrow><mml:mi>z</mml:mi><mml:mspace linebreak="nobreak" width="0.25em"/><mml:mtext>max</mml:mtext><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is given by:

            <disp-formula id="Ch1.E13" content-type="numbered"><label>13</label><mml:math id="M124" display="block"><mml:mrow><mml:msub><mml:mi>z</mml:mi><mml:mtext>max</mml:mtext></mml:msub><mml:mo>(</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mn mathvariant="normal">7</mml:mn><mml:mi>exp⁡</mml:mi><mml:mfenced open="(" close=")"><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>-</mml:mo><mml:mi>t</mml:mi></mml:mrow><mml:mrow><mml:mn mathvariant="normal">14.825</mml:mn><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mrow class="unit"><mml:mi mathvariant="normal">y</mml:mi></mml:mrow></mml:mrow></mml:mfrac></mml:mstyle></mml:mfenced><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d2e2719">In the tests here the resolution is 512 <inline-formula><mml:math id="M125" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 128, with 100 tracers per cell for advecting material properties. When using the sticky air method, a viscosity of 10<sup>18</sup> <inline-formula><mml:math id="M127" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">Pa</mml:mi><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mi mathvariant="normal">s</mml:mi></mml:mrow></mml:math></inline-formula> was used. Symmetric boundary conditions are imposed at the horizontal edges of the model, while a no-slip boundary condition is imposed at the bottom boundary, and a free slip condition is imposed at the top. Acceleration due to gravity <inline-formula><mml:math id="M128" display="inline"><mml:mi>g</mml:mi></mml:math></inline-formula> is set to 10 <inline-formula><mml:math id="M129" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msup><mml:mi mathvariant="normal">s</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>. For consistency with the benchmarks run by <xref ref-type="bibr" rid="bib1.bibx6" id="text.39"/>, models were run until <inline-formula><mml:math id="M130" display="inline"><mml:mi>t</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M131" display="inline"><mml:mo>=</mml:mo></mml:math></inline-formula> 100 <inline-formula><mml:math id="M132" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">ky</mml:mi></mml:mrow></mml:math></inline-formula> to show the system reaching equilibrium. Timesteps were limited to 500 years in order to give high temporal resolution for plots of model evolution.</p>

      <fig id="F11" specific-use="star"><label>Figure 11</label><caption><p id="d2e2802">2D relaxation benchmark comparing performance of different discretisation methods with an analytical solution. All methods tested are able to closely track the analytical solution.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f11.png"/>

        </fig>

      <p id="d2e2811">In Fig. <xref ref-type="fig" rid="F11"/>, the three discretisation methods are compared against the analytical solution. The result of this benchmark shows that all methods are able to very closely track the analytical solution. The staircase and variational methods in particular are close to the analytical solution, perhaps as a result of minor surface stresses created by the interface to the sticky air layer preventing the sticky air method from relaxing as quickly.</p>

      <fig id="F12" specific-use="star"><label>Figure 12</label><caption><p id="d2e2818">The 2D subduction benchmark is based on Case 1 presented in <xref ref-type="bibr" rid="bib1.bibx24" id="text.40"/>, and considers subduction initiation in this simplified viscous setup. Diagram not to scale.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f12.png"/>

        </fig>

</sec>
<sec id="Ch1.S5.SS3">
  <label>5.3</label><title>2D subduction benchmark</title>
      <p id="d2e2839">In order to test the ability of the implemented methods to track surfaces near convergent margins, particularly subduction zones, the simple isothermal viscous subduction benchmark proposed by <xref ref-type="bibr" rid="bib1.bibx24" id="text.41"/> was used with the model setup given in Fig. <xref ref-type="fig" rid="F12"/>.</p>
      <p id="d2e2847">The model setup consists of a gravitationally unstable lithospheric slab sinking and initiating a new subduction zone. The models are run on a 3000 <inline-formula><mml:math id="M133" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M134" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 750 <inline-formula><mml:math id="M135" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> Cartesian box domain at a resolution of 512 <inline-formula><mml:math id="M136" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 64. The lithosphere has a thickness of 100 <inline-formula><mml:math id="M137" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula>, a density 100 <inline-formula><mml:math id="M138" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">kg</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msup><mml:mi mathvariant="normal">m</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> greater than the surrounding mantle, and a viscosity 100 times greater than the surrounding mantle. At the top of the model is a 50 <inline-formula><mml:math id="M139" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> thick air layer. When using the sticky air method, a viscosity of 10<sup>19</sup> <inline-formula><mml:math id="M141" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">Pa</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mi mathvariant="normal">s</mml:mi></mml:mrow></mml:math></inline-formula>, 100 times lower than the viscosity of the mantle and 10 000 times lower than the viscosity of the slab, is used. Free slip boundary conditions are imposed on model boundaries. Acceleration due to gravity <inline-formula><mml:math id="M142" display="inline"><mml:mi>g</mml:mi></mml:math></inline-formula> is set to 9.81 <inline-formula><mml:math id="M143" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi><mml:mspace linebreak="nobreak" width="0.125em"/><mml:msup><mml:mi mathvariant="normal">s</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>. The models were run for a total of 100 <inline-formula><mml:math id="M144" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">My</mml:mi></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d2e2967">The results for this benchmark presented in <xref ref-type="bibr" rid="bib1.bibx24" id="text.42"/> are notable for the large differences in results produced as a result of relatively minor changes in the viscosity field, such as the use of different viscosity interpolation schemes. This fundamental instability is a result of minute differences in viscosity near the mantle-lithosphere-air triple junction causing radically different subduction initiation behaviour. In the models run for this study, a geometric average is used for viscosity interpolation.</p>

      <fig id="F13" specific-use="star"><label>Figure 13</label><caption><p id="d2e2976">2D subduction benchmark topography after 40 <inline-formula><mml:math id="M145" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">My</mml:mi></mml:mrow></mml:math></inline-formula> for the three discretisation methods. There are slight differences in subduction performance when using a sticky air method as opposed to either the staircase or variational methods, which produce very similar results.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f13.png"/>

        </fig>

      <fig id="F14" specific-use="star"><label>Figure 14</label><caption><p id="d2e2995">Slab tip depth over time for the three discretisation methods, demonstrating the slightly delayed subduction initiation seen when using the staircase and variational methods compared to the sticky air method.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f14.png"/>

        </fig>

      <p id="d2e3004">The topography generated by the three methods, plotted at 40 <inline-formula><mml:math id="M146" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">My</mml:mi></mml:mrow></mml:math></inline-formula> in Fig. <xref ref-type="fig" rid="F13"/>, reveals that the variational method and staircase method produce extremely similar results, in contrast to the sticky air method, which exhibits slightly faster subduction; the corresponding slab profiles at 40 <inline-formula><mml:math id="M147" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">My</mml:mi></mml:mrow></mml:math></inline-formula> are visually indistinguishable between the staircase and variational methods, with only a slightly more developed slab visible in the sticky air case. Figure <xref ref-type="fig" rid="F14"/> demonstrates the differing rates of subduction between the three methods by considering the depth of the tip of the subducting slab over time.</p>
      <p id="d2e3027">These results are not consistent with results obtained from the sticky air method with a higher viscosity contrast, in which case subduction was shown to be faster. While the two true free surface methods would be expected to show the fastest subduction due to a lack of resistance from the air layer, they instead produce slightly slower, delayed subduction. This behaviour is a direct consequence of the near-surface viscosity limitation described in Sect. <xref ref-type="sec" rid="Ch1.S4.SS2"/>: errors in the treatment of viscosity at interfacial cells affect the stress state near the air-mantle-lithosphere triple junction, which in turn influences subduction initiation timing. As noted there, this sensitivity is not specific to the variational method – <xref ref-type="bibr" rid="bib1.bibx24" id="text.43"/> document the same instability across a range of codes – but it does highlight that improving near-surface viscosity treatment is a prerequisite for reliable use of any free-surface method in subduction settings. This remains an important direction for future work, as discussed further in Sect. <xref ref-type="sec" rid="Ch1.S6"/>.</p>
</sec>
<sec id="Ch1.S5.SS4">
  <label>5.4</label><title>2D scaling tests</title>
      <p id="d2e3045">Scaling tests in 2D were performed using a non-dimensional model in spherical annulus geometry <xref ref-type="bibr" rid="bib1.bibx17" id="paren.44"/>. The model setup involves a constant viscosity mantle with Rayleigh number <inline-formula><mml:math id="M148" display="inline"><mml:mrow><mml:mi mathvariant="italic">Ra</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">7</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>, an air layer with a thickness 10 % of the mantle's thickness, and, in the case of the sticky air method, a viscosity contrast of <inline-formula><mml:math id="M149" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mtext>rock</mml:mtext></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi mathvariant="italic">η</mml:mi><mml:mtext>air</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">3</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula>. Each scaling model was run for 5000 timesteps to ensure steady-state convection was achieved. The computational performance of the Stokes solver–typically the most resource-intensive component of numerical geodynamic models–was assessed across three discretisation methods. Tests were conducted at various resolutions, ranging from 128 <inline-formula><mml:math id="M150" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 16 to 1024 <inline-formula><mml:math id="M151" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 128 to evaluate solver performance at different resolutions. Simulations were run in parallel on 4 cores for lower resolutions and 8 cores for higher resolutions, using an AMD Ryzen 9 3900XT processor.</p>

      <fig id="F15" specific-use="star"><label>Figure 15</label><caption><p id="d2e3107">Mean Stokes solver runtime per timestep across all resolutions, comparing direct and iterative solvers. Performance is consistent between discretisation methods when using a direct solver (typical for 2D models), but with an iterative multigrid solver, significant performance gains are observed when using the variational method.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f15.png"/>

        </fig>

      <p id="d2e3116">The performance results, illustrated in Fig. <xref ref-type="fig" rid="F15"/>, show the mean Stokes solver runtime per timestep, averaged over 5000 timesteps. All methods perform comparably when using a direct solver–the most common approach for 2D models. For these tests the MUMPS solver <xref ref-type="bibr" rid="bib1.bibx1 bib1.bibx2" id="paren.45"/> is used via the PETSc toolkit <xref ref-type="bibr" rid="bib1.bibx3" id="paren.46"/>. This consistency aligns with the fact that the size of the linear system remains identical across discretisation methods. However, when employing an iterative multigrid solver, significant performance improvements are achieved with the staircase and variational methods, the latter offering the most notable and consistent gains over the sticky air method. This reflects a smaller number of multigrid V-cycles necessary to reach satisfactory convergence.</p>
      <p id="d2e3128">Interestingly, at the highest resolution of 1024 <inline-formula><mml:math id="M152" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 128, the staircase method exhibited worse performance than the sticky air method. This outcome, verified through repeated simulations, may indicate that this combination of resolution and free surface position is particularly challenging to solve. Such behaviour can conceivably arise when the position of the free surface at coarse grid levels does not match its position on the fine grid, reducing the effectiveness of coarse-grid iterations and necessitating more fine-grid iterations. Indeed, experiments indicate that the convergence of V-cycles can be quite sensitive to the vertical position of the free surface, supporting this interpretation. This problem does not appear to affect the variational method, which is able to approximate the free surface boundary condition with sub-grid resolution on coarse grids as well as on fine grids. On coarse grids the free surface remains in the same position, just becoming vertically smeared. It is possible that for the staircase method, more work on restriction and prolongation operators in the region of the free surface could improve convergence.</p>
</sec>
<sec id="Ch1.S5.SS5">
  <label>5.5</label><title>3D scaling tests</title>
      <p id="d2e3146">3D scaling tests are used to assess the performance of the three methods. A constant viscosity Cartesian box setup featuring convection with a Rayleigh number of <inline-formula><mml:math id="M153" display="inline"><mml:mrow><mml:mi mathvariant="italic">Ra</mml:mi><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">7</mml:mn></mml:msup></mml:mrow></mml:math></inline-formula> was run at a variety of resolutions ranging from 32 <inline-formula><mml:math id="M154" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 32 <inline-formula><mml:math id="M155" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 16 to 256 <inline-formula><mml:math id="M156" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 256 <inline-formula><mml:math id="M157" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 128. When using the sticky air method, an air layer with viscosity 1000 times less than the mantle and 10 % the thickness of the mantle was used. Models were run for a total of 5000 timesteps to ensure a steady state convection was reached. As direct solvers are unavailable for 3D cases, only iterative multigrid solvers can be compared, in contrast with the 2D performance benchmarks shown in Sect. <xref ref-type="sec" rid="Ch1.S5.SS4"/>.</p>

      <fig id="F16"><label>Figure 16</label><caption><p id="d2e3197">Mean Stokes solver runtime per timestep for 3D scaling tests, conducted using an iterative multigrid solver on a constant-viscosity Cartesian box domain at various resolutions. The variational method consistently outperforms the sticky air method. The staircase method shows variable performance results.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f16.png"/>

        </fig>

      <p id="d2e3206">The results of this performance benchmark, which consider the mean time required to solve the Stokes equations per timestep, averaged over 5000 timesteps (8 cores, Ryzen 9 3900XT), reveal that the variational method can provide consistently improved Stokes solver performance in comparison to the sticky air method, with the greatest improvement seen at lower resolutions. At lower resolutions, the staircase method also provided superior performance to the sticky air method, with the exception of the highest resolution used, 256 <inline-formula><mml:math id="M158" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 256 <inline-formula><mml:math id="M159" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 128. The variational method performed better than the staircase method for all except the 128 <inline-formula><mml:math id="M160" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 128 <inline-formula><mml:math id="M161" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 64 model, where the performance was similar.</p>
      <p id="d2e3239">These results demonstrate that the variational method offers a more efficient solution to the Stokes equations with a free surface boundary condition than the sticky air method across all tested cases. This efficiency, coupled with consistent surface tracking performance across resolutions, highlights the potential of the variational Stokes method for 3D geodynamic simulations.</p>
</sec>
<sec id="Ch1.S5.SS6">
  <label>5.6</label><title>Prescribed traction boundary conditions</title>
      <p id="d2e3251">One of the key features enabled by the variational Stokes method is the ability to apply tractions directly at the free surface. This includes the ability to impose pressure boundary conditions at the surface. This capability holds significant potential for applications in global-scale geodynamic models.</p>

      <fig id="F17" specific-use="star"><label>Figure 17</label><caption><p id="d2e3256">Imposed pressure boundary condition setup in 2D. The model is run at a resolution of 512 <inline-formula><mml:math id="M162" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 64 for 4 <inline-formula><mml:math id="M163" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">My</mml:mi></mml:mrow></mml:math></inline-formula> to investigate the effect of the imposed surface pressure on topography.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f17.png"/>

        </fig>

      <p id="d2e3280">To evaluate the application of imposed traction boundary conditions in 2D, a simple setup illustrated in Fig. <xref ref-type="fig" rid="F17"/> is used. The model consists of a 2800 <inline-formula><mml:math id="M164" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M165" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 800 <inline-formula><mml:math id="M166" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> domain run at a resolution of 512 <inline-formula><mml:math id="M167" display="inline"><mml:mo>×</mml:mo></mml:math></inline-formula> 64, consisting of an initially flat 600 <inline-formula><mml:math id="M168" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> thick mantle, a 100 <inline-formula><mml:math id="M169" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> thick lithosphere, and a 100 <inline-formula><mml:math id="M170" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow></mml:math></inline-formula> thick air layer. A sinusoidal pressure boundary condition is applied to the free surface, given by:</p>
      <p id="d2e3341">The imposed pressure boundary condition tested is a sinusoidal profile given by:

            <disp-formula id="Ch1.E14" content-type="numbered"><label>14</label><mml:math id="M171" display="block"><mml:mrow><mml:msub><mml:mi>P</mml:mi><mml:mtext>BC</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">9</mml:mn></mml:msup><mml:mo>(</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>+</mml:mo><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">8</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:mi>x</mml:mi><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2800</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow><mml:mo>)</mml:mo><mml:mo>)</mml:mo><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mrow class="unit"><mml:mi mathvariant="normal">Pa</mml:mi></mml:mrow><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>

      <fig id="F18" specific-use="star"><label>Figure 18</label><caption><p id="d2e3398">The topography generated by the imposed pressure boundary condition in 2D follows a sinusoidal pattern corresponding to the applied pressure. After 4 <inline-formula><mml:math id="M172" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">My</mml:mi></mml:mrow></mml:math></inline-formula>, the numerical solution has almost exactly converged to this analytical solution.</p></caption>
          <graphic xlink:href="https://gmd.copernicus.org/articles/19/8839/2026/gmd-19-8839-2026-f18.png"/>

        </fig>

      <p id="d2e3415">The analytical solution for surface height can be derived using the relationship for lithostatic pressure, <inline-formula><mml:math id="M173" display="inline"><mml:mrow><mml:mi>P</mml:mi><mml:mo>=</mml:mo><mml:mi mathvariant="italic">ρ</mml:mi><mml:mi>g</mml:mi><mml:mi>h</mml:mi></mml:mrow></mml:math></inline-formula>, resulting in:

            <disp-formula id="Ch1.E15" content-type="numbered"><label>15</label><mml:math id="M174" display="block"><mml:mrow><mml:msub><mml:mi>h</mml:mi><mml:mtext>analytical</mml:mtext></mml:msub><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mn mathvariant="normal">9</mml:mn></mml:msup><mml:mi>cos⁡</mml:mi><mml:mo>(</mml:mo><mml:mn mathvariant="normal">8</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:mi>x</mml:mi><mml:mo>/</mml:mo><mml:mn mathvariant="normal">2800</mml:mn><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow><mml:mo>)</mml:mo><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mrow class="unit"><mml:mi mathvariant="normal">Pa</mml:mi></mml:mrow></mml:mrow><mml:mrow><mml:mn mathvariant="normal">3300</mml:mn><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mrow class="unit"><mml:mi mathvariant="normal">km</mml:mi></mml:mrow><mml:mo>⋅</mml:mo><mml:mn mathvariant="normal">9.81</mml:mn><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mrow class="unit"><mml:mi mathvariant="normal">m</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:msup><mml:mi mathvariant="normal">s</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>.</mml:mo></mml:mrow></mml:math></disp-formula></p>
      <p id="d2e3506">The model is run for 4 <inline-formula><mml:math id="M175" display="inline"><mml:mrow class="unit"><mml:mi mathvariant="normal">My</mml:mi></mml:mrow></mml:math></inline-formula> to allow surface deformation to reach equilibrium. The resulting topography is compared to the analytical solution in Fig. <xref ref-type="fig" rid="F18"/>.</p>
      <p id="d2e3519">The results show that the surface topography relaxes to the predicted analytical solution, exhibiting sinusoidal deformation due to the imposed pressure boundary condition.</p>
</sec>
</sec>
<sec id="Ch1.S6">
  <label>6</label><title>Summary and discussion</title>
      <p id="d2e3532">This study has demonstrated the successful implementation of the variational Stokes method of <xref ref-type="bibr" rid="bib1.bibx19" id="text.47"/> within the StagYY geodynamic code and evaluated its performance against the established sticky air and staircase free surface methods. The method is implemented by multiplying the local stencil with appropriate volume fractions, requiring only modest modifications to the Stokes solver. Since these modifications are local, the approach is straightforwardly applicable to other staggered-grid finite difference codes such as I2ELVIS/I3ELVIS <xref ref-type="bibr" rid="bib1.bibx10 bib1.bibx12" id="paren.48"/> or LaMEM <xref ref-type="bibr" rid="bib1.bibx18" id="paren.49"/>.</p>
      <p id="d2e3544">In most scenarios tested, the variational method produces results virtually identical to those of the sticky air and staircase methods, while substantially reducing the computational cost of solving the Stokes equations when using iterative or multigrid solvers. This improvement arises because the variational formulation eliminates the need for an air layer entirely, reducing the size of the system that must be solved. The method is applicable to all 2D and 3D geometries implemented in StagYY, including spherical and yin-yang geometries, making it suitable for global-scale mantle convection models. Accurate volume fractions are best obtained through Lagrangian surface tracking.</p>
      <p id="d2e3547">A particularly valuable feature of the variational discretisation is its natural support for prescribed traction boundary conditions at the free surface. This capability opens the door to modelling coupled planetary systems in which an external load, such as an ice sheet or ocean, acts on the lithosphere. Phenomena such as post-glacial rebound or the effect of evolving sea levels on lithospheric stress could, for the first time, be incorporated into global-scale geodynamic models with a free surface.</p>
      <p id="d2e3550">One limitation requires further attention. The treatment of viscosities in cells near the free surface introduces errors when lateral viscosity variations are present, as seen in Sect. <xref ref-type="sec" rid="Ch1.S5.SS3"/>. Since both the present results and the original benchmarks of <xref ref-type="bibr" rid="bib1.bibx24" id="text.50"/> show that subduction dynamics are highly sensitive to subtle changes in the near-surface viscosity field, existing benchmarks may be insufficient to validate future improvements. Developing more stable benchmarks targeted at near-surface viscosity treatment is therefore an important direction for future work, alongside exploration of alternative viscosity interpolation schemes.</p>
</sec>

      
      </body>
    <back><notes notes-type="codedataavailability"><title>Code and data availability</title>

      <p id="d2e3562">The Julia script used to produce the benchmark results and figures used in this paper is archived on Zenodo under the MIT license under <ext-link xlink:href="https://doi.org/10.5281/zenodo.17956246" ext-link-type="DOI">10.5281/zenodo.17956246</ext-link> <xref ref-type="bibr" rid="bib1.bibx13" id="paren.51"/>. No input data or additional scripts are required. The data plotted in Figs. 7–10 can be generated by running the script. The code StagYYFreeSurface (StagYYFS), a test branch of StagYY, may be used to produce the benchmark results and figures used in this paper. It is archived on Zenodo under the GPLv3 license under <ext-link xlink:href="https://doi.org/10.5281/zenodo.18096249" ext-link-type="DOI">10.5281/zenodo.18096249</ext-link> <xref ref-type="bibr" rid="bib1.bibx26" id="paren.52"/>.</p>
  </notes><notes notes-type="authorcontribution"><title>Author contributions</title>

      <p id="d2e3580">TSG: original study design; code and algorithm development; scaling and performance benchmarks; figure creation. PJT: development of StagYY; conceptual input; manuscript review. TVG: conceptual input; manuscript review; funding acquisition.</p>
  </notes><notes notes-type="competinginterests"><title>Competing interests</title>

      <p id="d2e3586">The contact author has declared that none of the authors has any competing interests.</p>
  </notes><notes notes-type="disclaimer"><title>Disclaimer</title>

      <p id="d2e3592">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. The authors bear the ultimate responsibility for providing appropriate place names. Views expressed in the text are those of the authors and do not necessarily reflect the views of the publisher.</p>
  </notes><notes notes-type="financialsupport"><title>Financial support</title>

      <p id="d2e3598">This research has been supported by the Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung, nccr – on the move (grant no. 192296).</p>
  </notes><notes notes-type="reviewstatement"><title>Review statement</title>

      <p id="d2e3604">This paper was edited by Mauro Cacace and reviewed by Wolfgang Bangerth and Thibault Duretz.</p>
  </notes><ref-list>
    <title>References</title>

      <ref id="bib1.bibx1"><label>Amestoy et al.(2001)Amestoy, Duff, Koster, and L'Excellent</label><mixed-citation> Amestoy, P., Duff, I. S., Koster, J., and L'Excellent, J.-Y.: A Fully Asynchronous Multifrontal Solver Using Distributed Dynamic Scheduling, SIAM J. Matrix Anal. A., 23, 15–41, 2001.</mixed-citation></ref>
      <ref id="bib1.bibx2"><label>Amestoy et al.(2019)Amestoy, Buttari, L'Excellent, and Mary</label><mixed-citation> Amestoy, P., Buttari, A., L'Excellent, J.-Y., and Mary, T.: Performance and Scalability of the Block Low-Rank Multifrontal Factorization on Multicore Architectures, ACM T. Math. Software, 45, 2:1–2:26, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx3"><label>Balay et al.(2025)Balay, Abhyankar, Adams, Benson, Brown, Brune, Buschelman, Constantinescu, Dalcin, Dener, Eijkhout, Faibussowitsch, Gropp, Hapla, Isaac, Jolivet, Karpeev, Kaushik, Knepley, Kong, Kruger, May, McInnes, Mills, Mitchell, Munson, Roman, Rupp, Sanan, Sarich, Smith, Suh, Zampini, Zhang, Zhang, and Zhang</label><mixed-citation>Balay, S., Abhyankar, S., Adams, M. F., Benson, S., Brown, J., Brune, P., Buschelman, K., Constantinescu, E., Dalcin, L., Dener, A., Eijkhout, V., Faibussowitsch, J., Gropp, W. D., Hapla, V., Isaac, T., Jolivet, P., Karpeev, D., Kaushik, D., Knepley, M. G., Kong, F., Kruger, S., May, D. A., McInnes, L. C., Mills, R. T., Mitchell, L., Munson, T., Roman, J. E., Rupp, K., Sanan, P., Sarich, J., Smith, B. F., Suh, H., Zampini, S., Zhang, H., Zhang, H., and Zhang, J.: PETSc/TAO Users Manual, Tech. Rep. ANL-21/39 – Revision 3.23, Argonne National Laboratory, <ext-link xlink:href="https://doi.org/10.2172/2476320" ext-link-type="DOI">10.2172/2476320</ext-link>, 2025.</mixed-citation></ref>
      <ref id="bib1.bibx4"><label>Botto(2013)</label><mixed-citation>Botto, L.: A geometric multigrid Poisson solver for domains containing solid inclusions, Comput. Phys. Commun., 184, 1033–1044, <ext-link xlink:href="https://doi.org/10.1016/j.cpc.2012.11.008" ext-link-type="DOI">10.1016/j.cpc.2012.11.008</ext-link>, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx5"><label>Burman et al.(2025)Burman, Hansbo, Larson, and Zahedi</label><mixed-citation>Burman, E., Hansbo, P., Larson, M. G., and Zahedi, S.: Cut finite element methods, Acta Numer., 34, 1–121, <ext-link xlink:href="https://doi.org/10.1017/s0962492925000017" ext-link-type="DOI">10.1017/s0962492925000017</ext-link>, 2025.</mixed-citation></ref>
      <ref id="bib1.bibx6"><label>Crameri et al.(2012)Crameri, Schmeling, Golabek, Duretz, Orendt, Buiter, May, Kaus, Gerya, and Tackley</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, Geophys. J. Int., 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.bibx7"><label>Deubelbeiss and Kaus(2008)</label><mixed-citation>Deubelbeiss, Y. and Kaus, B. J. P.: Comparison of Eulerian and Lagrangian numerical techniques for the Stokes equations in the presence of strongly varying viscosity, Phys. Earth Planet. In., 171, 92–111, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2008.06.023" ext-link-type="DOI">10.1016/j.pepi.2008.06.023</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx8"><label>Duretz et al.(2016)Duretz, May, and Yamato</label><mixed-citation>Duretz, T., May, D., and Yamato, P.: A free surface capturing discretization for the staggered grid finite difference scheme, Geophys. J. Int., 204, 1518–1530, <ext-link xlink:href="https://doi.org/10.1093/gji/ggv526" ext-link-type="DOI">10.1093/gji/ggv526</ext-link>, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx9"><label>Gerya(2019)</label><mixed-citation> Gerya, T. V.: Introduction to Numerical Geodynamic Modelling, Cambridge University Press, ISBN 978-1-107-14314-2, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx10"><label>Gerya and Yuen(2007)</label><mixed-citation>Gerya, T. V. and Yuen, D. A.: Robust characteristics method for modelling multiphase visco-elasto-plastic thermo-mechanical problems, Phys. Earth Planet. In., 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.bibx11"><label>Gerya et al.(2015a)Gerya, Stern, Baes, Sobolev, and Whattam</label><mixed-citation>Gerya, T. V., Stern, R. J., Baes, M., Sobolev, S. V., and Whattam, S. A.: Plate tectonics on the Earth triggered by plume-induced subduction initiation, Nature, 527, 221–225, <ext-link xlink:href="https://doi.org/10.1038/nature15752" ext-link-type="DOI">10.1038/nature15752</ext-link>, 2015a.</mixed-citation></ref>
      <ref id="bib1.bibx12"><label>Gerya et al.(2015b)Gerya, Stern, Baes, Sobolev, and Whattam</label><mixed-citation>Gerya, T. V., Stern, R. J., Baes, M., Sobolev, S. V., and Whattam, S. A.: Plate tectonics on the Earth triggered by plume-induced subduction initiation, Nature, 527, 221–225, <ext-link xlink:href="https://doi.org/10.1038/nature15752" ext-link-type="DOI">10.1038/nature15752</ext-link>, 2015b.</mixed-citation></ref>
      <ref id="bib1.bibx13"><label>Gray(2025)</label><mixed-citation>Gray, T.: Software accompanying manuscript “Variational Stokes method applied to free surface boundaries in numerical geodynamic models”, Zenodo [code and data set], <ext-link xlink:href="https://doi.org/10.5281/zenodo.17956246" ext-link-type="DOI">10.5281/zenodo.17956246</ext-link>, 2025.</mixed-citation></ref>
      <ref id="bib1.bibx14"><label>Gray et al.(2026a)Gray, Tackley, and Gerya</label><mixed-citation>Gray, T. S., Tackley, P. J., and Gerya, T.: Lagrangian tracking methods applied to free surface boundaries in numerical geodynamic models, EGUsphere [preprint], <ext-link xlink:href="https://doi.org/10.5194/egusphere-2025-6546" ext-link-type="DOI">10.5194/egusphere-2025-6546</ext-link>, 2026a.</mixed-citation></ref>
      <ref id="bib1.bibx15"><label>Gray et al.(2026b)Gray, Tackley, and Gerya</label><mixed-citation>Gray, T. S., Tackley, P. J., and Gerya, T.: Volume of Fluid method applied to free surface boundaries in numerical geodynamic models, EGUsphere [preprint], <ext-link xlink:href="https://doi.org/10.5194/egusphere-2025-6547" ext-link-type="DOI">10.5194/egusphere-2025-6547</ext-link>, 2026b.</mixed-citation></ref>
      <ref id="bib1.bibx16"><label>Heister et al.(2017)Heister, Dannberg, Gassmöller, and Bangerth</label><mixed-citation>Heister, T., Dannberg, J., Gassmöller, R., and Bangerth, W.: High accuracy mantle convection simulation through modern numerical methods – II: realistic models and problems, Geophys. J. Int., 210, 833–851, <ext-link xlink:href="https://doi.org/10.1093/gji/ggx195" ext-link-type="DOI">10.1093/gji/ggx195</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx17"><label>Hernlund and Tackley(2008)</label><mixed-citation>Hernlund, J. W. and Tackley, P. J.: Modeling mantle convection in the spherical annulus, Phys. Earth Planet. In., 171, 48–54, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2008.07.037" ext-link-type="DOI">10.1016/j.pepi.2008.07.037</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx18"><label>Kaus et al.(2016)Kaus, Popov, Baumann, Pusok, Bauville, Fernandez, and Collignon</label><mixed-citation>Kaus, B. J., Popov, A. A., Baumann, T., Pusok, A., Bauville, A., Fernandez, N., and Collignon, M.: Forward and Inverse Modelling of Lithospheric Deformation on Geological Timescales Forward and Inverse Modelling of Lithospheric Deformation on Geological Timescales, in: Proceedings of nic symposium, vol. 48, NIC Series, NIC – John von Neumann Institute for Computing, 978–983, <uri>https://juser.fz-juelich.de/record/507751/files/nic_2016_kaus.pdf</uri> (last access: 26 August 2026), 2016.</mixed-citation></ref>
      <ref id="bib1.bibx19"><label>Larionov et al.(2017)Larionov, Batty, and Bridson</label><mixed-citation>Larionov, E., Batty, C., and Bridson, R.: Variational stokes: a unified pressure-viscosity solver for accurate viscous liquids, ACM T. Graphic., 36, 101:1–101:11, <ext-link xlink:href="https://doi.org/10.1145/3072959.3073628" ext-link-type="DOI">10.1145/3072959.3073628</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx20"><label>Ogawa et al.(1991)Ogawa, Schubert, and Zebib</label><mixed-citation>Ogawa, M., Schubert, G., and Zebib, A.: Numerical simulations of three-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.bibx21"><label>Patankar(1980)</label><mixed-citation> Patankar, S. V.: Numerical Heat Transfer and Fluid Flow, Hemisphere Publishing Corporation, New York, ISBN 9780891165224, 1980.</mixed-citation></ref>
      <ref id="bib1.bibx22"><label>Ramberg(1981)</label><mixed-citation> Ramberg, H.: Gravity, Deformation, and the Earth's Crust: In Theory, Experiments, and Geological Application, Academic Press, ISBN 978-0125768603, 1981.</mixed-citation></ref>
      <ref id="bib1.bibx23"><label>Rauwoens et al.(2015)Rauwoens, Troch, and Vierendeels</label><mixed-citation>Rauwoens, P., Troch, P., and Vierendeels, J.: A geometric multigrid solver for the free-surface equation in environmental models featuring irregular coastlines, J. Comput. Appl. Math., 289, 22–36, <ext-link xlink:href="https://doi.org/10.1016/j.cam.2015.03.029" ext-link-type="DOI">10.1016/j.cam.2015.03.029</ext-link>, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx24"><label>Schmeling et al.(2008)Schmeling, Babeyko, Enns, Faccenna, Funiciello, Gerya, Golabek, Grigull, Kaus, Morra, Schmalholz, and van Hunen</label><mixed-citation>Schmeling, H., Babeyko, A. Y., Enns, A., Faccenna, C., Funiciello, F., Gerya, T., Golabek, G. J., Grigull, S., Kaus, B. J. P., Morra, G., Schmalholz, S. M., and van Hunen, J.: A benchmark comparison of spontaneous subduction models–Towards a free surface, Phys. Earth Planet. In., 171, 198–223, <ext-link xlink:href="https://doi.org/10.1016/j.pepi.2008.06.028" ext-link-type="DOI">10.1016/j.pepi.2008.06.028</ext-link>, 2008.</mixed-citation></ref>
      <ref id="bib1.bibx25"><label>Schmid and Podladchikov(2003)</label><mixed-citation>Schmid, D. W. and Podladchikov, Y. Y.: Analytical solutions for deformable elliptical inclusions in general shear, Geophys. J. Int., 155, 269–288, <ext-link xlink:href="https://doi.org/10.1046/j.1365-246X.2003.02042.x" ext-link-type="DOI">10.1046/j.1365-246X.2003.02042.x</ext-link>, 2003.</mixed-citation></ref>
      <ref id="bib1.bibx26"><label>Tackley and Gray(2026)</label><mixed-citation>Tackley, P. and Gray, T.: StagYYFreeSurface (StagYYFS): A testbed for free- surface methods in geodynamical simulations using the finite volume (staggered-grid finite difference) discretization, Zenodo [code], <ext-link xlink:href="https://doi.org/10.5281/zenodo.18096249" ext-link-type="DOI">10.5281/zenodo.18096249</ext-link>, 2026.</mixed-citation></ref>
      <ref id="bib1.bibx27"><label>Tackley(1993)</label><mixed-citation>Tackley, P. J.: Effects of strongly temperature-dependent viscosity on time-dependent, three-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>, _eprint: https://onlinelibrary.wiley.com/doi/pdf/10.1029/93GL02317, 1993.</mixed-citation></ref>
      <ref id="bib1.bibx28"><label>Tackley(2008)</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. In., 171, 7–18, <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.bibx29"><label>Trompert and Hansen(1996)</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, 1996.  </mixed-citation></ref>
      <ref id="bib1.bibx30"><label>Verzicco(2023)</label><mixed-citation>Verzicco, R.: Immersed Boundary Methods: Historical Perspective and Future Outlook, Annu. Rev. Fluid Mech., 55, 129–155, <ext-link xlink:href="https://doi.org/10.1146/annurev-fluid-120720-022129" ext-link-type="DOI">10.1146/annurev-fluid-120720-022129</ext-link>, 2023.</mixed-citation></ref>

  </ref-list></back>
    <!--<article-title-html>Variational Stokes method applied to free surface boundaries  in numerical geodynamical models using the  staggered-grid finite-difference discretisation</article-title-html>
<abstract-html/>
<ref-html id="bib1.bib1"><label>Amestoy et al.(2001)Amestoy, Duff, Koster, and L'Excellent</label><mixed-citation>
      
Amestoy, P., Duff, I. S., Koster, J., and L'Excellent, J.-Y.:
A Fully Asynchronous Multifrontal Solver Using Distributed Dynamic Scheduling, SIAM J. Matrix Anal. A., 23, 15–41, 2001.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib2"><label>Amestoy et al.(2019)Amestoy, Buttari, L'Excellent, and Mary</label><mixed-citation>
      
Amestoy, P., Buttari, A., L'Excellent, J.-Y., and Mary, T.:
Performance and Scalability of the Block Low-Rank Multifrontal Factorization on Multicore Architectures, ACM T. Math. Software, 45, 2:1–2:26, 2019.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib3"><label>Balay et al.(2025)Balay, Abhyankar, Adams, Benson, Brown, Brune, Buschelman, Constantinescu, Dalcin, Dener, Eijkhout, Faibussowitsch, Gropp, Hapla, Isaac, Jolivet, Karpeev, Kaushik, Knepley, Kong, Kruger, May, McInnes, Mills, Mitchell, Munson, Roman, Rupp, Sanan, Sarich, Smith, Suh, Zampini, Zhang, Zhang, and Zhang</label><mixed-citation>
      
Balay, S., Abhyankar, S., Adams, M. F., Benson, S., Brown, J., Brune, P., Buschelman, K., Constantinescu, E., Dalcin, L., Dener, A., Eijkhout, V., Faibussowitsch, J., Gropp, W. D., Hapla, V., Isaac, T., Jolivet, P., Karpeev, D., Kaushik, D., Knepley, M. G., Kong, F., Kruger, S., May, D. A., McInnes, L. C., Mills, R. T., Mitchell, L., Munson, T., Roman, J. E., Rupp, K., Sanan, P., Sarich, J., Smith, B. F., Suh, H., Zampini, S., Zhang, H., Zhang, H., and Zhang, J.:
PETSc/TAO Users Manual, Tech. Rep. ANL-21/39 – Revision 3.23, Argonne National Laboratory, <a href="https://doi.org/10.2172/2476320" target="_blank">https://doi.org/10.2172/2476320</a>, 2025.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib4"><label>Botto(2013)</label><mixed-citation>
      
Botto, L.:
A geometric multigrid Poisson solver for domains containing solid inclusions, Comput. Phys. Commun., 184, 1033–1044, <a href="https://doi.org/10.1016/j.cpc.2012.11.008" target="_blank">https://doi.org/10.1016/j.cpc.2012.11.008</a>, 2013.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib5"><label>Burman et al.(2025)Burman, Hansbo, Larson, and Zahedi</label><mixed-citation>
      
Burman, E., Hansbo, P., Larson, M. G., and Zahedi, S.:
Cut finite element methods, Acta Numer., 34, 1–121, <a href="https://doi.org/10.1017/s0962492925000017" target="_blank">https://doi.org/10.1017/s0962492925000017</a>, 2025.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib6"><label>Crameri et al.(2012)Crameri, Schmeling, Golabek, Duretz, Orendt, Buiter, May, Kaus, Gerya, and Tackley</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, Geophys. J. Int., 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.bib7"><label>Deubelbeiss and Kaus(2008)</label><mixed-citation>
      
Deubelbeiss, Y. and Kaus, B. J. P.:
Comparison of Eulerian and Lagrangian numerical techniques for the Stokes equations in the presence of strongly varying viscosity, Phys. Earth Planet. In., 171, 92–111, <a href="https://doi.org/10.1016/j.pepi.2008.06.023" target="_blank">https://doi.org/10.1016/j.pepi.2008.06.023</a>, 2008.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib8"><label>Duretz et al.(2016)Duretz, May, and Yamato</label><mixed-citation>
      
Duretz, T., May, D., and Yamato, P.:
A free surface capturing discretization for the staggered grid finite difference scheme, Geophys. J. Int., 204, 1518–1530, <a href="https://doi.org/10.1093/gji/ggv526" target="_blank">https://doi.org/10.1093/gji/ggv526</a>, 2016.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib9"><label>Gerya(2019)</label><mixed-citation>
      
Gerya, T. V.: Introduction to Numerical Geodynamic Modelling, Cambridge University Press, ISBN 978-1-107-14314-2, 2019.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib10"><label>Gerya and Yuen(2007)</label><mixed-citation>
      
Gerya, T. V. and Yuen, D. A.:
Robust characteristics method for modelling multiphase visco-elasto-plastic thermo-mechanical problems, Phys. Earth Planet. In., 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>Gerya et al.(2015a)Gerya, Stern, Baes, Sobolev, and Whattam</label><mixed-citation>
      
Gerya, T. V., Stern, R. J., Baes, M., Sobolev, S. V., and Whattam, S. A.:
Plate tectonics on the Earth triggered by plume-induced subduction initiation, Nature, 527, 221–225, <a href="https://doi.org/10.1038/nature15752" target="_blank">https://doi.org/10.1038/nature15752</a>, 2015a.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib12"><label>Gerya et al.(2015b)Gerya, Stern, Baes, Sobolev, and Whattam</label><mixed-citation>
      
Gerya, T. V., Stern, R. J., Baes, M., Sobolev, S. V., and Whattam, S. A.:
Plate tectonics on the Earth triggered by plume-induced subduction initiation, Nature, 527, 221–225, <a href="https://doi.org/10.1038/nature15752" target="_blank">https://doi.org/10.1038/nature15752</a>, 2015b.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib13"><label>Gray(2025)</label><mixed-citation>
      
Gray, T.: Software accompanying manuscript “Variational Stokes method applied to free surface boundaries in numerical geodynamic models”, Zenodo [code and data set], <a href="https://doi.org/10.5281/zenodo.17956246" target="_blank">https://doi.org/10.5281/zenodo.17956246</a>, 2025.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib14"><label>Gray et al.(2026a)Gray, Tackley, and Gerya</label><mixed-citation>
      
Gray, T. S., Tackley, P. J., and Gerya, T.: Lagrangian tracking methods applied to free surface boundaries in numerical geodynamic models, EGUsphere [preprint], <a href="https://doi.org/10.5194/egusphere-2025-6546" target="_blank">https://doi.org/10.5194/egusphere-2025-6546</a>, 2026a.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib15"><label>Gray et al.(2026b)Gray, Tackley, and Gerya</label><mixed-citation>
      
Gray, T. S., Tackley, P. J., and Gerya, T.: Volume of Fluid method applied to free surface boundaries in numerical geodynamic models, EGUsphere [preprint], <a href="https://doi.org/10.5194/egusphere-2025-6547" target="_blank">https://doi.org/10.5194/egusphere-2025-6547</a>, 2026b.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib16"><label>Heister et al.(2017)Heister, Dannberg, Gassmöller, and Bangerth</label><mixed-citation>
      
Heister, T., Dannberg, J., Gassmöller, R., and Bangerth, W.:
High accuracy mantle convection simulation through modern numerical methods – II: realistic models and problems, Geophys. J. Int., 210, 833–851, <a href="https://doi.org/10.1093/gji/ggx195" target="_blank">https://doi.org/10.1093/gji/ggx195</a>, 2017.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib17"><label>Hernlund and Tackley(2008)</label><mixed-citation>
      
Hernlund, J. W. and Tackley, P. J.:
Modeling mantle convection in the spherical annulus, Phys. Earth Planet. In., 171, 48–54, <a href="https://doi.org/10.1016/j.pepi.2008.07.037" target="_blank">https://doi.org/10.1016/j.pepi.2008.07.037</a>, 2008.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib18"><label>Kaus et al.(2016)Kaus, Popov, Baumann, Pusok, Bauville, Fernandez, and Collignon</label><mixed-citation>
      
Kaus, B. J., Popov, A. A., Baumann, T., Pusok, A., Bauville, A., Fernandez, N., and Collignon, M.: Forward and Inverse Modelling of Lithospheric Deformation on Geological Timescales Forward and Inverse Modelling of Lithospheric Deformation on Geological Timescales, in: Proceedings of nic symposium, vol. 48, NIC Series, NIC – John von Neumann Institute for Computing, 978–983, <a href="https://juser.fz-juelich.de/record/507751/files/nic_2016_kaus.pdf" target="_blank"/> (last access: 26 August 2026), 2016.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib19"><label>Larionov et al.(2017)Larionov, Batty, and Bridson</label><mixed-citation>
      
Larionov, E., Batty, C., and Bridson, R.:
Variational stokes: a unified pressure-viscosity solver for accurate viscous liquids, ACM T. Graphic., 36, 101:1–101:11, <a href="https://doi.org/10.1145/3072959.3073628" target="_blank">https://doi.org/10.1145/3072959.3073628</a>, 2017.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib20"><label>Ogawa et al.(1991)Ogawa, Schubert, and Zebib</label><mixed-citation>
      
Ogawa, M., Schubert, G., and Zebib, A.:
Numerical simulations of three-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.bib21"><label>Patankar(1980)</label><mixed-citation>
      
Patankar, S. V.: Numerical Heat Transfer and Fluid Flow, Hemisphere Publishing Corporation, New York, ISBN 9780891165224, 1980.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib22"><label>Ramberg(1981)</label><mixed-citation>
      
Ramberg, H.: Gravity, Deformation, and the Earth's Crust: In Theory, Experiments, and Geological Application, Academic Press, ISBN 978-0125768603, 1981.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib23"><label>Rauwoens et al.(2015)Rauwoens, Troch, and Vierendeels</label><mixed-citation>
      
Rauwoens, P., Troch, P., and Vierendeels, J.:
A geometric multigrid solver for the free-surface equation in environmental models featuring irregular coastlines, J. Comput. Appl. Math., 289, 22–36, <a href="https://doi.org/10.1016/j.cam.2015.03.029" target="_blank">https://doi.org/10.1016/j.cam.2015.03.029</a>, 2015.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib24"><label>Schmeling et al.(2008)Schmeling, Babeyko, Enns, Faccenna, Funiciello, Gerya, Golabek, Grigull, Kaus, Morra, Schmalholz, and van Hunen</label><mixed-citation>
      
Schmeling, H., Babeyko, A. Y., Enns, A., Faccenna, C., Funiciello, F., Gerya, T., Golabek, G. J., Grigull, S., Kaus, B. J. P., Morra, G., Schmalholz, S. M., and van Hunen, J.:
A benchmark comparison of spontaneous subduction models–Towards a free surface, Phys. Earth Planet. In., 171, 198–223, <a href="https://doi.org/10.1016/j.pepi.2008.06.028" target="_blank">https://doi.org/10.1016/j.pepi.2008.06.028</a>, 2008.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib25"><label>Schmid and Podladchikov(2003)</label><mixed-citation>
      
Schmid, D. W. and Podladchikov, Y. Y.:
Analytical solutions for deformable elliptical inclusions in general shear, Geophys. J. Int., 155, 269–288, <a href="https://doi.org/10.1046/j.1365-246X.2003.02042.x" target="_blank">https://doi.org/10.1046/j.1365-246X.2003.02042.x</a>, 2003.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib26"><label>Tackley and Gray(2026)</label><mixed-citation>
      
Tackley, P. and Gray, T.: StagYYFreeSurface (StagYYFS): A testbed for free- surface methods in geodynamical simulations using the finite volume (staggered-grid finite difference) discretization, Zenodo [code], <a href="https://doi.org/10.5281/zenodo.18096249" target="_blank">https://doi.org/10.5281/zenodo.18096249</a>, 2026.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib27"><label>Tackley(1993)</label><mixed-citation>
      
Tackley, P. J.:
Effects of strongly temperature-dependent viscosity on time-dependent, three-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>, _eprint: https://onlinelibrary.wiley.com/doi/pdf/10.1029/93GL02317, 1993.

    </mixed-citation></ref-html>
<ref-html id="bib1.bib28"><label>Tackley(2008)</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. In., 171, 7–18, <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.bib29"><label>Trompert and Hansen(1996)</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, 1996.


    </mixed-citation></ref-html>
<ref-html id="bib1.bib30"><label>Verzicco(2023)</label><mixed-citation>
      
Verzicco, R.:
Immersed Boundary Methods: Historical Perspective and Future Outlook, Annu. Rev. Fluid Mech., 55, 129–155, <a href="https://doi.org/10.1146/annurev-fluid-120720-022129" target="_blank">https://doi.org/10.1146/annurev-fluid-120720-022129</a>, 2023.

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