AERODYNAMIC OPTIMIZATION FOR FREIGHT TRUCKS USING A GENETIC ALGORITHM AND CFD Except where reference is made to the work of others, the work described in this thesis is my own or was done in collaboration with my advisory committee. This thesis does not include proprietary or classified information. _______________________ Joshua Brian Doyle Certificate of Approval: ________________________ Anwar Ahmed Associate Professor Aerospace Engineering _________________________ Roy J. Hartfield, Chair Associate Professor Aerospace Engineering ________________________ Brian Thurow Assistant Professor Aerospace Engineering _________________________ George T. Flowers Interim Dean Graduate School AERODYNAMIC OPTIMIZATION FOR FREIGHT TRUCKS USING A GENETIC ALGORITHM WITH CFD Joshua Brian Doyle A Thesis Submitted to the Graduate Faculty of Auburn University in Partial Fulfillment of the Requirements for the Degree of Master of Science Auburn, Alabama December 17, 2007 iii AERODYNAMIC OPTIMIZATION FOR FREIGHT TRUCKS USING A GENETIC ALGORITHM WITH CFD Joshua Brian Doyle Permission is granted to Auburn University to make copies of this thesis at its discretion, upon request of individuals or institutions and at their expense. The author reserves all publication rights ____________________________ Signature of Author ____________________________ Date of Graduation iv VITA Joshua Brian Doyle was born on November 15, 1982, in Birmingham, Alabama to Brian and Diane Doyle. During high school, he worked various jobs for his parents? small home building company in fields such as computer aided drafting and accounting. He began attending Auburn University after graduating from Oak Mountain High School in 2001. While at college, he was a member of Cupola engineering society, the section leader of the Auburn University Drumline, and an intern for Dynetics, Inc. in Huntsville, Alabama. Josh graduated Summa Cum Laude in May 2005 with a Bachelor of Aerospace Engineering degree. He began alternating semesters between work at Dynetics, Inc. and graduate school at Auburn University where he pursued a master?s degree in aerospace engineering. v THESIS ABSTRACT AERODYNAMIC OPTIMIZATION FOR FREIGHT TRUCKS USING A GENETIC ALGORITHM AND CFD Joshua Brian Doyle Master of Science, December 17 2007 (B.A.E., Auburn University, 2005) 90 Typed Pages Directed by Roy J. Hartfield A computational fluid dynamics (CFD) code is being combined with a genetic algorithm (GA) to perform a two-dimensional drag minimization study on tractor trailers. This paper involves the minimization of drag on two different parts of the tractor trailer: the rearview mirrors and the base region. Both optimization problems were simplified to two dimensional analyses due to the complexity of a CFD driven GA problem. Few studies have been conducted with CFD driven by a GA due to extensive run times the general non autonomous characteristics of meshing a suitable CFD geometry. This study solves the Reynolds-averaged Navier-Stokes (RANS) equations to obtain a drag calculation used by the GA. Two Fortran codes were written from scratch to handle the meshing of the variable geometry mirror and base region for the entire design space. The mesh generators were used as subroutines in the GA with the only input being the vi geometric variables. The objective function for the GA consists primarily of the mesh generator code and the CFD solver. The mirror shape optimization involved a mirror concept consisting of transparent flat plates extending beyond the mirror and tapering to a point similar to an airfoil. Four geometric parameters were varied to determine a minimum drag geometry within the design space. The resulting optimized mirror geometry was somewhat trivial due to the impractical length of the GA chosen mirror design. The base optimization involved placing flaps of varying size, position, and curvature in the base region to determine a minimum drag configuration. The front of the tractor trailer remained unchanged, but was included in the CFD analysis. The base flaps were defined by a cubic function that required 4 variables plus one additional variable to set the length of the flaps. Federal regulations limit length of base protuberances. For this study the flap length was limited to a maximum of four feet aft of the trailer base. The resulting minimum drag configuration was shown to reduce drag by over 50 percent when compared to the CFD run with no base flaps. vii ACKNOWLEDGEMENTS The author would like to thank Dr. Roy Hartfield and Dr. Chris Roy for their guidance with this thesis as well as Ravi Duggirala and Pavan Veluri for their help with technical CFD matters. The author also wishes to thank Dr. Murray Anderson, the author of the IMPROVE 3.1 Genetic Algorithm. The author would also like to thank his friends, family, and fianc? for being patient with him as he worked to complete this thesis. viii Style manual of journal used: The American Institute of Aeronautics and Astronautics Journal Computer software used: Improve 3.1 Genetic Algorithm, Fluent, Tecplot 360, Matlab, Force 2.0 Fortran Compiler, Microsoft Excel, Microsoft Word ix TABLE OF CONTENTS LIST OF TABLES .........................................................................................................xi LIST OF FIGURES...................................................................................................... xii NOMENCLATURE ......................................................................................................xv 1. INTRODUCTION ...................................................................................................1 2. MIRROR STUDY ...................................................................................................7 2.1 MIRROR MODELING....................................................................................7 2.2 MIRROR MESHING.......................................................................................8 2.3 MIRROR CONVERGENCE CRITERIA .......................................................13 2.4 CODE STRUCTURE AND COMPUTATIONAL EXPENSE .......................16 2.5 MIRROR RESULTS......................................................................................19 3. BASE SLAT STUDY............................................................................................27 3.1 BASE SLAT MODELLING ..........................................................................27 3.2 BASE SLAT MESHING................................................................................30 3.3 GRID REFINEMENT STUDY......................................................................37 3.4 BASE SLAT CONVERGENCE CRITERIA..................................................41 3.5 CODE STRUCTURE AND COMPUTATIONAL EXPENSE .......................43 3.6 BASE SLAT RESULTS.................................................................................46 x 4. CONCLUSIONS .......................................................................................................68 REFERENCES..............................................................................................................70 APPENDIX A: Mirror Optimization GA Input File .......................................................74 APPENDIX B: Base Slat Optimization GA Input File ...................................................75 xi LIST OF TABLES Table 1: Mirror Design Space and Optimized Parameter Values ....................................21 Table 2: Drag Breakdown of Mirror Results ..................................................................22 Table 3: Coarse and Fine Grid Node Points ...................................................................38 Table 4: Drag Breakdown for Coarse and Fine Grids.....................................................40 Table 5: Design Space for Slat Optimization..................................................................46 Table 6: GA Optimized Slat Variables...........................................................................57 Table 7: Effective Short Slat Variables ..........................................................................63 Table 8: Experimental Slat Variables.............................................................................66 xii LIST OF FIGURES Figure 1: Engine Loading on Tractor Trailers (Ref. 24) ...................................................3 Figure 2: Mirror Concept.................................................................................................5 Figure 3: Base Flap Concept............................................................................................6 Figure 4: Mirror Parameters.............................................................................................7 Figure 5: Mirror Mesh Directions ....................................................................................9 Figure 6: Mirror Mesh Area for Possible Grid Overlap ..................................................12 Figure 7: Mirror Trailing Edge Mesh.............................................................................13 Figure 8: Drag Convergence for Test Mirror..................................................................14 Figure 9: Residual History for Test Mirror.....................................................................15 Figure 10: Flow Chart for Original GA and Objective Function.....................................18 Figure 11: GA Mirror Convergence ...............................................................................20 Figure 12: Streamlines for Optimized Mirror Solution ...................................................21 Figure 13: X-Velocity for Optimized Mirror Solution....................................................23 Figure 14: X-Velocity for Optimized Mirror Solution....................................................24 Figure 15: Streamlines for Worst Mirror Performer .......................................................25 Figure 16: X-Velocity for Worst Mirror Performer ........................................................25 Figure 17: Depiction of Slat Variables ...........................................................................28 Figure 18: Full Truck Mesh ...........................................................................................31 Figure 19: Truck Zone 2 Indexing Without Slat .............................................................32 xiii Figure 20: Truck Zone 2 Indexing With Slat..................................................................32 Figure 21: Front End of Truck .......................................................................................33 Figure 22: Upper Corner of Truck Base Region.............................................................34 Figure 23: Base Region Grid Without Slat .....................................................................35 Figure 24: Base Region Grid With Slat..........................................................................36 Figure 25: Potential Area of Highly Skewed Cells .........................................................37 Figure 26: Coarse and Fine Grid Comparison ................................................................39 Figure 27: Drag Convergence for Grids Without Slats ...................................................40 Figure 28: Drag Convergence for Two Test Geometries ................................................41 Figure 29: Residual Convergence for Test Geometry.....................................................42 Figure 30: Revised GA Flowchart..................................................................................45 Figure 31: Truck Front Flowfield...................................................................................47 Figure 32: Truck Front Velocities..................................................................................48 Figure 33: Drag Distribution by Generation...................................................................50 Figure 34: H 1 Distribution by Generation.......................................................................51 Figure 35: H 2 Distribution by Generation.......................................................................52 Figure 36: ? by Generation ............................................................................................53 Figure 37: ? 1 Distribution by Generation .......................................................................54 Figure 38: ? 2 Distribution by Generation .......................................................................55 Figure 39: Slat Length Distribution by Generation.........................................................56 Figure 40: GA Optimized Slat .......................................................................................57 Figure 41: Drag History of Optimized Slat Configuration..............................................58 Figure 42: Residual History of Optimized Slat Configuration ........................................59 xiv Figure 43: Wake Region with No Slats ..........................................................................60 Figure 44: Wake Region with GA Optimized Slat..........................................................61 Figure 45: Close-up of Optimized Slat Base (1.5m scale) ..............................................62 Figure 46: Close-up of Optimized Slat Base (0.3m scale) ..............................................62 Figure 47: Effective Short Slat.......................................................................................63 Figure 48: Short Slat Base Region Flowfield .................................................................64 Figure 49: Experimental Slats........................................................................................65 Figure 50: Experimental Slat ?A? Flowfield ..................................................................67 Figure 51: Experimental Slat ?B? Flowfield...................................................................67 xv NOMENCLATURE CFD Computational Fluid Dynamics GA Genetic Algorithm RANS Reynolds-Averaged Navier-Stokes C f Skin Friction Coefficient C D Drag Coefficient RE Reynold?s Number ? Density ? Mach Number u X-Velocity U e Edge Velocity ? w Wall Shear Stress ? Viscosity u t Friction Velocity y+ Normalized Turbulence Length L 1 Mirror Parameter R 1 Mirror Parameter R 2 Mirror Parameter R 3 Mirror Parameter H 1 Base Slat Parameter H 2 Base Slat Parameter ? Base Slat Parameter L Base Slat Parameter ? 1 Base Slat Parameter ? 2 Base Slat Parameter 1 1. INTRODUCTION The use of genetic algorithms (GAs) as a design tool has been demonstrated in many areas of the aerospace industry. 1-22 GAs have been used in many aerospace applications such as spacecraft controls 1,2 , turbines 3,8,15 , helicopter controls 4 , flight trajectories 5 , wings and airfoils 6,7,9,10 , inlets 14 , rockets 16,19 , missiles 12,13,17,18,21,23 , and propellers 22 . This study uses the IMPROVE? code which is a binary encoded tournament based GA used in References 13, 17, 18, and 21-23. The GA features many capabilities such as a pareto option, nicheing, creep, and elitism. Genetic Algorithms are loosely based on the theory of evolution by having members compete with each over generations. Members that have the best survival characteristics, or in this case geometric parameters, are more prone to survival. For these two optimizations, fitness is determined by the computation of drag carried out by a RANS CFD simulation. The members in each case will be different geometries based on the selection of variable parameters within a given design space. The GA passes these members to the objective function. The objective function consists of a mesh generator for the given geometry and computational fluid dynamics (CFD) solver to obtain the drag value. GA?s have several advantages over typical gradient based optimizations. Gradient based optimizations require an initial set of parameters which are used as a starting point for the optimization. Gradient optimization schemes then attempt to approach an 2 optimum by feeling out derivatives and moving towards the best performing set of parameters. Problems can arise if the initial parameter set exists near some local optimum to which the optimization scheme will likely converge upon. Convergence to a local optimum is more common in problems with many variables and problems with highly coupled variables. 36 Performance derivatives with respect to each parameter are very costly when using Navier-Stokes CFD as an objective function. Geometric parameters also produce highly coupled results in complex flowfields. These factors justify using a GA rather than a gradient based optimization scheme for the drag minimization studies presented in this thesis. The Steady-state Reynolds-averaged Navier-Stokes equations were solved for each member evaluated by the GA. A k-? turbulence model was used for the mirror optimization while a k-? turbulence model was used for the base slat optimization. The CFD solver, Fluent, uses a cell centered finite volume method for integration of the governing equations. The segregated solver option was used to decouple continuity and momentum equations. The energy equation was deactivated because the simulations were conducted at low speed. A second-order upwind discretization was used for the momentum equation while a first-order upwind discretization was used for turbulent kinetic energy and specific dissipation rate. 31 The driving force behind this study is the potential fuel cost savings of an aerodynamically optimized tractor trailer. In 2006 tractor trailers logged 143.6 billion miles in the United States alone at an average of 5.9 miles per gallon corresponding to 24.3 billion gallons of diesel fuel or 600 million barrels or oil. 25 The direct economic 3 impact is about 40 billion dollars for a crude oil price of $70 per barrel. Figure 1 shows the horsepower contribution of aerodynamic drag and rolling friction resistance. For typical highway speeds, aerodynamic drag accounts for more than half of the engine load. A drag reduction of 20% would result in approximately 10% fuel savings. This amount of fuel savings would result in a savings of 4 billion dollars annually for trucks in the United States. Even if drag reduction efforts can only reduce drag by 5%, plenty of financial motivation still exists for the aerodynamic optimization of tractor trailers. Figure 1: Engine Loading on Tractor Trailers (Ref. 24) Two studies were conducted using CFD driven by the GA. The first was an optimization of a rearview mirror concept that places optically transparent surfaces which taper to a point aft of the mirror section to reduce flow separation around the mirror. The mirror problem was chosen for two main reasons. First, studies have shown that typical 4 rearview mirrors account for approximately 8.5 percent of drag on tractor trailers. 35 Even a small reduction in total drag from improvements in mirror aerodynamics could potentially save a large amount of fuel. Second, the two dimensional mirror was a relatively simple geometry to test the feasibility of a CFD driven GA solution. A simple ?C? mesh could wrap around the model in a similar manner as a typical airfoil CFD problem. Figure 2 shows a sketch of the proposed mirror design. Trailing edge length and three front end curvature variables were considered in the design space. The front section consists of four different arc sections with variable radii constrained by tangent connecting points. Three arc sections make up the nose of the mirror followed by one more arc section used to turn from the freestream tangent to the taper angle determined by the length of the mirror. Only two variables exist in the three nose arc section because one arc is simply a mirror image of the other. 5 Figure 2: Mirror Concept The second study concentrated on the base region of the tractor trailer. The GA was used to determine the optimal size, position, and curvature of the flaps for base drag reduction. References 24, 28, and 29 describe previous efforts of drag reduction by using base flaps. A front end geometry previously shown to produce no flow separation was provided by Dr. Chris Roy and implemented in the model. 30 In order to drastically reduce CFD run times, only half of the model was meshed and the symmetry boundary condition was used. A total of 5 variables were used for the modeling of the base region slats. Only symmetrical flap configurations were considered. The variable design space is covered in detail in a later section of this thesis. Figure 3 shows a schematic of the base slat configuration. 6 Figure 3: Base Flap Concept 7 2. MIRROR STUDY 2.1 MIRROR MODELING The geometry chosen for this optimization process consists of four variable parameters and a fixed mirror width of 6 inches as shown in Figure 4. L is the length of the trailing edge. Parameters R 1 , R 2 , and R 3 are all arc radii used for different arc segments. The geometry consists of six segments and is essentially a two- dimensionalized blunted ogive followed by a linear taper. Figure 4: Mirror Parameters The front of the mirror consists of three separate arc sections. The top and bottom arc sections on the front are mirror images of each other and both have a radius of R 1 . The nose of the mirror is a separate arc that has a radius of R 2 and is tangent to the connecting arc sections at points C and D. R 3 is the radius of the arc connecting point E to the tapering straight edge of the mirror at point F and is also tangent to its connecting surfaces. These four parameters along with the fixed width and tangent constraints are 8 enough to completely define the geometry of the mirror. 2.2 MIRROR MESHING The first step in a CFD simulation is to create the mesh. Ordinarily some sort of grid generation software with a graphical user interface (GUI) is used to create the mesh. While this approach is moderately quick and very effective, the use of a genetic algorithm prevents any sort of user interaction with gridding software. In this study, the entire grid generation process was done by writing two (one for each optimization) FORTRAN subroutines from scratch that were capable of generating a mesh for any possible geometry within the design space. After several preliminary CFD runs the mirror mesh generating subroutine was varied until a suitable combination of node clustering in high gradient areas was found while minimizing the number of nodes. Grids created by the mirror meshing subroutine typically had about 35000 nodes. The subroutine was programmed to mesh the nodes using a hyperbolic function for the j direction (moving away from the mirror in the surface-normal direction). Nodes in the j direction were extended perpendicular from every surface to best capture skin friction as shown in Figure 5. 9 Figure 5: Mirror Mesh Directions The locations of the first node points away from the wall were of importance to accurately capture the turbulent boundary layer. To determine the distance of the first node point away from the wall, the Near-Wall Model 31 approach was used. This method consists of finding an approximate skin friction value that can be used to estimate the shear stress at the wall. The friction velocity can then be found from the shear stress at the wall. With all of these properties known, y+ (the normalized turbulence length) can be determined as a function of the wall-normal distance y. For the Near-Wall Model approach, setting y+ equal to unity yields a value of y which serves as a suitable distance from the wall for the first node. 31 The calculation of y+ is developed as follows. The normalized turbulence length can be found by the following calculations. For a rough approximation of turbulent flow 10 over a flat plate, the skin friction coefficient can be written as shown below 5/1 Re 074.0 L f C = (Ref. 26) where Re c is the Reynolds number based on the chord length (or in this case, the mirror length) and can be expressed as ? ? total L uL =Re (Ref. 26) where the mirror length is a function of its geometric parameters. ()?? cos1cos 211 ?++= RRLL total Here, ? is the angle measured clockwise from vertical to the line tangent to the curve at point C in Figure 4. ? ? ? ? ? ? ? ? ? ? = ? 21 1 1 3 sin RR R ? The shear stress at the wall can be found from 11 few CU 2 2 1 ?? = (Ref. 26) where U e is the edge velocity, which is approximated here as the freestream velocity. The friction velocity can then be estimated by ? ? w T u = (Ref. 31) Finally, the expression for y+ can be written as ? yu y T = + (Ref. 31) where ? is the kinematic viscosity. The mesh generating subroutine uses this process for each mesh created to set a y+ values near unity for the first node away from the wall along all points of the wall. Grid points are then generated in the j direction (perpendicular to the wall) with hyperbolic tangent spacing until a distance of five chord lengths from the wall is reached. In the case of grid lines crossing each other (this is possible for a small L 1 and large R 3 ) the aft end of the mesh is extended until the crossover problem is resolved. Figure 6 12 shows the area where grid lines can possibly overlap. Figure 6: Mirror Mesh Area for Possible Grid Overlap Grid point spacing in the i direction along the mirror surface was programmed to be fine along the curved and trailing edges due to the gradients involved in these areas. It would be feasible to space the grid points out more over the center of the tapering section, however, for this preliminary study the grid spacing was held nearly constant over the entire wall. The only prominent varying of grid spacing in the i direction 13 came aft of the trailing edge. Figure 7 shows the meshed trailing edge. Figure 7: Mirror Trailing Edge Mesh 2.3 MIRROR CONVERGENCE CRITERIA Due to run time constraints, the solution was only allowed to converge until the variance in the drag coefficient was within three percent. This was determined by running one case and allowing the continuity, x-momentum, and y-momentum residuals to converge far past the point of any change in the drag coefficient. A suitable convergence criterion was then found by examining the percent error of drag compared to the fully converged value as a function of continuity, x-momentum, and y-momentum residual 14 convergence. Convergence values were chosen around the point where the drag reached 3% of the converged drag and never diverged out of the range. Figures 8 and 9 show the convergence history of continuity, x-momentum, and y-momentum residuals, as well as the drag coefficient normalized by the fully resolved drag coefficient. Drag Convergence History 0.9 0.95 1 1.05 1.1 0 500 1000 1500 2000 2500 3000 3500 4000 4500 Iteration N o rm al i z ed Drag C o effi ecn t Figure 8: Drag Convergence for Test Mirror 15 Residual History 1.E-09 1.E-08 1.E-07 1.E-06 1.E-05 1.E-04 1.E-03 1.E-02 1.E-01 1.E+00 0 500 1000 1500 2000 2500 3000 3500 4000 4500 Iteration S cal ed Re si d u al Continuity x-momentum y-momentum Figure 9: Residual History for Test Mirror From the plots above, it can be seen that the drag coefficient is within 3% for scaled residual values between 10 -4 and 10 -5 . For the cases run, the continuity, x- momentum, and y-momentum residuals were set to a convergence criteria of 2?10 -5 . For this study, all of the cases were run as turbulent flows. A mirror with a length of one foot in a freestream velocity of 75 mph (33.5 m/s) will have a Reynold?s number based on length of approximately 725,000. The Reynold?s number is found by ? ? Lu L ? =Re The smallest allowable length from the GA parameter constraints is just less than one foot with a maximum value of around three feet. This turbulent assumption is accurate 16 because the mirror is expected to have some considerable roughness to create a turbulent boundary layer along the majority of the surface. A typical transition Reynold?s number for a smooth flat plate is between 10 6 and 10 7 , while rough surfaces have lower transition Reynold?s numbers. 27 A two equation k-? turbulence model was used to capture the turbulent boundary layer effects. The inflow boundary started from the upper right corner of the mesh, wrapped around to the left end, and ended at the bottom right corner of the mesh. Freestream velocity was in the positive x direction. Although the top and bottom of the grid were defined as inflow boundaries, no actual flow passed through the boundary cells because the cells were parallel to the freestream velocity. A pressure outlet was used for the remaining free boundary with the outlet pressure set to one atmosphere. The entire mesh was initialized with the freestream conditions before being solved to reduce run time. 2.4 CODE STRUCTURE AND COMPUTATIONAL EXPENSE The initial strategy to decrease computational run times was to utilize the parallelization capabilities of the Fluent CFD solver on Auburn University?s 30 node, 60 processor Linux cluster. The GA used was not written with parallel capabilities, but with some effort could potentially be modified to run more than one case at a time. The objective function, however, could easily call the CFD solver and utilize its parallel capabilities. In this manner, only one case was run at a time, but that case would be parallelized. Mirror run times were found to decrease slightly by increasing the number of 17 processors from one to three; however, run times increased for any number of processors beyond three. This was due to two factors. The first was the initialization time required for multiple processor runs increased as processors were added. The second reason was that the relatively small number of grid points for the mirror mesh was likely too small to efficiently solve in parallel among many processors. It was found that most cases took roughly five minutes to converge to the chosen criteria when operating on two processors. With this relatively short run time, a full GA run consisting of 20 members per generation and 15 generations could be completed in approximately 25 hours while using two processors. For the mirror geometry, potential computational time decrease obtained by manipulating the GA to run more than one case at a time was not justified. While no modifications were made to the GA for the mirror optimization, optimizations involving more complicated geometries would almost certainly need the ability to have several members evaluated at the same time. As will be shown in Chapter 3, parallelism within the GA was necessary for the two-dimensional optimization of base slats on a tractor trailer. The flow chart for the GA along with the objective function is shown in Figure 10. The GA begins by randomly selecting variables within the design space for all members of the first generation. The GA then sends the members one at a time through the objective function. The objective function in this case consists of the grid generator as well as the CFD solver. Once the solver is converged, the drag is calculated and returned to the GA for that particular member. After all members in a generation have been evaluated, they are sorted by their performance and used to create the members of the 18 next generation. The methods used to create the new members depend on the selection of control options from the GA input file such as creep, elitism, pareto, and nicheing. A sample file of the GA input with the chosen options is shown in Appendix A. Create Generation of Random Members Call Objective Function for Each Member Start GA Run Rank / Sort Members based on Performance GA Run is Complete! Output Results Create Next Generation from Best Performers of Previous Generation Create Grid from Variables Run CFD Solver in Batch Mode (multiple processors) Return Drag Value If Not Final Generation If Final Generation Loop for Each Member Figure 10: Flow Chart for Original GA and Objective Function 19 2.5 MIRROR RESULTS Post analysis on the optimized solution showed an error in values of turbulent viscosity and turbulent dissipation rate. These errors were found to be in the inflow boundary conditions and were corrected. Several cases were rerun to check the effect on drag. Drag decreased some for all cases, but the best performers remained the same. The error had no practical effect on the geometry chosen as the optimized solution. The geometries most affected were the worst performers in the first few generations. All flow fields shown have the correct turbulent viscosity and turbulent dissipation rate. Drag values shown in the GA convergence plot are from the initial GA run before the changes were made. It is important to note the values of drag are not as important for this demonstration effort as the demonstrated ability to find an optimized solution. The GA arrived at a nearly optimized solution for the design space tested after 15 generations. Figure 11 shows drag results by generation. For this study, drag will be presented in coefficient form non-dimensionalized by freestream conditions and geometric parameters. Unlike three-dimensional flowfields, two-dimensional drag is expressed as a force per unit length rather than simply a force. The equation for the two- dimensional drag coefficient is shown below ref D Lu LengthDrag C 2 2 1 / ?? = ? 20 where ? ? and u ? are freestream density and velocity. L ref is the fixed mirror width of 6 inches. GA Convergence 0.06 0.065 0.07 0.075 0.08 0.085 0.09 0.095 0.1 0.105 0.11 0 2 4 6 8 10121416 Generation D r ag C o ef f i ci e n t Max Cd Avg Cd Min Cd Figure 11: GA Mirror Convergence The best performer in the last generation only reduced the drag 10% from the best performer of the first generation. As will be seen in Chapter 3, this is not the case for more complicated geometries and flowfields. Due to a small number of parameters, the GA was able to come very close to the optimized solution by the random parameter values chosen in the first generation. The maximum drag coefficient was from a member of the initial generation. The GA was able to drastically reduce the maximum drag after one generation. The average drag coefficient per generation levels out around 10 generations as well as the minimum drag member. Because the GA maximized L 1 and R 1 for the optimal solution, it is unlikely that the GA would have been able to drastically improve upon the winning geometry if more generations were run. 21 L1 (in) R1 (in) R2 (in) R3 (in) Minimum 10 4 0.5 0.5 Maximum 20 16 2.5 4 Optimized Solution 20.00 16.00 0.63 3.39 Table 1: Mirror Design Space and Optimized Parameter Values Table 1 shows the optimized solution parameter values found by the GA as well as the allowable design space for the optimization. L 1 and R 1 were maximized to get the minimum drag coefficient. It is apparent that the true optimal parameter values lie outside of the allowable design space. The general procedure would be to expand the design space and run the GA again, however, practical factors would prohibit the use of excessively long mirrors. Figure 12: Streamlines for Optimized Mirror Solution 22 The optimized design along with pressure contours and streamlines is shown in Figure 12. As expected, the flow remained attached all around the body of the mirror. One interesting detail of this GA optimization is the resemblance of the solution to an airfoil. Since L 1 and R 1 were maximized, the longest, most slender possibility was found to have the minimum drag, indicating that the pressure drag was much more dominant than the skin friction drag. pressure coefficient viscous coefficient total drag coefficient % viscous drag Optimized Solution 0.056 0.00738 0.0633 11.7 Worst Performer 0.104 0.00411 0.108 3.8 Table 2: Drag Breakdown of Mirror Results Table 2 shows the breakdown between viscous drag and pressure drag for the best and worst performers. The optimized solution has 11.65% of its total drag coming from skin friction forces while the worst performer only has 3.79% skin friction drag. This is due to the large difference in wetted wall area between the two members. Pressure drag is nearly twice as high for the worst performer. This comes from the separated flow for the worst performer and attached flow for the optimized solution. 23 Figure 13: X-Velocity for Optimized Mirror Solution Figures 13 and 14 show the x-velocity for the front and aft sections of the mirror. The stagnation point can be seen at the tip of the nose and the maximum velocity can be seen at the bottom middle of the mirror. The maximum velocity is around 55 m/s and the freestream velocity is 33.5 m/s (75 mph) giving a maximum velocity ratio of 1.64. For reference, the maximum velocity for potential flow over a cylinder is twice the freestream velocity. Figure 11 shows the bottom boundary layer thickness is much larger than the top boundary layer thickness. This is due to the flow on the under side (nearest the truck) experiencing an adverse pressure gradient. 24 Figure 14: X-Velocity for Optimized Mirror Solution The member with the maximum drag is shown in Figure 15. The short length contributes to flow separation on the under side resulting in large drag penalties. Although the wetted area is small causing very little skin friction, the pressure drag is dominant and much larger than the case with no separation. 25 Figure 15: Streamlines for Worst Mirror Performer Figure 16: X-Velocity for Worst Mirror Performer 26 Figure 16 shows the x-velocity for the member with the maximum drag. Once the flow passes the bottom edge to the tapering section of the mirror, the boundary layer grows drastically until separation occurs. By examining the best performer?s parameters, it is apparent that a true optimum for the mirror geometry exists outside of the design space limits by which the GA was bounded. It is also apparent that the optimal (with respect to drag) mirror design is too long to be practical. Much more experimentation and testing would be needed to determine if a shorter mirror could be a viable design. Although the results from the mirror optimization do not suggest a sensible design, the process of combining a GA with CFD was found to be effective. The customized grid generator was made to handle a number of parameters, and it created grids that converged sufficiently when input into the CFD solver. 27 3. BASE SLAT STUDY 3.1 BASE SLAT MODELLING Figure 17 illustrates the base region of the two dimensional tractor trailer model used in this study. The dotted line represents a line of symmetry used to drastically reduce computational expense. A cubic is used to describe the slat geometry here, hence six variables are shown. Five of the six variables shown can completely describe the curvature and length of the slat. ? and H 2 are redundant. ? 1 and ? 2 are initial and final angles of the slat with respect to the horizontal. L is the length the slat extends past the rear of the trailer. H 1 is the distance from the centerline to the point of attachment of the slat. H 2 is the vertical distance from the centerline to the end of the slat. Due to federal regulations, L will be limited to four feet. Initially, H 2 was planned to be non-dimensionalized by H 1 and allowed to vary between zero and one. After grid convergence issues arose, the variable was changed to ?, the angle between the attached end and free end of the slat. H 2 and ? are related by: L HH 21 tan ? =? In this manner, ? could be limited to a reasonable angle to avoid CFD convergence problems associated with large angles. 28 Figure 17: Depiction of Slat Variables H 1 , ?, ? 1 , ? 2 , and L provide just enough information to fully define the cubic curve. H1 and the length of the truck provide a location for the first point. H 2 and L provide a location for a second point of the curve. Finally, the initial and final angles, ? 1 and ? 2 , are needed to define the curvature. The following process was used to convert the variables into coefficients used for the cubic. The equation for a cubic curve can be written as DCxBxAxy +++= 23 Here, we seek to find the coefficients A, B, C, and D such that y can be determined for 29 every x position of the slat. Taking the derivative of y with respect to x gives the slope of the curve. CBxAx x y ++= ? ? 23 2 Applying the previous two equations at the known starting and ending points on the slat gives four equations and four unknowns. DCxBxAxy DCxBxAxy +++= +++= 2 2 2 3 22 1 2 1 3 11 () () CBxAx x y CBxAx x y ++=?= ? ? ? ? ? ? ? ? ++=?= ? ? ? ? ? ? ? ? 2 2 22 2 1 2 11 1 23tan 23tan ? ? Coefficients were then solved as functions of known values, x 1 , x 2 , y 1 , y 2 , ? 1 , and ? 2 . The coefficients can be expressed as follows: () () 21 2 2 2 1 21 3 21 2 22 2 1 3 1 21 2 tantan 33 22 xxxxxxxxxx yy A ?+ ?+? + ?+? +? = ?? ()() ()()()() 21 2 2 2 1 212211 3 21 2 22 2 1 3 1 212211 2 2tan2tan 33 33 xxxx xxxx xxxxxx xxyxxy B ?+ +??+?? + ?+? +?+ = ?? 30 ()( ) ()( ) 21 2 2 2 1 12122211 3 21 2 22 2 1 3 1 212211 2 2tan2tan 33 66 xxxx xxxxxx xxxxxx xxyxxy C ?+ +?++? + ?+? +? = ?? ()() () () 21 2 2 2 1 2 2 12 2 211 3 21 2 22 2 1 3 1 2 1212 2 2211 2 tantan 33 33 xxxx xxxx xxxxxx xxxyxxxy D ?+ ???? + ?+? ?+? = ?? Finally, the coefficients are substituted into the simple cubic expression to solve for any y on the slat as a function of x. 3.2 BASE SLAT MESHING Unlike the mirror problem, meshing the truck was not possible with a single zone ?c? mesh. The lack of a tapered trailing edge created a necessity for two zones in the truck grid. Figure 18 shows how the truck mesh is broken into two zones. Indexing for zone 1 starts at the lower right corner of the zone and extends left for the increasing i direction and up for increasing j direction. For this problem, a typical mesh with a base flap consists of about 90,000 to 100,000 nodes total with approximately 60,000 to 65,000 in zone 1 and 30,000 to 35,000 in zone 2. A grid refinement study (Section 3.3) was performed to ensure that this number of grid points was sufficient. Zone 1 generally consists of around 430 nodes in the i direction and 140 nodes in the j direction which extends approximately two truck lengths outward from the truck surface. 31 Figure 18: Full Truck Mesh Figures 19 and 20 show zone 2 in greater detail. The border between zones is a horizontal line if no slats exist. With the addition of slats, the entire region aft of the tractor trailer is shifted vertically causing a curved border between zones. Indexing starts in the lower left corner with increasing i in moving right and increasing j moving up. Zone 2 with a flap present typically consists of 300 nodes in the i direction and 100 nodes in the j direction. The far right side of the grid ends approximately two truck lengths aft of the rear of the truck. 32 Figure 19: Truck Zone 2 Indexing Without Slat Figure 20: Truck Zone 2 Indexing With Slat Figure 21 shows a close up of the front end of the truck. Spacing in the i direction 33 was held constant at just under one inch from the top of the truck?s curved corner in the increasing i direction all the way to the line of symmetry. The primary purpose of modeling the front end of the truck was to have an accurately developed boundary layer flow approaching the base, therefore, one inch spacing on the front end of a full scale truck model was deemed reasonable. Any drag error obtained by i spacing in the front end of the truck will be present on every model tested by the GA and will not affect which geometry is chosen as the optimal solution. Figure 21: Front End of Truck Spacing in the first nodes away from the walls was kept nearly constant at 34 around 0.0022 inches in order to obtain y+ values of 30 to 60 on the surface and sufficiently resolve gradients in the boundary layer. This number was calculated using the same process as the mirror problem detailed in Section 2.2. The chord length used for Reynold?s number calculation was the length of the truck while the desired y+ value was between 30 and 60 rather than the y+ of 1 used for the mirror. The y+ difference is necessary because a k-? SST turbulence model is used in place of the two equation k-? turbulence model with enhanced wall treatment. 31 Figure 22 shows the detail in the grid at the upper right corner of the truck base region magnified greatly. The spacing was carefully set up on the borders of zones 1 and 2 to prevent drastic changes in aspect ratio in adjacent cells. Figure 22: Upper Corner of Truck Base Region 35 Figure 23 shows the base region from the centerline of the truck to the upper edge with no slats. Note the high density of points close to the surface which extends above and to the right of the truck past where the walls exist. This was an unavoidable scenario due to the use of a structured grid. Figure 24 shows the base region with a slat. Note the dense grid along both sides of the slat extending into the base flow. Figure 23: Base Region Grid Without Slat 36 Figure 24: Base Region Grid With Slat While the grid generator produces suitable grids for most areas within the intended design space, excessively skewed cells lead to numerical instabilities for certain slat geometries. Large angles with respect to the horizontal anywhere on the slat create significantly skewed cells. Figure 25 shows the area of concern for a high angled slat. Ideally, cell boundary lines should extend perpendicular to the surface to better capture the boundary layer aerodynamics. Slat angles were limited by the GA to avoid excessively skewed cells. 37 Figure 25: Potential Area of Highly Skewed Cells 3.3 GRID REFINEMENT STUDY A grid refinement study was conducted on the truck model without slats to ensure that the chosen grid spacing will give accurate results. Due to limitations on grid point spacing near the surface of walls, it was not possible to create the coarse mesh from the fine mesh by means of removing every other grid point in the i and j directions. The y+ value near the surface of the wall needed to be the same for both the coarse and fine grids. The differences were mainly in the spacing of grid points in the base region and the spacing of points running parallel to the surface wall. Table 3 presents the number of grid points in both directions of both zones for the coarse and fine grids. 38 Coarse Grid Fine Grid Zone 1, i direction 432 836 Zone 1, j direction 141 269 Zone 2, i direction 289 542 Zone 2, j direction 103 183 Total Nodes 90679 324070 Table 3: Coarse and Fine Grid Node Points The spacing variables were tweaked in the grid generator routine to obtain a fine grid that had roughly twice the number of points in each direction as the coarse grid without changing the y+ needed to accurately capture the boundary layer. The ultimate goal of this study was to show that no significant difference exists between the converged drag values of both the coarse and fine grids. Figure 26 shows the coarse and fine grids compared next to each other. The coarse grid is on the left with the fine grid on the right. The front end and base region close-ups show the coarse grid has roughly twice the space between nodes compared to the fine grid in the direction parallel to the surface. 39 Figure 26: Coarse and Fine Grid Comparison The drag coefficient for both cases converged to approximately 0.296. The drag convergence for the truck without slats is illustrated in Figure 27. The fine grid required over 100,000 iterations to converge while the coarse grid required only about 25,000 iterations. 40 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0 50000 100000 150000 Iteration D r ag C o ef fi ci e n t Fine Grid Course Grid Figure 27: Drag Convergence for Grids Without Slats Table 4 gives a breakdown of viscous and pressure drag on the truck. Both the coarse and fine grids returned similar values for pressure and viscous drag. Viscous drag accounted for 13.5% of the total drag on the tractor trailer model. Due to the similar results of the coarse and fine grid, the coarse grid was determined to be sufficient for the calculation of drag. Slatted grids for the GA run use the node spacing properties of the coarse grid. Pressure Drag (N/m) Viscous Drag (N/m) Total Drag (N/m) Coarse Grid 223.733 34.588 258.321 Fine Grid 223.470 34.969 258.439 Table 4: Drag Breakdown for Coarse and Fine Grids 41 3.4 BASE SLAT CONVERGENCE CRITERIA Many CFD runs were conducted to determine optimal convergence criteria. Since Fluent does not have an option to set convergence based on a drag value, a residual convergence for continuity, x-momentum, y-momentum, k, and ? based on where drag was suitably converged was employed. Two test cases with the same slat and different base spacing parameters were run to test sensitivity of the grid spacing. The drag histories for both cases are shown in Figure 28. Both cases converged to the same drag value and required approximately the same number of iterations, thus showing the coarser of the two grids was sufficient. 300 350 400 450 500 550 600 0 20000 40000 60000 80000 100000 120000 140000 Iteration Dr a g Co e ffi ci en t Course Base Spacing Fine Base Spacing Figure 28: Drag Convergence for Two Test Geometries Residuals for the coarse base spacing grid are shown in Figure 29. Continuity 42 converges long before drag, but the other residuals converge just after drag. CFD residual convergence values for X-velocity, Y-velocity, k, and ? were set to values from Figure 3.13 at 60,000 iterations. Continuity convergence was set to 1.00E-7. 1.00E-09 1.00E-08 1.00E-07 1.00E-06 1.00E-05 1.00E-04 1.00E-03 0 20000 40000 60000 80000 100000 120000 140000 Iteration S c a l ed R esi d u a l s continuity x-velocity y-velocity k omega Figure 29: Residual Convergence for Test Geometry Initial GA run attempts showed that the selected residual convergence criteria were not universally effective throughout the entire design space. Frequently cases would hit the residual convergence criteria long before drag converged. This resulted in the GA choosing its best performers to be cases that had not converged and had drag values that were increasing with iteration. The fix for this problem involved creating a simple subroutine to check the 43 drag convergence from the outputted drag file after the case converged. If the drag was found to vary by more than 0.5% over the last 3000 iterations, the case was ?disqualified? by setting the drag to a high number rather than taking the final drag value. Setting the drag to a high value essentially kills off traits that cause difficulty in drag convergence as the GA progresses through generations. The obvious downfall to this approach is the possible elimination of a good solution just because it is ill conditioned for drag convergence. Testing all cases that did not converge would require additional computational expense and may or may not provide useful results. Further investigation in this area is recommended. 3.5 CODE STRUCTURE AND COMPUTATIONAL EXPENSE Initialization errors often occurred when attempting to solve for the flowfield using one case with more than four processors on the cluster. Since these errors could be prevented by running the same case with fewer processors, the problem was believed to be related to Fluent?s ability to adequately break up the given grid among the number of specified processors. Because of this error, the maximum number of processors allowed for each case was capped at four. Run times for a single geometry typically ranged from 10 to 12 hours while running in parallel on four processors. Initial GA run time calculations were found to be far too long. 15 generations with 20 members in each generation would take approximately 3600 hours or 150 days (15 generations * 20 members/generation * 12 hrs/member = 3600 hrs). It was necessary to modify the GA to have the ability to run multiple cases at a time. Since the objective function consisted of calling a script to execute Fluent, it was possible for the code to run 44 more than one case at a time without using parallel computing such as MPI. By running the script with the ampersand (Linux command to run in the background) at the end of the command, the GA would not wait until the script finished running before continuing with the rest of the code. In this manner, multiple cases were started while the GA continued looking for a flag signaling the completion of a case. The flag was a number in a file that was changed by the script after the CFD run was complete. After the flag was changed by the script and read by the Fortran code, the drag was read from the appropriate case file and a new case was started in the old case?s slot. The GA was configured with five available slots for CFD runs. At the beginning of the generation, the objective function was called five times, once for each of the five slots. Whenever a case finished, it was replaced with another case until all 20 members had been run through the objective function. One generation typically took two days to complete (12 hours * 20 members / 5 at a time = 48 hours). A 15 generation GA run would take about one month to complete on 20 processors. 45 Create Generation of Random Members Slot 1 Slot 2 Slot 3 Slot 4 Slot 5 Distribute Members to Available Slots Start GA Run Rank / Sort Members based on Performance GA Run is Complete! Output Results Create Next Generation from Best Performers of Previous Generation Create Grid from Variables Run CFD Solver in Batch Mode (multiple processors) Check for Convergence / Errors Return Drag Value If Not Final Generation If Final Generation Figure 30: Revised GA Flowchart Figure 30 shows the flowchart for the revised GA. The only changes made from the mirror case were implemented in the subroutine where the objective function was called. Due to shared cluster usage issues, the code was configured to change the number of processors being used at any time during a GA run. This was accomplished by changing the scripts which initiated Fluent. The scripts were called from the Fortran 46 code, but unlike the code itself, the scripts could be edited while the code was running to change the number of processors used to solve each case. The changes would take effect the next time the GA loaded a case. The design space for the slat optimization is given in Table 5. After initial CFD testing, it was found that large angles in the slat caused the CFD solution to diverge due to gridding issues. Conservative limitations were placed on the ranges of ? 1 , ? 2 , and ?. Finding an optimal slat within the limited design space was considered more important than expanding the design space and potentially allowing the GA to converge on an erroneous CFD run. maximum minimum increment H 1 0.995 0.3 0.005 ? 15.0? 0.0? 0.2? L 48.0 in. 10.0 in. 0.1 in. ? 1 15.0? 0.0? 0.1? ? 2 15.0? 0.0? 0.1? Table 5: Design Space for Slat Optimization 3.6 BASE SLAT RESULTS The tractor trailer model without slats produced a drag coefficient of 0.296. For comparison, reference 24 gives drag coefficients ranging from 0.277 to 0.474 depending on the turbulence model for a simplified, streamlined three-dimensional tractor trailer. Reference 24 also gives 0.6 as the wind averaged drag coefficient of a typical Class 8 tractor trailer. Figures 31 and 32 show the flow field around the front of the truck. All pressures shown in contour plots are in Pascals and are relative to freestream static pressure. Unless 47 otherwise specified, all lengths are in meters with the front end of the truck having a longitudinal coordinate of 0 meters. No flow separation occurs as expected. The maximum velocity of 55 m/s occurs at the corner of the ?nose?. Stagnation occurs as expected at the flat portion of the nose next to the centerline. Figure 31: Truck Front Flowfield 48 Figure 32: Truck Front Velocities After ten generations, the GA managed to reduce drag by over 50% from the two- dimensional tractor trailer with no slats. The optimized member has a drag coefficient of 0.1216. By assuming the difference between the 0.6 drag coefficient from reference 24 and the 0.296 drag coefficient from the two-dimensional model without slats remains unaffected by the addition of slats, a rough estimation of drag reduction on a three- dimensional truck with protuberances can be obtained. The drag coefficient can be estimated to drop approximately 29% from 0.6 without slats to 0.426 with slats. For comparison, reference 29 gives wind tunnel test data for two slat configurations that reduce the wind averaged drag coefficient by 16.4% and 18.8% from a baseline (no slats) configuration with a 0.59 drag coefficient. The drag reduction for this ?clean? vehicle can only loosely be related to the drag 49 reduction for a complete operable rig for several reasons. The ?clean? vehicle is a simplified two-dimensional model of an overhead projection of a tractor trailer. A symmetry boundary condition was used down the centerline of the truck, creating an unlikely wake region. No upstream protuberances exist, making the flow unrealistically streamlined as it approaches the rear of the truck. However, it is still important to note that even though this is just an estimate, the principle of substantial drag reduction using slats has been clearly demonstrated. Figure 33 shows the performance of each generation. A large drag reduction occurred after the 2 nd generation, while each successive generation only slightly improved on the design. In looking at the geometry, this appears to be closely correlated to the value of H 1 . 50 Drag Distribution By Generation 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0246810 Generation Drag Co effi ci en t Figure 33: Drag Distribution by Generation A total of five cases did not initialize or converge properly. They are not shown in the drag distribution plot due to the assigned penalty drag value. The five cases were from generations 1, 2, 5, and 10. All five cases converged properly when tested as individual runs outside of the GA. This meant the cases did not properly initialize while the GA was running, and could have failed due to a lack of available shared Fluent licenses on the cluster. Figure 34 shows H 1 as a function for each member of every generation. The GA quickly learns the benefit of placing the slat close to the edge of the truck. By the 4 th generation, the GA rarely creates a member with the slat far from the edge of the truck. 51 The slat can get close to the edge but never sit on the edge due to gridding complications. The GA input file was set to allow H 1 range between 0.3 and 0.995 percent of the truck half width, with the latter value corresponding to 0.25 inches from the edge. Variable Distribution By Generation 0 10 20 30 40 50 0246810 Generation I n ch es F r o m T r u ck Ed g e ( 51 i n . * ( 1 - H 1 ) ) Figure 34: H 1 Distribution by Generation The H 2 distribution by generation is shown in Figure 35. Initially a wide range of H 2 values exist due to the scattering of H 1 values. As H 1 approaches the edge of the truck, H 2 follows suit due to its dependence on H 1 by the angle between end points on the slat. Figure 36 shows how the angle between end points on the slat, ?, varies with generation. Every generation has a ? of 13?, and low values of ? are eliminated by the 4 th generation. 52 Variable Distribution By Generation 0 10 20 30 40 50 60 0246810 Generation H 2 ( i nc he s ) Figure 35: H 2 Distribution by Generation 53 Variable Distribution By Generation 0 2 4 6 8 10 12 14 16 0246810 Generation ? Figure 36: ? by Generation Figure 37 shows that ? 1 moves toward small angles as the GA progresses. With the slat being placed on the edge of the truck, a small angle ensures that large flow separation will not occur at the beginning of the slat. One interesting detail is the string of larger ? 1 values that survived up through the 8 th generation. Nearly all of these cases had shorter length slats. In general, slats with shorter lengths tended to perform better with a larger ? 1 values than slats with longer lengths. Flowfield illustrations with streamlines further validate this observance. 54 Variable Distribution By Generation 0 2 4 6 8 10 12 14 16 246810 Generation ? 1 (d eg rees) Figure 37: ? 1 Distribution by Generation Figure 38 shows the distribution by generation of the slat final angle, ? 2 . ? 2 approaches its 15? limit as the GA progresses. After the 4 th generation, all small ? 2 values disappear. The convergence towards the maximum ? 2 allowed by the design space indicates that there likely exists an optimal final slat angle greater than 15?. Due to CFD convergence issues, this design area could not be examined without a significant amount of additional work. However, in three-dimensional flows, it is unlikely that very large final turning angles could be maintained without flow separation, particularly in cross flow. 55 Variable Distribution By Generation 0 2 4 6 8 10 12 14 16 0246810 Generation ? 2 ( d e g rees ) Figure 38: ? 2 Distribution by Generation The slat length variable, L, does not have a strong tendency to converge to either a short or long slat as shown by Figure 39. The last two generations indicate a shift towards a longer slat, but more generations are needed to determine whether this trend would continue. Because pressure drag is much more dominant than the viscous drag, common intuition suggests the optimal member would have a large slat length. This would allow the slat to slow the flow down as much as possible without flow separation, thereby raising the base pressure. The GA converges to a range between 25 and 40 inches after the 4 th generation. 56 Variable Distribution By Generation 0 5 10 15 20 25 30 35 40 45 50 0246810 Generation S l a t Le ngt h ( i nc he s ) Figure 39: Slat Length Distribution by Generation The GA optimized slat is shown in Figure 40 with its variables in Table 6. The slat is connected to the truck 0.816 inches from the edge and extends out with an initial angle of 1.5?. The total slat length is 36.5 inches. The importance of the Coanda effect is illustrated by the geometry of the best performing slat. The Coanda effect is the tendency of a fluid to remain attached to a curved surface. 26 The airflow directly above the slat remains attached to the slat due to the pressure differential between the airflow above the slat and the vacuum that would be created on the slat if the flow were to become detached. Ultimately, the GA attempts to find a slat that keeps the flow attached to the surface while the slat curves toward 57 the centerline and increases the static pressure of the flow. Previous studies have shown that two-dimensional RANS CFD solutions with a k-? turbulence model perform fairly well when predicting certain aspects (primarily separation point) of Coanda effects. 37 Figure 40: GA Optimized Slat H 1 (from edge) 0.816 in. ? 15.000 deg. L 36.548 in. ? 1 1.471 deg. ? 2 13.471 deg. Table 6: GA Optimized Slat Variables Figures 40 and 41 contain drag and residual history for the optimized solution. 58 The drag coefficient is fully converged by 50000 iterations. Residuals oscillated up until 15000 iterations before settling into a smooth trend. The turbulence residuals, ? and k, remain nearly constant from 15000 to 40000 iterations before decreasing throughout the next 20000 iterations. The drag coefficient appears to have a strong dependence on the continuity residual as both change very little after 15000 iterations. GA Optimized Solution 0.1 0.11 0.12 0.13 0.14 0.15 0 10000 20000 30000 40000 50000 60000 70000 Iteration Dr a g Co ef f i ci e n t Figure 41: Drag History of Optimized Slat Configuration 59 1.00E-09 1.00E-08 1.00E-07 1.00E-06 1.00E-05 1.00E-04 1.00E-03 1.00E-02 1.00E-01 1.00E+00 0 10000 20000 30000 40000 50000 60000 70000 Iteration S caled R e sid u a l s Continuity X-Velocity Y-Velocity turbulence k turbulence ? Figure 42: Residual History of Optimized Slat Configuration The wake regions of the no slat case and optimal slat case are shown in Figures 43 and 44. Static Pressure differences on the base of the truck are drastically different for the two cases. With no slats, the static pressure drops dramatically as the flow separates at the aft end of the truck. The gage pressure remains nearly constant along the base of the truck and throughout most of the wake at approximately -200 pascals. The slats force the pressure drop to occur before the base region of the truck while increasing the gage pressure along the base of the truck to around -80 pascals. As expected, the optimal slat keeps the flow attached along its entire length. The main vortex length is reduced by 1.5 meters with the addition of the optimal slats. 60 Figure 43: Wake Region with No Slats 61 Figure 44: Wake Region with GA Optimized Slat Figures 45 and 46 zoom in on the counter rotating vortices in the corners of the slat. The grid resolution is fine enough to capture four distinct vortices in the wake region on the truck. The first is the large clockwise rotating vortex spanning over four meters in the wake. A second half meter vortex is captured just underneath rotating counterclockwise. The third and fourth vortices both rotate clockwise and are wedged in the corner of where the slat meets the truck. They are approximately 1-2 inches in size. While the CFD results illustrate the wake region in great detail, it is important to note that these details are highly suspect, especially with a symmetry forced boundary condition at the centerline. 62 Figure 45: Close-up of Optimized Slat Base (1.5m scale) Figure 46: Close-up of Optimized Slat Base (0.3m scale) 63 While the winning case mentioned above has the least drag of all the GA cases, its length makes it more impractical than some of the shorter members examined by the GA came across. Generation 5 had a slat design with a drag coefficient of 0.138 and a length of 17 inches. Figure 47 depicts the short slat while its variables are shown in Table 7. The short slat is positioned at the same place, but starts with a greater initial angle than the long slat. Figure 47: Effective Short Slat H 1 (from edge) 0.816 in. ? 12.992 deg. L 17.213 in. ? 1 4.176 deg. ? 2 10.294 deg. Table 7: Effective Short Slat Variables 64 Figure 48 shows the flowfield around the base region of the short slat. Static pressure on the base of the truck remains around -100 Pascals gage while the drag coefficient is 0.138. The wake zone extends five meters downstream of the truck. Figure 48: Short Slat Base Region Flowfield After obtaining a GA solution, two test cases were run to see if the solution could be improved upon. Generally, if given enough generations, the GA will find the optimal solution within the design space. Due to the grid concerns, the design space was fairly limited. Figure 49 shows two geometries selected based on a combination of intuition and 65 general convergence direction of the GA. Both geometries exceed the maximum angle limits set within the GA run. Slat variables are given in Table 8. Figure 49: Experimental Slats 66 Slat A Slat B H 1 (from edge) 0.255 in. 0.255 in. ? 25? 40? L 42 in. 44 in. ? 1 0? 5? ? 2 25? 40? Table 8: Experimental Slat Variables Experimental slat ?A? performed better than the optimal solution from the GA with a drag coefficient of 0.107. Slat ?B? did not perform very well and had a drag coefficient of 0.175. Static gage pressure on the base of the truck was around -40 pascals with slat ?A? and -100 pascals with slat ?B?. Unlike the optimized GA slat, flow separation at the free end of the slat occurs on both experimental slats. It is also important to note that greater flow separation is more likely to occur in a three-dimensional analysis with cross flow and a rougher upstream geometry. Pressure contours and streamlines for the experimental slats are shown in Figures 50 and 51. 67 Figure 50: Experimental Slat ?A? Flowfield Figure 51: Experimental Slat ?B? Flowfield 68 4. CONCLUSIONS Two CFD driven GA optimizations have been performed on simplified tractor trailer parts. The tasks involved writing a customized grid generator for each optimization capable of producing a suitable grid for any geometry within the design space. The grid generators couple to a CFD solver were used as an objective function for a GA. Other components of the objective function included a drag convergence check and several scripts and batch files needed for communication between Fluent and the GA. Several scripts and batch files were required to activate the CFD solver within the objective function. The GA was modified for the base slat optimization to operate in parallel on a cluster of linux processors to make computational run times manageable. CFD driven GA optimizations were shown to be an effective means of drag reduction for simple geometries. For more complicated geometries, computational expense and grid generation capabilities quickly become the limiting factor in the analysis. The mirror optimization produced a somewhat trivial result. While an optimal design was found within the design space, the winning member was too long to be a useful design. The GA attempted to give the mirror an airfoil-like appearance. The winning member had a drag coefficient of 0.0633 based on its width. Ultimately, the mirror optimization study proved to be more useful as a stepping stone to a more difficult optimization rather than a design tool for an optimized mirror concept. 69 The base slat optimization yielded a much more useful result than the mirror optimization. Drag was reduced by 59% from the clean two-dimensional model with the addition of a 36.5 inch slat and 53% with the addition of a 17 inch slat. By examining the traits of good performers, an experimental geometry was created outside of the tested GA design space that was shown to reduce drag by 64% from the clean two-dimensional model. For a quick projection to drag reduction on a real tractor trailer, the difference between the CFD runs without slats and with slats can be subtracted from known full tractor trailer drag coefficients. Using this method, the optimized base slat can be estimated to reduce drag by 29% from an operable tractor trailer rig. For three-dimensional optimizations, a different grid generation approach would be much more practical. The majority of the time spent with the base slat optimization was coding and recoding the grid generator so that all cases within the design space would converge. A two-dimensional geometry with more variables or a three- dimensional geometry would be nearly impossible with the Cartesian gridding approach used in this study. Unstructured automatic grid generators would provide much more flexibility with the complexity of the geometry as well as the limitations of the design space. Given successful results and financial motivation for even the smallest reduction in drag, future work in drag reduction via base slats is strongly encouraged. Three- dimensional CFD studies and wind tunnel analysis should be used to test the results from the two-dimensional optimization. More information is needed about the impact of slats to a three-dimensional model before more a accurate drag reduction estimations can be made. 70 REFERENCES 1. Karr, C.L., Freeman, L.M., and Meredith, D.L., "Genetic Algorithm based Fuzzy Control of Spacecraft Autonomous Rendezvous," NASA Marshall Space Flight Center, Fifth Conference on Artificial Intelligence for Space Applications, 1990. 2. Krishnakumar, K., Goldberg, D.E., ?Control System Optimization Using Genetic Algorithms?, Journal of Guidance, Control, and Dynamics, Vol. 15, No. 3, May- June 1992. 3. Tong, S.S., ?Turbine Preliminary Design Using Artificial Intelligence and Numerical Optimization Techniques.? Journal of Turbomachinery, Jan 1992, Vol 114/1. 4. Perhinschi, M.,G., "A Modified Genetic Algorithm for the Design of Autonomous Helicopter Control System," AIAA-97-3630, Presented at the AIAA Guidance, Navigation, and Control Conference, New Orleans, LA, August 1997. 5. Mondoloni, S., ?A Genetic Algorithm for Determining Optimal Flight Trajectories?, AIAA Paper 98-4476, AIAA Guidance, Navigation, and Control Conference and Exhibit, August 1998. 6. Anderson, M.B., ?Using Pareto Genetic Algorithms for Preliminary Subsonic Wing Design?, AIAA Paper 96-4023, presented at the 6th AIAA/NASA/USAF Multidisciplinary Analysis and Optimization Symposium, Bellevue, WA, September 1996. 7. Oyama, A., Obayashi, S., Nakahashi, K., ?Transonic Wing Optimization Using Genetic Algorithm?, AIAA Paper 97-1854, 13 th Computational Fluid Dynamics Conference, June 1997. 8. Selig, M.S., and Coverstone-Carroll, V.L., ?Application of a Genetic Algorithm to Wind Turbine Design?, Presented at the 14 th ASME ETCE Wind Energy Symposium, Houston, TX, January 1995. 9. Jang, M., and Lee, J., ?Genetic Algorithm Based Design of Transonic Airfoils Using Euler Equations?, AIAA Paper 2000-1584, Presented at the 41 st AIAA/ASME/ASCE/AHS/ASC Structures, Structural Dynamics, and Materials Conference, April 2000. 71 10. Jones, B.R., Crossley, W.A., and Anastasios, S.L., ?Aerodynamic and Aeroacoustic Optimization of Airfoils Via a Parallel Genetic Algorithm?, AIAA Paper 98-4811, 7 th AIAA/USAF/NASA/ISSMO Symposium on Multidisciplinary Analysis and Optimization, September 1998. 11. Perez, R.E., Chung, J., Behdinan, K., ?Aircraft Conceptual Design Using Genetic Algorithms?, AIAA Paper 2000-4938, Presented at the 8 th AIAA/USAF/NASA/ISSMO Symposium on Multidisciplinary Analysis and Optimization, September 2000. 12. Anderson, M.B., Burkhalter, J.E., and Jenkins, R.M., "Design of an Air to Air Interceptor Using Genetic Algorithms", AIAA Paper 99-4081, presented at the 1999 AIAA Guidance, Navigation, and Control Conference, Portland, OR, August 1999. 13. Anderson, M.B., Burkhalter, J.E., and Jenkins, R.M., ?Intelligent Systems Approach to Designing an Interceptor to Defeat Highly Maneuverable Targets?, AIAA Paper 2001-1123, presented at the 39 th Aerospace Sciences Meeting and Exhibit, Reno, NV, January 2001. 14. Chernyavsky, B., Stepanov, V., Rasheed, K., Blaize, M., and Knight, D., ?3-D Hypersonic Inlet Optimization Using a Genetic Algorithm?, AIAA Paper 98- 3582, 34 th AIAA/ASME/SAE/ASEE Joint Propulsion Conference and Exhibit, July 1998. 15. Torella, G., Blasi, L., ?The Optimization of Gas Turbine Engine Design by Genetic Algorithms?, AIAA Paper 2000-3710, 36 th AIAA/ASME/SAE/ASEE Joint Propulsion Conference and Exhibit, July 2000. 16. Schoonover, P.L., Crossley, W.A., and Heister, S.D., ?Application of Genetic Algorithms to the Optimization of Hybrid Rockets?, AIAA Paper 98-3349, 34 th AIAA/ASME/SAE/ASEE Joint Propulsion Conference and Exhibit, July 1998. 17. J.E. Burkhalter, R.M. Jenkins, and R.J. Hartfield, M. B. Anderson, G.A. Sanders, ?Missile Systems Design Optimization Using Genetic Algorithms,? AIAA Paper 2002-5173, Classified Missile Systems Conference, Monterey, CA, November, 2002 18. Hartfield, Roy J., Jenkins, Rhonald M., Burkhalter, John E., ?Ramjet Powered Missile Design Using a Genetic Algorithm,? AIAA 2004-0451, presented at the forty-second AIAA Aerospace Sciences Meeting, Reno NV, January 5-8, 2004. 19. Nelson, A., Nemec, M., Aftosmis, M., and Pulliam, T., ?Aerodynamic Optimization of Rocket Control Surfaces Using Cartesian Methods and CAD Geometry,? AIAA 2005-4836, 23 rd Applied Aerodynamics Conference, Toronto, 72 Canada, June 6-9, 2005. 20. Ahujz, V., and Hosangadi, A., ?Design Optimization of Complex Flowfields Using Evolutionary Algorithms and Hybrid Unstructured CFD,? AIAA 2005- 4984, 23 rd Applied Aerodynamics Conference, Toronto, Canada, June 6-9, 2005. 21. Jenkins, Rhonald M., Hartfield, Roy J., and Burkhalter, John E., ?Optimizing a Solid Rocket Motor Boosted Ramjet Powered Missile Using a Genetic Algorithm?, AIAA 2005-3507 presented at the Forty First AIAA/ASME/SAE/ASEE Joint Propulsion Conference, Tucson, AZ, July 10-13, 2005. 22. Burger, Christoph and Hartfield, Roy J., ?Propeller Performance Optimization using Vortex Lattice Theory and a Genetic Algorithm?, AIAA-2006-1067, presented at the Forty-Fourth Aerospace Sciences Meeting and Exhibit, Reno, NV, Jan 9-12, 2006. 23. Riddle, David B., ?Design Tool Development for Liquid Propellant Missile System,? MS Thesis, Auburn University, May 10, 2007. 24. McCallen, Rose C., (19 others), ?DOE?s Effort to Reduce Truck Aerodynamic Drag ? Joint Experiments and Computations Lead to Smart Design?, AIAA 2004- 2249, 34 th AIAA Fluid Dynamics Conference and Exhibit, Portland, OR, June 28 ? July 1, 2004. 25. United States Department of Energy Transportation Energy Data Book: Edition 26, 2006. http://cta.ornl.gov.data/download26.shtml 26. Anderson, J. D., Fundamentals of Aerodynamics, 3 rd Ed., McGraw Hill, 2001, 27. Hoerner, S. F., Fluid-Dynamic Drag: Practical Information on Aerodynamic Drag and Hydrodynamic Resistance, Hoerner Fluid Dynamics, 1965. 28. Cooper, K.R., ?Truck Aerodynamics Reborn ? Lessons from the Past,? Proceedings of the 2003 SAE International Truck and Bus Meeting and Exhibition, Fort Worth, Texas, November 10-12, 2003, SAE Technical Paper Series, 2003-01-3376. 29. Ortega, J. M., Salari, K., ?An Experimental Study of Drag Reduction Devices for a Trailer Underbody and Base,? AIAA 2004-2252, 34 th AIAA Fluid Dynamics Conference and Exhibit, Portland, OR, June 28 ? July 1, 2004. 30. Veluri, S. P., Roy, C. J., Ahmed, A.,Rifki, R., Worley, J. C., Recktenwald, B., ?Joint Computational/Experimental Aerodynamic Study of a Simplified Tractor/Trailer Geometry,? AIAA-2007-4430, 25th AIAA Applied Aerodynamics Conference, Miami, FL, June 25-28, 2007. 73 31. Fluent 6.1 User?s Guide, Fluent Inc., Lebanon, NH, 2003. 32. Sharatchandra, M.C., Sen, M., and Gad-el-Hak, M., ?New Approach to Constrained Shape Optimization Using Genetic Algorithms?, AIAA Journal, Vol. 36, No. 1, January 1998. 33. Jang, M., and Lee, J., ?Genetic Algorithm Based Design of Transonic Airfoils Using Euler Equations?, AIAA Paper 2000-1584, Presented at the 41 st AIAA/ASME/ASCE/AHS/ASC Structures, Structural Dynamics, and Materials Conference, April 2000. 34. Ahujz, V., and Hosangadi, A., ?Design Optimization of Complex Flowfields Using Evolutionary Algorithms and Hybrid Unstructured CFD,? AIAA 2005- 4984, 23 rd Applied Aerodynamics Conference, Toronto, Canada, June 6-9, 2005. 35. Cresswell, M. G. L., Hertz, P. B., ?Aerodynamic Drag Implications of Exterior Truck Mirrors,? SAE Technical Paper No. 920204, 1992. 36. Anderson, Murray, B., ?Genetic Algorithms in Aerospace Design: Substantial Progress, Tremendous Potential,? Sverdrup Technology Inc. /TEAS Group, Eglin Air Force Base, FL. May, 2002. 37. Gross, A., Fasel, H. F., ?RANS, URANS, and LES of Coanda Wall Jet Flows,? AIAA Paper 2006-3371, Presented at the 36 th AIAA Fluid Dynamics Conference and Exhibit, San Francisco, CA, June 5 ? 8, 2006. 74 APPENDIX A Mirror Optimization GA Input File .false. ; micro .false. ; pareto .true. ; steady_state .false. ; maximize .true. ; elitist .false. ; creep .false. ; uniform .false. ; restart .false. ; remove_dup .false. ; destroy_elite2 .false. ; niche .false. ; phenotype 23623 ; iseed 0.9 ; pcross 0.001 ; pmutation 0.05 ; pcreep 1 ; ngoals 1.0 ; xgls(j) .0 ; domst 2550 ; convrg_chk 4 ; no_para 'par1', 18.0, 8.0, .2, .false. ; xmax xmin resolution niche_par 'par2', 12.0, 4.0, .2, .false. ; xmax xmin resolution niche_par 'par3', 2.5, 0.5, .1, .false. ; xmax xmin resolution niche_par 'par4', 4.0, 0.5, .1, .false. ; xmax xmin resolution niche_par 1 ; ifreq 20 ; mempops 15 ; maxgen 75 APPENDIX B Base Slat Optimization GA Input File .false. ; micro .false. ; pareto .true. ; steady_state .false. ; maximize .true. ; elitist .false. ; creep .false. ; uniform .true. ; restart .false. ; remove_dup .false. ; destroy_elite2 .false. ; niche .false. ; phenotype 2531 ; iseed 0.9 ; pcross 0.001 ; pmutation 0.05 ; pcreep 1 ; ngoals 1.0 ; xgls(j) 0.0 ; domst 2550 ; convrg_chk 5 ; no_para 'par1', 0.995, 0.3, .005, .false. ; xmax xmin resolution niche_par 'par2', 15.0, 0.0, .2, .false. ; xmax xmin resolution niche_par 'par3', 48.0, 10.0, .1, .false. ; xmax xmin resolution niche_par 'par4', 15.0, 0.0, .1, .false. ; xmax xmin resolution niche_par 'par4', 15.0, 0.0, .1, .false. ; xmax xmin resolution niche_par 1 ; ifreq 20 ; mempops 15 ; maxgen