An Adaptive Two-dimensional Mesh Refinement

0 downloads 0 Views 135KB Size Report
Abstract. Mesh generation is one of the key issues in Computational Fluid Dy- namics. This paper presents an adaptive two-dimensional mesh refinement.
An Adaptive Two-dimensional Mesh Refinement Method for the Problems in Fluid Engineering Zhenquan Li Department of Mathematics and Computing Science, The University of the South Pacific, Suva, FIJI [email protected]

Abstract. Mesh generation is one of the key issues in Computational Fluid Dynamics. This paper presents an adaptive two-dimensional mesh refinement method based on the law of mass conservation. The method can be used to a governing system that includes the law of mass conservation (continuity equation) for incompressible or compressible steady flows. We show one example that demonstrates the streamlines constructed using the refined mesh is accurate.

1 Introduction There are a large number of publications on mesh adaptive refinements and their applications. The Berger-Oliger method is one of the well-known adaptive mesh refinements [5]. The refinement criterion for this method is local truncation errors. As the solution progresses mesh points with high local truncation errors are flagged. Fine meshes are created such that all the flagged points are interior to some fine mesh. The method suits for solving hyperbolic partial differential equations on structured computational domains and the refinement factor is the same in both space and time. The method has been extended to other applications [e.g. 4, 3, 1]. The other common methods include h-refinement (e.g. [10]), p-refinement (e.g. [2]) or r-refinement (e.g. [12]), with various combinations of these also possible (e.g. [6, 7]). The overall aim of any adaptive algorithm is to allow a balance to be obtained between accuracy and computational efficiency. Mass conservation is a key issue for accurate streamline construction of flow fields. In particular, failure to conserve mass can produce errors that cannot be eliminated by reducing the integration step and which can generate artificial effects, such as false spiraling [11]. Mass conservative streamline tracking methods for twodimensional and three-dimensional CFD velocity fields have produced much more accurate streamlines than non-mass conservative methods [8, 9]. We describe an adaptive mesh refinement method based on the law of mass conservation for two-dimensional incompressible flows in this paper. We assume that f is a scalar function depending only on spatial variables such that its product with the linear interpolation of velocity fields at the nodes of a triangle satisfies the law of

mass conservation on the triangle. The criteria for mesh refinement are the scalar functions f not equalling zero or infinity. The method introduced in this paper can be used for compressible steady flows by replacing the vector fields by the momentum fields.

2 The Mass Conservative Conditions for Linear Interpolations of Vector Fields over Triangle Domains Assume that Vl = AX + B is the linear interpolation of a vector field at the three vertexes in a triangle, where A is a 2-by-2 constant matrices, B and X are twodimensional vertical vector. Vl is unique if the area of the triangle is not zero [8]. Mass conservation for an incompressible fluid means that ∇ ⋅ Vl = trace( A) = 0 .

Let f be a scalar function depending only on spatial variables. We assume that f Vl satisfies the law of mass conservation first and then calculate the expressions of f . For incompressible flows, the mass conservation means ∇ ⋅ ( f Vl ) = 0 , or in Cartesian coordinates, ∂ ( fV x ) ∂ fV y (1) + =0, ∂x ∂y

( )

(

where Vl = V x , V y

)T . If Vl = AX+ B , then (1) can be written as

df (2) = −(a11 + a 22 ) f dt df ∂f ∂f ∂f is the material derivative. We can calculate the where = + Vx + Vy dt ∂t ∂x ∂y

expressions of f from (2). Table 1 shows the Jacobian of matrix A and corresponding expressions of f for all possible cases in which the linear interpolations of the vector fields over triangle domains do not hold the law of mass conservation. The conditions (MC) that f Vl satisfies the law of mass conservation in its triangle domains are the functions f in Table 1 not equalling zero or infinity in these triangles.

3 The Adaptive Mesh Refinement Method This section presents how to refine a given mesh. The unstructured mesh is usually used in practice and the most of the elements are quadrilateral. The adaptive refinement method is for each element in a mesh. Fig.1 is a quadrilateral element of a mesh.

The conditions (MC) are for triangles only. The following process describes how to use the conditions (MC) to refine a quadrilateral element in a given mesh. Table 1: Jacobian and expressions of f for all possible cases of a non mass conservative linear field

Case

Jacobian

1

 r1  0

0  ( 0 ≠ r1 ≠ r2 ≠ 0 ) r2 

2

 r1  0

0  ( r1 ≠ 0 ) 0 

f C   b  b   y1 + 1  y 2 + 2  r1  r2   C b y1 + 1 r1

C

3

4

 r 1  ( r ≠ 0 )  0 r

 µ  − λ

λ  ( µ ≠ 0, λ ≠ 0 ) µ 

b    y2 + 2  r  

2

C  µb − λb2  y1 + 1  µ 2 + λ2 

2

  λb + µb2  +  y2 + 1   µ 2 + λ2  

   

2

where c is a constant. The refinement process is as follows. 1) Subdivide the quadrilateral into two triangles and check if Vl satisfies the law of mass conservation on both triangles. If yes, no refinement for the quadrilateral is required. If no, go to Step 2.

Fig.1. An element in a mesh.

Fig. 2. Subdividing the element into four elements.

2) Apply the conditions (MC) to both of the triangles. If the conditions (MC) are satisfied on both triangles, there is no need to subdivide the element. Otherwise, we need to subdivide the element into a number of small elements such that the lengths of all sides of the small elements are truly re-

duced (e.g. half). Fig. 2 is an example that subdivides an element into four small quadrilaterals by connecting the midpoints of its non-neighboring sides. Fig. 3 is an example that subdivides the element into nine small quadrilaterals. 3) Take the elements in the subdivided quadrilateral in Fig. 2 or Fig. 3 as new elements of the mesh by replacing the initial element in Fig. 1 and repeat these three steps until a pre-specified threshold number T is reached.

Fig. 3. Subdividing the element into nine elements.

Fig. 4. Subdividing the triangle into small elements.

The threshold number T equals one in Fig. 2. A triangle is a special quadrilateral and can also be subdivided as the same as the element in Fig. 1. Fig. 4 shows a triangle can be subdivide into four elements. It is the fact that every simple closed polygon with more than three vertices can be split into only triangles [13]. Thus the conditions (MC) can be used to any shape of elements in a mesh. Because this adaptive mesh refinement method is element based, it can be used to both structured and unstructured meshes. The connectivity of the initially generated mesh is given while generating the mesh. The connectivity is easy to generate in the refined elements. Since the adaptive refinement method is element based, the connectivity is easy to work out for the refined mesh by making some appropriate changes to the initial connectivity and then inserting the connectivity of refined elements.

4 Example One example is shown here to demonstrate the effectiveness of the adaptive mesh refinement method. In the example, exact velocity field is used to show that the values at the nodes of the refined mesh can present the field very well by comparing the exact streamlines with the constructed streamlines using the values. We use the exact streamline expressions for linear vector fields in streamline drawing processes [14]. The threshold number T can be infinity in the example but we can only choose T as an integer. The bigger the threshold number T (or the more number of refinements), the more accurate the streamlines can be constructed based on the values at the nodes of the refined mesh. We refined the mesh in the example for T=4. The red lines in the following figures are the exact streamlines, the green line is the streamline constructed using the refined mesh, and the blue line is the streamline constructed using the unrefined mesh. The example here is using a structured mesh and the subdivision schemes subdivide a square into four equal squares.

Example: Velocity field

(

)

T

V = 26 y + x 2 y, 16 x − xy 2 . The closed streamline can be used to check if a numerical method is accurate. We here use a closed streamline to check how well the refined mesh can be used to present the velocity field.

Fig. 5. Constructed streamline (green) using refined mesh with seed at (5, 0).

Fig. 6. Constructed streamline (blue) using initial mesh with seed at (5, 0).

The streamline with the same seed using the initial mesh is shown in Fig. 6. It is clear that the values of the velocity field at the nodes of the refined mesh present the exact velocity field very well by comparing the streamlines in the above latter two figures. The error is about 0.05 using the refined mesh, i.e., the x-coordinate of the intersection of the green streamline with the positive x-axis is about 5.05 with starting from seed point (5, 0 )T .

5

Discussion

The adaptive mesh refinement method given in this paper can find the accurate positions of some phenomena such as the core of vortex by refining the regions in which the structure of flows may be complicated. The applications of the adaptive mesh refinement method in practice will be further research topics.

References 1. Almgren, A., Bell, J., Colella, P., Howell, L., Welcome, M.: A conservative adaptive

projection method for the variable density incompressible Navier-Stokes equations. J. Comp. Phys. 142 (1998) 1–46 2. Babuska, I., Szabo, B.A., Katz, I.N.: The p-Version of the Finite Element Method. SIAM. J. on Numer. Anal. 18 (1981) 515–545

3. Bell, J., Berger, M., Saltzman, J., Welcome, M.: Three dimensional adaptive mesh refinement for hyperbolic conservation laws. J. Sci. Comp. 15(1)(1994) 127–138 4. Berger, M.J., Colella, P.: Local adaptive mesh refinement for shock hydrodyamics. J. Comp. Phys. 82(1)(1989) 64–84 5. Berger, M.J., Oliger, J.: Adaptive Mesh Refinement for Hyperbolic Partial Differential Equations. J. Comp. Phys. 53(1)(1984) 484–512 6. Capon, P.J., Jimack P.K.: An Adaptive Finite Element Method for the Compressible NavierStokes Equations. In: Baines, M.J., Morton, K.W. (eds.): Numerical Methods for Fluid Dynamics 5. OUP (1995) 327–334 7. Demkowicz, L., Oden, J.T., Rachwicz, W., Hardy, O.: An h-p Taylor-Galerkin Finite Element Method for the Compressible Euler Equations. Comp. Meth. In Appl. Mech and Eng. 88(1991) 363–396 8. Li, Z.: A Mass Conservative Streamline Tracking Method for Two Dimensional CFD Velocity Fields. J. Flow Visual. And Image Proc. 9(3)(2002) 75–87 9. Li, Z.: A Mass Conservative Streamline Tracking Method for Three Dimensional CFD Velocity Fields. Proc. FEDSM’03, FEDSM2003-45526 (2003) 1–6 10. Lohner, R.: An Adaptive Finite Element Scheme for Transient Problems in CFD. Comp. Meth. in Appl. Mech. and Eng., 61(1987) 323-338 11. Mallinson, G: The Calculation of the Lines of a Three Dimensional Vector Fields. In: Davies, G. de Vahl, Fletcher, C. (eds.): Computational Fluid Mechanics, North Holland (1988) 525-534 12. Miller, K., Miller, R.: Moving Finite Elements. Part I. SIAM J. on Numer. Anal., 18(1981) 1019-1032

13. Nielson, G. M.: Tools for Triangulations and Tetrahedrizations and Constructing Functions Defined over Them. In: Nielson, G.M., Hagen, H., Mueller, H., (eds.): Scientific Visualization: Overviews, Methodologies, and Techniques. IEEE CS Press (1997) 429-526 14 Nielson, G. M., Jung, I.-H., Srinivasan, N., Sung, J., Yoon, J.-B.: Tools for Computing Tangent Curves and Topological Graphs for Visualizing Piecewise Linearly Varying Vector Fields over Triangulated domains. In: Nielson, G.M., Hagen, H., Mueller, H., (eds.): Scientific Visualization: Overviews, Methodologies, and Techniques. IEEE CS Press (1997) 527-562