• 검색 결과가 없습니다.

Finite Difference Schemes for Incompressible Flows on Fully Adaptive Grids

N/A
N/A
Protected

Academic year: 2022

Share "Finite Difference Schemes for Incompressible Flows on Fully Adaptive Grids"

Copied!
10
0
0

로드 중.... (전체 텍스트 보기)

전체 글

(1)

 2006 Birkh¨auser Verlag Basel/Switzerland

Finite Difference Schemes for Incompressible Flows on Fully Adaptive Grids

Fr´ ed´ eric Gibou, Chohong Min and Hector Ceniceros

Abstract. We describe a finite difference scheme for simulating incompressible flows on nonuniform meshes using quadtree/octree data structure. A semi- Lagrangian method is used to update the intermediate fluid velocity in a standard projection framework. Two Poisson solvers on fully adaptive grids are also described. The first one is cell-centered and yields first-order accu- rate solutions, while producing symmetric linear systems (see Losasso, Gibou and Fedkiw [15]). The second is node-based and yields second-order accurate solutions, while producing nonsymmetric linear systems (see Min, Gibou and Ceniceros [17]). A distinguishing feature of the node-based algorithm is that gradients are found to second-order accuracy as well. The schemes are fully adaptive, i.e., the difference of level between two adjacent cells can be arbi- trary. Numerical results are presented in two and three spatial dimensions.

Mathematics Subject Classification (2000). Primary 99Z99; Secondary 00A00.

1. Introduction

Incompressible flows are at the center of countless applications in physical sci- ences. Uniform Cartesian grids used in numerical simulations are limited in their ability to resolve small scale details and as a consequence nonuniform meshes are often used in practice. For example, see the approach of Almgren et al. [1] (and the references therein) for the Navier-Stokes equations on block structured grids.

Since the work of [2] on compressible flows, adaptive mesh refinement techniques have been widely used. In the case of incompressible flows, adaptive mesh strate- gies are quite common (see, e.g., [7]), but implementations based on the optimal quadtree/octree data structure is less common.

In the case of a standard projection method (see, e.g., [4, 3]), the most compu- tationally expensive part comes from solving a Poisson equation for the pressure.

This is also the limiting part in terms of accuracy, since high-order accurate (and unconditionally stable) semi-Lagrangian methods exist for the convective part. In

(2)

∆x

∆y

ui+1/2,j,k

vi,j+1/2,k

(i,j,k)

∆z

i,j,k−1/2

w p

T,

* u

u u

u 5

3 u1* 2

*

*

*

*

4

ρ, Φ

Figure 1. Left: the domain is tiled with cells of sizes varying accord- ing to the refinement criterion. Right: Zoom of one computational cell.

The velocity components u, v and w are defined on the cell faces while the pressure p is defined at the center of the cell. The density ρ, the temperature T and the level set function φ are stored at the nodes.

[18], Popinet proposed second-order nonsymmetric numerical method to study the incompressible Navier-Stokes equations using an octree data structure. In [15], Losasso et al. extended the nonsymmetric discretization of [18] proposing a sym- metric solution of the Poisson equation. This work relies on the observation that, in the case of the Poisson equation, first-order perturbations in the location of the solution yield consistent schemes (see [6]). Losasso et al. [14] recently extended the work of Lipnikov et al. [12] to the case of arbitrary grids to propose a second- order accurate symmetric discretization of the Poisson equation. In [17], Min et al.

proposed a second-order accurate scheme that also yields second-order accurate gradients. In this case the linear system is nonsymmetric, but diagonally dominant.

2. The octree data structure

In [15], Losasso et al. proposed a solver for the incompressible Euler equations on fully adaptive grids. The domain is tiled with cells as depicted in Figure 1 and the mesh is refined automatically in order to capture the local details critical to realistic simulations and coarsened elsewhere. An octree data structure is used (see [19]) for efficient processing and the different variables are stored as depicted in Figure 1: The velocity components u, v and w are stored at the cell faces while the pressure is stored at the center of the cell. This is the standard MAC grid arrangement used in previous works (see, e.g., [8]). However, in the case of nonuniform meshes it is more convenient to store the other quantities such as the density ρ, the temperature T and the level set function φ at the nodes of each cell.

This stems from the fact that interpolations of ρ, φ and T are more difficult with cell-centered data as discussed in [22].

(3)

3. Navier-Stokes equations on octrees

The motion of fluids is described by the incompressible Navier-Stokes equations for the conservation of momentum and mass:

ut+ u· ∇u = −∇p + f, (3.1)

∇ · u = 0, (3.2)

where u = (u, v, w) is the velocity field, f accounts for the external forces and where the spatially constant density of the mixture has been absorbed in the pressure p.

Viscous effects are ignored.

A projection method [4] (see also [3]) is used to solve equations 3.1 and 3.2:

First an intermediate velocity u is computed over a time step t, ignoring the pressure term

u− u

t + u· ∇u = f. (3.3)

This step, accounting for the convection and the external forces, is followed by a projection step to account for incompressibility and boils down to solving the Poisson equation

2p = 1

t∇ · u. (3.4)

Finally, the pressure correction is added to define the new velocity field u:

u = u− ∆t∇p. (3.5)

The reader is referred to [15] and the references therein for details in the simulations of free surface flows.

3.1. Finding the intermediate velocity

The intermediate velocity u is found by solving equation 3.3 using a first-order accurate semi-Lagrangian method. In the case of nonuniform grids, the standard high-order accurate upwind methods (see, e.g., [9, 20, 13]) traditionally used in the case of uniform grids are not well suited due to their stringent time step restrictions and the complexity of their implementations. On the other hand, semi-Lagrangian methods (see, e.g., [21]) are unconditionally stable and are straightforward to implement.

3.2. The divergence operator

Equation 3.4 is solved by first evaluating the right-hand side at every grid point in the domain. Then, a linear system for the pressure is constructed and inverted.

Consider the discretization of equation 3.4 for a large cell with dimensionsx, y andz neighboring small cells as depicted in Figure 1 (left). Since the discretiza- tion is closely related to the second vector form of Green’s theorem that relates a volume integral to a surface integral, we first rescale equation 3.4 by the volume of the large cell to obtain

Vcellt∇2p = Vcell∇ · u. (3.6)

(4)

∆ y

x

p p

p p

1 10

6 pa p^x 2

py px

Cell 1 Cell 2 Cell 10

Cell 6

Figure 2. Discretization of the pressure gradient. The pressure values p1, p2, p6, and p10 are defined at the center of the cells. pa represents a weighted average pressure value. py defines the y component of the pressure gradient between Cell 1 and Cell 10 defined by standard central differencing. ˆpxrepresents the discretization of the x component of the pressure gradient between Cell 1 and Cell 2, whereas px is a O(x) perturbation of ˆpx.

The right-hand side of equation 3.6 now represents the quantity of mass flowing in and out of the large cell within a time stept in m3s−1. This can be further rewritten as

Vcell∇ · (u− t∇p) = 0. (3.7) This equation implies that the term∇p is most naturally evaluated at the same location as u, namely at the cell faces, and that there is a direct correspondence between the components of the vectors ∇p and u. That is, there is a direct correspondence between px and u, py and v, pz and w, which live on the right and left faces, top and bottom faces, front and back faces, respectively. Moreover, substituting equation 3.5 into equation 3.7 implies Vcell∇ · u = 0 or ∇ · u = 0 as desired.

Invoking the second vector form of Green’s theorem, one can write Vcell∇ · u= 

faces

(uface· n) Aface, (3.8)

where n is the outward unit normal of the large cell and where Aface represents the area of a cell face. In the case of Figure 1 (left), the discretization of the x component ∂u/∂x of the divergence reads

xyz∂u

∂x = u2A2+ u3A3+ u4A4+ u5A5− u1A1, (3.9)

(5)

Figure 3. High-resolution simulation illustrating the motion of a solid object through shallow water (left), the subsequent flow that reflects off the wall (center), and the eventual cresting and overturning of waves generated by this process (right). Reprinted from [15]

where the minus sign in front of u1A1accounts for the fact that the unit normal points to the left. In this example, the discretization of ∂u/∂x amounts to

∂u

∂x = 1

x

u2+ u3+ u4+ u5

4 − u1

. (3.10)

The y and z directions are treated similarly.

3.3. Defining the pressure derivative to obtain a symmetric linear system Once, the divergence is computed at the grid node, equation 3.4 is used to construct a linear system of equations for the pressure. Invoking again the second vector form of Green’s theorem, one can write

Vcell∇ · (t∇p) = 

faces

((t∇p)face· n) Aface. (3.11)

Therefore, once the pressure gradient is computed at every face, we can carry out the computation in a similar manner as for the divergence of the velocity described above.

In Gibou et al. [6], we showed that O(x) perturbations in the location of the solution sampling still yield consistent approximations. This was then exploited in [15] to define∇p in order to construct a symmetric linear system. We simply define

px=p2− p1

 ,

where can be defined as  = x, which is the size of the large cell or  =12x, which is the size of the small cell, or as the Euclidean distance between the loca- tions of p1and p2or as the distance along the x direction between the locations of p1 and p2 etc. In fact, in light of Theorem 4.1, we understand that there is some leeway in defining. Numerical tests against analytical solutions equation were presented in [15] to demonstrate that this scheme is convergent.

(6)

Figure 4. High-resolution simulation of the formation of a milk crown illustrating the capability of emulating surface tension. Reprinted from [15].

4. Second-order schemes for Poisson

The method in [15] is first-order accurate on fully adaptive grid and yields a sym- metric linear system. This work was extended to second-order accuracy in Losasso et al. [14] using ideas from Lipnikov et al. [12]. We have presented in Min et al. [17] a Poisson solver on fully adaptive grids that produces second-order accu- rate solutions with second-order accurate gradients. This scheme yields diagonally dominant linear systems and is straightforward to implement. In particular, the discretization associated with one grid nodes involves only two (2D) or three (3D) adjacent cells, producing a scheme straightforward to implement.

4.1. Analysis

Theorem 4.1 (from [17]). Consider a finite difference foru = f that is mth-order accurate at locally uniform cell and nth-order accurate at locally nonuniform cell with m, n≥ 1. Then, it is globally min(m, n + 1)th-order accurate in L norm.

This means that second-order accuracy in the maximum norm can be achieved with discretizations that are only first-order accurate at locally nonuniform points, but that reduce to second-order accurate at locally uniform points. Consider a Cartesian domain Ω∈ Rn with boundary ∂Ω and the variable Poisson equation

∇ · (ρ∇u) = f on Ω with Dirichlet boundary condition u|∂Ω= g. We assume that the variable coefficient ρ is bounded from below by a positive constant.

In one spatial dimension, standard central differencing formulas read:



ui−1− ui

si1 2

·ρi−1+ ρi

2 +ui+1− ui

si+1 2

·ρi+1+ ρi

2



· 2

si1 2 + si+1

2

= fi,

where si−1/2 is the distance between nodes i− 1 and i. Authors have often been mislead by Taylor analysis and concluded that such schemes are only first-order accurate. However, they are second-order accurate. This has been observed ana- lytically (see, e.g., [16, 11] and numerically [5], [10]).

This discretization can be applied in a dimension by dimension framework.

However, special care needs to be taken when vertices are no longer aligned (see,

(7)

Figure 5. Left: Discretization at u0in the case of a nonuniform mesh.

Right: Domain Ω = [0, π]2and original mesh used in example 4.2.1.

e.g., Figure 5 [left]). In this case, [17] propose to use the truncation error in linear interpolation in the transverse direction as part of the stencil for the derivative in the other direction, leading to a more compact stencil, and an M-matrix. For example, referring to Figure 5 (left) the discretizations for (ρux)xand (ρuy)yalong with their Taylor analysis are given respectively by

u1− u0

s1 ·ρ1+ ρ0

2 +s6D5+ s5D6 s5+ s6

· 2

s1+ s4 (4.1)

= (ρux)x+ s5s6

(s1+ s4)s4(ρuy)y+ O(h),

and

u2− u0

s2 ·ρ2+ ρ0

2 +u3− u0

s3 ·ρ3+ ρ0 2

· 2

s2+ s3

(4.2)

= (ρuy)y+ O(h), with

D5 = u5s−u0

4 · ρ52 0, D6 = u6s−u0

4 · ρ62 0. The spurious term (ss5s6

1+s4)s4(ρuy)y is cancelled by weighting appropriately equations (4.1) and (4.2) as

u1−u0

s1 ·ρ12 0 +s6as5+s5a6

5+s6

· s1+s2 4

+

u2−u0

s2 ·ρ22 0 +u3s−u0

3 ·ρ32 0

· s2+s2 3 ·

1(s1s+s5s46)s4

= f0+ O(h).

The discretization obtained is now first-order accurate at locally nonuniform points and second-order accurate at locally uniform points, hence yields a globally second-order accurate scheme in the maximum norm in light of Theorem 4.1.

(8)

Effective Resolution Error in the Lnorm Order Error in the L1 norm Order

322 4.18× 10−1 9.25× 10−2

642 9.11× 10−2 2.20 2.09× 10−2 2.15

1282 2.31× 10−2 1.98 5.29× 10−3 1.99

2562 5.89× 10−3 1.97 1.33× 10−3 1.99

5122 1.49× 10−3 1.98 3.35× 10−4 1.99

Table 1. Second-order accuracy in the solution of example 4.2.1.

4.2. Numerical experiments

We report numerical evidences that confirm the schemes described above yield second-order accuracy in the L1 and L norms for both the solution and its gradients, on highly irregular grids. In particular the difference of level between cells can be greater that one, illustrating that the method preserves its second- order accuracy on fully adaptive meshes. The linear systems of equations are solved using a bi-conjugate gradient method with an incomplete Cholesky preconditioner.

4.2.1. Accuracy on solution. Consider a domain and a grid depicted in Figure 5 [right] and∇ (ρ∇u) = f with an exact solution of u(x, y) = sin(x) + sin(y) and density ρ = sin(x) sin(y) + 2. Dirichlet boundary conditions are imposed on the boundary. Table 1 demonstrates second-order accuracy in the L1and Lnorms.

4.2.2. Accuracy on gradient. One distinguishing feature of this algorithm is that it yields second-order accuracy in the maximum norm for the solution’s gradients as well. This is achieved by removing spurious error with procedures related to those presented above, i.e., referring to the notations in Figure 5 (left), the gradient at u0 is calculated as:

ux = u4s−u0

4 · s1s+s1 4 +u0s−u1

1 ·s1s+s44 2ss4(s5s16+ss14)uyy, uy = u3s−u0

3 · s2s+s2 3 +u0s−u2

2 ·s2s+s33, where

uyy=

u3− u0

s3

+u2− u0

s2

· 2

s2+ s3

.

Consider a domain and a grid depicted in Figure 5 (right) and∇ (ρ∇u) = f with an exact solution of u(x, y) = sin(x)+ sin(y) and density ρ = sin(x) sin(y)+ 2.

Dirichlet boundary conditions are imposed on the boundary. Table 2 demonstrates second-order accuracy of the gradient in the L1and Lnorms.

(9)

Effective Resolution Error in the Lnorm Order Error in the L1 norm Order

642 4.25× 10−2 9.48× 10−3

1282 1.66× 10−2 1.36 2.41× 10−3 1.98

2562 4.42× 10−3 1.91 5.81× 10−4 2.05

5122 1.12× 10−3 1.98 1.41× 10−4 2.04

10242 2.78× 10−4 2.01 3.46× 10−5 2.03

Table 2. Convergence rate for example 4.2.2.

5. Conclusion

We have described finite difference schemes for simulating incompressible flows on nonuniform meshes. The quadtree (2D) and octree (3D) data structures allowed for an efficient representation of the mesh. In particular, we have described two different schemes for solving the Poisson equation. The first one is cell-centered and yields first-order accurate solutions, while producing symmetric linear systems [15]. The second is node-based and yields second-order accuracy for the solution and its gradients, while producing nonsymmetric linear systems [17]. The schemes are fully adaptive, i.e., the difference of level between two adjacent cells can be arbitrary.

References

[1] A. Almgren, J. Bell, P. Colella, L. Howell, and M. Welcome. A conservative adaptive projection method for the variable density incompressible Navier-Stokes equations.

J. Comput. Phys., 142:1–46, 1998.

[2] M. Berger and J. Oliger. Adaptive mesh refinement for hyperbolic partial differential equations. J. Comput. Phys., 53:484–512, 1984.

[3] D. Brown, R. Cortez, and M. Minion. Accurate projection methods for the incom- pressible Navier-Stokes equations. J. Comput. Phys., 168:464–499, 2001.

[4] A. Chorin. A Numerical Method for Solving Incompressible Viscous Flow Problems.

J. Comput. Phys., 2:12–26, 1967.

[5] F. Gibou and R. Fedkiw. A fourth-order accurate discretization for the laplace and heat equations on arbitrary domains, with applications to the Stefan problem. J, Comput. Phys., 202:577–601, 2005.

[6] F. Gibou, R. Fedkiw, L.-T. Cheng, and M. Kang. A second-order accurate symmet- ric discretization of the Poisson equation on irregular domains. J. Comput. Phys., 176:205–227, 2002.

[7] F. Ham, F. Lien, and A. Strong. A fully conservative second-order finite difference scheme for incompressible flow on nonuniform grids. J. Comput. Phys., 117:117–133, 2002.

(10)

[8] F. Harlow and J. Welch. Numerical calculation of time-dependent viscous incom- pressible flow of fluid with free surface. Phys. Fluids, 8:2182–2189, 1965.

[9] A. Harten, B. Enquist, S. Osher, and S Chakravarthy. Uniformly high-order accurate essentially non-oscillatory schemes III. J. Comput. Phys., 71:231–303, 1987.

[10] H. Johansen and P. Colella. A Cartesian grid embedded boundary method for Pois- son’s equation on irregular domains. J. Comput. Phys., 147:60–85, 1998.

[11] H.O. Kreiss, H.-O. Manteuffel, T.A. Schwartz, B. Wendroff, and A.B. White Jr.

Supra-convergent schemes on irregular grids. Math. Comp., 47:537–554, 1986.

[12] K. Lipnikov, J. Morel, and M. Shashkov. Mimetic finite difference methods for diffu- sion equations on non-orthogonal non-conformal meshes. J. Comput. Phys., 199:589–

597, 2004.

[13] X.-D. Liu, S. Osher, and T. Chan. Weighted essentially non-oscillatory schemes. J.

Comput. Phys., 126:202–212, 1996.

[14] F. Losasso, R. Fedkiw, and S. Osher. Spatially adaptive techniques for level set methods and incompressible flow. Computers and Fluids (in press).

[15] F. Losasso, F. Gibou, and R. Fedkiw. Simulating water and smoke with an octree data structure. ACM Trans. Graph. (SIGGRAPH Proc.), pages 457–462, 2004.

[16] T. Manteuffel and A. White. The numerical solution of second-order boundary value problems on nonuniform meshes. Math. Comput., 47 (176):511–535, 1986.

[17] C. Min, F. Gibou, and H. Ceniceros. A simple second-order accurate finite difference scheme for the variable coefficient poisson equation on fully adaptive grids. CAM report 05-29, Submitted to J. Comput. Phys.

[18] S. Popinet. Gerris: A tree-based adaptive solver for the incompressible euler equa- tions in complex geometries. J. Comput. Phys., 190:572–600, 2003.

[19] H. Samet. The Design and Analysis of Spatial Data Structures. Addison-Wesley, New York, 1989.

[20] C.-W. Shu and S. Osher. Efficient implementation of essentially non-oscillatory shock capturing schemes II (two). J. Comput. Phys., 83:32–78, 1989.

[21] A. Staniforth and J. Cote. Semi-Lagrangian Integration Schemes for Atmospheric Models: A Review. Monthly Weather Review, 119:2206–2223, 1991.

[22] J. Strain. Fast tree-based redistancing for level set computations. J. Comput. Phys., 152:664–686, 1999.

Fr´ed´eric Gibou

Department of Mechanical Engineering & Department of Computer Science Bldg II, room 2334, UCSB, CA 93111, USA

e-mail: fgibou@engineering.ucsb.edu Chohong Min

Department of Mathematics, UCSB, CA 93106, USA e-mail: chohong@math.ucsb.edu

Hector Ceniceros

Department of Mathematics, UCSB, CA 93106, USA e-mail: hdc@math.ucsb.edu

참조

관련 문서

On applying an iterative method to solve the discrete Poisson equation which is related to an nonsymmetric matrix, it is noted in [17] that if the related matrix is

The local flux matching method finds a numerical solution in the same solution space of the DG type nonconforming element method, but it achieves much faster iterative

We proposed first and second order numerical methods based on a new convex splitting of the Swift–Hohenberg energy functional for the phase-field crystal equation..

In this case, we choose to store all the variable at the grid nodes in order to develop a simple supra-convergent scheme for the Poisson equation as well as a

Also in surface reconstruction, there are some researches[13, 17] using the adaptive grid in order to generate high resolution.. We employ the octree which is a sort of

In this paper, we study the long time behavior of degenerate compressible Navier-Stokes equations with damping based on [4] with finite energy.. In gen- eral, we can

Thus, instead of using nominal Haar wavelets, the proposed method for numerical solution of linear and nonlinear and the system of integral equations of the second kind

Key words and phrases : Incompressible Navier-Stokes Equations, Mixed Finite Element Method, A posteriori error estimates, Iterative solvers, Ad-