Reduced models to calculate stationary solutions for the lid-driven cavity problem
Full text
MASTER THESIS Reduced models to calculate stationary solutions for the lid-driven cavity problem María Muriel Gracia SUPERVISED BY Dr. Adeline de Villardi de Montlaur Dr. Jose Manuel Vega de Prada Universitat Politècnica de Catalunya Master in Aerospace Science & Technology July 2010
Reduced models to calculate stationary solutions for the lid-driven cavity problem BY María Muriel Gracia DIPLOMA THESIS FOR DEGREE Master in Aerospace Science and Technology AT Universitat Politècnica de Catalunya SUPERVISED BY: Dr. Adeline de Villardi de Montlaur EPSC (UPC) Dr. Jose Manuel Vega de Prada ETSI Aeronáuticos (UPM)
ABSTRACT This Master thesis presents a method that allows for the quick calculation of any steady state solution for flow problems with a Reynolds number within a selected range, namely, for which a steady state is reached. The method proposed here first requires to calculate various steady state solutions (for appropriate values of the Reynolds number) using a given computational fluid dynamics (CFD) code. These provided solutions are called snapshots and are then used to construct the model based on the combination of proper orthogonal decomposition (POD) and modal interpolation. This method is applied to the lid-driven cavity problem, which consists in studying the motion of an incompressible fluid inside a squared cavity, whose upper wall moves horizontally. When Reynolds numbers are not too large (for example here up to 10000) the flow converges to a steady state solution. The method is analyzed in connection with a) the number of snapshots that are needed for a given precision, b) the possibility of using high order singular value decomposition (HOSVD) instead of POD, c) the number of POD/HOSVD modes that must be retained and d) the overall computational efficiency of the reduced order model.
ACKNOWLEDGEMENTS First of all, I would like to thank Adeline de Villardi and José Manuel Vega for the daily help, support and dedication put in guiding this master thesis. I am also indebted to Filippo Terragni for providing me with the spectral CFD code to compute the snapshots that have been used along this dissertation, and both Filippo and Luis Santiago Llorente for their help and advices during the last ten months. In addition, I would like to thank the whole group of PhD students of the ETSI Aeronáuticos (UPM), in particular, Filippo, Robert, Juan Angel, Jose, David and Luis, who received me with opened arms, have made me feel in place at any moment and have always given me a hand when needed. Finally, thanks to my friends and family for their constant encouragement. In particular, I am deeply indebted to my boyfriend, Álvaro, and my parents, Jesús and Blanca, for their constant support and their infinite patient.
Table of Contents INTRODUCTION ........................................................................................................ 1 CHAPTER 1. BASICS ................................................................................................ 3 1.1. Motivation ............................................................................................................. 3 1.2. ROMs .................................................................................................................. 3 1.3. Objectives of the study ............................................................................................. 4 1.4. Thesis distribution ................................................................................................... 4 1.5. Results ................................................................................................................. 5 CHAPTER 2. POD AND SVD ..................................................................................... 7 2.1. Introduction ................................................................................................................................... 7 2.2. POD .............................................................................................................................................. 7 2.2.1. Inner product and norm .................................................................................................... 7 2.2.2. Mathematical formulation ................................................................................................. 8 2.2.3. Error of the method .......................................................................................................... 9 2.2.4. Orthogonal projection ..................................................................................................... 10 2.3. SVD ............................................................................................................................................ 10 2.3.1. Description of the method .............................................................................................. 10 2.3.2. Error ............................................................................................................................... 11 CHAPTER 3. HOSVD .............................................................................................. 13 3.1. Introduction ......................................................................................................... 13 3.2. Basic concepts ..................................................................................................... 13 3.2.1. Tensor norm................................................................................................................... 13 3.2.2. Errors ............................................................................................................................. 13 3.2.3. Concept of the HOSVD .................................................................................................. 14 3.3. Methodology of the HOSVD .................................................................................... 14 3.4. Errors in HOSVD .................................................................................................. 17
Basics 3 Chapter 1 BASICS 1.1. Motivation During the last decades, experiments in engineering have been steadily complemented with numerical simulations. In fact, nowadays there is (almost) no competitive industry where computational simulations do not play an important role in the design phase. But direct numerical simulation of realistic industrial problems involving fluid dynamics is numerically too expensive and requires huge computational resources, which can be kept reasonable using Reduced Order Models (ROMs). This trend can be easily appreciated in the literature of the past twenty-five or thirty years (see, for instance, references from [1] to [8]). This trend to substitute experiments by numerical simulations is, in general, due to the flexibility and cost-competitiveness of the latter. In particular, there is a growing trend in the Aeronautic Industry to substitute wind tunnel tests by Computational Fluid Dynamics (CFD) simulations. The first difficulty of CFD is the lack of confidence among designers. The trust gained after using wind tunnel tests cannot be matched to that provided by computational simulations. Another important problem of CFD is that, despite the advances in computing power, there are still many systems that remain out of reach due to their high dimension. A clear example in the aircraft industry occurs when dealing with aerodynamic databases, which are usually multi-parametric. This means that thousands of simulations can be needed to fill these databases up (see [1]). The main goal of model reduction is to find a lower-dimensional system, which approximates the highdimensional one retaining as much information as possible; namely, minimizing the error when solving the system. Reduced Order Models (ROMs) provide cost-efficient and reasonably good results in a competitive time. In fact, both computational efficiency and effectiveness of the method can become crucial factors to improve design cycles, saving both design costs and time. This is why each year the number of published papers containing different reduced order methods and applications increases. Improvement of these two factors should give industry the needed level of confidence for practical applications of CFD, using wind tunnel test only for validation. 1.2. ROMs As it has been previously mentioned, there are cases where thousands of simulations are necessary to study a design problem. For instance, consider the case of studying the aerodynamic coefficients and surface pressure distribution of a 2-D airfoil depending on Reynolds and Mach numbers, angle of attack and flap deflection angle. If 5 to 10 values for each parameter are considered, between 54 to 104
4 Reduced models to calculate stationary solutions for the lid-driven cavity problem simulation runs would be needed; and this without taking into account geometry design parameters or the case where a 3-D wing is considered (see [1], [2] and [3]). It is clear that in this case the cost advantage associated with CFD is eclipsed by the number of simulations needed. One way to deal with this could be usual interpolation, namely, to compute a wellselected number of cases and then use interpolation. However, interpolation accuracy decreases when either the distance between the available points in the parametric space is not small enough or when many parameters are taken into account. An alternative method was proposed by Bui-Thanh et al. (see [4]) in 2D settings and extended to higher dimensions by Lorente et al. (see [1]). The method consists in first using a reduce order model (ROM), POD or SVD (in 2D) and HOSVD in higher dimensions to obtain a low dimensional model of the set of snapshots, and then in interpolating over the global modes obtained. The main advantage is that interpolation on each mode is a 1D interpolation, which substitutes the higher dimensional interpolation that would be needed in principle. The study made in this Master thesis will be based on this idea. 1.3. Objectives of the study The goal of the Master thesis is to apply the method developed by Lorente et al. [1] to the lid driven cavity problem. The objective is to first use CFD to calculate the solution of a problem for a set of values of parameters, and then to guess a goodenough approximation of the solution for the remaining values of the parameters in a competitive time. To begin with, the case where the solutions only depend on one parameter is considered. A deep study is carried out in this one-parameter dependence situation, which will help to the better understanding of the algorithms and methods to be applied. However, it is well known that most of the problems presented in the Aeronautic Industry (and in many other sectors) have to deal with multi-parametric situations. This is the reason why, although the study begins with the case of one-parameter situation, at the end of the Master thesis we deal with a multi-parametric situation, comparing the results obtained by the previous method with the ones obtained under the assumption that there are more than one parameter to account for. The application of the method needs to be validated either with experiments or with already known data. In this work, the results have been checked with the problem of the lid-driven cavity. As it will be explained, this configuration is chosen to take the steady state solutions for a given Reynolds number range and simulate the solutions for any other Reynolds in that range. 1.4. Thesis distribution This thesis dissertation begins with the description of the reduced order models that will be used as part of the method, which as previously commented, will be based on
Basics 5 the application of these models (POD or SVD) plus modal interpolation. Then, a selection of the most energetic of the modes given by the ROM used is made and, finally, some 1D interpolations on these global modes are performed to obtain the required solution. The importance of these models lies on the fact that it is possible to define a way to find the n-dimensional manifold that is closest (in the root mean square sense) to a set of given solutions (known as the snapshot set) of the problem, among all manifolds of dimension n. Such manifold is the one spanned by the n most energetic modes obtained from the set of modes applying POD. Thus, POD modes provide a basis of global modes that allow obtaining each snapshot as a linear combination of modes. This part is studied in chapter 2, were we deal with the main ideas of the reduce order models that will be used in the sequel and in the formulation of Proper Orthogonal Decomposition and Singular Value Decomposition. Once the ideas of the POD and SVD are clear, a method to deal with multiparametric situations is explained in chapter 3. This method is called High Order Singular Value Decomposition (HOSVD) and it can be seen as an extension of the Singular Value Decomposition described in the previous chapter. During these first chapters the mathematical decompositions in which all our study is based are described. These are the more theoretical parts of the Master thesis. However, to validate our analysis we need a physical problem to apply the explained theory, and to study and/or compare the results obtained. Chapter 4 is divided in two sections. At the beginning, a description of the lid-driven cavity problem is given as well as the reasons to select this problem instead of any other one. In the second part, the main ideas of the code used to calculate the solutions of this problem are given. The last two chapters deal with the discussion of the results obtained. On the one hand, Proper Orthogonal Decomposition and Singular Value Decomposition apply to 2D tensors (namely, matrices), and are seen to be a method to obtain a goodenough approximation of the solution of the problem decreasing drastically the computational time needed to obtain it. On the other hand we have used High Order Singular Value Decomposition, with the main purpose of comparing the results obtained when considering the problem as one-parameter-dependent with those obtained when solving it with a multi-parameter dependence. 1.5. Results The model presented is an efficient tool to calculate solutions for a one parameter dependent problem, assuming that previous solutions for some values of the parameter have been provided. In the case of the lid driven cavity problem, if the numerical code is used, the time spent in the calculation of the steady state solution for a particular Reynolds number
6 Reduced models to calculate stationary solutions for the lid-driven cavity problem increases with the value of the Reynolds number. For instance, when the Reynolds number is equal to 10, the CPU time needed to obtain the solution is around one minute, while if the Reynolds number is 1000, the CPU time is 11 minutes. In contrast, the reduced model used in this work allows to obtain the steady state solutions for any Reynolds number almost instantaneously, namely around 1.5 CPU seconds. Finally, when comparing with the method used for the multi-parameter dependent cases, the results obtained are not as good as expected. This is because the method is applied to the same one-parameter problem considered above, introducing an artificial dependence on two parameters considering two scales in the only parameter that is present. Such artificial application has been made just to illustrate the application of the method since no a true multi-parameter problem was available. Introducing a second parameter in the CFD code was out of the scope of the present Master thesis. However, some previous studies on related problems (see [1]) makes us to think that application of HOSVD also provides good results in cases in which the problem is genuinely multidimensional.
POD and SVD 7 Chapter 2 POD AND SVD Equation Chapter (Next) Section 2 2.1. Introduction Reduced Order Models (ROMs) have been for long applied in Fluid Dynamics for data compression (see references from [1] to [7]). Ideally, we would like to create a model in which the dynamics of the system are captured accurately, but with a low number of degrees of freedom. This will be done applying a reduced order model, based on either the Proper Orthogonal Decomposition (POD) or the Singular Value Decomposition (SVD). The method of Proper Orthogonal Decomposition has been used in the fluids community for a long time (see [7]). This decomposition is also known as Principal Component Analysis (PCA) or Empirical Orthogonal Functions (EOF) in Meteorology or as the Karhunen-Loève expansion in Statistics. The idea of the method is to obtain a lower dimension approximation of the given sample (usually, made with some solutions of the problem). Actually, what POD pursues is to give the best n-dimensional (with n less or equal to the dimension sample) approximation. This is achieved by first calculating a set of basis functions (which are called modes) from the sample, ordering them with respect to the information of the problem provided (in other words, from more to less energetic modes). Afterwards, the n first of these modes are selected and some coefficients (called amplitudes of the modes) matched to the original sample are obtained, which gives us a linear system to reproduce the whole sample. On the other hand, Singular Value Decomposition applies to matrices (instead of to systems of vectors) and can be seen as a way to obtaining the modes satisfying the POD (see [6]) in each dimension of the matrix. SVD was created (see [6] and [7]) to be used for real squared matrices in the 1870s (thanks to the work by Beltrami and Jordan), then some changes were introduced in 1902 by Autonne to make it work for complex square matrices and, finally, it was established for general rectangular matrices in 1939, by Eckart and Young. 2.2. POD 2.2.1. Inner product and norm The first step is to define the inner product and norm that will be used during the process. Here, unless otherwise stated, we consider the L2 -inner product and norm (so called usual product and norm).
8 Reduced models to calculate stationary solutions for the lid-driven cavity problem Due to the physical nature of the considered problem, all variables used here (either being scalars or arrays of any order) have their entries lying in . Thus, the definition of both the norm and the inner product can be particularized as 2 1 2 1 , N ii i N i Li xy x xy x (2.1) where 11 ( ,..., ) and ( ,..., ) NN x x y yxy are vectors living in N . 2.2.2. Mathematical formulation Let us consider a set of N snapshots 11 ( ) ,..., ( ) NN u u Re u u Re (2.2) where the i-th snapshot is a vector containing vorticity and stream function values (as it will be explain in chapter 4) in the grid points of a spatial mesh of the steady state solution of the reduced lid driven cavity problem for a given Reynolds number. We need to obtain the orthonormal POD modes 1 ,..., N UU (2.3) associated with the snapshots (2.2). The first step is to calculate the self-adjoint matrix R, called covariance matrix, whose elements are defined as , ij Rij u u (2.4) in terms of the usual inner product. It is worth remembering that since the entries of the snapshots (2.2) are values of the stream function and vorticity of a physical problem, they must be real numbers. This implies that all the entries of R are real and then R is square, symmetric, and positive definite (provided that the snapshots are linearly independent). Once we have the covariance matrix, we obtain the eigenvalues 2 i , and eigenvectors, i , of the matrix R , the columns of the matrix A below
POD and SVD 9 2 12 2 2 12 2 1 = , ... , for 1,..., 0 0N N NiN (2.5) It turns out that the POD modes (2.3) can be written as 1 1Nk i i k k i Uu (2.6) in terms of the snapshots, where k i denotes the k-th component of the i-th eigenvector of the matrix R. Taking into account that the eigenvectors are orthonormal and the product is the usual one, equation (2.6) yields to 1 Ni i k k k k uU (2.7) This provides the original snapshots in terms of the POD modes. 2.2.3. Error of the method Using the definition of the POD modes given in (2.6), the truncation in the expression (2.7) to n<N terms yields to the best possible n-terms approximation of the snapshots. An estimate of the truncation error is given by (see [5]): 22 1 1 1 N n N i i j j j j i j j n uU (2.8) which means that the root mean square (RMS) error resulting from truncation to n modes is 2 1 1 N j jn Error RMS N (2.9) Using these definitions, we can select the number of modes needed for the reconstruction of the snapshots for a given error.
10 Reduced models to calculate stationary solutions for the lid-driven cavity problem 2.2.4. Orthogonal projection Once the number of modes n has been selected, the original solution can be reconstructed upon orthogonal projection onto the n-dimensional span of the selected POD modes, as 1 n ii i u aU (2.10) The coefficients i a will be called from now on the amplitudes of the POD modes. Taking into account that POD modes are orthonormal, the amplitudes can be obtained as , , 1,..., ii a U u i n (2.11) A physical explanation of the POD modes is that they are those that maximize the energy of the projection. This is the same as saying that they minimize the error resulting from the projection onto the subspace spanned by the modes. 2.3. SVD 2.3.1. Description of the method The Singular Value Decomposition of a m x n matrix Q allows to write the matrix as T Q U V , where the superscript T denotes the transpose. In this decomposition, U is an m x m orthogonal matrix whose columns are the eigenvectors of T QQ , V is an n x n orthogonal matrix whose columns are the eigenvectors of T QQ and is an m x n positive definite diagonal matrix containing the singular values of Q (namely, the square roots of the strictly positive eigenvalues of either T QQ or T QQ ). The decomposition is made such that the singular values of Q are ordered in descending order. This decomposition can be written in terms of the elements of Q as: 1 r ij k ik jk k Q u v (2.12) where r is the rank of the matrix Q, k are the singular values (in other words, the elements of the diagonal of ) and and ik jk uv are the elements of U and V respectively.
POD and SVD 11 2.3.2. Error If the decomposition given in (2.12) is truncated to n < N terms, then the RMS error can be obtained as done in section 2.2.2 to obtain the truncation error associated with POD. Namely, 2 1 1 r j jn Error RMS N (2.13)
18 Reduced models to calculate stationary solutions for the lid-driven cavity problem 2 1 1 1 , , p mn i j k ijk ijk i j k i j k A A A (3.30) where expression (3.30) is exactly the same as (3.29) when no truncation is applied in (3.20), otherwise 2 1 1 1 p mn i j k i m j n k p AA (3.31)
The lid-driven cavity problem 19 Chapter 4 The lid-driven cavity problem Equation Chapter (Next) Section 4 4.1. Background 4.1.1. Selection of the problem The lid-driven cavity problem consists in studying the motion of an incompressible fluid inside a squared cavity, whose upper wall moves horizontally in a rigid solid fashion. The selection of the lid driven cavity problem is not casual. This is one of the most CFD-studied fluid flow problems. The reason lies in the simplicity of both its geometry and boundary conditions. In spite of the simplicity of the lid driven cavity problem, it retains all relevant physical behaviours. Also, its geometrical simplicity makes it easier the experimental calibrations of numerical implementations. For these reasons, the cavity problem is often used as a test for the validation of new codes. Numerical investigation of the physics of a flow inside lid-driven cavity began with the study of Burggraf (see [10]) in 1966 and has been followed by numerous works during the last forty years, among which it is impossible to forget those carried out by Ghia (see [11]) or Botella and Peyret (see [12]). 4.1.2. Ideas to be developed The lid-driven cavity reaches a steady state at moderate Reynolds number (the ones that will be considered below). Thus, the steady state at these moderate values of the Reynolds number can be obtained leaving the system evolve, using a numerical code to integrate the time-dependent, incompressible Navier-Stokes equations. The code used here is based on a spectral method. In order to allow to use this spectral method, the constant velocity at the upper wall is smoothed out near the upper lateral corners of the cavity. The time dependent incompressible Navier-Stokes governing equations have been discretized using Chebyshev polynomials. The steady state solutions, called snapshots, are calculated as the final states, which simulates how steady states are reached in physical cavities. This requires that the Reynolds number is not too large, since otherwise steady states are not reached and the final state is time-dependent. Once we are able to calculate the steady states for any Reynolds number in a given range, two difficulties appear. On the one hand, we face one of the most common problems nowadays in engineering; the problem of storage. During the last years, the study of compression of databases has become a very important branch of study in several fields, among which aeronautical engineering stands out. HOSVD allows a very efficient compression of huge databases [2], especially when these are multidimensional and exhibit redundancies along the various dimensions. On the
20 Reduced models to calculate stationary solutions for the lid-driven cavity problem other hand, the CPU time-cost (namely, the time needed to reach each the steady state solution) can be very large. 4.2. Mathematical formulation Even though the study of the lid-driven cavity problem itself is not the main object of this thesis, it is convenient to provide the reader with some basic ideas on both the problem itself and the algorithm used to solve it. Let us consider a 2D bounded square domain = [0,1] x [0,1], where a fluid is enclosed. This fluid evolves according to the incompressible Navier-Stokes equations: vv v v ,p t Re (4.1) v0 in the domain , where v ( , )uv is the nondimensional velocity field, p is the nondimensional pressure, and Re the Reynolds number. The boundary conditions are ( , ) ( ( ),0) on ( , ) (0,0) on u v F x uv (4.2) where F is a real function of x and ( , ) : 1x y y is the upper wall of the cavity (as seen in figure 4.1). Fig. 4.1 Regularized square lid-driven cavity problem. (a) Boundary conditions. (b) Flow configuration (Tanahashi and Okanaga, 1990) If F(x) = 1, then we have the standard lid-driven cavity problem, in which the upper wall moves to the right in a rigid-solid fashion. But such problem exhibits strong singularities near the lateral corners of the upper wall, where the horizontal velocity is discontinuous since it jumps from zero to one. In order to remove these singularities, the following smoothing law for the horizontal velocity distribution is used
The lid-driven cavity problem 21 22 ( ) 16 (1 )F x x x (4.3) The continuity and Navier-Stokes equations above can be rewritten using the vorticity and the stream function as: t y x x y Re (4.4) (4.5) where the subscripts indicate differentiation with respect to the specified variables. The boundary conditions (4.2) are rewritten as 0 at , ( ) 0, at 0 and 1 ( ) 0, at 0 ( ) ( ), at 1 x x x yy y F x y (4.6) The system of the two coupled equations (4.4) together with the set of boundary conditions (4.6) represent the stream function – vorticity formulation of the regularized lid-driven cavity problem, which can be solved using an spectral algorithm described by Theofilis (see [13]). 4.3. The algorithm 4.3.1. Temporal integration Temporal integration of (4.4) is carried out by a third-order hybrid implicit-explicit three-substep scheme proposed by Sparlat et al. (see [14]). 1 1 1 2 2 2 2 11 3 3 3 3 ´ ( ´) ( ) ´´ ´ ( ´ ´´) ( ´) ( ) ´´ ( ´´ ) ( ´´) ( ´) n n n n nn t L N t L N N t L N N (4.7) where the advance in time is produced from the solution n at time instant n t n t to the solution 1n at time instant 1( 1) n t n t , with 0,1,...n Here, t is the time integration step, and L and N are the linear and non-linear operators in equation (4.4) namely () Re () x y y x f Lf N f f f (4.8)
22 Reduced models to calculate stationary solutions for the lid-driven cavity problem Note that the linear terms correspond to the viscous part and are treated implicitly while non-linear convective term is treated explicitly. The parameters in (4.7) are chosen such that the method is stable and provides third-order accuracy. The values of these parameters can be found in the work by Sparlat et al. (see [14]). 4.3.2. Spatial discretization Continuity and momentum equations are spatially discretized using the Chebyshev collocation spectral method. The non-uniform mesh of collocation points is defined on the squared domain = [0,1] x [0,1] considering two sets of Chebyshev-Gauss- Lobatto points: cos , 0,..., cos , 0,..., ix x jy y i x i N N j y j N N (4.9) in the x and y directions, respectively, and then mapping them on the interval [0,1] with a linear transformation, namely 1, 0,..., 21, 0,..., 2 i ix i iy x x i N y y j N (4.10) Thus, we have a mesh ( , ) ij xy of points in the domain = [0,1] x [0,1], with 1,..., x iN and 1,..., y jN . This discretization is performed (as can be seen in fig. 4.2.) in order to concentrate the mesh points in those regions where dynamics are more complicated, which happens near the walls and especially near the corners of our domain.
The lid-driven cavity problem 23 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 X Y Fig. 4.2 Chebyshev-Gauss-Lobatto mesh with the same number of points in both directions Concerning the differentiation in the spatial domain, the analytical formulae for derivatives of the Chebyshev polynomials at the Chebyshev-Gauss-Lobatto points yields to the following expression ' (1) 0 ( ) , 0,..., x N i x ik k x k u D u i N (4.11) where ' i u is the first-order derivative of u with respect to x at collocation point i x and the operator (1) x D in matrix form (called Chebyshev collocation derivative matrix) accomplishes differentiation in physical space (see [15], [16]) for more details) and is defined as: 2 (1) 2 2 1, , 1 1 21 () 21 , 0 6 21 , 6 ij i j i j j x j x ij x xx cij c x x xi j N x D Nij Ni j N (4.12) The first order derivative with respect to y at collocation points j y is defined similarly.
24 Reduced models to calculate stationary solutions for the lid-driven cavity problem Second order derivatives, both with respect to x and with respect to y and at collocation points i x and j y respectively, can be computed as (2) (1) (1) (2) (1) (1) , xx x x yy y y D D D D D D (4.13) A spectral code to solve the regularized lid-driven cavity problem based on this spectral algorithm is available at the School of Aeronautics, of the Universidad Politécnica de Madrid. 4.4. The steady state solutions As anticipated above, the flow converges to the steady state solution for Reynolds numbers up to 10000 (see [15]). Although the maximal time step that guarantees the convergence of the method depends on the Reynolds number. Nevertheless, in the case of Reynolds numbers varying in the interval [10, 1100] and with the code used here, it is guaranteed that in order to reach the steady state solution with high precision it is enough to consider 3 5 10t . Finally, for a given Reynolds number, we consider that the steady state solution is reached when 11 max max , , j j j j i i i i jj and tt (4.14) where 9 5 10 . The CPU time spent to reach the steady state solution, depending on the time step given, is shown in table 4.1. Results are given for different Reynolds numbers and for a grid of 33 x 33 points. Table 4.1 Computational time (in seconds) depending on the time step Re 100 500 1000 dt = 0,001 494 1519 2995 dt = 0,005 99 303 600 dt = 0,01 49 152 300 The results obtained for the steady states have been compared with data from literature (see [12]). The streamlines of the steady state solution for different values of Reynolds are shown in figure 4.3. The first plot (top, left) corresponds to Re=100, and shows two very small vortices near the lower corners of the cavity. However, when Reynolds number increases those vortices grow, as seen in the remaining two plots, which correspond to Re= 400 and 1000, respectively. And the main vortex moves to the central part of the cavity.
The lid-driven cavity problem 25 Fig. 4.3 Streamlines of the steady state solution of the lid-driven cavity problem for Reynolds number equal to 100 (top, left), 400 (top, right) and 1000 (bottom). 4.5. The mesh The number of points on the grid is an important parameter to take into account. On the one hand, if a very thin mesh is selected, then it would lead to very high computational cost. But on the other hand, the mesh must be thin enough to represent well the states of the flow inside the regularized cavity for all the Reynolds numbers in the considered range. Figures 4.4 and 4.5 show the spatial errors of the time-dependent solution for Reynolds 500. Figure 4.4 shows the maximum error (in logarithmic scale) of the numerical code when working with 17 x 17 mesh-points, as obtained comparing with the results obtained with 33 x 33 mesh-points. As it is observed, the errors for both the horizontal (left plot) and the vertical (right plot) components of the velocity are of the order of 2 10 , which is considered a too large error. x y -0.085 -0.082 -0.076 -0.067 -0.043 -0.034 -0.016 -0.037 -0.055 -0.025 -0.028 -0.007 -0.004 -0.001 -0.01 -0.07 -0.0001 -2e-005 2e-006 5e-005 0.0002 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 x y -0.082 -0.076 -0.07 -0.04 -0.058 -0.037 -0.019 -0.028 -0.04 -0.016 -0.01 -0.007 -0.004 -0.001 -0.0001 -2e-005 5e-007 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 x y -0.085 -0.082 -0.076 -0.073 -0.064 -0.001 -0.007 -0.022 -0.037 -0.055 -0.013 -0.049 -0.055 -0.004 -0.0001 5e-005 0.00037 0.0008 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
26 Reduced models to calculate stationary solutions for the lid-driven cavity problem In figure 4.5, the maximum spatial errors in a grid of 33 x 33 points are plotted, for both the horizontal (left) and the vertical (right) components of the velocity. In this case, the maximum error is of the order of 5 10 , which is considered good enough. In addition, increasing the number of mesh-points from 17 x 17 to 33 x 33 the time spent by the numerical code to obtain the steady state solutions increases in around a 7.5% and the same happens when increasing from 33 x 33 to 65 x 65 points the mesh. This increment is much smaller than what should be expected estimating the increase in computational cost of the spatial discretization, which would lead to doubling the computational cost. The better performance of the finer mesh is due to the fact that convergence to the steady state solution is faster in the finer mesh, which can be somehow appreciated comparing the plots in figures 4.4 and 4.5. The results obtained lead us to select the 33 x 33 points grid as the best option to obtain reasonably good accuracy saving computational time and cost. Fig. 4.4 Evolution with time of the maximum spatial error of the method using 17 x 17 mesh-points. Left plot shows the error for the horizontal component u of the velocity, while the right plot shows the error for the vertical component v. The solution is obtained for Re = 500 and the errors are given in logarithmic scale. 010 20 30 40 -2 -1.95 -1.9 -1.85 -1.8 -1.75 -1.7 -1.65 Error time 010 20 30 40 -2.5 -2.4 -2.3 -2.2 -2.1 -2 -1.9 -1.8 Error time
The lid-driven cavity problem 27 Fig. 4.5 Counterpart of figure 4.2 for the 33x33 mesh 010 20 30 40 -6 -5.8 -5.6 -5.4 -5.2 -5 -4.8 -4.6 -4.4 -4.2 -4 Error time 010 20 30 40 -5.2 -5.15 -5.1 -5.05 -5 -4.95 -4.9 -4.85 -4.8 -4.75 -4.7 Error time
34 Reduced models to calculate stationary solutions for the lid-driven cavity problem indistinguishable, as seen in plots (c) and (d), which result from retaining 12 and 8 modes, respectively. 5.2.3. A compromise between the number of snapshots and the number of modes Let us consider a real case, requiring that the maximum error on the stream function and the vorticity is smaller 3 10 . (a) (b) (c) (d) Fig. 5.4 RMS errors vs. the number of retained modes using 55 equispaced snapshots . (a) Global error for 54 test case; (b) error for Re = 55, (c) error for Re = 455, and (d) error for Re = 955. For the sake of clarity three cases are considered, using 55, 22, and 11 equispaced snapshots. For each of these three cases, the error is calculated for various numbers of retained modes in the reconstruction of the solution, at three different values of the Reynolds number, one at the beginning of the selected range, which goes from 10 to 1100, another in the middle of the range and a final one at the end of it. 0 5 10 15 20 25 30 35 40 45 50 55 -12 -10 -8 -6 -4 -2 0 Number of modes Error 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -8 -7 -6 -5 -4 -3 -2 -1 0 Number of modes Errors 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -8 -7 -6 -5 -4 -3 -2 -1 Number of modes Errors 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -8 -7 -6 -5 -4 -3 -2 -1 0 Number of modes Errors
Application of the POD/SVD model to the lid-driven cavity problem 35 The case of 55 snapshots is considered in figure 5.4. The first plot provides the global RMS error in reconstructing the 54 test cases considered above, and the remaining three plots, the errors for the above mentioned values of the Reynolds number. These plots suggest that 7 modes are enough in this case to reconstruct the solution for the three selected values of the Reynolds number. However, 55 snapshots are too many, as already noticed. Thus, the dependence of the number of required modes on the number of snapshots needs to be analyzed. (a) (b) (c) (d) Fig. 5.5 Counterpart of figure 5.4 using 22 snapshots. The case of 22 equispaced snapshots is considered in figure 5.5, which shows that 7 modes are also enough if 22 equispaced snapshots are used. This emphasizes the fact that 55 snapshots are quite redundant. However, as seen in figure 5.6, if the number of snapshots is again reduced to the half, 11 equispaced snapshots, then for some values of the Reynolds number the model does not reach the steady state with a maximum error of 3 10 . This is because the information provided by only 11 snapshots is not enough to build an efficient model. 0 2 4 6 8 10 12 14 16 18 20 22 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 Number of modes Error 1 2 3 4 5 6 7 8 9 10 -7 -6 -5 -4 -3 -2 -1 0 Number of modes Errors 12345678910 -5 -4.5 -4 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 Number of modes Errors 1 2 3 4 5 6 7 8 9 10 -7 -6 -5 -4 -3 -2 -1 Number of modes Errors
36 Reduced models to calculate stationary solutions for the lid-driven cavity problem (a) (b) (c) (d) Fig. 5.6. Counterpart of figure 5.4 using 11 snapshots. Summarizing these results, the error of the method is due to both truncation in the SVD step and interpolation. The number of snapshots should be enough to both produce sufficiently good spatial modes and prevent interpolation errors. Increasing the number of snapshots from this threshold level, does not produce any additional benefit and decresing the number of snapshots worsen both the quality of the modes and the efficiency of the interpolation. Of course, the location of the snapshots in the Reynolds number range matters, but this is outside the scope of this dissertation. 0 1 2 3 4 5 6 7 8 9 10 11 -7 -6 -5 -4 -3 -2 -1 0 1 2 Number of modes Error 0 1 2 3 4 5 6 7 8 9 10 11 -6 -5 -4 -3 -2 -1 0 Number of modes Errors 1 2 3 4 5 6 7 8 9 10 11 -3.5 -3 -2.5 -2 -1.5 -1 -0.5 Number of modes Errors 1 2 3 4 5 6 7 8 9 10 11 -7 -6 -5 -4 -3 -2 -1 0 Number of modes Errors
Application of the HOSVD model to the lid-driven cavity problem 37 Chapter 6 APPLICATION OF HOSVD TO THE LID-DRIVEN CAVITY PROBLEM 6.1. Application of HOSVD to the lid-driven cavity problem Higher-order tensor (N-array with 3N ) decompositions are applied in many different areas such as psychometrics, signal processing, numerical linear algebra, computer vision, numerical analysis, neuroscience or graph analysis among others (see [17]). Several of these decompositions have been studied for long (see [17] and [18]). However, since in the one-parameter dependence problem the method used was based on POD and/or SVD, the decomposition called High Order Singular Value Decomposition is the one to be used for multiparameter problems. But not only the resemblance of POD and HOSVD, which can be seen as an extension to third order tensors of SVD, made us chose this decomposition, also the knowledge of the good results provided when applied to problems that are genuinely multidimensional (see [1]). Since no additional parameters are available in the lid-driven cavity, in order to apply High Order Singular Value Decomposition to the problem of the lid-driven cavity, it is necessary to reorder the snapshots in a way that simulates the multi-parameter dependence. This is carried out by dividing the Reynolds number range in two scales, which will be called the long scale, which gives the order of magnitude of the Reynolds number, and the short scale, which specifies the actual values of Reynolds number in each interval of the long scale. In order to do this is, the whole range of the Reynolds number will be divided into sub-ranges of the same length, this is the long scale division, which will be accounted for with third index of the tensor, k . After this, the second index accounts for the short range, namely the position of the Reynolds number in the k -th subinterval of the long range. Finally, the first index stands as it was before, it labels the various points of the spatial mesh. An example is given for the sake of clarity. Suppose that the 110 steady state solutions corresponding to Reynolds numbers taken from 10 to 10, between 10 and 1100 are provided. First, the Reynolds interval [1, 1100] is divided in eleven subintervals, [1, 100], [101, 200], …, [1001, 1100]. Then the long scale index varies from 1 to 11 indicating in which of these subintervals is located the Reynolds number. Note that the same number of snapshots must be contained in each one of these subintervals; in other words, the same number of Reynolds for which the solution is known. In our case, ten snapshots are given in each subinterval, so the short scale index goes from 1 to 10. Finally, index i continues going from 1 to 2 x 33 x 33, which is twice the dimension of the selected mesh.
38 Reduced models to calculate stationary solutions for the lid-driven cavity problem Along this chapter, we refer to the third order ( )m x n x p - tensor, whose elements are given by ijk A as the snapshots tensor. When HOSVD is applied, three kinds of modes are obtained, which are associated with the three dimensions. The first one corresponds to the spatial mesh and thus the associated modes are the spatial modes, which are independent of the Reynolds number. The second and third indexes give the long and short scales and the associated modes can be seen as respectively long range and short range parametric modes. The core tensor is independent of both the spatial and parametric indexes. Thus, if an intermediate value of the Reynolds number is to be considered, then interpolation must be made only in the short range parametric modes, once the long range value of the index has been identified. As above, interpolation will be made using cubic splines. 6.2. Global Error As described in section 3.4, the error introduced by HOSVD when truncating to m x n x p , where , and m m n n p p can be bounded by the expression (3.31). The dependence of the global error on the 3 sets of eigenvalues, instead of just one as it happened when dealing with POD (or SVD), makes it a bit harder to study the global error of the method. In fact, (3.31) provides us with just an upper bound of the error. Figure 6.1 shows the dependence of the error with the number of modes taken in each of the three orthonormal sets. Each of the plots shows the dependence on a different index. For the first case, plot (a), the modes are taken for second and third indexes, while the number of modes taken for the first index changes from 1 to the total number of them (m = 2 x 33 x 33). In figure 6.1 (b), the error when varying the number of modes taken for the second index is plotted, while for the first and third indexes, all the modes are retained (that is and m m p p ). Finally, the counterpart is done in plot (c), where and m m n n , and p varies from 1 to p ( in this case p =11). A bound for the global error is given by the sum of the 3 errors. It is observed that the biggest reduction is obtained from the first index.
Application of the HOSVD model to the lid-driven cavity problem 39 (b) (a) (b) (c) Fig. 6.1 Error of the method depending on the number of modes taken for (a) the first index, (b) the second index, and (c) the third index of the tensor, when taking all the modes for the other two indexes. Errors are given in logarithmic scale and the case treated is that of 110 snapshots provided. Assume that the three orthonormal systems of eigenvalues, and their associated eigenvectors, are ordered such that the most energetic one is located first and then in decreasing order. The global dependence of the error on the number of modes taken can be studied in the following way. First, the error of the method when retaining just one HOSVD mode in each of the three sets ( 1 u , 1 v and 1 w ) is calculated. These first modes correspond to the most energetic eigenvalue of each one of the three systems ( 11 , and 1 ). Then, a new mode is selected to be added to the retained ones and the error of the new system is calculated. The selection of this new mode is made with respect to the most energetic eigenvalue left, thus either a mode can be added for the first system ( 2 u ) if 22 and 22 , or for the second system ( 2 v ) in case of being 22 and 22 , or for the third system ( 2 w ) 0200 400 600 800 1000 1200 1400 1600 1800 2000 -30 -25 -20 -15 -10 -5 0 Number of modes for alpha Errors 1 2 3 4 5 6 7 8 9 10 11 -16 -14 -12 -10 -8 -6 -4 -2 0 2 Number of modes for gamma Error 1 2 3 4 5 6 7 8 9 10 -16 -14 -12 -10 -8 -6 -4 -2 0 Number of modes for beta Error
40 Reduced models to calculate stationary solutions for the lid-driven cavity problem if 22 and 22 . This process goes on adding one mode at a time and calculating the error of the model for the total number of modes retained, until all of them have been selected. In that way, if in the second step 22 and 22 , then a HOSVD mode for the first of the orthonormal systems is retained and the error of the method retaining those four modes ( 1 u , 1 v , 1 w and 2 u ) is obtained. However, it is of no interest to retain all the modes. The interest of the process is to retain the least number of modes possible for a given error, then instead of adding modes until the total number of them is taken, the process is stopped when an error smaller than a given value is reached. From now on, a (2178 x 5 x 11)-tensor is considered, unless otherwise stated. This tensor corresponds to the case of 55 snapshots given. The dependence of the error of the model with respect to the total number of modes taken is plotted in figure 6.2. In addition, the corresponding numbers of modes of each one of the three orthogonal systems of eigenvectors are shown in table 6.1. Considering the obtained data, in order to calculate the solution for a Reynolds number in the given range with an error less than 5 10 , it is enough to retain 26 HOSVD modes, from which 12 are taken from the first system, 5 from the second (these are all of them) and 9 (over the 11 possible) from the third. In order to compare the model obtained using HOSVD with the one obtained for the POD/SVD, let us fix the bound for the error to 3 10 . For the HOSVD-based method (with 55 snapshots), in order to calculate the solutions of the problem for any Reynolds in the given range with an error smaller than 3 10 , it is necessary to retain 18 modes (8 from U, 3 from V and 7 from W). In contrast, for the case of POD-based model it was enough to retain 7 modes. This fact leads us to think, without further exploration of the methods, that the HOSVD-based model is not as good as the POD-based one. However, previous studies on related problems (see [1]) drives us to think that HOSVD-based models provides good results in cases in which the problem is genuinely multidimensional. Fig. 6.2 Bound for the error of the method depending on the number of modes, for a (2178 x 5 x 11) – tensor 0 5 10 15 20 25 30 35 -6 -5 -4 -3 -2 -1 0 1 2 Number of modes Error
Application of the HOSVD model to the lid-driven cavity problem 41 Table 6.1: Table of modes total modes 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 U 1 1 2 3 3 3 4 4 5 5 6 6 6 7 7 8 8 9 9 10 11 11 11 12 13 13 14 15 16 16 V 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 4 5 5 5 5 5 5 5 5 W 1 2 2 2 3 3 3 4 4 5 5 5 6 6 7 7 7 7 8 8 8 9 9 9 9 10 10 10 10 11 6.3. Interpolation error Interpolation is made over the retained modes. In fact, it is done over the modes for the short scale associated system (V). To compare with the results obtained for the POD-based model, the cases corresponding to those shown in figure 5.4 are plotted in figure 6.3. Different ideas are seen in this figure. On the one hand, in plot (a), the bound for the error, given by the sum of the singular values, is plotted in blue dots and the maximum error obtained when reproducing the snapshots in red dots, both depending on the number of modes retained. On the other hand, the other three plots show the maximum error obtained, depending on the number of modes retained, when calculating the solution for (b) Re = 55, (c) Re = 455, and (d) Re = 955. The minimum number of modes for which the obtained solutions give maximum errors smaller than 0.001 is 16. This can be also observed in figure 6.2. Thus, the number of modes needed using the HOSVD-based model, to calculate the steady state solutions of the lid-driven cavity problem, is higher than the number needed for POD-based models.
42 Reduced models to calculate stationary solutions for the lid-driven cavity problem (a) (b) (c) (d) Fig. 6.3 Plot (a) Bound for the error of the model (blue dots) and maximum error when reproducing the snapshots (red dots) both depending on the number of modes taken. Plots (b), (c) and (d) show the maximum errors from calculating the solutions for Reynolds numbers 55, 455 and 955 (respectively) depending on the number of modes retained. All the errors are given in logarithmic scale. 0 5 10 15 20 25 30 35 40 45 50 -7 -6 -5 -4 -3 -2 -1 Number of modes Error 0 5 10 15 20 25 30 35 40 45 50 -6 -5 -4 -3 -2 -1 0 Number of modes Error 0 5 10 15 20 25 30 35 40 45 50 -6 -5 -4 -3 -2 -1 0 Number of modes Error 0 5 10 15 20 25 30 35 40 45 50 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 Number of modes Error
Conclusions and future developments 43 Chapter 7 CONCLUSIONS AND FUTURE DEVELOPMENTS 7.1. Summary A model has been proposed to accelerate the calculation of the steady state solutions of the lid-driven cavity problem. The model begins with the application of Proper Orthogonal Decomposition to a set of steady state solutions, which are obtained using a CFD code. This decomposition gives the best n-dimensional approximation of the sample set (by selecting the n more energetic POD modes), for any n less or equal to the number of solutions provided. Afterwards, the given solutions are projected onto the set of modes retained to obtain the coefficients (amplitudes) which, when multiplied by the modes, give that best n-dimensional approximation to the solution. In fact, the RMS error of this procedure when n POD modes have been retained is easily obtained, which makes easy to find out how many of the modes are necessary to calculate the solutions of the problem within a given error, after having the first contact with the method. The solutions for a new value of the Reynolds number are obtained by interpolation on the amplitudes of the retained modes. However, with the interpolation some errors are introduced in the model. With the available numerical code, the computational time expended to calculate these solutions for some values of Reynolds numbers is shown in table 7.1. As it can be observed, the computational time increases with the Reynolds number. Table 7.1 Time expended by the numerical code Reynolds 10 100 300 500 700 900 1100 Comp.Time (s) 57 99 229 303 410 535 664 In contrast, the reduced model presented in this work allows to obtain any steady state solution almost instantaneously (namely, within around 1.5 seconds). In fact, the CPU time used to calculate any steady state solution does not depend on the Reynolds number.It is invariant once the number of modes retained is selected. 7.2. Conclusions The model proposed here is able to calculate the steady state solution for any Reynolds number in the interval [1, 1100] within a maximum error of 3 10 . In fact, an