You are on page 1of 31

Tutorial 10.

Introduction

Simulation of Wave Generation in a Tank

The purpose of this tutorial is to illustrate the setup and solution of the 2D laminar uid ow in a tank with oscillating motion of a wall. The oscillating motion of a wall can generate waves in a tank partially lled with a liquid and open to atmosphere. Smooth waves can be generated by setting appropriate frequency and amplitude. One of the tank walls is moved to and fro by specifying a sinusoidal motion. In this tutorial you will learn how to: Read an existing mesh le in FLUENT. Check the grid for dimensions and quality. Add new uid in the materials list. Set up a multiphase ow problem. Use the dynamic mesh model. Set up an animation using Execute Commands panel.

Prerequisites
This tutorial assumes that you have little experience with FLUENT but are familiar with the interface.

Problem Description
In this tutorial, we consider a rectangular tank with a length (L) of 15 m and width (W) of 0.8 m (Figure 10.1). The left wall is assigned a motion with sinusoidal time variation. The top wall is open to atmosphere and thus maintained at atmospheric pressure. The ow is assumed to be laminar.

c Fluent Inc. August 18, 2005

10-1

Simulation of Wave Generation in a Tank

Figure 10.1: Problem Schematic

Preparation
1. Copy the mesh le, wave.msh and libudf folder to your working directory. 2. Start the 2D double precision solver of FLUENT.

Setup and Solution Step 1: Grid


1. Read the grid le, wave.msh. File Read Case... FLUENT will read the mesh le and report the progress in the console window. 2. Check the grid. Grid Check This procedure checks the integrity of the mesh. Make sure the reported minimum volume is a positive number. 3. Check the scale of the grid. Grid Scale...

10-2

c Fluent Inc. August 18, 2005

Simulation of Wave Generation in a Tank

Check the domain extents to see if they correspond to the actual physical dimensions. If not, the grid has to be scaled with proper units. 4. Display the grid (Figure 10.2). Display Grid...

(a) Click Colors.... The Grid Colors panel opens.

i. Under Options, enable Color by ID. ii. Click Close. (b) In the Grid Display panel, click Display (c) Zoom in near the moving-wall (Figure 10.3).

c Fluent Inc. August 18, 2005

10-3

Simulation of Wave Generation in a Tank

Grid (Time=0.0000e+00)

FLUENT 6.2 (2d, dp, segregated, dynamesh, vof, lam, unsteady)

Figure 10.2: Grid Display

Grid

FLUENT 6.2 (2d, dp, segregated, lam)

Figure 10.3: Grid Display (Close-up of moving-wall)

10-4

c Fluent Inc. August 18, 2005

Simulation of Wave Generation in a Tank

Step 2: Models
1. Specify the solver settings. Dene Models Solver...

(a) Under Time, enable Unsteady (b) Under Transient Controls, enable Non-Iterative Time Advancement. (c) Click OK. 2. Enable VOF multiphase model. Dene Models Multiphase...

c Fluent Inc. August 18, 2005

10-5

Simulation of Wave Generation in a Tank

(a) Under Model, enable Volume of Fluid. The panel expands to show the other settings related to VOF model. Retain the other settings as default. (b) Click OK.

Step 3: Materials
Dene Materials... 1. Add liquid water to the list of uid materials by copying it from the materials database.

10-6

c Fluent Inc. August 18, 2005

Simulation of Wave Generation in a Tank

(a) Click Fluent Database.... Fluent Database Materials panel opens.

c Fluent Inc. August 18, 2005

10-7

Simulation of Wave Generation in a Tank

i. Select water-liquid (h2o<l>) from the Fluent Fluid Materials list. Scroll down to view water-liquid. ii. Click Copy and close the panel. (b) Click Change/Create and close the panel.

Step 4: Phases
Dene Phases... 1. Set air as primary phase and water as secondary phase.

(a) Under Phase, select phase-1. The Type will be shown as primary-phase. (b) Click Set....

i. Change Name to air. ii. Select air in the Phase Material drop-down list. iii. Click OK. (c) Similarly, change the Name of phase-2 to water and set its Type to water-liquid. (d) Close the Phases panel.

10-8

c Fluent Inc. August 18, 2005

Simulation of Wave Generation in a Tank

Step 5: Operating Conditions


Dene Operating Conditions... 1. Set the gravitational acceleration.

(a) Enable Gravity. (b) Under Gravitational Acceleration, set Y to -9.81 m/s2 . As the tank bottom is perpendicular to Y axis, gravity points in the negative Y direction. 2. Set the operating density. (a) Under Variable-Density Parameters, enable Specied Operating Density. (b) Retain the default density of 1.225 kg/m3 . Set the operating density to the density of the lighter phase. This excludes the build-up of hydrostatic pressure within the lighter phase, improving the round-o accuracy for the momentum balance. 3. Set the reference pressure location. (a) Under Reference Pressure Location, retain the default value of zero for both X and Y. This location corresponds to a region where the uid will always be 100% of one of the phases (water). If it is not, it is recommended to change the region to a appropriate location where the pressure value does not change much over time. This condition is essential for smooth and rapid convergence. 4. Click OK to accept the settings and close the panel.

c Fluent Inc. August 18, 2005

10-9

Simulation of Wave Generation in a Tank

Step 6: Boundary Conditions


FLUENT maintains zero velocity condition on all the walls. Also, the pressure condition for outlet boundary at the top is set by default to zero gauge (or atmospheric). Hence, there is no need to change the boundary conditions. Retain all the boundary conditions as default.

Step 7: UDF Library


Dene User-Dened Functions Compiled...

1. Click Load to load the UDF library. The sinusoidal wall motion will be assigned using user dened function. A compiled UDF library named libudf is created for this purpose.

Step 8: Dynamic Mesh Model


1. Set the dynamic mesh parameters. Dene Dynamic Mesh Parameters...

10-10

c Fluent Inc. August 18, 2005

Simulation of Wave Generation in a Tank

(a) Under Models, enable Dynamic Mesh. The panel expands. (b) Under Mesh Methods, disable Smoothing and enable Layering. (c) Under the Layering tab, set Collapse Factor to 0.4. (d) Click OK. 2. Set the dynamic mesh zones. Dene Dynamic Mesh Zones...

(a) Under Zone Names, select moving-wall. (b) Under Type, retain the default selection of Rigid Body. (c) Under Meshing Options tab, set Cell Height to 0.008 m. This is the average size of the cell normal to the moving wall. (d) Click Create and close the panel.

Step 9: Solution
1. Retain the default solution controls. Solve Controls Solution...

c Fluent Inc. August 18, 2005

10-11

Simulation of Wave Generation in a Tank

2. Initialize the ow. Solve Initialize Initialize...

(a) Click Init and close the panel. The complete domain is now initialized with air. The water level required at start (t=0) can be patched. 3. Create a register marking the region of initial water level. Adapt Region...

10-12

c Fluent Inc. August 18, 2005

Simulation of Wave Generation in a Tank

(a) Set X Max to be 15 m. (b) Set Y Max to be 0.5 m. (c) Click Mark and close the panel. FLUENT displays the following message in the console: 8510 cells marked for renement, 0 cells marked for coarsening. 4. Patch the initial water level. Solve Initialize Patch...

(a) Under Registers to Patch, select hexahedron-r0. (b) Under Phase, select water. (c) Under Variable, select Volume Fraction. (d) Set Value to 1. (e) Click Patch and close the panel.

c Fluent Inc. August 18, 2005

10-13

Simulation of Wave Generation in a Tank

5. Display the zone motion to check the movement of moving-wall. (a) Display the grid (Figure 10.4). Display Grid...

i. Under Surfaces, deselect default-interior. Zoom-in the graphics window to get the view as shown in Figure 10.4. ii. Click Display.

Figure 10.4: Grid Display Outline at t=0 (b) Display the zone motion. Display Zone Motion...

10-14

c Fluent Inc. August 18, 2005

Simulation of Wave Generation in a Tank

i. Under Motion History Integration, set Time Step to 0.001. ii. Set Number of Steps to 300. iii. Click Integrate. iv. Under Preview Controls, set Time Step to 0.001. v. Set Number of Steps to 300. vi. Click Preview to observe the wall motion. vii. Close the Zone Motion panel. 6. View the contours of volume fraction for water (Figure 10.5). Display Contours...

(a) Select Phases... and Volume Fraction in the Contours of drop-down lists. (b) Under Phase, select water. (c) Under Options, enable Filled. (d) Click Display and close the panel.

c Fluent Inc. August 18, 2005

10-15

Simulation of Wave Generation in a Tank

Figure 10.5: Contours of Volume Fraction for Water 7. Enable the plotting of residuals during the calculation. Solve Monitors Residuals...

(a) Under Options, enable Plot. (b) Under Plotting, set Iterations to 10. This will display residuals for only the last 10 iterations. (c) Click OK.

10-16

c Fluent Inc. August 18, 2005

Simulation of Wave Generation in a Tank

8. Set hardcopy settings. File Hardcopy...

(a) Under Format, select TIFF. (b) Under Coloring, select Color. (c) Click Apply. (d) Click Preview. The background of graphics window is changed to white. FLUENT will display a question dialog box asking you whether to reset the window. (e) Click Yes in the Question dialog box. (f) Close the panel. 9. Set the commands to capture the images of contours. You need to use Text User Interface (TUI) commands to achieve this. For most of the graphical commands, corresponding TUI commands are available. Solve Execute Commands...

c Fluent Inc. August 18, 2005

10-17

Simulation of Wave Generation in a Tank

(a) Set the number of Dened Commands to 3. (b) Enable On option for all the commands. (c) Under Every, set 7 for all the commands. (d) Under When, set Time Step for all the commands. (e) For command-1, specify the Command as: display set-window 1 This command will make the window-1 active. (f) For command-2, specify the Command as: display contour water vof 0 1 This command will display the contours of water volume fraction in the active window. (g) For command-1, specify the Command as: display hard-copy "vof-%t.tif" This command will save the image in the TIF format. The %t option gets replaced with the time step number, when the image le is saved. The TIF les saved can then be used to create a movie. For the information on converting TIF le to an animation le, refer to http://www.bakker.org/cfm/graphics01.htm (h) Click OK to accept the settings and close the panel. 10. Set the surface monitors. Solve Monitors Surface...

(a) Increase the number of Surface Monitors to 1. (b) Enable Plot for monitor-1. (c) Under Every, select Time Step. (d) Click on Dene... next to monitor-1.

10-18

c Fluent Inc. August 18, 2005

Simulation of Wave Generation in a Tank

(e) Select Area Weighted Average in the Report Type drop-down list. (f) Select Grid and X-Coordinate in the Report of drop-down list. (g) Under Surfaces, select moving-wall. (h) Click OK to close both the panels. 11. Save the case and data les (wave-init.cas.gz and wave-init.dat.gz). File Write Case & Data... Retain the default Write Binary Files option so that you can write a binary le. The .gz extension will save zipped les on both, Windows and UNIX platforms.

c Fluent Inc. August 18, 2005

10-19

Simulation of Wave Generation in a Tank

12. Start the calculation. Solve Iterate...

(a) Set the Time Step Size as 0.001 s (b) Set Number of Time Steps to 4000. (c) Click Iterate.

Figure 10.6: Scaled Residuals

13. Save the case and data les (wave-4000.cas.gz and wave-4000.dat.gz).

10-20

c Fluent Inc. August 18, 2005

Simulation of Wave Generation in a Tank

Figure 10.7: Monitor Plot of Area Weighted Average on moving-wall

Step 10: Postprocessing


1. Display lled contours of static pressure (Figure 10.8). Display Contours...

c Fluent Inc. August 18, 2005

10-21

Simulation of Wave Generation in a Tank

(a) Select Pressure... and Static Pressure in the Contours of drop-down lists. (b) Click Display. The pressure at the bottom of the tank is maximum and goes on decreasing towards the top. This shows the variation of hydrostatic pressure due to the height of the liquid.

Figure 10.8: Contours of Static Pressure

Summary
The dynamic mesh model is used to apply periodic sinusoidal motion to the wall. This generates a wave in the uid. The VOF model is used to track the air-water interface and consequently the wave motion. Non-iterative time advancement (NITA) was used to reduce the run time of transient simulation. Images displaying contours of water phase were captured to visualize the transient eects.

References
1. Flow Around the Itsukushima Gate, an example from Fluent Inc. Marketing Catalog, 2003.

10-22

c Fluent Inc. August 18, 2005

Simulation of Wave Generation in a Tank

Exercises/Discussions
1. Run the simulation for longer ow time to check the wave pattern. 2. Try running the simulation without non-iterative time advancement (NITA) option. (a) Are the ow patterns dierent? (b) Compare the wall clock time taken to reach the same ow time. 3. Run the simulation using variable time step option. 4. Try dierent motions to the wall and observe wave patterns. This will need specic C compiler to create UDF library from the source code. 5. What other situation can be simulated using the same mesh le?

Links for Further Reading


http://www.prads2004.de/pdf/027.pdf http://www.prads2004.de/pdf/138.pdf http://www.math.rug.nl/veldman/preprints/OMAE2004-51084.pdf

c Fluent Inc. August 18, 2005

10-23

Simulation of Wave Generation in a Tank

10-24

c Fluent Inc. August 18, 2005

2D numerical simulation of ocean waves


Qingjie. Du,*, Y.C. Dennis. Leung
Department of Mechanical Engineering, The University of Hong Kong, Hong Kong, China * Corresponding author. Tel: +852 51743593, E-mail: qingjie.du@gmail.com

Abstract: As fossil energy is depleting and global warming effect is worsening rapidly, developing renewable energies become the top priority on most developed and some developing countries. Among different kinds of renewable energies, wave energy attracts more and more attention in recent years due to its high energy density and enormous global amount. However, some technical difficulties still need to be overcome for extracting wave power. I n designing a wave energy converter, it is important to develop an efficient method to determine the wave load and predict its response. In this paper, a n umerical investigation of ocean waves is presented. Commercial software code FLUENT is used as a computational platform in this study. Based on the NavierStokes equations for viscous, incompressible fluid and Volume of fluid (VOF) method, a two dimensional numerical wave tank is established. Dynamic meshing method is used to simulate the wave maker, and GeoReconstruct scheme is used to capture the free surface. A wave-absorbing method employing porous media model is proposed, which can absorb the wave energy efficiently. Moving boundary, wall boundary and pressure-inlet boundary are used to construct the computational domain. Linear regular waves are simulated accurately using the proposed numerical model. The numerical results matched with the theoretical calculation. Keywords: Numerical wave flume, FLUENT, VOF method, Dynamic meshing

Nomenclature
u v velocity component (x-direction) ......... ms-1 velocity component (y-direction) ......... ms-1 density ................................................kgm-3 dynamic viscosity ............................ kgms-1 static pressure ......................................... Pa body force (x-direction) .................... NKg-1 body force (x-direction) .................... NKg-1 S T k h paddle stroke ............................................ m wave period ............................................... s wave number ..........................................m-1 wave free surface ...................................... m angular frequency ................................... s-1 body forces ................................................ N

p gx gx

1. Introduction The World Energy Council (1999) reported that the total globally extractable wave energy is about 2 Terawatts [1], which is the same order of magnitude as the worlds total electricity consumption. How to harness this huge energy has attracted more and more scientists attention. In the design of wave energy converter, predicting wave loads and the structure responses have become increasingly important. In the past, the study of wave-structure interaction is mainly based on physical model experiment, which is both time consuming and money costly. Nowadays, following the rapid development in computational method and computer hardware, numerical simulation of the wave-structure interaction has attracted more and more attention. The computation of unsteady free-surface flow is a key point in two-phase flow. Hirt and Nichols [2] developed the Volume of fluid (VOF) method to solve the two-phase problem, which uses a g eometrical reconstruction scheme to capture the free surface. Wang et al [3] employed a numerical method to simulate the wave group development in long tanks. Zou [4] and Liu [5] used a moving boundary to simulate the piston-type wave maker, and successfully generated regular waves. Wei et al [6] and Chawla [7] implemented a source function method to generate ocean waves, based on Boussinesq model. Based on the 2D form of Navier-Stokes

2183

equations, Dong and Huang [8] established a 2 D numerical wave tank to simulate smallamplitude waves and solitary waves. Lu et al [9] numerically simulated wave overtopping against seawalls in regular wave case. During the last two decades, numerous scientists have developed their numerical methods to simulate ocean waves that are nonlinear and unsteady free-surface flows. In this paper, the research is focused on the simulation of a two-dimensional numerical wave flume. FLUENT is used as the main computational platform. Some User-Define-Function (UDF) has been implemented to simulate the wave maker and wave absorbing bench. Dynamic meshing technique is used to simulate a piston-type wave maker, which can generate both regular and irregular waves. VOF model is used to capture the free surface between water and air. Porous media model acts as the wave absorbing bench to absorb the wave energy. Both linear and nonlinear waves are simulated and compared with theoretical result. 2. Governing equation In fluid dynamic research, there are several important assumptions. F irst, the fluid being studied is assumed to be a continuum; second, all field involved are differentiable, such as velocity field, pressure field. Moreover, for the water fluid dynamic field, some other sound assumptions are also established. Water is assumed to be Newtonian fluids, and it is incompressible and its density will not change with time. Based on the above assumptions, the NavierStokes equation and continuity equation are used to describe the fluid motion, which are also the governing equations in this study. 2.1. NavierStokes equation Equation 1 shows the Navier-Ssokes equation in vector form: (1) Rewriting the vector equation explicitly in 2D Cartesian coordinates: (2.a) (2.b) 2.2. Continuity Equation Equation 3 shows the continuity equation in 2D Cartesian coordinates (3) 3. Numerical method 3.1. Boundary condition Given proper boundary condition and initial condition, the above equations can be solved computationally. For a 2D case, given the velocity potential , the boundary conditions are as follows: (a) dynamic free-surface condition:

2184

(4) where P 0 is the pressure on the free surface. (b) kinematic free-surface condition: (5) (c) No normal-flux condition: (6) applied on the rigid bottom, and at the vertical end-wall of the numerical flume. In FLUENT, boundary condition (a) and (b) is satisfied by using the VOF scheme, and boundary condition (c) is satisfied by using wall condition. 3.2. Free surface--VOF model The main goal of the present research is to study the characteristics of ocean waves under different scenarios. In this research, the key problem is how to accurately describe the free surface between the two different phases. In this paper, since all the calculation is based on FLUENT, VOF model is used to simulate the free surface between water and air. The method is based on t he idea of so called fraction function . It is defined as the integral of fluid's characteristic function in the control volume (namely volume of a computational grid cell). Basically, when the cell is empty, ; if the cell is full, ; if , then the volume is the interface between the two phases. For this study, it is a two-phase problem, so q=1,2, representing air and water respectively. q is tracked by solving the continuity equation below for qth fluid. (7) (8) 3.3. Wave maker--dynamic mesh A piston-type wave maker is simulated using the dynamic mesh technology in this study. Moving boundary is used to model the oscillating paddle in the physical wave maker. A userdefined function (UDF) is used to describe the motion of the oscillating paddle. In order to make the simulation more smoothly, the velocity of the paddle is described as follows: (9.a) (9.b)

2185

where S is the stroke of the paddle, t is the run time, T is the wave period, the angular frequency. 3.4. Wave absorbing bench--Porous media The mathematic model of the porous medium is defined as:

)is

(10) where i represents x, y, z; resistance respectively. & are the coefficients of viscous resistance & inertial

In this 2D model, only is considered. How to decide the value of is very important. If is too small, the wave energy cannot be absorbed completely and when waves reach the right boundary, it will reflect. If is too large, the fluid property will change dramatically in the interface between the water and porous medium, so the wave will reflect too. In this simulation, the coefficient is defined as a function of the position, which is described by a UDF, in order to make the resistance of the porous medium change smoothly. 3.5. Computational model

Fig.1 computational model scheme

Fig.1 shows a computation scheme of this study. Boundary AD represents the oscillating paddle; Boundary DC represents the wave flume bottom; Boundary BC represents the end of the wave flume; Boundary AB represents the top of the flume. The Volume of Fluid model is used to describe the free surface between the air and water. 4. Results and discussion In this study, the numerical model is based on the dimension of a physical wave flume in the laboratory, with a dimension of 9m long and 0.45m high. In this simulation, the initial water depth is 0.3m. A linear regular wave with a wave height at 0.05m and wave period at 1.8s will be simulated by the numerical model. The theoretical analysis will be performed too. The wave form in the whole tank is monitored at certain times. Also the surface elevation history at point x=4.5m, which is the center point of the physical wave tank, is monitored too. These data will be compared with the theoretical result.

2186

Under the assumption of both small amplitude paddle motion and small wave height, linear wavemaker theory has been developed by Dean and Dalrymple [10]. Assuming the original place of the paddle is at x= 0, and the wavemaker stroke is S, the angular frequency of the paddle is , the wave elevation on the free surface in the wave tank with water height d is shown as follows: (11) (12) Fig.2 shows the water elevation history at x=4.5m from the time of 40s to 50s. 40s, which is about 20 wave periods, is thought to be long enough for the wave to be fully developed. The black line with stars represents for the numerical result, and the green dotted line represents for the theoretical result.

Fig.2 surface elevation history at point x=4.5

Though there is a slight shift in the phase, the numerical result matches the theoretical result well. The phase shift is due to the first 2 periods. In the simulation, during first 2 periods, all the parameters were dividing by 2T for smoothing issue. Fig.3 shows the water free surface at t= 40s, 45s and 50s. The water surface is sinusoidal, which matches the theoretical analysis.

2187

Fig.3 wave surface at t=40s, 45s, 50s

Noted that for the wave absorbing model, the waves are absorbed completely by the porous media in the right part. Otherwise, the waves will reflect since the right boundary condition is wall. 5. Conclusion In this study, the wave simulation model is developed based on a commercial software FLUENT for modeling fluid flow. Linear regular waves and wave absorbing bench are simulated well with a self-developed numerical model. The simulation of a wave with a wave height of 0.05m and period of 1.8s is conducted successfully. Comparison between the numerical and theoretical results shows that the numerical method works well. Compared with the physical model experiments, this numerical model is more adaptable. The wave tank dimension can be changed according to the specific situation. The use of this numerical model is costless and is very convenient. Based on this model, the wave-structure interaction can be studied. Whats more important is that it can serve as a platform to predict the hydrodynamic response of wave energy convertors (WECs) in waves, and the result can be used to optimize the WECs. Acknowledgement The authors wish to acknowledge the IEEE of the University of Hong Kong for supporting the project. References [1] Thorpe, T.W., A brief review of wave energy. ETSU Report Number R-120 for the DTI, 1999. [2] Hirt, C.W. and B.D. Nichols, Volume of fluid (VOF) method for the dynamics of free boundaries. Journal of Computational Physics, 1981. 39(1): pp. 201-225. [3] Wang, P., Y. Yao, and M.P. Tulin, Wave group evolution, wave deformation, and breaking: simulations using LONGTANK, a numerical wave tank. International Journal of Offshore and Polar Engineering, 1994. 4(3): pp. 200-205.

2188

[4] Zou, Z., Numerical simulation of nonlinear wave generated in wave flume by VOF technique. Journal of Hydrodynamics, 1996. 11(1): pp. 93-103. [5] LIU, J.H., Making waves in 2-d numerical flume and feature analysis of the numerical waves. Journal of Sichuan University, 2004. 36(6): pp. 28-31. [6] Wei, G., J.T. Kirby, and A. Sinha, Generation of waves in Boussinesq models using a source function method. Coastal Engineering, 1999. 36(4): pp. 271-299. [7] Chawla, A. and J.T. Kirby, A source function method for generation of waves on currents in Boussinesq models. Applied Ocean Research, 2000. 22(2): pp. 75-83. [8] Dong, C.M. and C.J. Huang, Generation and propagation of water waves in a t wodimensional numerical viscous wave flume. Journal of Waterway, Port, Coastal and Ocean Engineering, 2004. 130(3): pp. 143-153. [9] Lu, Y.j., et al., Numerical simulation of two-dimensional overtopping against seawalls armored with artificial units in regular waves. Journal of Hydrodynamics, 2007. 19( 3): pp. 322-329. [10] Dean, R.G. and R.A. Dalrymple, Water wave mechanics for engineers and scientists. 1984.

2189

You might also like