a parallel solver for thin film hydrodynamic lubrication...

14
A parallel solver for thin film hydrodynamic lubrication Dongfang Bai Department of Mechanical Engineering, MIT May 10, 2010                                                            Abstract                       This project is focused on building a parallel solver for thin film hydrodynamic lubrication with specific application on piston skirt lubrication.  Previously a similar solver has been developed in Matlab with a serial algorithm. In this project, I implement it in C language utilizing PETSc package. Moreover, the previous Matlab code, which essentially solves Reynolds' equation,  is found to be inadequate when cavitation happens. So I also implement a pressure-checking-and-updating algorithm to handle that. The developed parallel solver is tested on a quad-core computer and proved to be well behaving. The calculation time is shown to be reduced by 2/3 when 4 processors are used when grid size is large.  Further direction of study are also proposed.   Introduction In internal combustion engines, the piston skirt – liner provides a critical interface in terms of lubrication because it is one of the major sources of engine friction.  Moreover, the performance of this lubrication system also influence wear and engine noise. Thus it’s important to model this lubrication system and gain better understanding of it. Figure 1 gives the overview of the power- cylinder system. When engine runs, the crankshaft rotates and correspondingly the piston (skirt) slides up and down relative to the stationary cylinder liner. Generally, the sliding speed of the skirt ranges from 0 to 10m/s. Between the skirt and the liner, there is oil present to lubricate the interface.                                                                              Figure 1: Power -Cylinder system                                       

Upload: others

Post on 03-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

A parallel solver for thin film hydrodynamic lubricationDongfang Bai

Department of Mechanical Engineering, MIT

May 10, 2010

                                                           Abstract                       

This project is focused on building a parallel solver for thin film hydrodynamic lubrication with specific application on piston skirt lubrication.  Previously a similar solver has been developed in Matlab with a serial algorithm. In this project, I implement it in C language utilizing PETSc package. Moreover, the previous Matlab code, which essentially solves Reynolds' equation,  is found to be inadequate when cavitation happens. So I also implement a pressure­checking­and­updating algorithm to handle that. The developed parallel solver is tested on a quad­core computer and proved to be well behaving. The calculation time is shown to be reduced by 2/3 when 4 processors are used when grid size is large.  Further direction of study are also proposed.

1   Introduction 

In internal combustion engines, the piston skirt – liner provides a critical interface in terms of lubrication because it is one of the major sources of engine friction.  Moreover, the performance of this lubrication system also influence wear and engine noise. Thus it’s important to model this lubrication system and gain better understanding of it. Figure 1 gives the overview of the power­cylinder system. When engine runs, the crankshaft rotates and correspondingly the piston (skirt) slides up and down relative to the stationary cylinder liner. Generally, the sliding speed of the skirt ranges from 0 to 10m/s. Between the skirt and the liner, there is oil present to lubricate the interface. 

                                

                                              Figure 1: Power ­Cylinder system                                      

Page 2: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

2   Modeling

This section will first show the governing equations, then the numerical scheme of discretization and  algebraic equation formulation will be presented.

2.1 Characteristic of the skirt – liner lubrication

                                                 Figure 2: skirt – liner interface

The skirt – liner lubrication is characterized as a thin film lubrication. Figure 2 shows the length scales of the skirt – liner interface. Generally, the clearance between the skirt (moving surface) and the liner (stationary surface) is at the order of 10­100 micron meter, while the length and width of the skirt are at the order of several centimeter.  Thus the hydrodynamic behavior at the piston skirt – liner interface is generally described by Reynolds' Equation. It is derived from Navier­Stokes and continuity equations for incompressible flow under the main assumptions of Newtonian fluid, laminar flow, negligible inertia forces and no pressure variation across the oil film. It is expressed as,

                         [ ∂∂ z hρ 3

12 μ∂ p∂ z ∂

∂ x hρ 3

12 μ∂ p∂ x ]= ∂

∂ z [ρ hW

2 ]∂ hρ ∂ t     (1)

     where p is the oil film hydrodynamic pressure field and h is the distribution of the clearance between piston skirt and the liner. z­ direction is the skirt sliding direction and x­ direction is the circumferential direction. W is the piston sliding velocity relative to the liner. Essentially, we can view the left side of the Reynolds' equation as mass transport driven by pressure gradient, the first term at the right hand side as the mass transport induced by the sliding motion, and the second term at the right hand side as the change of mass within the control volume.                  Although the Reynolds' Equation is a good starting point. Preliminary results during the project do show its limitation. That is, it can not handle the cavitation phenomenon. Fluids can not sustain tension, and therefore can not exist at pressures below their cavitation pressure. Once the pressure predicted by the Reynolds' equation drops to a critical level (the cavitation pressure), as will occur for sufficiently divergent geometries, the fluid will cavitate, separating into liquid and vapor. In central regions of the flow, which are surrounded by fluid, cavitation will result in a region filled by a combination of oil vapor and liquid, at the cavitation pressure, as shown in Figure 3a. According 

Page 3: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

to the Jakobson­Floberg­Olsson (JFO) cavitation theory, as described by Elrod, the whole domain can be divided into two distinct zones, a full film region where the Reynolds' equation governs the pressure generation, and a partial film region which is at a constant pressure, with only a fraction of the control volume being occupied by fluid. It is assumed that within the partial film region, the fluid distribution can be represented by multiple streamers of fluid, spanning the gap between the two surfaces, as shown in Figure 3b. The oil transport rate is then determined using a linear velocity profile across the gap.

                                                      Figure 3a: Cavitation 

                                          Figure 3b: Partial film representation

    2.2 The Numerical Scheme

To obtain the algebraic discretized equations, a finite volume method is applied. In this project, a uniform rectangular grid is used. Equation 1 is integrated over each control volume. Figure 4 shows a typical control volume and its neighbors. Since convection mass transport only happens in sliding direction (z­direction), for a typical node P, it can exchange mass with all of its four neighbors in terms of diffusion (pressure gradient), while it can only exchange mass with its North and South neighbors in terms of convection. Note that to handle cavitation, some modification to equation 1 is needed since the mass transport mechanism in cavitation region is different from the mass transport mechanism in full film region. At cavitation region, mass transport is governed by local oil volume fraction and sliding motion, while at full film region, mass transport is governed by pressure gradient and sliding motion. Since we do not know exactly where is the cavitation region in prior, an initial guess of cavitation region should be made. For example, we can start with assuming there is full film everywhere. Then we solve the equations balancing oil mass to get a pressure distribution. Then we check at each node whether the pressure value is higher than cavitation pressure. If not, we set the state of this node to cavitation and solve the equation again. Note that depending on whether the state of the node is full film or cavitation, different oil mass transport mechanism should be applied accordingly. Using this iterative method, we can finally get the correct pressure distribution which is always  equal (cavitation region) or larger (full film region) then cavitation pressure.  In this project, the oil inlet boundary is always assumed to be the south boundary of the calculation domain. The oil boundary condition is set to be fully flooded boundary condition and the boundary pressure and the cavitation pressure is set to be zero (Note that since boundary pressure is only a reference for the pressure generated within the computation domain, 

Page 4: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

this is a reasonable assumption).    

                                Figure 4: relative location of nodes and control surfaces

3   Parallel implementation

After formulating the algebraic equations, the next step is to solve it. After some searching, I find a c numerical package, PETSc, and decide to use it in solving the skirt – liner lubrication problem. The Portable, Extensible Toolkit for Scientific Computation (PETSc) is a suite of data structures and routines that provide the building blocks for the implementation of large­scale application codes on parallel (and serial) computers. PETSc uses the MPI standard for all message­passing communication.    In this project, a uniform rectangular grid with Nx cells in x­ direction and Nz cells in z­ direction is used. There is no advantage in using a non­uniform grid because the location and extent of the cavitation zone is not known a priori. Then, it is quite simple to partition the computation domain. In PETSc, this can be done using the data structure DA, which help manage the parallel communication required while working with regular grid. Since the skirt shape in z­ direction is much more complex due to the presence of skirt tooling mark, Nz is usually much larger than Nx in order to capture the geometrical feature in z­direction in this project. Thus generally, the processors are partitioned along the z­direction. Figure 5 shows the partition when 4 processors are used. 

  

                                          Figure 5: grid partition when 4 processors are used

Page 5: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

        When solving the discretized sparse linear equation Ax=b in parallel, special caution is need to handle the 'ghost' nodes, that is, the bordering portions of the grid that are owned by neighboring processes. For example, see figure 4, it is possible that node P belongs to processor 1 while its north neighbor N belongs to processor 2, whose information is not contained in processor 1. Then, to get the  updated information of node N in evaluating the mass transport rate between P and N, communication between processor 1 and processor 2 is needed. One of the most important thing I learn during coding and debugging throughout this project is that always remember each processor only have part of the overall information and be clear when and where communication is necessary. 

4  Results

This section shows some of the project results. First I will show the physical results for Reynolds' equation and the modified results when cavitation is considered. Then, the timing results will be reported. To see the effect of cavitation, at first, the Reynolds' equation is solved, and some of the calculated pressure distributions with corresponding height profiles are reported. Then I will show that the results of Reynolds equation may give pressure values that are smaller than cavitation pressure (sometimes, even negative pressure), which is not physically feasible. This will demonstrate the necessity of including a pressure­checking­and­updating procedure that will make sure local pressure can not drop below cavitation pressure. These results with cavitation considered will be compared with the results when cavitation is not considered.    

4.1 Physical results 

In this section, I will present the pressure distributions generated corresponding to different height profile. To better show the results, I will start with the results of a very simple barrel shape height profile, which only captures the geometrical feature of the real skirt in the sliding direction. Thenovality is added to the height profile, which captures the geometrical feature of the real skirt in the circumferential direction. Finally, micro­features, that is, the skirt tooling mark is added in.

4.1.1   Pressure distribution for a simple barrel shape height profile 

Figure 6a shows the height (that is, the clearance between skirt and liner) profile. As a starting point, let's use a simple profile. Since it is typical for a piston skirt to have a converging­ diverging shape (barrel shape),  here I use a quadratic function to represent it. Later on, results for a real measured skirt profile will be presented. In this case, there are 100 nodes in the x­ direction (circumferential direction), and 400 nodes in the z­ direction (sliding direction). The arrow shows the sliding direction and the sliding speed is set to be 10m/s.  Figure 6b shows the corresponding pressure distribution given by Reynolds' equation. Figure 6c shows the pressure and height profile of the centerline (parallel to sliding direction). Note that at the converging region, the clearance is getting smaller and to balance the mass of oil, a high pressure builds up, similarly, at the diverging region, pressure drops. These observations are exactly what we learn from fluid mechanics.     However, these figures also shows the limitations of Reynolds equation. From Figure 6b and 6c we can clearly see that the minimum pressure drops all the way to negative 36 bar, which is physically not feasible. Also, since the height profile is symmetric, the pressure profile is also symmetric. Thus, if we integrate the pressure distribution over the computation domain, we get the 

Page 6: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

total load that can be supported by the  hydrodynamic pressure, that is, zero, which is also not true since we know in practice this kind of sliding bearings can actually support load.     Then, the previous mentioned iterative method is used to make sure that pressure can not drop below cavitation pressure. Figure 7a shows the corresponding pressure distribution for the same height profile. And figure 7b shows the corresponding pressure profile and height profile for the centerline. Compare figure 7 with figure 6, we can see now since at diverging region pressure can not drop too low, the pressure at converging region becomes higher (from 36bar in figure 6 to 43 bar in figure 7) to balance oil mass. 

                                           

                                          Figure 6a: Height profile                       Figure 6b: pressure profile (Reynolds' equation)                                  

                       Figure 6c: pressure and height profile of centerline (Reynolds' Equation)

                                

Page 7: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

   

         

   

                                           Figure 7a: pressure profile(cavitation considered)

                       Figure 7b: pressure and height profile of centerline (cavitation considered)

4.1.2 Pressure distribution of a height profile with combined ovality and barrel shape

In reality, beside the barrel shape along sliding direction, piston skirt also has a ovality feature in circumferential direction. Figure 8a shows such a height profile, figure 8b shows the corresponding pressure distribution given by Reynolds' equation and figure 8c shows the pressure distribution when cavitation is considered. Now since the clearance at the sides are larger compared with the previous height distribution, it is much easier for oil to find a way at the sides, and thus high pressure only builds up within the center region (where the clearance is minimum). 

Page 8: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

          Figure 8a: height profile                             Figure 8b: pressure profile (Reynolds' equation)  

                                Figure 8c: pressure profile (cavitation considered)

4.1.3 Add skirt tooling mark

Besides the macro­features including barrel shape and ovality, there are also micro­features, the tooling marks, present on the skirt. That is, the skirt surface is not smooth, instead, transverse (along the circumferential direction) tooling marks are machined on the skirt. Figure 9 shows such a height profile as well as the corresponding pressure distribution.

                Figure 9a: height profile                    Figure 9b: pressure profile (cavitation considered) 

Page 9: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

                  Figure 9c: pressure and height profile of centerline (cavitation considered)         From 9c, we can see when the clearance is large, the tooling mark is micro­feature compared with the macro barrel shape, thus the tooling mark does not change the pressure profile much. However, when the clearance is small, the wave height of the tooling mark is comparable with the clearance, and its effect on pressure profile is obvious.    To conclude this part, figure 10 shows the results for a real measured skirt. 

             Figure 10a: height profile                       Figure 10b: pressure profile(cavitation considered)

                     Figure 10c: pressure and height profile of centerline (cavitation considered)

Page 10: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

 4.2 Timing results 

To measure the performance of the parallel solver, a model problem is run on a quad­core computer. First, the accuracy of the parallel solver is confirmed. Compared with the results of serial code,   the relative error of the parallel code results are smaller than 1e­6. To measure the calculation time,  the built in PETSc profiler is used.   

                             Figure 11: sample PETSc profiling information       In Table 1, I reported the timing results with different processors used for different problem size. To help explain the results, figure 11 shows a sample PETSc profiling information. Table 1, the time is the maximum time of all the processors used, the Flop/sec is the average value of all the processors. To evaluate the amount of message communication, number of MPI messages and their lengths are also reported and its interesting to notice that the number of MPI message scale with (#Processor ­1), which is reasonable since this represents the number of 'ghost' nodes.       Figure 12 plots the timing results. The timing results show clearly when problem size is small, using more processors does not reduce the calculation time much because of the bottleneck of communication and thus the CPUs are essentially waste time waiting. When the problem size is fairly large, we do see significant speed up when more processors are used. Figure 13 shows the speed up, which is defined as the ratio of the calculation time for N processors over the calculation time for 1 single processor. Figure 14 shows the parallel efficiency, defined as the speed up over the number of processors used.

                                          Figure 12: timing results 

Page 11: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

                                                 Figure 13: speed up

                                            Figure 14: parallel efficiency

Table 1: parallel performance on a quad­core computer

Nx Nz # Processor Avg Flop/sec(*1e8)

#MPI messages

Total MPI Message Length

Time (second)

100 300 1 2.62 0 0 0.59

100 300 2 1.35 134 1.02E+005 0.57

100 300 3 0.97 268 2.05E+005 0.53

100 300 4 0.66 402 3.07E+005 0.58

100 600 1 2.55 0 0.00E+000 1.21

100 600 2 1.98 134 1.02E+005 0.78

100 600 3 0.96 268 2.05E+005 1.07

Page 12: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

100 600 4 0.9 402 3.07E+005 0.86

100 900 1 2.54 0 0.00E+000 1.82

100 900 2 1.53 134 1.02E+005 1.5

100 900 3 1.21 268 2.05E+005 1.28

100 900 4 0.91 402 3.07E+005 1.27

100 1200 1 2.51 0 0.00E+000 2.46

100 1200 2 1.97 134 1.02E+005 1.57

100 1200 3 1.54 268 2.05E+005 1.34

100 1200 4 0.99 402 3.07E+005 1.56

100 1500 1 2.51 0 0.00E+000 3.08

100 1500 2 2.26 134 1.02E+005 1.71

100 1500 3 1.54 268 2.05E+005 1.67

100 1500 4 1.04 402 3.07E+005 1.86

100 1800 1 2.49 0 0.00E+000 3.72

100 1800 2 2.25 134 1.02E+005 2.05

100 1800 3 1.82 268 2.05E+005 1.7

100 1800 4 0.97 402 3.07E+005 2.11

100 2400 1 2.46 0 0.00E+000 5.03

100 2400 2 2.23 134 1.02E+005 2.71

100 2400 3 1.92 268 2.05E+005 2.38

100 2400 4 1.57 402 3.07E+005 1.97

100 3000 1 2.45 0 0.00E+000 6.29

100 3000 2 2.3 134 1.02E+005 3.36

100 3000 3 1.71 268 2.05E+005 3.01

100 3000 4 1.44 402 3.07E+005 2.68

100 6000 1 2.3 0 0.00E+000 13.45

100 6000 2 2.29 134 1.02E+005 6.75

100 6000 3 1.83 268 2.05E+005 5.64

100 6000 4 1.81 402 3.07E+005 4.26

100 9000 1 2.35 0 0.00E+000 19.7

100 9000 2 2.23 134 1.02E+005 10.4

100 9000 3 1.81 268 2.05E+005 8.57

100 9000 4 1.81 402 3.07E+005 6.4

Page 13: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

100 12000 1 2.31 0 0.00E+000 26.7

100 12000 2 2.11 134 1.02E+005 14.7

100 12000 3 1.79 268 2.05E+005 11.5

100 12000 4 1.8 402 3.07E+005 8.61

To test the parallel performance portability, I also run the code on a dual­core shared memory computer. The results are reported as figure 15 and table 2. Still, we can see only when grid size is fairly large, 2 processors will reduce the calculation time. However, the parallel performance is worse on this computer. On the quad­core computer, the parallel efficiency with 2 processors is higher than 80% while on this computer, the parallel efficiency with 2 processors is around 60% to 70%.  

                                                                                                      Figure 15: timing result

Table 2: parallel performance on a dual­core computer

Nx Nz # Processor Time(second) Avg flop/sec (*1e8)

100 100 1 0.13 3.92

100 100 2 0.16 1.68

100 200 1 0.28 3.7

100 200 2 0.31 1.67

100 400 1 0.6 3.41

100 400 2 0.51 2.02

100 800 1 1.67 2.47

100 800 2 1.13 1.82

100 1600 1 3.59 2.29

Page 14: A parallel solver for thin film hydrodynamic lubrication ...courses.csail.mit.edu/18.337/2010/projects/reports... · This project is focused on building a parallel solver for thin

100 1600 2 2.93 1.41

100 3200 1 7.47 2.21

100 3200 2 6.16 1.34

100 5000 1 11.9 2.17

100 5000 2 9.78 1.32  

5  Conclusion

In this project, a parallel solver for thin film hydrodynamic lubrication is developed. The limitation of Reynolds' equation is recognized and consideration of cavitation is included in the solver. A mass conserving finite volume method is used to discretize the governing equation and formulate the algebraic equations. The assembled sparse linear system is solved using PETSc package. The parallel code built using PETSc is based on MPI standard. The solver is tested on a quad­core computer and good speed up is achieved. One of the future work I plan to do is to try the various parallel linear system solver provide in PETSc and compare their performance. Also, due to hardware limitations, I was unable to test the algorithm on more than four processors. In the future, it would be useful to test the algorithm on larger machines to verify how well it scales with the number of processors used.