Elsevier

Computers & Fluids

Volume 197, 30 January 2020, 104352
Computers & Fluids

Adaptive mesh refinement for steady flows in Nek5000

https://doi.org/10.1016/j.compfluid.2019.104352Get rights and content

Highlights

Abstract

Adaptive mesh refinement is performed in the framework of the spectral element method augmented by approaches to error estimation and control. The h-refinement technique is used for adapting the mesh, where selected grid elements are split by a quadtree (2D) or octree (3D) structure. Continuity between parent–child elements is enforced by high-order interpolation of the solution across the common faces. Parallel mesh partitioning and grid management respectively, are taken care of by the external libraries ParMETIS and p4est. Two methods are considered for estimating and controlling the error of the solution. The first error estimate is local and based on the spectral properties of the solution on each element. This method gives a local measure of the L2-norm of the solution over the entire computational domain. The second error estimate uses the dual-weighted residuals method — it is based on and takes into account both the local properties of the solution and the global dependence of the error in the solution via an adjoint problem. The objective of this second approach is to optimize the computation of a given functional of physical interest. The simulations are performed by using the code Nek5000 and three steady-state test cases are studied: a two-dimensional lid-driven cavity at Re=7,500, a two-dimensional flow past a cylinder at Re=40, and a three-dimensional lid-driven cavity at Re=2,000 with a moving lid tilted by an angle of 30. The efficiency of both error estimators is compared in terms of refinement patterns and accuracy on the functional of interest. In the case of the adjoint error estimators, the trend on the error of the functional is shown to be correctly represented up to a multiplicative constant.

Introduction

The size and class of scientific or engineering problems that can be studied today in fluid mechanics are limited mostly by the onset of turbulence at high Reynolds numbers and the resolution of all the turbulence scales up to dissipation [1]. One solution to push the limit farther is the use of adaptive mesh refinement (AMR), which describes a set of methods used to automatically adapt a numerical grid in the course of a simulation.

AMR is especially desirable when little is known a priori about the solution, and it offers much more flexibility than a static mesh. The two main ingredients of AMR are tools for adapting the mesh and error estimators, and the efficiency of these choices affects the entire simulation. Several frameworks have been developed in the past few years for block-structured mesh refinement [2], [3], [4] and allow for mesh adaptation in parallel. However, the block-structured mesh requirement is a limiting constraint for many applications of interest. More flexible refinement techniques include adjusting the relative sizes of some elements (r-refinement) [5], [6], increasing the number of elements (h-refinement) [7], [8], or locally increasing the polynomial order (p-refinement) [9] in the case of high-order methods. Examples of libraries for mesh refinement are p4est [10], which enables the dynamic management of a collection of adaptive octrees or deal.II [11], which supports hp-refinement for the FEM.

Furthermore, various options exist to estimate the error. A posteriori error estimators have been extensively studied for the FEM [12], [13], [14] as well as for the spectral element method [15]. Similarly, error estimators based on spectral properties have been developed by Jacobs et al. [16] and applied to aerofoil simulations using finite differences. A second class of estimators, called adjoint error estimators, aims at optimizing the computation of a functional of interest via knowledge of a solution to the adjoint problem. Based on ideas from design optimization, a goal-oriented error estimator is developed by Pierce and Giles [17], where the sensitivity of the output functional to a hypothetical mesh refinement is computed by the application of a prolongation operator. A second approach to goal-oriented estimators involves dual-weighted error estimators, which skip the computation or application of a prolongation operator; this approach was used early by Johnson and Hansbo [18] and thoroughly studied by Bangerth and Rannacher [19]. It combines local error estimates with global adjoint weights for an optimal estimation of the error.

A milestone paper by Babuška on the topic of AMR [12] considers a localized error estimator designed for the FEM providing a heuristic for optimal mesh design. The concept of automatic local adaptive mesh refinement in time and space was introduced by Berger and Oliger [20] and applied to 2D [21] and 3D cases [22] for hyperbolic equations. The ideas and concepts for AMR have since then been applied to a wide range of disciplines. In astrophysics, AMR is essential in dealing with the substantial scale variations encountered in cosmological computations [23], [24], [25], [26]. Similar methods have been applied to various problems in computational solid mechanics [18], [27], [28], [29]. In computational fluid dynamics Berrone and Maro present space- and time-adaptive simulations using a posteriori error indicators and h-refinement of triangles (2D) or tetrahedra (3D) using the FEM [30]. In particular, they performed two-dimensional simulations of the steady flow behind a backward-facing step and the laminar flow past a square cylinder. In the same vein, Hoffman developed a posteriori error estimators based on the computation of an adjoint problem and dual weights to perform adaptive direct numerical simulation and large eddy simulation (LES) using the Galerkin method [31]. The test cases considered were a surface-mounted cube at Re=40,000 and the three-dimensional flow past a square cylinder at Re=22,000. AMR using the finite volume method and LES were explored by Antepara et al. [32]. Their applications were turbulent flows around a square cylinder at Re=22,000 and around two side-by-side square cylinders at Re=21,000. The p-adaptation method has been used by Ekelschot et al. [9], along with goal-oriented adjoint error estimators, within the framework of the discontinuous Galerkin method. They showed that their method is suitable for the computation of aerodynamic forces in the case of 2D and 3D inviscid and compressible airfoil simulations.

The present work is a preliminary step toward unsteady AMR and deals with the implementation and validation of adjoint error estimators for mesh optimization for simulations of steady flows. The Navier–Stokes equations are solved in Nek5000, a code based on the spectral element method (SEM), and the mesh is refined by using the h-refinement method. While many research codes have made the choice of block-structured mesh refinement (see the survey in [33]), our method only requires the original mesh to be conforming; refinement can then be applied separately on each individual element. This additional flexibility allows for more complex geometries. The adjoint estimators are also compared with a posteriori error indicators based on the local spectral properties of the solution in the case of steady simulations in two and three dimensions.

The manuscript is organized as follows. In Section 2, we briefly present the modifications made to Nek5000 in order to enable the use of h-refinement techniques. In Section 3, selected spectral error indicators are introduced, which are used for comparison with the adjoint error estimators. In Section 4, the adjoint error estimators are derived for steady cases within the framework of the SEM. In Section 5, the refinement algorithm is summarized. In Section 6, both methods for error estimation are combined with the new mesh refinement capabilities, and mesh refinement is performed on three steady test cases: a two-dimensional lid-driven cavity at Re=7,500, a two-dimensional flow past a cylinder at Re=40, and a three-dimensional flow inside a lid-driven cavity at Re=2,000 with a lid oriented by an angle of 30. In Section 7, conclusions and outlook are discussed.

Section snippets

Numerical methods

The code used in this work is Nek5000 [34], an open-source, highly scalable and portable code based on the SEM, which offers minimal dissipation and dispersion and spectral accuracy. The high scalability of the code is owed to the vectorization at the element level via tensor product representations and the matrix-free implementation at the global solver level. In this section, we introduce the main concepts behind the SEM, Nek5000 and the adaptations that were required in the code to enable h

Spectral error indicators

A posteriori error indicators are used as a reference to compare the adjoint error estimators. These indicators are based on a method developed by Mavriplis [15].

Consider u(x), the exact solution of a 1D partial differential equation. Its spectral transform and associated spectral coefficients are given respectively byu(x)=k=0u¯kpk(x)andu¯k=1γk11w(x)u(x)pk(x)dx,where pk is a family of orthogonal polynomials (k denotes the polynomial order), w is a weight associated to the family of

Adjoint error estimators

Adjoint error estimators are goal-oriented since they aim at better computing a specific target value, in contrast to traditional a priori error estimators. In this section, the method for computing the adjoint error estimators for the SEM is presented following the book by Bangerth and Rannacher [19] and their dual-weighted residual estimators. So far, only the steady formulation has been considered. The method combines local information with a global adjoint solution to the problem and gives

Refinement strategy

The selection of elements to be refined or coarsened relies on the error estimators. Several methods exist for refinement, such as error balancing, fixed-error reduction, or fixed-rate strategies [19]. Given the exponential decay of our estimators, an easy and efficient strategy is to refine all elements whose local error is above a given fraction of the maximum local error. Since only steady simulations are considered, no coarsening operation is performed. Therefore, the refinement criterion

Results and discussion

Adaptive mesh refinement is applied to three test cases: the flow inside a 2D lid-driven cavity, the 2D flow past a cylinder, and the flow inside a 3D lid-driven cavity whose lid is oriented by 30. In each configuration, the Reynolds number is chosen sufficiently low such that the flows are steady. For the adjoint error estimators, the output quantity is always the drag on the surface of interest, namely, the lid or the surface of the cylinder.

Conclusions

Adjoint error estimators have been developed for the SEM, implemented in Nek5000 and applied to steady flows. The estimators have been combined with an h-refinement method for goal-oriented mesh optimization. The mesh refinement tools operate by local quadtree (2D) or octree (3D) splitting, while keeping the polynomial order of the spectral expansion constant over the whole domain. Unstructured grids are supported and refinement can be applied on a single element, which can be deformed and

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Acknowledgments

We thank Niclas Jansson for sharing his expertise on adjoint error estimators.

This work was supported by a European Commission Horizon 2020 project grant entitled “ExaFLOW: Enabling Exascale Fluid Dynamics Simulations” (grant reference 671571). Additional financial support was provided by the Knut and Alice Wallenberg (KAW) Foundation via the Wallenberg Academy Fellow (WAF ) program (under grant numbers KAW 2013.0172 and KAW 2018.0151). This material is based upon work supported by the U.S.

References (51)

  • A. Peplinski et al.

    Parallel performance of h-type adaptive mesh refinement for Nek5000

    Proceedings of the exascale applications and software conference 2016, Stockholm, Sweden, April 26–29, 2016

    (2016)
  • Karypis G, Kumar V. MeTis: Unstructured Graph Partitioning and Sparse Matrix Ordering System, Version 4.0....
  • V. Citro et al.

    Efficient stabilization and acceleration of numerical simulation of fluid flows by residual recombination

    J Comput Phys

    (2017)
  • C.-H. Bruneau et al.

    New bench-mark results for the 2D lid-driven cavity problem

    Computational fluid dynamics 2002: proceedings of the second international conference on computational fluid dynamics, ICCFD, Sydney, Australia, 15–19 July 2002

    (2003)
  • P. Moin et al.

    DIRECT NUMERICAL SIMULATION: A tool in turbulence research

    Annu Rev Fluid Mech

    (1998)
  • K.T. Mandli et al.

    Clawpack: building an open source ecosystem for solving hyperbolic PDEs

    PeerJ Comput Sci

    (2016)
  • M. Adams et al.

    Chombo software package for AMR applications – design document

    Tech. Rep. LBNL-6616E

    (2013)
  • R. Anderson et al.

    SAMRAI concepts and software design

    Tech. Rep. LLNL-SM-617092-DRAFT

    (2013)
  • D. McRae

    r-refinement grid adaptation algorithms and issues

    Comput Methods Appl Mech Eng

    (2000)
  • G.W. Kruse

    Parallel nonconforming spectral element solution of the incompressible Navier-Stokes equations in three dimensions

    (1997)
  • D. Ekelschot et al.

    A p-adaptation method for compressible flow problems using a goal-based error indicator

    Comput Struct

    (2017)
  • G. Alzetta et al.

    The deal.II library, version 9.0

    J Numer Math

    (2018)
  • I. Babuška et al.

    Error estimates for adaptive finite element computations

    SIAM J Numer Anal

    (1978)
  • M. Ainsworth et al.

    A posteriori error estimation in finite element analysis

    Comput Methods Appl Mech Eng

    (1997)
  • T. Grätsch et al.

    A posteriori error estimation techniques in practical finite element analysis

    Comput Struct

    (2005)
  • Cited by (23)

    • Error-driven adaptive mesh refinement for unsteady turbulent flows in spectral-element simulations

      2023, Computers and Fluids
      Citation Excerpt :

      This estimator has been used and validated in several previous works to optimally predict integral quantities of interest [20–24]. We have shown in previous work on steady simulations that adjoint error estimator is preferred for flows with a strongly convective nature, where errors and perturbations are transported with the flow [3]. We wish to generalize these findings to unsteady and turbulent cases.

    • Numerical algorithm based on regularized equations for incompressible flow modeling and its implementation in OpenFOAM

      2022, Computer Physics Communications
      Citation Excerpt :

      Details of the QHD time-advancement algorithm and its implementation as the QHDFoam solver based on the OpenFOAM computational library program are presented in Section 4. Section 5 contains the results of solver verification and validation, as well as a comparison of QHD technique with the PISO approach and the spectral element method (program Nek5000 [33,34]). The conclusion Section summarizes distinctive features of the QHD algorithm implementation and results of its application to mentioned above flow problems.

    View all citing articles on Scopus
    View full text