<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing with OASIS Tables v3.0 20080202//EN" "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-14-3769-2021</article-id><title-group><article-title>Development of a large-eddy simulation subgrid model based on artificial neural networks: a case study of turbulent channel flow</article-title><alt-title>LES subgrid modelling using ANNs</alt-title>
      </title-group><?xmltex \runningtitle{LES subgrid modelling using ANNs}?><?xmltex \runningauthor{R.~Stoffer et al.}?>
      <contrib-group>
        <contrib contrib-type="author" corresp="yes" rid="aff1">
          <name><surname>Stoffer</surname><given-names>Robin</given-names></name>
          <email>robin.stoffer@wur.nl</email>
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff2">
          <name><surname>van Leeuwen</surname><given-names>Caspar M.</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff2">
          <name><surname>Podareanu</surname><given-names>Damian</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff2">
          <name><surname>Codreanu</surname><given-names>Valeriu</given-names></name>
          
        </contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Veerman</surname><given-names>Menno A.</given-names></name>
          
        <ext-link>https://orcid.org/0000-0002-4869-3948</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Janssens</surname><given-names>Martin</given-names></name>
          
        <ext-link>https://orcid.org/0000-0003-2905-6692</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>Hartogensis</surname><given-names>Oscar K.</given-names></name>
          
        <ext-link>https://orcid.org/0000-0001-8920-9975</ext-link></contrib>
        <contrib contrib-type="author" corresp="no" rid="aff1">
          <name><surname>van Heerwaarden</surname><given-names>Chiel C.</given-names></name>
          
        <ext-link>https://orcid.org/0000-0001-7202-3525</ext-link></contrib>
        <aff id="aff1"><label>1</label><institution>Meteorology and Air Quality Group, Wageningen University, Wageningen, the Netherlands</institution>
        </aff>
        <aff id="aff2"><label>2</label><institution>SURFsara, Amsterdam, the Netherlands</institution>
        </aff>
      </contrib-group>
      <author-notes><corresp id="corr1">Robin Stoffer (robin.stoffer@wur.nl)</corresp></author-notes><pub-date><day>24</day><month>June</month><year>2021</year></pub-date>
      
      <volume>14</volume>
      <issue>6</issue>
      <fpage>3769</fpage><lpage>3788</lpage>
      <history>
        <date date-type="received"><day>26</day><month>August</month><year>2020</year></date>
           <date date-type="rev-request"><day>10</day><month>November</month><year>2020</year></date>
           <date date-type="rev-recd"><day>14</day><month>April</month><year>2021</year></date>
           <date date-type="accepted"><day>8</day><month>May</month><year>2021</year></date>
      </history>
      <permissions>
        <copyright-statement>Copyright: © 2021 Robin Stoffer et al.</copyright-statement>
        <copyright-year>2021</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/14/3769/2021/gmd-14-3769-2021.html">This article is available from https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021.html</self-uri><self-uri xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021.pdf">The full text article is available as a PDF file from https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021.pdf</self-uri>
      <abstract><title>Abstract</title>
    <p id="d1e151">Atmospheric boundary layers and other wall-bounded flows are often simulated with the large-eddy simulation (LES) technique, which relies on subgrid-scale (SGS) models to parameterize the smallest scales. These SGS models often make strong simplifying assumptions. Also, they tend to interact with the discretization errors introduced by the popular LES approach where a staggered finite-volume grid acts as an implicit filter. We therefore developed an alternative LES SGS model based on artificial neural networks (ANNs) for the computational fluid dynamics MicroHH code (v2.0). We used a turbulent channel flow (with friction Reynolds number <inline-formula><mml:math id="M1" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">Re</mml:mi><mml:mi mathvariant="italic">τ</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">590</mml:mn></mml:mrow></mml:math></inline-formula>) as a test case. The developed SGS model has been designed to compensate for  both the unresolved physics and instantaneous spatial discretization errors introduced by the staggered finite-volume grid. We trained the ANNs based on instantaneous flow fields from a direct numerical simulation (DNS) of the selected channel flow. In general, we found excellent agreement between the ANN-predicted SGS fluxes and the SGS fluxes derived from DNS for flow fields not used during training. In addition, we demonstrate that our ANN SGS model generalizes well towards other coarse horizontal resolutions, especially when these resolutions are located within the range of the training data. This shows that ANNs have potential to construct highly accurate SGS models that compensate for spatial discretization errors. We do highlight and discuss one important challenge still remaining before this potential can be successfully leveraged in actual LES simulations: we observed an artificial buildup of turbulence kinetic energy when we directly incorporated our ANN SGS model into a LES simulation of the selected channel flow, eventually resulting in numeric instability. We hypothesize that error accumulation and aliasing errors are both important contributors to the observed instability. We finally make several suggestions for future research that may alleviate the observed instability.</p>
  </abstract>
    </article-meta>
  </front>
<body>
      

<sec id="Ch1.S1" sec-type="intro">
  <label>1</label><title>Introduction</title>
      <p id="d1e178">Large-eddy simulation (LES) is an often-used technique to simulate turbulent atmospheric boundary layers (ABLs) and other wall-bounded geophysical flows with high Reynolds numbers (e.g. rivers). These turbulent flows are challenging to simulate because of their strong non-linear dynamics and large ranges of involved spatial and temporal scales. LES explicitly resolves only the largest, most energetic turbulent structures in these flows, while parameterizing the smaller ones with so-called subgrid-scale (SGS) models. This allows LES to keep the total computational effort feasible for today's high-performance computing systems but makes the quality of the results strongly dependent on the chosen SGS model. As an SGS model based on physical principles alone does not exist, the SGS models used today typically rely on simplifying assumptions in combination with ad hoc empirical corrections <xref ref-type="bibr" rid="bib1.bibx40 bib1.bibx43" id="paren.1"><named-content content-type="pre">e.g.</named-content></xref>.</p>
      <p id="d1e186">To briefly illustrate the effects simplifying assumptions can have, we take as an example the eddy-viscosity assumption used in the popular Smagorinsky model <xref ref-type="bibr" rid="bib1.bibx47 bib1.bibx28" id="paren.2"/> and several other SGS models. Crucially, the eddy-viscosity assumption introduces an alignment between the Reynolds stress and strain rate tensor that has not been verified in experimental data <xref ref-type="bibr" rid="bib1.bibx45" id="paren.3"/>. This<?pagebreak page3770?> makes it impossible to produce both the correct Reynolds stresses and dissipation rates <xref ref-type="bibr" rid="bib1.bibx21" id="paren.4"/>. As a consequence, eddy-viscosity SGS models often require ad hoc manual corrections (e.g. tuning the Smagorinsky coefficient and/or implementing a wall-damping function) or multiple computationally expensive spatial filtering operations (e.g. scale-dependent dynamical Smagorinsky models <xref ref-type="bibr" rid="bib1.bibx5" id="altparen.5"/>) to achieve satisfactory results.</p>
      <p id="d1e201">Data-driven machine learning techniques are, in contrast, much more flexible regarding their functional form and thus may potentially help to circumvent the need for many of these simplifying assumptions. This is especially valid for artificial neural networks (ANNs): simple feed-forward ANNs with just one hidden layer are theoretically able to represent any continuous function on finite domains (i.e. they are universal approximators; <xref ref-type="bibr" rid="bib1.bibx20" id="altparen.6"/>).</p>
      <p id="d1e207">A wide effort is therefore currently underway  to explore the potential for ANNs and other machine learning techniques in flow and turbulence modelling <xref ref-type="bibr" rid="bib1.bibx8 bib1.bibx25 bib1.bibx13" id="paren.7"/>. In particular, multiple studies successfully modelled turbulence in Reynolds-averaged Navier–Stokes (RANS) codes with machine learning techniques trained on high-fidelity direct numerical simulations (DNSs) that resolve all relevant turbulence scales <xref ref-type="bibr" rid="bib1.bibx22 bib1.bibx29 bib1.bibx30 bib1.bibx54 bib1.bibx56 bib1.bibx46" id="paren.8"><named-content content-type="pre">e.g.</named-content></xref>.</p>
      <p id="d1e219">Several other efforts in literature experimented with comparable approaches in both LES SGS modelling <xref ref-type="bibr" rid="bib1.bibx3 bib1.bibx9 bib1.bibx15 bib1.bibx33 bib1.bibx35 bib1.bibx44 bib1.bibx53 bib1.bibx55 bib1.bibx57 bib1.bibx58 bib1.bibx61" id="paren.9"/> and, interestingly, parameterizations in climate–ocean modelling <xref ref-type="bibr" rid="bib1.bibx4 bib1.bibx7 bib1.bibx41 bib1.bibx59" id="paren.10"><named-content content-type="pre">e.g.</named-content></xref>. The studies focusing on LES SGS modelling similarly used DNS fields as a basis and subsequently applied a downscaling procedure to generate consistent pairs of coarse-grained fields (that are assumed to represent the fields that a LES code would generate) and the quantity of interest (e.g. the “true” subgrid transport or the closure term itself). These pairs were then typically used to train ANNs in a supervised way. Some studies showed very promising results with this method, both in so-called a priori (offline) tests (where the predicted quantity is directly compared to the ones derived from DNS) and so-called  a posteriori (online) tests (where the trained ANN is directly incorporated as a SGS model into a LES simulation). However, these studies mostly focused on 2-D/3-D (in)compressible isotropic turbulence <xref ref-type="bibr" rid="bib1.bibx3 bib1.bibx18 bib1.bibx33 bib1.bibx53 bib1.bibx55 bib1.bibx57 bib1.bibx61" id="paren.11"/> and thus do not represent wall-bounded geoscientific flows. Furthermore, some of these studies <xref ref-type="bibr" rid="bib1.bibx3 bib1.bibx33 bib1.bibx61" id="paren.12"/> resorted to ad hoc adjustments (e.g. artificially introducing dissipation by combining with the Smagorinsky SGS model, neglecting all backscatter) to achieve stable a posteriori results. Such ad hoc adjustments are not ideally preferred: they obscure the link between the a priori and a posteriori implementation and re-introduce part of the assumptions that are ideally circumvented by using ANN SGS models.</p>
      <p id="d1e236">There are also studies that attempted similar methods in cases that better represent ABLs. Some of them focused on LES wall modelling specifically <xref ref-type="bibr" rid="bib1.bibx35 bib1.bibx58" id="paren.13"/>, which is challenging on its own because of the many unresolved near-wall motions that the wall model has to take into account. <xref ref-type="bibr" rid="bib1.bibx44" id="text.14"/> and <xref ref-type="bibr" rid="bib1.bibx15" id="text.15"/>, in turn, focused on SGS modelling in the whole turbulent channel flow. <xref ref-type="bibr" rid="bib1.bibx44" id="text.16"/> used neural networks to predict the Smagorinsky coefficient in the Smagorinsky–Bardina SGS model <xref ref-type="bibr" rid="bib1.bibx2" id="paren.17"/> reaching a computational time savings of about 20 %. <xref ref-type="bibr" rid="bib1.bibx15" id="text.18"/> directly predicted the SGS turbulent transport with a neural network using DNS during training. They got reasonable a priori results but did not perform an a posteriori test. Another important step towards application of these methods in realistic atmospheric boundary layers was taken by <xref ref-type="bibr" rid="bib1.bibx9" id="text.19"/>. They performed an extensive a priori test for an ANN-based LES SGS model covering a wide range of grid resolutions and flow stabilities (from neutral channel flow to very unstable convective boundary layers). We emphasize though that for successful integration of ANN-based SGS models in practical applications, accurate and numerically stable a posteriori results are an important requirement. Recently, <xref ref-type="bibr" rid="bib1.bibx39" id="text.20"/> took a step in this direction by testing an ANN-based SGS model in a neutral channel flow both a priori and a posteriori. They found that their SGS model introduced numeric instability a posteriori, except when they neglected all backscatter or only used single-point, rather than multi-point, inputs. However, selecting only single-point inputs, in turn, clearly reduced the a priori performance. Hence, it remains an open issue whether and how the often-observed high a priori potential of ANN SGS models can be successfully leveraged in an a posteriori test, in particular for wall-bounded flows like ABLs.</p>
      <?pagebreak page3771?><p id="d1e264">In addition, all the previously mentioned ANN LES SGS models, together with traditional eddy-viscosity models, do not directly reflect the LES approach where a staggered finite-volume numerical scheme acts as an implicit filter, despite being a common practice when simulating ABLs. Traditional eddy-viscosity models are typically derived based on a generic filtering operation that does not consider the finite discrete nature of the used numerical grid (i.e. it is usually thought of as an analytical filter like a continuous top-hat filter), while the ANN SGS models so far did not attempt to compensate for all the discretization errors arising in simulations with staggered finite volumes. These discretization errors, however, can strongly influence the resolved dynamics <xref ref-type="bibr" rid="bib1.bibx16 bib1.bibx10 bib1.bibx17" id="paren.21"><named-content content-type="pre">e.g.</named-content></xref>, especially at the smallest resolved scales. Since the ANNs have access to both the instantaneous DNS flow fields and corresponding coarse-grained field during training, a unique opportunity arises to compensate also for instantaneous discretization errors in ANN SGS models.</p>
      <p id="d1e272">Within this context, there have been a couple of noteworthy studies <xref ref-type="bibr" rid="bib1.bibx26 bib1.bibx52 bib1.bibx60" id="paren.22"/> that introduced the framework of perfect and optimal LES. Based on this framework, these studies approximated the full LES closure terms (that account for both the unresolved physics and all instantaneous discretization errors) with a data-driven approach based on DNS. The statistical method they used for this purpose though (i.e. stochastic estimation) still made additional assumptions about the functional form of the LES SGS model (e.g. linearity). A recent study by <xref ref-type="bibr" rid="bib1.bibx3" id="text.23"/> therefore used ANNs to approximate, in a similar way to the aforementioned studies, the full LES closure terms. To construct based on these ANNs an LES SGS model that is numerically stable a posteriori, they combined the ANNs with eddy-viscosity models. They did not specifically focus on the discretization errors associated with staggered finite-volume grids and did not consider wall-bounded turbulent flows like ABLs.</p>
      <p id="d1e281">In this study, we therefore made a first attempt to construct, based on DNS fields, an ANN SGS model that compensates for both the unresolved physics and the instantaneous discretization errors introduced by staggered finite-volume grids. Our ambition in doing so is to eventually improve the a posteriori accuracy compared to LES with traditional SGS models like the Smagorinsky model. This may potentially reduce the computational cost involved in LES as well, as accurate results may still be achieved with much coarser, computationally cheaper resolutions than currently used.</p>
      <p id="d1e284">To make a step towards this ambition, our aim with the current paper is two-fold:
<list list-type="order"><list-item>
      <p id="d1e289">We describe the framework of our ANN SGS model, which takes both the unresolved physics and instantaneous spatial discretization errors in finite-volume LES into account. This includes its theoretical foundations (Sect. <xref ref-type="sec" rid="Ch1.S2"/>) and its implementation (Sect. <xref ref-type="sec" rid="Ch1.S3"/>).</p></list-item><list-item>
      <p id="d1e297">We characterize both the a priori and a posteriori performance of our ANN SGS model for a wall-bounded turbulent neutral channel flow, without resorting to previously used ad hoc adjustments (Sect. <xref ref-type="sec" rid="Ch1.S4"/>). This includes a discussion about the numeric instability we observed a posteriori (Sect. <xref ref-type="sec" rid="Ch1.S4.SS2"/>), together with suggestions for future studies that may help to overcome the observed instability without needing the previously used ad hoc adjustments (Sect. <xref ref-type="sec" rid="Ch1.S5"/>).</p></list-item></list></p><?xmltex \hack{\newpage}?>
</sec>
<sec id="Ch1.S2">
  <label>2</label><title>Theoretical framework of our ANN finite-volume LES SGS model </title>
      <p id="d1e315">As mentioned in Sect. <xref ref-type="sec" rid="Ch1.S1"/>, one of our key objectives is to construct an ANN LES SGS model that compensates for the instantaneous discretization errors introduced by implicit filtering with staggered finite-volume numerical schemes. To derive such an SGS model, we used as a starting point the Navier–Stokes momentum conservation equations for a Newtonian incompressible fluid without buoyancy effects (which is appropriate for the test case used in this study; see Sect. <xref ref-type="sec" rid="Ch1.S3.SS1"/>):
          <disp-formula id="Ch1.E1" content-type="numbered"><label>1</label><mml:math id="M2" display="block"><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>P</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:msup><mml:mo>∂</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msup><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:mn mathvariant="normal">2</mml:mn></mml:msup></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M3" display="inline"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mspace linebreak="nobreak" width="0.33em"/><mml:mo>(</mml:mo><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi>v</mml:mi><mml:mo>,</mml:mo><mml:mi>w</mml:mi><mml:mo>)</mml:mo><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mspace width="0.33em" linebreak="nobreak"/><mml:mo>[</mml:mo><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">1</mml:mn></mml:mrow></mml:msup><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> is the wind velocity along the <inline-formula><mml:math id="M4" display="inline"><mml:mi>j</mml:mi></mml:math></inline-formula>th direction, <inline-formula><mml:math id="M5" display="inline"><mml:mi>t</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M6" display="inline"><mml:mrow><mml:mo>[</mml:mo><mml:mi mathvariant="normal">s</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> the time, <inline-formula><mml:math id="M7" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M8" display="inline"><mml:mrow><mml:msub><mml:mi>x</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M9" display="inline"><mml:mrow><mml:mo>[</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> the positions in the <inline-formula><mml:math id="M10" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula>th direction and <inline-formula><mml:math id="M11" display="inline"><mml:mi>j</mml:mi></mml:math></inline-formula>th direction, respectively, <inline-formula><mml:math id="M12" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M13" display="inline"><mml:mrow><mml:mo>[</mml:mo><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:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> the density, <inline-formula><mml:math id="M14" display="inline"><mml:mi>P</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M15" display="inline"><mml:mrow><mml:mo>[</mml:mo><mml:mi mathvariant="normal">Pa</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> the pressure, and <inline-formula><mml:math id="M16" display="inline"><mml:mi mathvariant="italic">ν</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M17" display="inline"><mml:mrow><mml:mo>[</mml:mo><mml:msup><mml:mi mathvariant="normal">m</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><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">1</mml:mn></mml:mrow></mml:msup><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> the kinematic viscosity.</p>
      <p id="d1e631">The governing LES equations are usually derived by applying a generic, unspecified filtering operation <inline-formula><mml:math id="M18" display="inline"><mml:mi mathvariant="bold">G</mml:mi></mml:math></inline-formula> to Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>), which introduces a subgrid term <inline-formula><mml:math id="M19" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>≡</mml:mo><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>-</mml:mo><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mspace width="0.33em" linebreak="nobreak"/><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:mrow></mml:math></inline-formula> that has to be modelled <xref ref-type="bibr" rid="bib1.bibx40 bib1.bibx43" id="paren.24"/>. Traditional subgrid models like that of Smagorinsky <xref ref-type="bibr" rid="bib1.bibx47 bib1.bibx28" id="paren.25"/> attempt to model <inline-formula><mml:math id="M20" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> associated with <inline-formula><mml:math id="M21" display="inline"><mml:mi mathvariant="bold">G</mml:mi></mml:math></inline-formula>. However, by only considering the generic operation <inline-formula><mml:math id="M22" display="inline"><mml:mi mathvariant="bold">G</mml:mi></mml:math></inline-formula>, they cannot directly compensate for the discretization errors arising on a specific finite numerical grid. Although the impact of the discretization errors can be reduced by adopting an explicit filtering technique (for instance, by increasing the grid resolution compared to the filter width), this is in practice often not done because of the high computational cost <xref ref-type="bibr" rid="bib1.bibx43" id="paren.26"/>.
It may therefore be beneficial to develop a LES SGS model that directly compensates for the introduced discretization errors, ideally such that explicit filtering is not required anymore.</p>
      <p id="d1e733">To this end, we applied the  finite-volume filtering operation <inline-formula><mml:math id="M23" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">FV</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> to Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>) instead of the generic operation <inline-formula><mml:math id="M24" display="inline"><mml:mi mathvariant="bold">G</mml:mi></mml:math></inline-formula>. <inline-formula><mml:math id="M25" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">FV</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> is defined as a 3-D top-hat filter sampled on an a priori defined finite-volume grid, where the finite sampling implicitly imposes an additional spectral cutoff filter <xref ref-type="bibr" rid="bib1.bibx26 bib1.bibx60" id="paren.27"/>. We used <inline-formula><mml:math id="M26" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">FV</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula> to derive an alternative set of LES equations (Eq. <xref ref-type="disp-formula" rid="Ch1.E3"/>) that reflects the employed finite-volume grid and removes the need for commutation between the filtering and spatial differentiation operators (Eq. <xref ref-type="disp-formula" rid="Ch1.E3"/>; <xref ref-type="bibr" rid="bib1.bibx12" id="altparen.28"/>). This allowed us to explicitly include many instantaneous discretization errors in the definition <inline-formula><mml:math id="M27" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, making use of prior knowledge about the employed finite-volume grid and numerical schemes.</p>
      <?pagebreak page3772?><p id="d1e803">Considering for the sake of clarity only equidistant LES grids, following <xref ref-type="bibr" rid="bib1.bibx60" id="text.29"/>, the filtered velocity associated with <inline-formula><mml:math id="M28" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="bold">G</mml:mi><mml:mi mathvariant="normal">FV</mml:mi></mml:msup></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M29" display="inline"><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula>, at a certain grid cell with indices <inline-formula><mml:math id="M30" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> can be written as
          <disp-formula id="Ch1.E2" content-type="numbered"><label>2</label><mml:math id="M31" display="block"><mml:mrow><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo><mml:mo>=</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>x</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>y</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:munder><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>,</mml:mo><mml:mi>z</mml:mi><mml:mo>)</mml:mo><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mspace width="0.33em" linebreak="nobreak"/><mml:mi mathvariant="normal">d</mml:mi><mml:msup><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>,</mml:mo></mml:mrow></mml:math></disp-formula>
        where <inline-formula><mml:math id="M32" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>y</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:math></inline-formula> are the equidistant filter widths in the three spatial directions, <inline-formula><mml:math id="M33" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> the grid cube/control volume for <inline-formula><mml:math id="M34" display="inline"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> at the considered grid cell, and <inline-formula><mml:math id="M35" display="inline"><mml:mi mathvariant="bold-italic">x</mml:mi></mml:math></inline-formula> a vector indicating the position <inline-formula><mml:math id="M36" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>,</mml:mo><mml:mi>z</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> in the flow domain.
Since we focused in this study on  staggered finite-volume grids (Table <xref ref-type="table" rid="Ch1.T1"/>), the location of each control volume <inline-formula><mml:math id="M37" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> depends on the <inline-formula><mml:math id="M38" display="inline"><mml:mi>j</mml:mi></mml:math></inline-formula> component considered (Sect. <xref ref-type="sec" rid="Ch1.S3.SS2"/>).</p>
      <p id="d1e1081">Applying the finite-volume filter to Eq. (<xref ref-type="disp-formula" rid="Ch1.E1"/>), using the divergence theorem to convert the volume integrals to surface integrals, and combining the advection and viscous stress terms, for a certain grid cell, we get an expression similar to that obtained by <xref ref-type="bibr" rid="bib1.bibx60" id="text.30"/>:
          <disp-formula id="Ch1.E3" content-type="numbered"><label>3</label><mml:math id="M39" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>t</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd><mml:mtd><mml:mrow><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>x</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>y</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:munder></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>⋅</mml:mo><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>i</mml:mi></mml:msub><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mfenced><mml:msub><mml:mi>n</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>⋅</mml:mo><mml:mi mathvariant="normal">d</mml:mi><mml:msup><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>-</mml:mo><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>x</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>y</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:msub><mml:mi mathvariant="italic">ρ</mml:mi><mml:mn mathvariant="normal">0</mml:mn></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:munder><mml:mi>p</mml:mi><mml:msub><mml:mi>n</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mspace width="0.33em" linebreak="nobreak"/><mml:mi mathvariant="normal">d</mml:mi><mml:msup><mml:mi mathvariant="bold-italic">x</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
        where <inline-formula><mml:math id="M40" display="inline"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> is the surface area of the control volume <inline-formula><mml:math id="M41" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, and <inline-formula><mml:math id="M42" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M43" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> the <inline-formula><mml:math id="M44" display="inline"><mml:mi>i</mml:mi></mml:math></inline-formula>th and <inline-formula><mml:math id="M45" display="inline"><mml:mi>j</mml:mi></mml:math></inline-formula>th components, respectively, of the outward-pointing normal vector <inline-formula><mml:math id="M46" display="inline"><mml:mi mathvariant="bold-italic">n</mml:mi></mml:math></inline-formula> corresponding to <inline-formula><mml:math id="M47" display="inline"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>j</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>. It is noteworthy that, by invoking the divergence theorem, the divergence operator itself is effectively replaced by surface integrals, which removes the need for a commutative filter <xref ref-type="bibr" rid="bib1.bibx12" id="paren.31"/> and avoids the truncation errors introduced by the discretization of the divergence operator on the finite grid.</p>
      <p id="d1e1437">The well-known closure problem does, of course, persist. In fact, none of the terms on the right-hand side of Eq. (<xref ref-type="disp-formula" rid="Ch1.E3"/>) can be determined exactly on the available finite LES grid and therefore have to be approximated. As argued, however, by <xref ref-type="bibr" rid="bib1.bibx27" id="text.32"/> and <xref ref-type="bibr" rid="bib1.bibx60" id="text.33"/>, an  optimal formulation for the pressure term is impractical and barely more accurate than traditional finite-volume pressure schemes.</p>
      <p id="d1e1448">The errors made in approximating the time derivative, in turn, are usually constrained by the advection and diffusion terms through the selected time step. Furthermore, the time discretization scheme we selected (Sect. <xref ref-type="sec" rid="Ch1.S3.SS1"/>) has good energy conservation properties with a slight damping of TKE over time <xref ref-type="bibr" rid="bib1.bibx51" id="paren.34"/>.</p>
      <p id="d1e1456">In this study, we will therefore only consider the instantaneous spatial discretization errors in the advection and viscous stress terms. We further note that, in contrast to eddy-viscosity SGS models, the isotropic part of the transport terms does not have to be incorporated in a modified pressure term.</p>
      <p id="d1e1459">To approximate the advection and viscous stress terms on the finite LES grid, in this study, we used second-order linear interpolations (Sects. <xref ref-type="sec" rid="Ch1.S3.SS2"/>, <xref ref-type="sec" rid="Ch1.S4.SS2"/>). If we then consider specifically (i) the control volume of the <inline-formula><mml:math id="M48" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula> component and (ii) the transport in vertical direction, we can rewrite the first term on the right-hand side of Eq. (<xref ref-type="disp-formula" rid="Ch1.E3"/>) as follows:
          <disp-formula id="Ch1.E4" content-type="numbered"><label>4</label><mml:math id="M49" display="block"><mml:mtable class="split" rowspacing="0.2ex" displaystyle="true" columnalign="right left"><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mn mathvariant="normal">1</mml:mn><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>x</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>y</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:mo>∂</mml:mo><mml:msubsup><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>u</mml:mi><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:munder><mml:mfenced close=")" open="("><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>u</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mfenced><mml:mi mathvariant="normal">d</mml:mi><mml:msup><mml:mi>x</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mi mathvariant="normal">d</mml:mi><mml:msup><mml:mi>y</mml:mi><mml:mo>′</mml:mo></mml:msup></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:mi mathvariant="normal">Δ</mml:mi><mml:mi>x</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>y</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:munder><mml:mo movablelimits="false">∫</mml:mo><mml:mrow><mml:mo>∂</mml:mo><mml:msubsup><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>u</mml:mi><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:munder><mml:mfenced close=")" open="("><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mo>∂</mml:mo><mml:mi>u</mml:mi></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mfenced><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mspace width="0.33em" linebreak="nobreak"/><mml:mi mathvariant="normal">d</mml:mi><mml:msup><mml:mi>x</mml:mi><mml:mo>′</mml:mo></mml:msup><mml:mi mathvariant="normal">d</mml:mi><mml:msup><mml:mi>y</mml:mi><mml:mo>′</mml:mo></mml:msup></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:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mfenced close="" open="("><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mover accent="true"><mml:mi>w</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mover accent="true"><mml:mi>w</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></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:mrow><mml:mover accent="true"><mml:mi>u</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mover accent="true"><mml:mi>u</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mo>-</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mover accent="true"><mml:mi>u</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mover accent="true"><mml:mi>u</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></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:mrow><mml:mover accent="true"><mml:mi>w</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mover accent="true"><mml:mi>w</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle></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:mrow><mml:mover accent="true"><mml:mi>u</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo><mml:mo>+</mml:mo><mml:mover accent="true"><mml:mi>u</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo></mml:mrow><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:mstyle></mml:mrow></mml:mtd></mml:mtr><mml:mtr><mml:mtd/><mml:mtd><mml:mrow><mml:mfenced open="" close=")"><mml:mrow><mml:mo>+</mml:mo><mml:mi mathvariant="italic">ν</mml:mi><mml:mstyle displaystyle="true"><mml:mfrac style="display"><mml:mrow><mml:mover accent="true"><mml:mi>u</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>+</mml:mo><mml:mn mathvariant="normal">1</mml:mn><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:mover accent="true"><mml:mi>u</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></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:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:mfrac></mml:mstyle><mml:mfenced close=")" open="("><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo><mml:mo>-</mml:mo><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:mfenced><mml:mo>,</mml:mo></mml:mrow></mml:mtd></mml:mtr></mml:mtable></mml:math></disp-formula>
        where <inline-formula><mml:math id="M50" display="inline"><mml:mrow><mml:mo>∂</mml:mo><mml:msubsup><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>u</mml:mi><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M51" display="inline"><mml:mrow><mml:mo>∂</mml:mo><mml:msubsup><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>u</mml:mi><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> are, respectively, the lower and upper boundaries of the control volume corresponding to the <inline-formula><mml:math id="M52" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula> component <inline-formula><mml:math id="M53" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, representing two different subsets of the total control volume area <inline-formula><mml:math id="M54" display="inline"><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi mathvariant="normal">Ω</mml:mi><mml:mi>u</mml:mi></mml:msub><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e2208"><inline-formula><mml:math id="M55" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M56" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>, in turn, are unknown terms at the lower and upper boundaries of the considered control volume and are directly defined by Eq. (<xref ref-type="disp-formula" rid="Ch1.E4"/>). They correct for the unresolved physics and instantaneous discretization errors introduced by the employed approximations denoted on the right-hand side.</p>
      <p id="d1e2273">The correction terms for the other control volumes and transport components can be defined in a similar manner. In the remainder of the paper, we will denote the complete correction terms with the shorthand notation <inline-formula><mml:math id="M57" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M58" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>. It is these complete terms we aim to predict with our ANN-based LES SGS model. To fully solve Eq. (<xref ref-type="disp-formula" rid="Ch1.E3"/>),  after training, our ANN SGS model only makes use of information available in an actual finite-volume LES: for its inputs, it relies only on the resolved flow fields <inline-formula><mml:math id="M59" display="inline"><mml:mover accent="true"><mml:mi>u</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula>, <inline-formula><mml:math id="M60" display="inline"><mml:mover accent="true"><mml:mi>v</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula>, <inline-formula><mml:math id="M61" display="inline"><mml:mover accent="true"><mml:mi>w</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula>, and their boundary conditions (Sect. <xref ref-type="sec" rid="Ch1.S3.SS3"/>).</p>
</sec>
<sec id="Ch1.S3">
  <label>3</label><title>Methodology</title>
      <p id="d1e2351">In this section, we will describe in detail the implementation of our ANN SGS model. First, we will provide a description<?pagebreak page3773?> of the DNS test case we used to train and test our ANN SGS model (Sect. <xref ref-type="sec" rid="Ch1.S3.SS1"/>). Next, we will briefly outline how we generated the data needed to train our ANN SGS model, using the selected DNS test case (Sect. <xref ref-type="sec" rid="Ch1.S3.SS2"/>). Subsequently, we will describe how we designed and trained our ANN SGS model (Sect. <xref ref-type="sec" rid="Ch1.S3.SS3"/> and <xref ref-type="sec" rid="Ch1.S3.SS4"/>). Finally, we will specify how we tested the a priori and a posteriori performance of our ANN SGS model (Sect. <xref ref-type="sec" rid="Ch1.S3.SS5"/>).</p>
<sec id="Ch1.S3.SS1">
  <label>3.1</label><title>DNS test case</title>
      <p id="d1e2371">We used as a test case a DNS of incompressible neutral channel flow (with friction Reynolds number <inline-formula><mml:math id="M62" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">Re</mml:mi><mml:mi mathvariant="italic">τ</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> being equal to 590) based on <xref ref-type="bibr" rid="bib1.bibx37" id="text.35"/>. The friction Reynolds number is a variant of the standard Reynolds number based on the friction velocity, which is typically lower in magnitude than the standard Reynolds number and is often used in the context of wall-bounded turbulent flows <xref ref-type="bibr" rid="bib1.bibx40" id="paren.36"><named-content content-type="pre">e.g.</named-content></xref>. The friction velocity, in turn, is a velocity scale that measures the amount of mechanically generated turbulence and consequently is a logical scale to consider in neutral channel flow. We note that the selected friction Reynolds number is relatively low compared to most turbulent flows occurring in nature.</p>
      <p id="d1e2393">As simulation tool, we used the high-order DNS and finite-volume LES MicroHH  code (v2.0), which has been verified previously for the case selected in this study <xref ref-type="bibr" rid="bib1.bibx51" id="paren.37"/>. The selected neutral channel flow is a turbulent flow bounded by walls at both the bottom and top of the domain (no-slip boundary conditions), with a mean flow characterized by a symmetric horizontally averaged vertical profile (Fig. <xref ref-type="fig" rid="Ch1.F1"/>). In the horizontal directions, periodic boundary conditions were applied and a constant volume-averaged velocity (<inline-formula><mml:math id="M63" display="inline"><mml:mrow><mml:msub><mml:mi>U</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.11</mml:mn><mml:mspace linebreak="nobreak" width="0.125em"/><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">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>) was enforced by dynamically adjusting the pressure gradient.</p>
      <p id="d1e2428">We stored in total 31 3-D flow fields of the wind velocity fields <inline-formula><mml:math id="M64" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M65" display="inline"><mml:mi>v</mml:mi></mml:math></inline-formula>, and <inline-formula><mml:math id="M66" display="inline"><mml:mi>w</mml:mi></mml:math></inline-formula> at time intervals of 60 s after the flow reached steady state. This time interval was large enough to ensure that subsequent stored flow fields were (nearly) independent, which is preferable for the training and testing of the neural networks (Sect. <xref ref-type="sec" rid="Ch1.S3.SS4"/> and <xref ref-type="sec" rid="Ch1.S3.SS5"/>). More details about the used simulation setup and simulation code can be found in Table <xref ref-type="table" rid="Ch1.T1"/> and <xref ref-type="bibr" rid="bib1.bibx51" id="text.38"/>.</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T1" specific-use="star"><?xmltex \currentcnt{1}?><label>Table 1</label><caption><p id="d1e2466">Simulation specifications for direct numerical simulation of the incompressible neutral channel flow test case we used to generate the training data (Sect. <xref ref-type="sec" rid="Ch1.S3.SS2"/>). Here, <inline-formula><mml:math id="M67" display="inline"><mml:mrow><mml:mi mathvariant="italic">δ</mml:mi><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mspace width="0.33em" linebreak="nobreak"/><mml:mo>[</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> refers to the channel-half width. Additional details about the employed code (MicroHH v2.0) are given in <xref ref-type="bibr" rid="bib1.bibx51" id="text.39"/>.
</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="2">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1">Friction Reynolds number <inline-formula><mml:math id="M68" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">Re</mml:mi><mml:mi mathvariant="italic">τ</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M69" display="inline"><mml:mn mathvariant="normal">590</mml:mn></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Boundary conditions</oasis:entry>
         <oasis:entry colname="col2">horizontal directions (<inline-formula><mml:math id="M70" display="inline"><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi></mml:mrow></mml:math></inline-formula>): periodic, vertical direction (<inline-formula><mml:math id="M71" display="inline"><mml:mi>z</mml:mi></mml:math></inline-formula>): no slip</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Domain size (<inline-formula><mml:math id="M72" display="inline"><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>,</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:math></inline-formula>)</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M73" display="inline"><mml:mrow><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">π</mml:mi><mml:mi mathvariant="italic">δ</mml:mi><mml:mo>,</mml:mo><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mspace width="0.33em" linebreak="nobreak"/><mml:mi mathvariant="italic">π</mml:mi><mml:mi mathvariant="italic">δ</mml:mi><mml:mo>,</mml:mo><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mspace linebreak="nobreak" width="0.33em"/><mml:mn mathvariant="normal">2</mml:mn><mml:mi mathvariant="italic">δ</mml:mi></mml:mrow></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Kinematic viscosity <inline-formula><mml:math id="M74" display="inline"><mml:mi mathvariant="italic">ν</mml:mi></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M75" display="inline"><mml:mrow><mml:mn mathvariant="normal">1.0</mml:mn><mml:mo>×</mml:mo><mml:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M76" display="inline"><mml:mrow><mml:mo>[</mml:mo><mml:msup><mml:mi mathvariant="normal">m</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msup><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">1</mml:mn></mml:mrow></mml:msup><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Prescribed volume-averaged velocity <inline-formula><mml:math id="M77" display="inline"><mml:mrow><mml:msub><mml:mi>U</mml:mi><mml:mi mathvariant="normal">f</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M78" display="inline"><mml:mn mathvariant="normal">0.11</mml:mn></mml:math></inline-formula> <inline-formula><mml:math id="M79" display="inline"><mml:mrow><mml:mo>[</mml:mo><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">1</mml:mn></mml:mrow></mml:msup><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Grid resolution (<inline-formula><mml:math id="M80" display="inline"><mml:mrow><mml:mi>x</mml:mi><mml:mo>,</mml:mo><mml:mi>y</mml:mi><mml:mo>,</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:math></inline-formula>)</oasis:entry>
         <oasis:entry colname="col2">768, 384, 256  (stretched in vertical)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Employed grid</oasis:entry>
         <oasis:entry colname="col2">staggered Arakawa C grid</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Spatial discretization</oasis:entry>
         <oasis:entry colname="col2">fourth-order interpolation scheme</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Time discretization</oasis:entry>
         <oasis:entry colname="col2">three-stage, third-order Runge–Kutta scheme</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <?xmltex \floatpos{t}?><fig id="Ch1.F1"><?xmltex \currentcnt{1}?><?xmltex \def\figurename{Figure}?><label>Figure 1</label><caption><p id="d1e2761">Sketch of simulated turbulent channel flow. Here, <inline-formula><mml:math id="M81" display="inline"><mml:mi mathvariant="italic">δ</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M82" display="inline"><mml:mrow><mml:mo>[</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> refers to the channel-half width.</p></caption>
          <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f01.png"/>

        </fig>

</sec>
<sec id="Ch1.S3.SS2">
  <label>3.2</label><title>DNS training data generation</title>
      <p id="d1e2797">Using the filtering procedure outlined in Sect. <xref ref-type="sec" rid="Ch1.S2"/>, we calculated consistent pairs of (i) low-resolution flow velocity fields <inline-formula><mml:math id="M83" display="inline"><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula> (that serve as input for the ANN) and (ii) correction terms <inline-formula><mml:math id="M84" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M85" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> (that serve as the ground truth for the ANN predictions) from 31 previously stored DNS flow fields (Sect. <xref ref-type="sec" rid="Ch1.S3.SS1"/>). We used these input–output pairs as training data for our ANNs (Sect. <xref ref-type="sec" rid="Ch1.S3.SS4"/>).</p>
      <p id="d1e2853">By design, the filter in Sect. <xref ref-type="sec" rid="Ch1.S2"/> is directly defined by a selected coarse equidistant LES resolution (Eq. <xref ref-type="disp-formula" rid="Ch1.E2"/>). To generate the training data, we selected three different typical horizontal equidistant coarse resolutions with an identical coarsening in the vertical: <inline-formula><mml:math id="M86" display="inline"><mml:mrow><mml:mn mathvariant="normal">192</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">96</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M87" display="inline"><mml:mrow><mml:mn mathvariant="normal">96</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">48</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula>, and <inline-formula><mml:math id="M88" display="inline"><mml:mrow><mml:mn mathvariant="normal">64</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">32</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula> (<inline-formula><mml:math id="M89" display="inline"><mml:mrow><mml:mi>x</mml:mi><mml:mo>×</mml:mo><mml:mi>y</mml:mi><mml:mo>×</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:math></inline-formula>) cells. These three resolutions correspond to horizontal coarse-graining factors, <inline-formula><mml:math id="M90" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">hor</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, of 4, 8, and 12, respectively. In the remainder of the paper, we will denote the horizontal coarse-graining factor(s) used during training and testing as <inline-formula><mml:math id="M91" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M92" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, respectively (see Sect. <xref ref-type="sec" rid="Ch1.S3.SS5.SSS1"/>).</p>
      <p id="d1e2970">We note that the spatial discretization errors introduced by the applied coarsening, specifically concern errors associated with typically applied second-order linear interpolations (Eq. <xref ref-type="disp-formula" rid="Ch1.E4"/>). These interpolation errors remove a substantial fraction of the turbulent energy remaining after applying the filter (Eq. <xref ref-type="disp-formula" rid="Ch1.E2"/>), reflecting their detrimental impact on the smallest resolved scales (Fig. <xref ref-type="fig" rid="Ch1.F2"/>). Only by including their impact in the predicted correction terms is our ANN SGS model able to fully compensate for the spatial discretization errors in the advection and viscous stress terms.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F2"><?xmltex \currentcnt{2}?><?xmltex \def\figurename{Figure}?><label>Figure 2</label><caption><p id="d1e2982">Example stream-wise power spectra of <inline-formula><mml:math id="M93" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula> for the selected channel flow (Sect. <xref ref-type="sec" rid="Ch1.S3.SS1"/>) at a height of <inline-formula><mml:math id="M94" display="inline"><mml:mrow><mml:mn mathvariant="normal">0.109</mml:mn><mml:mi mathvariant="italic">δ</mml:mi></mml:mrow></mml:math></inline-formula> (i.e. in the log layer) and considering a typical coarse equidistant LES resolution of <inline-formula><mml:math id="M95" display="inline"><mml:mrow><mml:mn mathvariant="normal">64</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">32</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula> (<inline-formula><mml:math id="M96" display="inline"><mml:mrow><mml:mi>x</mml:mi><mml:mo>×</mml:mo><mml:mi>y</mml:mi><mml:mo>×</mml:mo><mml:mi>z</mml:mi></mml:mrow></mml:math></inline-formula>) cells (which corresponds to a horizontal coarse-graining factor of <inline-formula><mml:math id="M97" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">hor</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula>). Here, <inline-formula><mml:math id="M98" display="inline"><mml:mi mathvariant="italic">δ</mml:mi></mml:math></inline-formula> <inline-formula><mml:math id="M99" display="inline"><mml:mrow><mml:mo>[</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> refers to the channel-half width. The power spectral density <inline-formula><mml:math id="M100" display="inline"><mml:mi>E</mml:mi></mml:math></inline-formula> on the vertical axis has been normalized by <inline-formula><mml:math id="M101" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">δ</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M102" display="inline"><mml:mrow><mml:mi>u</mml:mi><mml:msup><mml:msub><mml:mi/><mml:mi mathvariant="italic">τ</mml:mi></mml:msub><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M103" display="inline"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi mathvariant="italic">τ</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M104" display="inline"><mml:mrow><mml:mo>[</mml:mo><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">1</mml:mn></mml:mrow></mml:msup><mml:mo>]</mml:mo></mml:mrow></mml:math></inline-formula> is the friction velocity. Here, the black line corresponds to the power spectrum of the DNS fields, the red line to the power spectrum remaining after the finite-volume LES filter (Eq. <xref ref-type="disp-formula" rid="Ch1.E2"/>) has been applied, and the blue line to the spectrum remaining after both the finite-volume filter and the second-order linear interpolations required on the coarse LES grid (Eq. <xref ref-type="disp-formula" rid="Ch1.E4"/>).</p></caption>
          <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f02.png"/>

        </fig>

</sec>
<sec id="Ch1.S3.SS3">
  <label>3.3</label><title>ANN architecture</title>
      <p id="d1e3161">We used feed-forward, fully connected ANNs with a single hidden layer to predict the correction terms <inline-formula><mml:math id="M105" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M106" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> with the resolved flow fields <inline-formula><mml:math id="M107" display="inline"><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula> as input. These are simple ANNs that facilitate computationally fast evaluations and easy implementation. We did not use deeper, more sophisticated ANNs to limit the computational cost involved in making predictions with the ANN as much as possible. This computational cost is critical for the affordability of an ANN SGS model in an actual LES simulation (Sect. <xref ref-type="sec" rid="Ch1.S4.SS2"/>).</p>
      <p id="d1e3212">To introduce non-linearity in the ANN, we used as an activation function the leaky rectified linear unit (ReLu) function <xref ref-type="bibr" rid="bib1.bibx32" id="paren.40"/> with the constant <inline-formula><mml:math id="M108" display="inline"><mml:mi mathvariant="italic">α</mml:mi></mml:math></inline-formula> set to the common value <inline-formula><mml:math id="M109" display="inline"><mml:mn mathvariant="normal">0.2</mml:mn></mml:math></inline-formula>. This non-linear activation function, together with the linear matrix–vector multiplications and bias parameter additions, defines the entire functional form of the ANN.</p>
      <?pagebreak page3774?><p id="d1e3232">Similar to conventional LES SGS models, the ANN should preferably act on a small subdomain of the full grid to facilitate integration in our simulation code (MicroHH), which uses domain decomposition for distributed memory computing. We consequently predicted with the ANN only the <inline-formula><mml:math id="M110" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">in</mml:mi><mml:mo>/</mml:mo><mml:mi mathvariant="normal">out</mml:mi></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula> values associated with one grid cell <inline-formula><mml:math id="M111" display="inline"><mml:mrow><mml:mo>(</mml:mo><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula> at a time. As input to the ANN, we used the locally resolved flow fields <inline-formula><mml:math id="M112" display="inline"><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula> in a <inline-formula><mml:math id="M113" display="inline"><mml:mrow><mml:mn mathvariant="normal">5</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">5</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:math></inline-formula> stencil surrounding the grid cell for which we predict <inline-formula><mml:math id="M114" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">in</mml:mi><mml:mo>/</mml:mo><mml:mi mathvariant="normal">out</mml:mi></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula>. Similar to <xref ref-type="bibr" rid="bib1.bibx9" id="text.41"/> and <xref ref-type="bibr" rid="bib1.bibx58" id="text.42"/>, we opted not to make our inputs Galilean/rotational invariant as the walls already provide an intrinsic coordinate system and velocity reference.</p>
      <p id="d1e3334">To select appropriate <inline-formula><mml:math id="M115" display="inline"><mml:mrow><mml:mn mathvariant="normal">5</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">5</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:math></inline-formula> inputs stencils close to the boundaries of the domain, we made use of the horizontal periodic boundary conditions and the vertical no-slip conditions. We encoded the no-slip conditions in the input stencils by mirroring <inline-formula><mml:math id="M116" display="inline"><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula> over the walls, such that <inline-formula><mml:math id="M117" display="inline"><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula> linearly interpolated to the wall was <inline-formula><mml:math id="M118" display="inline"><mml:mrow><mml:mn mathvariant="normal">0</mml:mn><mml:mspace width="0.125em" linebreak="nobreak"/><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">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>. This may have helped the ANN to distinguish the near-wall region from the bulk of the flow, potentially removing the need for separate SGS and wall models.</p>
      <p id="d1e3402">Using the <inline-formula><mml:math id="M119" display="inline"><mml:mrow><mml:mn mathvariant="normal">5</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">5</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:math></inline-formula> stencils in combination with the employed staggered Arakawa C grid, an asymmetric bias is introduced in the ANN input and output variables if no special care is taken. We overcame this issue by combining three separate single-layer ANNs, where each one corresponded to one of the three control volumes considered (Sect. <xref ref-type="sec" rid="Ch1.S2"/>). Here, each received a stencil with slightly adjusted dimensions and predicted only the correction terms (<inline-formula><mml:math id="M120" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>) corresponding to the considered control volume (resulting in six outputs per ANN; Fig. <xref ref-type="fig" rid="Ch1.F3"/>). This ensured symmetry in the inputs and outputs of the ANN (Fig. <xref ref-type="fig" rid="Ch1.F4"/>a) and did not increase the computational effort involved in evaluating the ANN after training.</p>
      <p id="d1e3455">In fact, this allowed us to reduce the number of ANN evaluations in the a posteriori simulation (Sect. <xref ref-type="sec" rid="Ch1.S4.SS2"/>) by almost a factor of 2. Except for close to the walls, evaluating the ANN with a checkerboard-like pattern was sufficient to obtain all the needed correction terms (Fig. <xref ref-type="fig" rid="Ch1.F4"/>b). Close to the walls, we did require (sometimes partial) ANN evaluations at every grid cell to calculate all needed correction terms: the checkerboard-like pattern does not provide all the correction terms at the edges of the domain. In the horizontal directions, we could make use of the periodic boundary conditions at the edges of the domain.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F3" specific-use="star"><?xmltex \currentcnt{3}?><?xmltex \def\figurename{Figure}?><label>Figure 3</label><caption><p id="d1e3464">Architecture of ANN framework used in this study. We combined three separate ANNs that each correspond to one of the three considered control volumes. For more information, please refer to Sect. <xref ref-type="sec" rid="Ch1.S3.SS3"/>.</p></caption>
          <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f03.png"/>

        </fig>

      <?xmltex \floatpos{t}?><fig id="Ch1.F4" specific-use="star"><?xmltex \currentcnt{4}?><?xmltex \def\figurename{Figure}?><label>Figure 4</label><caption><p id="d1e3477"><bold>(a)</bold> Example two-dimensional input stencil of <inline-formula><mml:math id="M121" display="inline"><mml:mrow><mml:mover accent="true"><mml:mi>u</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>,</mml:mo><mml:mover accent="true"><mml:mi>v</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:mrow></mml:math></inline-formula> that the ANN corresponding to the control volume of <inline-formula><mml:math id="M122" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula> receives, together with four of its outputs (i.e. <inline-formula><mml:math id="M123" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M124" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M125" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mi>v</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M126" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mi>v</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>). <bold>(b)</bold> Two-dimensional visualization of the way we evaluated the ANN during a posteriori simulations. By evaluating the ANN in checkerboard-like pattern (i.e. only evaluating the grey-shaded grid cells) and making use of the periodic boundary conditions, we could calculate all needed correction terms except those close to the walls.</p></caption>
          <?xmltex \igopts{width=341.433071pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f04.png"/>

        </fig>

</sec>
<sec id="Ch1.S3.SS4">
  <label>3.4</label><title>ANN training</title>
      <p id="d1e3590">We trained the employed ANNs (Fig. <xref ref-type="fig" rid="Ch1.F3"/>) using the training data (consisting of corresponding local <inline-formula><mml:math id="M127" display="inline"><mml:mrow><mml:mn mathvariant="normal">5</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">5</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:math></inline-formula> <inline-formula><mml:math id="M128" display="inline"><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula> fields and correction terms <inline-formula><mml:math id="M129" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">in</mml:mi><mml:mo>/</mml:mo><mml:mi mathvariant="normal">out</mml:mi></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula>; Sect. <xref ref-type="sec" rid="Ch1.S3.SS2"/>) we generated from 31 previously stored DNS flow fields (Sect. <xref ref-type="sec" rid="Ch1.S3.SS1"/>). The exact number of unique samples we could extract from each flow field during training depended on the considered <inline-formula><mml:math id="M130" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> (Sect. <xref ref-type="sec" rid="Ch1.S3.SS2"/>). For the case we mostly focused on in the a priori and a posteriori tests (i.e. where <inline-formula><mml:math id="M131" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula>; see Sect. <xref ref-type="sec" rid="Ch1.S3.SS5"/>), we could extract 294 912 unique samples from each flow field. Of the 31 stored flow fields, we used 25 for training, 3 for validation during training and tuning of the hyperparameters, and 3 for the a priori and a posteriori tests (Sect. <xref ref-type="sec" rid="Ch1.S3.SS5.SSS1"/>).</p>
      <?pagebreak page3775?><p id="d1e3693">To train our ANNs, we used TensorFlow (v 1.12.0), an open-source machine learning framework <xref ref-type="bibr" rid="bib1.bibx1" id="paren.43"/>. We relied on the backpropagation algorithm <xref ref-type="bibr" rid="bib1.bibx42" id="paren.44"/> incorporated within TensorFlow to minimize the loss function. We defined the loss function as the mean squared error (MSE) between the 18 DNS-derived <inline-formula><mml:math id="M132" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">in</mml:mi><mml:mo>/</mml:mo><mml:mi mathvariant="normal">out</mml:mi></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula> components (Sect. <xref ref-type="sec" rid="Ch1.S3.SS2"/>) and the 18 ANN-predicted <inline-formula><mml:math id="M133" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">in</mml:mi><mml:mo>/</mml:mo><mml:mi mathvariant="normal">out</mml:mi></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula> components (Sect. <xref ref-type="sec" rid="Ch1.S3.SS3"/>), combining the results from all three separate ANNs (Sect. <xref ref-type="sec" rid="Ch1.S3.SS3"/>). We observed good convergence of both the training and validation loss without signs of overfitting for all the ANNs we tested (shown as an example for <inline-formula><mml:math id="M134" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula> in Fig. <xref ref-type="fig" rid="Ch1.F5"/>).</p>
      <p id="d1e3781">Here, we chose the popular ADAM optimizer <xref ref-type="bibr" rid="bib1.bibx23" id="paren.45"/> with a relatively low value for the learning rate <inline-formula><mml:math id="M135" display="inline"><mml:mi mathvariant="italic">η</mml:mi></mml:math></inline-formula> (0.0001) and a relatively large batch size of 1000. As our training data contain a high amount of noise inherent to turbulence, these parameter choices were in our case needed to stabilize the training results and achieve good convergence. For all the chosen ANNs corresponding to 2 or 3 <inline-formula><mml:math id="M136" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> (see Sect. <xref ref-type="sec" rid="Ch1.S3.SS5.SSS1"/>), we ensured that the samples originating from the different <inline-formula><mml:math id="M137" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> were approximately equally represented in each training batch.</p>
      <p id="d1e3828">Besides that, we implemented preferential sampling near the walls: during training, we selected the five horizontal layers closest to the bottom and top wall more often than the other horizontal layers (starting from the bottom or top wall towards the centre of the channel, respectively, with a factor of 10, 8, 6, 4, and 2). The preferential sampling restored the balance in the training data set between the physics near the wall and the bulk of the flow, allowing the ANN to improve its performance close to the walls where a SGS model generally matters most.</p>
      <p id="d1e3832">In Table <xref ref-type="table" rid="Ch1.T2"/>, we give an overview of all the hyperparameters and settings we used. The chosen initialization methods for the weights and bias parameter are standard for the architecture and activation function we selected. Furthermore, in line with common practice, we normalized all the inputs and outputs with their means and standard deviations. This improved the convergence during training and accelerated learning.</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T2" specific-use="star"><?xmltex \currentcnt{2}?><label>Table 2</label><caption><p id="d1e3840">Fixed hyperparameters and settings used in the ANNs we trained.  
</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="2">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1">No. of training iterations (epochs)</oasis:entry>
         <oasis:entry colname="col2">500 000 (<inline-formula><mml:math id="M138" display="inline"><mml:mrow><mml:mo>≈</mml:mo><mml:mn mathvariant="normal">38</mml:mn></mml:mrow></mml:math></inline-formula> epochs for <inline-formula><mml:math id="M139" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula>, taking into account the preferential sampling)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">No. of hidden layers</oasis:entry>
         <oasis:entry colname="col2">1</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Batch size</oasis:entry>
         <oasis:entry colname="col2">1000</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Loss function</oasis:entry>
         <oasis:entry colname="col2">mean squared error, no regularization</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Activation function</oasis:entry>
         <oasis:entry colname="col2">leaky ReLu with <inline-formula><mml:math id="M140" display="inline"><mml:mrow><mml:mi mathvariant="italic">α</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.2</mml:mn></mml:mrow></mml:math></inline-formula><xref ref-type="bibr" rid="bib1.bibx32" id="paren.46"/></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Optimizer</oasis:entry>
         <oasis:entry colname="col2">ADAM with <inline-formula><mml:math id="M141" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">β</mml:mi><mml:mn mathvariant="normal">1</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.9</mml:mn></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M142" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">β</mml:mi><mml:mn mathvariant="normal">2</mml:mn></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.999</mml:mn></mml:mrow></mml:math></inline-formula>, and <inline-formula><mml:math id="M143" 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:msup><mml:mn mathvariant="normal">10</mml:mn><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> <xref ref-type="bibr" rid="bib1.bibx23" id="paren.47"/></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Learning rate <inline-formula><mml:math id="M144" display="inline"><mml:mi mathvariant="italic">η</mml:mi></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M145" display="inline"><mml:mn mathvariant="normal">0.0001</mml:mn></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Normalization</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M146" display="inline"><mml:mi>z</mml:mi></mml:math></inline-formula> score (<inline-formula><mml:math id="M147" display="inline"><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mi mathvariant="normal">value</mml:mi><mml:mo>-</mml:mo><mml:mi mathvariant="normal">mean</mml:mi></mml:mrow><mml:mtext>standard deviation</mml:mtext></mml:mfrac></mml:mstyle></mml:math></inline-formula>)</oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Weight/kernel initializer</oasis:entry>
         <oasis:entry colname="col2">He uniform variance scaling initializer <xref ref-type="bibr" rid="bib1.bibx19" id="paren.48"/></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">Bias initializer</oasis:entry>
         <oasis:entry colname="col2">zeros initializer</oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <?pagebreak page3776?><p id="d1e4078">We performed a more extensive sensitivity analysis with the number of neurons in the hidden layer, <inline-formula><mml:math id="M148" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">hidden</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, as it is for our architecture a good measure of the model complexity. In general, we found for all three selected <inline-formula><mml:math id="M149" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">hor</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> (Sect. <xref ref-type="sec" rid="Ch1.S3.SS2"/>) that increasing <inline-formula><mml:math id="M150" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">hidden</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, and thus increasing the model complexity, improved the reduction of the loss function without showing signs of overfitting (shown as an example for <inline-formula><mml:math id="M151" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">hor</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula> in Fig. <xref ref-type="fig" rid="Ch1.F5"/>). However, the improvement in training loss reduction clearly reduced with increasing model complexity, while a higher model complexity increases the computational cost of the ANN SGS model. In the next sections, we will therefore focus on the results we obtained with <inline-formula><mml:math id="M152" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">hidden</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula>, as a reasonable compromise between accuracy and total computational cost.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F5"><?xmltex \currentcnt{5}?><?xmltex \def\figurename{Figure}?><label>Figure 5</label><caption><p id="d1e4151">Evolution of the loss corresponding to the considered training batches (dotted lines) and the three validation flow fields (solid lines) with a changing number of neurons in the single hidden layer as a function of training iteration, for the ANNs using <inline-formula><mml:math id="M153" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula> (see Sect. <xref ref-type="sec" rid="Ch1.S3.SS5.SSS1"/>). To improve readability and keep the total computational effort involved in the training feasible, we show here both losses only for every 10 000 iterations instead of every single iteration.</p></caption>
          <?xmltex \igopts{width=236.157874pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f05.png"/>

        </fig>

<?xmltex \hack{\newpage}?>
</sec>
<sec id="Ch1.S3.SS5">
  <label>3.5</label><title>ANN testing</title>
<sec id="Ch1.S3.SS5.SSS1">
  <label>3.5.1</label><title>A priori (offline) test</title>
      <p id="d1e4199">To assess the potential a priori accuracy of our ANN SGS model, we first compared the ANN predictions to the DNS-derived values (Sects. <xref ref-type="sec" rid="Ch1.S2"/> and <xref ref-type="sec" rid="Ch1.S3.SS2"/>) for three flow fields held out during training (Sect. <xref ref-type="sec" rid="Ch1.S3.SS4"/>) and a single representative coarse LES resolution (i.e. an equidistant grid with <inline-formula><mml:math id="M154" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula>; see Sect. <xref ref-type="sec" rid="Ch1.S4.SS1.SSS1"/>). This tests the ability of our ANN SGS model to generalize towards previously unseen realizations of the steady state associated with the selected channel flow (Sect. <xref ref-type="sec" rid="Ch1.S3.SS1"/>).</p>
      <p id="d1e4245">We especially focused, in the log layer, on <inline-formula><mml:math id="M155" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and the net energy transfer towards the unresolved scales, <inline-formula><mml:math id="M156" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mi mathvariant="normal">SGS</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, where <inline-formula><mml:math id="M157" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi>S</mml:mi><mml:mi>G</mml:mi><mml:mi>S</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is defined and approximated as <inline-formula><mml:math id="M158" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mi mathvariant="normal">SGS</mml:mi></mml:msub><mml:mo>≡</mml:mo><mml:mo>-</mml:mo><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>≈</mml:mo><mml:mo>-</mml:mo><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">in</mml:mi><mml:mo>/</mml:mo><mml:mi mathvariant="normal">out</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">int</mml:mi></mml:mrow></mml:msubsup><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:msub><mml:mi>x</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:math></inline-formula>. We calculated <inline-formula><mml:math id="M159" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mi mathvariant="normal">SGS</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> by interpolating all the individual components to the grid centres (denoted here as <inline-formula><mml:math id="M160" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mrow><mml:mi mathvariant="normal">in</mml:mi><mml:mo>/</mml:mo><mml:mi mathvariant="normal">out</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">int</mml:mi></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula>) and subsequently summing them. <inline-formula><mml:math id="M161" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mi mathvariant="normal">SGS</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> can be both positive and negative, where positive values indicate SGS dissipation and negative values backscatter towards the resolved scales. Both these processes are critical for the a priori and a posteriori performance: dissipating sufficient energy to the unresolved scales is crucial for achieving stable a posteriori results. <inline-formula><mml:math id="M162" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, in turn, is also of particular interest in channel flow: it is the vertical gradient of <inline-formula><mml:math id="M163" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> that has to balance the imposed horizontal pressure gradient <xref ref-type="bibr" rid="bib1.bibx40" id="paren.49"><named-content content-type="pre">e.g.</named-content></xref>, making <inline-formula><mml:math id="M164" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> critical for the quality of the achieved steady-state solution. The log layer is mainly interesting because of its universal character. In the log layer, the horizontally averaged profiles of the mean velocity and Reynolds stress tensor components become partly independent of the Reynolds number when properly scaled with wall units <xref ref-type="bibr" rid="bib1.bibx40" id="paren.50"><named-content content-type="pre">e.g.</named-content></xref>.</p>
      <?pagebreak page3777?><p id="d1e4470">As a reference, we included in the comparison the subgrid fluxes and net SGS transfer predicted with the popular Smagorinsky <xref ref-type="bibr" rid="bib1.bibx28" id="paren.51"/> SGS model (see Sect. <xref ref-type="sec" rid="Ch1.S4.SS1.SSS2"/>), which we will denote as <inline-formula><mml:math id="M165" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">Smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M166" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mi mathvariant="normal">smag</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, respectively. In the Smagorinsky SGS model, <inline-formula><mml:math id="M167" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">Smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is modelled as <inline-formula><mml:math id="M168" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi>r</mml:mi></mml:msub><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:mrow></mml:math></inline-formula>, with <inline-formula><mml:math id="M169" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi>r</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> being the modelled eddy-viscosity coefficient and <inline-formula><mml:math id="M170" display="inline"><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula> being the filtered strain rate tensor (defined as <inline-formula><mml:math id="M171" display="inline"><mml:mrow><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>≡</mml:mo><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:mfenced open="(" close=")"><mml:mrow><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mo>∂</mml:mo><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle><mml:mo>+</mml:mo><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mrow><mml:mo>∂</mml:mo><mml:mover accent="true"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi>j</mml:mi></mml:msub></mml:mrow><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:mrow><mml:mrow><mml:mo>∂</mml:mo><mml:msub><mml:mi>x</mml:mi><mml:mi>i</mml:mi></mml:msub></mml:mrow></mml:mfrac></mml:mstyle></mml:mrow></mml:mfenced></mml:mrow></mml:math></inline-formula>) <xref ref-type="bibr" rid="bib1.bibx40" id="paren.52"><named-content content-type="post">e.g.</named-content></xref>. In line with usual practice for wall-bounded flows, we augmented the model for <inline-formula><mml:math id="M172" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi>r</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> with an ad hoc Van Driest <xref ref-type="bibr" rid="bib1.bibx49" id="paren.53"/> wall-damping function to (partly) compensate for the known over-dissipative behaviour close to walls <xref ref-type="bibr" rid="bib1.bibx40 bib1.bibx43" id="paren.54"><named-content content-type="pre">e.g.</named-content></xref>. Consequently, <inline-formula><mml:math id="M173" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi>r</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> is effectively modelled as <inline-formula><mml:math id="M174" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ν</mml:mi><mml:mi>r</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:msup><mml:mfenced open="(" close=")"><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msub><mml:mi mathvariant="normal">Δ</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>-</mml:mo><mml:mi>exp⁡</mml:mi><mml:mfenced close=")" open="("><mml:mrow><mml:mo>-</mml:mo><mml:msup><mml:mi>z</mml:mi><mml:mo>+</mml:mo></mml:msup><mml:mo>/</mml:mo><mml:msup><mml:mi>A</mml:mi><mml:mo>+</mml:mo></mml:msup></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced></mml:mrow></mml:mfenced><mml:mn mathvariant="normal">2</mml:mn></mml:msup><mml:mover accent="true"><mml:mi>S</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:mrow></mml:math></inline-formula>, with <inline-formula><mml:math id="M175" display="inline"><mml:mrow><mml:msub><mml:mi>c</mml:mi><mml:mi mathvariant="normal">s</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> being the Smagorinsky coefficient (which is being set to <inline-formula><mml:math id="M176" display="inline"><mml:mn mathvariant="normal">0.1</mml:mn></mml:math></inline-formula>), <inline-formula><mml:math id="M177" display="inline"><mml:mi mathvariant="normal">Δ</mml:mi></mml:math></inline-formula> being the filter size (defined as <inline-formula><mml:math id="M178" display="inline"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mo>≡</mml:mo><mml:msup><mml:mfenced open="(" close=")"><mml:mrow><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>x</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>y</mml:mi><mml:mi mathvariant="normal">Δ</mml:mi><mml:mi>z</mml:mi></mml:mrow></mml:mfenced><mml:mfrac><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">3</mml:mn></mml:mfrac></mml:msup></mml:mrow></mml:math></inline-formula>), <inline-formula><mml:math id="M179" display="inline"><mml:mrow><mml:msup><mml:mi>z</mml:mi><mml:mo>+</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> the absolute vertical distance from the closest wall normalized by <inline-formula><mml:math id="M180" display="inline"><mml:mrow><mml:msup><mml:mi>u</mml:mi><mml:mo>*</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M181" display="inline"><mml:mi mathvariant="italic">δ</mml:mi></mml:math></inline-formula>, <inline-formula><mml:math id="M182" display="inline"><mml:mrow><mml:msup><mml:mi>A</mml:mi><mml:mo>+</mml:mo></mml:msup></mml:mrow></mml:math></inline-formula> an empirical constant (which is being set to <inline-formula><mml:math id="M183" display="inline"><mml:mn mathvariant="normal">26</mml:mn></mml:math></inline-formula>), and <inline-formula><mml:math id="M184" display="inline"><mml:mover accent="true"><mml:mi>S</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula> the squared filtered strain rate tensor (defined as <inline-formula><mml:math id="M185" display="inline"><mml:mrow><mml:mover accent="true"><mml:mi>S</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn><mml:msup><mml:mfenced close=")" open="("><mml:mrow><mml:msub><mml:mi>S</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub><mml:msub><mml:mi>S</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfenced><mml:mfrac><mml:mn mathvariant="normal">1</mml:mn><mml:mn mathvariant="normal">2</mml:mn></mml:mfrac></mml:msup></mml:mrow></mml:math></inline-formula>).</p>
      <p id="d1e4908">To facilitate easier interpretation and comparison with the Smagorinsky SGS model, for the ANN and DNS results, we combined the two separate correction terms <inline-formula><mml:math id="M186" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup><mml:mo>,</mml:mo><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>. In the remainder of the paper, we will denote the resulting combined correction terms as <inline-formula><mml:math id="M187" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M188" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, where both consist of the same nine components as <inline-formula><mml:math id="M189" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>. We did this in accordance with the way we evaluated the ANNs within our computational fluid dynamics (CFD) MicroHH code  during the a posteriori test (Sect. <xref ref-type="sec" rid="Ch1.S3.SS3"/>).</p>
      <p id="d1e4996">On top of the comparison for a single  coarse horizontal resolution, we separately explored the generalization performance of the developed ANN SGS model with respect to the selected coarse horizontal resolution in Sect. <xref ref-type="sec" rid="Ch1.S4.SS1.SSS3"/> . To this end, we trained our ANN SGS model, in three different ways, on filtered DNS data corresponding to all selected <inline-formula><mml:math id="M190" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">hor</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> (4, 8, and 12, respectively; see Sect. <xref ref-type="sec" rid="Ch1.S3.SS2"/>):
<list list-type="order"><list-item>
      <p id="d1e5016">train only on filtered DNS data corresponding to <inline-formula><mml:math id="M191" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">hor</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula>,</p></list-item><list-item>
      <p id="d1e5035">train on filtered DNS data corresponding to <inline-formula><mml:math id="M192" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">hor</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">12</mml:mn></mml:mrow></mml:math></inline-formula>, and</p></list-item><list-item>
      <p id="d1e5058">train on filtered DNS data corresponding to all three <inline-formula><mml:math id="M193" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">hor</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>.</p></list-item></list>
For all three training configurations mentioned above, we tested the performance of the ANN SGS models on previously unseen filtered data corresponding to all three <inline-formula><mml:math id="M194" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">hor</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>. This thus includes several cases where the ANN SGS model is being applied to other resolutions than seen during training.</p>
      <p id="d1e5084">Finally, to get some more insight into the behaviour of our ANNs, in Sect. <xref ref-type="sec" rid="Ch1.S4.SS1.SSS4"/>, we calculated for every input variable in the <inline-formula><mml:math id="M195" display="inline"><mml:mrow><mml:mn mathvariant="normal">5</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">5</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:math></inline-formula> stencils the so-called “permutation feature importance” <xref ref-type="bibr" rid="bib1.bibx14 bib1.bibx36 bib1.bibx6" id="paren.55"><named-content content-type="pre">e.g.</named-content></xref> associated with predicting <inline-formula><mml:math id="M196" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M197" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> in the log layer.</p>
      <p id="d1e5142">The most important advantage of these “permutation feature importances” is their intuitive meaning: they indicate how important a certain input variable is for the prediction quality of the <inline-formula><mml:math id="M198" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M199" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> in the log layer: the higher it is, the more important that variable is. Specifically, the permutation feature importance measures by which factor the prediction error (in our case measured as the root mean square error between the DNS values and ANN predictions) increases when the information contained in that input variable is destroyed, while the information in the other input variables is retained. We destroyed the information in each input variable by randomly shuffling it in the corresponding horizontal plane. Besides that, we averaged the calculated permutation feature importances over all three testing flow fields and over <inline-formula><mml:math id="M200" display="inline"><mml:mn mathvariant="normal">10</mml:mn></mml:math></inline-formula> different random shufflings to stabilize the results. We intentionally chose not to shuffle the input variables along different heights. Because of the strong mean vertical gradient in <inline-formula><mml:math id="M201" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula>, this would possibly introduce an unrealistic bias into the calculated permutation feature importances. We do emphasize that the permutation feature importances are likely affected by the correlations existing in our input data. The permutation feature importances we report therefore need to be interpreted with caution.</p>
</sec>
<sec id="Ch1.S3.SS5.SSS2">
  <label>3.5.2</label><title>A posteriori (online) test</title>
      <p id="d1e5199">To test the a posteriori performance of our ANN LES SGS model, we directly incorporated one of our ANNs (i.e. with <inline-formula><mml:math id="M202" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">hidden</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M203" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula>) into our CFD code (MicroHH v2.0) <xref ref-type="bibr" rid="bib1.bibx51" id="paren.56"/>. We chose the input and output variables of our ANN SGS model such that the integration into our CFD code was relatively straightforward (Sect. <xref ref-type="sec" rid="Ch1.S3.SS3"/>). Furthermore, we improved the computational performance of the ANN SGS model by implementing basic linear algebra subprogram (BLAS) routines from the Intel<sup>®</sup> Math Kernel Library (version 2019 update 5 for Linux), which has been optimized for the Intel CPUs we used (i.e. E5-2695 v2 (Ivy Bridge) and E5-2690 v3 (Haswell)). Still, the computational effort involved in the ANN SGS model was large: an equivalent LES simulation with the Smagorinsky SGS model was for our setup about a factor of 15 faster, showing that, in its current form, our ANN SGS model still needs more optimizations for practical applications.</p>
      <p id="d1e5245">With the ANN SGS model incorporated in our CFD code, we ran a LES with an equidistant grid of <inline-formula><mml:math id="M204" display="inline"><mml:mrow><mml:mn mathvariant="normal">96</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">48</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula> cells, directly corresponding to the selected <inline-formula><mml:math id="M205" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula>, for the turbulent channel flow test case described in Sect. <xref ref-type="sec" rid="Ch1.S3.SS1"/>. Here, we used second-order linear interpolations to calculate all the velocity tendencies, consistent with our filtering and training data generation procedure (Sect. <xref ref-type="sec" rid="Ch1.S2"/> and <xref ref-type="sec" rid="Ch1.S3.SS2"/>). Furthermore, we initialized the LES simulation from one of the three flow fields reserved for the a priori testing. We did this to ensure that any possible errors in the initialization phase of the LES (i.e. before steady state is achieved) did not impact the solution. Still, our LES ran freely from the prescribed initialized steady-state fields, meaning that all the model and discretization errors made in calculating the channel flow steady-state dynamics were included.</p>
</sec>
</sec>
</sec>
<?pagebreak page3778?><sec id="Ch1.S4">
  <label>4</label><title>Results and discussion</title>
      <p id="d1e5300">In this section, we will characterize the a priori and a posteriori performance of our ANN SGS model. We will first describe the a priori performance of our ANN SGS model and the Smagorinsky SGS model for a single coarse resolution (i.e. where <inline-formula><mml:math id="M206" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula>; Sect. <xref ref-type="sec" rid="Ch1.S4.SS1.SSS1"/> and <xref ref-type="sec" rid="Ch1.S4.SS1.SSS2"/>). Subsequently, we will discuss the generalization performance of our ANN SGS model with respect to the selected coarse resolution (Sect. <xref ref-type="sec" rid="Ch1.S4.SS1.SSS3"/>) and the permutation feature importances associated with the input stencils (Sect. <xref ref-type="sec" rid="Ch1.S4.SS1.SSS4"/>). Finally, we will describe and discuss the instability we observed a posteriori (Sect. <xref ref-type="sec" rid="Ch1.S4.SS2"/>).</p>
<sec id="Ch1.S4.SS1">
  <label>4.1</label><title>A priori (offline) test</title>
<sec id="Ch1.S4.SS1.SSS1">
  <label>4.1.1</label><title>Single horizontal-resolution ANN performance</title>
      <p id="d1e5360">The ANN-predicted <inline-formula><mml:math id="M207" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M208" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> (with <inline-formula><mml:math id="M209" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">hidden</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula>; see Sect. <xref ref-type="sec" rid="Ch1.S3.SS4"/>) values in the log layer generally show excellent agreement with the DNS-derived values (Figs. <xref ref-type="fig" rid="Ch1.F6"/>–<xref ref-type="fig" rid="Ch1.F9"/>). Especially the consistency we found in the horizontal cross sections (Figs. <xref ref-type="fig" rid="Ch1.F6"/>a and b, <xref ref-type="fig" rid="Ch1.F7"/>a and b) is striking given the noisy spatial patterns of <inline-formula><mml:math id="M210" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M211" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, which the ANN reproduces quite accurately both qualitatively and quantitatively. Particularly noteworthy is its ability to accurately reproduce both negative and positive <inline-formula><mml:math id="M212" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, as these are associated with backscatter and SGS dissipation, respectively. These two processes are both critical for the quality of the a posteriori simulations (see Sect. <xref ref-type="sec" rid="Ch1.S4.SS2"/>).</p>
      <p id="d1e5476">We note that the found correspondence between correction and SGS transfer terms in the log layer of neutral channel flow is in agreement with the results of <xref ref-type="bibr" rid="bib1.bibx9" id="text.57"/>, <xref ref-type="bibr" rid="bib1.bibx39" id="text.58"/>, and <xref ref-type="bibr" rid="bib1.bibx15" id="text.59"/>, despite our training data generation procedure additionally accounting for numerical errors associated with LES where a staggered finite-volume grid acts as an implicit filter (Sects. <xref ref-type="sec" rid="Ch1.S2"/> and <xref ref-type="sec" rid="Ch1.S3.SS2"/>). Consistent with the matching horizontal cross sections, the ANN reproduces quite well the distributions and spectra of <inline-formula><mml:math id="M213" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M214" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> (Figs. <xref ref-type="fig" rid="Ch1.F8"/>b and c, <xref ref-type="fig" rid="Ch1.F9"/>b and c). The notable high normalized spectral density of <inline-formula><mml:math id="M215" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> at high wave modes is a direct consequence of the instantaneous spatial discretization errors we compensate for. As these discretization errors remove a large part of the variance at the smallest resolved spatial scales (Fig. <xref ref-type="fig" rid="Ch1.F2"/>), the corresponding correction terms, including <inline-formula><mml:math id="M216" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, are characterized by strong variability at the smallest resolved scales.</p>
      <p id="d1e5566">From the tails of the distribution and the high wave modes of the spectra (Figs. <xref ref-type="fig" rid="Ch1.F8"/>b and c, <xref ref-type="fig" rid="Ch1.F9"/>b and c), it is apparent that the ANN does still slightly underestimate the extremes at small spatial scales characteristic of <inline-formula><mml:math id="M217" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M218" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>. Probably, these extremes were hard to predict accurately because of their high stochastic nature and inherent rare occurrence. <xref ref-type="bibr" rid="bib1.bibx58" id="text.60"/> identified this issue in the context of an ANN-based LES wall model and found that this issue persisted even when the errors were weighted inversely proportional to their probability density function (PDF) (i.e. giving extreme values larger weights in the loss function).</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F6" specific-use="star"><?xmltex \currentcnt{6}?><?xmltex \def\figurename{Figure}?><label>Figure 6</label><caption><p id="d1e5613">Horizontal cross sections of <inline-formula><mml:math id="M219" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> in the log layer (<inline-formula><mml:math id="M220" display="inline"><mml:mrow><mml:mn mathvariant="normal">0.09375</mml:mn><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mi>z</mml:mi><mml:mi mathvariant="italic">δ</mml:mi></mml:mfrac></mml:mstyle><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mspace linebreak="nobreak" width="0.33em"/><mml:mo>(</mml:mo><mml:mn mathvariant="normal">55.3125</mml:mn><mml:msup><mml:mi>z</mml:mi><mml:mo>+</mml:mo></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>) for a representative flow field not used to train and validate the ANNs. All values are normalized by the friction velocity <inline-formula><mml:math id="M221" display="inline"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi mathvariant="italic">τ</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and half-channel width <inline-formula><mml:math id="M222" display="inline"><mml:mi mathvariant="italic">δ</mml:mi></mml:math></inline-formula>.</p></caption>
            <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f06.png"/>

            <p id="d1e5680">.</p>
          </fig>

      <?xmltex \floatpos{t}?><fig id="Ch1.F7" specific-use="star"><?xmltex \currentcnt{7}?><?xmltex \def\figurename{Figure}?><label>Figure 7</label><caption><p id="d1e5686">Horizontal cross sections of <inline-formula><mml:math id="M223" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mi mathvariant="normal">SGS</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> in the log layer (<inline-formula><mml:math id="M224" display="inline"><mml:mrow><mml:mn mathvariant="normal">0.109375</mml:mn><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mi>z</mml:mi><mml:mi mathvariant="italic">δ</mml:mi></mml:mfrac></mml:mstyle><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mspace linebreak="nobreak" width="0.33em"/><mml:mo>(</mml:mo><mml:mn mathvariant="normal">64.53125</mml:mn><mml:msup><mml:mi>z</mml:mi><mml:mo>+</mml:mo></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>) for a representative flow field not used to train and validate the ANNs. All values are normalized by the friction velocity <inline-formula><mml:math id="M225" display="inline"><mml:mrow><mml:msub><mml:mi>u</mml:mi><mml:mi mathvariant="italic">τ</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> and half-channel width <inline-formula><mml:math id="M226" display="inline"><mml:mi mathvariant="italic">δ</mml:mi></mml:math></inline-formula>.</p></caption>
            <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f07.png"/>

            <p id="d1e5750">.</p>
          </fig>

      <?xmltex \floatpos{t}?><fig id="Ch1.F8" specific-use="star"><?xmltex \currentcnt{8}?><?xmltex \def\figurename{Figure}?><label>Figure 8</label><caption><p id="d1e5756">Performance of <inline-formula><mml:math id="M227" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> (with <inline-formula><mml:math id="M228" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">hidden</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula>) in the log layer (<inline-formula><mml:math id="M229" display="inline"><mml:mrow><mml:mn mathvariant="normal">0.09375</mml:mn><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mi>z</mml:mi><mml:mi mathvariant="italic">δ</mml:mi></mml:mfrac></mml:mstyle><mml:mspace width="0.125em" linebreak="nobreak"/><mml:mspace linebreak="nobreak" width="0.33em"/><mml:mo>(</mml:mo><mml:mn mathvariant="normal">55.3125</mml:mn><mml:msup><mml:mi>z</mml:mi><mml:mo>+</mml:mo></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>) for a representative flow field not used to train and validate the ANNs. Panel <bold>(a)</bold> shows the corresponding hexbin plot between <inline-formula><mml:math id="M230" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M231" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, where the dotted blue line indicates the <inline-formula><mml:math id="M232" display="inline"><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>:</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> line. Panel <bold>(b)</bold> shows the probability density functions and panel <bold>(c)</bold> the stream-wise spectra averaged in the span-wise direction. <inline-formula><mml:math id="M233" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M234" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> have been normalized by the friction velocity <inline-formula><mml:math id="M235" display="inline"><mml:mrow><mml:msubsup><mml:mi>u</mml:mi><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula>. The power spectral density <inline-formula><mml:math id="M236" display="inline"><mml:mi>E</mml:mi></mml:math></inline-formula> on the vertical axis in panel <bold>(c)</bold> has been normalized by <inline-formula><mml:math id="M237" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">δ</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M238" display="inline"><mml:mrow><mml:mi>u</mml:mi><mml:msup><mml:msub><mml:mi/><mml:mi mathvariant="italic">τ</mml:mi></mml:msub><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>.  As a reference, in panels <bold>(b)</bold> and <bold>(c)</bold>, <inline-formula><mml:math id="M239" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is shown as well.</p></caption>
            <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f08.png"/>

          </fig>

      <?xmltex \floatpos{t}?><fig id="Ch1.F9" specific-use="star"><?xmltex \currentcnt{9}?><?xmltex \def\figurename{Figure}?><label>Figure 9</label><caption><p id="d1e6005">Performance of <inline-formula><mml:math id="M240" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> (with <inline-formula><mml:math id="M241" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">hidden</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula>) in the log layer (<inline-formula><mml:math id="M242" display="inline"><mml:mrow><mml:mn mathvariant="normal">0.109375</mml:mn><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mi>z</mml:mi><mml:mi mathvariant="italic">δ</mml:mi></mml:mfrac></mml:mstyle><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mspace linebreak="nobreak" width="0.33em"/><mml:mo>(</mml:mo><mml:mn mathvariant="normal">64.53125</mml:mn><mml:msup><mml:mi>z</mml:mi><mml:mo>+</mml:mo></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>) for a representative flow field not used to train and validate the ANNs. Panel <bold>(a)</bold> shows the corresponding hexbin plot between <inline-formula><mml:math id="M243" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M244" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, where the dotted blue line indicates the <inline-formula><mml:math id="M245" display="inline"><mml:mrow><mml:mn mathvariant="normal">1</mml:mn><mml:mo>:</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> line. Panel <bold>(b)</bold> shows the probability density functions and panel <bold>(c)</bold> the stream-wise spectra averaged in the span-wise direction. <inline-formula><mml:math id="M246" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M247" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> have been normalized by the friction velocity <inline-formula><mml:math id="M248" display="inline"><mml:mrow><mml:msubsup><mml:mi>u</mml:mi><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M249" display="inline"><mml:mi mathvariant="italic">δ</mml:mi></mml:math></inline-formula>. The power spectral density <inline-formula><mml:math id="M250" display="inline"><mml:mi>E</mml:mi></mml:math></inline-formula> on the vertical axis in panel <bold>(c)</bold> has been normalized by <inline-formula><mml:math id="M251" display="inline"><mml:mrow><mml:mi>u</mml:mi><mml:msup><mml:msub><mml:mi/><mml:mi mathvariant="italic">τ</mml:mi></mml:msub><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>.  As a reference, in panels <bold>(b)</bold> and <bold>(c)</bold>, <inline-formula><mml:math id="M252" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">Smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is shown as well.</p></caption>
            <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f09.png"/>

          </fig>

      <p id="d1e6234">Extending our focus from the log layer to vertical profiles of horizontally averaged <inline-formula><mml:math id="M253" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M254" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mi mathvariant="normal">SGS</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula>, in general, we again observe quite good correspondence between the ANN predictions and DNS-derived values (Figs. <xref ref-type="fig" rid="Ch1.F10"/> and <xref ref-type="fig" rid="Ch1.F11"/>). In the profile of <inline-formula><mml:math id="M255" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, we do see some deviations from the <inline-formula><mml:math id="M256" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> profile, especially close to the walls. In our training data, the horizontally averaged flux of <inline-formula><mml:math id="M257" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> was generally small compared to its point-wise fluctuations. As a result, the loss associated with <inline-formula><mml:math id="M258" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> was probably more sensitive to the point-wise fluctuations than the average flux, which may have contributed to the observed deviations.</p>
      <p id="d1e6339">The vertical profile of <inline-formula><mml:math id="M259" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, in turn, matches very closely the profile of <inline-formula><mml:math id="M260" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>. The ANN approximately provides the net dissipation inferred from the DNS, which primarily occurs close to the walls. Hence, this does not make yet clear why our ANN SGS model induces the observed a posteriori instability. In Sect. <xref ref-type="sec" rid="Ch1.S4.SS2"/>, we will elaborate more on potential reasons why our ANN SGS model nonetheless induces instability.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F10"><?xmltex \currentcnt{10}?><?xmltex \def\figurename{Figure}?><label>Figure 10</label><caption><p id="d1e6378">Vertical profiles of horizontally averaged <inline-formula><mml:math id="M261" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M262" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, and <inline-formula><mml:math id="M263" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> at one representative time step not used to train and validate the ANNs. All values are normalized by the friction velocity <inline-formula><mml:math id="M264" display="inline"><mml:mrow><mml:msubsup><mml:mi>u</mml:mi><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula> and half-channel width <inline-formula><mml:math id="M265" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">δ</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>.</p></caption>
            <?xmltex \igopts{width=199.169291pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f10.png"/>

          </fig>

      <?xmltex \floatpos{t}?><fig id="Ch1.F11"><?xmltex \currentcnt{11}?><?xmltex \def\figurename{Figure}?><label>Figure 11</label><caption><p id="d1e6473">Vertical profiles of horizontally averaged <inline-formula><mml:math id="M266" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M267" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">ANN</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, and <inline-formula><mml:math id="M268" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> at one representative time step not used to train and validate the ANNs. All values are normalized by the friction velocity <inline-formula><mml:math id="M269" display="inline"><mml:mrow><mml:msubsup><mml:mi>u</mml:mi><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:msubsup></mml:mrow></mml:math></inline-formula> and half-channel width <inline-formula><mml:math id="M270" display="inline"><mml:mi mathvariant="italic">δ</mml:mi></mml:math></inline-formula>.</p></caption>
            <?xmltex \igopts{width=199.169291pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f11.png"/>

          </fig>

      <p id="d1e6553">Extending our focus towards all components, we found that in general the ANN correlated well with all DNS-derived correction and SGS transfer terms (third row in Table <xref ref-type="table" rid="Ch1.T3"/> and Fig. <xref ref-type="fig" rid="Ch1.F12"/>; mostly <inline-formula><mml:math id="M271" display="inline"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.6</mml:mn></mml:mrow></mml:math></inline-formula>–0.9). Looking more closely at the found correlations, we did find that the correlations differed depending on the channel height. Closer to the walls, the correlations generally slightly decreased compared to the middle of the channel (except for the vertical layers directly adjacent to the wall, where most terms show a better correlation). Here, we emphasize that we implemented a preferential sampling technique (Sect. <xref ref-type="sec" rid="Ch1.S3.SS4"/>), which helped to minimize this reduction of prediction performance close to the walls compared to the middle of the channel.</p>
      <p id="d1e6575">Looking at the individual terms, some of them were clearly better predicted than others (e.g. <inline-formula><mml:math id="M272" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>v</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> vs. <inline-formula><mml:math id="M273" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>v</mml:mi><mml:mi>w</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>): this was likely related to differences in their magnitude that persisted even after the applied normalization (i.e. the same normalization was applied over the entire domain, meaning that some components with strong vertical gradients still contained more extreme values than components without a clear vertical gradient) and differences in their stochastic variability and consequent signal-to-noise ratio.</p>
      <p id="d1e6606">One clear outlier is <inline-formula><mml:math id="M274" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> at the first vertical level (with <inline-formula><mml:math id="M275" display="inline"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.339</mml:mn></mml:mrow></mml:math></inline-formula>; not shown), which appeared to be most difficult to predict. This component was located at the bottom wall because of the staggered grid orientation and consequently only the viscous flux contributed. As a consequence, the target DNS values and input patterns were different than for other vertical levels and components, making it hard for the ANN to give accurate predictions. Still, the magnitude of the ANN predictions matched the DNS values reasonably well (not shown).</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F12" specific-use="star"><?xmltex \currentcnt{12}?><?xmltex \def\figurename{Figure}?><label>Figure 12</label><caption><p id="d1e6637">Vertical profiles of correlation coefficients between ANN predictions and DNS values for all correction and dissipation terms <bold>(a–d)</bold> at one representative time step not used to train and validate the ANNs. Here, the <inline-formula><mml:math id="M276" display="inline"><mml:mi>j</mml:mi></mml:math></inline-formula> index refers to the considered control volume (Sect. <xref ref-type="sec" rid="Ch1.S2"/>). The heights are normalized by the half-channel width <inline-formula><mml:math id="M277" display="inline"><mml:mrow><mml:msup><mml:mi mathvariant="italic">δ</mml:mi><mml:mrow><mml:mo>-</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:math></inline-formula>. Note that the <inline-formula><mml:math id="M278" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>u</mml:mi><mml:mi>w</mml:mi><mml:mo>,</mml:mo><mml:mi>v</mml:mi><mml:mi>w</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> components are left out at the first vertical level, as these are due to the staggered grid located exactly at the bottom wall. At the bottom wall, we imposed a no-slip boundary condition, meaning that these components are by definition 0.</p></caption>
            <?xmltex \igopts{width=398.338583pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f12.png"/>

          </fig>

</sec>
<?pagebreak page3779?><sec id="Ch1.S4.SS1.SSS2">
  <label>4.1.2</label><title>Single horizontal-resolution Smagorinsky performance</title>
      <p id="d1e6700">Considering the individual grid points, the a priori performance of the Smagorinsky SGS model is in sharp contrast with the a priori ANN performance: <inline-formula><mml:math id="M279" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, and to a somewhat lesser extent <inline-formula><mml:math id="M280" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, shows barely any agreement with the DNS-derived values both qualitatively and quantitatively (Figs. <xref ref-type="fig" rid="Ch1.F6"/>–<xref ref-type="fig" rid="Ch1.F9"/>). The poor point-wise a priori performance of Smagorinsky is well known in literature <xref ref-type="bibr" rid="bib1.bibx11 bib1.bibx34 bib1.bibx31" id="paren.61"><named-content content-type="pre">e.g.</named-content></xref>. In addition, we can also observe its known inability, in the form we employed, to account for backscatter <xref ref-type="bibr" rid="bib1.bibx40 bib1.bibx43" id="paren.62"><named-content content-type="pre">e.g.</named-content></xref>.</p>
      <p id="d1e6752">In our case though, the point-wise a priori performance of Smagorinsky is still worse than usually documented: the found correlations with DNS in our study (mostly <inline-formula><mml:math id="M281" display="inline"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0.0</mml:mn></mml:mrow></mml:math></inline-formula> at individual heights for all correction and dissipation terms; not shown) are lower than reported before (where <inline-formula><mml:math id="M282" display="inline"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>=</mml:mo><mml:mo>∼</mml:mo><mml:mn mathvariant="normal">0</mml:mn><mml:mi mathvariant="normal">…</mml:mi><mml:mn mathvariant="normal">0.4</mml:mn></mml:mrow></mml:math></inline-formula>; <xref ref-type="bibr" rid="bib1.bibx9 bib1.bibx11 bib1.bibx34 bib1.bibx31" id="text.63"/>). Furthermore, <inline-formula><mml:math id="M283" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">Smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M284" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> are off by approximately 1 order of magnitude and are too smooth (Figs. <xref ref-type="fig" rid="Ch1.F6"/>, <xref ref-type="fig" rid="Ch1.F7"/> and  <xref ref-type="fig" rid="Ch1.F8"/>–<xref ref-type="fig" rid="Ch1.F9"/>b and c): in comparison to <inline-formula><mml:math id="M285" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M286" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, the PDF is narrower (Figs. <xref ref-type="fig" rid="Ch1.F8"/>b and <xref ref-type="fig" rid="Ch1.F9"/>b), and the spectral energy in <inline-formula><mml:math id="M287" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">Smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, <inline-formula><mml:math id="M288" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is smaller and skewed towards low wave modes (Figs. <xref ref-type="fig" rid="Ch1.F8"/>c and <xref ref-type="fig" rid="Ch1.F9"/>c).</p>
      <p id="d1e6908">This exacerbated point-wise a priori performance of the Smagorinsky SGS model is caused by our alternative definition for <inline-formula><mml:math id="M289" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, which, in contrast to the commonly defined <inline-formula><mml:math id="M290" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, compensates for all the instantaneous discretization effects introduced by the staggered finite volumes in both the advection and viscous flux terms (Sect. <xref ref-type="sec" rid="Ch1.S2"/>).
As these discretization effects remove a large part of the variance present in the LES (Fig. <xref ref-type="fig" rid="Ch1.F2"/>), our <inline-formula><mml:math id="M291" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> inherently contains a large amount of variance that is not represented by Smagorinsky.</p>
      <p id="d1e6957">Focusing on the horizontally averaged vertical profiles of <inline-formula><mml:math id="M292" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, we consequently found also that <inline-formula><mml:math id="M293" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">smag</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> does not compare well with <inline-formula><mml:math id="M294" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> (Fig. <xref ref-type="fig" rid="Ch1.F10"/>). Except close to the walls and the centre of the channel, the Smagorinsky SGS model strongly underestimates the horizontally averaged <inline-formula><mml:math id="M295" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>. We emphasize that the correspondence close to the walls was only achieved because of the implemented ad hoc Van Driest wall damping function <xref ref-type="bibr" rid="bib1.bibx49" id="paren.64"/>.</p>
      <?pagebreak page3781?><p id="d1e7031">In the horizontally averaged vertical profiles of <inline-formula><mml:math id="M296" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mi mathvariant="normal">SGS</mml:mi></mml:msub></mml:mrow></mml:math></inline-formula> (Fig. <xref ref-type="fig" rid="Ch1.F11"/>), we observe a striking characteristic that may seem counterintuitive at first: the Smagorinsky SGS model underpredicts <inline-formula><mml:math id="M297" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> at the walls, despite its known over-dissipative behaviour in a posteriori tests <xref ref-type="bibr" rid="bib1.bibx40 bib1.bibx43" id="paren.65"><named-content content-type="pre">e.g.</named-content></xref>. However, as the Smagorinsky SGS model does not directly compensate for instantaneous discretization errors (and thus does not re-introduce the associated inherent variance), the Smagorinsky SGS needs to produce less dissipation than our ANN SGS model to achieve stable a posteriori results (see also Sect. <xref ref-type="sec" rid="Ch1.S4.SS2"/>).</p>
      <p id="d1e7070">All in all, our ANN SGS model is clearly better able to represent <inline-formula><mml:math id="M298" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M299" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> in the presented a priori test than the Smagorinsky SGS model. This shows the promise ANN SGS models like ours could have to construct more accurate SGS models that, in contrast to traditional SGS models like Smagorinsky, additionally compensate for instantaneous spatial discretization errors. The most important issue remaining, is whether and how this a priori potential can be successfully leveraged in a posteriori simulations without introducing numeric instability.</p>
</sec>
<sec id="Ch1.S4.SS1.SSS3">
  <label>4.1.3</label><title>Multiple horizontal-resolution ANN generalization</title>
      <p id="d1e7115">Overall, our ANN SGS model shows promising generalization capabilities towards other coarse horizontal resolutions than the one considered in the previous section. The extent to which it is able to maintain its high a priori accuracy, however, does strongly depend on the considered <inline-formula><mml:math id="M300" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">train</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">hor</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M301" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">test</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">hor</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> (Table <xref ref-type="table" rid="Ch1.T3"/>).</p>

<?xmltex \floatpos{t}?><table-wrap id="Ch1.T3"><?xmltex \currentcnt{3}?><label>Table 3</label><caption><p id="d1e7155">Pearson correlation coefficients <inline-formula><mml:math id="M302" display="inline"><mml:mi mathvariant="italic">ρ</mml:mi></mml:math></inline-formula> between ANN predictions (<inline-formula><mml:math id="M303" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">hidden</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula>) and DNS values averaged for all three test flow fields, all heights, and all correction and dissipation terms. The different coarse-graining factors used during training, <inline-formula><mml:math id="M304" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, and testing, <inline-formula><mml:math id="M305" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>, are indicated. Here, the third row refers to the training and test configuration used in Sect. <xref ref-type="sec" rid="Ch1.S4.SS1.SSS1"/>. More details about all the indicated training and test configurations are given in Sect. <xref ref-type="sec" rid="Ch1.S3.SS5.SSS1"/>.  
</p></caption><oasis:table frame="topbot"><oasis:tgroup cols="3">
     <oasis:colspec colnum="1" colname="col1" align="left"/>
     <oasis:colspec colnum="2" colname="col2" align="left"/>
     <oasis:colspec colnum="3" colname="col3" align="left"/>
     <oasis:thead>
       <oasis:row rowsep="1">
         <oasis:entry colname="col1"><inline-formula><mml:math id="M306" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M307" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M308" display="inline"><mml:mi mathvariant="italic">ρ</mml:mi></mml:math></inline-formula></oasis:entry>
       </oasis:row>
     </oasis:thead>
     <oasis:tbody>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M309" display="inline"><mml:mn mathvariant="normal">8</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M310" display="inline"><mml:mn mathvariant="normal">12</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M311" display="inline"><mml:mn mathvariant="normal">0.624</mml:mn></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M312" display="inline"><mml:mn mathvariant="normal">8</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M313" display="inline"><mml:mn mathvariant="normal">8</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M314" display="inline"><mml:mn mathvariant="normal">0.758</mml:mn></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1"><inline-formula><mml:math id="M315" display="inline"><mml:mn mathvariant="normal">8</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M316" display="inline"><mml:mn mathvariant="normal">4</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M317" display="inline"><mml:mn mathvariant="normal">0.526</mml:mn></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">12, 4</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M318" display="inline"><mml:mn mathvariant="normal">12</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M319" display="inline"><mml:mn mathvariant="normal">0.656</mml:mn></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">12, 4</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M320" display="inline"><mml:mn mathvariant="normal">8</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M321" display="inline"><mml:mn mathvariant="normal">0.737</mml:mn></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">12, 4</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M322" display="inline"><mml:mn mathvariant="normal">4</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M323" display="inline"><mml:mn mathvariant="normal">0.832</mml:mn></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">12, 8, 4</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M324" display="inline"><mml:mn mathvariant="normal">12</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M325" display="inline"><mml:mn mathvariant="normal">0.657</mml:mn></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">12, 8, 4</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M326" display="inline"><mml:mn mathvariant="normal">8</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M327" display="inline"><mml:mn mathvariant="normal">0.744</mml:mn></mml:math></inline-formula></oasis:entry>
       </oasis:row>
       <oasis:row>
         <oasis:entry colname="col1">12, 8, 4</oasis:entry>
         <oasis:entry colname="col2"><inline-formula><mml:math id="M328" display="inline"><mml:mn mathvariant="normal">4</mml:mn></mml:math></inline-formula></oasis:entry>
         <oasis:entry colname="col3"><inline-formula><mml:math id="M329" display="inline"><mml:mn mathvariant="normal">0.832</mml:mn></mml:math></inline-formula></oasis:entry>
       </oasis:row>
     </oasis:tbody>
   </oasis:tgroup></oasis:table></table-wrap>

      <p id="d1e7493">Considering first the ANNs solely trained on <inline-formula><mml:math id="M330" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula> (rows 2–4 in Table <xref ref-type="table" rid="Ch1.T3"/>), we find, unsurprisingly, that they achieve their best performance when <inline-formula><mml:math id="M331" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula> (which is identical to the configuration used in Sect. <xref ref-type="sec" rid="Ch1.S4.SS1.SSS1"/>). More interestingly, however, we observe that these ANNs already have some generalization capability, even without having seen multiple <inline-formula><mml:math id="M332" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>. This does depend on the selected <inline-formula><mml:math id="M333" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>: the performance is better for <inline-formula><mml:math id="M334" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">12</mml:mn></mml:mrow></mml:math></inline-formula> than for <inline-formula><mml:math id="M335" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">4</mml:mn></mml:mrow></mml:math></inline-formula> (where for multiple terms <inline-formula><mml:math id="M336" display="inline"><mml:mrow><mml:mi mathvariant="italic">ρ</mml:mi><mml:mo>&lt;</mml:mo><mml:mn mathvariant="normal">0.5</mml:mn></mml:mrow></mml:math></inline-formula>; not shown).</p>
      <?pagebreak page3782?><p id="d1e7626">Comparing these ANNs to the ones trained on <inline-formula><mml:math id="M337" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">12</mml:mn></mml:mrow></mml:math></inline-formula> (rows 5–7 in Table <xref ref-type="table" rid="Ch1.T3"/>), first of all, we see a clear, unsurprising improvement when <inline-formula><mml:math id="M338" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">12</mml:mn></mml:mrow></mml:math></inline-formula>: including the tested coarse-graining factors in the training, improves the ANN performance in the associated a priori test. Interestingly, this improvement is much larger for <inline-formula><mml:math id="M339" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">4</mml:mn></mml:mrow></mml:math></inline-formula> than for <inline-formula><mml:math id="M340" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">12</mml:mn></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e7719">Secondly, we observe that, without using <inline-formula><mml:math id="M341" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula>, the ANN performance on <inline-formula><mml:math id="M342" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula> is only subtly lower than the ANNs directly trained on <inline-formula><mml:math id="M343" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula>. This shows that our ANN SGS model may accurately generalize to other unseen resolutions without losing its high a priori accuracy, if <inline-formula><mml:math id="M344" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> is within the range of the used <inline-formula><mml:math id="M345" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula>.</p>
      <p id="d1e7814">Finally, comparing the previously discussed ANNs (with <inline-formula><mml:math id="M346" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">4</mml:mn><mml:mo>,</mml:mo><mml:mn mathvariant="normal">12</mml:mn></mml:mrow></mml:math></inline-formula>) to the ones trained on all three considered <inline-formula><mml:math id="M347" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> (rows 8–10 in Table <xref ref-type="table" rid="Ch1.T3"/>), we find that additionally including <inline-formula><mml:math id="M348" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula> barely influences the ANN performance for all terms (even when <inline-formula><mml:math id="M349" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">test</mml:mi></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula>). This again highlights the possibility our ANN SGS model may accurately generalize to other resolutions, as long as the range in the training data covers the testing situations. In doing so, the need to include multiple intermediate <inline-formula><mml:math id="M350" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mrow><mml:mi mathvariant="normal">hor</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">train</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> values can likely be limited.</p>
</sec>
<sec id="Ch1.S4.SS1.SSS4">
  <label>4.1.4</label><title>Permutation feature importance ANN</title>
      <p id="d1e7924">For <inline-formula><mml:math id="M351" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M352" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> in the log layer, we calculated all the permutation feature importances associated with the ANNs listed in Table <xref ref-type="table" rid="Ch1.T3"/> (see Sect. <xref ref-type="sec" rid="Ch1.S3.SS5.SSS1"/>). Generally, we found that highest feature importances were associated with <inline-formula><mml:math id="M353" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula>, and that the feature importances corresponding to ANNs trained on two or more resolutions were mostly lower than the ones corresponding to the ANNs trained on one resolution. The former suggests that the ANN focuses mostly on the flow velocity component in the mean direction, while the latter suggests that the ANN becomes less sensitive on the inputs when trained on multiple resolutions. As an example, we show in Figs. <xref ref-type="fig" rid="Ch1.F13"/> and <xref ref-type="fig" rid="Ch1.F14"/> the feature importances corresponding to the <inline-formula><mml:math id="M354" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula>-velocity input stencil and the ANN only trained and tested on <inline-formula><mml:math id="M355" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">hor</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula> (third row in Table <xref ref-type="table" rid="Ch1.T3"/>).</p>
      <p id="d1e7999">Interestingly, all the calculated feature importances (including the ones not shown in Figs. <xref ref-type="fig" rid="Ch1.F13"/> and <xref ref-type="fig" rid="Ch1.F14"/>) suggest that the input variables most important to the ANN are generally located close to the considered correction term. In addition, there seems to be an orientation along the mean flow direction <inline-formula><mml:math id="M356" display="inline"><mml:mi>l</mml:mi></mml:math></inline-formula>, with corresponding low feature importances at the edges in the span-wise <inline-formula><mml:math id="M357" display="inline"><mml:mi>m</mml:mi></mml:math></inline-formula> and wall-normal <inline-formula><mml:math id="M358" display="inline"><mml:mi>k</mml:mi></mml:math></inline-formula> direction.</p>
      <p id="d1e8027">Comparing the calculated feature importances corresponding to <inline-formula><mml:math id="M359" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M360" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula>, in turn, we generally observe a corresponding shift in the vertical. For the shown <inline-formula><mml:math id="M361" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula>-velocity input stencil (Figs. <xref ref-type="fig" rid="Ch1.F13"/>–<xref ref-type="fig" rid="Ch1.F14"/>), for instance, the vertical patterns corresponding to <inline-formula><mml:math id="M362" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M363" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> are nearly mirrored versions of each other.</p>
      <p id="d1e8106">All in all, these findings suggest that the employed input stencils can be made smaller in the vertical and span-wise direction without sacrificing their predictive value, and that an extension along the stream-wise direction, in turn, may help to increase the predictive value of the input stencils.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F13" specific-use="star"><?xmltex \currentcnt{13}?><?xmltex \def\figurename{Figure}?><label>Figure 13</label><caption><p id="d1e8112">Permutation feature importance of all <inline-formula><mml:math id="M364" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula> velocities in the local input stencil (with indices l, m, n) associated with predicting <inline-formula><mml:math id="M365" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> in the log layer (<inline-formula><mml:math id="M366" display="inline"><mml:mrow><mml:mn mathvariant="normal">0.09375</mml:mn><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mi>z</mml:mi><mml:mi mathvariant="italic">δ</mml:mi></mml:mfrac></mml:mstyle><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mspace width="0.33em" linebreak="nobreak"/><mml:mo>(</mml:mo><mml:mn mathvariant="normal">55.3125</mml:mn><mml:msup><mml:mi>z</mml:mi><mml:mo>+</mml:mo></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>) using an ANN (with <inline-formula><mml:math id="M367" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">hidden</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula>) trained and tested only on <inline-formula><mml:math id="M368" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">hor</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula>, averaged over three flow fields reserved for a priori testing and 10 random shufflings. The five panels <bold>(a–e)</bold> each show one of the five horizontal planes (indicated by their vertical index <inline-formula><mml:math id="M369" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula>) present in the input stencils.  <inline-formula><mml:math id="M370" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">in</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> is located in the centre of the shown horizontal plane, halfway between <inline-formula><mml:math id="M371" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">1</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M372" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula>.</p></caption>
            <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f13.png"/>

          </fig>

      <?xmltex \floatpos{t}?><fig id="Ch1.F14" specific-use="star"><?xmltex \currentcnt{14}?><?xmltex \def\figurename{Figure}?><label>Figure 14</label><caption><p id="d1e8254">Permutation feature importance of all <inline-formula><mml:math id="M373" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula> velocities in the local input stencil (with indices <inline-formula><mml:math id="M374" display="inline"><mml:mrow><mml:mi mathvariant="normal">l</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">m</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">n</mml:mi></mml:mrow></mml:math></inline-formula>) associated with predicting <inline-formula><mml:math id="M375" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> in the log-layer (<inline-formula><mml:math id="M376" display="inline"><mml:mrow><mml:mn mathvariant="normal">0.09375</mml:mn><mml:mstyle displaystyle="false"><mml:mfrac style="text"><mml:mi>z</mml:mi><mml:mi mathvariant="italic">δ</mml:mi></mml:mfrac></mml:mstyle><mml:mspace linebreak="nobreak" width="0.125em"/><mml:mspace width="0.33em" linebreak="nobreak"/><mml:mo>(</mml:mo><mml:mn mathvariant="normal">55.3125</mml:mn><mml:msup><mml:mi>z</mml:mi><mml:mo>+</mml:mo></mml:msup><mml:mo>)</mml:mo></mml:mrow></mml:math></inline-formula>) using an ANN (with <inline-formula><mml:math id="M377" display="inline"><mml:mrow><mml:msub><mml:mi>n</mml:mi><mml:mi mathvariant="normal">hidden</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">64</mml:mn></mml:mrow></mml:math></inline-formula>) trained and tested only on <inline-formula><mml:math id="M378" display="inline"><mml:mrow><mml:msub><mml:mi>f</mml:mi><mml:mi mathvariant="normal">hor</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">8</mml:mn></mml:mrow></mml:math></inline-formula>, averaged over three flow fields reserved for a priori testing and 10 random shufflings. The five panels <bold>(a–e)</bold> each show one of the five horizontal planes (indicated by their vertical index <inline-formula><mml:math id="M379" display="inline"><mml:mi>n</mml:mi></mml:math></inline-formula>) present in the input stencils.  <inline-formula><mml:math id="M380" display="inline"><mml:mrow><mml:msubsup><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow><mml:mi mathvariant="normal">out</mml:mi></mml:msubsup></mml:mrow></mml:math></inline-formula> is located in the centre of the shown horizontal plane, halfway between <inline-formula><mml:math id="M381" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">2</mml:mn></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M382" display="inline"><mml:mrow><mml:mi>n</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">3</mml:mn></mml:mrow></mml:math></inline-formula>.</p></caption>
            <?xmltex \igopts{width=483.69685pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f14.png"/>

          </fig>

</sec>
</sec>
<sec id="Ch1.S4.SS2">
  <label>4.2</label><title>A posteriori (online) test</title>
      <p id="d1e8419">Our ANN LES SGS model produced numerically unstable a posteriori results without resorting to artificially introducing additional variance (for instance, via eddy-viscosity models) or imposing strong ad hoc numerical constraints, which is in agreement with the results of <xref ref-type="bibr" rid="bib1.bibx3" id="text.66"/>, <xref ref-type="bibr" rid="bib1.bibx33" id="text.67"/>, and <xref ref-type="bibr" rid="bib1.bibx61" id="text.68"/>.</p>
      <p id="d1e8431">Several other studies <xref ref-type="bibr" rid="bib1.bibx18 bib1.bibx39 bib1.bibx55 bib1.bibx57 bib1.bibx58" id="paren.69"/>, in contrast, did report stable a posteriori results without requiring ad hoc adjustments, although in some cases only after using single-point rather than multi-point inputs <xref ref-type="bibr" rid="bib1.bibx39" id="paren.70"/>, or ensuring that sufficient training samples are presented <xref ref-type="bibr" rid="bib1.bibx18" id="paren.71"/>.</p>
      <p id="d1e8443">We emphasize though that all the aforementioned studies (with the notable exception of <xref ref-type="bibr" rid="bib1.bibx39" id="text.72"/>) do not consider wall-bounded flows. In addition, they do not compensate for the instantaneous spatial discretization errors associated with a staggered finite-volume grid.</p>
      <p id="d1e8449">Crucially, for our setup, these spatial discretization errors were substantial, removing a large part of the variance present at high wave modes in the DNS (Fig. <xref ref-type="fig" rid="Ch1.F2"/>). Since we designed our ANN SGS model to fully compensate for these instantaneous discretization errors, our SGS model tended to re-introduce a large amount of variance at the highest resolved wave modes. In the a priori test, we consistently found that the Smagorinsky SGS model, as opposed to our ANN SGS model, strongly underestimated the small-scale variability of <inline-formula><mml:math id="M383" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> and <inline-formula><mml:math id="M384" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">ϵ</mml:mi><mml:mrow><mml:mi mathvariant="normal">SGS</mml:mi><mml:mo>,</mml:mo><mml:mi mathvariant="normal">DNS</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> (Sect. <xref ref-type="sec" rid="Ch1.S4.SS1.SSS2"/>).</p>
      <p id="d1e8491">The introduction of additional variance at the highest wave modes by our ANN SGS model is on its own not necessarily a problem if the energy transfer from the resolved to the unresolved scales is sufficient. Our ANN SGS model,<?pagebreak page3783?> consequently, needs to provide sufficient additional dissipation, compared to the SGS models from the aforementioned studies and traditional SGS models like Smagorinsky. Promisingly, a priori we found that the ANN matched well the net dissipation inferred from the DNS (Fig. <xref ref-type="fig" rid="Ch1.F11"/>) and indeed provided more net dissipation than the traditional Smagorinsky SGS model. Despite that, we observed a posteriori a gradual pile-up of spectral energy at the smallest wave modes (shown as an example for the <inline-formula><mml:math id="M385" display="inline"><mml:mi>u</mml:mi></mml:math></inline-formula> component in Fig. <xref ref-type="fig" rid="Ch1.F15"/>), indicating that an overall lack of dissipation nonetheless remains.</p>

      <?xmltex \floatpos{t}?><fig id="Ch1.F15"><?xmltex \currentcnt{15}?><?xmltex \def\figurename{Figure}?><label>Figure 15</label><caption><p id="d1e8507">Time evolution of stream-wise spectra averaged in the span-wise direction, where the colour brightness indicates the different time steps. Here, the light blue colours refer to the first time steps, and the dark blue colours to the final time steps. The time steps range from <inline-formula><mml:math id="M386" display="inline"><mml:mrow><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">0</mml:mn></mml:mrow></mml:math></inline-formula> s to <inline-formula><mml:math id="M387" display="inline"><mml:mrow><mml:mi>t</mml:mi><mml:mo>=</mml:mo><mml:mn mathvariant="normal">36</mml:mn></mml:mrow></mml:math></inline-formula> s, with intervals of 3 s.</p></caption>
          <?xmltex \igopts{width=227.622047pt}?><graphic xlink:href="https://gmd.copernicus.org/articles/14/3769/2021/gmd-14-3769-2021-f15.png"/>

        </fig>

      <p id="d1e8540">We hypothesize that two issues prevented the ANN SGS model from producing the required dissipation a posteriori: (1) error accumulation and (2) aliasing errors.</p>
      <p id="d1e8543">In the first place, similar to <xref ref-type="bibr" rid="bib1.bibx3" id="text.73"/>, we hypothesize that high-frequency errors in the ANN predictions accumulated over time due to strong positive feedbacks between our ANNs and the LES simulation. We stress that ANN SGS models like ours can never be perfect and consequently will always introduce errors in an a posteriori simulation that affect, together with the full LES dynamics, its own inputs in the next time step. It strongly depends on the characteristics of the SGS model whether this can result in positive feedback loops that cause divergence from the physical solution and subsequent numeric instability. In this regard, eddy-viscosity models like that of Smagorinsky have an important stabilizing property in steady-state channel flow: as soon as the energy content starts deviating from the physical solution, the subgrid dissipation is automatically adjusted (via a change in the gradients serving as input) to compensate for it.</p>
      <p id="d1e8549">Such a stabilizing property, however, was clearly lacking in our ANN SGS model. This is not surprising: we designed our ANN SGS model to compensate for many spatial discretization effects, which typically dampen the error accumulation at high frequencies. It is well known that, due to the chaotic nature of turbulence, small errors introduced by the predicted transports have a tendency to grow over time <xref ref-type="bibr" rid="bib1.bibx31" id="paren.74"><named-content content-type="pre">e.g.</named-content></xref>. On top of that, it has been shown before by <xref ref-type="bibr" rid="bib1.bibx38" id="text.75"/> that “perfect” SGS models (that exactly compensate for the unresolved physics, modelling errors, and instantaneous discretization errors) are inherently unstable in implicit filtering LES due to the presence of multiple different attractors. These issues were likely exacerbated by the growing need for the ANN to extrapolate beyond its training state once the simulation started deviating from the physical solution. This extrapolation likely increased the ANN prediction errors, which would in turn accelerate the divergence from the physical solution.</p>
      <p id="d1e8561">Secondly, we hypothesize that, during the a posteriori test, aliasing errors became prominent due to the introduced variance at high wave modes. Such aliasing errors are known<?pagebreak page3784?> to introduce instability when not dampened by discretization errors and/or dealiasing techniques  <xref ref-type="bibr" rid="bib1.bibx24 bib1.bibx10" id="paren.76"><named-content content-type="pre">e.g.</named-content></xref>. The quadratic velocity products in the non-linear advection term can in principle introduce wave modes that are not supported by the finite LES grid. The additional variance could have prevented them from being dampened by the instantaneous spatial discretization errors, causing them to appear as spurious resolved wave modes in the finite LES solution. This would increase the amount of dissipation required in the LES simulation. These aliasing errors were not accounted for during the ANN training, as it only relied on instantaneous coarse-grained flow fields that did not contain additional variance.</p>
</sec>
</sec>
<sec id="Ch1.S5" sec-type="conclusions">
  <label>5</label><title>Conclusions and recommendations</title>
      <p id="d1e8579">In this study, we evaluated and developed a data-driven large-eddy simulation (LES) subgrid-scale (SGS) model based on artificial neural networks (ANNs) that aims to represent both the unresolved physics and instantaneous spatial discretization errors. We focused specifically on the widely used LES approach where a staggered finite-volume grid acts as an implicit filter, where the discretization errors can strongly interact with the resolved physics.</p>
      <p id="d1e8582">We designed our ANN SGS model such that, similar to conventional eddy-viscosity SGS models like that of Smagorinsky, it can be applied locally in the grid domain: the employed ANNs used as input only local <inline-formula><mml:math id="M388" display="inline"><mml:mrow><mml:mn mathvariant="normal">5</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">5</mml:mn><mml:mo>×</mml:mo><mml:mn mathvariant="normal">5</mml:mn></mml:mrow></mml:math></inline-formula> stencils of the resolved wind velocity components (<inline-formula><mml:math id="M389" display="inline"><mml:mrow><mml:mover accent="true"><mml:mi>u</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>,</mml:mo><mml:mover accent="true"><mml:mi>v</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover><mml:mo>,</mml:mo><mml:mover accent="true"><mml:mi>w</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:mrow></mml:math></inline-formula>).<?pagebreak page3785?> Interestingly, an additional analysis we performed with so-called permutation feature importances suggested that our ANNs mostly focused on a small part of the stencils oriented along the mean flow direction. Hence, the input stencils we used could perhaps be further optimized by selecting smaller stencils that extend along the mean flow direction.</p>
      <p id="d1e8626">Using as a test case turbulent channel flow (with <inline-formula><mml:math id="M390" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">Re</mml:mi><mml:mi mathvariant="italic">τ</mml:mi></mml:msub><mml:mo>=</mml:mo><mml:mn mathvariant="normal">590</mml:mn></mml:mrow></mml:math></inline-formula>), we trained the ANNs with individual 3-D flow fields obtained from direct numerical simulation (DNS). By applying an explicit finite-volume filter (i.e. a discrete 3-D top-hat filter) on the high-resolution DNS fields and mimicking the instantaneous spatial discretization errors made in the actual LES, we generated millions of ANN input–output pairs that allowed us to train the ANNs in a supervised manner.</p>
      <p id="d1e8644">Subsequently, we performed both an a priori (offline) and a posteriori (online) test. As an a priori test, we directly compared the ANN predictions to the DNS derived values for flow fields unseen during training. Focusing first on the relatively simple case where a single coarse horizontal resolution is used during both training and testing, we found, in general, excellent agreement for all heights in the channel: the spatial patterns in the DNS values were well captured, and the correlation coefficients between the ANN predictions and DNS values were high (mostly between <inline-formula><mml:math id="M391" display="inline"><mml:mn mathvariant="normal">0.6</mml:mn></mml:math></inline-formula> and <inline-formula><mml:math id="M392" display="inline"><mml:mn mathvariant="normal">1.0</mml:mn></mml:math></inline-formula>). For a single coarse resolution, the ANNs were thus well able to represent the unresolved physics and instantaneous spatial discretization errors in the entire flow, based only on the resolved flow fields. We do note that we did find a few shortcomings that can possibly be improved upon: the extreme SGS fluxes were slightly underestimated, and the predicted horizontally averaged vertical profile of <inline-formula><mml:math id="M393" display="inline"><mml:mrow><mml:msub><mml:mi mathvariant="italic">τ</mml:mi><mml:mrow><mml:mi>w</mml:mi><mml:mi>u</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:math></inline-formula> deviated in particular close to the walls.</p>
      <p id="d1e8676">In addition, we tested the generalization performance of our ANN SGS model with respect to the selected coarse horizontal resolution. We found that the ANN could be successfully trained on multiple resolutions simultaneously and was in most cases able to generalize to other resolutions unseen during training. The generalization performance was particularly good when the unseen resolution was within the range of the resolutions seen during training, suggesting that a limited set of training resolutions may be sufficient to achieve a good generalization performance with respect to the selected resolution. The generalization performance of our ANN SGS model towards other flow types and/or higher Reynolds number though is currently still an open issue. This can possibly be overcome by applying known scalings and properties to the inputs and outputs <xref ref-type="bibr" rid="bib1.bibx30 bib1.bibx58" id="paren.77"><named-content content-type="pre">e.g.</named-content></xref>, extending the range of cases covered in the training data set, and/or retraining a previously optimized ANN on limited data from a new flow through transfer learning <xref ref-type="bibr" rid="bib1.bibx18" id="paren.78"/>.</p>
      <p id="d1e8687">To test our ANN SGS model a posteriori, we incorporated a trained ANN SGS model directly into an actual LES of the selected turbulent channel flow test case. Contrary to the a priori test, the ANN SGS model did not produce satisfactory results. Since our ANN SGS model, in contrast to traditional SGS models like that of Smagorinsky, compensated for many spatial discretization effects by introducing additional variance, the need for additional dissipation increased. The ANN SGS model appeared not to provide this dissipation sufficiently, causing an artificial buildup of TKE at high wave modes that eventually destabilized the solution. We hypothesized that our ANN SGS model did not produce sufficient dissipation because of (1) error accumulation and (2) aliasing errors.</p>
      <p id="d1e8690">We thus conclude that our ANN SGS model cannot, in its current form, achieve computationally stable results without resorting to previously suggested ad hoc adjustments (e.g. neglecting all backscatter or combining with the Smagorinsky SGS model). These ad hoc adjustments, however,  (re-)introduce strong assumptions and obscure the link between the a priori and a posteriori SGS model. We therefore would like to mention below a couple of possible alternative approaches, which may help to circumvent the need for ad hoc adjustments and could therefore be worth exploring further in future studies.</p>
      <p id="d1e8693">First of all, one way forward could be to adjust the training procedure such that it reflects better the a posteriori simulation. A potential elegant way to achieve this may be an online learning procedure similar to the ones proposed by <xref ref-type="bibr" rid="bib1.bibx41" id="text.79"/> and <xref ref-type="bibr" rid="bib1.bibx18" id="text.80"/>, where the ANN SGS model would be trained within the actual online LES simulation to reproduce the correct statistics and/or the correction terms inferred from a dynamically coupled DNS. Alternatively, errors expected to be introduced by an ANN SGS model in an a posteriori LES simulation could be added offline to the filtered flow fields <inline-formula><mml:math id="M394" display="inline"><mml:mover accent="true"><mml:mi>u</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula>, <inline-formula><mml:math id="M395" display="inline"><mml:mover accent="true"><mml:mi>v</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula>, <inline-formula><mml:math id="M396" display="inline"><mml:mover accent="true"><mml:mi>w</mml:mi><mml:mo mathvariant="normal">‾</mml:mo></mml:mover></mml:math></inline-formula> during training. This may help to reduce the sensitivity of the ANN to its own errors, alleviating the need for extrapolation once the a posteriori LES simulation starts diverging.</p>
      <p id="d1e8732">A second way forward may be to further improve the design of our data-driven SGS model, in particular including more physical constraints and insights. It could, for instance, be interesting to include the SGS transfer terms in the loss function used during offline training, as it may allow the ANNs to improve their representation of the net SGS transfer. This could make the ANN SGS model less prominent to a posteriori instability.</p>
      <p id="d1e8735">Besides that, it is likely worthwhile to further optimize the chosen inputs, the selected machine-learning algorithm, and the training when attempting to stabilize the a posteriori simulation. <xref ref-type="bibr" rid="bib1.bibx39" id="text.81"/> found, for instance, that using single-point inputs, rather than multi-point inputs, alleviated the observed a posteriori instability. <xref ref-type="bibr" rid="bib1.bibx18" id="text.82"/> observed that  convolutional neural networks achieved higher a priori accuracy than the multi-layer perceptron architecture selected in this study, and, interestingly, that the a posteriori stability depended on the number of training samples. Possibly, a corresponding further increase in the a priori accuracy<?pagebreak page3786?> helps to reduce the error accumulation a posteriori, making the a posteriori simulation less prone to instability.</p>
      <p id="d1e8745">All in all, our developed ANN LES SGS model has, based on its excellent a priori performance, potential to improve the representation of the unresolved physics and discretization errors in turbulent flows. However, the developed ANN LES SGS model is in its current form still prone to numeric instability in a posteriori simulations. Hence, several open challenges remain before the potential of ANN LES SGS models like ours can be successfully leveraged in practical applications.</p>
</sec>

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

      <p id="d1e8752">All the code used to generate the data and figures in this paper, including the employed CFD code (MicroHH) <xref ref-type="bibr" rid="bib1.bibx50 bib1.bibx51" id="paren.83"/>, is hosted on a GitHub repository located at <uri>https://github.com/robinstoffer/microhh2/tree/NN</uri> (last access: 17 May 2021). In addition, the used repository has been archived at <ext-link xlink:href="https://doi.org/10.5281/zenodo.4767902" ext-link-type="DOI">10.5281/zenodo.4767902</ext-link> <xref ref-type="bibr" rid="bib1.bibx48" id="paren.84"/>. To facilitate a posteriori LES simulations with the ANN SGS model developed in this paper, the parameters of the ANN selected in this paper are included as .txt files.</p>
  </notes><notes notes-type="authorcontribution"><title>Author contributions</title>

      <p id="d1e8770">RS generated the training data, wrote the ANN SGS model, and tested its performance in an a priori and a posteriori test. CCvH supported RS in developing and writing the ANN SGS model.
RS and CCvH developed the ideas that led to the study. CCvH, CMvL, DP, VC, and MAV all provided extensive feedback on the training data generation, ANN design, and hardware-specific tuning. MJ helped in interpreting the a posteriori results and coming up with suggestions for future research. RS wrote the manuscript. CCvH, OKH, CMvL, MJ, and MAV provided valuable feedback on the manuscript.</p>
  </notes><notes notes-type="competinginterests"><title>Competing interests</title>

      <p id="d1e8776">The authors declare that they have no conflict of interest.</p>
  </notes><ack><title>Acknowledgements</title><p id="d1e8782">We thank the SURF Open Innovation Lab for introducing us to the world of machine learning and for their indispensable assistance in the development of the ANN SGS model.</p></ack><notes notes-type="financialsupport"><title>Financial support</title>

      <p id="d1e8787">This research has been supported by the SURF Open Innovation Lab (project no. SOIL.DL4HPC.03).</p>
  </notes><notes notes-type="reviewstatement"><title>Review statement</title>

      <p id="d1e8793">This paper was edited by Richard Mills and reviewed by Noah Brenowitz and one anonymous referee.</p>
  </notes><ref-list>
    <title>References</title>

      <ref id="bib1.bibx1"><?xmltex \def\ref@label{{Abadi et~al.(2016)}}?><label>Abadi et al.(2016)</label><?label abadi2016tensorflow?><mixed-citation>
Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., Devin, M., Ghemawat, S., Irving, G., Isard, M., Kudlur, M., Levenberg, J., Monga, R., Moore, S., Murray, D. G., Steiner, B., Tucker, P., Vasudevan, V., Warden, P., Wicke, M., Yu, Y., and Zheng, X.: TensorFlow: A system for
large-scale machine learning, in: 12th (USENIX) Symposium on Operating
Systems Design and Implementation (OSDI 16), 265–283, 2016.</mixed-citation></ref>
      <ref id="bib1.bibx2"><?xmltex \def\ref@label{{Bardina et~al.(1980)}}?><label>Bardina et al.(1980)</label><?label bardina1980improved?><mixed-citation>Bardina, J., Ferziger, J., and Reynolds, W.: Improved subgrid-scale models for
large-eddy simulation, in: 13th fluid and plasmadynamics conference, 1357,
<ext-link xlink:href="https://doi.org/10.2514/6.1980-1357" ext-link-type="DOI">10.2514/6.1980-1357</ext-link>, 1980.</mixed-citation></ref>
      <ref id="bib1.bibx3"><?xmltex \def\ref@label{{Beck et~al.(2019)}}?><label>Beck et al.(2019)</label><?label beck2019deep?><mixed-citation>Beck, A., Flad, D., and Munz, C.: Deep neural networks for data-driven LES
closure models, J. Comput. Phys., 398, 108910,
<ext-link xlink:href="https://doi.org/10.1016/j.jcp.2019.108910" ext-link-type="DOI">10.1016/j.jcp.2019.108910</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx4"><?xmltex \def\ref@label{{Bolton and Zanna(2019)}}?><label>Bolton and Zanna(2019)</label><?label bolton2019applications?><mixed-citation>Bolton, T. and Zanna, L.: Applications of deep learning to ocean data inference
and subgrid parameterization, J. Adv. Model. Earth Sy.,
11, 376–399, <ext-link xlink:href="https://doi.org/10.1029/2018MS001472" ext-link-type="DOI">10.1029/2018MS001472</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx5"><?xmltex \def\ref@label{{Bou-Zeid et~al.(2005)}}?><label>Bou-Zeid et al.(2005)</label><?label bou2005scale?><mixed-citation>Bou-Zeid, E., Meneveau, C., and Parlange, M.: A scale-dependent Lagrangian
dynamic model for large eddy simulation of complex turbulent flows, Phys. Fluids, 17, 025105, <ext-link xlink:href="https://doi.org/10.1063/1.1839152" ext-link-type="DOI">10.1063/1.1839152</ext-link>, 2005.</mixed-citation></ref>
      <ref id="bib1.bibx6"><?xmltex \def\ref@label{{Breiman(2001)}}?><label>Breiman(2001)</label><?label breiman2001random?><mixed-citation>Breiman, L.: Random forests, Mach. Learn., 45, 5–32,
<ext-link xlink:href="https://doi.org/10.1023/A:1010933404324" ext-link-type="DOI">10.1023/A:1010933404324</ext-link>, 2001.</mixed-citation></ref>
      <ref id="bib1.bibx7"><?xmltex \def\ref@label{{Brenowitz and Bretherton(2019)}}?><label>Brenowitz and Bretherton(2019)</label><?label brenowitz2019spatially?><mixed-citation>Brenowitz, N. D. and Bretherton, C. S.: Spatially extended tests of a neural
network parametrization trained by coarse-graining, J. Adv.
Model. Earth Sy., 11, 2728–2744, <ext-link xlink:href="https://doi.org/10.1029/2019MS001711" ext-link-type="DOI">10.1029/2019MS001711</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx8"><?xmltex \def\ref@label{{Brunton et~al.(2020)}}?><label>Brunton et al.(2020)</label><?label brunton2020machine?><mixed-citation>Brunton, S. L., Noack, B. R., and Koumoutsakos, P.: Machine learning for fluid
mechanics, Annu. Rev. Fluid Mech., 52, 477–508,
<ext-link xlink:href="https://doi.org/10.1146/annurev-fluid-010719-060214" ext-link-type="DOI">10.1146/annurev-fluid-010719-060214</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx9"><?xmltex \def\ref@label{{Cheng et~al.(2019)}}?><label>Cheng et al.(2019)</label><?label cheng2019deep?><mixed-citation>
Cheng, Y., Giometto, M., Kauffmann, P., Lin, L., Cao, C., Zupnick, C., Li, H.,
Li, Q., Abernathey, R., and Gentine, P.: Deep learning for subgrid-scale
turbulence modeling in large-eddy simulations of the atmospheric boundary
layer, arXiv preprint arXiv:1910.12125, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx10"><?xmltex \def\ref@label{{Chow and Moin(2003)}}?><label>Chow and Moin(2003)</label><?label chow2003further?><mixed-citation>Chow, F. K. and Moin, P.: A further study of numerical errors in large-eddy
simulations, J. Comput. Phys., 184, 366–380,
<ext-link xlink:href="https://doi.org/10.1016/S0021-9991(02)00020-7" ext-link-type="DOI">10.1016/S0021-9991(02)00020-7</ext-link>, 2003.</mixed-citation></ref>
      <ref id="bib1.bibx11"><?xmltex \def\ref@label{{Clark et~al.(1979)}}?><label>Clark et al.(1979)</label><?label clark1979evaluation?><mixed-citation>Clark, R. A., Ferziger, J. H., and Reynolds, W. C.: Evaluation of subgrid-scale
models using an accurately simulated turbulent flow, J. Fluid
Mech., 91, 1–16, <ext-link xlink:href="https://doi.org/10.1017/S002211207900001X" ext-link-type="DOI">10.1017/S002211207900001X</ext-link>, 1979.</mixed-citation></ref>
      <ref id="bib1.bibx12"><?xmltex \def\ref@label{{Denaro(2011)}}?><label>Denaro(2011)</label><?label denaro2011does?><mixed-citation>Denaro, F. M.: What does Finite Volume-based implicit filtering really resolve
in Large-Eddy Simulations?, J. Comput. Phys., 230,
3849–3883, <ext-link xlink:href="https://doi.org/10.1016/j.jcp.2011.02.011" ext-link-type="DOI">10.1016/j.jcp.2011.02.011</ext-link>, 2011.</mixed-citation></ref>
      <ref id="bib1.bibx13"><?xmltex \def\ref@label{{Duraisamy et~al.(2019)}}?><label>Duraisamy et al.(2019)</label><?label duraisamy2019turbulence?><mixed-citation>Duraisamy, K., Iaccarino, G., and Xiao, H.: Turbulence modeling in the age of
data, Annu. Rev. Fluid Mech., 51, 357–377,
<ext-link xlink:href="https://doi.org/10.1146/annurev-fluid-010518-040547" ext-link-type="DOI">10.1146/annurev-fluid-010518-040547</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx14"><?xmltex \def\ref@label{{Fisher et~al.(2019)}}?><label>Fisher et al.(2019)</label><?label fisher2018model?><mixed-citation>
Fisher, A., Rudin, C., and Dominici, F.: All Models are Wrong, but Many are
Useful: Learning a Variable's Importance by Studying an Entire Class of
Prediction Models Simultaneously, J. Mach. Learn. Res., 20,
1–81, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx15"><?xmltex \def\ref@label{{Gamahara and Hattori(2017)}}?><label>Gamahara and Hattori(2017)</label><?label gamahara2017searching?><mixed-citation>Gamahara, M. and Hattori, Y.: Searching for turbulence models by artificial
neural network, Phys. Rev. Fluids, 2, 054604,
<ext-link xlink:href="https://doi.org/10.1103/PhysRevFluids.2.054604" ext-link-type="DOI">10.1103/PhysRevFluids.2.054604</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx16"><?xmltex \def\ref@label{{Ghosal(1996)}}?><label>Ghosal(1996)</label><?label ghosal1996analysis?><mixed-citation>Ghosal, S.: An analysis of numerical errors in large-eddy simulations of
turbulence, J. Comput. Phys., 125, 187–206,
<ext-link xlink:href="https://doi.org/10.1006/jcph.1996.0088" ext-link-type="DOI">10.1006/jcph.1996.0088</ext-link>, 1996.</mixed-citation></ref>
      <ref id="bib1.bibx17"><?xmltex \def\ref@label{{Giacomini and Giometto(2021)}}?><label>Giacomini and Giometto(2021)</label><?label giacomini2020suitability?><mixed-citation>Giacomini, B. and Giometto, M. G.: On the suitabilit<?pagebreak page3787?>y of second-order accurate finite-volume solvers for the simulation of atmospheric boundary layer flow, Geosci. Model Dev., 14, 1409–1426, <ext-link xlink:href="https://doi.org/10.5194/gmd-14-1409-2021" ext-link-type="DOI">10.5194/gmd-14-1409-2021</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx18"><?xmltex \def\ref@label{{Guan et~al.(2021)}}?><label>Guan et al.(2021)</label><?label guan2021stable?><mixed-citation>Guan, Y., Chattopadhyay, A., Subel, A., and Hassanzadeh, P.: Stable a
posteriori LES of 2D turbulence using convolutional neural networks:
Backscattering analysis and generalization to higher Re via transfer
learning, arXiv preprint arXiv:2102.11400,
available at: <uri>https://arxiv.org/pdf/2102.11400.pdf</uri> (last access: 1 March 2021), 2021.</mixed-citation></ref>
      <ref id="bib1.bibx19"><?xmltex \def\ref@label{{He et~al.(2015)}}?><label>He et al.(2015)</label><?label he2015ICCV?><mixed-citation>He, K., Zhang, X., Ren, S., and Sun, J.: Delving Deep into Rectifiers:
Surpassing Human-Level Performance on ImageNet Classification, in: The IEEE
International Conference on Computer Vision (ICCV), 1026–1034,
<ext-link xlink:href="https://doi.org/10.1109/ICCV.2015.123" ext-link-type="DOI">10.1109/ICCV.2015.123</ext-link>, 2015.</mixed-citation></ref>
      <ref id="bib1.bibx20"><?xmltex \def\ref@label{{Hornik et~al.(1989)}}?><label>Hornik et al.(1989)</label><?label hornik1989multilayer?><mixed-citation>Hornik, K., Stinchcombe, M., and White, H.: Multilayer feedforward networks are
universal approximators., Neural Networks, 2, 359–366,
<ext-link xlink:href="https://doi.org/10.1016/0893-6080(89)90020-8" ext-link-type="DOI">10.1016/0893-6080(89)90020-8</ext-link>, 1989.</mixed-citation></ref>
      <ref id="bib1.bibx21"><?xmltex \def\ref@label{{Jimenez and Moser(2000)}}?><label>Jimenez and Moser(2000)</label><?label jimenez2000large?><mixed-citation>Jimenez, J. and Moser, R. D.: Large-eddy simulations: where are we and what can
we expect?, AIAA journal, 38, 605–612, <ext-link xlink:href="https://doi.org/10.2514/2.1031" ext-link-type="DOI">10.2514/2.1031</ext-link>, 2000.</mixed-citation></ref>
      <ref id="bib1.bibx22"><?xmltex \def\ref@label{{Kaandorp and Dwight(2020)}}?><label>Kaandorp and Dwight(2020)</label><?label kaandorp2020data?><mixed-citation>Kaandorp, M. L. A. and Dwight, R. P.: Data-driven modelling of the Reynolds
stress tensor using random forests with invariance, Comput. Fluids, 202,
104497, <ext-link xlink:href="https://doi.org/10.1016/j.compfluid.2020.104497" ext-link-type="DOI">10.1016/j.compfluid.2020.104497</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx23"><?xmltex \def\ref@label{{Kingma and Ba(2014)}}?><label>Kingma and Ba(2014)</label><?label kingma2014adam?><mixed-citation>
Kingma, D. P. and Ba, J.: Adam: A method for stochastic optimization, arXiv
preprint arXiv:1412.6980, 2014.</mixed-citation></ref>
      <ref id="bib1.bibx24"><?xmltex \def\ref@label{{Kravchenko and Moin(1997)}}?><label>Kravchenko and Moin(1997)</label><?label kravchenko1997effect?><mixed-citation>Kravchenko, A. G. and Moin, P.: On the effect of numerical errors in large eddy
simulations of turbulent flows, J. Comput. Phys., 131,
310–322, <ext-link xlink:href="https://doi.org/10.1006/jcph.1996.5597" ext-link-type="DOI">10.1006/jcph.1996.5597</ext-link>, 1997.</mixed-citation></ref>
      <ref id="bib1.bibx25"><?xmltex \def\ref@label{{Kutz(2017)}}?><label>Kutz(2017)</label><?label kutz2017deep?><mixed-citation>Kutz, J. N.: Deep learning in fluid dynamics, J. Fluid Mech., 814,
1–4, <ext-link xlink:href="https://doi.org/10.1017/jfm.2016.803" ext-link-type="DOI">10.1017/jfm.2016.803</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx26"><?xmltex \def\ref@label{{Langford and Moser(1999)}}?><label>Langford and Moser(1999)</label><?label langford1999optimal?><mixed-citation>Langford, J. A. and Moser, R. D.: Optimal LES formulations for isotropic
turbulence, J. Fluid Mech., 398, 321–346,
<ext-link xlink:href="https://doi.org/10.1017/S0022112099006369" ext-link-type="DOI">10.1017/S0022112099006369</ext-link>, 1999.</mixed-citation></ref>
      <ref id="bib1.bibx27"><?xmltex \def\ref@label{{Langford and Moser(2001)}}?><label>Langford and Moser(2001)</label><?label langford2001breakdown?><mixed-citation>Langford, J. A. and Moser, R. D.: Breakdown of continuity in large-eddy
simulation, Phys. Fluids, 13, 1524–1527, <ext-link xlink:href="https://doi.org/10.1063/1.1358876" ext-link-type="DOI">10.1063/1.1358876</ext-link>, 2001.</mixed-citation></ref>
      <ref id="bib1.bibx28"><?xmltex \def\ref@label{{Lilly(1967)}}?><label>Lilly(1967)</label><?label lilly1967turbulence?><mixed-citation>Lilly, D. K.: The representation of small-scale turbulence in numerical
simulation experiments, in: Proceedings of the IBM Scientific Computing
Symposium on Environmental Sciences, 195–210, <ext-link xlink:href="https://doi.org/10.5065/D62R3PMM" ext-link-type="DOI">10.5065/D62R3PMM</ext-link>,
1967.</mixed-citation></ref>
      <ref id="bib1.bibx29"><?xmltex \def\ref@label{{Ling et~al.(2016{\natexlab{a}})}}?><label>Ling et al.(2016a)</label><?label ling2016machine?><mixed-citation>Ling, J., Jones, R., and Templeton, J.: Machine learning strategies for systems
with invariance properties, J. Comput. Phys., 318, 22–35,
<ext-link xlink:href="https://doi.org/10.1016/j.jcp.2016.05.003" ext-link-type="DOI">10.1016/j.jcp.2016.05.003</ext-link>, 2016a.</mixed-citation></ref>
      <ref id="bib1.bibx30"><?xmltex \def\ref@label{{Ling et~al.(2016{\natexlab{b}})}}?><label>Ling et al.(2016b)</label><?label ling2016reynolds?><mixed-citation>Ling, J., Kurzawski, A., and Templeton, J.: Reynolds averaged turbulence
modelling using deep neural networks with embedded invariance, J.
Fluid Mech., 807, 155–166, <ext-link xlink:href="https://doi.org/10.1017/jfm.2016.615" ext-link-type="DOI">10.1017/jfm.2016.615</ext-link>,
2016b.</mixed-citation></ref>
      <ref id="bib1.bibx31"><?xmltex \def\ref@label{{Liu et~al.(1994)}}?><label>Liu et al.(1994)</label><?label liu1994properties?><mixed-citation>Liu, S., Meneveau, C., and Katz, J.: On the properties of similarity
subgrid-scale models as deduced from measurements in a turbulent jet, J. Fluid Mech., 275, 83–119, <ext-link xlink:href="https://doi.org/10.1017/S0022112094002296" ext-link-type="DOI">10.1017/S0022112094002296</ext-link>, 1994.</mixed-citation></ref>
      <ref id="bib1.bibx32"><?xmltex \def\ref@label{{Maas et~al.(2013)}}?><label>Maas et al.(2013)</label><?label maas2013rectifier?><mixed-citation>
Maas, A. L., Hannun, A. Y., and Ng, A. Y.: Rectifier nonlinearities improve
neural network acoustic models, in: ICML Workshop on Deep Learning for Audio,
Speech and Language Processing, 16–21 June 2013, Atlanta, USA, 2013.</mixed-citation></ref>
      <ref id="bib1.bibx33"><?xmltex \def\ref@label{{Maulik et~al.(2019)}}?><label>Maulik et al.(2019)</label><?label maulik2019subgrid?><mixed-citation>Maulik, R., San, O., Rasheed, A., and Vedula, P.: Subgrid modelling for
two-dimensional turbulence using neural networks, J. Fluid Mech.,
858, 122–144, <ext-link xlink:href="https://doi.org/10.1017/jfm.2018.770" ext-link-type="DOI">10.1017/jfm.2018.770</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx34"><?xmltex \def\ref@label{{McMillan and Ferziger(1979)}}?><label>McMillan and Ferziger(1979)</label><?label mcmillan1979direct?><mixed-citation>McMillan, O. J. and Ferziger, J. H.: Direct testing of subgrid-scale models,
AIAA Journal, 17, 1340–1346, <ext-link xlink:href="https://doi.org/10.2514/3.61313" ext-link-type="DOI">10.2514/3.61313</ext-link>, 1979.</mixed-citation></ref>
      <ref id="bib1.bibx35"><?xmltex \def\ref@label{{Milano and Koumoutsakos(2002)}}?><label>Milano and Koumoutsakos(2002)</label><?label milano2002neural?><mixed-citation>Milano, M. and Koumoutsakos, P.: Neural network modeling for near wall
turbulent flow, J. Comput. Phys., 182, 1–26,
<ext-link xlink:href="https://doi.org/10.1006/jcph.2002.7146" ext-link-type="DOI">10.1006/jcph.2002.7146</ext-link>, 2002.</mixed-citation></ref>
      <ref id="bib1.bibx36"><?xmltex \def\ref@label{{Molnar(2019)}}?><label>Molnar(2019)</label><?label molnar2019?><mixed-citation>Molnar, C.: Interpretable Machine Learning, lulu.com,
available at: <uri>https://christophm.github.io/interpretable-ml-book/</uri> (last access: 14 April 2021), 2019.</mixed-citation></ref>
      <ref id="bib1.bibx37"><?xmltex \def\ref@label{{Moser et~al.(1999)}}?><label>Moser et al.(1999)</label><?label moser1999direct?><mixed-citation>Moser, R. D., Kim, J., and Mansour, N. N.: Direct numerical simulation of
turbulent channel flow up to Re <inline-formula><mml:math id="M397" display="inline"><mml:mi mathvariant="italic">τ</mml:mi></mml:math></inline-formula>= 590, Phys. Fluids, 11, 943–945,
<ext-link xlink:href="https://doi.org/10.1063/1.869966" ext-link-type="DOI">10.1063/1.869966</ext-link>, 1999.</mixed-citation></ref>
      <ref id="bib1.bibx38"><?xmltex \def\ref@label{{Nadiga and Livescu(2007)}}?><label>Nadiga and Livescu(2007)</label><?label nadiga2007instability?><mixed-citation>Nadiga, B. T. and Livescu, D.: Instability of the perfect subgrid model in
implicit-filtering large eddy simulation of geostrophic turbulence, Phys.
Rev. E, 75, 046 303, <ext-link xlink:href="https://doi.org/10.1103/PhysRevE.75.046303" ext-link-type="DOI">10.1103/PhysRevE.75.046303</ext-link>, 2007.</mixed-citation></ref>
      <ref id="bib1.bibx39"><?xmltex \def\ref@label{{Park and Choi(2021)}}?><label>Park and Choi(2021)</label><?label park2021toward?><mixed-citation>Park, J. and Choi, H.: Toward neural-network-based large eddy simulation:
application to turbulent channel flow, J. Fluid Mech., 914, A16,
<ext-link xlink:href="https://doi.org/10.1017/jfm.2020.931" ext-link-type="DOI">10.1017/jfm.2020.931</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx40"><?xmltex \def\ref@label{{Pope(2001)}}?><label>Pope(2001)</label><?label pope2001turbulent?><mixed-citation>
Pope, S. B.: Turbulent flows, Cambridge University Press, Cambridge, United
Kingdom, 2001.</mixed-citation></ref>
      <ref id="bib1.bibx41"><?xmltex \def\ref@label{{Rasp(2020)}}?><label>Rasp(2020)</label><?label rasp2020coupled?><mixed-citation>Rasp, S.: Coupled online learning as a way to tackle instabilities and biases in neural network parameterizations: general algorithms and Lorenz 96 case study (v1.0), Geosci. Model Dev., 13, 2185–2196, <ext-link xlink:href="https://doi.org/10.5194/gmd-13-2185-2020" ext-link-type="DOI">10.5194/gmd-13-2185-2020</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx42"><?xmltex \def\ref@label{{Rumelhart et~al.(1986)}}?><label>Rumelhart et al.(1986)</label><?label rumelhart1986learning?><mixed-citation>Rumelhart, D. E., Hinton, G. E., and Williams, R. J.: Learning representations
by back-propagating errors, Nature, 323, 533–536, <ext-link xlink:href="https://doi.org/10.1038/323533a0" ext-link-type="DOI">10.1038/323533a0</ext-link>,
1986.</mixed-citation></ref>
      <ref id="bib1.bibx43"><?xmltex \def\ref@label{{Sagaut(2006)}}?><label>Sagaut(2006)</label><?label sagaut2006large?><mixed-citation>
Sagaut, P.: Large eddy simulation for incompressible flows: an introduction,
Springer Science &amp; Business Media, Berlin, Germany, 2006.</mixed-citation></ref>
      <ref id="bib1.bibx44"><?xmltex \def\ref@label{{Sarghini et~al.(2003)}}?><label>Sarghini et al.(2003)</label><?label sarghini2003neural?><mixed-citation>Sarghini, F., De Felice, G., and Santini, S.: Neural networks based subgrid
scale modeling in large eddy simulations, Comput. Fluids, 32, 97–108,
<ext-link xlink:href="https://doi.org/10.1016/S0045-7930(01)00098-6" ext-link-type="DOI">10.1016/S0045-7930(01)00098-6</ext-link>, 2003.</mixed-citation></ref>
      <ref id="bib1.bibx45"><?xmltex \def\ref@label{{Schmitt(2007)}}?><label>Schmitt(2007)</label><?label schmitt2007boussinesq?><mixed-citation>Schmitt, F. G.: About Boussinesq's turbulent viscosity hypothesis: historical
remarks and a direct evaluation of its validity, Comptes Rendus
Mécanique, 335, 617–627, <ext-link xlink:href="https://doi.org/10.1016/j.crme.2007.08.004" ext-link-type="DOI">10.1016/j.crme.2007.08.004</ext-link>, 2007.</mixed-citation></ref>
      <ref id="bib1.bibx46"><?xmltex \def\ref@label{{Singh et~al.(2017)}}?><label>Singh et al.(2017)</label><?label singh2017augmentation?><mixed-citation>Singh, A. P., Duraisamy, K., and Zhang, Z. J.: Augmentation of turbulence
models using field inversion and machine learning, in: 55th AIAA Aerospace
Sciences Meeting,  0993, <ext-link xlink:href="https://doi.org/10.2514/6.2017-0993" ext-link-type="DOI">10.2514/6.2017-0993</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx47"><?xmltex \def\ref@label{{Smagorinsky(1963)}}?><label>Smagorinsky(1963)</label><?label smagorinsky1963general?><mixed-citation>Smagorinsky, J.: General circulation experiments with the primitive equations:
I. The basic experiment, Mon. Weather Rev., 91, 99–164,
<ext-link xlink:href="https://doi.org/10.1175/1520-0493(1963)091&lt;0099:GCEWTP&gt;2.3.CO;2" ext-link-type="DOI">10.1175/1520-0493(1963)091&lt;0099:GCEWTP&gt;2.3.CO;2</ext-link>, 1963.</mixed-citation></ref>
      <ref id="bib1.bibx48"><?xmltex \def\ref@label{{Stoffer(2021)}}?><label>Stoffer(2021)</label><?label stoffer2021microhhnn?><mixed-citation>Stoffer, R.: robinstoffer/microhh2: Rep corresponding to GMD publication
Stoffer et al. (2021) (Version ANN_SGS_v1.2-alpha) [code], Zenodo,
<ext-link xlink:href="https://doi.org/10.5281/zenodo.4767902" ext-link-type="DOI">10.5281/zenodo.4767902</ext-link>, 2021.</mixed-citation></ref>
      <ref id="bib1.bibx49"><?xmltex \def\ref@label{{Van~Driest(1956)}}?><label>Van Driest(1956)</label><?label van1956turbulent?><mixed-citation>Van Driest, E. R.: On turbulent flow near a wall, J. Aeronaut.
Sci., 23, 1007–1011, <ext-link xlink:href="https://doi.org/10.2514/8.3713" ext-link-type="DOI">10.2514/8.3713</ext-link>, 1956.</mixed-citation></ref>
      <ref id="bib1.bibx50"><?xmltex \def\ref@label{{van Heerwaarden et~al.(2017{\natexlab{a}})}}?><label>van Heerwaarden et al.(2017a)</label><?label heerwaarden2017code?><mixed-citation>van Heerwaarden, C. C., van Stratum, B. J. H., and Heus, T.: microhh/microhh:
1.0.0 (Version 1.0.0) [code], Zenodo, <ext-link xlink:href="https://doi.org/10.5281/zenodo.822842" ext-link-type="DOI">10.5281/zenodo.822842</ext-link>, 2017a.</mixed-citation></ref>
      <ref id="bib1.bibx51"><?xmltex \def\ref@label{{van Heerwaarden et~al.(2017{\natexlab{b}})}}?><label>van Heerwaarden et al.(2017b)</label><?label heerwaarden2017microhh?><mixed-citation>van Heerwaarden, C. C., van Stratum, B. J. H., Heus, T., Gibbs, J. A., Fedorovich, E., and Mellado, J. P.: MicroHH 1.0: a computational fluid dyna<?pagebreak page3788?>mics code for direct numerical simulation and large-eddy simulation of atmospheric boundary layer flows, Geosci. Model Dev., 10, 3145–3165, <ext-link xlink:href="https://doi.org/10.5194/gmd-10-3145-2017" ext-link-type="DOI">10.5194/gmd-10-3145-2017</ext-link>, 2017b.</mixed-citation></ref>
      <ref id="bib1.bibx52"><?xmltex \def\ref@label{{V{\"{o}}lker et~al.(2002)}}?><label>Völker et al.(2002)</label><?label volker2002optimal?><mixed-citation>Völker, S., Moser, R. D., and Venugopal, P.: Optimal large eddy simulation
of turbulent channel flow based on direct numerical simulation statistical
data, Phys. Fluids, 14, 3675–3691, <ext-link xlink:href="https://doi.org/10.1063/1.1503803" ext-link-type="DOI">10.1063/1.1503803</ext-link>, 2002.</mixed-citation></ref>
      <ref id="bib1.bibx53"><?xmltex \def\ref@label{{Vollant et~al.(2017)}}?><label>Vollant et al.(2017)</label><?label vollant2017subgrid?><mixed-citation>Vollant, A., Balarac, G., and Corre, C.: Subgrid-scale scalar flux modelling
based on optimal estimation theory and machine-learning procedures, J. Turbulence, 18, 854–878, <ext-link xlink:href="https://doi.org/10.1080/14685248.2017.1334907" ext-link-type="DOI">10.1080/14685248.2017.1334907</ext-link>, 2017.</mixed-citation></ref>
      <ref id="bib1.bibx54"><?xmltex \def\ref@label{{Wang et~al.(2017)}}?><label>Wang et al.(2017)</label><?label wang2017physics?><mixed-citation>Wang, J., Wu, J., and Xiao, H.: Physics-informed machine learning approach for
reconstructing Reynolds stress modeling discrepancies based on DNS data,
Phys. Rev. Fluids, 2, 034603, <ext-link xlink:href="https://doi.org/10.1103/PhysRevFluids.2.034603" ext-link-type="DOI">10.1103/PhysRevFluids.2.034603</ext-link>,
2017.</mixed-citation></ref>
      <ref id="bib1.bibx55"><?xmltex \def\ref@label{{Wang et~al.(2018)}}?><label>Wang et al.(2018)</label><?label wang2018investigations?><mixed-citation>Wang, Z., Luo, K., Li, D., Tan, J., and Fan, J.: Investigations of data-driven
closure for subgrid-scale stress in large-eddy simulation, Phys. Fluids,
30, 125101, <ext-link xlink:href="https://doi.org/10.1063/1.5054835" ext-link-type="DOI">10.1063/1.5054835</ext-link>, 2018.</mixed-citation></ref>
      <ref id="bib1.bibx56"><?xmltex \def\ref@label{{Wu et~al.(2018)}}?><label>Wu et al.(2018)</label><?label wu2018physics?><mixed-citation>Wu, J., Xiao, H., and Paterson, E.: Physics-informed machine learning approach
for augmenting turbulence models: A comprehensive framework, Phys.  Rev.
Fluids, 3, 074602, <ext-link xlink:href="https://doi.org/10.1103/PhysRevFluids.3.074602" ext-link-type="DOI">10.1103/PhysRevFluids.3.074602</ext-link>, 2018.
</mixed-citation></ref><?xmltex \hack{\newpage}?>
      <ref id="bib1.bibx57"><?xmltex \def\ref@label{{Xie et~al.(2019)}}?><label>Xie et al.(2019)</label><?label xie2019artificial?><mixed-citation>Xie, C., Wang, J., Li, K., and Ma, C.: Artificial neural network approach to
large-eddy simulation of compressible isotropic turbulence, Phys. Rev.
E, 99, 053113, <ext-link xlink:href="https://doi.org/10.1103/PhysRevE.99.053113" ext-link-type="DOI">10.1103/PhysRevE.99.053113</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx58"><?xmltex \def\ref@label{{Yang et~al.(2019)}}?><label>Yang et al.(2019)</label><?label yang2019predictive?><mixed-citation>Yang, X., Zafar, S., Wang, J., and Xiao, H.: Predictive large-eddy-simulation
wall modeling via physics-informed neural networks, Phys. Rev. Fluids,
4, 034602, <ext-link xlink:href="https://doi.org/10.1103/PhysRevFluids.4.034602" ext-link-type="DOI">10.1103/PhysRevFluids.4.034602</ext-link>, 2019.</mixed-citation></ref>
      <ref id="bib1.bibx59"><?xmltex \def\ref@label{{Yuval and O'Gorman(2020)}}?><label>Yuval and O'Gorman(2020)</label><?label yuval2020stable?><mixed-citation>Yuval, J. and O'Gorman, P. A.: Stable machine-learning parameterization of
subgrid processes for climate modeling at a range of resolutions, Nat.
Commun., 11, 1–10, <ext-link xlink:href="https://doi.org/10.1038/s41467-020-17142-3" ext-link-type="DOI">10.1038/s41467-020-17142-3</ext-link>, 2020.</mixed-citation></ref>
      <ref id="bib1.bibx60"><?xmltex \def\ref@label{{Zandonade et~al.(2004)}}?><label>Zandonade et al.(2004)</label><?label zandonade2004finite?><mixed-citation>Zandonade, P. S., Langford, J. A., and Moser, R. D.: Finite-volume optimal
large-eddy simulation of isotropic turbulence, Phys. Fluids, 16,
2255–2271, <ext-link xlink:href="https://doi.org/10.1063/1.1736672" ext-link-type="DOI">10.1063/1.1736672</ext-link>, 2004.</mixed-citation></ref>
      <ref id="bib1.bibx61"><?xmltex \def\ref@label{{Zhou et~al.(2019)}}?><label>Zhou et al.(2019)</label><?label zhou2019subgrid?><mixed-citation>Zhou, Z., He, G., Wang, S., and Jin, G.: Subgrid-scale model for large-eddy
simulation of isotropic turbulent flows using an artificial neural network,
Comput. Fluids, 195, 104319, <ext-link xlink:href="https://doi.org/10.1016/j.compfluid.2019.104319" ext-link-type="DOI">10.1016/j.compfluid.2019.104319</ext-link>,
2019.</mixed-citation></ref>

  </ref-list></back>
    <!--<article-title-html>Development of a large-eddy simulation subgrid model based on artificial neural networks: a case study of turbulent channel flow</article-title-html>
<abstract-html><p>Atmospheric boundary layers and other wall-bounded flows are often simulated with the large-eddy simulation (LES) technique, which relies on subgrid-scale (SGS) models to parameterize the smallest scales. These SGS models often make strong simplifying assumptions. Also, they tend to interact with the discretization errors introduced by the popular LES approach where a staggered finite-volume grid acts as an implicit filter. We therefore developed an alternative LES SGS model based on artificial neural networks (ANNs) for the computational fluid dynamics MicroHH code (v2.0). We used a turbulent channel flow (with friction Reynolds number <i>Re</i><sub><i>τ</i></sub> = 590) as a test case. The developed SGS model has been designed to compensate for  both the unresolved physics and instantaneous spatial discretization errors introduced by the staggered finite-volume grid. We trained the ANNs based on instantaneous flow fields from a direct numerical simulation (DNS) of the selected channel flow. In general, we found excellent agreement between the ANN-predicted SGS fluxes and the SGS fluxes derived from DNS for flow fields not used during training. In addition, we demonstrate that our ANN SGS model generalizes well towards other coarse horizontal resolutions, especially when these resolutions are located within the range of the training data. This shows that ANNs have potential to construct highly accurate SGS models that compensate for spatial discretization errors. We do highlight and discuss one important challenge still remaining before this potential can be successfully leveraged in actual LES simulations: we observed an artificial buildup of turbulence kinetic energy when we directly incorporated our ANN SGS model into a LES simulation of the selected channel flow, eventually resulting in numeric instability. We hypothesize that error accumulation and aliasing errors are both important contributors to the observed instability. We finally make several suggestions for future research that may alleviate the observed instability.</p></abstract-html>
<ref-html id="bib1.bib1"><label>Abadi et al.(2016)</label><mixed-citation>
Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., Devin, M., Ghemawat, S., Irving, G., Isard, M., Kudlur, M., Levenberg, J., Monga, R., Moore, S., Murray, D. G., Steiner, B., Tucker, P., Vasudevan, V., Warden, P., Wicke, M., Yu, Y., and Zheng, X.: TensorFlow: A system for
large-scale machine learning, in: 12th (USENIX) Symposium on Operating
Systems Design and Implementation (OSDI 16), 265–283, 2016.
</mixed-citation></ref-html>
<ref-html id="bib1.bib2"><label>Bardina et al.(1980)</label><mixed-citation>
Bardina, J., Ferziger, J., and Reynolds, W.: Improved subgrid-scale models for
large-eddy simulation, in: 13th fluid and plasmadynamics conference, 1357,
<a href="https://doi.org/10.2514/6.1980-1357" target="_blank">https://doi.org/10.2514/6.1980-1357</a>, 1980.
</mixed-citation></ref-html>
<ref-html id="bib1.bib3"><label>Beck et al.(2019)</label><mixed-citation>
Beck, A., Flad, D., and Munz, C.: Deep neural networks for data-driven LES
closure models, J. Comput. Phys., 398, 108910,
<a href="https://doi.org/10.1016/j.jcp.2019.108910" target="_blank">https://doi.org/10.1016/j.jcp.2019.108910</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib4"><label>Bolton and Zanna(2019)</label><mixed-citation>
Bolton, T. and Zanna, L.: Applications of deep learning to ocean data inference
and subgrid parameterization, J. Adv. Model. Earth Sy.,
11, 376–399, <a href="https://doi.org/10.1029/2018MS001472" target="_blank">https://doi.org/10.1029/2018MS001472</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib5"><label>Bou-Zeid et al.(2005)</label><mixed-citation>
Bou-Zeid, E., Meneveau, C., and Parlange, M.: A scale-dependent Lagrangian
dynamic model for large eddy simulation of complex turbulent flows, Phys. Fluids, 17, 025105, <a href="https://doi.org/10.1063/1.1839152" target="_blank">https://doi.org/10.1063/1.1839152</a>, 2005.
</mixed-citation></ref-html>
<ref-html id="bib1.bib6"><label>Breiman(2001)</label><mixed-citation>
Breiman, L.: Random forests, Mach. Learn., 45, 5–32,
<a href="https://doi.org/10.1023/A:1010933404324" target="_blank">https://doi.org/10.1023/A:1010933404324</a>, 2001.
</mixed-citation></ref-html>
<ref-html id="bib1.bib7"><label>Brenowitz and Bretherton(2019)</label><mixed-citation>
Brenowitz, N. D. and Bretherton, C. S.: Spatially extended tests of a neural
network parametrization trained by coarse-graining, J. Adv.
Model. Earth Sy., 11, 2728–2744, <a href="https://doi.org/10.1029/2019MS001711" target="_blank">https://doi.org/10.1029/2019MS001711</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib8"><label>Brunton et al.(2020)</label><mixed-citation>
Brunton, S. L., Noack, B. R., and Koumoutsakos, P.: Machine learning for fluid
mechanics, Annu. Rev. Fluid Mech., 52, 477–508,
<a href="https://doi.org/10.1146/annurev-fluid-010719-060214" target="_blank">https://doi.org/10.1146/annurev-fluid-010719-060214</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib9"><label>Cheng et al.(2019)</label><mixed-citation>
Cheng, Y., Giometto, M., Kauffmann, P., Lin, L., Cao, C., Zupnick, C., Li, H.,
Li, Q., Abernathey, R., and Gentine, P.: Deep learning for subgrid-scale
turbulence modeling in large-eddy simulations of the atmospheric boundary
layer, arXiv preprint arXiv:1910.12125, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib10"><label>Chow and Moin(2003)</label><mixed-citation>
Chow, F. K. and Moin, P.: A further study of numerical errors in large-eddy
simulations, J. Comput. Phys., 184, 366–380,
<a href="https://doi.org/10.1016/S0021-9991(02)00020-7" target="_blank">https://doi.org/10.1016/S0021-9991(02)00020-7</a>, 2003.
</mixed-citation></ref-html>
<ref-html id="bib1.bib11"><label>Clark et al.(1979)</label><mixed-citation>
Clark, R. A., Ferziger, J. H., and Reynolds, W. C.: Evaluation of subgrid-scale
models using an accurately simulated turbulent flow, J. Fluid
Mech., 91, 1–16, <a href="https://doi.org/10.1017/S002211207900001X" target="_blank">https://doi.org/10.1017/S002211207900001X</a>, 1979.
</mixed-citation></ref-html>
<ref-html id="bib1.bib12"><label>Denaro(2011)</label><mixed-citation>
Denaro, F. M.: What does Finite Volume-based implicit filtering really resolve
in Large-Eddy Simulations?, J. Comput. Phys., 230,
3849–3883, <a href="https://doi.org/10.1016/j.jcp.2011.02.011" target="_blank">https://doi.org/10.1016/j.jcp.2011.02.011</a>, 2011.
</mixed-citation></ref-html>
<ref-html id="bib1.bib13"><label>Duraisamy et al.(2019)</label><mixed-citation>
Duraisamy, K., Iaccarino, G., and Xiao, H.: Turbulence modeling in the age of
data, Annu. Rev. Fluid Mech., 51, 357–377,
<a href="https://doi.org/10.1146/annurev-fluid-010518-040547" target="_blank">https://doi.org/10.1146/annurev-fluid-010518-040547</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib14"><label>Fisher et al.(2019)</label><mixed-citation>
Fisher, A., Rudin, C., and Dominici, F.: All Models are Wrong, but Many are
Useful: Learning a Variable's Importance by Studying an Entire Class of
Prediction Models Simultaneously, J. Mach. Learn. Res., 20,
1–81, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib15"><label>Gamahara and Hattori(2017)</label><mixed-citation>
Gamahara, M. and Hattori, Y.: Searching for turbulence models by artificial
neural network, Phys. Rev. Fluids, 2, 054604,
<a href="https://doi.org/10.1103/PhysRevFluids.2.054604" target="_blank">https://doi.org/10.1103/PhysRevFluids.2.054604</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib16"><label>Ghosal(1996)</label><mixed-citation>
Ghosal, S.: An analysis of numerical errors in large-eddy simulations of
turbulence, J. Comput. Phys., 125, 187–206,
<a href="https://doi.org/10.1006/jcph.1996.0088" target="_blank">https://doi.org/10.1006/jcph.1996.0088</a>, 1996.
</mixed-citation></ref-html>
<ref-html id="bib1.bib17"><label>Giacomini and Giometto(2021)</label><mixed-citation>
Giacomini, B. and Giometto, M. G.: On the suitability of second-order accurate finite-volume solvers for the simulation of atmospheric boundary layer flow, Geosci. Model Dev., 14, 1409–1426, <a href="https://doi.org/10.5194/gmd-14-1409-2021" target="_blank">https://doi.org/10.5194/gmd-14-1409-2021</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib18"><label>Guan et al.(2021)</label><mixed-citation>
Guan, Y., Chattopadhyay, A., Subel, A., and Hassanzadeh, P.: Stable a
posteriori LES of 2D turbulence using convolutional neural networks:
Backscattering analysis and generalization to higher Re via transfer
learning, arXiv preprint arXiv:2102.11400,
available at: <a href="https://arxiv.org/pdf/2102.11400.pdf" target="_blank"/> (last access: 1 March 2021), 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib19"><label>He et al.(2015)</label><mixed-citation>
He, K., Zhang, X., Ren, S., and Sun, J.: Delving Deep into Rectifiers:
Surpassing Human-Level Performance on ImageNet Classification, in: The IEEE
International Conference on Computer Vision (ICCV), 1026–1034,
<a href="https://doi.org/10.1109/ICCV.2015.123" target="_blank">https://doi.org/10.1109/ICCV.2015.123</a>, 2015.
</mixed-citation></ref-html>
<ref-html id="bib1.bib20"><label>Hornik et al.(1989)</label><mixed-citation>
Hornik, K., Stinchcombe, M., and White, H.: Multilayer feedforward networks are
universal approximators., Neural Networks, 2, 359–366,
<a href="https://doi.org/10.1016/0893-6080(89)90020-8" target="_blank">https://doi.org/10.1016/0893-6080(89)90020-8</a>, 1989.
</mixed-citation></ref-html>
<ref-html id="bib1.bib21"><label>Jimenez and Moser(2000)</label><mixed-citation>
Jimenez, J. and Moser, R. D.: Large-eddy simulations: where are we and what can
we expect?, AIAA journal, 38, 605–612, <a href="https://doi.org/10.2514/2.1031" target="_blank">https://doi.org/10.2514/2.1031</a>, 2000.
</mixed-citation></ref-html>
<ref-html id="bib1.bib22"><label>Kaandorp and Dwight(2020)</label><mixed-citation>
Kaandorp, M. L. A. and Dwight, R. P.: Data-driven modelling of the Reynolds
stress tensor using random forests with invariance, Comput. Fluids, 202,
104497, <a href="https://doi.org/10.1016/j.compfluid.2020.104497" target="_blank">https://doi.org/10.1016/j.compfluid.2020.104497</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib23"><label>Kingma and Ba(2014)</label><mixed-citation>
Kingma, D. P. and Ba, J.: Adam: A method for stochastic optimization, arXiv
preprint arXiv:1412.6980, 2014.
</mixed-citation></ref-html>
<ref-html id="bib1.bib24"><label>Kravchenko and Moin(1997)</label><mixed-citation>
Kravchenko, A. G. and Moin, P.: On the effect of numerical errors in large eddy
simulations of turbulent flows, J. Comput. Phys., 131,
310–322, <a href="https://doi.org/10.1006/jcph.1996.5597" target="_blank">https://doi.org/10.1006/jcph.1996.5597</a>, 1997.
</mixed-citation></ref-html>
<ref-html id="bib1.bib25"><label>Kutz(2017)</label><mixed-citation>
Kutz, J. N.: Deep learning in fluid dynamics, J. Fluid Mech., 814,
1–4, <a href="https://doi.org/10.1017/jfm.2016.803" target="_blank">https://doi.org/10.1017/jfm.2016.803</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib26"><label>Langford and Moser(1999)</label><mixed-citation>
Langford, J. A. and Moser, R. D.: Optimal LES formulations for isotropic
turbulence, J. Fluid Mech., 398, 321–346,
<a href="https://doi.org/10.1017/S0022112099006369" target="_blank">https://doi.org/10.1017/S0022112099006369</a>, 1999.
</mixed-citation></ref-html>
<ref-html id="bib1.bib27"><label>Langford and Moser(2001)</label><mixed-citation>
Langford, J. A. and Moser, R. D.: Breakdown of continuity in large-eddy
simulation, Phys. Fluids, 13, 1524–1527, <a href="https://doi.org/10.1063/1.1358876" target="_blank">https://doi.org/10.1063/1.1358876</a>, 2001.
</mixed-citation></ref-html>
<ref-html id="bib1.bib28"><label>Lilly(1967)</label><mixed-citation>
Lilly, D. K.: The representation of small-scale turbulence in numerical
simulation experiments, in: Proceedings of the IBM Scientific Computing
Symposium on Environmental Sciences, 195–210, <a href="https://doi.org/10.5065/D62R3PMM" target="_blank">https://doi.org/10.5065/D62R3PMM</a>,
1967.
</mixed-citation></ref-html>
<ref-html id="bib1.bib29"><label>Ling et al.(2016a)</label><mixed-citation>
Ling, J., Jones, R., and Templeton, J.: Machine learning strategies for systems
with invariance properties, J. Comput. Phys., 318, 22–35,
<a href="https://doi.org/10.1016/j.jcp.2016.05.003" target="_blank">https://doi.org/10.1016/j.jcp.2016.05.003</a>, 2016a.
</mixed-citation></ref-html>
<ref-html id="bib1.bib30"><label>Ling et al.(2016b)</label><mixed-citation>
Ling, J., Kurzawski, A., and Templeton, J.: Reynolds averaged turbulence
modelling using deep neural networks with embedded invariance, J.
Fluid Mech., 807, 155–166, <a href="https://doi.org/10.1017/jfm.2016.615" target="_blank">https://doi.org/10.1017/jfm.2016.615</a>,
2016b.
</mixed-citation></ref-html>
<ref-html id="bib1.bib31"><label>Liu et al.(1994)</label><mixed-citation>
Liu, S., Meneveau, C., and Katz, J.: On the properties of similarity
subgrid-scale models as deduced from measurements in a turbulent jet, J. Fluid Mech., 275, 83–119, <a href="https://doi.org/10.1017/S0022112094002296" target="_blank">https://doi.org/10.1017/S0022112094002296</a>, 1994.
</mixed-citation></ref-html>
<ref-html id="bib1.bib32"><label>Maas et al.(2013)</label><mixed-citation>
Maas, A. L., Hannun, A. Y., and Ng, A. Y.: Rectifier nonlinearities improve
neural network acoustic models, in: ICML Workshop on Deep Learning for Audio,
Speech and Language Processing, 16–21 June 2013, Atlanta, USA, 2013.
</mixed-citation></ref-html>
<ref-html id="bib1.bib33"><label>Maulik et al.(2019)</label><mixed-citation>
Maulik, R., San, O., Rasheed, A., and Vedula, P.: Subgrid modelling for
two-dimensional turbulence using neural networks, J. Fluid Mech.,
858, 122–144, <a href="https://doi.org/10.1017/jfm.2018.770" target="_blank">https://doi.org/10.1017/jfm.2018.770</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib34"><label>McMillan and Ferziger(1979)</label><mixed-citation>
McMillan, O. J. and Ferziger, J. H.: Direct testing of subgrid-scale models,
AIAA Journal, 17, 1340–1346, <a href="https://doi.org/10.2514/3.61313" target="_blank">https://doi.org/10.2514/3.61313</a>, 1979.
</mixed-citation></ref-html>
<ref-html id="bib1.bib35"><label>Milano and Koumoutsakos(2002)</label><mixed-citation>
Milano, M. and Koumoutsakos, P.: Neural network modeling for near wall
turbulent flow, J. Comput. Phys., 182, 1–26,
<a href="https://doi.org/10.1006/jcph.2002.7146" target="_blank">https://doi.org/10.1006/jcph.2002.7146</a>, 2002.
</mixed-citation></ref-html>
<ref-html id="bib1.bib36"><label>Molnar(2019)</label><mixed-citation>
Molnar, C.: Interpretable Machine Learning, lulu.com,
available at: <a href="https://christophm.github.io/interpretable-ml-book/" target="_blank"/> (last access: 14 April 2021), 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib37"><label>Moser et al.(1999)</label><mixed-citation>
Moser, R. D., Kim, J., and Mansour, N. N.: Direct numerical simulation of
turbulent channel flow up to Re <i>τ</i>= 590, Phys. Fluids, 11, 943–945,
<a href="https://doi.org/10.1063/1.869966" target="_blank">https://doi.org/10.1063/1.869966</a>, 1999.
</mixed-citation></ref-html>
<ref-html id="bib1.bib38"><label>Nadiga and Livescu(2007)</label><mixed-citation>
Nadiga, B. T. and Livescu, D.: Instability of the perfect subgrid model in
implicit-filtering large eddy simulation of geostrophic turbulence, Phys.
Rev. E, 75, 046&thinsp;303, <a href="https://doi.org/10.1103/PhysRevE.75.046303" target="_blank">https://doi.org/10.1103/PhysRevE.75.046303</a>, 2007.
</mixed-citation></ref-html>
<ref-html id="bib1.bib39"><label>Park and Choi(2021)</label><mixed-citation>
Park, J. and Choi, H.: Toward neural-network-based large eddy simulation:
application to turbulent channel flow, J. Fluid Mech., 914, A16,
<a href="https://doi.org/10.1017/jfm.2020.931" target="_blank">https://doi.org/10.1017/jfm.2020.931</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib40"><label>Pope(2001)</label><mixed-citation>
Pope, S. B.: Turbulent flows, Cambridge University Press, Cambridge, United
Kingdom, 2001.
</mixed-citation></ref-html>
<ref-html id="bib1.bib41"><label>Rasp(2020)</label><mixed-citation>
Rasp, S.: Coupled online learning as a way to tackle instabilities and biases in neural network parameterizations: general algorithms and Lorenz 96 case study (v1.0), Geosci. Model Dev., 13, 2185–2196, <a href="https://doi.org/10.5194/gmd-13-2185-2020" target="_blank">https://doi.org/10.5194/gmd-13-2185-2020</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib42"><label>Rumelhart et al.(1986)</label><mixed-citation>
Rumelhart, D. E., Hinton, G. E., and Williams, R. J.: Learning representations
by back-propagating errors, Nature, 323, 533–536, <a href="https://doi.org/10.1038/323533a0" target="_blank">https://doi.org/10.1038/323533a0</a>,
1986.
</mixed-citation></ref-html>
<ref-html id="bib1.bib43"><label>Sagaut(2006)</label><mixed-citation>
Sagaut, P.: Large eddy simulation for incompressible flows: an introduction,
Springer Science &amp; Business Media, Berlin, Germany, 2006.
</mixed-citation></ref-html>
<ref-html id="bib1.bib44"><label>Sarghini et al.(2003)</label><mixed-citation>
Sarghini, F., De Felice, G., and Santini, S.: Neural networks based subgrid
scale modeling in large eddy simulations, Comput. Fluids, 32, 97–108,
<a href="https://doi.org/10.1016/S0045-7930(01)00098-6" target="_blank">https://doi.org/10.1016/S0045-7930(01)00098-6</a>, 2003.
</mixed-citation></ref-html>
<ref-html id="bib1.bib45"><label>Schmitt(2007)</label><mixed-citation>
Schmitt, F. G.: About Boussinesq's turbulent viscosity hypothesis: historical
remarks and a direct evaluation of its validity, Comptes Rendus
Mécanique, 335, 617–627, <a href="https://doi.org/10.1016/j.crme.2007.08.004" target="_blank">https://doi.org/10.1016/j.crme.2007.08.004</a>, 2007.
</mixed-citation></ref-html>
<ref-html id="bib1.bib46"><label>Singh et al.(2017)</label><mixed-citation>
Singh, A. P., Duraisamy, K., and Zhang, Z. J.: Augmentation of turbulence
models using field inversion and machine learning, in: 55th AIAA Aerospace
Sciences Meeting,  0993, <a href="https://doi.org/10.2514/6.2017-0993" target="_blank">https://doi.org/10.2514/6.2017-0993</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib47"><label>Smagorinsky(1963)</label><mixed-citation>
Smagorinsky, J.: General circulation experiments with the primitive equations:
I. The basic experiment, Mon. Weather Rev., 91, 99–164,
<a href="https://doi.org/10.1175/1520-0493(1963)091&lt;0099:GCEWTP&gt;2.3.CO;2" target="_blank">https://doi.org/10.1175/1520-0493(1963)091&lt;0099:GCEWTP&gt;2.3.CO;2</a>, 1963.
</mixed-citation></ref-html>
<ref-html id="bib1.bib48"><label>Stoffer(2021)</label><mixed-citation>
Stoffer, R.: robinstoffer/microhh2: Rep corresponding to GMD publication
Stoffer et al. (2021) (Version ANN_SGS_v1.2-alpha) [code], Zenodo,
<a href="https://doi.org/10.5281/zenodo.4767902" target="_blank">https://doi.org/10.5281/zenodo.4767902</a>, 2021.
</mixed-citation></ref-html>
<ref-html id="bib1.bib49"><label>Van Driest(1956)</label><mixed-citation>
Van Driest, E. R.: On turbulent flow near a wall, J. Aeronaut.
Sci., 23, 1007–1011, <a href="https://doi.org/10.2514/8.3713" target="_blank">https://doi.org/10.2514/8.3713</a>, 1956.
</mixed-citation></ref-html>
<ref-html id="bib1.bib50"><label>van Heerwaarden et al.(2017a)</label><mixed-citation>
van Heerwaarden, C. C., van Stratum, B. J. H., and Heus, T.: microhh/microhh:
1.0.0 (Version 1.0.0) [code], Zenodo, <a href="https://doi.org/10.5281/zenodo.822842" target="_blank">https://doi.org/10.5281/zenodo.822842</a>, 2017a.
</mixed-citation></ref-html>
<ref-html id="bib1.bib51"><label>van Heerwaarden et al.(2017b)</label><mixed-citation>
van Heerwaarden, C. C., van Stratum, B. J. H., Heus, T., Gibbs, J. A., Fedorovich, E., and Mellado, J. P.: MicroHH 1.0: a computational fluid dynamics code for direct numerical simulation and large-eddy simulation of atmospheric boundary layer flows, Geosci. Model Dev., 10, 3145–3165, <a href="https://doi.org/10.5194/gmd-10-3145-2017" target="_blank">https://doi.org/10.5194/gmd-10-3145-2017</a>, 2017b.
</mixed-citation></ref-html>
<ref-html id="bib1.bib52"><label>Völker et al.(2002)</label><mixed-citation>
Völker, S., Moser, R. D., and Venugopal, P.: Optimal large eddy simulation
of turbulent channel flow based on direct numerical simulation statistical
data, Phys. Fluids, 14, 3675–3691, <a href="https://doi.org/10.1063/1.1503803" target="_blank">https://doi.org/10.1063/1.1503803</a>, 2002.
</mixed-citation></ref-html>
<ref-html id="bib1.bib53"><label>Vollant et al.(2017)</label><mixed-citation>
Vollant, A., Balarac, G., and Corre, C.: Subgrid-scale scalar flux modelling
based on optimal estimation theory and machine-learning procedures, J. Turbulence, 18, 854–878, <a href="https://doi.org/10.1080/14685248.2017.1334907" target="_blank">https://doi.org/10.1080/14685248.2017.1334907</a>, 2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib54"><label>Wang et al.(2017)</label><mixed-citation>
Wang, J., Wu, J., and Xiao, H.: Physics-informed machine learning approach for
reconstructing Reynolds stress modeling discrepancies based on DNS data,
Phys. Rev. Fluids, 2, 034603, <a href="https://doi.org/10.1103/PhysRevFluids.2.034603" target="_blank">https://doi.org/10.1103/PhysRevFluids.2.034603</a>,
2017.
</mixed-citation></ref-html>
<ref-html id="bib1.bib55"><label>Wang et al.(2018)</label><mixed-citation>
Wang, Z., Luo, K., Li, D., Tan, J., and Fan, J.: Investigations of data-driven
closure for subgrid-scale stress in large-eddy simulation, Phys. Fluids,
30, 125101, <a href="https://doi.org/10.1063/1.5054835" target="_blank">https://doi.org/10.1063/1.5054835</a>, 2018.
</mixed-citation></ref-html>
<ref-html id="bib1.bib56"><label>Wu et al.(2018)</label><mixed-citation>
Wu, J., Xiao, H., and Paterson, E.: Physics-informed machine learning approach
for augmenting turbulence models: A comprehensive framework, Phys.  Rev.
Fluids, 3, 074602, <a href="https://doi.org/10.1103/PhysRevFluids.3.074602" target="_blank">https://doi.org/10.1103/PhysRevFluids.3.074602</a>, 2018.

</mixed-citation></ref-html>
<ref-html id="bib1.bib57"><label>Xie et al.(2019)</label><mixed-citation>
Xie, C., Wang, J., Li, K., and Ma, C.: Artificial neural network approach to
large-eddy simulation of compressible isotropic turbulence, Phys. Rev.
E, 99, 053113, <a href="https://doi.org/10.1103/PhysRevE.99.053113" target="_blank">https://doi.org/10.1103/PhysRevE.99.053113</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib58"><label>Yang et al.(2019)</label><mixed-citation>
Yang, X., Zafar, S., Wang, J., and Xiao, H.: Predictive large-eddy-simulation
wall modeling via physics-informed neural networks, Phys. Rev. Fluids,
4, 034602, <a href="https://doi.org/10.1103/PhysRevFluids.4.034602" target="_blank">https://doi.org/10.1103/PhysRevFluids.4.034602</a>, 2019.
</mixed-citation></ref-html>
<ref-html id="bib1.bib59"><label>Yuval and O'Gorman(2020)</label><mixed-citation>
Yuval, J. and O'Gorman, P. A.: Stable machine-learning parameterization of
subgrid processes for climate modeling at a range of resolutions, Nat.
Commun., 11, 1–10, <a href="https://doi.org/10.1038/s41467-020-17142-3" target="_blank">https://doi.org/10.1038/s41467-020-17142-3</a>, 2020.
</mixed-citation></ref-html>
<ref-html id="bib1.bib60"><label>Zandonade et al.(2004)</label><mixed-citation>
Zandonade, P. S., Langford, J. A., and Moser, R. D.: Finite-volume optimal
large-eddy simulation of isotropic turbulence, Phys. Fluids, 16,
2255–2271, <a href="https://doi.org/10.1063/1.1736672" target="_blank">https://doi.org/10.1063/1.1736672</a>, 2004.
</mixed-citation></ref-html>
<ref-html id="bib1.bib61"><label>Zhou et al.(2019)</label><mixed-citation>
Zhou, Z., He, G., Wang, S., and Jin, G.: Subgrid-scale model for large-eddy
simulation of isotropic turbulent flows using an artificial neural network,
Comput. Fluids, 195, 104319, <a href="https://doi.org/10.1016/j.compfluid.2019.104319" target="_blank">https://doi.org/10.1016/j.compfluid.2019.104319</a>,
2019.
</mixed-citation></ref-html>--></article>
