Turbulent Structure of Flow Past a Ship Bow by Matthew E. Beeken B.S. Ocean Engineering, Virginia Polytechinc Institute and State University 1998 Submitted to the Department of Ocean Engineering in partial fulfillment of the requirements for the degree of Master of Science in Ocean Engineering at the MASSACHUSETTS INSTITUTE OF TECHNOLOGY September 2000 © Massachusetts Institute of Technology 2000. All rights reserved. Author.. ....... ................. Department of Ocean Engineering September 5, 2000 Certified by.......... ................. . . . Dick K.P. Yue Professor Hydrodynamics & Ocean Engineering Thesis Supervisor A ccepted by ........... ............... olas Patrikalakis Chairman, Department Committee on Graduate Students MASSACHUSETTS INSTITUTE OF TECHNOLOGY MAR 2 7 ?001 LIBRARIES Turbulent Structure of Flow Past a Ship Bow by Matthew E. Beeken Submitted to the Department of Ocean Engineering on September 5, 2000, in partial fulfillment of the requirements for the degree of Master of Science in Ocean Engineering Abstract Large Eddy Simulations are used to numerically study the turbulent flow past the bow of a ship. We place Particular emphasis on the free-surface flow in and near the nonlinear bow wave. We give a detailed description of the numerical implementation of this fully non-linear viscous time accurate method for flow past a complex geometry. We present the results of various numerical techniques by which we increase the computational efficiency of the code. Despite the inherent unsteadiness of the free surface, we show good comparison between average simulation results in comparison to average experimental velocity field data. Using the time range of good velocity comparison to average our results, we calculate free-surface turbulence quantities showing the turbulent flow capturing capability of our method and elucidating the vortical and turbulent structire of the flow past a DDG-51 bow. Thesis Supervisor: Dick K.P. Yue Title: Professor Hydrodynamics & Ocean Engineering 2 Acknowledgements There are many people to whom I owe much thanks for giving me the support I have needed to complete this work. First and foremost, I would like to thank Ed Rood of the Office of Naval Research whose grant made this work possible. Thanks are due to Lenny Imas for laying the ground work upon which this work was based. Thanks to Kelli Hendrickson for work on parallelization of the code. I give my thanks to Lian Shen and Kelli Hendrickson for lending their expertise in turbulence modelling of free-surface flows. I would also like to thank Fred Stern and Eric Paterson of the Iowa Institute of Hydraulic Research for their willingness to share experimental data taken at the INSEAN testing tank facility in Italy. Thanks go to Angelo Olivieri of INSEAN for his help with that data as well. Most of all, I would like to thank Dick Yue for teaching me how to research and for his passion and drive to understand what is difficult to understand. Finally, I would like to thank my family for their support, especially my wife and dearest love, Kelly. Thanks to God for putting me here and helping me to continue to learn and grow every day. 3 Contents 1 2 Introduction 10 1.1 P urpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.2 Overview of Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Method 14 2.1 Mathematical Formulation . . . . . . . . . . . . . . . . . . . . . . . . 15 2.1.1 Governing Equations . . . . . . . . . . . . . . . . . . . . . . . 15 2.1.2 Initial Conditions . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.1.3 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . 17 Description of SHIPLES code structure . . . . . . . . . . . . . . . . . 21 2.2.1 Code Initialization . . . . . . . . . . . . . . . . . . . . . . . . 22 2.2.2 Velocity Boundary Conditions and Derivatives . . . . . . . . . 23 2.2.3 Momentum Vector Assembly . . . . . . . . . . . . . . . . . . . 24 2.2.4 Grid Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2.2.5 Right Hand Side of Pressure Solver . . . . . . . . . . . . . . . 25 2.2.6 Pressure Solver . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2.2.7 Veolcity Field Integration . . . . . . . . . . . . . . . . . . . . 27 Numerical Implementation . . . . . . . . . . . . . . . . . . . . . . . . 27 2.3.1 Code Initialization . . . . . . . . . . . . . . . . . . . . . . . . 28 2.3.2 Velocity Boundary Conditions and Derivatives . . . . . . . . . 38 2.3.3 Momentum Vector Assembly . . . . . . . . . . . . . . . . . . . 48 2.3.4 G rid Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 2.3.5 Righ Hand Side of Pressure Solver 62 2.2 2.3 4 . . . . . . . . . . . . . . . 2.4 2.3.6 Pressure Solver . . . . . . . . . . . . . . . . . . . . . . . . . . 67 2.3.7 Integrate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Associated Programs and Tools . . . . . . . . . . . . . . . . . . . . . 75 2.4.1 Pre-Processing Programs . . . . . . . . . . . . . . . . . . . . . 76 2.4.2 Post-Processing Programs . . . . . . . . . . . . . . . . . . . . 78 3 Performance & Efficiency 83 3.1 Parallel Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 3.2 Speed ...... ... 85 3.3 M em ory Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ................................... 4 Contributions to SHIPLES development 4.1 4.2 Theoretical Contributions 5.2 91 4.1.1 Free-Surface Stress Boundary Condition Treatment . . . . . . 91 4.1.2 Dirichlet Free-Surface Pressure Boundary Condition . . . . . . 95 Computational Contributions . . . . . . . . . . . . . . . . . . . . . . 98 4.2.1 Dynamic Successive Overrelaxation (SOR) parameter calculation 98 4.2.2 Treatment of Body Geometry . . . . . . . . . . . . . . . . . . 101 106 Free Surface Elevation Comparison . . . . . . . . . . . . . . . . . . . 109 5.1.1 Average Free Surface . . . . . . . . . . . . . . . . . . . . . . . 109 5.1.2 Waterline Profile . . . . . . . . . . . . . . . . . . . . . . . . . 109 5.1.3 Measures of flow steadiness . . . . . . . . . . . . . . . . . . . 111 Average Velocity Field Comparison . . . . . . . . . . . . . . . . . . . 5.2.1 L D = - 0.1209 5.2.2 D 115 . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 = 2.3067 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 5.2.3 YD = 4.6134 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 5.2.4 3 = 9.2268 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 6 Results 6.1 91 . . . . . . . . . . . . . . . . . . . . . . . . 5 Validation of Method 5.1 87 Vortical Structures 124 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 124 7 6.1.1 Steady Vortices . . . . . . . . . . . . . . . . . . . . . . . . . . 125 6.1.2 Unsteady Bow Wave Vortices 127 . . . . . . . . . . . . . . . . . . 128 Conclusions 7.1 Reccomendations for Future Work . . . . . . . . . . . . . . . . . . . . 7.2 Sum m ary 128 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 6 List of Figures 2-1 Computational Domain with Boundaries . . . . . . . . . . . . . . . . 18 2-2 A sample input file for SHIPLES . . . . . . . . . . . . . . . . . . . . 28 2-3 Mapping of Computational Domain . . . . . . . . . . . . . . . . . . . 34 2-4 Initial Distribution of 'Slip' Points on Body Surface . . . . . . . . . . 44 2-5 Faired Hull with Original Hull . . . . . . . . . . . . . . . . . . . . . . 76 3-1 20 x 80 x 20 Speed Up Testing . . . . . . . . . . . . . . . . . . . . . 86 3-2 50 x 200 x 50 Speed Up Testing . . . . . . . . . . . . . . . . . . . . 87 3-3 Memory Usage for 20 x 80 x 20 case . . . . . . . . . . . . . . . . . . 88 3-4 Memory Usage for 50 x 200 x 50 case . . . . . . . . . . . . . . . . . . 89 4-1 Iterations to Convergence with Respect to Overrelaxation Factor . . . 100 4-2 The functions z1 - -z4 defining the body boundaries at each station 104 5-1 Experimental Whisker Probe Free-Surface Elevation Data . . . . . . . 107 5-2 Domain Boundaries showing extent of free surface modeled . . . . . . 108 5-3 Comparison of computed average waterline with experimental data 110 5-4 Mass Conservation of SHIPLES . . . . . . . . . . . . . . . . . . . . . 112 5-5 Volume Average Quantities Versus Time . . . . . . . . . . . . . . . . 113 5-6 Time Fluctuation of Bow Wave Peak Height and Location . . . . . . 114 5-7 Velocity Comparisons for Medium Resolution Case . . . . . . . . . . 117 . . . . . . . . . . . . 118 5-8 Velocity Comparisons for High Resolution Case 5-9 Velocity Comparisons for Medium Resolution Case 5-10 Velocity Comparisons for High Resolution Case 7 . . . . . . . . . . 119 . . . . . . . . . . . . 120 5-11 Velocity Comparisons for Medium Resolution Case . . . . . . . . . . 121 5-12 Velocity Comparisons for Medium Resolution Case . . . . . . . . . . 122 6-1 Average Longitudinal Vorticity 6-2 Temporal development of longitudianl vorticity contours . . . . . . . . . . . . . . . . . . . . . 124 8 . . . . . . . 125 List of Tables 2.1 Correspondence between code variables and math variables . . . . . . 29 2.2 3D Mapped Laplacian Coefficients . . . . . . . . . . . . . . . . . . . . 53 2.3 3D Mapped Laplacian Coefficients . . . . . . . . . . . . . . . . . . . . 66 4.1 D coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 95 Chapter 1 Introduction 1.1 Purpose The turbulent flow around a complex ship geometry, which is represented by the DDG-51 hull shape for the following investigations, is a topic of great interest for many reasons. The bow wave generated by the ship is a non-linear wave which has been well observed, but not as well studied. For high enough Froude number, the free-surface flow becomes turbulent as it passes the bow wave. This of course effects many things, including the nature of the wake left behind the ship. Widely used computational methods have trouble accurately predicting free-surface details at the bow and stern waves [20]. Experimental methods, like Digital Particle Image Velocimetry (DPIV), have been used with some success to study these flows, but are very expensive and only obtain a limited amount of data. The difficulty and expense of obtaining experimental measurements in the bow wave make the ability to quickly simulate these flows and to find turbulent structure in bow waves by means of numerical computation highly desirable. Currently, the computational methods necessary to study time-accurate turbulent flows are very expensive, but are becoming more attainable as computing power increases. SHIPLES is a code originally developed by Imas [6] as a part of his Doctoral research at the Massachusetts Institute of Technolgy (MIT). It was used to study flow past a surface piercing strut and used to perform our first simulations of flow 10 past the DDG-51 hull shape. Since his thesis has been defended, there have been many improvements to the code and great leaps made in its simulation capability. None the less, the heart of the code is still the one orginally developed by Imas. Recently, there has been an increasing interest on the structure of the bow wave at a ship. Linear theory does a good job of predicting a large portion of the wave field about a ship. It has the most problems at the bow and the stern where nonlinear wave phenomenon are observed. This paper focuses on flow properties of the nonlinear bow wave. Tsai and Yue [19] review many techniques for the numerical computation of free-surface flows. We seek a better understanding of the bow wave to allow better models of the effect of novel bow shapes on the overall performance of a ship. Miyata and Inui [8] performed a detailed study into the nature of these nonlinear waves. Among their conclusions they found that their is a sharp change in the average velocity at the bow wave, which is limited to a thin region near the free-surface. They also noted that the free-surface aft of a steep bow wave becomes turbulent. Miyata [7] was one of the very first to calculate the three dimensional viscous flow past a ship, but used a simplified free-surface boundary condition. Some of the vital turbulent experimental data have recently been taken by Katz and his associates [4],[11],[15]. These papers demonstrate the ways in which DPIV has been used to study the turbulent characteristics of the flow past a surface poercing strut and past a couple of different ship models. The experimental data obtained here has much elucidated the production of turbulence within the bow wave. Their observations include the formation of a thin liquid sheet upstream of the wave separation point and that the free surface becomes turbulent as it crosses the bow wave. This thesis serves as a guide to future users of the code and as the location for the documentation of major changes made to the code since [6] was originally published. Results obtained using the code will be presented in comparison to other known results as a validation of the code's simulation capability. A summary of key turbulence calculations made with the code will presented to elucidate the turbulent structure of the bow wave. This thesis is meant to serve as a good reference, not only to users of SHIPLES, 11 but to anyone who is developing a code to perform Large Eddy Simulation (LES) of flow past a complicated geometry in a boundary fitted coordinated system. The report will describe the mathematics that are behind the code and will provided a detailed look at our numerical implementation of the governing equations. We show some selected results from the work that has been done by this method. These results show that the code is a valuable method for studying free-surface turbulent flows past complex geometries. 1.2 Overview of Report The report is divided into five sections. Chapter 2 presents the governing equations and a detailed look at our solution method. Chapter 3 discusses various aspects of the performance and efficiency of the code. Chapter 4 presents the rationale behind the major updates and changes that have been made to the code. Chapter 5 presents results validating the capabilities of the code to recreate experimental data. Chapter 6 presents results elucidating the turbulent structure of the bow wave past the DDG-51 hull shape. In presenting our solution method, chapter 2 describes the governing equations and boundary conditions on our problem. We show the code structure, by presenting a comprehensive outline of all the routines contained in SHIPLES. Then, expanding on each of the routines described in the outline, we present a detailed look ar the numerical implementation of the equations solved in each routine. Chapter 3 describes measures of performance evaluation for this code. We discuss the computational effort needed to solve the routines in the code and memory usage required for specific grid sizes. We show comparisons of parallel performance of the code to serial performance. Understanding the performance of the code thoroughly is the only way to make the best decisions when deciding where to spend the time and energy to make further computational improvements. In chapter 4, we present many changes made in the code and highlight the reasons for their inclusion, and, where available, comments on the success of the particular 12 changes. In this chapter, we also present some of the different work that has gone into validating the performance of some of the routines in the code. In chapter 5 we present several results which validate the other results found with SHIPLES. We present results showing that the bow wave profile for FrL -0.28 is the correct order of magnitude. We also present direct comparisons of experimental velocity data to time averaged SHIPLES results. We get largely good results and show that despite free surface unsteadiness, we may take time averages of the data to compare with experiments. In chapter 6 we present data on the turbulent structure of the bow wave. We show the location of various steay and unsteady longitudinal rollers by examinging contours and iso-surfaces of longitudinal vorticity. We also show the capability of the code to cpature time varying turbulent structure on the free surface. We also show that the bow wave is a region of high turbulent energy. The concluding chapter presents recommendations for future work on the use of SHIPLES to study the flow past the DDG-51. important findings of this thesis. 13 Chapter 7 also summarizes the Chapter 2 Method SHIPLES performs Large Eddy Simulation (LES) of the flow around a given body shape. It simulates the flow field on one side of the shape with full deformations of the free surface in a time accurate manner. For our investigations, we use a faired version of the DDG-51 hull shape as our body. The method is performed in the physical domain on a boundary-fitted coordinate system. Since the moving free surface is one of the domain boundaries, we must regrid the entire flow field every time step. The governing equations are the Navier-Stokes equations (2.1) and the continuity equation (2.2). LES intends to directly simulate the flow physics at the largest scales and model the effects of the smallest scales of the flow. There are many different ways to computationally solve the governing equations. The most straight forward method is Direct Numerical Simulation (DNS). In DNS, we must have a grid which will resolve the flow field down to a very small length scale over which the turbulent energy is dissipated. Since this length scale is inversely proportional to the Reynolds Number of the flow, we are restricted to performing DNS on low Re flows. LES is a technique which directly calculates the flow at length scales larger than the grid length, filtering out the information at scales smaller than the grid size and modelling their effects on the larger scale flow. RANS is a technique which uses the Reynolds decomposition of the Navier-Stokes equations to calculate the average flow, and uses a turbulence model to model the effect of the turbulence on the flow. Rogallo and Moin [14] provide a comprehensive review on the use of 14 these computational techniques for simulating turbulent flows. 2.1 Mathematical Formulation Throughout this paper we use the following notations: P stands for the dynamic pressure; xi stands for the ith component of the position vector, I = (x, y, z); u2 stands for the velocity component in the ith direction. Einstein summation notation over repeated indices is implied unless specifically stated that it is not used. p is the fluid density while v is the kinematic viscosity, and t is the time. We map the position vector into a computational domain whose position components are given by [ ), ((, r (I, 2, 3), or (I, J,K). To specify the value of any variable, f, at = a specific location in the computational domain we use f(I,JK), which represents the value of f at = (I, J,K) in the computational domain and f at = (X(I,J,K), Y(I,J,K), Z(I,J,K)) in the physical domain. 2.1.1 Governing Equations The governing equations for the flow are the Navier-Stokes equations (2.1) and the continuity equation (2.2). aui u at -_ =i1u --- 1 aP a +V ~u82 a3x P axxi ax ___ 19ui 19_= 0 (2.1) 2x1 (2.2) To allow for quick comparison to experimental and other available data, we solve the non-dimensional versions of these equations. Our primary focus is on the turbulent structure of the nonlinear bow wave. The draft is the dominant length scale governing the dynamics of the nonlinear bow wave [8]. Therefore, we non-dimensionalize by the inflow velocity, V, and the ship's midesection draft, D, for our investigations into the DDG-51 bow shape. We non-dimensionalize the pressure by pV 2 . The time is non-dimensionalized by (-. The non-dimensional form of the navier-stokes equations 15 are given by aui at + auu aP - axj axi + 1 O2 u ReD XX3j'(2 (2.3) where all quantities are non-dimensional and (2.2) has been applied to the convective term. Continuity is unchanged by the non-dimensionalization procedure. We now have four equaitons for the three velocity components and the pressure. To regain our coupling between the pressure and velocity equations in time we reformulate, following [6] our governing equations as follows: = -VP + F (2.4) o-0 Each component of the momentum vector, F, is given by 1 Fi= R. a 2u, RCeD aij _uiuj aIj ax (2.5) at. at (2.6) Rearranging (2.4) and taking V- of it we obtain, V2 P F-V The last term of (2.6) may be altered to give the projection equation, (- -7. 6) + V~~ V. V2P=VF at - av at (2.7) In a purely mathematical solution, the last term of (2.7) would be indentically zero. In our discrete representation, the V operator is a function of our grid, which is itself changing with time, so we do not drop this term. We have a poisson equation for the pressure at the next time step, given the velocity at the previous time step. 2.1.2 Initial Conditions Our initial conditions are a given velocity field and an initial free-surface location. We begin with an initial non-dimensional uniform velocity field of U' = (0, 1, 0) and a calm 16 undisturbed free surface. We hard code several physical constants into SHIPLES, we choose them for fresh water at 20 0 C, as found in [10] g is the gravitational constant, which is 9.811. - is the surface tension, which is 0.074a. 998.2 1. While the kinematic viscosity, v, is given by 1.00 p is the density, which is x 10-6N. Since one of our goals is to make direct comparisons to experimental data, we set two input values, the square of the Froude number, (2.8) FTD2 __D gD and the ship's draft, D, in meters. The remaining non-dimensional parameters, ReD- (2.9) D pV2 WeD = 2 D ,V o- (2.10) are calculated based on these inputs and the physical constants. 2.1.3 Boundary Conditions We restrict our domain to that of a numerical wave tank. There are six sides to our computational domain. Each side has its own specific boundary conditions for the velocity and pressure. On the far side, which is labeled 1 in figure 2-1, we have a free slip wall, whose boundary condition allows no flux through it. This condition is dv dw u=0-z=0 =0'dx 'dx dP 0 dx (2.11) on the wall. The bottom of our domain, labeled 5 in figure 2-1 is also defined by a free slip wall. This condition is du -=0 dz dv -=0,w=0; 'dz 17 . ............ 11 .......... ........ ..-.... ... ...... ...... z c-Y ... Z/D=Z, mi. 4 ld n SX/D=TL Y/D=TW-YOFF Z/D=- TH Y Y/=0 Y/D=-YOFF 5 Figure 2-1: Computational Domain with Boundaries 18 dP P d= dz 0 (2.12) on the bottom. The inflow boundary, labeled 3 in figure 2-1, condition is U= 0,Ov = 1, w 0; dP d -0. = dy (2.13) The boundary condition at the outflow plane, labeled 4 in figure 2-1, is given by a zero-gradient extrapolation of the flow field du dy dv dw =0 =0=0'dy 'dy dP_ d = 0. dy (2.14) The pressure boundary condition on the wall containing the ship, labeled 2 in figure 2-1, is dP= 0. dh (2.15) The velocity boundary conditions on this wall are more complex. There are three distinct regions on this boundary. The velocity boundary condition on the ship is, excluding a small region near the free-surface body juncture, a no-slip boundary condition which is S= 0. (2.16) At all points off the body, we use a symmetry condition for the velocity which is another free-slip condition, dv u =0-=0, Udx dw = 0. 0dx (2.17) The most complicated boundary condition is given in the follwing expressions for the 19 velocity in the region near the contact line. The conditions on the velocity are VW - = U , (2.18) (n= /3(z)' (2.19) / (z)' VV - U -h = 0. (2.20) In these boundary conditions ft, t1, t 2 are the unit normal and the two unit tangent vectors to the body. /(z) line model where constant / / is the slip coefficient. Imas [6] uses a dynamic contact is a function of z. Most traditional contact line models use a model for this boundary condition. Imas [6] has developed a first of its kind contact line model which uses a varying coefficient model. In [6] he shows the capability to model macro scale contact line effects that were not previously viable with constant coefficient models. Typically a constant coefficient / is used with this boundary condition. Imas was able to demonstrate solution capabilities with his model that constant slip coefficient models were unable to produce. Imas shows that the governing equation for z / (z) is W +[ ax _ Oz ax ay ax + - ax 0. (2.21) Following Imas, we use an approximate solution /oe 13(i) = dz, (2.22) 2 where, S fs -A' z,', - A (2.23) and A is the height of the slip region. The velocity boundary conditions on the free surface are found from the dynamic and kinematic free-surface boundary conditions. Defining the stress tensor, 20 T, such that Tij = + -P Re axj ± + 09xi (2.24) , we can find a Neumann condition for the velocity at the free surface by simultaneously solving T {ti}[T]nI} 0, (2.25) {t2}[T]{n}= 0. (2.26) with the continuity equation (2.2) on the free surface. A more detailed look at how we solve these equations is presented in § 4.1.1. These yield expressions for 4, ), and dd on the free surface. In these equations, the normal and tangential vector correspond to the free-surface normal and tangential directions. The pressure condtion on the free surface gives a Dirichlet condition for the pressure solver. We also take into account surface tension effects when we calculate the dynamic free-surface boundary condition. This condition is derived from {n}[7]{f We We R1 A more detailed look at this condition is given in 2.2 + (2.27) R2 § 4.1.2. Description of SHIPLES code structure SHIPLES is a finite difference code which solves the non-dimensionalized NavierStokes equations (2.3) with the continuity equation (2.2). It is based on a time accurate method for modeling a turbulent flow, Large Eddy Simulation (LES). It is applied in a boundary-fitted rectangular coordinate system. The primary application for the code is the modeling the flow past a DDG-51 bow shape. The complicated geometry, particularly at the bulbous bow, coupled with the deformation of the free surface, conspire to make the problem difficult to solve. A poisson solver is used to solve the pressure equations as well as the grid equations at each time step. A third order Runge-Kutta method is used to integrate the code in time. The pressure 21 solution is the most computationally expensive operation undertaken by the code. The code is driven by a simple text input file and may be restarted given output from a previous run of the code. Shown below is a list made of the general calculations which are performed by SHIPLES. Each item in the list will be broken down into a more detailed list in the remainder of this section. 1. Code initialization 2. Velocity boundary conditions and velocity derivatives 3. Momentum vector assembly 4. Grid Solver 5. Right hand side of pressure solver 6. Pressure Solver 7. Velocity field integration 2.2.1 Code Initialization The code goes through the initialization process shown in the following list. The code must have an intial grid, body geometry, and velocity field before it can proceed. The code may use two kinds of initializations: a start from scratch or a continuation of a previously stopped run. The list below shows the process followed in the initialization stage of SHIPLES. 1. Read input file (a) Set physical constants (b) Calculate non-dimensional numbers (c) Output a file summarizing the problem being solved 2. Initialize output files with Tecplot headers 22 3. Read in body geometry 4. Set grid parameters 5. Set grid and velocity field 6. Calculate grid metrics, grid coefficients, and inverse grid metrics 7. Estimate spectral radius and calculate initial SOR parameter 2.2.2 Velocity Boundary Conditions and Derivatives The remainder of the code is inside the time iteration loop and is repeated for each of three Runge-Kutta(RK) steps per time step. The total number of time steps for each run is prescribed by the user. Upon completion of the prescribed number of time steps, output files and data files, which include the information necessary to restart the code, are written. This portion of the code is summarized in the following list. 1. Dynamically adjust SOR parameter 2. Update inverse metrics 3. Calculate wall and free-surface normal and tangent vectors 4. Calculate velocity boundary conditions and derviatives (a) Set outer wall velocity boundary conditions (b) Set bottom velocity boundary conditions (c) Set inflow velocity boundary conditions (d) Set outflow velocity boundary conditions (e) Set ship wall velocity boundary conditions for: i. Points off the body ii. Points on the body and in the slip zone iii. Points on the body and in the no-slip zone 23 (f) Calculate velocty derivatives (g) Set velocity derivatives on the free surface (h) Use free-surface derivatives to set free-surface velocity boundary condition (i) Set velocity in corner dummy cells (j) Iterate all velocity boundary conditions until convergence (k) Calculate the exact free-surface pressure 5. Calculate temporal metrics 2.2.3 Momentum Vector Assembly The next portion of the code involves the calculation of the momentum vector, F, for the right hand side of the governing equations as they are written in the projection method (2.7) for coupling the velocity and pressure. This portion of the code is described in the following list. 1. If LES is on, calculate SGS contribution to F (a) Calculate Ax, Ay, Az, and A (b) Calculate cross velocities; UU,UV,UW,VV,VW, and WW (c) Filter velocities (d) Filter cross vleocities (e) Calculate o-ij and calculate (O-ij) if wall function is on (f) Calculate Tij, accounting for use of wall function if on (g) Set rij in dummy cells (h) Get derviatives of Tij w.r.t. ,1, and ( (i) Caclulate TTy, and Tz 2. Calculate the mapped laplacian coefficients for the viscous contribution to F 3. Assemble F 24 (a) Calculate viscous terms (b) Calculate convective terms (c) Sum viscous, convective, and SGS terms 4. Set boundary conditions for F 2.2.4 Grid Solver The next section of code re-grids the entire flow domain for the next RK step. This is necessary due to the movement of the free surface. This is accomplished through an elliptic grid solver with Dirichlet boundary conditions. We specify the location of all points on the boundaries of the domain. To achieve any desired clustering, we cluster points on the boundaries and allow the grid solver to connect the boundary points while satisfying an orthogonality condition. The following list outlines the process by which this is achieved. 1. If it is first RK step, store grid from previous time step in XS, YS, and ZS 2. Integrate free-surface points by kinematic free-surface boundary condition 3. Smooth free-surface grid points 4. Redefine all other boundary points (a) Redefine I = 1 points first; interrogating bas body geometry (b) Place points on the remaining boundaries according to specified clustering 5. Solve grid equaitons using succesive overrelaxation (SOR) 6. Solve updated metrics, grid coefficients, and inverse metrics 2.2.5 Right Hand Side of Pressure Solver The next section of the code deals with the calculation of the right hand side of our pressure solver. The pressure solver is the single most important routine in the code. 25 It drives the entire solution and is itself driven by its right hand side. The following list describes the process taken to set up the pressure solver's right hand side. 1. Initialize right hand side (RHS) to zero 2. If grid correction is on, account for the movement of the grid points 3. Calculate divergence term for RHS 4. Add momentum contribution to RHS of pressure solver 5. Assemble the 19 laplacian coefficients for the pressure solver 2.2.6 Pressure Solver The next section of the code is the actual pressure solver, which is the most compuatationally expensive part of the code. The list describes the process by which the pressure is solved. 1. Set P on wall ghost cells 2. Set P on side ghost cells 3. Set P on bottom ghost cells 4. Set P at inflow ghost cells 5. Set P at outflow ghost cells 6. Set P in corner ghost cells 7. Solve pressure for each (r/, () pair at all points simultaneously 8. Update P by SOR and repeat procedure, including ghost cells, until convergence 9. Make final pass over boundary conditions after P converges 10. Add pressure term to momentum equations 26 2.2.7 Veolcity Field Integration We determine which output, if any, is to be written at this time step. We calculate many volumetric quantities at this time step as well. Upon completion of the output, we integrate the momentum equations to get the velocity field for the next time step. The following list describes the process by which this happens. 1. If RK is first RK step, calculate vorticity in flow field, check mass conservation, and calculate other volumetric quantities 2. Check and see if an output flag has been tripped, if so, write appropriate data to output file and reset output counter 3. Store velocity field in memory 4. Integrate velocity via RK integration 5. Reset velocity at boundaries 6. Smooth velocity on the free surface 7. If at RK 1 or 2 begin next RK step; if at RK 3, check courant condition for time step and begin next time step 8. If last time step complete, write data files that will allow program to be restarted 2.3 Numerical Implementation We provide a comprehensive look at our numerical implememntation of large eddy simulation past a complex geometry. The entire code is treated here, to help others who may be interested in performing this kind of work and to serve as source of reference for future users of SHIPLES. There are two distinct notations which we will use in this section of the paper. Table 2.1 compares the names of variables as they will be discussed in the paper alongside the name of the variable used in the code. 27 0 ISTART(0 - 6.4 3.125 25.6 6.4 0.005 1000 0.132251 1.7493 0.2 1.0 1000 20 3 100. 1.E-14 1.E-5 1.E-8 1.00 0.99 0.0 1.61 4 0.0 0.9 4 TL,TH,TW,YOFF DT,NTIME DRAFT,FR2 SMAGCON,BRDCON NOUTF,NOUTD NSLIP,BINIT VTOL,GTOL,PTOL CONG,CONP YCL,YPOS,BETY ZCL,ZPOS,BETZ 1.0 1.1 .TRUE. .TRUE. .TRUE. .FALSE. .FALSE. XCL,BETX WALLFNC, GRDCOR, SGSFLAG FMTFLAG, CONFLAG NEW, 1 - OLD) Figure 2-2: A sample input file for SHIPLES We will use them interchangeably in this section. The table is provided as a reference to allieviate any confusion that this may cause. 2.3.1 Code Initialization The code is compiled with several quantities hard coded as parameters. These parameters are hard coded since they define the size of many arrays in the code. These are NX, NY, NZ, NTV, NTG, NXB, and NYB. NX, NY, and NZ are the number of points in the X, Y, and Z directions. Since Y is the longitudinal direction of the ship, NY is typically the largest of the three dimensions. NTV is the number of velocity steps saved for the Runge-Kutta(RK) integration; this value is always 3. NTG is the number of grid metrics that need to be stored for the projection operator; its value is 2. NXB and NYB represent the number of points in the base body geometry. These are 193 and 49, respectively. Read Input File The first task performed by SHIPLES is reading a control file, fort. 11, which contains parameters for controlling the code. An example version of fort. 11 is shown in Figure 2-2. The purpose of each variable in the control file will be described in this subsection. 28 Code Variables [Math Variable DT AT NT NTIME SMAGCON Cs BRD _CON CB BINIT BETX BETY BETZ CL USTER Y (3) C, CL USTERZ(3) C, Vo V0 G g SIGMA NU RHO p USHIP Us RE Re 1 RWE We Fr2 FR2 1 DKSI 2A 1 DETA DZET DKSI2 2i DETA2 AP( DZET2 DXE DXZ 4A77A DEZ Represents Time step Number of time steps Smagorinsky Constant Bardina Constant Slip Velocity Magnitude X-Clustering strength Y-Clustering strength Z-Clustering strength Y-Clustering coefficient Z-Clustering coefficient Inflow Velocity Gravitational acceleration Surface Tension Kinematic Viscosity Density Ship Velocity (T) Reynolds Number Inverse of Weber Number Square of Froude Number I; X Grid Parameter J; Y Grid Parameter K; Z Grid Parameter I; X Grid Parameter J; Y Grid Parameter K; Z Grid Parameter mixed grid parameter mixed grid parameter mixed grid parameter Table 2.1: Correspondence between code variables and math variables 29 The first line contains the variable ISTART. With a value of 0, ISTART casuses the code to read in the initial grid, initialize the flow field, and set the output counters such that data will be output after completing the first RK step. With a value of 1, ISTART causes all relevant data from a previous run to be read from file. The second line of the input file defines the size and orientation of the computational domain as shown in figure 2-1. TL is the width of the computational domain. TH is the height of the computational domain. TW is the length of the computational domain. The apparent confusion in the variables is an artifact of the code from which SHIPLES was originally developed. That original code studied run-up of water on a wall with the dynamic contact line model. For that case, the longitudinal and primary flow direction went from side 1 to side 2. YOFF represents how much of the longitudinal domain resides in the region of Y < 0. The entire computational domain is given by [X : (0, TL), Y : (- YOFF : TW - YOFF),Z: (- TH : zfS)], where zf, is the local free-surface elevation. The third line of the input file defines the timing of the code. DT is the desired time step for the code. NTIME is the total number of time steps to be run. Line 4 includes the Draft of the ship in meters and the Fr2. The SMAGCON and BRD-CON from line 5 are constants which control the two types of turbulence models which can be employed by the code, the Smagorinsky [17] model and the Bardina [2] model. Line six is made up of NOUTF and NOUTD, the number of time steps between output of free-surface data and domain data, respectively. The next three lines, lines sevem through nine, control three important components of the code, the dynamic contact line model, the grid solver, and the pressure solver. NSLIP and BINIT both relate to the dynamic contact line model. NSLIP is the number of points in the ( direction which are in the slip zone. BINIT is a factor which defines the magnitude of the slip velocity at the actual contact line. The velocity boundary condition is iterated to allow for a converged solution between the dynamic contact line boundary condition and the other velocity boundary conditions. VTOL is the tolerance to which iterated velocity values must be solved. GTOL is the tolerance to which the grid points must be solved. PTOL is the tolerance to 30 which all pressure values must be solved in the pressure solver. Both the grid solver and the pressure solver are solved by successive over relaxation(SOR) methods. The ideal relaxation factor w is estimated, and the conservancy factors for the grid and the pressure, CONG and CONP, alter the initial w for their solvers to a more conservative value. The next three lines set any clustering which is to be used in the grid. YCL is a factor which turns clustering on for YCL = 1.0 and leaves it off for any other value. YPOS is a value which allows the user to specify the y value where clustering is to be focused. BETY is a factor which controls the strength of the clustering. The z clustering factors, ZCL, ZPOS, and BETZ, work in the same manner in the z direction. x clustering is set by default to cluster towards x = 0. XCL works in the same manner as YCL and ZCL, and BETX controls the strength of the clustering. Two clustering parameters are derived in the code based on the input given here, one for Y and one for Z. The following quantities are calculated: CY' where ==, z = Y, = = 3 log(1+y zeYa) O'Ze3 o~ 2 3 y,z (1 + Vfy,z[e-z - (2.28) 1])'(2 and 3y,z = BETY or BETZ. The next three input variables are logical flags which turn certain parts of the code on and off. WALLFNC turns on the wall function to modify how the Smagorinsky turbulence model is employed near the wall. GRDCOR, when set to . TRUE., forces the code to account for the effect of taking the time derivative of a grid-dependent operator on a transient grid. SGSFLA G allows the user to quickly turn off the turbulence modeling in the code, which will force the code to perform DNS. The very last line of the input file contains two more logical switches. The first, FMTFLA G, controls the type of output given by the code. If this flag is set to .TRUE., then the output will be ASCII text in data files with TECPLOT headers. If FMTFLAG = .FALSE., then the output will be in binary format, which takes up less disk space and is more quickly written, but requires some kind of post processing program to be analyzed. The final flag is CONFLA G which determines the 31 manner in which the convective terms of the projection equations are dealt with. If CONFLA G =. TRUE., they will be dealt with through a conservative central differenced discretization. Otherwise, those terms will be dealt with by an upwinded discretization. An output file which displays quantities input to the code and calculated in the initialization stage is given to help the user keep track of what is being done for each run. Initialize Output files with Tecplot headers The next task the code performs in its initialization stage is to output tecplot data headers to the necessary output files. If FMTFLAG =. TRUE., we write tecplot headers to all data files. Otherwise, we write a Tecplot header only to the data file keeping track of volumetric quantities. Read in Body Geometry The next portion of code reads in information regarding the base body geometry. First to be read in is an intger array, IBOD, of size NY x (NZ + 4). For each point on the I = 1 plane, IBOD has a value of either 1 or 0. If the point is on the ship, the value is one, otherwise, it is zero. The array IBODPT(NY) is also read in, it is simply the total number of points on the body at a given station, J. The base body geometry is given by a set of offsets, x (y, z), at a given number of stations. NXBT is the number of stations in the body gemoetry, and NYB is the number of points at each station. We read in the values XBOD(IB,JB), YBOD(IB,JB), and ZBOD(IB,JB). The body geometry is stored in an array of size NXB x NYB, where NXB is a constant value such that NXB > NXBT. This allows shorter, faired versions of the ship to be used without re-compiling the code. Set Grid Parameters We store many commonly used variables in memory rather than repeating their calculation repeatedly for many different operations. Some commonly used grid parameters are set this way. These include DX, DY, DZ, DKSI, DETA, DZET, DKSI2, 32 DETA2, DZET2, DXE, DXZ, and DEZ. DX, DY, and DZ are the average values of these quantities as if there were no body in our computational domain. We show the calculation of DX as an example of how we calculate them, TL DX= NX. NX - 1 (2.29) Many of these values are based on differences in the mapped space and are easy to define. Given the conversions of these to mathematical qunatities via Table 2.1, and the information that A =-- =z =1 (2.30) we see that all of these values are constant. Set Grid and Velocity Field The code must choose whether to continue a previous run or to begin a new one. This decision is based on the value of ISTART, as discussed earlier. If the code is restarting from a previous run, it reads in the data that was output at the end of that run, otherwise it perfoms the following initialization procedure. First, the initial grid, (x, y, z), is read. The length of the slip region is calculated based on the value of NSLIP, as defined in the input file, at each station, J. The distance between subsequent grid points in the ( direction, which are in the slip region, are summed to find this value. For every point not on the ship body, we initialize the velocity field to V - Oi + 1] + Ok. (2.31) All points on the ship body have an initial velocity of zero. Boundary conditions are performed by setting the values in up to two ghost cells beyond the computational domain. After initializing the computational domain with the inflow velocity field, the two planes at the inflow of the domain, J = -1 J = 0, are also set to the inflow velocity field. 33 and - YNatural Space (XYZ) X 8 6 2 4 2 0 -1O1 -22 Computational Space 70 60 50 10 20 20 30 020 10 10 00 Figure 2-3: Mapping of Computational Domain Calculate Grid Metrics, Grid Coefficients, and Inverse Grid Metrics The next portion of code calculates all of the grid metrics associated with the mapping of the grid. In figure 2-3 we show the transformation of the volume from natural space (x, y, z) to computational space ( , TI, (). Each point in natural space has a corresponding point in the computational space. The mapped location of a point is given by the indices with which it is stored on the computer. U(2 ,3 ,5 ) is the transverse velocity located at (X( 2 ,3 ,5 ), Y(2,3,5), z( 2 ,3 ,5)) in the natural space, but in the mapped space it is located at (2, 3, 5). There are many advantages to doing this. The mapped space derivatives are given by (2.30). Since our flow equations are formulated in natural space, we can take advantage of the chain rule to find natural derivatives given the easily calculated mapped-space derivatives, if we know the inverse grid metrics. For example, Of Of a - Oxi Oj Oxi' 34 (2.32) To calculate the inverse grid metrics, we first calculate the grid metrics. The grid metrics form a transformation matrix, M, whose entry at the ith row and J'th column is given by Ax - (2.33) Mk= The inverse metrics are given by the inverse transformation matrix N, whose entries are given by Nij - a (2.34) 19xj It may be shown that N is the inverse matrix of M and may be therefore be found easily. The Jacobian of M, J = det [M] I, (2.35) is a very useful quantity in finding the inverse of M. We denote the ijth minor of M as (2.36) 'Yij = (-1)i+j det [Mi], where Me is found by blanking the ith row and the jth column of the transformation matrix M. We can solve directly for the elements of the inverse transformation matrix, N .J (2.37) The entire transformation matrix must be calculated at each point in the domain. After that has been done, we calculate the Jacobian of the transformation matrix, the nine minors of the matrix and its inverse, by the method we have described above. To calculate the metrics at a given point we use the following derivative formulas. T(I+1,J,K) - r(I-1,J,K) 2(- (I,J,K) r(1,J±1,K) r(I,j1,K) - (I,J,K) r(I,J,K+1) o= - 2A( (I,J,K) T(I,J,K-1) (2.38) where r may be any variable which is stored at each point in the computational 35 domain. There are two different ways in which we take derivatives at the boundaries of the computational domain. We set values in ghost cells outside the computational domain such that the derivatives taken by (2.38) meet specific properties or we may use one sided derivatives that do not reference locations outside of the computational domain. The one sided derivative equations are Or I 4 r(NX,JK) - 4 -3r(1,J,K) 2A (1,JK) Or r(2,JK) - r(3,JK) 3 r(NX1,JK) + r(NX-2,JK) 2A (NX,J,K) Or -3r(I,1,K) + 4 3 4 r(I,NY,K) - r(I,NY-1,K) -- 3r(I,J,1) + r(I,NY-2,K) 4 T(I,J,2) - r(I,J,3 ) 2A( (I,J,1) 3 Or + 2Aq 0 (I,NY,K) Or r(I,3,K) 2ATI 0 (I,1,K) Or r(I,2,K) - T(I,J,Nz) - 4 r(I,J,Nz-1) + r(I,J,NZ-2) 2A( 0( (I,J,NZ) (2.39) We solve for one additional set of grid related coefficients which will be used in the grid solver and some other geometric calculations. (2.40) C'ii = 7ki7k Another method of filling values at ghost cell points is to use a simple extrapolation procedure that makes the difference between the ghost cell point and the comutational domain's boundary point the same as the difference between the first two computational domain points in the given direction. We fill the ghost cell inverse metrics values with r(o,J,K) r(NX+1,J,K) r(I,o,K) r(I,NY+1,K) 2 r(1,JK) - r(2,JK), 2 r(NX,JK) - r(NX-1,J,K)7 2 r(I,1,K) - r(I,2,K), 2 T(I,NY,K) 36 - r(I,NY-1,K), 2 r(I,J,o) r(I,J,1) - 2 T(I,J,NZ) T(I,J,Nz+1) T(I,J,2), r(I,J,NZ-1)- - (2.41) The values of these components are also set on the dummy edges of the computational domain, where two of the indices are dummy variables. A simple average of the components dummy-cell neighbors is used. As an example, consider cells which have I = 0 and J = 0, for all K, r(ooK) = r(1,o,K) + 2 T(O,1,K) (2.42) The values of the inverse metrics along the other eleven ghost cell edges of the computational domain are calculated in a similar manner. Estimate Spectral Radius and Calculate Initial SOR parameter We use a method to give us a conservative starting value for the overrelaxation parameters for our grid and pressure solvers. There is an optimal value for the overrelaxation parameter which will give the fastest possible convergence of the pressure and grid solver. We use separate relaxation parameters for each solver, O for the grid solver and wp for the pressure solver. From [12] we know that we can calculate the optimal parameter from 2 W =_ 1+ , 1 - p2a (2.43) if the spectral radius of the Jacobi iteration, Pjac, is known. There is a simple expression for calculating Pjac for a 2D poisson equation with homogeneous Dirichlet and Neumann boundary conditions, cos Piac + ()2 1 cos (A)2 (. (2.44) Since our grid and pressure solvers are both poisson solvers with mostly appropriate boundary conditions. We project our problem into each of the three possible 2D projections. We calculate the spectral radius of the Jacobi for each and use the 37 smallest of the three. We use conservancy factors, CONG and CONP to decrease the spectral radius of the Jacobi iteration, and use the resulting spectral radii and (2.43) to solve for our initial values of w9 and wp. 2.3.2 Velocity Boundary Conditions and Derivatives Most of the routines that are described in the followig are looped over 3 x NTIME times. We use a 3 step Runge-Kutta (RK) integration to move forward in time. NTIME is the number of time steps we set in the input file. At the beginning of each iteration, several counters are updated. We add DT to the TIME and one to each of the flow output counters IOUTD and IOUTF. We keep track of the current Runge-Kutta iteration count with the variable IR UN. At the beginning of each RK iteration, the values of TIME, ISTEP, and IRUN are output to the screen. ISTEP is the counter which keeps track of the number of time steps that have been run. The velocity boundary conditions are very important to the performance of the code. For SHIPLES, one of the most important boundary conditions that is set is that set by the dynamic contact line model. This model allows for a smooth transition from a no-slip region to a slip region near the contact line. Dynamic SOR parameter adjustment The grid and pressure solvers each have an ideal SOR parameter, w. This parameter is a function of the grid, and the nature of the boundary conditions, and therefore changes with respect to time. We show in § 4.2.1 that knowledge of the sign of d will allow us to modify the value of w so that it is closer to the instantaneous optimum value of w. n is the total number of iterations to convergence for the particulat time step. This routine finds the sign of d by calculating d in response to a given .The routine then modifies the value of w such that it is closer to the optimum. Details on the derivation of this routine and validation for it may be found in § 4.2.1. 38 Update Inverse Metrics We store two versions of the metrics and inverse metrics in memory at any given time, one at NTG = 1 and the other at NTG = 2. At the beginning of every RK iteration, we update the values of the inverse metrics. N'l,,g = NI,,K (2.45) Later in the iteration we will update the grid, and place the new inverse metrics in N 2IJK)* After the grid is solved for, we have the newest version of the inverse metrics at NTG = 2 and the previous N at NTG = 1. Two versions of the inverse metrics are stored to enable the correct calculation of the Laplacian operator for the pressure solver. Calculate the wall and free-surface normal and tangent vectors Velocity and pressure boundary conditions are typically cast in terms of the normal and tangential directions, which do not necessarily correspond to the principal directions of the coordinate system used in our simulation. In the case of SHIPLES, the normal and tangential directions of the computational domain are trivially easy to find on four of the six faces. The inflow, bottom, side, and outflow faces of the computational domain all have normals which are parallel to one of the coordinate-system axes. The remaining two faces, the wall and the free surface may not necessarily meet this condition. To set our boundary conditions properly, we calculate the unit normal and tangent vectors at each point on these faces. We use the transformation matrix, M, to compute the normals and tangents. The free-surface tangents are given by aD + ay D+ D D ax i 2 =- ay ~i + 19- j D71 D 77 39 _( D D 5 az -k D77 (2.46) where, D = Ox 2 + Dy 2 - +-. z 2 (2.47) For the tangent directions on the wall, the calculations follow in a similar manner as they did for the free-surface tangents. We use the definition that l (2.48) t2 x i2 to calculate the normal. Because of the way we declare our tangent vectors, we can take advantage of grid coefficent expressions which we have previously calculated in (2.36) and (2.40). It may be shown that the following expression holds for any flow boundary where ti and i 2 are defined similarily to (2.46). ujfi, i = (2.49) where iij is the unit normal in the j-direction and i corresponds to a wall or side unit normal, h2 corresponds to an inflow or outflow unit normal and 13 corresponds to a free surface or bottom unit normal. Calculate velocity boundary conditions and derviatives The velocity boundary conditions are simple everywhere but the contact line. The numerical implementation of the contact line model and velocity boundary conditions will be treated here. The calculation of the velocity boundary conditions involves an iterative procedure in the slip region since the slip velocity is a function of velocity derivatives in the slip region. We begin the subroutine by placing the old values of the velocities in the slip regions into memory. These are placed in the arrays UTMP, VTMP, and WTMP. We implement the velocity boundary conditions one at a time. The first boundary 40 condition to be applied is the side boundary condition on side 1 of figure 2-1. The boundary condition is given by (2.11). We show in detail how we set the ghost cell velocity value such that the boundary condition is met. All other homogeneous Dirichlet and Neumann boundary conditions are set in a similar manner. First, we give a typical example of how we set a homogeneous Neumann condition. dv= 0. dx (2.50) Along side 1, I= NX. Referencing (2.32) we get dv dx k _v . 094kx Then taking derivatives in mapped space accroding to (2.38), V(I+1,J,K) - V(I-1,JK) 'k V(IJ+1,K) - V(I,J-1,K) 091 2A ax 2ATI 1x + V(I,JK+1) - V(I,J,K-1) 19( 2,A( Ox (2.52) Defining the following variables RATI = 2A' ax RAT2= ax RAT3= and solving (2.52) for V(I+1,J,K) = RATi d V(I+1,JK), 9z, 2A(' (2.53) we get V(I-1,J,K)- [RAT2 (V(I,J+1,K) - V(I,J-1,K)) + RAT3 - 0 is solved in a completely analagous way (V(I,J,K+1) ~ V(I,J,K-1) ( forW(I+1,JK)- Our typical example for a homogeneous dirichlet boundary condition is given for 41 u = 0 on the side of the domain, 0, U(I+1,JK) U(I,J,K) = (2.55) - -U(I-1,JK) The next boundary condition that is set is the bottom boundary condition, which is applied on side 5 of figure 2-1. The boundary condition here is a free-slip boundary condition which satisfies (2.12). Since these are also homogeneous boundary conditions on a flat surface, the procedure for finding the velocities,u,v, and w at the ghost cells with k = 0 parallels completely the process followed in (2.50) through (2.55). The next boundary condition set inside our boundary condition iteration loop is the inflow velocity condition. This is set on side 3 of figure 2-1. The boundary condition must satisfy (2.13). This one is set at all points where J = -1,0, or 1, U(I,J,K) -0, V(I,JK) = 1, W(I,J,K) = 0- (2.56) The next velocity boundary condition set is the outflow condition. This condition is set at the J = NY plane on side 4 in figure 2-1. We set a zero gradient extrapolation condition here, which is stated in (2.14). Since all boundary conditions here are homogeneous Neumann conditions on a flat surface we can use expressions similar to (2.54). The next velocity boundary conditions set are more complex and are applied on the wall where I = 1. This is shown as side 2 of figure 2-1. There are three distinct regions: 1. Points off the body 2. Points on the body (a) Points in no-slip zone (b) Points in the slip-zone / near contact line region From our list above, we deal first with points in region 1. This boundary condition is given by (2.17). The symmetry plane condition is given by another free-slip 42 condition on a flat surface and expressions similar to (2.54) and (2.55) are derived to meet the condition. The next region we deal with is points on the body and in the no-slip zone. The majority of the body points are in this region. There is logic in the code to deal with a heaving or advancing body that stays symmetric to the Y - Z plane, but for SHIPLES we hard code the values of VWALL and WWALL to zero, and the corresponding boundary condition in this region is given by (2.16). These conditions are homogeneous dirichlet conditions and expressions similar to (2.55) can easily be applied. The points fitting the category denoted by point 2b in the list have the most complex boundary condition. The boundary conditions are given by (2.18) through (2.20), where the slip coefficient is found by calculating the approximate solution to (2.21) given by (2.22). Numerically, we are solving directly for the velocities at I =1 and will use (2.41) to find the velocities in the ghost cells at I = 0 in this region. Before we can solve for the velocities in this region, we first solve for the slip coefficeint, / (z). This value must be calculated for each point in the slip region. At each station, there are NSLIP points in the slip region. Figure 2-4 shows how these points relate to the value of NSLIP. The red points are the free-surface points. The yellow points are the slip points as if NSLIP = 3, the cyan points are no slip points which define the bottom edge of the slip region, and the blue points beneath them are no-slip points which are on the body. To calculate the slip coefficient, we define two indices KT and KB which are the K values at the top and bottom of the slip region given by KT = NZ, KB = NZ - NSLIP - 1. (2.57) KT corresponds to the red points in figure 2-4 and KB corresponds to the cyan points in the same figure. We define the slip length, A, as the vertical distance between these 43 . z Y Figure 2-4: Initial Distribution of 'Slip' Points on Body Surface 44 . .......... - .... .. . .......... ............... two points on the body at the same J, A = Z(I,J,KT) - (2.58) Z(I,J,KB). then we calculate Z(I,J,K) - (2.59) Z(I,J,KB) A The slip coefficient 3 is found given the input parameter 0 and the value of i at a point, 3 (2 o 1 - e .(2.60) 2 We now calculate our boundary velocities in the slip region. We have a system of three equations in (2.18) through (2.20) which we solve for W(I,J,K). U(1,JK),V(1,J,K), This is done by the following procedure: Si (J O( ( OJ (1,J,K) - 4V(2,JK) 1 -V(1,J+1,K) 2DV =q V(3,J,K) - V(1,J-1,K) - V(1,J,K-1) 2 D V3 - DW DW 2 V(1,J,K+1) = 4 w(2,JK) - W(3,JK) W(1,J+1,K) - W(1,J-1,K) - W(1,J,K-1) 2Ar7 W3(1,J,K+1) VBAR = SjDVi WBAR = SjDW tij = ti - j 1* = 45 t 12 + 3S 1 and 3S, 3 t2t1n 3 - D = t(1J _ V(1,J,K) W(2,JK) - 2 - 2 - 2t 1 1t 2 3 (211- D 6h 1 3) WBAR + (f2'*3 D ?1h2*) WBAR + D (122 U(O,=K) We now calculate velocity derivatives. 23 + n2t21t13 + (h 3 '1 2 - h 2 i 1 3) WBAR + (h 2 23 (h3 1n - = 2 h 3 t 2 2 tll 22)VBAR - h3 - + 2A ( 2 1) VBAR h2i2) Ui(JK) VBAR - Ui( 2,JK) (2.61) We take velocity derivatives according to (2.38) unless appropriate ghost cell values have not been set. In those cases we use (2.39) at the boundaries. Special care is taken in the longitudinal direction to avoid taking derivatives across the body-fluid boundary. If the normal central difference stencil would cause a derivative to be taken across the body-fluid boundary, it is taken in a one-sided manner, using (2.39), to avoid this possibility. The same process could be done in the vertical direction, but is not currently implemented at this time. We now turn our attention to solving the dynamic free-surface boundary condition. By solving the boundary conditions on the surface given by (2.25) and (2.26) with continuity (2.2) simultaneously, we obtain direct expressions for the derivatives of the velocity components with respect to ( on the free surface. These will be used to integrate the new free surface particle locations exactly. A detailed look at the exact derivation of this condition may be seen in § 4.1.1. Another extrapolation procedure to set the values of the velocities in the ghost cells at K = NZ + 1 is done. This is done differently than in (2.41). Here, we use r(I,J,NZ+1) T(I,J,NZ-1) + 2A( - (2.62) Upon setting the free-surface ghost cell velocity values, we set values in the domain edge ghost cells. These are done by various forms of extrapolation and averaging 46 which are not given here. There is some interplay bewteen the free surface boundary condition and the contact line model which must be resolved. We take care of this by iterating all of the above boundary conditions to convergence. The convergence is checked by comparing the difference in the velocities in and just below the slip region with their values at the previous iteration as stored in UTMP, VTMP, and WTMP. The largest sum of the absolute value of the differences,max U - UTMP + IV - VTMPI + W - WTMPI, is compared to the input variable VTOL to check for convergence. After completely setting all of the velocity boundary conditions, we set the dirichlet pressure condition on the free surface through the solution to (2.27). The correct solution to this equation is given in § 4.1.2. Calculate Temporal Metrics We need to find the quantities ,x and - at each point, based on how much the grid has moved in that time. We then calculate the inverse time metrics( and 2) 2 , which will allow the calculation of time derivatives of variables in natural space through the chain rule. The grid from the previous time step is stored in the arrays XS, YS, and ZS. The expression for a is given as an example of how we calculate the time metrics, 1x = 3(X-XS) DT 3(X-XS) 2DT OT (X-xs) DT IR UN = 1 IRUN = 2 (2.63) IRUN = 3 The other time metrics are calculated in an analagous manner. We apply the chain rule to find the inverse time metrics for the transformed grid, ogT --- 6kx &r~x O6Dx O + + O. _ The remaining inverse time metrics are found in a similar way. 47 (2.64) 2.3.3 Momentum Vector Assembly We use the projection equation (2.7) to couple our pressure and velocity fields. We assemble the momentum vector, F, at each point in the flow filed. The three terms of F are given by (2.5). When performing LES, we have an additional shear stress like term, the sub-grid stress (SGS), which models the effects of ther flow at scales smaller than our resolved grid scale. We also calculate the contributions that come from the viscous and convective terms of the Navier-Stokes equations to assemble F. If LES is being used as opposed to DNS, calculate SGS contribution to F The input variable, SGSFLAG, determines whether or not this calculation is performed. The operation is necessary unless the grid resolution is such that DNS may be performed. The flag allows SGS computation when set to . TRUE. In our SGS routine, we begin by calculating the grid size at each point in the flow field. We use the following expression for the characteristic grid size, A = Ax 2 + Ay 2 + Az 2 (2.65) We take a central difference equation at each point to calculate Ax K - Xi(I+lJK) (2.66) Xi(I1,JK) If we are at one of the boundaries, we calculate the value of Ax7 by a low order one sided difference, similar to AX(IJK) K) - (2.67) Xi(1,J,K) The values of Ax, Ay, and Az are calculated at each point in the domain and the characteristic grid size A is calculated by (2.65). We store the cross velocity terms, uiu for all i = 1, 2, 3 and j = 1, 2, 3 into memory. We store six new arrays in memory with names, UU, UV, UW, VV, VW, 48 and WW. Each of these arrays are filled by multiplying the two values in their respective names together at the given index (I, J, K) for example, UU(I,J,K) U(I,J,K)U(I,J,K)- = (2.68) All six arrays are filled in a similar manner. We filter the nine velocity variables (the three velocity components and the six cross velocity components). The filtering operation is performed at each point in all three coordinate directions independently. We filter each variable in the x direction first, followed by filtering in the y direction and finally the z direction. The filtering operation uses a three point stencil of the following form U(I,J,K) + au(I--1,JK) bu(I,J,K) + CU(I+1,JK)- (2.69) When AX(I,JK) is a constant for all (I, J,K), it may be shown that the proper coefficients for the filter are a =- 1 1 c= 1 . (2.70) These coefficients were applied in [6]. One of the improvements to the code has been an improved filtering operation which is designed to perform well on grids with uneven spacing. We assemble the subgrid-stress(SGS) contribution to F using two different SGS models, which may be applied separately or together. The first model is the Smagorinsky [17] model which is a purely dissipative model controlled by the input Smagorinsky coefficient, Cs. The second model is the Bardina [2] model which allows for a backscatter of energy. The two are often used together and called the SGS mixed model. We also employ the option to use a common modification to the Smagorin- 49 sky model for flow near a wall [9]. This modification is called the Wall Function Model. We have an input flag, WALLFNC, which, when set to . TRUE., turns the modification on, and when set to .FALSE. leaves it off. We calculate several quantities before applying the models. First we calculate the stress auj, which does not include pressure terms, Oxj 2 + au (2.71) Oxj ) where Ox 3 (2.72) - k 0X Our model takes the following form: Tij=- 2 (2.73) (C, A)2 (2ukiukl) 2 i1 + CB (Ui U When the wall function model is turned on, we modify the expression to the following form: 2 (Cs A) 2 (2 - where (OUk - 2 (CAz z + CB (UiU - 0U)) ( ) indicates - - (Urki)) (Orkl - (Ok)))V (rij 2 _(e - (Ouij)) (2.74) the longitudinal average of a quantity, calculated by summing the qunatity over all J and dividing by NY. If the wall function is on, we caclulate the nine longitudinally averaged auj for each (I, K) combination. After calculating Tij at each point we calculate the dissipation, which we denote as DISSIP in the code, by DISSIP(I,J,K) = -Tij(IJK) OJ(IJ,K). 50 (2.75) We define the SGS contribution to the ith componentof F, Ti -- 0 - -- - . Ok OXj (2.76) We set boundary conditions for rij by setting ghost cell values on the four flat walls. This is done by declaring each Tij to be either symmetric or anti-symmetric on the particular wall we are dealing with. Each wall can be denoted by an index k which corresponds to the coordinate axis that the normal to that wall is parallel to. If either i or j of Tij is equal to k we declare that particular Ti3 anti-symmetric and the remaining to be symmetric. As an example of how we set the ghost cell values, we demonstrate what happens where I = NX for the anti-symmetric variables Tij(NX-1,J,K) Tij(NX+1,J,K) (2.77) The symmetric boundary conditions yield expressions such as (NX-1,J,K) Tij(NX+1,J,K) (2.78) We use all symmetric ctonditions on the inflow and outflow walls, so that there is no turbulent effect at these locations. We calculate the derivatives of each Tij in mapped space. We use the central difference (2.38) formulas to perform these derivatives for each point. The only exceptions are at the free surface and the wall. Along these boundaries we use the one-sided difference (2.39) formulas to calculate the derivatives. After all the derivatives have been calculated, we assemble the three variables Tx, Ty, and Tr according to (2.76). Calculating the 3D-Mapped Laplacian coefficients for the viscous contribution to F In assembling the momentum vector, F, we account for three terms. One term is from the viscous contribution to the momentum equations. This is the first term of 51 F as stated in (2.5). The notation may easily recognized as 1 0 2 U, I V2Ui ReD 1 jl9j ReD (2.79) where OX a2 92 92 2 D9y 2 2 +9z (2.80) Using the chain rule (2.32) and taking mapped first derivatives by the central difference (2.38) and mapped second derviatives by D2 r D2 r _ r(I+1,J,K) - 2 r(I,JK) r(I,J+1,K) - 2 T(I,JK) + r(I,J-1,K) _ Dr2 92 r r(I-1,JK) 7, 2 - -2r(I,JK) + (I,J,K+1) _ + r(I,JK-1) (2.81) we come up with a 19 point stencil. We multiply each of the 19 points by a different coefficient based on the derivatives at a given point. Table 2.2 summarizes what the 19 points are and the definition of each of the coefficients. We define the following equations which we use to fill Table 2.2 Cx = I49X ) 2 + (1)49Y 2 + Ar (a,)2 OZ 2 CY = (~2+ CZ = (1)2 Ox CXY= CxZ= () (0" a y +x a a, aO a z z 4A(Ar ax ax ay a CYZ az az (2.82) 52 J Coefficient Stencil Point] Equation C1 -2 (CX + CY + CZ) (I,J,K) C2 Cx (I+1,J,K) C3 Cx (I-1,J,K) C4 Cy (I,J+1,K) C5 CY (I,J-1,K) C6 Cz (I,J,K+1) C7 Cz (I,J,K-1) C8 CXy (I+1,J+1,K) C9 (I+1,J-1,K) CIO - Cxy (I-1,J+1,K) Ci1 - CXy CXZ (I-1,J-1,K) C12 Cxz C13 Cxz (I+1,J,K-1) (I+1,J,K-1) C14 - Cxz (I-1,J,K+1) C15 Cxz C16 Cyz (I,J+1,K+1) C17 - Cyz (I,J+1,K-1) C18 (I,J-1,K+1) C19 Cyz , (I,J-1,K-1) Table 2.2: 3D Mapped Laplacian Coefficients 53 Assemble F We assemble the momentum, F, by calculating the viscous contribution using the coefficients calculated previously and the convective terms. The viscous terms are easily calculated after the 19 coefficients shown in Table 2.2 have been assembled. Referencing the table we calculate GRAD2, for j = = V 2 ui = Cjus ,i = I... 3 (2.83) 1, 2... 19 where Sj indicates the stencil point for coefficient Cj. SHIPLES calculates the convective terms in one of two ways. The first method is a first order upwinding scheme, while the second method uses a conservative scheme. The convective scheme used is dependent on the value of the input variable, CONFLAG. If CONFLAG . TRUE. then the conservative scheme is used, otherwise we use the upwinded scheme. The upwinded scheme is taken straight from Imas [6]. Upwinding is a technique which places a larger emphasis on the information coming from the local upwind flow direction. Using an upwinded treatment of the convective terms has dissipative properties, which tend to dampen turbulent effects and the influence of our SGS models [16]. We write the convective terms in curvilinear form as: ui+ a O, (2.84) where a, OxJ . a= ak=OT (2.85) The upwinding distribution means that we calculate this quantity as GRADj = --7 + ak krj+> 54 + ak N k _G (2.86) where a= (2.87) ak±ak 2 and Or r(I,JK) - r(I-1,JK) Or r(I,JK) - r(I,J-1,K) Or _r(I,JK) - r(I,J,K-1) 0+(~ Or r(I+1,J,K) - r(I,J,K) Or r(I,J+1,K) - r(I,JK) AT)~ Or r(I,J,K+1) r(I,JK) - (2.88) The calculation of the conservative form of the convective terms is a simple procedure. Derivatives of the cross velocities calculated for the SGS calculation are taken with the standard central difference (2.38) and the chain rule (2.32) is applied as the quantities are assembled. The three convective terms are simply given by GRADj = + uiuj OTF +OxJ _OUi 04k Ou OT OUiUj OGk ± OGk OX (2.89) for i = 1, 2, 3. After calculating these terms, we assemble the three components together into Fi=-GRAD-i GRAD2T -R (2.90) for each of the three components of F. Calculate F in ghost cells We now apply boundary conditions on F so that the derivatives of F which are used in (2.7) meet specific properties on the boundaries. These derivatives are set in a 55 similar manner to the many other boundary conditions in the code. The first boundary conditions are set on side 1 of figure 2-1. There are homogeneous Neumann boundary conditions similar to (2.54) set for F 2 and F3 on this wall. F1 is set such that F1(NX+1,J,K) - F1(NX-1,J,K) (2.91) On side 2, where we have our ship body, we have three sets of boundary conditions again. The normal component of F is dealt with in the same way in all three regions of this boundary F1(, JK) F1(2 ,,K). - (2.92) The other two components are dependent on the region, for the region off of the body we have a symmetry condition similar to what we have on side 1. For points on the body in the no-slip region we have a complete anti-symmetry condition, where F(O,J,K) - -F(2,J,K)- (2.93) Points in the slip region near the contact line get there values from an extrapolation similar to( 2.41). The inflow condition is such that in the two ghost cells at the front of the domain is F(I,J=-1,0,K) F(I,1,K)- = (2.94) The outflow condition is the same for each of the three components as well, where ghost cell values are set according to OF ay 0 (2.95) and given by (2.54). On the bottom of the flow field we set F and F2 by (2.54), and F3 , which is 56 normal to the boundary is given by F3 (0,J,K) 2.3.4 (2,J,K) (2.96) Grid Solver We solve the grid equations at the next RK step. The grid remains boundary fitted at all times and must deflect with the moving free surface. Since the free surface is in constant motion, we must solve for the grid at each time step. The grid solver is non-linear since it is a function of itself. There are many ways to approach the problem of solving for the new grid, but none is necessarily the right answer. We solve the problem by setting dirichlet boundary conditions for the grid positions on each of the boundaries. The grid solution is a way of connecting the points by presciribing certain conditions on their connections. If at first RK step, store previous grid The title of this subsection says exactly what we do in this portion of the code. If IRUN = 1, we store the values of X, Y, and Z in the variables XS, YS, and ZS. This is done to allow for integration forward in time by the Runge Kutta method. We must always know what the solved grid was at the last completed time step. Integrate Free-Surface Points according to kinematic free surface boundary condition Here we perform the Runge-Kutta integration for the free-surface points. We use the velocities at the free surface which were solved for earlier. We integrate in time from the grid points at the previous time step via the kinematic free surface boundary condition, which states that D XDt= U (2.97) on the free surface. This means that the free surface is a material surface and that fluid particles remain on the free surface. 57 Given which is the ith component of the position vector at point (I, J,K) XnjK, in transformed space at the nth time step and the velocities at the current RK step and some previous RK steps, we can calculate the location of new free-surface points by x i(I,J,K) 1} x 'Z(I,J,K) X{2} Z(I,J,K) _ {n+1} _ 2 (I,J,K) n Z(IJK) +3 + {n} 2 IR UN = IU IRUN = 2 Ui(I,J,K) 211 3 2 (I,J,K) At {2} 4 (I,J,K) 'U(I,J,K) 3At 4 { +1} Z(I,J,K) IRUN = (2.98) 3 Smooth free-surface grid points We do not allow points on the free surface to flow out of the domain, even though the kinematic free surface boundary condition would have us doing this. We smooth the free surface with a low pass filter, which prevents the formation of high frequency instabilities which often form on numerically calculated free surface flows. The filtering opeartion also keeps our points inside the computational domain. We filter each of the free surface positions in turn, X, Y, and Z. The filtering operation is performed in the x direction first. We calculate X(1,J,NZ) X(1,JNZ) ,X(2,J,NZ) X(1,J,NZ)+X(3,J,NZ) -_ (NX-1,J,NZ) 2 (2.99) (NX,J,NZ) +X(NX-2,J,NZ) X(NX,JNZ) X(NX,J,NZ) - -X(I-2,J,NZ)+ 4 x(I-1,J,NZ)+lOX(I,J,NZ)+ T(I,J,NZ) 4 x(I1,J,NZ)-X(I+2,J,NZ) 16 The same filtering operation is repeated in the longitudinal direction for each J as opposed to each I. After the filtering operation has been completed, we have new positions for each point on the free-surface boundary. Redefine all other boundary points After solving for all points on the free surface boundary, we redefine the positions of all points on the remaining boundaries. The most difficult of the remaining boundaries to deal with is the body boundary. The difficulty arises from searching for the offset 58 value x at each newly moved point (y, z). We use the clustering data that was provided in the input file to place the boundary points. We begin by setting flags for the clustering. We have three logical clustering flags for each of the three directions LCX, LCY, and LCZ. We fill three arrays of clustering information, CLUSTERX, CLUSTERY, and CLUSTERZ based on the input file variables. The first value of these arrays, if set to 1.0 turns the clustering in their respective directions on, by setting the corresponding logical clustering flag to .TRUE.. We fill the dirichlet points on the body side of the computational domain. We set the y and z values according to the clustering desired and the location of the free surface as previously calculated. All bottom points on this wall, (I = 1, K = 1), are set to z(1,J,1) = - TH. Then we continue to set locations of points on this wall where I = 1. We set the z values first. If LCZ .FALSE. then we use even distibution in the = z direction which gives Z(1,JK) = (Z(1,J,NZ) Clustering equations are taken from [5]. - Z(1,J,1)) NZ - 1 If L CZ = (K - 1) TH. (2.100) .TRUE. then we use our clustering function. We use the 4 values stored in the array CL USTERZ in this formulation. CL USTERZ (2) is the input variable ZPOS which gives the location where the Z clustering will be focused. CL USTERZ (3) is the clustering parameter we calculated with (2.28). CL USTERZ (4) is the input variable oz. Given these we calculate the positions by ZPOS (I + sinh Oz ((z(1,J,NZ)-Z(1,J,1))(K-1) Z(1,J,K) Z1) sinh(s ,r C)z -inh(Q TH (2.101) After all z locations have been set, a very similar method is taken to calculate the 59 y location for all points with I = 1. For LCY = .FALSE. we have (J - 1) NY-i Y(T,J,K) Where LCY = (2.102) YOFF. .TRUE. we have, YPOS (I+ sinh y ( JY(1,J,K) = - Cy)) - YOFF. sinh(#yCy) (2.103) Here we call the routine which interrogates the body geometry to determine the x value of the boundary for each given (y, z) point. This routine was one of the significant upgrades to the code and is described in detail in § 4.2.2. We redefine the rest of the boundary points taking account of the free-surface movement on these boundaries. We currently do this by setting the (x, y, z) values at each point throughout the entire volume according to the same clustering rules as above for y and z. The x clustering is achieved by X(I,J,K) = (TL - ( X(1,J,K)) R+ - + X(1,JK), (2.104) where R+ = x I-1 N X-1 + 1 3x - 1) R = #+ 1 1 NX + 1 (2.105) and Ox is an input variable. After redifining all remaining x,y, and z locations by this method, we overwrite the interior points with their values from the grid at the previous time step as stored in XS, YS, and ZS. This allows the initial grid for the grid solver to maintain a level of smoothness not found in algebraic grids. 60 Solve Grid Equaitons using point SOR We have the boundary points defined by the clustering we have set in the previous routine, and we use the grid from the previous time step as an initial guess for our solution. The grid solver is described well in [6], but we have made a slight modification. The first modification we have made is by removing the right hand side source terms that were previously used to cluster the points. Our clustering is controlled completely by the grid point locations on the boundaries. Our grid equations are quite simply = 0 V2 v 2J=o V2( = 0 (2.106) Remembering the grid coefficients, ao, we calculated in (2.40), it can be shown that the solution to this is given by 02r 01 02r + a 22 - + a 33 02 r + 2 192r a12 + a 13 02r + a 23 - 02 r , (2.107) where r may be x,y or z. This equation must be solved at every (I, J,K) which is not on a boundary. We solve the equation numerically. The solution itself is slightly problematic since the coefficients for the method are themselves functions of the grid. If the grid were solved to machine tolerance, we would have a completely orthogonal grid. It is not necessary to solve it to a great tolerance though, we just solve it well enough to get a reasonably orthogonal grid. We use the method of successive overrelaxation in our solution. Using second order central difference operators 2.81 to approximate the partial derivatives we have, and solving for the resulting expression r(I,JK), we are able to iteratively solve for a new value of T(I,J,K). This is done for all interior points 61 such that ~1 [(I,J,K) + a222 + 2 24 + (1 (r(I,J+1,K) { (r(I+1,J,K+1) (r(I,J+1,K+1) - (I+,JK) + r(I,J-1,K)) + '1(r(I+1,J+1,K) + 24a1 - ) - - + r(I-,JK) ((I,,K+1) Aa + r(I,JK-1) T(I+1,J-1,K) - T(I-1,J+1,K) + r(I+1,J,K-1) - r(I-1,JK+1) T(I,J+1,K-1) r(I-1,J-1,K)) + T(I-1,J,K ~ r(I,J-1,K+1) -1) + r(I,J-1,K-1)) w) rold(I,JK) (2.108) As mentioned above, we iterate this equation to convergence. At each iteration, we store the previous values of X, Y, and Z into the arrays XOLD, YOLD, ZOLD. We calculate the latest values of the grid coefficients i and we step through all interior points updating the values of X, Y, and Z by (2.108). Upon updating the three position values at all points, we check to see if the absolute value of the largest change is less than the grid tolerance, GTOL. If it is not, we iterate another step. If it is, we have found our grid solution. Solve for new metrics, grid coefficients, and inverse metrics Upon finding our grid solution, we solve for the updated grids metrics, coefficients, and inverse metrics at each point based on the new grid. 2.3.5 Righ Hand Side of Pressure Solver In preparing to solve the projection equations (2.7), we set up the right hand side (RHS) of the equation. We store these values in an array named RHSF. There are three terms on the RHS of (2.7). The first term is the momentm contribution, which includes sgs stress, convective terms, and viscous terms. The second term is the divergence term, which should be zero, but has a finite value due to the movement of the grid. The final term is the correction due to grid movement from one time step to the next. 62 Initialize RHS to zero We begin by setting each value of the RHSF array to zero to make sure that we don't add RHS contributions from previous time steps into the RHS contributions at this time step. If Grid Correction is on, account for the movement of the grid points We begin with the final term of (2.7). This term is calculated conditionally, if and only if GRIDCOR . TR UE. This term, U- -, has been found to only have a small effect on the outcome since the grid changes so little from one RK step to the next. We therefore include the option to turn it on for cases where it becomes more necessary to include the effect. Numerically we implement this as U --av -0 at au a =Ox2 k (2.109) at(1 where we find _x_ x i (I,J,K) aXi (I,JK)) At - at (2.110) where C = 3 for IRUN = 1, C = 1.5 for IRUN = 2, and C =1 for IRUN = 3. The values of aui are the most recent stored in memory. We update the RHSF by RHSF(I,J,K) C a ( 0k (IJK) (Oxi (I,J,K) a )) (2.111) Oli (I,JK)) where At will be accounted for later. Divergence calculation for the RHS term including divergence The divergence calculation is used to ensure that the pressure field will be such that the velocity field conserves mass. This is the second term of (2.7) which is a(V - U-) a at .(2.112) 63 We calculate this using the updated grid. The velocity field was divergence free on the old grid, and is no longer so on the new grid. We denote quantities associated with the previous grid by Ill and qunatities associated with the new grid by {2}. We use the same coefficients, C, from the grid correction section, which are dependent on the RK step. We calcualte U(-4) axi (I,JK)49 k (I,JK)) At At (2.113) We update RHSF by RHSF(I,J,K)= RHSF(I,JK) + C ( aU k K)! (2.114) i (I,J,K) ak (I,J,K) Add F contributions to RHS of pressure solver We complete the RHS of the pressure solver by adding the contributions of F to RHSF. We have the value of each of the three components of F at each point and we need to assemble the values of V - F. To apply the chain rule (2.32), we need to first take derivatives of F in computational space. We do this for each component individually. We take derivatives with respect to each k. Each direction is treated diifferently. For derivatives with respect to , we take central derivatives at all points, similar to (2.38), using the ghost cell values which were set previously. For derivatives with respect to rq, we use primarily central differences again, except for along the body plane where we take one sided differences (2.39) whenever a central difference would take a derivative across the body-water boundary. Finally, for the derivatives with respect to (, we use central derivatives everywhere except along the body. Here, we take one sided derivatives where central derivatives would take points across the body boundary, and we also take one sided derivatives at the base of the slip region. The cyan A points in Figure 2-4 have their derivatives taken towards the no-slip blue square points. We also take one sided derivatives down from the free surface. Once all of the computational space derivatives have been formed, we use the 64 chain rule to form V - F at each point. We do this by V OFi oa - F(I,J,)-4(,JK- 'fk (I,J,K) IJK ~ (2.115) Ei(I,J,K) We update the final version of RHSF by RHSF(IJK) RHSF(I,J,K) = R I + V (I,J,K) (2.116) which accounts for the At factors left out of the previous updates to RHSF. Assemble the 19 point laplacian coefficients for the pressure solver The laplacian coefficients we use for the pressure solver have a fundamental difference from those used by the grid solver. We have velocity values stored in memory from the previous time step on the old grid positions, and we have to account for the fact that we are projecting the operator, not only to the next time step, but also to the new grid positions. We take V. of (2.4). Where the V operator is a function of the grid at the new time step and the V operator is a function of the grid at the previous time step. We now come up with a modified version of (2.7) which has the form S-VP = .F - t at +U- .t at* The process of forming V - V is well documented in [6]. (2.117) We end up with a 19 point stencil which is summarized in Table 2.3. The coefficients in Table 2.3 which 65 Coefficient Stencil Point Cl (I,JK) C2 (I+1,JK) C3 C4 C5 CX+ (I-1,JK) CX- (I,J+1,K) CY+ (I,J-1,K) CY C6 (I,J,K+1) C7 C8 (I,JK-1) (I+1,J+1,K) CZ+ CZCXY++ - Equation (CX+ + CX- + CY+ + cy- + CZ+ + Cz-) C9 (I+1,J-1,K) - CXY+- C10 (I-1,J+1,K) - CXY-+ C11 (I-1,J-1,K) CXY-- C12 C13 (I+1,J,K+1) (I+1,J,K-1) CXY++ - CXZ+- C14 (I-1,J,K+1) - CXZ-+ C15 (I-1,J,K-1) C16 C17 (I,J+1,K+1) CXZ-CYz++ C18 C19 (I,J-1,K+1) (I,J+1,K-1) - (I,J-1,K-1) CYZ Table 2.3: 3D Mapped Laplacian Coefficients 66 assembled with 1 CX* - A ax (I,J,K) Ox (I± ,JK) + 2r 2 a a 9X(I,J,K) Ox (I±i,J,K) C A(2 CXY±± =1 + Ox (I,J,K) Ox (I±},JK) 1 4A Aq OY W a Ox(I,JK) O )Y (I,J,K) aY (I,J±,K) 7 (I±i,JK) OY Oz (I,JK) zI,J,Ki}! x2)) az (I,J,K)az (I, J,K Ox (I,J,K) Ox (I,J±1,K) (I,JK)-Y (I,J±1,K) Oz (I,J,K) aO (I,J±i,K)) -1 (& a 4AA( \x O (I,JK)ax(I±1,J,K) 9Y (I±1,J,K) Oz (I,JK)Oz (I±I,JK) + ay(I,J,K)aY I,Jij!,K) +b 9 (I,JK)OY (I±i,J,K) 9Y (I,JK)aY CYZ** a7 ay (I,JK)aY I,Jij!,K) Oz (I,JK)Oz (I±i,J,K) CXZ± = A + ?I Oz (I,JK) Oz (I,J,K±I) + Ox O( ax (I,JK)ax (I,J,K±i) (I,JK)-Y (I,J,K±1) Oz (I,J,K) Ox (I,J,K±1)i 497 + 49 &9 1 -b a 4AA( \ Ox (I,J,K) Ox(I,J±1,K) 4x (I,J,K) ax (I,J,K±l) 9Y (I,JK) 9Y (I,J±1,K) OY Oz (I,J,K) Oz (I,J±i,K) (I,JK) 9Y (I,J,K±i) Oz (I,JK) ox (I,J,K±i)) (2.118) where, ( ( (I )(I,J,K) ,J,K2 + ( )(II,JK) (2.119) and the first of the double ± signs in the cross coefficents apply to the first direction in the coefficient name, while the second corresponds to the second direction in the coefficient name. 2.3.6 Pressure Solver The solution of the pressure at a given RK step is quite important to the success 67 of the code. To solve the pressure equation, we set pressure boundary coditions and use the coefficients from Table 2.3. The pressure solution method is iterated by successive overralaxation. The five neumann pressure boundary conditions are set at each iteration of the solution, and the dirichlet pressure condition on the free surface is used to find the solution. We set the ghost cell pressure values based on the pressure values at each (I, J,K) point. We use the current values to solve for an updated value at each line of constant (J,K) by SOR. The updated values are compared with the values from the previous iteration. If the maximum absolute difference is less than the pressure tolerance, PTOL, we declare the pressure the solution. If it still larger than PTOL, we iterate again until convergence. Set P on wall ghost cells The first pressure boundary condition we set is on the I =1 plane. Due to the geometry and the complexity of the velocity boundary conditions, this pressure boundary condition can be a bit complex. We essentially are saying that ! = 0 on all bound- aries except the free-surface boundary where we have the dirichlet pressure condition. Taking (2.4) -h and knowing that iU -h = 0 on most boundaires, we get OP - -F - h. (2.120) On most boundaries, we have set F -f = 0 and we need the normal component of the pressure to be zero. On the body, especially in the slip region, this is not necessarily the case. For points on the body, we set our boundary condition by finding P(O,J,K) such that OP (2.121) + IBOD(JK)F ' h - 0, where IBOD = 1 for points on the body and IBOD = 0 for points off the body. This process is similar to (2.54), but a little more complicated, since we are dealing with the normal and tangential directions. This is easily dealt with by the full application of the chain rule using the unit wall normal vectors we have already calculated. A slightly different expression obtains at the free surface, where a one-sided difference 68 is used to define a. Set P on side ghost cells The far side has a normal direction parallel to the x axis. We calculate P(NX+1,J,K), such that 1 = 0, by a method similar to (2.54). We make a slight adjustment in the expression at the free surface by deriving our expression for a one-sided difference at the free surface. Set P on bottom ghost cells The bottom boundary condition is 0. We use a homogeneous neumann bound- ary condition similar to (2.54), where we set the pressure values in the ghost cells, P(I,J,o). We also set two of the edge boundary conditions. We set P(o,J,o) = P(o,J,2) and P(NX+1,J,O) =P(NX+1,J,2)- Set P at inflow ghost cells The inflow pressure boundary condition is that ( = 0 on the inflow plane. We set this condition in a method similar to (2.54) , allowing us to set the pressure in the ghost cells, P(I,o,K). We set another bottom edge boundary condition here as well. The inflow bottom edge has P(I,o,o) = P(I,2,o). Set P at outflow ghost cells The outflow pressure condition is the same as the inflow, but allows us to set the ghost cell pressures, P(I,NY+1,K). bottom outflow edge, P(I,NY+1,o) We also set the pressure boundary condition for the - P(I,NY-1,0)- Set P in corner ghost cells There are boundary coditions set for many of the corner and edge ghost cells, where at least two of the three indices are not part of the computational domain. We do not explicitly set any values where K = NZ + 1 since we use a dirichlet condition 69 on the free-surface boundary. We set boundary conditions on the four bottom edges and the four vertical edges. The bottom edges have already been set and we set the boundary conditions on the four vertical edges by P(NX+1,NY+1,K) = P(NX+1,NY-1,K), P(NX+1,0,K) P(NX+1,1,K), P(O,NY+1,K) P(2,NY+1,K), (2.122) P(2,0,K)- P(o,o,K) Solve for pressure We use a slightly modified version of the SOR method to solve for the pressure in the flow field. Instead of solving point by point, we solve one line at a time, this is known as a block SOR scheme, since we are solving entire sub-blocks of the full pressure matrix at a time. We progress through the flow field solving the pressure at all values of I simultaneously for each given pair (J,K). We use a tri-diagonal solver to do this. At each point in the standard stencil, we have three points that share the same (J,K) values. These make the upper and lower diagonal adjacent to the given point, which is at (I, J,K). Referencing Table 2.3, we see that the two points sharing the same (J,K) value correspond to C2 and C3. We fill the lower diagonal with the values of C3, the main diagonal with the values of C1, and the upper diagonal with the values of C2. We take care to move the ghost cell values of C 2 (1,JK)P(o,J,K) and 08 (NX,J,K)P(NX+1,J,K) to the right hand side of the equations. All the other coefficients multiplying the pressure at their respective stencil points go on the right hand side as well. We now have a tri-diagonal system with which we solve for the temporary pressure solution, E*. We have stored in memory the pressure from the previous iteration, P'. We now update the pressure by SOR, P(I,J,K) IWP(*,J,K) 70 ( - W) PO ) (2.123) After updating the pressure values we compare the largest absolute value pressure difference between P and P 0 to the input variable PTOL. If max ( P(I,J,K) - (I,J,K)) PTOL then we have completed our iteration procedure, otherwise we make another iteration, storing P values in the array PO, and re-calculating all pressure boundary conditions before iterating. Completing pressure solution We make one final pass over all the boundary conditions after we converge our pressure solution. This forces the boundary conditions to be met in the final solution. Add Pressure term to momentum equations We update the momentum equations (2.4) with the correct pressure term. We do this to get a correct expression for f. Numerically, we accomplish this by modifying the values of F such that F = F - VP, (2.124) where VP is calculated by taking central difference formulas of type (2.38) in mapped space and using the inverse metrics to map them into real space, such that OP OXi . (2.125) 1Gg &xi We modify (2.4) such that = F 2.3.7 (2.126) Integrate We update the velocity field and perform necessary data processing before advancing to the next RK or time step. The values calculated at the first two RK steps are just intermediate values. The calculated values at the third RK step are the values we are most interested in since they are the values for the particular time step we are calculating. 71 Data Processing If we are on the first RK step, IR UN = 1, we calculate the vorticity in the flow field from the previous time step before integrating the velocity field. We use the mapped domain velocity derivatives and the mapped domain velocities stored from the last time step to calculate the vorticity, W' = V x U', which we calculate at each point, 09 X , Wi = Eijk (2.127) where Eijk = -1 ijk = 321, 213,132 1 ijk = 123, 231, 312 0 ijk = else (2.128) We calculate the mass from the current time step to confirm that we are calculating a divergence free flow. We calculate the divergence at each point in the flow field by ML(I,J,K) (2.129) Ui a (IJ,K) aXi (I,J,K) We check to see what the maximum mass loss at a given point is and store it in memory. To calculate volume quantities we use the following procedure. We note from [5] that the Jacobian, J, of the metrics matrix, M, is the ratio of the volume of a cell in physical space to the same cell's volume in computational space. The volume of each cell in computational space is by definition one, so by knowing the Jacobian we know the volume of the cell. Thinking about the computational space, the Jacobian of the point corresponds to a cube that has i8 of its volume in each of the cubes surrounding it. For this reason, we calculate the volume of each cell as VOL(I,J,K) (J(I,JK) + J(I+1,J,K) ,JK) J(I,J,K+1) + + J(I,J+1,K) + J(I+1,J+1,K)i J(I+1,J,K+l) 8(2.130) + i(I,J+l,K+l) + i(I+1,J+1,K+l) - To calculate the volume of the entire flow field, we do this for each cell. Note that 72 in computational space all the cells are defined by the corner point with the three smallest indices. We do not calculate volumes for cells which have an index, I = NX, J = NY, or K = NZ, since these cells are not inside the computational domain. If we want to find the volume average of any quantity, the contributions df in that cell which is }fsd VOL, f, we sum over each cell for each of the 8 corners, s, that make up each cell. By this method,we calculate the volume averaged quantities of Iwj 2 , DISPTN, and ML. We output these volume avergaed quantities with the maximum mass loss at a point and the simulation time to a data file. Data Output We check to see if any of the output counters, IOUTD and IOUTF, have reached the prescribed variables NOUTD or NOUTF. If IOUTD = NOUTD then we output the flow variables throughout the fluid domain. We output to one file the position vector, the velocity vector, and the pressure magnitude at each point. Then we output to a second file the position vector, the vorticity vector, the vorticity magnitude, and the turbulent dissipation at each point in the flow field. If the free surface output flag has been tripped such that IOUTF = NOUTF, we output the same quantities to two different files for all points on the free surface. The type of output in all cases is controlled by the input variable FMTFLAG. If FMTFLAG = . TRUE. then we write formatted output in ASCII text symbols, otherwise, we write a binary data file, which has the advantage of taking less time to output and taking less disk space, but has the disadvantage of being platform dependent. Regardless of the type of output used, if either counter has reached its maximum value set in the input file, it is reset to zero after the output file has been written or appended. Store velocity field in memory Due to the three stage Runge-Kutta integration we use, we store three sets of velocities and mapped space velocity derivatives in memory at any given instant. Before we integrate the velocity into the current time step, we save the velocities from the 73 previous RK step in memory. We have three memory positions indicated by the value of IM2 or IMI. The velocity we use during the simulation is always stored in position 1. If IR UN = 1, the velocities we have used to get our pressure field have been from the previous time step's RK step 3. So, at this time we store the velocities and derivatives in position 3. We store the other variables in a similar way, if IRUN = 2 we store the velocities and derivatives in position 2. If we are actually on the final RK step, we store the velocities and derivatives in position 1. Integrate velocity via RK integration We integrate the velocity field forward in time via RK integration. We follow the RK integration scheme outlined in [6]. Using the modified form of F from (2.126), we integrate the velocity by U(I,J,K) U(I,J,K) +- to get us to the first RK stage. To get us to the second RK stage we use U(IJK) = ( U(I,J,K)+ -2) The important final integration to the next time step is given by -.{n+l} (I,J,K -4{n} IJK) K + 3 11} (I,JK) _, n} (I,J,K) + 3Ar ( (2.133) The superscripts all correspond to the RK step or time step at which these quantities are calculated or stored. Velocity Modification We reset the boundary velocities at the inflow as we did when the velocity filed was originally set up. The free surface velocity quantities are then smoothed by the same method that the free surface grid locations were smoothed when the kinematic free-surface boundary condition was applied. 74 Courant Condition There are some fairly strict stability criterion which must be met in order for our time integration to keep giving us a stable solution. The courant condition can be viewed as a condition that restricts the distance at which flow particles move in one time step to one cell size or smaller, so that no information is lost in the course of the time integration. We compare the theoretically predicted maximum time step allowed by the courant codition, ATCourant = 1 Vm maL7Xmn with our current time step. As long as AT < + AYmin ATCourant Wa. (2.134) AZmzn we proceed with the simulation without changing our time step, otherwise we reduce our timestep to 80% of the value of the Courant predicted value. The courant condition is only checked at the very end of a time step, not at the end of each RK step. Write restart data files We check and see if we have completed the desired number of time steps, NT. If we have not completed them we continue the simulation process until we do. If we have completed the desired number of time steps, we output a file which nay be read to continue the simulation at a future time. 2.4 Associated Programs and Tools We have a variety of pre-processing and post-processing tools which help make SHIPLES easier to use and the data it outputs easier to analyze. The use of them is described here along with their purpose. 75 . - . ...... ... . ..... ........ ............ . .... ..... Y=Y +Y, Y=Y. Y=o Figure 2-5: Faired Hull with Original Hull 2.4.1 Pre-Processing Programs newbase The first pre-processing program we use is a program called newbase. This program reads in a set of ship offsets, fairs the ship to remove the transom stern, and outputs the new outputs to a file sutiable to be read by SHIPLES. We have a table of offsets for the DDG-51 hull shape. This data was obtained from the David Taylor Model Basin [13]. The only other inputs we need are two lengths. These are stored in the file fort. 10. The two lengths are y, and yf, the natural and faired length, respectively. The natural length is defined as the length in drafts from the forward perpendicular to the point at which the faired portion of the ship meets the natural portion. The faired length is the length in drafts of the faired portion of the ship geometry. Figure 2-5 gives a top down perspective of the faired hull shape. On the left is the full ship model and on the right is shown a faired hull with y,, = 10 and yf = 17. The program begins by reading the original ship hull position information from file 76 and scaling it by the draft for consistent use with SHIPLES. We store all the original locations in arrays of size NYB x NZB. Our first task is to find the offset value XN(J,K) for all Z(J,K) at y y,. We do this by using the search routine described in § 4.2.2 on the original ship to find XN (y, z) at the junction of the natural ship with the faired ship. All points that belong to the natural region of the new data set are unchanged from their positions in the original data set. The points beyond the faired region are given an offset value of zero. We choose our current fairing based on two requirements. First, we want the faired region to have a smooth connection with the natural region. Second, we want the faired form to go to zero in a fashion which keeps flow separation in the faired region from affecting the flow at the bow of the ship. We do this by choosing a fairing of form X(J,K) = aXN(J,K) sin K4, where (2.135) is a non-dimensional length of value one at y = y, and zero at y = yn + Yf. We prescribe the values of a and 0 such that X(J*,K) dX dY (J*,K) = _ XN(K), dX dY (JK)' (2.137) where Y(J*,K) - yn. The faired hull is then output to a data file which is used by SHIPLES and the initial grid generation routine. les-input les-input is used to generate all necessary input files for SHIPLES. We have already generated the file which includes hull geometry information used by SHIPLES. With our input code, we generate an initial grid and information about which points are initially on and off the body. Thisdata is stored in the files fort.98 and fort. 99. 77 The procedure is very similar to that used in the grid generation process followed in SHIPLES. The main difference is that we do not have an initial guess prior to beginning. For our initial guess, we use the same clustering information needed for SHIPLES to create an algebraic grid. The details of the clustering will not be repeated here. We set all points in the flow initially according to the algebraic clustering flags we use and send these points as an initial guess to the grid solver and solve to a given tolerance. The solved grid is output to fort.99 while the IBOD data is output to the file fort. 98. As an additional piece of information, we output an estimate for the largest time step we can safely use according the courant condition for the initial solved grid. 2.4.2 Post-Processing Programs The output files for SHIPLES can be quite large. The input/output (I/O) operations can take a long time, so we save time by allowing the user to specify that unformatted output be written. This saves time and disk space. We use a pair of post processing tools to help in data analysis. The first serves mainly as a data extractor, it will read in unformatted output and extract the specified output into ASCII files with Tecplot headers. The second program reads in data and performs time averaging, interpolation, and turbulence calculations on the data as specified. Ship Analysis The ship analysis program, shipanal, is designed to operate directly on the unformatted or formatted data files output by SHIPLES. The primary tasks of this program are to translate unformatted data files into formatted ones and to extract data from the main data file. The program is designed modularly and the various modules may be turned on or off by a control file, fort. 12. The control file will be described in detail so that future users may quickly pick it up and begin to use it. The very first line of the control file is the value of a logical variable in the program, FORMT. When FORMT is . TR UE., the input data 78 is formatted, otherwise the data is unformatted. The remaining logical variables each correspond to a module of the analysis which will be run if the value is . TRUE. or skipped if it is .FALSE. The second line of the contorl file is the logical variable, WATER. If the module is turned on, information defining which file to operate on must follow in the input file. The first additional line is one integer which is the number of files this module will be run on. There is one additional line for each file to be run on. Each of these lines has two values. The first is a character expression which is the name of the input file in quotes,' 'f ilename''. The second is an integer value which will be either seven or eight. If the value is seven, the file to be read in has seven variables. If it is eight there are eight variables in the input file. This module extracts the waterline from the specified input data file into a formatted data file with Tecplot headers. The waterline is the position information for all points such that I =1 and K = NZ. The next module extracts computational planes of data from the input data file. The logical variable for this module is SLICE. If the module is on, the following line is once again an integer representing the number of files to be processed. For each file, we have several lines following in the control file. The next three lines each have one integer, the first for the number of slices of constant I index, followed by the same for J and K, respectively. Then we follow these integers by the values of I, J, and K defining which planes to extract. The following example begins with SLICE in the control file. TRUE. 1 "fort. 92. 1" 7 1 2 0 12 23 34 79 This particular set of values in the input file will read in data from the seven variable data file f ort .92. 1 and output formatted files for the slices of constant index, I = 12, J = 23, and J = 34. The next module calculates wall and free-surface vorticity in normal and tangential components and outputs the results to two data files with Tecplot headers. The logical variable for this module is VORT. If this module is on, the next line of the control file contains the number of files to be processed. The following lines are simply the names of the files to be processed without an integer indicating how many variables are in the file, since the vorticity data is always stored in an eight variable data file. The next module is a data extraction module which will extract all volume data written between two different time values and output it to a formatted ASCII data file with Tecplot headers. The logical variable for this module is TIMECHUNK. If this module is on, the control file must contain a line with an integer indicating the number of files to be processed. For each file to be processed, we have two lines in the control files. The first line is the standard file name with integer indicating the number of variables. The second line has two real values, the first is the lower time bound and the second is the upper time bound. The final module in the code also extracts specified data. The logical variable for this module is SLB. If this module is on, we have an integer on the next line representing the number of files to be processed. There are two lines for each file following the number of files line. The first line is the standard file name with integer indicating the number of variables in the file. The next line has six integers which define a rectangular slab of data in computationl space. The integers are the lower index bound for I followed by the upper index bound for I followed by the corresponding pairs for J and K, respectively. The purpose of this program is to extract useful data from very large and difficult to work with data files that are output by SHIPLES. We often want to look at time average values and turbulence fluctuations. We typically perform these calculations on extracted slices of data for quicker calculation. These calculations are performed with another program that performs these operations on data extracted from SHIPLES 80 output files by use of shipanal. Average Ship Analysis The program avganal is used to perform time averaging of various quantities and calculate various turbulent quantities. We use a modular design with modules turned on and off by means of logical variables in a control file. The program is designed to easily allow module addition for future analyses. The first module is an average waterline calculator. The logical variable for this module is WATER. If the module is used, then the following line is an intger indicating the number of files the avergaing is to be performed on. For each file, there is one additional line in the control file. The additional line contains three components: the name of a waterline data file output by shipanal followed by a lower time bound and an upper time bound over which the averaging is to performed. We output two data files for each processed file. The first file contains the average waterline data, while the second data file contains the time history of the maximum wave height and its location along the ship. The next module calculates the average values of quantities in a given file and outputs them to another file. Several other quantities may be output to data files as well, depending on the values of the four logical variables on the next four lines of the control file. They occur in the following order: AVGS, RMSS, REYNOLDS, and PRIMES. All four logical variables are read. Processing of any type only begins if A VGS = .TR UE.. If this module is on, we have an integer on the line following the fourth logical variable indicating the number of files to be processed. For each file that we are processing, we include two additional lines. The first of which contains three components. The first two are the standard file identifiers, and the final one is an integer which indicated what kind of plane is contained in the data file. If the value is 1, the index I is constant; if it is 2, J, and if it is 3, then K is the constant index. The second line contains the lower and upper bounds for the time over which the average is to be taken. The time average of all quantities in the data file are taken over the time range 81 indicated in the control file, and output to another file. If RMSS = . TRUE., we begin more calculations. To discuss this properly we make the following definitions. The time avergae of a qunatity f is given by f. We then define the instanteous difference of a quantity with the average quantity at the same location to be f' then define the RMS of the qunatity f to be f = f' 2 . If RMSS f - f. We = . TRUE., we ouput the RMS values of the flow quantities at the average position locations. If REYNOLDS = . TRUE., we additionally output the cross term Reynolds stresses, ri=u ui'u' at the average locations. Additionally, if PRIMES =.TRUE., we output the instantaneous difference of the various quantities from their mean quantites at their instantaneous locations. The final module calculates kinetic energy and turbulent kinetic energy at a large number of locations. This module is turned on by the flag TKE. If this module is on, we require a line indicating the number of files to process and two additional lines for each file, which are identical in their form to the lines used for the previous module. We output the instantaneous kinetic energy, KE TKE = ui'ui' at each point in the flow field. 82 = uui, and turbulent kinetic energy, Chapter 3 Performance & Efficiency The computational effort required to run SHIPLES is quite large. It is largely driven by the effort required to solve the pressure at each RK step. The computational effort required to solve problems of physical interest is not realizable without the help of high performance computing techniques. To best understand how to more efficiently run the program, we aim to fully understand the performance characteristics of the code. There are many different ways to measure the performance of a code. In this chapter, we discuss the ways in which we measure the code's performance and demonstrate the effects parallel processing of the code has had on our ability to use the code for larger and more difficult problems. 3.1 Parallel Processing We have chosen to develop the code for high performance computer on large distributed memory parallel platforms. Parallel platforms allow the program to use the power of several processors to divide and conquer a problem. A distributed memory parallel platform is one where each processor has its own memory. We divide the problem by sending blocks of data to each processor, where each processor performs the necessary manipulations to its own data block concurrently with the other processors. 83 For SHIPLES, we break the data into volumetric blocks of data. Due to the presence of two ghost cells at each of the outer boundaries of our fluid volume for boundary conditions, we must divide the computational volume of size [(NX + 4) x (NY + 4) x (NZ + 4)] among the processors we are using for our simulation. Finite difference calculations involve the solution of equations involving data which is typically stored local to each processor. These calculations are taken care of very efficiently by parallel processing. The nature of a finite difference code prevents this from always being the case. We must specifically allow cross processor communication to calculate derivatives across the data block boundaries. These calculations are not performed as effectively as onprocessor calculations, but we show that we achieve an overall benefit from processing SHIPLES in parallel. We parallelize the code by decomposing the data that is solved throughout the domain into several different regions. The current version of SHIPLES breaks the domain into several equal sized blocks of size NX x NY x NZB, where NZB is an integral factor of the total number of constant K data planes, NZ+4. For a case where NZ = 20, we may run the program on 1, 2, 3, 4, 6, 8, 12, or 24 processors. Calling each data plane of constant K a slice, we set the minimum number of slices per processor at three, so that at least the standard derivative formula used may be contained completely on the processor for one of the on processor slices. This restriction means that we would not run a case with NZ = 20 on 12 or 24 processors. We parallelize the code using, xhpf, a program provided by Advanced Parallel Research, Inc. We write the code in standard fortran 77 and include comments in the code that tell the program how the data should be distributed, which data loops to parallelize, where to allow inter-processor communication, and where inter-processor communication should not be needed. The program generates a new source code suitable for compilation on a parallel compiler. We use mpi extrinsics to parallelize the grid and pressure solvers. This allows more user control over how the parallelization of these solvers actually takes place. We have developed a unique way of solving for the pressure and the grid in parallel. 84 3.2 Speed In order to predict how long it will take to run the code on a given machine, we must have accurate measurements of the time required to run the code. We accomplish this by using system calls. Speed testing also enables us to quantify the benefit gained by processing the code in parallel. Speed testing was performed for two cases, the first case being a coarse (20 x 80 x 20) case used for fast evaluation of a given set of parameters. The second case being a more realiatic case (50 x 200 x 50) from which many of the results presented in this paper were developed with. We perform the testing by placing system calls just before and just after the call to each subroutine in the code. We took the difference between the two calls and added it to the running time total for the particular subroutine. Upon completion of the run, we divided each of the totals by the number of time steps taken in the code, and called each time the time per iteration for the particular subroutine. We ran the test on a varying number of processors ranging from one to the number that would reach our minimum value of slices per processor. There is a certain amount of computational overhead involved in the use of the parallel version of the code. To measure this overhead, we performed the same test cases using the serial version of the code on one processor. All tests were performed on an IBM SP P3 with 132 nodes containing 4 processors each. Each of the processors is an IBM RS/6000 Power3-II operating at 375 Mhz with a peak floating point rate of 1.5 Gflops. Each processor has 1 Gb of onboard memory. The testing times reported are the sum of the total times for each processor minus the time taken at initialization, conclusion, and data output. Not including these components in the timing gives a better comparison since each of these items are not done at each time step, so we are actually comparing the time required to complete all calculations per time step. We report three measures of speed up, E, E, and E. El is the ideal linear speed up. Ideally, we expect a code to run 16 times fasster on 16 processors than it would on one processor. E is the ratio of the time required to run on a given number of processors to the time required to run the same code on 85 10 20x80x20 Speed Up Tests 8 6 - 4 - 2- 0 0 I I I 2 i 4 I i i NODES I 6 i I 8 i i I 10 Figure 3-1: 20 x 80 x 20 Speed Up Testing 1 processor. E, is the optimal speed up, which is defined as the ratio of the time required to run on a given number of processors to the time required to run the serial version of the code on one processor. This number is the realistic number to use since it compares the difference a user actually sees going from a serial version to a parallel version of the code. Figures 3-1 and 3-2 report the results of the speed up testing for the parallel version of the code. The figures show pretty good results for the parralelization of the code. For the smaller test case, we see the best speed up figures giving E = 4.6 and E, = 3.5 on 8 processors. We show super-linear (better than linear ideal) speed up for the smaller case on 2 processors. The parallel efficiency (I), decreases greatly for the increasing number of processors. For the larger test case, we see much closer to linear ideal speed up for a larger 86 20 50x200x50 Speed Up Tests 18 16 14 -E)- 0 12 *A 10 8 6 4 2 0C 5 10 15 NODES I 20 Figure 3-2: 50 x 200 x 50 Speed Up Testing number of processors. After we use nine or more processors, we see a decrase in the efficiency due to the increased amount of inter-processor communication required, yet we still see a peak speed up on 18 processors of E = 13.0 and E, = 8.1. The trend shows that the parallel code performs more efficiently for larger problems and that we can expect to see significantly faster run times by using the parallel code as compared to the serial version. 3.3 Memory Usage Due to the nature of distributed memory parallel computing, we may take advantage of parallel processing to look at problems that would be too large to be processed on one single machine. The total amount of memory required increases with the 87 200 175 - E--MEM/PROC A MEM - 150 125100 -0 ES75 5025 - I 0 I I I 2 I i i I 4 I i 6 Processors i i I i i 8 I 10 Figure 3-3: Memory Usage for 20 x 80 x 20 case number of processors used, but the memory per processor has a decrasing trend with increasing number of processors. For the same two cases for which timing tests were performed, we found the amount of memory being used on the first processor for the particular case. Since most of the data is distributed throughout the entire vertical extent, this is a good reference value for the average amount of memory used per processor. The majority of the data in the code are stored in arrays of size (NX + 4) x (NY + 4) x (NZ + 4) and the total memory needed by the code is nearly directly proportional to this value. The 50 x 200 x 50 case that was studied is at the limit of the problem size which may be stored on one processor. We certainly have the desire to run the code on problems as large as we possibly can, and only parallel processing will enable us to do this for problems larger than this size. 88 1500 -E- MEM/PROC 1400 -A MEM 1300 1200 1100 1000 300 200 700 )600 500 400300 200100- 0 2 4 6 8 10 12 14 16 18 20 Processors Figure 3-4: Memory Usage for 50 x 200 x 50 case The memory usage of the parallel code is shown in Figures 3-3 and 3-4. The similarities between the two cases are quite evident. We expect a sharp decerease in the amount of memory per processor as the number of processors incrases, while the total amount of memory usage increases slightly as the number of processors is increased. The amount of memory required by the serial version is represented as the memory at zero processors in the two figures. The amount of extra memory required by the parallel version of the code may be clearly seen by comparing the amount of memory for zero processors and for one processor. The code's capabilities have been greatly increased by the move to parallel computing, and by several of the critical code changes discussed in Chapter 4. These improvements to the code have lead to a more efficient parallelization of the code and to a faster code speed. As an extreme example of the improvement in code capability, 89 we once parallelized the code by giving each processor one slice of data. The extra communication done by this forced the parallel routine on 24 processors to run at speeds on the same order of magnitue as the serial code. A 20 x 80 x 20 job would take 436.56 seconds to complete one time step. In contrast the same problem run on eight processors with the latest version of the code can now be run at 11.15 seconds per time step. The improvements in the efficiency and parallelizability of the code make it much more usable as a tool to calculate LES past complex geometries. 90 Chapter 4 Contributions to SHIPLES development This chapter documents the major theoretical contributions which have been made to SHIPLES since the code was presented in IMAS [6]. They are divided into two primary sections, the first section includes the theoretical contributions to the development of SHIPLES. The second presents contributions which have greatly enhanced the efficiency and parallelizability of the code as demonstrated in chapter 3. There have been many contributions and developments and only the most significant are described. 4.1 4.1.1 Theoretical Contributions Free-Surface Stress Boundary Condition Treatment The purpose of this modification was to correct a weak implementation of the freesurface stress boundary conditions in the SHIPLES code. It was determined that the root of the significant mass conservation problem was a poor treatment of the stress conditions. 91 Free-Surface Stress Boundary Condition There are two free-surface stress conditions, kinematic and dynamic. The kinematic condition, that the free surface is a material surface, is treated by the Lagrangian free-surface points. All points on the free surface will remain on the free surface after integration. The dynamic condition deals with the stress on the free surface. The normal stresses on the free surface prescribe what the pressure on the free surface is. This provides a Dirichlet condition in the pressure solver used in SHIPLES. The only free-surface stress boundary condition not treated exactly in the original SHIPLES version was that of the tangential shear stress condition. This condition states that, in the absence of surfactants, that the free surface has zero tangential stress. The stress tensor, T is defined as the following for a Newtonian viscous fluid R where fx e -PRe + 2u. (vX + uY) (uZ + wX) (vX + uy) -PRe + 2vy (vZ + wY) (uZ + wX) (vZ + wY) -PRe + 2wz is shorthand notation for the partial derivative of f with (4.1) respect to x. The first tangential shear stress equation is given by: { 1} ['r] {n}T {t 2} [T] {n}j 0 = 0 (4.2) Tj ] (4.3) (4.2) expanded becomes h - (i2 f2 - Weak Treatment of Tangential Shear Stress Condition In the original treatment of the tangential shear stress condition, the metrics for the normal and tangential vector components were substituted into (4.3). The continuity 92 equation V - i' = 0 was employed to simplify the equation somewhat. The resulting equations are given in Imas [6], but are repeated here because they will be used in the exact solution in the following section. S1 u. + S2 uy + S3 uz + S4 vx + S5 vy + s6 vz + s7 w + S8 wy = 0 S11 ux + S12 uY + S13 uz + S14 vx + S15 vy + S16 vz + S17 wx + S18 wy = 0 (4.4) (4.5) In (4.4) and (4.5), the coefficients si - S1 8 are exactly the same as Imas [6] barring one typographical error in term s1l. This error only appears in the thesis and was not translated into the original version of SHIPLES. S1l = -2z y.,x, + 4z.yzX., - 2ynxgxn (4.6) Also note that in (4.4) and (4.5), there is no term multiplying wz. That is because the continuity condition, wz = - (uX + vy) is used to remove it. In the original weak treatment of the tangential free-surface stress boundary conditions, (4.4) and (4.5) were mapped into computational space and iteratively solved for u( and v( with w( coming from the mapped continuity equation. The result was an initial slow gain of mass through a simulation which then became slightly parabolic in appearance before other factors entered and stopped the simulation. Exact Solution of Free-Surface Tangential Stress Condition The exact solution of the free-surface tangential stress condition picks up almost where the original weak treatment left off with (4.4) and (4.5). In the mapped domain, three terms are needed to determine the ghost values at the free-surface and enforce the boundary condition: u(, v(, w(. Only two equations are currently available. Therefore, continuity will be used as the third equation to ensure that the ghost values chosen do not violate it. Mapping these equations into the computational 93 domain yields Dl u + D2 u, + D3 u( + D4 v + D5 v2 + D6 v( + D7 wg + D8 w, + D9 w DlIIU = 0 (4.7) D±2U fDl3U fD14VfDl5V7+Dl6V +Dl7WfDl8W, +Dl9wc = 0 (4.8) D21 U+D22 Ug+D23 U+D24V +D25 Vn+D26 V+D27 W+D28W = 0 (4.9) The values for the twenty-seven coefficients are given in Table 4.1. There is now a system of three equations which can be solved for the three unknowns: D3 D6 D9 U1 R1 D13 D16 D19 V( R2 D23 D26 D29 (4.10) R3 where RI - R2 = R3 -(DlU+D2un+D4v +D5v,+D7w +D8w.) - (D11 U + D12 u. + D14 v + D15 v, + D17 w + D18 - (D21 u + D22 u, + D24 vg + D25 v. w,) + D27 W + D28 W7) (4.11) This system of equations is solved by inverting 4.10 and gives the exact solution for u(, v( and w( which satisfy continuity and the free-surface tangential stress condition. The solution is as follows: [(D16 D29 - D19 D26)R1 + (D9 D26 - D6 D29)R2 + (D6 D19 - D9 D16)R3] det A S= [(D19 D23 - D13 D29)R1 + (D3 D29 - D9 D23)R2 + (D9 D13 - D3 D19)R3] det A [(D13 D26 - D16 D23 )R1 + (D6 D23 - D3 D26 )R2 + (D3 D16 - D6 D13)R34 det A 14.12) where det A = D3 (D16 D29 -D19 D26 )+D13 (D9 D26 -D6 D29 )+D23 (D6 D19- D9 D16) 94 (4.13) D1 D2 D3 D4 Sl x + S1 %j+ S1 (x + s4 x + S2y + S3 z S2 77y + s3 Tz S2 (y + S3 (z S5 y + S6 z Dl D12 D13 D5 D6 D7 s4 77x S4 (x S7 S7 ijx S7 (x s5 77y + s6 77z S5 (y + S6 (z S8 y S8 T/y S8 (y D8 D9 + + + + + D21 D22 D23 qx D14 + S13 z + S13 uz + S13 (z S14 Q + S15 y + S16 z D24 y D15 D16 D17 S14 r/±+ S15 r/y + S16qz S14 (x + S15 (y + S16 (z S17 x + S18 y D25 D26 D27 rTy D18 S17 Ti D28 D19 S17 (x + S18 (y r/z (z S11 x + S12 y S11n Tj + S12% S11 (x + S12 y + s18 71y D29 x (x (y z Table 4.1: D coefficients Finally, with solutions for the ( derivatives found, the ghost points above the free surface in mapped space are found by an extrapolation of the finite difference stencil. f(i,j,nz+l) = f(i,j,nz-) + 2A(f( 4.1.2 (4.14) Dirichlet Free-Surface Pressure Boundary Condition Imas [6] states in the derivation of the dynamic free-surface boundary conditions, that the effect of surface tension as one passes through the interface is to produce a discontinuity in the normal stress proportional to the mean curvature of the boundary surface. This is mathematically stated as fi~u h [(-] hT = 1 1 I(I+ We R1 1) I). (4.15) R2 h is the unit normal vector to the free surface, n = nrt + nyj+ nzk 95 . (4.16) where JT denotes the transpose of a unit vector, i). [r], the stress tensor, is defined by T -a - pei, I ... 3,j = I...3, where Oij Re --O Oxj Oxi (4.17) ) (4.18) , p is the dynamic pressure, and 6ij is the Kroenecker delta. We is the Weber number defined by We = PU 2 L (4.19) where o-* is the surface tension between air and water. R1 and R 2 are the principal radii of curvature of the free surface at a given point. Imas [6] reported that the Dirichlet pressure boundary condition may be found by equation 2.23, repeated here as (4.20). P= 1 (n) 2 2_ Re (nz 2 _ Ow OU ( (Ov Ou\ + +(nny) + + Oz Ox OX Qy 2 1 .. On Ow'1' (nxn2 ) (u+ aw] Oz ±Ox 1 (1 i Ri+ We 1 1\ I)+ R2 Zf Zf 2 . Fr (4.20) There are two errors in this expression of the Dirichlet pressure boundary condition at the free surface. The first was simply a typographical error that was correct in all versions of the code, but the second error, which arose from a minor mathematical error, was in his paper and all three aforementioned computer codes. The correct derivation of the Dirichlet pressure boundary condition at the free surface is shown. First we calculate the left hand side of (4.15). Define A = [o] T, 7 96 by T11-p T 12 T13 T2 1 T2 2 p - T2 3 nx (T 11 nx T12 T31 nx T 32 ny T3 3 - 1= nz -P p) + nyT21 + nzT3l + ny (T 2 2 - (4.21) p) + nzT32 nxT13 + nyT2 3 + nz (7 3 3 - p) Therefore, i [a] hT A- = - = R n[ 2 zu + ny vY + nz 2 w +nny (uY + vX) + nynz (vz + wY) +nrnz (uz + wX)] 1 (4.22) 2 The omission of term 2 of (4.22) was the typographical error in Imas [6]. The error that existed in both Imas [6] and SHIPLES comes from the expression of term 1. By applying continuity one finds that term 1 may be written in the following manner, nx2 ux + ny v + nz2wz = (nx2 _ ny2) UX + (nz2 _ ny2) Wz (4.23) Imas [6] incorrectly expressed this term as nx2,u + ny2 vY + nTz w= (4.24) (nz2 _ ny2) (wz + ux) By replacing (4.24) with (4.23), the correct Dirichlet pressure boundary condition is found by 2 Re (nx2 L y2) _ 1 + (n2 _ n2) 2 97 w +nxn YO + (y av ax B ___ njnz ax ___v + az) + nynz + (z ay 11 We __ + R1 + R2 __z I Fr2- (4.25) 3 Directly comparing the original boundary condition from (4.20) with (4.25) the errors may be seen. The typographical error was the omission of term 3 of (4.25) from (4.20). The mathematical error was the incorrect combination of two terms (terms 1 and 2 of (4.25)) into term 1 of (4.20). 4.2 Computational Contributions The computational expense of performing LES past a complicated gemoetry is quite large. In order to perform these simulations it is important to perform the calculations as efficiently as possible. We present some of the major contributions to the computational efficiency of the code which have made the use of these simulations much more realistic. 4.2.1 Dynamic Successive Overrelaxation (SOR) parameter calculation Following the discussion of SOR methods in Numerical Recipes [12], we see that the ideal overrelaxation parameter, w, can be found by, 2 1 - PJacobi 1+ (4.26) if the spectral radius of the Jacobi iteration, PJacobi, is known. The spectral radius for a 2D poisson equation with homogeneous Dirichlet or Neumann boundary conditions, from [12], is + (AX)2 COS 7 cos Pacobi _ NX Ay c NY (4.27) - + (AX ) 98 Currently both our pressure grid solvers are poisson solvers. We make a seemingly ad hoc extension of (4.27) into three dimensions. The lowest pJacobi of three similar two dimensional problems are calculated and used as the spectral radius to calculate the overrelaxation factor. We outline a method by which we make a continually better estimate of the optimal overrelazation factor which increases solution speed of the pressure and grid solvers greatly by decreasing the total number of iteartions needed to solve them. Strang [18], in §5.3 of his book, defines the spectral radius as the largest eigenvalue of the matrix B, where B = M-' (M - A). In the case of Jacobi iteration, A is the matrix of the problem you are trying to solve and M is the diagonal of that matrix. The SOR method implies a slightly different B than does the Jacobi scheme mentioned. We can call this matrix BSOR. The largest eigenvalue of this matrix controls the rate of convergence of the SOR method. The largest eigenvalue of BsOR is given by PSOR - wopt-1., where 2(1 wopt = 1 2 - pJacobi) .o(4.28) PJacobi It can be shown quite readily that (4.26) and (4.28) are equivalent expressions and that the trick is still to solve for or estimate PJacobi. For simple problems, this value may be solved for directly. Since we solve this problem on a moving grid, the coefficients which make up the pressure and grid solver matrices are time dependent. For each instant in time, there is a single optimum value of wot. Since the grid can only deform by a finite amount in one time step, the coefficients which make up the matrix can only change by a finite amount. We assume that these only change the value of wo0 t by a small amount as well. Performing a convergence test on the initial grid and pressure solvers we can find the true value of w0 pt for the grid and pressure solvers at the first time step. Figure 4-1 shows the results of this test. In figure 4-1, N. and Np are the number of iterations until convergence of the grid and pressure solvers using their respective values of w. By performing this kind of test, we discover the optimum value of w. This optimum 99 II~~~~~~~~~ l~~l~l I~UDUU 5000, .. .1111 .......... =1.79 OOPt for grid co for pressure =1.835 co sed with CON=0.97 =1.5545 co predicted for CON=1= 1.7295 -N o9/Ngl=1.915 N I9 /NP,=1.514 300 250 4000 I 200 3000 -s-- C- z 150Z 2000 100 0 N Ng - 1000 1 '' I 1.2 ' 50 ' I 1.4 I 1 , 1.6 ! ! ! I 1.8 (0 Figure 4-1: Iterations to Convergence with Respect to Overrelaxation Factor 100 value occurs in the trough of the curve, where dN 0. (4.29) Experience gives that N(w), is always concave up. Therefore, we can determine which side of the optimum w we are on if we know the sign of 1. We can use the scheme described in § 2.3.1 to give a conservative starting value for W. We perturb W over the course of a time step and record the resulting change in the number of iterations to convergence. Thus we calculate w for the next time step, if d d. if dNjj > 0, then we know we must decrease > 0, we must increase w in order to achieve better convergence. One must be careful to not push the value of w too large during one time step, since there is a very large penalty to be paid in iteration count for having too large a vlaue of w as can be seem in figure 4-1. We find, in practice, that the number of iterations to convergence of the pressure solver compared to running without the dynamic SOR parameter calculation is cut in approximately half. These savings greatly enhance the simulation capability and speed of SHIPLES. Occasionally the method does choose an w which is larger than the optimal and requires a large number of iterations to convergence occur. Safeguards are in place to reduce Iomega automatically if the solver coverges much more slowly than it did on the last timestep. These occurnces are rare enough that they are outweighed by the savings of the method. 4.2.2 Treatment of Body Geometry Improved interpolation and body definition Another factor we must accounted for is the need to redefine the value of points on the I -= 1 plane as they move up and down the body when the free surface moves. We solve directly for the free surface motion and place seed points (Y, Z) according to the type of clustering being used for the particlar run. The Y distribution is kept constant with respect to time, but the Z distribution changes at each time step. Given a coordinate pair (Y, Z) on the I = 101 1 plane we need to know two pieces of information. 1. Is the given point, (Y, Z) on the body or off the body? 2. If it is on the body, what is the offset X at that location? The treatment of the body geometry has been greatly improved in the code. Imas used a base grid created from the program SHIPGRID created by Joe Curran [3]. This base grid served the purpose of taking an ordered, but unevenly spaced ship data set, fairing the end of the hull and using interpolation to find the offset value X as a function of an evenly spaced ordered set of (Y, Z) points. Imas used this data set to determine the offset value of a point and used a complicated search routine to find whether or not a point was on or off the body. The first update in the way the body geometry used the following procedure to eliminate some unnecessary searching which was done finding the interpolated value of the offset. The searching was not necessary in order to find out where a point was since it was based on an evenly distributed data set. An improvement in the order of the interpolation being performed was also achieved. Previously a linear interpolation was being performed in one direction only. A full bi-linear interpolation was used to improve the accuracy of the interpolated offset value. Finally, a much quicker way to determine whether a given point was on or off the body was devised. The manner in which the interpolation is performed has been revamped. The 0th order in y and linear in z interpolation (o-l) that was in the code has been replaced by a fully bi-linear interpolation (I - 1). This manner of calculating the value of X(Y, Z) on the I = 1 plane is more accurate than the previous method. By taking advantage of the fact that the master data set (formerly fort.14) was an evenly distributed data set on the Y - Z plane, the table searching that was performed was eliminated and storage requirements were reduced. For more information on interpolation methods see Numerical Recipes [12]. The code used a searching method to determine whther a given point was on or off of the body. An integer value of 1 is stored in an array, IBOD, for (J,K) points on the body and a value of 0 is stored for those off of the body. A stand alone program was 102 written that takes the standard fort.14 file and determines the value of four discrete functions zl(jb), z2(jb), z3(jb), z4(jb). jb is the index describing the points in the Y direction on the body data set. A given field point (Y, Z) on the I = 1 data plane is closer to a certain value of jb than any other value of jb. The z1 - z4 functions define the points that are the intersection between the body and the water surrounding it. If there were not a bulb on the ship we would only need a function defining the top, z4, and the bottom, z1, of the ship. Figure 4-2 shows the functions z1 - z4. Any point on the I =1 plane may be found to be on or off the ship by evaluating the following expression, zon = (Z - zl)(Z - z2)(Z - z3)(Z - z4) (4.30) If zon < 0 then the point is on the body, otherwise it is off of the body. This method has proved to be more accurate at determining whether a point is on or off the body than the previous method. This method has increased the speed at which this section of code could be run by a factor of at least 103. Furthermore, the method is now fully parallelizable and the previous method was not, allowing for more complete parallelization of SHIPLES, which lead to greater parallel speed up. Next generation of improvements The method mentioned above in § 4.2.2 worked fine given the data set created by the program SHIPGRID or any other data set created by SHIPGRID, but there were some fundamental problems with this. By taking the base ordered, but unevenly spaced, data set and turning it into an evenly spaced one, some of the areas which had the clustering necessary to define them lost that clustering in the re-spacing part. It was also found that the Bezier curve fairing employed by SHIPGRID was hard to control and generally produced stern shapes which had inflection points which caused a large separation region which had the potential to influence the results that we obtained at the bow of the ship. The goal was then set to come up with a new fairing routine 103 . ......... 5 4 * Z1 * Z2 * * Z3 Z4 3 N 2 1 0 -1 0 1 2 3 4 5 6 y Figure 4-2: The functions zl - -z4 defining the body boundaries at each station 104 and a method to interpolate directly from a data set which is ordered but unevenly spaced. 105 Chapter 5 Validation of Method We validate the performance of SHIPLES by comparing our results with avaialable experimental data sets. By validating our method against experimental data, we show its ability to calculate data values. The suuccessful comparison gives us the confidence we need to use the method to study the flow past other complicated gemoetries. Unsuccessful comparisons, of course, show where work may be put into the method or the use of the mehtod to further improve its simualtion capabilities. We use experimental data on two different models of the DDG-51 hull shape. The majority of our data, including free surface elevation and velocity field data, has been obtained from experiments performed on the Italian ship model C2340. The experiments done on this hull are described in [1]. We also have wave profile results for the model 5415 at the David Taylor Model Basin [13]. They gather free-surface elevation measurements by use of a whisker probe array. The free-surface elevation data was taken along four lines of constant x. The data, shown in figure 5-1, is taken for approximately one ship length in front of the bow back to a point about 4 ship lengths behind the stern. The image on the left is a contour plot of the measured free-surface elevation, while the image on the right shows the location of the data measurements and the approximate distance, x, from the ship centerline. Their average velocity field data was found by a repeated series of tests with a 5 hole pitot tube mounted on a dynamic positioning system. The pitot tube measure106 Z/D;Z 0.15 0.13 0.11 0.09 0.07 0.05 0.03 0.01 -0.01 -0.03 II 8 ~6 ~4 =2 -0.05 -0.07 -0.09 -0.11 -0.13 -0.15 Figure 5-1: Experimental Whisker Probe Free-Surface Elevation Data 107 120 110 100 90 15 - C C C 80 70 10 60 50 C C C C C C C 5 40 30 20 0 10 0 C -10 -5 -20 -20 0 20 0 5 i 10 i 15 Figure 5-2: Domain Boundaries showing extent of free surface modeled ments were taken in a grid of (X, Z) locations for several stations along the hull. We show comparisons to two SHIPLES data sets. The first we name our medium resolution data set. It is on a domain of length 25.6, width 6.4, and depth 3.125. This set is run with the wall function and a grid of 50 x 200 x 50. The higher resolution data set is run on the same size computational grid with a much smaller domain size. The high reolution data set has a length of 10, width 2.5, and depth 3.125. Each case was run with the wall function and grid correction on and Smagorinsky coefficients of 0.1 and Bardina Coefficients of 1.0. Both runs were run at an equivalent FrL of 0.28 to compare directly with experimental data. 108 5.1 5.1.1 Free Surface Elevation Comparison Average Free Surface Our computational domain is sized for efficient solutions for flow details in the near bow flow. In this thesis we work with two distinct computational domain sizes for one discretization. The smaller of the two domains gives high reolution data, while the larger of the domains gives a lower resolution data set. Both domains are 50 x 200 x 50 cases. The high resolution data set uses a faired version of the hull with i, = 4 and If = 3.5. The medium resolution data set used a much longer faired version of the ship with i, = 10 and If = 7. The depth of each domain is approximately 3 drafts while the length and width are vastly different. The domain boundaries are shown from a top down perspective in figure 5-2. The boundaries denoted by black squares are the boundaries of the high resolution case. The boundaries denoted by the red triangles are the bpundaies of the lower resolution larger domain case. The boundaries denoted by the blue circles are the boundaries of the experimental free surface data. The experimental average free surface elevation is available along four profile lines of constant x. The data is taken a significant distance fore and aft of the ship. Showing the comparison of our largest simulated domain size, it may readily be seen that it is extremely difficult to compare our computed free surface elevation at these lines due to the proximity of our boundaries to the data that has been taken. The edge effects influence the computed free surface elevation values such that until a larger domain is simulated, free surface elevation data does not make a good source of validation for our computational method. 5.1.2 Waterline Profile The waterline profile is a commonly measured experimental value. The waterline profile is the height of the water along the length of the ship. This measured data is the average position of the contact line, where the ship, the water, and the air all meet. We show that a time average of the computed waterline length shows reasonable 109 ... ..... ....... .... .... ........... .... 0.5 0.25 N 0 DTMB Experiment AVG SHIPLES (T:1.4 < T < 2.4) --- Si -2 i ii iiii -1 ii li 0 I 1 ii iiiii 1 2 1 1 3 I i 4 y Figure 5-3: Comparison of computed average waterline with experimental data 110 comparison to the waterline profile at the bow wave. The shown computed data is average data over the time period 1.4 < T < 2.4. This period was chosen since it is the computed time range which gives the best fit to the experimental data over the length 0.461 < Y < 1.615. The comparison, which is shown in figure 5-3, has an error of 9% in this small region near the bow. The shape and height of the wave profile at the bow (Y = 0) agree quite closely with the experimental data, but the location of the peak is slightly forward of the proper location. The agreement breaks down dramatically for Y > 1.615. This is most likely attributable to effects of the impulsive start which have not compltely dissipated. Averages taken at larger times do not show good comparison most likely due to the effect of the computational boundaries on the flow. We conclude that we are unable to make good comparisons of our waterline with the experimentally avaialble data for a number of reasons. Despite finding a reasonably good fit over a limited region, we dismiss its usefullness, due to its association with the start-up wave. We find that simulations run to longer times begin to behave poorly in comparison to the experimental data due to the effects of the boundaries of the simulation on the overall flow field. To fix this, we must compute the flow for a larger domain of the flow field. 5.1.3 Measures of flow steadiness To most accurately compare to experimental data, we must compare average freesurface elevation and average velocity field data with the available experimental data. To take a meaningful average, we must devise a way to determine what time ranges would be valid for comparison. There is no one set way to do this. We discuss several methods used here, and comment on their strengths and weaknesses. One important measure of the usefullness of a code is its ability to conserve mass. Due to the careful treatment of the free-surface boundary conditions, we show in 54 that the method we use conserves mass very well with respect to time. Earlier versions of the code had a gradual mass increase with time. This problem was fixed by an improved application of the free-surface stress boundary conditions in s 4.1.1. 111 0.0001 7.5E-05 5E-05 2.5E-05 0 0 -2.5E-05 -5E-05 -7.5E-05 -0.0001 I 0 I I I I 2 I I I i 4 I 6 TIME i i I I 8 10 Figure 5-4: Mass Conservation of SHIPLES 112 0.6 0.005 0.55 0.0045 ENSTROPHY DISSIPATION 0.5 0.004 0.45 0.0035 0.4 0.003 0.35 z 0.3 W 0.0025 0.25 0.002 0.2 0.0015 0.15 0.001 0.1 0.0005 0.05 0. 0 2 6 4 8 10 0 TIME Figure 5-5: Volume Average Quantities Versus Time The divergence term quickly approaches a small value after the start up time has been completed. The divergence term is not useful in determining when the code has reached steady state since it quickly converges to a small value. One method used to determine the steadiness of the flow field is to look at volume averaged quantities with respect to time. Examining Turbulent dissipation and the average vorticity magnitude, which we also call the total enstrophy, in the flow field with respect to time, we can easily see the effects of the start up flow. Figure 5-5 shows that the start up flow has pretty much dissipated out by the time the simulation has reached approximately T = 2. These volume averaged quantities show that the simulation reaches a somewhat steady state very quickly. Despite the inherent steadiness in volume averaged quantities past T = 2, the free surface is far from steady at this early time. We show in figure 5-6 that the 113 r--- 1 0.5 0.45 0.75 0.4 0.5 . 0.35 1 0.25 >- 0 ~ 0.3 I.. I I. I 0.25 1 - 0.2 -0.25 0.15 Y(Z) Zmax) -0.5 -0.75 -1 0.1 Experimental Average Z, Experimental Average Y(Z I 0 I I I I I I 5 I 10 I I I ) I - 0.05 I 15 0 T Figure 5-6: Time Fluctuation of Bow Wave Peak Height and Location 114 maximum wave profile height, Zma, and location, Y (Zmax), are unsteady throughout our simulation. These indicate that our flow is not steady in contradiction to what is indicated by the volume averaged quantities. Despite the unsteadiness of the free surface elevation, we note thay magnitude and location of the bow wave peak are close to the experimental data after the start up period has completed. Given a simulation on a larger domain than currently used, we expect that the free surface will reach a steady state showing good comparison with that of the experimental data. 5.2 Average Velocity Field Comparison We show that our numerical method can compute flow quantities in good agreement with available experimental velocity field data. This shows the trustworthiness of the code in producing reliable results for the flow past ships. All shown comparisons are between Large Eddy Simulations performed at MIT with SHIPLES and experimental data collected at INSEAN. These data are compared at four stations along the hull. The first is located just in front of the ship at Y = -0.1209. The second station, j = 2.3067, is located at the aft portion of the bulb. The third station is at while the final station we compare is a bit forward of midships at = = 4.6134, 9.2268. These stations were chosen since they are the stations of data available from INSEAN which are also simulated by SHIPLES, for a faired version of the hull with a natural length of 10 drafts and a faired region of 7 drafts tacked on to it. All other avaiable INSEAN data is in the region where we are not simulating the actual DDG-51 hull. Rms error, C, is reported for each average SHIPLES slice for u,v, and w. The RMS error is calculated for each velocity component by the following method. The local error at a point is defined as EU(I,K) = U(I,K) - uexpt(IK) 1 (5.1) We calcaulate the total rms error by 1 2 115 (5.2) where () indicates a plane average for all comparable data points. The absolute error was used due to difficulties in calculating relative error where the experimental values were small. The error is calculated for each of the three velocity components. Time averages of SHIPLES data were chosen that showed the best possible comparison for the SHIPLES data with the INSEAN data. Despite the inherent unsteadiness of the free surface at the times the time averages were taken, we found good comparison between SHIPLES and INSEAN results. The data is presented for all stations of experimental data for which y < y,. The higer resolution case with a natural length of four is comparable with the front two data slices while the lower resolution data is comparable at all four slices. The medium resolution data set was averaged over 1.2 < T < 4.3 while the higher resolution data set was averaged over 0.8 < T < 2.1. The high resolution data set was much further from a steady state in this time period, but all of the available data was used. In each figure showing comparison below the experimental data is shown on the left and the average SHIPLES data is shown on the right. 5.2.1 - -0.1209 We show comparisons between our computations and experimental data at a station just forward of the ship at ! = -0.1209. Figure 5-7 shows very good comparisons to experimental data for all three velocity components. The vertical velocity shows the best comparison. The most notable difference for this slice is the magnitude difference for the longitudinal velocity just in front of the bulb. Data was available for the high resolution case at this station as well. It is shown in figure 5-8. Here we show improvement in the compraison for the high resolution case. This particular slice is probably a fairly steady slice, since the early time average for the high resolution case gives good results. 5.2.2 Y= 2.3067 We s We show very good qualitative comparison for the velocity components,particularly 116 X Y/D=-0.1209 P -1 0 1 2 4 0.5- 5 0.2 0.16 0 0.12 0.08 0-04 0 =1 -0.5- 1.85 % -0.04 -0.08 -0.12 -0.16 -0.2 -1 N -1.5 X 0.5 -- v i 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0- -0.5 -1 v 1 2 3 - 4 F=6.88% -1~ N -1.5X -1 0 1 2 3 4 0.5- w 0.2 0.16 0.12 0.08 0.04 Ew=3.93% -0.5 0 -0.04 .08 -0.08 -0.12 -0.16 -0.2 S -1_ N -1.57 Figure 5-7: Velocity Comparisons for Medium Resolution Case 117 5 X Y/D=-0.1209 U 0.2 0.16 0.12 0.08 0 -0.04 0.04 -0.08 -0.12 -0.16 -0.2 -1 0 1 -1 -1.5 0 2 1 i i 3 4 5 -T 0 E 0I7 -0.5- ev=7.32% N -1.5 K 0.5- 6r 0.16 0.12 0.08 0 0.01 % N 09 008 w 5 4 E=1 -0.5 -1 106 3 0 0.5- 0.5 0.4 0.3 0.2 0.1 2 0.5- -1 0 I I I I I I 1 2 3 I 4 I I * I 5 , I 0- EW=2.71 % -0.5- -0.04 -0.08 -0.12 -0.16 1-0.2 -1.5 Figure 5-8: Velocity Comparisons for High Resolution Case 118 I I X Y/D=2.3067 P0.2 0.16 -1 0 1 2 5 0 0.12 0.08 0 -0.04 -0.04 -0.08 -0.12 -016 -0.2 -0.5- F=7.07 % -1 Ni1.5 X -1 0 1 2 3 4 5 V 0.9 0.8 0.7 0.6 E,=1 3.00% 0.5 0.4 0.3 02 0.1 0 X -1 0 1 2 3 4 5 w 0.2 0.16 0.12 0.08 0.04 0 -0.04 -0.08 0 -0.5- Ew=5.31% -1 - -0.12 -0.16 -0.2 N1.5 Figure 5-9: Velocity Comparisons for Medium Resolution Case 119 .......... - - X Y/D=2.3067 -1 0 1 2 3 I 5 4 I I I I ' ' ' I 0 0.16 012 -0.5- s-=7.45 % -0.08 P41.5 - X 1 0 1 2 3 4 5 V i 0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 -0.5- Ev=1 9.02% N1.5 X -1 0 1 2 3 4 5 w '.04 5016 0.12 0.08 Fiue0 -0.5- -0 w=7.44% Ns.5 Velocity Comparisons for High Resolution Case for the transverse velocity, at the first station on the ship. The longitudinal velocity for the medium resolution shows good comparison everywhere except at the extremely thick boundary layer shown. It should be noted that the experimental method was unable to obtain data very near the body or the free surface. Some descrepencies hold in the vertical velocity as well. We note a higher overall vertical velocity for our case. This most likely is a factor of the moving free surface and the initial rise of the start up wave. The higher resolution case shows similar comparison for the transverse velocity andvertical velocity, with a slightly better resolution of the positive vertical velocity below the bulb. The longitudinal velocity comparison is much better with the boundary layer not being too obviously thick. 120 X Y/D=4.6134 P -1 0 1 2 5 0.2 0.16 0.12 008 E=8.40 % 0 -0.04 -0.08 -0.12 -0.16 -0.2 -0.5- v 0.9 0.8 0.7 0.6 05 0.4 0.3 0.2 0.1 -1 -1- 0 1 2 3 4 5 0- Ni1.5-0.5- E=20.04% x 0- 0 X: -1 P02 w 0'16 0.12 0.08 0.04 0 -0.04 -0.08 -0.12 -0.16 -0.2 0 1 2 3 4 5 Fw=3.41 % N1.5 Figure 5-11: Velocity Comparisons for Medium Resolution Case 121 .... . . ..... X Y/[)=9,2268 U 01 0.08 0.06 0.04 0.02 0 -0.02 -0.04 -0.06 -0.08 -0.1 0 -1 I ' '1 1 I 1 1 1 3 2 . . I ' ' 1 5 I ' , 1 F=2.82 % N1.5 X 0 1 2 3 4 5 -1 0 1 2 3 4 5 -1 V 040.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 -0.5N1.5.63 X W 0.1 0.08 0.06 0.04 0.02 0 -0.02 -0.04 -0.06 -0.08 -0.1 -0.5-1=193 N1.5 Figure 5-12: Velocity Comparisons for Medium Resolution Case 5.2.3 = 4.6134 The next station is also a medium resolution result. The comparison is good overall with the boundary layer once again being the only noticeably wrong aspect. 5.2.4 = 9.2268 We show comparisons for our final station which is almost at amidships for the full DDG-51 model. This station shows very good comparison to the experimental data as well. The average velocity field comparisons validate SHIPLES as a computational method capable of solving for the flow past a complex geometry. The code ably captures average results obtainable by experimental methods. We show comparisons of average medium and high resolution SHIPLES data with the experimental data at four different stations. While the comparisons are not dead on accurate, they demonstrate the capability of SHIPLES. Since we show that average SHIPLES results 122 compare well with experimental data, we use the SHIPLES data to perform time averaging and allow us to investigate turbulent quantities in the flow which are not shown in the average results. 123 Chapter 6 Results We present results elucidating the vortical and turbulent structure of the flow past the DDG-51 bow shape. The numerical method has been presented in detail and validated against available experimental data. We use the code to study the turbulent structure of the flow. The results we present will give a basic understanding of the general nature of the turbulent flow past this complicated geometry. We examine the vortical structure of quasi-steady and unsteady longitudinal rollers as they are developed around the bulbous bow and as they are generated at the free-surface. We show qualitatively that we can obtain results with SHIPLES that lead to a better understanding of the turbulent nature of the flow past the ship bow. 6.1 Vortical Structures One way in which we identify vortical flow structures is by observing three dimensional iso-surfaces of vorticity magnitude. We particularly note the presence of longitudinal roller vortices near the bow and the free surface. These are the largest and most important vortical structures in the flow. Some of these structure are steady or quasisteady in nature, while some are more transient in nature. We show the location and nature of the steady vortical structures. We also elucidate the development of the unsteady vortical structures that we see at the free surface. 124 ... . ...... .. ..... Figure 6-1: Average Longitudinal Vorticity 6.1.1 Steady Vortices To show the steady vortices in the flow we show results of time averaged SHIPLES calculations. As discussed in chapter 5, we note that the time averaging of our results may not be fully justified due to the unsteadiness of our free surface. We do justify our time averaging by making comparisons of time-averaged planes of data with the available experimental data. We choose periods of time for averaging which lead to the best overall velocity field comparisons. We present results from two runs, a medium resolution and high resolution run. The data is from the same runs as presented in section 5.2. We show in figure 6-1 that average vorticity results yield data with lonigtudinal structure. This points to an area of quasi-steady vortical flow. We especially notice the preesence of longitudinal vortex just below and above the bulb, as well as at the 125 . ........ .... --"I 1 2 .I Figure 6-2: Temporal development of longitudianl vorticity contours 126 free surface. In figure 6-2 we see the quai-steady vorticity contour in the flow field just outside the bulbous bow and along the ship body. 6.1.2 Unsteady Bow Wave Vortices We present plots showing iso-surfaces of vorticity and various vorticity components showing the presence of unsteady vortical structures. We present vortical structure associated with the developing bow wave. Once again referring to figure 6-2 we also see unsteady flow features in this teemrporally advancing sequence. Most notably, vorticity is shed away from the ship with the developing bow wave as it rises and falls. This vorticity comes in positive and negative counter-rotating pairs on each side of the advancing wave. This mild wave is cited in [15] as the location of a considerable amount of vortical structure as well. 127 Chapter 7 Conclusions 7.1 Reccomendations for Future Work Time has not allowed me to present as much turbulent analysis as possible. Some of things that need to be investigated more completely are correlations of the turbulent production term with the nonlinear bow wave location. Katz [15] used a two dimensional approximation of the production at the free surface with his DPIV data to show the source of turbulent energy production in the bow wave. Also given more time, calculations of the turbulent kinetic energy at the free surface would be used to show the capability to capture turbulent data results on the free surface. Data has been calculated and looked at preliminarily which showed a relatively high turbulent kinetic energy at the bow wave. Reccomendations for future work include running at even higher resolution to better resolve the flow near the wall and at the free surface. We currently need to have an order of magnitude higer resolution to be properly using the wall function model as we are currently implementing it. In order to enable running at higher resolution I recommend a change in the domain decomposition for running in parallel. Currently we decompose our domain in the vertical direction. To take the best of advantage of parallel resources we need to decompose the domain in the longitudinal direction. This will require rewriting the pressure and grid solvers, but should not be too difficult to implement. The effort 128 involved in doing this will pay off great dividends in the future. I also recommend the direct comparison of the proposed new higher resolution SHIPLES with the results for turbulence production in the bow wave as shown by Roth, Mascenik, and Katz [15]. This comparison can be used to once and for all validate the successful free surface turbulence modeling of the SHIPLES method. 7.2 Summary We have presented in great detail the mathematics, code structure, and numerical implementation that have gone into the maing of the code SHIPLES. These details can be seen as a learning tool for those who have a desire to use the code SHIPLES or for those who have the desire to develop their own code using Large Eddy Simulation to model a free surface flow past a complex geometry in a boundary fitted coordinate system. The method is a very expensive computational method which can yield a lot of crucial info for those interested in the time history of large scale turbulent free surface flows that can not be investigated with faster methods based on the averaging of the Navier-Stokes equations. The computational expense can be lessened by taking advantage of High Performance Computing solutions. We employ parallel processing to improve our simulation capability with this very expensive code. Several changes have been tried and made since the original code was first produced as part of the work going into Imas [6]. The changes are highlighted as well as some of the ideas that were tried and later dismissed to prevent others from repeating work that has been done by others previously. The ideas that have been applied to the design of the code are as well documented as possible, and it is hoped that this document may serve as the basis for many futher improvements in the code's capabilities, with the ultimate goal of capturing numerically results that otherwise would have taken a very large number of difficult experimental measurements to obtain, allowing the user to study the turbulent structure of a free-surface flow around a complex geometry. 129 Averaged SHIPLES results have been validated by showing direct comparison to average experimental results for the velocity field at four locations. The average results show good comparison. We show that SHIPLES can not currently be run to a steady state at the free surface due to the influence of the domain boundaries. This is not a concern since the results for teh average velocity still show good comparison, and we are quite interested in the unsteady effects at the free surface. We also show the capability of SHIPLES to capture steady and unsteady vortical structures in the flow past the ship bow. We visualize these structure by looking at iso-surfaces and contours of various vorticity components. 130 Bibliography [1] Giulio Avanzini and Roberto Penna. Towing test results with uncertainty assessment on a combatant ship. Technical Report 1, INSEAN-IIHR, May 1998. [2] Jorge Bardina, Joel H. Ferziger, and W.C. Reynolds. Improved subgrid-scale models for large eddy simulation. Technical Report AIAA-80-1357, AIAA, July 1980. [3] J. Curran. A toolset for the identification of structures in turbulent flow, 1999. SB Thesis, Massachusetts Institute of Technology. [4] Ronald R. Dong, Joseph Katz, and Thomas T. Huang. On the structure of bow waves on a ship model. Jurnal of Fluid Mechanics, 346:77-115, 1997. [5] Klaus A. Hoffman and Steve T. Chiang. Computational Fluid Dynamics for Engineers, volume 1. Engineering Education System, 1993. [6] Leonard G. Imas. Hydrodynamics Involving A Free-Surface Body Juncture. PhD thesis, Massachusetts Institute of Technology, February 1998. [7] Hideaki Miyata, Toru Sato, and Nobuhiro Baba. Difference solution of a viscous flow with free-surface wave about an advancing ship. Journal of Computational Physics, 72:393-421, 1987. [8] Hideki Miyata and Takao Inui. Nonlinear ship waves. Advances in Applied Mechanics, 24:215-288, 1984. [9] Parviz Moin and John Kim. Numerical investigation of turbulent channel flow. Journal of Fluid Mechanics, 118:341-377, 1982. 131 [10] J.N. Newman. Marine Hydrodynamics. The MIT Press, Cambridge, Mas- sachusetts and London, England, 1977. [11] E.M. Pogozelski, J. Katz, and T.T. Huang. The flow structure around a surface piercing strut. Physics of Fluids, 9(5):1387-1399, May 1997. [12] William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery. Numerical Recipes in Fortran 77 : The Art of Scientific Computing, vol- ume 1. Cambridge University Press, second edition, 1992. [13] Toby Ratcliffe. http://www50.dt.navy.mil/5415. [14] Robert S. Rogallo and Parviz Moin. Numerical simulation of turbulent flows, 1984. [15] Gary I. Roth, Daniel T. Mascenik, and Joseph Katz. Measurements of the flow structure and turbulence within a ship bow wave. Physics of Fluids, 11(11):35123523, November 1999. [16] T.K. Sengupta and Manoj T. Nair. Upwind schemes and large eddy simulations. InternationalJournalfor Numerical Methods in Fluids, 31:879-889, 1999. [17] J. Smagorinsky. General circulation experiments with the primitive equations. Monthly Weather Review, 91(3):99-152, March 1963. [18] Gilbert Strang. Introduction to Applied Mathematics. Wellesley-Cambridge Press, 1986. [19] Wu ting Tsai and Dick K.P. Yue. Computation of nonlinear free-surface flows. Annual Review of Fluid Mechanics, 28:248-278, 1996. [20] Daohua Zhang and Allen T. Chwang. On nonlinear ship waves and wave resistance calculations. Journal of Marine Science and Technology, 4:7-15, 1999. 132