• No se han encontrado resultados

Discretizaciones miméticas para dinámica de fluidos computacional: Caso uni-dimensional

N/A
N/A
Protected

Academic year: 2020

Share "Discretizaciones miméticas para dinámica de fluidos computacional: Caso uni-dimensional"

Copied!
6
0
0

Texto completo

(1)REVISTA INGENIERÍA UC. Vol. 11, No 3, 52-57, 2004. Discretizaciones miméticas para dinámica de fluidos computacional: Caso uni-dimensional M. Fagúndez(1), J. Medina(1), C. Cadenas(2), G. Larrazabal(1) Departamento de Computación, FACYT-Universidad de Carabobo, Valencia, Venezuela (2) Departamento de Matemática, FACYT- Universidad de Carabobo, Valencia, Venezuela Email: [email protected];[email protected];[email protected];[email protected] (1). Resumen Se presentan resultados preliminares en la simulación de flujo de fluidos uni-dimensional con métodos conservativos. Se exhiben diferentes esquemas numéricos para resolver las ecuaciones de Navier-Stokes y de compresibilidad artificial, dos de ellos son explícitos y los restantes implícitos. El primer esquema usa el método de operadores de soporte, el segundo mezcla este método con el de Crank-Nicolson, y los otros usan el método de Castillo Grone 2-2-2. Para resolver los sistemas de ecuaciones obtenidos por medio de los métodos implícitos, se usa la librería UCSparseLib la cual ha sido desarrollada en ANSI C. Además, se desarrolló un conjunto de herramientas para mostrar los resultados gráficamente usando OpenGL. Palabras clave: Métodos miméticos, Navier-Stokes, dinámica de fluidos.. Mimetic discretizations for computational fluid dynamics: uni-dimensional case Abstract Preliminary results in uni-dimensional fluid flow simulation based on conservative methods are presented. Several numerical schemes to solve Navier-Stokes and artificial compressibility equations, two of them explicit and two implicit are exhibited. The first uses Support-Operators method, the second scheme mixes this method with Crank-Nicholson’s and the others uses 2-2-2 Castillo-Grone method. For solving the systems of linear equations obtained through implicit methods, the UCSparseLib library is used which has been developed on ANSI C. Furthermore, a set of tools was developed to display results graphically using OpenGL. Keywords: Mimetic methods, Navier-Stokes, fluid dynamics. 1. INTRODUCTION The mimetic methods are based on the construction of discrete differential operators that mimic some fundamental properties of divergence and gradient operators, among others. About two decades ago the Support-Operators method was developed [4,5], which is based on considering discrete analog of Green's Theorem to obtain a derived discrete operator starting from a prime discrete operator, i. e., a differential operator is imposed as the prime, and starting from the discrete Green's identity the derived operator is obtained. For furthers details on this methodology see [1]. For several methods related to the construction of mimetic discrete operators [6,7,9,10], as well as 52 Rev. INGENIERÍA UC. Vol. 11, No 3, Diciembre 2004. some of their applications [8,11], check http:// cnls.lanl.gov/~shashkov. A methodology to build discrete operators satisfaying Green´s generalized discrete theorem has been recently developed in [2], where higher order mimetic differential operatos can be built in the inner nodes as in the boundaries for 1D uniform grid. In this work, a set of operators obtained by the Support-Operators method as well as Castillo-Grone methods is used in order to simulate the flow of fluids in one dimension. In all cases staggered grids were used being necessary the using of grid functions. Some basic topics allowing the understadins of the notation to be used in the next sections are now present..

(2) Fagúndez, Medina, Cadenas y Larrazabal. 2. PRELIMINARY In this section the equations the equations governing the behavior of the fluids flow to be simulated are presented, as well as an introduction to the staggered uniform grids and grid functions generation. The discrete operators to obtain the differences schemes are also presented.. 2.1. Model problem. h = xi +1 − xi ; i = 1, L, M − 1. Figure 1. The staggered grid and grid functions.. Next, the equations to use in the Onedimensional flow of fluid simulations are show. They are the Navier-Stokes and Artificial Compressibility equations. ∂V ∂V 1 ∂p ∂2V +V =− +ν 2 on (a, b) and 0 < t < ∞ ∂t ∂x ∂x ρ ∂x. (1). 2.3. Discrete operators The discrete divergence and gradient operators given by the Support-Operators method for a staggered uniform grid are:. ( D g )i + 1. 2. 1 ∂p ∂V + = 0 on ( a , b ) and 0 < t < ∞ β ∂t ∂x. (2). where p is the pressure, V the velocity, ρ the density, ν the viscosity, t is the time and β the artificial compressibility parameter. Test cases were built using Dirichlet boundary conditions.. 2.2. Staggered grid and grid functions In this work a staggered uniform grid is used, which is defined by M nodes along the one dimension domain considered and M-1 cells. A cell is given by the set of points in between any pair of consecutive nodes. Usually, in order to identify a cell any point inside of it is utilized. For this porpuse, in this work is used as its identification. Hence, it there is a set {x1 , x 2 , L , x i , x i +1 , L , x M −1 , x M } of nodes with x1=0 and xM = 1 , then the set of cells will be denoted as {x 3 2 , x 5 2 , L , x i −1 2 , x i +1 2 , L , x M − 3 2 , x M −1 2 }. where. x i+1. 2. =. ( x i+1. + x i 2 ) ; i = 1, L , M − 1. As usually, two classes of grid functions are used: a nodal-valued and a cell-valued. The nodal-valued functions are defined as f: HC→HN whereas the cellvalued ones as of the form g: HN→HC such that HC is the space for cell-valued grid functions and HN, the space for nodal discretization. Figure 1 shows the staggered grid and grid functions to be used. The size of the cell will be denoted by:. ( Gf ) i. =. g i +1 − g i , h. ⎧ f 3 2 − f1 , ⎪ 2 h ⎪ ⎪⎪ f i +1 2 − f i −1 2 =⎨ , h ⎪ ⎪ f M − f M −1 2 , ⎪ h2 ⎪⎩. 1 ≤ i ≤ M −1. (3). i =1 2 ≤ i ≤ M −1. (4). i=M. In the 2-2-2 Castillo-Grone method, the equations for the gradient operator on the boundaries are modified, being obtained:. 3 1 ⎧ 4 ⎪ − 3 f1 + 2 f 3 2 − 6 f 5 2 , ⎪ h2 ⎪ ( Gf )1 = ⎨ 1 ⎪4 f − 3 f f M −3 2 M M −1 2 + ⎪3 2 6 , ⎪ h2 ⎩. i =1 (5). i=M. 3. EXPLICIT METHODS Two explicit difference equations for the problem given in (1) and (2) are here presented, using the discrete operators introduced in the previous section. In all the cases the differential equation is evaluated on a generic point xi or xi+1/2. The cell-valued functions are approximated by the average of the functions evaluated on the nodes. This is a second order approximation: Rev. INGENIERÍA UC. Vol. 11, No 3, Diciembre 2004. 53.

(3) Mimetic discretizations for computational fluid dynamics. f i +1/ 2 =. f i +1 + f i + O (h 2 ) 2. (6). Since equations (1) and (2) hold for every point of the domain, this is particularly true on the cells of the grid when time t= n∆t, where ∆t is the size of the discretization of the time and n = 0, 1, 2,… This is. ∂Vi +n1 2 ∂t. +V. n i +1 2. ∂Vi +n1 2 ∂x. n ∂ 2Vi +n1 2 1 ∂pi +1 2 =− +ν ∂x 2 ρ ∂x. n n 1 ∂pi +1 2 ∂Vi +1 2 + =0 ∂x β ∂t. (7). (8). ∂p. p 3n/+21 = p 3n/ 2 − qδ 5V n. where δ 5W = W5 2 + W3 / 2 − 2W1 depend on the method used. n. n. n. n. and δ3 and δ4. δ 3W n = W5n2 + W3n/ 2 − 2W1n and. δ 4W n = W5n2 − 3W3n/ 2 + 2W1n for the Support-Operators method and. δ 3W n = −(8 3)W1n + 2W3n/ 2 + (2 3)W5n/ 2. Now, equation (6) is used to approximate the discrete gradient operator of the pressure, i.e.. ∂x. n i +1 2. and. and. δ 4W n = (4 3)W5n2 − 4W3n/ 2 + (8 3)W1n for the Castillo-Grone method.. Then, approximations (3), (4) and (5) are applied to the operators involved in (7) and (8). On inner points, this is n +1 i +1 2. V. p. n +1 i + 1/ 2. =V. n i +1 2. = p. r. (1 − rδ V ) − ρ δ. n i +1 / 2. n. 1. − qδ 1V. p + sδ 2V n. 1. For the right boundary they are. (. ). VNn−+11/ 2 = VNn−1/ 2 1 − rδ 8V n −. r. ρ. δ 6 p n + sδ 7V n. n. and. p Nn+−11/ 2 = p Nn −1 / 2 − qδ 8V n. n. Where r = ∆t/2h, s = ∆tν/h2, q = β∆tν/2h with h = xi+1 -xi and the difference operators in δ1 and δ2 are defined by. n n n n where δ 8W = 2W N − W N −1 / 2 − W N − 3 / 2 and δ6 and δ7 depend on the method used.. δ 6W n = 2W Nn − W Nn−1 / 2 − W Nn−3 / 2 and. δ 1W n = W i +n 3 / 2 − W i −n1 / 2. δ 7W. and. n. = 2W Nn − 3W Nn −1 / 2 + W Nn − 3 / 2. for the Support-Operators method and. δ 2W n = W i +n 3 / 2 − 2W i +n1 / 2 + W i −n1 / 2 It is important to say that both δ1 and δ2 are used in the Support-Operators and Castillo-Grone methods. The difference between those methods is the gradient operator approximation on the boundaries.. δ 6W p = (8 3)WNp − 2WNp−1/ 2 − (2 3)WNp−3 / 2 and. δ 7W p = (8 3)WNp − 4WNp−1/ 2 + (4 3)WNp−3 / 2 for the Castillo-Grone method.. Next, the equations for the left boundary are. V3n2+1 = V3n2 (1 − rδ 5V n ) −. r. ρ. δ 3 p n + sδ 4V n. 54 Rev. INGENIERÍA UC. Vol. 11, No 3, Diciembre 2004.

(4) Fagúndez, Medina, Cadenas y Larrazabal. 4. IMPLICIT METHODS. ∆t = 10-3 with an initial value ∆x0 = 10-2. This value is decreased using ∆xi+1 = ∆xi/2, i = 0,1,2,.... In this section the difference equations are presented in an implicit way for the problem given in (1) and (2) using the Cranck-Nicolson method and the discrete operators given in the previous section. Substituting the difference operators (3-6), into equations (1) and (2) it is obtained:. Vi +n1+12 + Vi +n1 2. r r s δ1V n+1 + δ1 p n+1 − δ 2V n+1 = 2 2ρ 2. r s ⎛ ⎞ r Vi n+1 2 ⎜1 − δ1V n ⎟ − δ1 p n + δ 2V n 2 2 ⎝ ⎠ 2ρ. q q pin++11/ 2 + δ 1V n+1 = pin+1 / 2 − δ1V n 2 2 Next, the equations for the left boundary are n +1 32. V. +V. n 32. r r s δ 5V n+1 + δ 3 p n+1 − δ 4V n+1 = 2 2ρ 2. s ⎛ r ⎞ r V3n2 ⎜1 − δ 5V n ⎟ − δ 3 p n + δ 4V n 2 ⎝ 2 ⎠ 2ρ q q p3n/+21 + δ 5V n+1 = p3n/ 2 − δ 5V n 2 2 And for the right boundary they are. Figure 2. Sparse matrix structure for implicit methods.. 5.1. Case 1 A laminar flow, incompressible with constant cinematic viscosity between two parallel walls separated by a distance H is considered. Initially the two walls and the fluid are in stationary state. In the instant t = 0, one of the walls moves at a constant speed V0. This problem has an exact solution given by. V / V0 = 1 − x / H − ∞. VNn−+11/ 2 + VNn−1 / 2. r r s δ 8V n+1 + δ 6 p n+1 − δ 7V n+1 = 2 2ρ 2. s ⎛ r ⎞ r VNn−1/ 2 ⎜1 − δ 8V n ⎟ − δ 6 p n + δ 7V n 2 ⎝ 2 ⎠ 2ρ q q p Nn+−11/ 2 + δ 8V n+1 = p Nn −1/ 2 − δ 8V n 2 2. 2∑ n =1. 1 sen ( nπx / H ) exp( − n 2 π 2ν t / H 2 ) nπ. Once all simulations have been made, it is possible to obtain the behavoir shown in Figure 3, in which the value of the speed can be observed for each one of the nodes in a given moment. To stop the iterations it is used a tolerance of 10-2 for the energy norm of the error given by:. 5. NUMERICAL TESTS The purpose of these tests is to verify the behavior of the presented schemes. See the matrix structure for implicit cases in the Figure 2. To guarantee the stability of the method is used β = ν∆t/∆x2. For explicit methods ∆t = 10-5 and for implicit methods. 1/ 2. ⎛ M −1 h 2 ⎞ u = ⎜ ∑ ui * (xi+1 − xi )⎟ ⎜ i=1 ⎟ ⎝ ⎠ h. ( ). .. Figures 4 and 5 show the results obtained using the explicit and implicit methods respectively. Rev. INGENIERÍA UC. Vol. 11, No 3, Diciembre 2004. 55.

(5) Mimetic discretizations for computational fluid dynamics PRESSURE SCALE 0.04 VELO CITY 1.00E+00. 0.03. 0.02. 0.01 PRESSURE 0.00. Figure 3. Simulation with the explicit Support-Operators method. ρ = 996, ν = 0.804, ∆t = 10-5 and ∆t = 10-2.. 5.2. Case 2 The same as in the previous test, a fluid is considered between two parallel walls, but in this case the walls are fixed. An initial constant speed is set for all the nodes on the grid in the time t=0, as well as a constant pressure bigger than zero. The simulation process generates a parabolic function in the speed profile, which diminish while the time in the simulation increases. See Figure 6.. Figure 5. Comparison of Castillo-Grone 2-2-2 Explicit and Implicit results with the exact solutions.. 5.3. Case 3 In this case, constant speeds are set for each wall, but in opposite sense. The behavior of the simulation tends to a straight line along the profile of speeds of each one of the walls. See Figure 7. PRESSURE SCALE 20.92 VELO CITY. 2.00E+00. 15.69. 10.46. 5.23 PRESSURE 0.00. Figure 6. Case 2: Implicit Support-Operators method. ρ = 996, ν = 0.804, ∆t = 10-3 and ∆t = 10-2. Figure. 4. Comparison of Support-Operators Explicit and Implicit results with the exact solution.. 56 Rev. INGENIERÍA UC. Vol. 11, No 3, Diciembre 2004.

(6) Fagúndez, Medina, Cadenas y Larrazabal PRESSURE SCALE 0.03 VELO CITY. 1.00E+00. 0.00225. 0.015 -5.00E-01 0.0075 PRESSURE 0.00. Figure 7. Case 3: Implicit Castillo-Grone 2-2-2 method. ρ = 996, ν = 0.804, ∆t = 10-3 and ∆x = 10-2.. 6. CONCLUSIONS - The implemented methods converge in all test cases. - The results obtained in the simulations, in function of the boundary conditions, present a similar behavior to that which happens in reality. - In all cases, the tolerance of the error in the calculation of the solution of the linear systems by the BicGSTAB and GMRES methods were 10-12, accuracy generally reached in the initial iterations. That is why it is considered that it is not necessary to change the method unless higher precision is required. - In the calculation of the approximations of the differential equations through the mimetic methods, the error of the energy norm with regard to an analytic solution, is in the order of 10-2, being better with the approximation formulated by the 2-2-2 methods.. 7. ACKNOWLEDGMENTS To Professor José Castillo of San Diego State University for his collaboration.. REFERENCES [1]. M. Shashkov. Conservative Finite-Difference Methods on General Grids. CRC Press. Florida, USA, 1996 [2] J. Castillo and R. Grone A Matrix Analysis. Approach to Higher-Order Approximations for Divergence and Gradients Satisfying a Global Conservation Law. SIAM J. Matrix Anal. Appl. 25(1):128-142, 2003. [3] G. Larrazabal. UCSparseLib: Una Librería Numérica para la Resolución de Sistemas Lineales Dispersos. Facultad Experimental de Ciencias y Tecnología, Departamento de Computación, Universidad de Carabobo, 2002. [4] Samarskii, A., Tishkin, V., Favorskii, A., Shashkov, M. Operational Finite-Difference Schemes, Diff. Eqns., 17(7):854-862, 1981. [5] Samarskii, A., Tishkin, V., Favorskii, A., Shashkov, M. Employment of the ReferenceOperator Method in the Constrution of Finite Difference Analog of Tensor Operations, Diff. Eqns., 18(7):881-885, 1982. [6] J.E. Castillo, J. M. Hyman, M.J. Shashkov and S. Steinberg, High-Order Mimetic Finite Difference Methods on Nonuniform Grids, In ICOSAHOM-95, Proc. of the Third International Conference on Spectral and High Order Methods. Houston. Texas, 5-9. June, 1995.Special Issue of Houston Journal of Mathematics [7] J.E. Castillo, J.M. Hyman, M. Shashkov and S. Steinberg, Fourth-and Six-Order Conservative Finite Difference Approximations of the Divergence and Gradient, Applied Numerical Mathematics, 37:171-187. 2001. [8] J. Hyman, M. Shashkov and Stanly Steinberg, The Numerical Solution of Diffusion Problems in Strongly Heterogeneous Non-Isotropic Materials, Journal of Computational Physics 132:130-148. 1997. [9] J. Hyman and M. Shashkov, Adjoint Operators for the Natural Discretizations of the Divergence, Gradient, and Curl on Logically Rectangular Grids, Applied Numerical Mathematics 25:413442. 1997. [10] J. Hyman, M. Shashkov, Approximation of Boundary Conditions for Mimetic FiniteDifference Methods, Computers Math. Applic. 36(5):79-99. 1998. [11] M. Shashkov and S. Steinberg, Solving Diffusion Equations with Rough Coefficients in Rough Grids, Journal of Computational Physics. 129:383-405. 1996. [12] M. Potter, D. Wiggert, Mecánica de Fluidos, Thompson. 2002.. Rev. INGENIERÍA UC. Vol. 11, No 3, Diciembre 2004. 57.

(7)

Referencias

Documento similar