an adaptive multilevel multigrid formulation for cartesian hierarchical grid methods

23
An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods Daniel Hartmann * , Matthias Meinke, Wolfgang Schro ¨der Institute of Aerodynamics, RWTH Aachen University, Wu ¨ llnerstr. zw. 5 u. 7, 52062 Aachen, Germany Received 1 December 2006; received in revised form 15 June 2007; accepted 27 June 2007 Available online 15 December 2007 Abstract A Cartesian grid method with adaptive mesh refinement and multigrid acceleration is presented for the compressible Navier–Stokes equations. Cut cells are used to represent boundaries on the Cartesian grid, while ghost cells are introduced to facilitate the implemen- tation of boundary conditions. A cell-tree data structure is used to organize the grid cells in a hierarchical manner. Cells of all refinement levels are present in this data structure such that grid level changes as they are required in a multigrid context do not have to be carried out explicitly. Adaptive mesh refinement is introduced using phenomenon-based sensors. The application of the multilevel method in conjunction with the Cartesian cut-cell method to problems with curved boundaries is described in detail. A 5-step Runge–Kutta mul- tigrid scheme with local time stepping is used for steady problems and also for the inner integration within a dual time-stepping method for unsteady problems. The inefficiency of customary multigrid methods on Cartesian grids with embedded boundaries requires a new multilevel concept for this application, which is introduced in this paper. This new concept is based on the following novelties: a formu- lation of a multigrid method for Cartesian hierarchical grid methods, the concept of averaged control volumes, and a mesh adaptation strategy allowing to directly control the number of refined and coarsened cells. Ó 2007 Elsevier Ltd. All rights reserved. 1. Introduction In the last two decades, Cartesian grid methods to solve the Euler and Navier–Stokes equations have gained in pop- ularity since they offer the possibility to automatically gen- erate the grid and thus make the simulation of flows with complex embedded boundaries very efficiently accessible [1–4]. Furthermore, the geometric simplicity of the mesh facilitates adaptive mesh refinement (AMR) [5,6] during the solution process such that detailed a priori knowledge of the flow phenomena is not mandatory to solve the problem. A number of AMR techniques for Cartesian grids have been proposed in the literature, mainly for the Euler equa- tions [5–9]. To take full advantage of AMR, cells are usu- ally not deleted after refinement such that a coarsening operation can be performed without (re)creating the coarse cells. On adaptively refined grids, not only irregular cells at the boundary require a more elaborate approach in terms of an accurate estimate of the flux through the cell faces, but also all refined cells or those that are adjacent to refined cells. This requires more complex reconstruction tech- niques than are necessary on unrefined structured grids. Furthermore, the speed of convergence is governed by the finely resolved areas of the grid even when local time stepping is used. To remedy this drawback multilevel meth- ods are used, which ideally exhibit grid-independent rates of convergence. An AMR data structure, where all grid lev- els are present, is especially suitable for multilevel methods, since multigrid can be applied without creating grids at dif- ferent levels during the solution. Multilevel methods are known to be one of the fastest iterative solution techniques [10,11]. They have been widely used to solve the Euler and Navier–Stokes equations. How- ever, while numerous publications exist on the application 0045-7930/$ - see front matter Ó 2007 Elsevier Ltd. All rights reserved. doi:10.1016/j.compfluid.2007.06.007 * Corresponding author. Tel.: +49 241 80 90396; fax: +49 241 80 92257. E-mail address: offi[email protected] (D. Hartmann). www.elsevier.com/locate/compfluid Available online at www.sciencedirect.com Computers & Fluids 37 (2008) 1103–1125

Upload: daniel-hartmann

Post on 26-Jun-2016

220 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

Available online at www.sciencedirect.com

www.elsevier.com/locate/compfluid

Computers & Fluids 37 (2008) 1103–1125

An adaptive multilevel multigrid formulation for Cartesianhierarchical grid methods

Daniel Hartmann *, Matthias Meinke, Wolfgang Schroder

Institute of Aerodynamics, RWTH Aachen University, Wullnerstr. zw. 5 u. 7, 52062 Aachen, Germany

Received 1 December 2006; received in revised form 15 June 2007; accepted 27 June 2007Available online 15 December 2007

Abstract

A Cartesian grid method with adaptive mesh refinement and multigrid acceleration is presented for the compressible Navier–Stokesequations. Cut cells are used to represent boundaries on the Cartesian grid, while ghost cells are introduced to facilitate the implemen-tation of boundary conditions. A cell-tree data structure is used to organize the grid cells in a hierarchical manner. Cells of all refinementlevels are present in this data structure such that grid level changes as they are required in a multigrid context do not have to be carriedout explicitly. Adaptive mesh refinement is introduced using phenomenon-based sensors. The application of the multilevel method inconjunction with the Cartesian cut-cell method to problems with curved boundaries is described in detail. A 5-step Runge–Kutta mul-tigrid scheme with local time stepping is used for steady problems and also for the inner integration within a dual time-stepping methodfor unsteady problems. The inefficiency of customary multigrid methods on Cartesian grids with embedded boundaries requires a newmultilevel concept for this application, which is introduced in this paper. This new concept is based on the following novelties: a formu-lation of a multigrid method for Cartesian hierarchical grid methods, the concept of averaged control volumes, and a mesh adaptationstrategy allowing to directly control the number of refined and coarsened cells.� 2007 Elsevier Ltd. All rights reserved.

1. Introduction

In the last two decades, Cartesian grid methods to solvethe Euler and Navier–Stokes equations have gained in pop-ularity since they offer the possibility to automatically gen-erate the grid and thus make the simulation of flows withcomplex embedded boundaries very efficiently accessible[1–4]. Furthermore, the geometric simplicity of the meshfacilitates adaptive mesh refinement (AMR) [5,6] duringthe solution process such that detailed a priori knowledgeof the flow phenomena is not mandatory to solve theproblem.

A number of AMR techniques for Cartesian grids havebeen proposed in the literature, mainly for the Euler equa-tions [5–9]. To take full advantage of AMR, cells are usu-ally not deleted after refinement such that a coarsening

0045-7930/$ - see front matter � 2007 Elsevier Ltd. All rights reserved.

doi:10.1016/j.compfluid.2007.06.007

* Corresponding author. Tel.: +49 241 80 90396; fax: +49 241 80 92257.E-mail address: [email protected] (D. Hartmann).

operation can be performed without (re)creating the coarsecells. On adaptively refined grids, not only irregular cells atthe boundary require a more elaborate approach in termsof an accurate estimate of the flux through the cell faces,but also all refined cells or those that are adjacent to refinedcells. This requires more complex reconstruction tech-niques than are necessary on unrefined structured grids.Furthermore, the speed of convergence is governed bythe finely resolved areas of the grid even when local timestepping is used. To remedy this drawback multilevel meth-ods are used, which ideally exhibit grid-independent ratesof convergence. An AMR data structure, where all grid lev-els are present, is especially suitable for multilevel methods,since multigrid can be applied without creating grids at dif-ferent levels during the solution.

Multilevel methods are known to be one of the fastestiterative solution techniques [10,11]. They have been widelyused to solve the Euler and Navier–Stokes equations. How-ever, while numerous publications exist on the application

Page 2: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

1104 D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125

of multigrid acceleration to body-fitted grids, very few arti-cles are known in which multigrid is applied to non-bound-ary-conforming Cartesian grids [12,13]. In this context,multigrid has been applied to solve the Euler equations[13], the heat equation [14,15], and the Poisson equationfor incompressible flows [12,16,15]. To the best of theauthors’ knowledge, multigrid applied to the full compress-ible Navier–Stokes equations in conjunction with a Carte-sian grid method has not been reported, yet.

One of the challenges of Cartesian grid methods is themodeling of the embedded boundaries which do not coin-cide with grid lines. Depending on how the boundary con-ditions are imposed on the Cartesian grid, one can identifythree techniques.

The immersed-boundary method introduces forcingterms into the governing equations to enforce the boundaryconditions [17,12,18,19]. Its primary disadvantage is thatthe solution on the immersed boundary is smeared out tothe order of the local cell size, i.e., a sharp fluid-to-bound-ary interface cannot be generated [17].

In a hybrid Cartesian grid/immersed-boundary method[20–23] the variable values of cells at the embedded bound-aries are interpolated from surrounding cells and theenforced boundary condition. A number of variations ofthese immersed boundary methods are proposed in [24–26,4].

The most straightforward method is the Cartesian cut-cell method, where the control volumes at the boundariesare reshaped [1,27,3,28]. This is done by splitting all cellfaces, which intersect the embedded boundary at the cutpoints, and by a subsequent substitution of all cell facesand face parts outside the integration domain by a cell–body interface, which linearly approximates the boundarysurface. Thus, partial cell volumes and partial cell facesfor cells on the boundaries are obtained. Using this tech-nique, sharp interfaces on the embedded boundaries aregenerated while eliminating the need for interpolation. Fur-thermore, the application of adaptively refined grids doesnot complicate the implementation of this technique. How-ever, it is a must to remove all emerging small cut cells,which otherwise diminish the stability of the numericalintegration.

A conservative approach proposed by Ye et al. [1] is tomerge small cells with existing Cartesian neighbor cells.However, especially for structured codes the cell mergingprocess introduces additional complexity into the flux com-putations, since the computational stencil for all cells adja-cent to the merged cell and for the merged cell itselfbecomes different to that of regular internal cells. There-fore, the calculation of the flux requires an interpolationof cell variables and variable gradients at the cell faces.Ye et al. [1] suggest interpolation schemes for the irregularcells around the boundary which conserve the second-orderaccuracy of the solver also on the boundary. Kirkpatricket al. [27] link small cells and corresponding master cellsto form a master–slave pair. The cell centers of both theslave and the master cells are shifted to an almost likewise

common location. The difference between both approachesis that cell merging implies a substitution of the small cell,while cell linking retains both the master and the small cell,i.e., fluxes can be computed separately for both cells as isthe case for standard interface cells.

In this paper, a Cartesian grid method with AMR andmultigrid for the Navier–Stokes equations in compressibleform is presented. Various multigrid methods exploitingthe dual time-stepping idea have been proposed for thetime-dependent Navier–Stokes equations [29,30]. We solvethese equations using the dual time-stepping scheme pro-posed by Jameson [30], based on a 5-step Runge–Kuttamultigrid scheme with local time stepping. A variant ofthe AUSM scheme is used to compute the convective flux[31,32]. At far field boundaries a sponge layer [33,34] for-mulated for pressure and density is used. In the AMRmethod phenomenon-based sensors are used and the cellson different levels of refinement are organized in a hierar-chical cell-tree data structure. Embedded boundaries arerepresented by cut cells in combination with ghost cells,while the small cell problem is resolved by using a mixedcell-merging/cell-linking approach, which does not enlargethe complexity of the flux computation. The concept ofaveraged control volumes is introduced, which is employedfor the cell merging process and for the volume-conservinggeneration of coarse grids in the multilevel method. Sincestandard multigrid methods designed for structured meshesare inefficient when applied to Cartesian grid methods withembedded boundaries, we propose a new formulation of amultilevel method for Cartesian hierarchical grid methodsbased on the concept of averaged control volumes. Theapplication of this multilevel method to a Cartesian cut-cellmethod is discussed in detail, before results of numericalexamples are reported to validate the novel method.

The organization of the paper is as follows. In Section 2the governing equations are given, in Section 3 the Carte-sian cut-cell method is described and the AMR methodand the concept of averaged control volumes are intro-duced. The discretization is given in Section 4, while in Sec-tion 5 a multilevel formulation for Cartesian hierarchicalgrid methods is developed. In Section 6, the overall algo-rithm is summarized in a high-level description. Finally,results are presented in Section 7 and in Section 8 the find-ings of this paper are summarized.

2. Governing equations

Let the density be denoted by ., the Cartesian compo-nents of the velocity vector v in the xf directions of x begiven by vf (f ¼ f0; 1g), and the total specific energy andthe pressure be represented by E ¼ eþ v2

2and p, respec-

tively. The quantity e denotes the specific internal energy.We consider the compressible Navier–Stokes equations intheir non-dimensional form, which can be written as

oQ

otþ $H ¼ 0; ð1Þ

Page 3: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

Fig. 1. Sequence of hierarchical locally refined grids Xk�1, Xk , and Xkþ1.The grids comprise cells at different levels of refinement and are subsets ofa common hierarchical cell tree.

D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125 1105

with Q ¼ ½.; .v; .E�T being the vector of the conservativevariables and H ¼ ½F;G�T being the flux vector containingan inviscid part Hi and a viscous part Hv

H ¼ Hi �Hv ¼.v

.vvþ p

vð.E þ pÞ

0B@1CAþ 1

Re

0

�s

�svþ q

0B@1CA; ð2Þ

where q contains the heat conduction terms. The Reynoldsnumber is given by Re ¼ .1v1l

l1, where l is a characteristic

length. The dynamic viscosity l is computed using Suther-land’s law. We assume a Newtonian fluid such that thecomponents sij of the second-rank stress tensor �s can beformulated by

sij ¼ �2lSij þ2

3lSijdij; ð3Þ

where Sij ¼ 12

ovioxjþ ovj

oxi

� �. The vector of heat conduction q is

accounted for by Fourier’s law

q ¼ � kPrðc� 1Þ$T ; ð4Þ

where T is the static temperature and c is the ratio of spe-cific heats. The Prandtl number Pr ¼ l1cp

k1contains the spe-

cific heat at constant pressure cp. Finally, thermalconductivity is evaluated from kðT Þ ¼ lðT Þ, which holdsfor a constant Prandtl number.

Using the Gauss theorem, we obtain the integral form ofthe Navier–Stokes equationsZ

V

oQ

otdV þ

ZA

HndA ¼ 0; ð5Þ

where n is the outward normal vector on the surface dA.

Fig. 2. Notation of cell and surface superscripts, index numbering fromleft to right and from bottom to top. Open circles: cell centers, the size ofthe circles indicates the refinement level; open squares: surface centroids;surface superscripts are given for cell Cn1;2

r only.

3. Cartesian grid formulation

Let the physical domain X be represented by a numberof multilevel composite grids Xk composed of square Carte-sian cells with k denoting the level of refinement of the fin-est grid cell on Xk, Fig. 1. Although we refer to squareCartesian cells, the multilevel Cartesian grid method pre-sented in this paper can be applied to grids with arbitrarilystretched rectangular cells. Furthermore, let k denote themaximum level of refinement, 0 6 k 6 k, such that Xk isthe finest grid. We consider a two-dimensional space, i.e.,D ¼ 2, and the space directions f are denoted by 0 and 1.The cell centered finite-volume discretization of the hierar-chical, locally refined grids Xk is non-uniform, i.e., controlvolumes or cells of different size are present. The size of acell is determined by its level of refinement r, while r

increases with decreasing cell size. Then, the side lengthof a surface of a cell Cn

r at level r can be determined byhn

r ¼h0

2r with h0 being the side length of a surface of a cellat level 0. The cell at level 0 completely covers X and isthe root of the cell-tree data structure, which is used tohierarchically organize all cells. In this hierarchical cell-tree

data structure each cell is stored only once although it mayappear on several grids Xk.

We refer to cells using the running index n; n 2Nk,where Nk is the set of indices of all cells on Xk. Relatedparent and child cells are identified as shown in Fig. 2.Given the parent cell with index n, the indices of its chil-dren and grandchildren are denoted by na and na;b, respec-tively, with a; b ¼ f0; . . . ; 3g according to Fig. 2. Thus, thegrids Xk discretize X using a set of non-overlapping controlvolumes on different levels of refinement, Fig. 1,

Page 4: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

Fig. 3. Storage of and access to neighbor cells. Bold arrows: storedneighbor information; dashed arrows: stored parent-child information;circles: cell centers.

1106 D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125

Xk ¼ fCnr j 8n 2Nkg; ð6Þ

and with r0 being the refinement level of the largest cell onXk, where r0 6 k,

limhr0!0

Xk ¼ X: ð7Þ

Cells which are cut by the boundary are denoted boundarycells Cn

r , while all other cells inside the computational do-main are denoted internal cells. External cells outside Xare discarded. The cell center of a cell Cn

r is denoted byxn

c and its volume by V n. Furthermore, we introduce thevolume fraction

xn ¼ V n

ðhnÞD; ð8Þ

which equals 1 for all internal cells. Boundary cells are re-shaped such that for them V n 6¼ ðhnÞD. Details of thereshaping of boundary cells are given in Section 3.4.

The evaluation of fluxes is performed by a surface-basedconcept using interpolated values and gradients of the statevariables at the surface centroids. A surface Sm is createdfor each interface between two cells such that each controlvolume is enclosed by a set of surfaces, which we define forinternal cells as

rn ¼ fSm j 8Sm 2 oCnrg: ð9Þ

For boundary cells, we define the set of surfaces

rn ¼ fSm;Cn j 8Sm;Cn 2 oCnrg; ð10Þ

which contains the boundary surface Cn being unique foreach boundary cell. The centroid and the area of a surfaceSm are denoted by xm

s and Am, respectively, and nm ¼½nm

0 ; nm1 �

T denotes the outward normal vector on Sm.The overall flux computation for every control volume is

carried out by sweeping once over all surfaces and distrib-uting the corresponding fluxes to the cells adjacent to thesurfaces. A surface-based data structure is especially suit-able for adaptively refined grids, since coarse-to-fine gridinterfaces do not complicate the cell data structure.

The physical domain is discretized using a Cartesian gridgenerator, which automatically generates and adapts thegrid to the solution. The development of a Cartesian gridbegins with the generation of an isotropic start grid, ontowhich the geometry is mapped. To this end, the points ofintersection between the geometry and the grid cells aredetermined and boundary cells are defined. The isotropicgrid is further refined prior to the solution in the vicinityof specified boundaries.

A grid smoothing is performed after each grid adapta-tion during the solution and also after the initial geometri-cal refinement to maintain grid quality. We allowneighboring cells to have a maximum difference in refine-ment levels of 1. Details on automatic Cartesian grid gen-eration are given in [35].

After the grid is generated, all geometric informationthat is required for the computation is held by boundarycells. The two-dimensional boundary line is linearly

approximated along the computed cut points. For twospace dimensions, each boundary cell holds exactly twocut points, i.e., a linear boundary segment.

3.1. Data structure

As mentioned above, we employ a hierarchical cell-treedata structure, which is based on parent-child relations[36,37]. In terms of the data structure each cell can be sep-arately refined or coarsened, regardless of the refinementlevel of surrounding cells. In the process of cell refinementa cell is split into child cells and becomes a parent of these.We will refer to child cells as underlying cells of an overly-ing parent cell. Unrefined cells are referred to as leaf cells.To be able to traverse vertically through the tree each cell isrequired to store pointers to its parent cell and existingchild cells and the number of these child cells. The neighborinformation is stored such that it is consistent in the hierar-chical levels of the cell-tree data structure. That is, neigh-bor pointers are only established between cells on thesame refinement level. This is indicated by the bold arrowsin Fig. 3. Hence, there is a maximum of 2D stored neigh-bors for each cell. The number of neighbors in a specificdirection can be either 0 or 1 and is also stored. Based onthe existing neighbor and parent-child relations, Fig. 3,neighbor relations between cells on a different level ofrefinement can be efficiently determined. Provided thatthe difference in refinement levels of neighbor cells is notgreater than 1, this is achieved using the algorithm givenbelow. Its extension to the case of neighbor cells on arbi-trary levels of refinement is straightforward, but will notbe considered in the following.

Page 5: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125 1107

For each considered cell Cnar at level r, 8Cna

r 2 Xk. fFor each direction f. f

If a neighbor pointer is stored in the f direction, then

f identify the neighbor CðnþiÞbr in the f direction.

If CðnþiÞbr is not a parent cell or r ¼ k, then

fbreak. CðnþiÞbr 2 Xk is the neighbor.g

Else,f determine those child cells C

ðnþiÞb;crþ1 which are

neighbors of Cnar .gg

Else,f identify the parent cell Cn

r�1 of Cnar .

If a neighbor pointer is stored in the f direction

for Cnr�1, then g

identify the neighbor Cnþjr�1 in the f direction.

Cnþjr�1 2 Xk is the neighbor.g

Else,fCna

r faces a boundary in the f direction so that

no neighbor cell exists.ggggThe determination of neighborship between cells on dif-

ferent levels of refinement is performed using a coordinate-based algorithm, which defines the relative location of childcells with respect to their parent cells. It is clear from theabove description that the cell-tree data structure is com-pletely stored from the leaf cells on the highest level ofrefinement all the way up to the cells of the isotropic startgrid, i.e., parent cells are not deleted from the datastructure.

Compared against a fully unstructured data structure[16], where all neighbors are explicitly stored, the presentlyused data structure possesses a small computational over-head, which can be avoided by regenerating and storingthe neighborship information with the algorithm aboveafter each mesh adaptation. Nevertheless, the current datastructure greatly simplifies the establishment of neighborrelations during grid adaptation. Additionally, levelchanges can be performed without any changes of neighborpointers. In a data structure which is consistent within itshierarchical levels all cells Cn

r 2 Xk of an arbitrary grid Xk

can be identified directly by requiring for each cell thateither

(1) r 6 k, and Cnr is not a parent cell or

(2) r ¼ k.

Hence, there is no need to explicitly store the connectiv-ity between grids and cells, since it can be implicitly estab-lished using the conditions given above.

Unlike the fully unstructured approach the hierarchi-cal consistency enables a static cell-tree data structure,since the number of neighbors stored does not exceed 2D

regardless of the mesh topology. A static data structureis especially beneficial in terms of memory management,since the memory required for a prescribed maximumnumber of cells can be allocated prior to the computa-tion and does not have to be changed during grid refine-ment.

3.2. Adaptive mesh refinement

A phenomenon-based approach to mesh adaptation isapplied, i.e., sensors are employed to detect and localizephysical flow phenomena, and hereafter, a grid refinementis initiated where appropriate. We use the sensors

sc ¼j $� v j ðhrÞ3=2;

se ¼j $S j ðhrÞ3=2 �j $p � a2$. j ðhrÞ3=2;

(ð11Þ

which are weighted by the cell length hr to take into ac-count the present cell refinement [38]. The exponent 3

2of

the geometric weighting factor is chosen according to[39]. The quantity S can be considered a measure of entro-py and sc is proportional to the magnitude of the vorticityvector x, used to detect shear layers, while se detects phe-nomena that generate entropy gradients.

Mesh refinement is carried out on the finest grid Xk, i.e.,only leaf cells, which however, may occur on different levelsof refinement, are taken into account. As noted above,there is no need to explicitly update the cell-grid connectiv-ity after a mesh adaptation. The sensors si; i 2 fc; eg, arecomputed at given time steps or on specified conditionsfor the cells Cn

k; 8Cnk 2 Xk, and refinement or coarsening

of a cell Cnk are initiated if sn

i > si;u or sni < si;l, respectively,

where sni is the sensor value which is computed for cell Cn

k.The quantities si;u and si;l are the upper and lower sensorlimits, respectively. To control the number of cells whichare added or deleted by the adaptation process the valuesof si;u and si;l are determined according to prescribed frac-tions of cells fr and fc that should be refined or coarsened,respectively. The fractions fr;i and fc;i can be specified sep-arately for each sensor and will be referred to as adaptationparameters in the following. The first step in computing si;u

and si;l is the computation of a distribution function of thesensor values of all cells. A discrete distribution functionP iðst

iÞ for T sensor value intervals of si with a constantspacing Dsi is given by

P iðstiÞ ¼

Ckst

i

Ck ; 0 < t 6 T ; ð12Þ

where Ckst

iis the number of cells with st

i � Dsi2< si 6 st

i þ Dsi2

and

TDsi ¼ sþi � s�i : ð13Þ

The maximum and minimum sensor values are denoted bysþi and s�i , respectively. As shown in Fig. 4, let the intervalsst�1

i and sti as well as st0

i and st0�1i be given such that

Pt�1

j¼0

P iðsjiÞ 6 fc;i <

Pt

j¼0

P iðsjiÞ;

PTj¼t0

P iðsjiÞ 6 fr;i <

PTj¼t0�1

P iðsjiÞ:

8>>><>>>: ð14Þ

Linearly interpolating P iðsiÞ in the intervals st�1i 6 si 6 st

i

and st0i P si P st0�1

i and subsequent extrapolation to theintervals st

i < si < sti þ Dsi

2and st0�1

i > si > st0�1i � Dsi

2yields

Page 6: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

Fig. 4. Determination of the lower and upper sensor limit si;l and si;u. Summarizing the values of P i at the open squares yields the adaptation parametersfc;i and fr;i, respectively.

1108 D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125

piðvÞ ¼P iðst

iÞ�P iðst�1i Þ

Dsivþ P iðst�1

i Þ; Dsi26 v < 3Dsi

2;

piðv0Þ ¼P iðst0�1

i Þ�P iðst0i Þ

Dsiv0 þ P iðst0

i Þ; Dsi26 v0 < 3Dsi

2:

8<: ð15Þ

Thus, the limit sensor values si;u and si;l can be determinedas

si;l ¼ st�1i þ si;l;

si;u ¼ st0i � si;u:

(ð16Þ

Finally, si;l and si;u are computed byPt�1

j¼1

P iðsjiÞ þ

R si;l

v¼Dsi2

piðvÞdv ¼ fc;i;

PTj¼t0

P iðsjiÞ þ

R si;u

v0¼Dsi2

piðv0Þdv0 ¼ fr;i;

8>>><>>>: ð17Þ

where the integral on the left-hand side is solved using Eq.(15), see Fig. 4.

The adaptation process can be carried out after a timestep is completed. Several criteria can be used to determinewhether the adaptation procedure should be started. Weemploy a residual-based criterion for steady-state prob-lems, i.e., the grid adaptation is initiated every time a spec-ified residual convergence limit is reached up to amaximum number of adaptation steps. For unsteady prob-lems, we use a time step based criterion for unsteady flowcases, such that the grid is adapted in regular time stepintervals.

If a cell is flagged for adaptation, the routine for cellrefinement or that for cell coarsening is used. Whether acell is actually refined or coarsened depends on its currentlevel of refinement. Cell refinement is permitted unless thecreated child cells are at a level of refinement greater thanthe maximum allowed. The state variables of the newly cre-ated cells are then injected from the parent cell. A cell canonly be coarsened if its parent cell can be identified, i.e., the

considered cell is on a higher level of refinement than thoseon the isotropic initial grid. Furthermore, all children ofthe identified parent cell need to be leaf cells. The coarsen-ing is then conducted in such a way that all children of aparent cell are deleted provided at least one of them hasbeen flagged for coarsening. The state variables of the par-ent cell are computed as a volume-weighted average of thevariable values of its child cells. Details of this procedure interms of boundary cells and small cells are given in thedescription of the restriction operators of the multilevelmethod, Section 5.1 (cf. Eq. (52)).

As aforementioned, the final step of the AMR method isthe grid smoothing process, in which cells are refined wherenecessary to ensure a smooth transition from coarse to finecells and vice versa.

3.3. Evaluation of surface fluxes

A finite-volume discretization of the Navier–Stokesequations following Eq. (5) requires the integration overthe surfaces of each cell. For the inviscid flux Hi an integra-tion over variable values is necessary, while the viscous fluxHv is computed by integrating the derivative of variablesnormal to the surface. In a Cartesian frame of referencethese surface normals always point in one of the Cartesianspace directions e0 ¼ ½1; 0�T or e1 ¼ ½0; 1�T. Hence, we needto determine both state variables of Qm as well as their gra-dients $Qm at the centroids of each surface Sm. Since Q issolved for with a cell-centered scheme, the surface valuescan be computed using the gradient $Qn at the cell center.The same applies to the gradient at the surface centroid,which can be computed using $Qn and $2Qn. For a genericquantity /, which may represent a variable as well as thegradient of a variable, we obtain

/ðxms Þ

n ¼ /ðxncÞ þ $/nDxn

m; ð18Þ

Page 7: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125 1109

where Dxnm ¼ xm

s � xnc . The quantity / is finally evaluated at

the centroid of the surface Sm, which is the interface be-tween two cells Cn

r and Cnþir0

/ðxms Þ ¼

/ðxms Þ

n þ /ðxms Þ

nþi

2: ð19Þ

The gradients at the cell center are evaluated by means of asecond-order accurate least-squares reconstruction scheme[40]. Fig. 5 shows the neighbors used for the reconstructionof the gradient at the cell center for both an internal celland a boundary cell. To be able to evaluate the gradientin two space dimensions to second-order accuracy, a stencilof at least four neighbor cells is required. This is always ful-filled for internal cells, which have at least one direct neigh-bor at each of their four faces. Additionally, the diagonalneighbors can be added to the stencil, as indicated by thedashed arrows in Fig. 5a. The stencil for a boundary cellincludes its assigned ghost cell, its internal neighbor cell,and boundary neighbor cells as well as their assigned ghostcells and internal neighbor cells.

3.4. Boundary cells

In Cartesian cut-cell approaches boundary cells are gen-erated to represent the boundaries. These boundary cellsare reshaped such that the entire cell, i.e., the control vol-ume, lies inside the domain of integration. Depending onhow the geometric boundaries cut the boundary cell, wecan identify a number of cut faces and possibly cell faceswhich lie completely outside X, which we denote externalfaces. In the following, we assume that two cut pointsand thus two cut faces are associated with each boundarycell. Faces being completely inside X are denoted internalfaces. For the reshaped control volume all internal facesof the original cell are retained, while all external facesare discarded. Cut faces are split at the cut points, whilethe internal part of the face is kept and the external partdeleted. Depending on the number of neighbors in each

Fig. 5. Neighbor cells used for the reconstruction procedure for (a) internal celltriangles: ghost cell centers.

direction, surfaces are generated from the obtained facessuch that for each cell interface a surface is created. Inaddition, a boundary surface is added, which connectsthe cut points.

The volume V n ¼ V nb of a reshaped boundary cell Cn

r isthat enclosed by rn, and its cell center is computed accord-ing to

xnc ¼

1

V nb

ZV n

b

xdV : ð20Þ

The coordinate shift Dxnc ¼ xn

c � xnc is stored for each

boundary cell such that the original grid cell center xnc

can be recomputed (cf. Fig. 6). For example, xnc is required

to determine the location of child cells within their parentcells, which in turn is used in the neighbor search algorithmgiven in Section 3.1. Along with the shift of the boundarycell center the reference coordinates for all state variablesare moved to the new location xn

c as well.

3.4.1. Application of boundary conditions

In general, boundary conditions can be applied bydirectly manipulating all boundary surfaces. However, thisrequires a subdivision of all surfaces into internal surfacesand boundary surfaces. To facilitate the surface flux com-putation, we introduce ghost cells on the boundaries. Eachboundary cell is assigned to exactly one ghost cell with theboundary surface as the common interface. Furthermore,we project the boundary surface into the Cartesian spacedirections and subsequently replace it by its projectionssuch that we obtain D boundary surfaces with coincidentcentroids. Hence, all outward normal vectors n point eitherin the x0 direction or in the x1 direction and a particulartreatment of boundary cell surfaces is not required forthe overall flux computation.

The introduced ghost cells are not connected to anyother cells by parent-child or neighbor relationships. Theonly interface they have is the boundary surface, which

s and (b) boundary cells. Circles: cell centers of internal and boundary cells;

Page 8: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

Fig. 6. Representation of curved boundaries using ghost cells: (a) the shift of the cell center of boundary cells; (b) the location of the ghost cell center.Symbols as in Fig. 5.

1110 D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125

connects them to the corresponding boundary cells. Theirlocation is determined by the cell center of the boundarycell xn

c as well as the centroid of the boundary surface xms .

The position is computed by

xgc ¼ xn

c þ 2ðDxnm � nmÞnm; ð21Þ

where

Dxnm ¼ xm

s � xnc : ð22Þ

That is, the ghost cell center is obtained by mirroring thecell center of the boundary cell at the boundary surface,Fig. 6. The state variables in the ghost cell center are deter-mined according to the boundary condition, which is ap-plied on the boundary surface.

Dirichlet boundary conditions Qm ¼ g1 and von Neu-mann boundary conditions oQm

onm ¼ g2 are implemented usinga boundary cell Cn

r and the corresponding ghost cell Cgr as

Qn þQg

2¼ g1; ð23Þ

and

Qg �Qn

j Dxng j¼ g2; ð24Þ

where

j Dxng j¼j xg

c � xnc j : ð25Þ

In other words, the vector of variables Qg is determinedaccording to Eqs. (23) and (24).

3.4.2. Computation of gradients on the boundary surface

The flux computation according to Eq. (19) involves thegradient $Qg ¼ ½Qg

x0;Qg

x1�T in the ghost cell center. Since

the state variables in the surface centroid are computedusing $Qg, the gradient must be computed such that Eqs.(23) and (24) hold. For the inviscid flux, where the gradientat the surface centroid is not used, we prescribe the bound-ary cell gradient in the ghost cell, which clearly satisfiesEqs. (23) and (24). For example, for the Dirichlet boundarycondition, we have from Eq. (19)

Qm ¼ Qðxms Þ

n þQðxms Þ

g

2;

where the terms on the right-hand side are determined byEq. (18). In Eq. (18), the terms $QnDxn

m and $QgDxgm can-

cel since Dxnm ¼ �Dxg

m such that we arrive at Eq. (23).The stress terms appearing in the viscous flux are com-

puted using $Qm, which is on boundary surfaces a functionof the gradients at the cell centers of the neighbor bound-ary and ghost cells. Plugging the gradient of the formerinto the corresponding ghost cells introduces a first-ordererror. Thus, for $Qm to be evaluated second-order accuratea second-order accurate expression for $Qg needs to bederived. Such an expression for the magnitude of the gradi-ent at the ghost cell center is

j $Qg j¼ Qg �Qðxms Þ

n

j xgc � xm

s j; ð26Þ

which is obtained by enforcing

Qðxms Þ

n ¼ Qðxms Þ

g: ð27Þ

In order to determine $Qg, we derive a second equation,which relates the components of $Qg to each other.

Let us introduce a local coordinate system ðnn; gnÞ foreach boundary cell Cn

r with gn being the local wall-normalcoordinate, Fig. 7. The coordinate nn coincides with theboundary surface Cn. Furthermore, we introduce theoperator

An : UðxÞ ! Uðnn; gnÞT; ð28Þ

which transforms the components of a generic vector Ufrom the Cartesian coordinate system into the locallybody-fitted frame of reference. We thus obtain the wall-parallel and wall-normal components of $Qn asAnð$QnÞ ¼ ½Qn

n;Qng�

T. Although introducing an error ofOðx0s � xm

s Þ, we choose the midpoint x0s between the bound-ary and the ghost cell for interpolation instead of estimat-ing $Qm at the surface centroid xm

s , Fig. 7, and rewrite Eqs.(26) and (27)

Page 9: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

Fig. 7. Illustration showing the point x0s where $Q is interpolated on theboundary surface. Open square: boundary surface centroid; filled square:shifted surface centroid; other symbols as in Fig. 5.

Fig. 8. Illustration showing the assignment of master cells to small cells.Open circles: original small cell centers; shaded circles: original master cellcenters; filled circles: cell center of the master–slave pair; triangles: ghostcell centers; shaded triangles indicate affiliation to the master cell, openones indicate affiliation to the small cell. The rightmost ghost cell isillustrated as shaded triangle since it is affiliated to a boundary master cell,while the other ghost cells are affiliated to small cells. The correspondingmaster cells of the latter are internal cells.

D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125 1111

j $Qg j¼ Qg �Qðx0sÞn

j xgc � x0s j

; ð29Þ

and

Qðx0sÞn ¼ Qðx0sÞ

g; ð30Þ

where j xgc � x0s j¼j gn

c j, to obtain

Qðx0sÞn ¼ ðAnÞ�1ðAnðQnÞ þ ½0;�Qn

ggnc �

TÞ;Qðx0sÞ

g ¼ ðAnÞ�1ðAnðQgÞ þ ½0;Qggg

nc �

TÞ:

(ð31Þ

Combining Eqs. (29)–(31) yields

Qgg ¼

Qg �Qðx0sÞn

xgc � x0s

; ð32Þ

and using the inverse transformation ðAnÞ�1, we can relatethe components of $Qg to each other according to

Qgx0

Qgx1

¼ nm0

nm1

; nm0;1 6¼ 0; ð33Þ

or compute the components directly

rQg ¼ ½0;Qgg�

T; nm

0 ¼ 0;

rQg ¼ ½Qgg; 0�

T; nm

1 ¼ 0:

(ð34Þ

Finally, we obtain

$Qm ¼ $Qn þ $Qg

2ð35Þ

for all boundary surfaces.Summarizing, the gradient $Qg can be obtained by

injection from the corresponding boundary cell to computethe inviscid flux. To obtain the viscous flux, we derivedEqs. (29) and (33) to determine $Qg in the general case that

nm does not point into one of the Cartesian coordinatedirections. Otherwise, the computation of $Qg reduces toEq. (34).

3.4.3. Treatment of small cells

It is natural in Cartesian cut-cell approaches, that arbi-trarily small cells may be generated. As noted in the intro-duction, removing these cells is mandatory, since theirsmall cell volume increases the stiffness of the system ofequations and may result in numerical instability. We solvethis problem with a combined cell-merging/cell-linkingapproach. To retain a consistent cell-tree data structuresmall cells are not discarded but kept as partially passivecells. This allows to undo the cell-merging/cell-linking,which is important when AMR is used and consequentlythe master–slave cell connectivity may be changed throughgrid adaptation, e.g. when a master or slave cell is coars-ened or refined, respectively. We begin by describing theidentification of a master cell for each small cell. After amaster cell is assigned to the small cell the latter becomesa slave cell. Its variable values and gradients are transferredfrom the master cell whenever the master cell values areupdated. The stencil of the latter for the least-squaresreconstruction procedure (cf. Section 3.3) is updated ascombination of the stencils of the original master cell andthe slave cell. For the following description, let us considerthe master cell eCm

r and the slave cell Csr. The former can be

an internal cell as well as a boundary cell, which is indi-cated by the tilde.

A master cell always has to be a face neighbor of theconnected slave cell and cannot be a slave cell itself. Fur-thermore, it cannot be assigned to more than one slave cell.If possible, internal cells, otherwise boundary cells are des-ignated as master cells, Fig. 8. If more than one boundary

Page 10: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

1112 D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125

cell is available in the latter case, the cell with the larger cellvolume is chosen. Small cell detection and master cellassignment is carried out individually for each grid levelafter the coarse grid cells have been constructed. Only forsimple cases, it is possible to establish a consistent mas-ter–slave cell assignment across grid levels in the sense thata master–slave cell pair on Xk underlies exactly one parentcell or one master–slave pair on Xk�1. The implications onthe application of multigrid are discussed in Section 5. Forproblems such as the steady flow around a circular cylin-der, it is important that the grid resembles the symmetryexhibited by the geometry. The master–slave cell connectiv-ity is designed such that this symmetry is preserved.

After a master–slave cell pair is established, its cell vol-ume, volume fraction, and cell center coordinates are com-puted by

V mþs ¼ V m þ V s; ð36Þxmþs ¼ xm þ xs; ð37Þ

and

xmþsc ¼ V mxm

c þ V sxsc

V m þ V s : ð38Þ

The data is copied to the slave and master cells accordingto

xmc xmþs

c ;

xsc xmþs

c ;

V m V mþs;

V s V s:

8>>><>>>:The set of surfaces of the combined master–slave pair iscomposed of

rmþs ¼ fSi; Sj j 8Si 2 rm; 8Sj 2 rsg;rm rmþs; rs ¼ ;;

�ð39Þ

and

rmþs ¼ fSi; Sj;Cmþs j 8Si 2 rm; 8Sj 2 rsg:rm rmþs; rs ¼ ;; if eCm

r is a boundary cell;

rs ¼ fCmþsg; otherwise:

8><>: ð40Þ

Note that rm and rs do not comprise the boundary surfacesof the master–slave cell pair. Hence, we retain all surfacesexcept for boundary surfaces for the master–slave cell pairand assign the set rmþs to the master cell. This requires onlyan update of the cell neighbor information of the partici-pating surfaces. The boundary surface Cmþs is assigned tothe master cell and its ghost cell, if the former is a boundarycell. Otherwise, Cmþs ¼ Cs remains assigned to the slave celland its ghost cell. Thus, the slave ghost cell is active only ifthe master cell is not a boundary cell.

The boundary surface Cmþs can be constructed in severalways. If the master cell is not a boundary cell, Cmþs ¼ Cs asstated above. However, in the case that we have a bound-ary master cell, Cmþs replaces Cm and Cs. Therefore, weintroduce the concept of averaged control volumes, in

which Cmþs is constructed as the average of Cm and Cs. Thisconcept is discussed in the following section.

3.5. The concept of averaged control volumes

The concept of averaged control volumes is applied toconstruct boundary surfaces of master–slave pairs as wellas to generate boundary cells on coarse grids for the mul-tilevel method in a volume-conserving way. Note that themaster–slave connectivity is established after the coarsegrid boundary cells have been generated, i.e., the cell-merg-ing/cell-linking process involves already averaged controlvolumes on coarse grids. In the following, the concept isdescribed for both applications. To this end, we consideri boundary cells Cna

r ; a ¼ f1; . . . ; ig, with the boundary sur-faces Cna . The problem is to replace the set of Cna ;a ¼ f1; . . . ; ig, by one surface C, C fCna j a ¼ 1; . . . ; ig.

Consider the cells Cn2r and Cn3

r in Fig. 9a with cut pointsA, B, and C, i.e., a ¼ f2; 3g. In this example, Cn2

r is a slavecell of Cn3

r . Hence, the task is to merge the boundary sur-faces Cn2 and Cn3 , see Fig. 9a. The centroids xna

s of the sur-faces Cna lie midway between AB and BC, respectively. Forthis case, Ye et al. [1] propose to use the midpoint betweenAC as centroid for the new surface. Let us denote theaccordingly constructed surface, which is shown as dashedline in Fig. 9a, by C. Obviously, this choice is independentof point B, hence reducing the accuracy of the givenboundary information.

In terms of the application of multigrid, let us further-more consider the cell Cn

r�1 and its child cellsCna

r ; a ¼ f1; . . . ; 4g, in Fig. 9b. Using C in this case, i.e.,taking only the outer cut points A and D into account toconstruct the overlying coarse grid boundary cell Cn

r�1,yields a crude representation of the underlying fine gridcells, which is independent of the cut points B and C.The surface C is again shown as the dashed line inFig. 9b. Furthermore, in this approach the cell volumesof the fine grid cells are not conserved on the coarse gridif the boundary is curved.

Therefore, we propose to construct C as area-weightedaverage of all Cna . This allows a more accurate representa-tion of Cna as well as a conservative computation of the vol-ume V of the averaged cell

V ¼X

a

V na : ð41Þ

Summing up Eq. (41) over all cells Cnr ; 8Cn

r 2 Xk, it can beseen that the grid volume is conserved on all grids, i.e.,V Xk ¼ V Xk ; 8k. The centroid �xs and the normal vector �ns

of C are computed by

�xs ¼

Pa

AnaxnasP

aAna

; ð42Þ

�ns ¼

Pa

Anannas

jPa

Anannas j

: ð43Þ

Page 11: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

Fig. 9. Illustration of the concept of averaged control volumes. Shaded areas identify the averaged cells; symbols as in Figs. 2, 5 and 7.

D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125 1113

The area of the averaged surface is obtained as

A ¼X

a

Anannas

!� �ns: ð44Þ

It is evident that C can be obtained by translating C along�ns ¼ ns. Then, both the present approach and that of Yeet al. [1] can be generalized by interpreting the centroidsof the boundary surfaces C and C to be weighted averagesof the cut point coordinates of Cna . Taking the case shownin Fig. 9b as an example, the weighting factors for (A, B, C,D) are 1

4; 1

4; 1

4; 1

4

� �for the present approach and 1

2; 0; 0; 1

2

� �for the approach of Ye et al. [1], respectively.

Finally, note the introduction of the concept of averagedcontrol volumes does not complicate the implementationand methodology of the presented cut-cell method. Theconcept of averaged control volumes is applied after alloperations which rely on the cut point information, suchas the generation of partial and boundary surfaces, havebeen completed, while the coarse grid cut point informa-tion is not altered. As stated above, the essential operationto obtain the averaged boundary surface is to translate theoriginal coarse grid boundary surface, while all other sur-faces of the coarse grid boundary cells remain unchanged.This operation can easily be undone by reversing thistranslation.

4. Numerical method

4.1. Spatial discretization

The inviscid flux Hi is rewritten using the advectionupstream splitting method (AUSM) proposed by Liouet al. [31]. The inviscid flux is split into a convective anda pressure term. Various approaches exist to define the splitMach number and pressure. Liou and Steffen suggest asplitting weighted by polynomials of the characteristicspeed (M � 1) [31]. A mixed central-upwind scheme of sec-ond-order accuracy is used to discretize the inviscid terms[32]. The viscous and the heat flux terms are approximatedusing central difference schemes.

4.2. Temporal integration

The Navier–Stokes equations (5) are integrated using thedual time-stepping scheme proposed by Jameson [30,41], inwhich the time derivative is discretized implicitly, while a 5-step Runge–Kutta scheme with the coefficients ak ¼

14; 1

6; 3

8; 1

2; 1

� �is used to seek the steady-state solution in

pseudo time

Qðwþ1Þ �QðwÞ

Ds¼ �L�ðQðwÞÞ; ð45Þ

where

L�ðQðwÞÞ ¼ 3Qðwþ1Þ � 4QðwÞ þQðw�1Þ

2Dtþ LðQðwþ1ÞÞ ð46Þ

with the physical time step Dt and Ds ¼ sðwþ1Þ � sðwÞ beingthe pseudo-time step. The operator L is defined such thatLðQÞ becomes the discretized residual $H. Eq. (45) issolved using local time stepping with the local pseudo-timestep

Dsn ¼ minf

xn Chn

jvnf j þ an

!; f ¼ f0; 1g; ð47Þ

where xn is the volume fraction as in Eq. (8), an ¼ffiffiffiffiffiffic pn

.n

qis

the local speed of sound, and C is the CFL number.

4.3. Sponge layer

Sponge layers are used to drive the solution variables onfar field boundaries towards the freestream values as wellas to absorb spurious waves in the vicinity of these bound-aries, since they would otherwise be reflected back into thecomputational domain and thus lower convergence or leadto unphysical solutions of time-dependent problems. Thesponge layer is formulated such that only the pressureand density are dissipated. Hence, the forcing terms

DLð/Þ ¼ er j Dxspj2

L2s

D~/ ð48Þ

Page 12: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

1114 D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125

are added to LðQÞ to absorb outgoing pressure waves. InEq. (48), / ¼ f.; .eg, ~/ ¼ f.; p

c�1g, and D~/ ¼ ~/� ~/1 is

the difference between the local and the freestream valuesof ~/. The quantity Dxsp is the distance from the cell centerto the inner boundary of the sponge layer, which is in Eq.(48) normalized by the sponge layer thickness Ls. The coef-ficient ~r is used to control the amplitude of the forcingterm. For the present work, the value of ~r is set to 0.5.

5. Multilevel method

We now turn to describe a multilevel method for hierar-chical, adaptively refined Cartesian grids with cells on arbi-trarily many different levels of refinement. The developedmultigrid technique is based on the full approximationstorage (FAS) multigrid method [11].

Multigrid methods use a sequence of grids of differentresolution such that grid changes have to be performed inthe course of the solution process. As aforementioned, ahierarchically consistent data structure in conjunction withthe storage of the cell data tree for all grid levels which areused in the multigrid method simplifies these level changessince there is no need to modify the connectivity betweencells as well as between cells and grids after or during meshadaptation. A sequence of grids Xk; . . . ;Xk; . . . ;Xk0

isobtained using

Xk�1 ¼ Xk n fCnk j 8Cn

k 2 Xkg: ð49Þ

Hence, Xk�1 and Xk differ only in cells at level k, Fig. 1. Thelowest level visited in a multigrid cycle is denoted by k0.Sawtooth cycles are used to traverse through the grid lev-els. The number of time steps that are performed on eachlevel are

mk ¼1; if k0 < k 6 k;

2; if k ¼ k0;

�ð50Þ

for decreasing k, i.e., transfer to coarser grids and mk ¼ 0for increasing k. The presence of all grid levels in the datastructure allows for a straightforward implementation ofrestriction and prolongation, since the coarse–fine-gridconnectivity is given by parent-child relations. The restric-tion operators are selected depending on the existence ofchildren for the coarse grid cells, as discussed below. Theprolongation operator is defined by the stencil to interpo-late the coarse grid correction to the fine grid. The determi-nation of the stencil cells can be cumbersome on adaptivelyrefined Cartesian grids especially for boundary cells. Oftenseveral choices exist for the stencil, while its implementa-tion is straightforward for internal cells. A remedy for thisnon-uniqueness is found by prolongating to boundary cellsin a locally body-fitted coordinate system. As we will showin Section 5.2, the appropriate stencil is easily determined,and the neighbor search for the interpolation stencil re-duces to determining the closest neighbor boundary cell.A detailed description of the restriction and prolongationoperations is given in the following. The presented multi-

level method is straightforward to implement and generallyapplicable to Cartesian grid methods.

5.1. Restriction

The fine-to-coarse grid transfer of the solution from Xk

to Xk�1 is achieved using the restriction operators Ik�1k and

Ik�1k , i.e.,

/nk�1 ¼ Ik�1

k ð/kÞn ð51Þ

holds for a generic quantity /. The second-order accuratetransfer operator Ik�1

k evaluates the volume-weighted arith-metic mean of the solution variables of underlying cells

Ik�1k ðQkÞn ¼

Pa

~xnan V naQna

kPa

V na; a > 0; ð52Þ

Ik�1k ðQkÞn ¼ IðQn

kÞ; a ¼ 0: ð53Þ

The index a denotes the number of child cells of Cnk and the

children of an associated slave cell if it exists, and I is theidentity operator, which applies for cells without children.The residual LðQÞ is restricted according to

Ik�1k ðLkðQkÞÞn ¼

Xa

~xnan LkðQna

k Þ; a > 0; ð54Þ

Ik�1k ðLkðQkÞÞn ¼ IðLkðQn

kÞÞ; a ¼ 0: ð55Þ

The quantity ~xnan is defined as the volume fraction of Cna

k

related to Cnk�1, while Cna

k and Cnk�1 may be regular cells

or master–slave pairs. Only for a master–slave pair whichis not completely nested into Cn

k�1, ~xnan 6¼ 1. In this case,

the variables and the residuals of the underlying master–slave pair are distributed to the overlying cells n andnþ i according to Eqs. (52) and (54) withX

j

~xnaj ¼ 1; j ¼ fn; nþ ig: ð56Þ

Using the restricted variables and residuals the solutionequation on a coarse grid Xk�1 reads

Lk�1ðQk�1Þ ¼ skk�1: ð57Þ

Here, skk�1 is the defect correction, which represents the dis-

cretization error of Xk�1 relative to the finest grid Xk andcan be written as

skk�1 ¼ Ik�1

k skk þ Lk�1ðIk�1

k QkÞ � Ik�1k ðLkQkÞ: ð58Þ

Having the fine-to-coarse grid transfer determined by Eqs.(52)–(58), we discuss next the particular choice of therestriction operators given by Eqs. (52)–(55). The operatorsin Eqs. (52) and (54) are applied to transfer the solutionand residual from child cells on the fine grid to their over-lying parent cells on the coarse grid. In coarser cell areas ofthe fine grid, where the local cell structure is not modifiedby a grid level change, the solution is transferred to thecoarse grid via Eq. (53). If, on the fine grid, the coarse cellsin these cell areas are in the vicinity of the finest cells the

Page 13: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125 1115

defect correction in Eq. (58) is non-zero for these cells. Tosatisfy Neumann’s solvability conditionX

n

LkðQkÞn ¼ 0; 8n 2Nk; ð59Þ

Eq. (58) is evaluated using Eq. (55).To identify those coarse cells on the fine grid for which

the defect correction becomes non-zero consider cells Cn�jk�1

and Cnak , a ¼ f0; . . . ; 3g; on grid Xk and cells Cn�j

k�1 and Cnk�1

on grid Xk�1, as illustrated in Fig. 10. Furthermore, con-sider a level change from Xk to Xk�1, i.e., from the gridshown in Fig. 10a to the one shown in Fig. 10b, and letCi

k and Cik�1, i 6¼ n, be the neighbor cells of Cn�j

k andCn�j

k�1, respectively. Clearly, LkðQn�jk Þ 6¼ Lk�1ðQn�j

k�1Þ. More-over, since LkðQi

kÞ depends on LkðQn�jk Þ through $/n�j

k forany level k, Eq. (19), we have LkðQi

kÞ 6¼ Lk�1ðQik�1Þ. Thus,

it is necessary to apply the restriction operator in Eq.(55) to all leaf cells within a distance of two cells to thecoarse-to-fine mesh interface referring to the discretizationstencils discussed in Section 3.3 in Fig. 5. These cells are

Fig. 10. Restriction on coarse–fine-mesh interfaces: (a) the grid Xk ; (b) thegrid Xk�1. Open circles: cell centers; shaded cells are those for whichLkðQkÞ 6¼ Lk�1ðQk�1Þ; arrows indicate the direction of influence of the levelchange.

identified as the light shaded cells in Fig. 10. To avoiddetermining all cells in the range of two cells from acoarse-to-fine mesh interface, we apply Eq. (55) to all leafcells. Consequently, the defect correction in Eq. (58) isevaluated for all cells and vanishes for all leaf cells whichare not in the above discussed coarse cell areas.

5.2. Prolongation

Returning from the coarse grid to the fine grid the cor-rected solution on the fine grid reads

Qk;ðnewÞ ¼ Qk;ðoldÞ þ Ikk�1DQk�1 ð60Þ

with the coarse grid correction

DQk�1 ¼ Qk�1 � Ik�1k Qk;ðoldÞ: ð61Þ

The prolongation operator is Ikk�1, which interpolates the

coarse grid correction to the fine grid. A simple way toachieve this is by injection of the correction DQk�1 fromparent cells to their child cells. However, since this operatoris only first-order accurate and amplifies high frequency er-ror modes on the fine grid, prolongation with second-orderaccuracy is commonly used. For a bilinear interpolation ofa generic variable / the equation

/ðxÞ ¼ aTN ð62Þ

with a ¼ ½a0; . . . ; a3� and N ¼ ½1; x0; x1; x0x1�T is solved forthe area which is covered by the interpolation stencil. Thistype of prolongation is used for all internal cells.

Four cells are required to solve Eq. (62). These four cellsare chosen to be the closest neighbors of the consideredunderlying cell, which all have a common cell vertex, pointA in Fig. 11. Fig. 11 shows some typical interpolation sten-cils, which are used to solve Eq. (62). Two grid levels k � 1and k are shown. The shaded area defines the range where/ðxÞ is an interpolated value, whereas outside the shadedarea /ðxÞ is extrapolated. In most cases, the solution ofEq. (62) can be simplified to some extent. Whenever oneof the sides of the four-sided polygon, which bounds thearea of interpolation, is aligned with one of the Cartesiancoordinate axes, one of the coefficients in a can be directlycomputed, Figs. 11a and b. Fig. 11a shows the simpleststencil, for which the area of interpolation is a square.The interpolation formula reads

/n1;2

k ¼ 1

16ð9/n1

k�1 þ 3/n0k�1 þ 3/n3

k�1 þ /n2k�1Þ: ð63Þ

In the cases that paired master and slave cells are includedin the stencil, the slave cell is replaced by the ghost cellwhich is connected to the master–slave pair, Section3.4.3. Two of these cases are illustrated in Figs. 11c and d.

The prolongation to boundary cells is not based on Eq.(62). Instead, a two-step bilinear interpolation in a locallybody-fitted coordinate system is used. It turns out, thisapproach resolves all of the difficulties to find an appropri-ate interpolation stencil. Let us introduce the locally body-fitted coordinate system ðnn; gnÞ for each boundary cell Cn

k

Page 14: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

Fig. 11. Typical interpolation stencils for the prolongation for an internal cell: (a) simple interpolation where only internal cells are involved; (b)interpolation for an internal cell using internal cells and boundary cells; (c) interpolation for an internal cell where an internal master cell and its ghost cellare involved; (d) interpolation for an internal master cell using two internal master cells and their corresponding ghost cells. Shaded areas show the area ofinterpolation; symbols as in Fig. 5.

1116 D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125

with gn being the locally wall-normal coordinate, as in Sec-tion 3.4.2 and Fig. 7. Four cells are again required for bilin-ear interpolation. Considering the fine grid boundary cellCna

k ; a ¼ 1; in Fig. 12 two of these cells are the parent cellCn

k and the boundary cell neighbor of Cnk which is closest to

Cnak . Let this cell be denoted by Cnþi

k according to Fig. 12.Together with the corresponding ghost cells, we then havea four-point stencil, as illustrated in Fig. 12. Only for Cnþi

k asearch algorithm is needed, while the other stencil cells canbe directly determined. Hence, the following conditions areverified to correctly take into account master–slave pairs:

(1) xnc 6¼ xnþi

c , i.e., Cnk is not the master cell of Cnþi

k andvice versa.

(2) If one of Cjk; j ¼ fn; nþ ig, belongs to a master–slave

pair the ghost cell, which is added to the stencil, is theone corresponding to the master–slave pair (cf. Sec-tion 3.4.3).

In the following description of the two-step interpola-tion, we use the superscripts �n and nþ i to identify theghost cells of Cn

k�1 and Cnþik�1, respectively.

As a first step, we determine the coordinate gnac , which

defines the wall-normal distance dgna �j gnac j of the cell cen-

ter of Cnak . Next, we compute the coordinates for the first

interpolation step by

xj� ¼ Bjð0; dgna Þ; j ¼ fn; nþ ig; ð64Þ

using the coordinate transformation Bj : ðnj; gjÞ ! x.Using nj ¼ 0 we ensure that xn

� and xnþi� are on the lines

connecting the cell and ghost cell centers such that wecan evaluate /ðxj

�Þ using a one-dimensional interpolationbetween the cells and their ghost cells. For /ðxj

�Þ we write

/ðxj�Þ ¼ c/ðx�j

cÞ þ ð1� cÞ/ðxjcÞ; ð65Þ

where

c ¼ gðxjcÞ � gðxj

�Þgðxj

cÞ � gðx�jcÞ; j ¼ fn; nþ ig: ð66Þ

The second step of the prolongation is the interpolation of/ðxna

c Þ in the wall-tangential direction using /ðxn�Þ and

/ðxnþi� Þ from the first step, Fig. 12. We approximate the

wall-tangential interpolation by

/ðxnac Þ ¼ �c/ðxn

�Þ þ ð1� �cÞ/ðxnþi� Þ; ð67Þ

where

Page 15: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

Fig. 12. Prolongation to Cartesian cut cells. Shaded squares: points of interpolation between boundary and ghost cells; the second step of the interpolationis indicated by arrows; other symbols as in Figs. 2 and 5.

D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125 1117

�c ¼ j xnþi� � xna

c jPjj xj� � xna

c j; j ¼ fn; nþ ig: ð68Þ

6. Summary of the algorithm

Let us briefly summarize the overall algorithm thedetails of which are presented in the preceding chapters.Considering the dual time-stepping integration schemewith the multigrid accelerated 5-step Runge–Kutta schemein pseudo time, the essential procedures in the solutionalgorithm can be decomposed into the steps depicted inFig. 13. The solver initialization includes the automaticgrid generation, the generation of boundary cells, ghostcells, and surfaces, the small cell treatment, and the appli-cation of the concept of averaged control volumes. Thedashed box in Fig. 13 highlights the inner integration algo-rithm using the multilevel method. The quantity m countsthe time steps completed on the current grid level in a mul-tilevel cycle. A pseudo-time step includes the application ofthe boundary conditions, the computation of the fluxL�ðQÞ, the application of the sponge layer forcing, andthe inner integration step using the Runge–Kutta method.

Before advancing the physical time step on convergenceof the inner integration, the adaptation step is executed ifan adaptation criterion is fulfilled. An adaptation stepcomprises first the computation of the sensor values si

for all cells on the finest grid Xk, based on which the sensorlimit values si;l and si;u are determined. Following the sen-sor-based grid refinement/grid coarsening process the gridis smoothed, the surfaces are recreated, and all variablesare interpolated onto the newly created cells.

It is evident from Fig. 13 that the adaptive mesh refine-ment does not complicate the overall structure of theNavier–Stokes solver since it is executed outside the inte-gration algorithm. As such it can be used as an add-on fea-ture to every solution algorithm. The multilevel method isnaturally embedded in the integration algorithm and doesnot interfere with the grid adaptation procedure.

7. Results

We now turn to present results of simulations of steadyand unsteady laminar flow around a circular cylinder. Thebenefit of multigrid and adaptation strategies is discussedin detail.

The flow around a circular cylinder is an appropriatevalidation test case, since the flow field exhibits differentregimes depending on the Reynolds number, and thecurved boundary is challenging for Cartesian grid methods.Furthermore, it has been studied in numerous publications[42–45]. With D being the diameter of the circular cylinderthe Reynolds number based on the cylinder diameter isdefined ReD ¼ .1v1D

l1. At laminar flows around circular cyl-

inders, three regimes can be distinguished. At very lowReynolds numbers ReD 1 the viscous terms are domi-nant and creeping flow is observed. When the Reynoldsnumber is increased the flow separates on the leeward sideof the cylinder and forms a pair of vortices, which are sym-metrically attached to the cylinder. At further increase ofthe Reynolds number these vortices are stretched and ata critical Reynolds number of about ReD;crit 49 the recir-culation region becomes unstable [45]. This point of transi-tion is called Benard–von Karman instability [44]. Above

Page 16: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

[ = k]

[else]

++

k=

[k>k0]

[else]

[else]

[physical time stepis converged]

[adaptation criterionis fulfilled]

[else]

Inner multigridalgorithm

k-- k=

=0

=0 =0

Grid adaptationRefinement/Coarsening

Change the grid levelRestriction

Change the grid levelProlongation

Perform a pseudo-timestep on k

Initialize the solver

Advance the physicaltime step

Fig. 13. High-level description of the overall solution algorithm. The illustration of the inner multigrid algorithm corresponds to sawtooth multigridcycles. The quantity m counts the time steps completed on the current grid level in a multilevel cycle, k denotes the grid level, while k is the highest grid leveland k0 is the lowest grid level visited in a multigrid cycle.

1118 D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125

the critical Reynolds number the cylinder wake begins tooscillate and exhibits a wavy structure known as the vonKarman vortex street. Vortices are alternately shed fromeither side of the cylinder and convected downstream[44]. This essentially two-dimensional laminar flow regimeappears for Reynolds numbers up to 140–194 [45], abovewhich three-dimensional flow phenomena emerge.

We consider laminar flows in steady and vortex-shed-ding regimes at Reynolds numbers in the range ofReD ¼ 20 to ReD ¼ 300. Although the three-dimensionalstructures exhibited by the flow fields at ReD ¼ 200 andReD ¼ 300 are not captured by two-dimensional simula-tions, results of such simulations are reported in the litera-ture and hence, flows at these Reynolds numbers are

Fig. 14. Reference grid with 43,676 cells on Xk for the simulations of the flow aReD ¼ 40. Cut cells are shown as regular grid cells overlapping the embedded

considered in this paper. The simulations are performedusing a computational domain of 60D� 30D, where thecylinder is located 15D downstream of the inflow boundaryand vertically centered in the domain. A rather low Machnumber M ¼ 0:1 is chosen to obtain results comparableto solutions computed for incompressible flow.

7.1. Steady flow at M ¼ 0:1

Reference solutions (I–II) for the flow around a circularcylinder at ReD ¼ 20 and ReD ¼ 40 are obtained on the gridshown in Fig. 14. The base grid consists of 64� 32 cellsand is patchwisely refined such that the composite gridcomprises on levels 6 through 11 a total number of

round a circular cylinder at M ¼ 0:1 and Reynolds numbers ReD ¼ 20 andcylinder.

Page 17: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125 1119

57,436 cells including ghost cells. 43,676 cells are on the fin-est grid Xk. Fig. 14 also shows a magnified view of the gridaround the embedded cylinder. Note that cut cells areshown as regular grid cells, i.e., before reshaping, and over-lap the circular cylinder geometry to clarify the cell struc-ture on the boundary. The size of the computational gridnear the cylinder is h11 0:03D. Similar computationsshowed the results to be nearly independent of the basegrid. The drag coefficient was decreased by 0.5% comparedto the reference grid when a base grid with 128� 64 cellswas used. The steady problem is solved by integrating theNavier–Stokes equations (5) for a sufficiently large timeinterval Dt.

Fig. 15. Instantaneous streamlines for the flow around a circular cylinderat M ¼ 0:1 and different Reynolds numbers: (a) ReD ¼ 20; (b) ReD ¼ 40;(c) ReD ¼ 100.

Fig. 16. Instantaneous Mach number distribution for the flow around a circ(b) ReD ¼ 40; (c) ReD ¼ 100; (d) ReD ¼ 200; (e) ReD ¼ 300; the flow direction i

On the inflow boundary we prescribe the freestream val-ues of the variables, while a zero gradient von Neumannboundary condition is used on the outflow boundary. Atthe top and bottom of the computational domain, weemploy characteristic boundary conditions assuming alocally one-dimensional inviscid flow field [46]. The bound-ary condition is implemented such that it is able to switchbetween inflow and outflow depending on the local flowstate. This state is determined by the flow on the localboundary cell. Sponge layers are applied on all boundaries.We use Ls ¼ 5 on the inflow boundary as well as on the topand bottom boundaries and Ls ¼ 10 on the outflow bound-ary. Local time stepping is used in all computations for theintegration in pseudo time.

Figs. 15a and b show the streamlines of the steady flowfield at ReD ¼ 20 and ReD ¼ 40, illustrating the characteris-tic pair of recirculation regions attached to the leeward sideof the cylinder. In this steady regime, the recirculationregions extend at increasing Reynolds number. Fig. 16compares the computed Mach number distributions at dif-ferent Reynolds numbers. Figs. 16a and b show the distri-butions for the steady flow fields at ReD ¼ 20 and ReD ¼ 40.In Table 1, characteristic parameters of the computed flowfields are compared with data from the literature. Thequantity Cd ¼ 2F d=ð.1v2

1DÞ is the drag coefficient withF d being the drag and Lr is the length of the recirculationregion. All findings match convincingly the results of otherauthors.

We now turn to discuss the performance of the multi-level method for reference solution (II), i.e., for ReD ¼ 40.Let the maximum residual of the density be defined

Lwð.Þ � Lwð.ÞL1ð.Þ

; ð69Þ

where the superscript w denotes the time step. Measure-ments of the computing time on grids with a differentdegree of cell clustering indicated a nearly linear depen-dence of the computing time on the number of cells, suchthat this number is used as a measure of the computationalwork. We define one work unit W to be the computationalwork Wk required to advance the solution from time w to

ular cylinder at M ¼ 0:1 and different Reynolds numbers: (a) ReD ¼ 20;s from bottom to top.

Page 18: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

1120 D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125

wþ 1 on the finest grid Xk, W �Wk, with Wk being pro-portional to the number of cells Nk

Wk ¼Nk

Nk: ð70Þ

On the reference grid a 2-grid V-cycle requires 1.92 workunits, while a 3-grid V-cycle requires 1.93 work units. Thenumber of time steps that are performed on each grid isgiven by Eq. (50). To compare the performance of the mul-tilevel method relative to the single-grid computation the

Table 1Drag coefficient and length of the recirculation regions for steady laminarflow over a circular cylinder at M ¼ 0:1 and Reynolds numbers ReD ¼ 20and ReD ¼ 40

Contribution ReD ¼ 20 ReD ¼ 40

Cd Lr=d Cd Lr=d

Tritton [42]a 2.08 – 1.58 –Dennis and Chang [43]b 2.045 – 1.522 –Tseng and Ferziger [2]c – – 1.53 2.21Ye et al. [1]d 2.03 0.92 1.52 2.27Chung [3]d 2.05 0.96 1.54 2.30Present (reference)d 2.047 0.966 1.533 2.315Present (adaptive)d 2.043 0.972 1.535 2.240

a Experimental data.b Numerical result using a body-fitted grid method.c Numerical result using an immersed boundary method.d Numerical result using a Cartesian cut-cell method.

10-10

10 -8

10 -6

10 -4

10 -2

100

102

0 20000 40000 60000 80000

max

. den

sity

res

idua

l

work units

single-grid

2-grid

3-grid

Reference single-gridReference 2-gridReference 3-grid

Fig. 17. Convergence history of Lwð.Þ; reference solution for the flowaround a circular cylinder at ReD ¼ 40.

Fig. 18. Solution-adaptive grid with 9716 cells on Xk for the solution

maximum CFL number C is determined separately foreach solution. We use Cs ¼ 0:75 for the single-grid compu-tations and Cm ¼ 0:5 for the multigrid computations. Thelatter is kept constant on all grids. In Fig. 17, the conver-gence histories of Lwð.Þ are given for a single-grid, 2-grid,and 3-grid computation. Despite the lower CFL number,the multigrid schemes accelerate the convergence tosteady-state. The 3-grid computation converges about 4times faster than the single-grid computation. Peaks inthe residual plot for the single-grid computation are dueto a local switch of the inflow and outflow boundary con-ditions on the top and bottom boundaries caused by localchanges of the solution during convergence. Note, thesepeaks do not appear in the residual plots for the multigridcomputations.

Computations with solution-adaptive mesh refinementare started on the geometrically refined base grid with64� 32 cells for flows at ReD ¼ 20 and ReD ¼ 40. Gridadaptation is initiated when Lwð.Þ reaches 10�5-conver-gence. Using the prescribed adaptation parametersfc;c=e ¼ 0:15 and fr;c=e ¼ 0:30 yields after 7 adaptation stepsa converged grid with a total of 9972 cells, where 8078 cellsare on Xk, for the case ReD ¼ 20 and with a total of 12,156cells, where 9716 cells are on Xk, for the case ReD ¼ 40,respectively. For the simulation at ReD ¼ 40, the adaptedgrid is shown in Fig. 18. The grid is said to be convergedwhen the convergence threshold 10�5 is reached within100 time steps after an adaptation step. Furthermore, weimpose the constraint that at each adaptation step thenumber of deleted cells must not exceed the number ofnewly created cells. That is, the overall number of cells isnon-decreasing. In doing so, oscillations of the number ofcells in the limit of grid convergence can be avoided.

The obtained values for the drag coefficient Cd and thelength of the recirculation regions show good agreementwith the reference solutions, Table 1. Fig. 19 shows the v0

velocity component plotted along the centerline x1 ¼ 0for the flows at ReD ¼ 20 and ReD ¼ 40. The positionx0 ¼ 0 is right behind the cylinder. Since there are no cellcenters along the centerline, the centerline v0 componentis computed by linear interpolation in the x1 direction.The solutions on the adaptive grid match very well the ref-erence solutions. The visible small deviations are due to theinterpolation of the solution and appear where the cell sizeof the reference grid and the solution-adaptive grid doesnot match. In Fig. 20 the distribution of the pressure coef-

of the flow around a circular cylinder at ReD ¼ 40 and M ¼ 0:1.

Page 19: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

-0.02

0

0.02

0.04

0.06

0.08

0.1

-10 0 10 20 30 40

cent

erlin

e v 0

x0 coordinate

Adaptive solutionAdaptive solution

Reference solutionReference solution

Fig. 19. Comparison of the adaptive and the reference solution for theflow around a circular cylinder at M ¼ 0:1 and Reynolds numbersReD ¼ 20 and ReD ¼ 40: v0 velocity component along the centerlinecomputed by linear interpolation in x1 direction (x ¼ 0 corresponds to theleeward face center of the cylinder). Small deviations between the plots aredue to the interpolation from cell areas which differ on the solution-adaptive grid and the reference grid.

-1

-0.5

0

0.5

1

1.5

0 20 40 60 80 100 120 140 160 180

c p

Θ (degr.)

Adaptive solutionReference solution

Kim et al.Tseng and Ferziger, body-fitted

Fig. 20. Comparison between the adaptive and the reference solution andsolutions of Tseng and Ferziger [2] and Kim et al. [25] for the flow arounda circular cylinder at ReD ¼ 40 and M ¼ 0:1: distribution of the pressurecoefficient cp on the surface of the cylinder (H is counted clockwise startingfrom the windward face center of the cylinder).

10-10

10 -8

10 -6

10 -4

10 -2

100

102

0 2000 4000 6000 8000 10000

max

. den

sity

res

idua

l

work units

Reference single-gridReference 3-grid

Adaptive single-gridAdaptive 3-grid

Fig. 21. Convergence history of Lwð.Þ; adaptive and reference solution forthe flow around a circular cylinder at ReD ¼ 40 and M ¼ 0:1.

D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125 1121

ficient cp ¼ 2ðp � p1Þ=.v21 for the flow at ReD ¼ 40 is

given. Again, the solution on the adaptive grid agrees verywell with the reference solution.

For the flow at ReD ¼ 40, Figs. 17 and 21 show the workrequired to converge the solution to be reduced by a factorgreater than 2 compared with the most efficient 3-grid mul-tigrid reference computation and by a factor of 9 comparedwith the single-grid reference computation.

Analyzing the single-grid and multigrid solutions withthe adaptation strategy described above shows that themultilevel method accelerates convergence before the firstadaptation step and after the last adaptation step andLwð.Þ < 10�5. During the adaptation steps multigrid slows

down convergence. This can be explained as follows. Bytransferring the variables of the parent cells onto newly cre-ated cells locally high-frequency error modes are intro-duced. On the other hand, low-frequency error modeswere globally reduced by the initial multigrid iterationsprior to the first adaptation. Thus, a relatively low levelof low-frequency errors and local peaks of high-frequencyerrors occur in the refined cell areas.

Considering a multilevel method operating on the gridsXk; . . . ;Xk0

two cases have to be distinguished. First, if a cellCn

r ; r < k0; is refined, the newly created child cells Cnarþ1 are

present on all multilevel grids. Second, if a cellCn

r ; k0 6 r < k; is refined, the newly generated child cellsCna

rþ1 are not present on all multigrid levels anymore. Inthe latter case, it is clear that multigrid is less efficient inreducing the high-frequency error modes compared to a sin-gle-grid computation. In the first case, the overall rate ofconvergence is determined by the local time step on thenewly created cells, which is in turn governed by the CFLnumber C. Since Cm < Cs, the multilevel method is less effi-cient in reducing the residual than the single-grid method.

An efficient multigrid strategy in combination withAMR is to run the solution with multigrid until the firstgrid adaptation is performed. At this point, we switch toa single-grid computation and use grid adaptation untilthe final grid is obtained and the residual has been drivendown to Lwð.Þ ¼ 10�5 on this grid. Subsequently, multigridis again used to reduce the residual until a converged solu-tion is reached. With this strategy, the overall solution con-vergence can be accelerated by a factor of 1.75 using the 3-grid method, as shown in Fig. 21 for ReD ¼ 40. Comparedto the single grid reference case a speed-up factor ofroughly 16 is achieved with the combination of AMRand multigrid.

7.2. Unsteady flow at M ¼ 0:1

Next, we consider results of simulations of the unsteadyflow around a circular cylinder at ReD ¼ 100, ReD ¼ 200,

Page 20: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

Fig. 22. Reference grid for the simulations of the flow around a circular cylinder at M ¼ 0:1 and Reynolds numbers ReD ¼ 100, ReD ¼ 200, andReD ¼ 300. Cut cells are shown as regular grid cells overlapping the embedded cylinder.

Table 3Coefficients and Strouhal number for unsteady laminar flow over acircular cylinder at M ¼ 0:1 and Reynolds numbers ReD ¼ 200 andReD ¼ 300

Contribution ReD ¼ 200 ReD ¼ 300

Cd C0l St Cd St

Liu et al. [48]a 1.31 0.69 0.192 – –De Palma et al. [47]b 1.34 0.68 0.19 – –Mittal and Balachandar [49]a – – – 1.37 0.213Ye et al. [1]a – – – 1.38 0.21Present (reference)c 1.371 0.726 0.194 1.433 0.208Present (adaptive)c 1.373 0.724 0.194 1.436 0.207

a Numerical result using a body-fitted grid method.b Numerical result using an immersed boundary method.c Numerical result using a Cartesian cut-cell method.

1122 D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125

and ReD ¼ 300. Reference solutions (III–V) are obtainedon a patchwisely refined grid with a total number of163,652 cells on cell refinement levels 6 through 11,Fig. 22. The grid is coarse in the sponge layer region atthe outflow to dissipate outgoing waves, while the nearwake of the circular cylinder is resolved with a very finemesh. In total, 123,338 cells are located on Xk. Theunsteady problems are solved using the dual time-steppingtechnique with a physical time step of Dt ¼ 0:1 and localtime stepping in pseudo time. The maximum CFL numbersfor the single-grid and multigrid computations were deter-mined as Cs ¼ Cm ¼ 0:5. The residual is reduced by 4–5orders of magnitude in pseudo time before the solution isadvanced in physical time. All other solution parametersand the boundary conditions are those of the steady cases.The von Karman vortex street is triggered by letting thecircular cylinder rotate in alternating directions duringthe first 60 physical time steps, which correspond toapproximately one vortex shedding cycle at ReD ¼ 100.

Tables 2 and 3 compare the lift and drag coefficients andthe Strouhal number of the present computations with datafrom the literature. The value C0l denotes half of the ampli-tude of the oscillating lift coefficient Cl ¼ 2F l=ð.1v2

1DÞwith F l being the lift. Furthermore, in Table 2 we give

Table 2Coefficients and Strouhal number for unsteady laminar flow over acircular cylinder at M ¼ 0:1 and ReD ¼ 100

Contribution Cd C0l Cl;rms St

Williamson [45]a – – – 0.164Tseng and Ferziger [2]b 1.42 – 0.29 0.164Kim et al. [25]b 1.33 0.32 – 0.165De Palma et al. [47]b 1.32 0.331 – 0.163Chung [3]c 1.392 – – 0.172Present (reference)c 1.354 0.335 0.237 0.164Present (adaptive)c 1.358 0.334 0.236 0.164

a Experimental data.b Numerical result using an immersed boundary method.c Numerical result using a Cartesian cut-cell method.

the rms value of Cl denoted by Cl;rms since some authorsuse it instead of C0l. Finally, the Strouhal numberSt ¼ D=v1ts, where ts is the period of a shedding cycle, isgiven. All parameters are in good agreement with the pub-lished results. Fig. 15c shows the streamlines of an instan-taneous solution of the flow field at ReD ¼ 100. The wavystructure of the von Karman vortex street is clearly visible.In the vicinity of the cylinder wall a vortex develops, whilethe vortex which was shed from the cylinder has alreadytraveled downstream. In Figs. 16c–e, the Mach number dis-tributions of the flows at the investigated Reynolds num-bers are compared. Clearly, the wavy pattern of the vonKarman vortex street contracts in the streamwise directionat increasing Reynolds number indicating the rising vortexshedding frequency.

Like in the steady flow case the adaptive-grid solutionsare started on a geometrically refined grid with 64� 32cells. The dual time-stepping method is used with the sameparameters as given for the reference cases (III–V). Theonset of the von Karman vortex street is triggered asdescribed for the reference solutions and the mesh refine-ment is initiated as soon as the vortex street is fully devel-

Page 21: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125 1123

oped in the computational domain. Initially, the adapta-tion parameters fc;c=e ¼ 0:15 and fr;c=e ¼ 0:30 are used togenerate a refined mesh. Adaptation steps are carried outafter each physical time step until a prescribed maximumnumber of cells Nmax is reached.

Having reached the maximum number of cells it isdesired to keep the number of grid cells constant and atthe same time to enable a dynamic change of the gridaccording to the solution. We specify a threshold H inaddition to the maximum number of grid cells Nmax.Within an adaptation step, cell refinement is initiated first,followed by coarsening. The refinement and coarseningprocedures are performed after each physical time step.The grid is refined until the number of cells on Xk reachesP

kNk ¼ ð1þHÞNmax and subsequently coarsened untilPkNk ¼Nmax. The number of cells after an adaptation

step is thus Nmax and the grid is changed by 2HNmax cells.The specified adaptation parameters fc;c=e and fr;c=e must belarge enough to enable the grid changes required to dynam-ically follow the solution. In the present case, the initialadaptation parameters are changed to fc;c=e ¼ 0:5 andfr;c=e ¼ 0:5. This adaptation strategy produces distinct,highly resolved cell areas, which track the vortices beingconvected downstream. A somewhat smoother grid, i.e.,a higher background resolution can be obtained by impos-

Fig. 23. Vorticity distribution and corresponding solution-adapted grids for thand M ¼ 0:1: (a) the instantaneous solution which corresponds to Cl;min; (b) t

-0.4

-0.2

0

0.2

0.4

0 5 10 15 20

Cl

time units

AdaptiveReference

Fig. 24. Lift and drag coefficients vs. time: comparison of

ing the restriction that only cells above a certain level ofrefinement may be coarsened.

Fig. 23 shows the solution-adapted grid at two instantsbeing half a shedding cycle apart and corresponding toCl;min and Cl;max at ReD ¼ 100. The maximum and minimumlevels of refinement are 11 and 6, respectively, and the max-imum number of cells and the threshold are Nmax ¼85; 000 and H ¼ 0:1. The above mentioned coarseningrestriction is applied to all cells on a refinement level of 9and below. The effect of this restriction can be seen asthe refined cell area which surrounds the shed vortices.With this strategy high-frequency oscillations in the liftand drag coefficient produced by the mesh refinementand coarsening events are very small and in fact cannotbe monitored in the plots of the coefficients Cl and Cd,Fig. 24. Fig. 23 also shows the vorticity distribution forthe flow at ReD ¼ 100 at the instants which correspond tothe grids shown in the same figure. Clearly, the solution-adapted grid is clustered where peaks in the vorticity distri-bution can be found and through the dynamic grid adapta-tion the refined cell areas are seen to accurately follow thedownstream motion of these peaks. Tables 2 and 3 indicatethat the results obtained with the solution-adaptive meshrefinement are in excellent agreement with those of the ref-erence computation.

e simulation of the unsteady flow around a circular cylinder at ReD ¼ 100he instantaneous solution which corresponds to Cl;max.

1

1.2

1.4

1.6

1.8

2

0 5 10 15 20

Cd

time units

AdaptiveReference

the reference and the adaptive solution for ReD ¼ 100.

Page 22: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

1124 D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125

The performance of the multilevel method is assessed onthe solution-adaptive grid for the flow at ReD ¼ 100 withcontinuing mesh adaptation using a 3-grid V-cycle as inthe steady case. Three different physical time steps, namelyDt ¼ 0:1, Dt ¼ 0:2, and Dt ¼ 0:5, are investigated. InFig. 25 the convergence of Lwð.Þ is compared forDt ¼ 0:2 and Dt ¼ 0:5. Clearly, the multigrid methodbecomes more efficient in accelerating the solution conver-gence with increasing physical time step Dt. While the workincreases nearly linearly with the physical time step for sin-gle-grid computations, this increase is much smaller usingthe multilevel method, Fig. 26. For Dt ¼ 0:5, we have anacceleration factor of 2.4 compared to the single-gridcomputation.

10-6

10 -5

10 -4

10 -3

10 -2

10 -1

100

0 2000 4000 6000 8000 10000 12000

max

. den

sity

res

idua

l

work units

Δt=0.5, single-gridΔt=0.2, single-grid

Δt=0.5, 3-gridΔt=0.2, 3-grid

Fig. 25. Convergence history of Lwð.Þ for Dt ¼ 0:2 and Dt ¼ 0:5; adaptivesolution for the flow around a circular cylinder at ReD ¼ 100 and M ¼ 0:1.Note Dt is the physical time step and the residual plots refer to theiterations in pseudo time.

1

1.5

2

2.5

3

3.5

4

4.5

5

0 0.1 0.2 0.3 0.4 0.5 0.6

acce

lera

tion

fact

or /

wor

k

physical time step Δt

multigrid accelerationsingle-grid work

multigrid work

Fig. 26. Multigrid convergence acceleration for different physical timesteps Dt and convergence to Lwð.Þ ¼ 10�6 for the flow around a circularcylinder at ReD ¼ 100 and M ¼ 0:1; the work is normalized by the workrequired to advance the solution by Dt with Dt ¼ 0:1.

8. Conclusions

A Cartesian cut-cell method with AMR and multigrid isintroduced to solve the Navier–Stokes equations for com-pressible flows. Small cells are treated with a combinedcell-merging/cell-linking approach. The volume-conservingconcept of averaged control volumes is introduced andused to treat small cells and to construct coarse grids in amultigrid method formulated for Cartesian hierarchicalgrids. It is shown that multigrid methods can be efficientlyimplemented based on a hierarchical cell-tree data struc-ture in conjunction with AMR. The presented AMR strat-egy allows to directly control the number of refined andcoarsened cells.

Computations of steady and unsteady laminar flowsaround a circular cylinder at various Reynolds numbersin the range of ReD ¼ 20 to ReD ¼ 300 were performed tovalidate the Cartesian grid method and to assess its perfor-mance. For a steady flow multigrid was seen to acceleratethe convergence to the steady-state solution. A residualdrop of 10 orders of magnitude was reached roughly 16times faster with a computation utilizing AMR and multi-grid compared to a single-grid reference computation,which also was based on a hierarchically refined grid. Itgoes without saying that the flow fields of both solutionsdo match published results.

Unsteady flow computations around the circular cylin-der were performed using a dual time-stepping scheme withlocal time stepping in pseudo time. With the presentedAMR strategy the grid is dynamically modified accordingto the unsteady flow field. The results obtained are in excel-lent agreement with the solutions on a reference grid, whichcontains about twice as many cells as the solution-adaptivegrid. Both the reference and the adaptive solutions comparewell with other published results. The multilevel methodwas tested for ReD ¼ 100 in conjunction with AMR for anumber of physical time steps in the range of Dt ¼ 0:1 toDt ¼ 0:5. It turned out that multigrid becomes more effi-cient in converging the pseudo steady-state problem withincreasing physical time step. Concerning single-grid com-putations, the dynamic AMR strategy yields a speed up fac-tor of 1.7 compared to the reference cases, which also werecomputed on a statically refined mesh. For Dt ¼ 0:5 usingmultigrid and dynamic AMR results in a speed up factorof 2.4 compared to the single-grid dynamic AMR computa-tion. Hence, an overall speed up factor of roughly 4 can beachieved with multigrid and dynamic AMR compared tothe reference computations of unsteady cylinder flow. Sinceall investigations performed in this paper are for two-dimensional flow, even higher speed-up factors will beobtained in three-dimensional applications.

References

[1] Ye T, Mittal R, Udaykumar H, Shyy W. An accurate Cartesian gridmethod for viscous incompressible flows with complex immersedboundaries. J Comput Phys 1999;156:209–40.

Page 23: An adaptive multilevel multigrid formulation for Cartesian hierarchical grid methods

D. Hartmann et al. / Computers & Fluids 37 (2008) 1103–1125 1125

[2] Tseng Y-H, Ferziger J. A ghost-cell immersed boundary method forflow in complex geometry. J Comput Phys 2003;192:593–623.

[3] Chung M-H. Cartesian cut cell approach for simulating incompress-ible flows with rigid bodies of arbitrary shape. Comput Fluids2006;35:607–23.

[4] Su S-W, Lai M-C, Lin C-A. An immersed boundary technique forsimulating complex flows with rigid boundary. Comput Fluids2007;36:313–24.

[5] Berger M, Oliger J. Adaptive mesh refinement for hyperbolic partialdifferential equations. J Comput Phys 1984;53:484–512.

[6] Berger M, Colella P. Local adaptive mesh refinement for shockhydrodynamics. J Comput Phys 1989;82:64–84.

[7] De Zeeuw D, Powell K. An adaptively refined Cartesian mesh solverfor the Euler equations. J Comput Phys 1993;104:56–68.

[8] Pember R, Bell J, Colella P, Crutchfield W, Welcome M. An adaptiveCartesian grid method for unsteady compressible flow in irregularregions. J Comput Phys 1995;120:278–304.

[9] Dadone A, Grossman B. Ghost-cell method with far-field coarseningand mesh adaptation for Cartesian grids. Comput Fluids 2006;35:676–87.

[10] Brandt A. Multi-level adaptive solutions to boundary-value prob-lems. Math Comput 1977;31(138):333–90.

[11] Jameson A. Solution of the Euler equations for two dimensionaltransonic flow by a multigrid method. Appl Math Comput1983;13:327–55.

[12] Roma A, Peskin C, Berger M. An adaptive version of the immersedboundary method. J Comput Phys 1999;153:509–34.

[13] Aftosmis M, Berger M, Adomavicius G. A parallel multilevel methodfor adaptively refined Cartesian grids with embedded boundaries.Paper 2000-0808, AIAA; 2000.

[14] McCorquodale P, Colella P, Johansen H. A Cartesian grid embeddedboundary method for the heat equation on irregular domains. JComput Phys 2001;173:620–35.

[15] Schwartz P, Barad M, Colella P, Ligocki T. A Cartesian gridembedded boundary method for the heat equation and Poisson’sequation in three dimensions. J Comput Phys 2006;211:531–50.

[16] Ham F, Lien F, Strong A. A Cartesian grid method with transientanisotropic adaptation. J Comput Phys 2002;179:469–94.

[17] Peskin C. The immersed boundary method. Acta Numer 2002:1–39.[18] Lai M, Peskin C. An immersed boundary method with formal

second-order accuracy and reduced numerical viscosity. J ComputPhys 2000;160:705–19.

[19] Griffith B, Peskin C. On the order of accuracy of the immersedboundary method: higher order convergence rates for sufficientlysmooth problems. J Comput Phys 2005;208:75–105.

[20] Mohd-Yusof J. Combined immersed-boundary/B-spline methods forsimulations of flow in complex geometries, CTR annual researchbriefs. NASA Ames/Stanford University; 1997.

[21] Fadlun E, Verzicco R, Orlandi P, Mohd-Yusof J. Combinedimmersed-boundary finite-difference methods for three-dimensionalcomplex flow simulations. J Comput Phys 2000;161:35–60.

[22] Gilmanov A, Sotiropoulos F, Balaras E. A general reconstructionalgorithm for simulating flows with complex 3D immersed bound-aries on Cartesian grids. J Comput Phys 2003;191:660–9.

[23] Balaras E. Modeling complex boundaries using an external force fieldon fixed Cartesian grids in large-eddy simulations. Comput Fluids2004;33:375–404.

[24] Goldstein D, Handler R, Sirovich L. Modeling a no-slip flowboundary with an external force field. J Comput Phys1993;105:354–66.

[25] Kim J, Kim D, Choi H. An immersed-boundary finite-volumemethod for simulations of flow in complex geometries. J ComputPhys 2001;171:132–50.

[26] Lima E Silva A, Silveira-Neto A, Damasceno J. Numerical simula-tion of two-dimensional flows over a circular cylinder using theimmersed boundary method. J Comput Phys 2003;189:351–70.

[27] Kirkpatrick M, Armfield S, Kent J. A representation of curvedboundaries for the solution of the Navier–Stokes equations on astaggered three-dimensional Cartesian grid. J Comput Phys2003;184:1–36.

[28] Hu X, Khoo B, Adams N, Huang F. A conservative interface methodfor compressible flows. J Comput Phys 2006;219:553–78.

[29] Schroder W, Keller H. Wavy Taylor-vortex flows via multigrid-continuation methods. J Comput Phys 1990;91:197–227.

[30] Jameson A. Time dependent calculations using multigrid, withapplications to unsteady flows past airfoils and wings. Paper 91-1596, AIAA; 1991.

[31] Liou M-S, Steffen Jr CJ. A new flux splitting scheme. J Comput Phys1993;107:23–39.

[32] Meinke M, Schroder W, Krause E, Rister T. A comparison ofsecond- and sixth-order methods for large-eddy simulation. ComputFluids 2002;31:695–718.

[33] Israeli M, Orszag S. Approximation of radiation boundary condi-tions. J Comput Phys 1981;41:115–35.

[34] Bodony D. Analysis of sponge zones for computational fluidmechanics. J Comput Phys 2006;212:681–702.

[35] Aftosmis M, Berger M, Melton J. Robust and efficient Cartesianmesh generation for component-based geometry. Paper 97-0196,AIAA; 1997.

[36] Young D, Melvin R, Bieterman M, Johnson F, Samant S, BussolettiJ. A locally refined rectangular grid finite element method: applica-tion to computational fluid dynamics and computational physics. JComput Phys 1991;92:1–66.

[37] Khokhlov A. Fully threaded tree algorithms for adaptive refinementfluid dynamics simulations. J Comput Phys 1998;143:519–43.

[38] Warren G, Anderson W, Thomas J, Krist S. Grid convergence foradaptive methods. Paper 91-1592, AIAA; 1991.

[39] Coirier W. An adaptively-refined, Cartesian, cell-based scheme forthe Euler and Navier–Stokes equations. TM 106754, NASA; 1994.

[40] Barth T. Recent developments in high order k-exact reconstructionon unstructured meshes. Paper 93-0668, AIAA; 1993.

[41] Alkishriwi N, Meinke M, Schroder W. A large-eddy simulationmethod for low mach number flows using preconditioning andmultigrid. Comput Fluids 2006;35:1126–36.

[42] Tritton D. Experiments on the flow past a circular cylinder at lowReynolds numbers. J Fluid Mech 1959;6:547–67.

[43] Dennis S, Chang G-Z. Numerical solutions for steady flow past acircular cylinder at Reynolds numbers up to 100. J Fluid Mech1970;42:471–89.

[44] Provansal M, Mathis C, Boyer L. Benard–von Karman instability:transient and forced regimes. J Fluid Mech 1987;182:1–22.

[45] Williamson C. Vortex dynamics in the cylinder wake. Ann Rev FluidMech 1996;28:477–539.

[46] Whitfield D. Three dimensional unsteady Euler equation solutionsusing flux vector splitting. UTSI Publication No. E02-4005-023-84.In: Notes for computational fluid dynamics user’s workshop,Tullahoma, Tennessee, March 1984; 1984.

[47] De Palma P, de Tullio M, Pascazio G, Napolitano M. An immersed-boundary method for compressible viscous flows. Comput Fluids2006;35:693–702.

[48] Liu C, Zheng X, Sung C. Preconditioned multigrid methods forunsteady incompressible flows. J Comput Phys 1998;139:35–57.

[49] Mittal R, Balachandar S. On the inclusion of three-dimensionaleffects in simulations of two-dimensional bluff-body wake flows. In:Proceedings, ASME fluids engineering division summer meeting;1997.