Adaptive mesh refinement for steady flows in Nek5000
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 and the three-dimensional flow past a square cylinder at . 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 and around two side-by-side square cylinders at . 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 a two-dimensional flow past a cylinder at and a three-dimensional flow inside a lid-driven cavity at 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 bywhere 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)
Mesh adaptation strategies for problems in fluid dynamics
Finite Elem Anal Des
(1997)- et al.
Nonconforming mortar element methods: application to spectral discretizations
Proceedings of the 2nd international conference on domain decomposition methods
(1988) - et al.
p4est: scalable algorithms for parallel adaptive mesh refinement on forests of octrees
SIAM J Sci Comput
(2011) A posteriori error estimators for adaptive spectral element techniques
- et al.
An error indicator for finite difference methods using spectral techniques with application to aerofoil simulation
Comput Fluids
(2018) - et al.
Adaptive finite element methods in computational mechanics
Comput Methods Appl Mech Eng
(1992) - et al.
Adaptive mesh refinement for hyperbolic partial differential equations
J Comput Phys
(1984) - et al.
Three-dimensional adaptive mesh refinement for hyperbolic conservation laws
SIAM J Sci Comput
(1994) - et al.
FLASH: An adaptive mesh hydrodynamics code for modeling astrophysical thermonuclear flashes
Astrophys J Suppl Ser
(2000) - Moxey D, Cantwell C, Vyzamal M, Offermans N, Jansson N, Peplinski A, et al. D1.2 – initial proof-of-concept formulation...
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
Efficient stabilization and acceleration of numerical simulation of fluid flows by residual recombination
J Comput Phys
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
DIRECT NUMERICAL SIMULATION: A tool in turbulence research
Annu Rev Fluid Mech
Clawpack: building an open source ecosystem for solving hyperbolic PDEs
PeerJ Comput Sci
Chombo software package for AMR applications – design document
Tech. Rep. LBNL-6616E
SAMRAI concepts and software design
Tech. Rep. LLNL-SM-617092-DRAFT
r-refinement grid adaptation algorithms and issues
Comput Methods Appl Mech Eng
Parallel nonconforming spectral element solution of the incompressible Navier-Stokes equations in three dimensions
A p-adaptation method for compressible flow problems using a goal-based error indicator
Comput Struct
The deal.II library, version 9.0
J Numer Math
Error estimates for adaptive finite element computations
SIAM J Numer Anal
A posteriori error estimation in finite element analysis
Comput Methods Appl Mech Eng
A posteriori error estimation techniques in practical finite element analysis
Comput Struct
Cited by (23)
Error-driven adaptive mesh refinement for unsteady turbulent flows in spectral-element simulations
2023, Computers and FluidsCitation 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 CommunicationsCitation 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.
Applying Bayesian optimization with Gaussian process regression to computational fluid dynamics problems
2022, Journal of Computational PhysicsThe flow around a stepped cylinder with turbulent wake and stable shear layer
2023, Journal of Fluid MechanicsNon-iterative vortex-based smearing correction for the actuator line method
2023, Journal of Fluid Mechanics