1.pdf

22
Tutorial: Solving a 2D Box Falling into Water Introduction The purpose of this tutorial is to provide guidelines and recommendations for setting up and solving a moving deforming mesh (MDM) case along with the six degree of freedom (6DOF) solver and the volume of fluid (VOF) multiphase model. The 6DOF UDF is used to calculate the motion of the moving body which also experiences a buoyancy force as it hits the water (modeled using the VOF model). Gravity and the bouyancy forces drive the motion of the body and the dynamic mesh. This tutorial demonstrates how to do the following: Use 6DOF solver to calculate motion of the moving body. Use VOF multiphase model to model the buoyancy force experienced by the moving body. Set up and solve the dynamic mesh case. Create TIFF files for graphic visualization of the solution. Postprocess the resulting data. Prerequisites This tutorial is written with the assumption that you have completed Tutorial 1 from ANSYS FLUENT 13.0 Tutorial Guide, and that you are familiar with the ANSYS FLUENT navigation pane and menu structure. Some steps in the setup and solution procedure will not be shown explicitly. In this tutorial, you will use the dynamic mesh model and the 6DOF model. If you have not used these models before, see Sections 11.3 Using Dynamic Meshes and 11.3.7 Six DOF Solver Settings, respectively in the ANSYS FLUENT 13.0 User’s Guide. Problem Description The schematic of the problem is shown in Figure 1. The tank is partially filled with water. A box is dropped into the water at time t = 0. The box is subjected to a viscous drag force and a gravitational force. When the box is immersed in water, it is also subjected to a buoyancy force. c ANSYS, Inc. November 24, 2010 1

Upload: climax1364

Post on 01-Nov-2014

270 views

Category:

Documents


1 download

DESCRIPTION

werwerwerwewerwerwerv wrr wer wr r wer wer wr wr w wer r wer r

TRANSCRIPT

Page 1: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

Introduction

The purpose of this tutorial is to provide guidelines and recommendations for setting upand solving a moving deforming mesh (MDM) case along with the six degree of freedom(6DOF) solver and the volume of fluid (VOF) multiphase model. The 6DOF UDF is usedto calculate the motion of the moving body which also experiences a buoyancy force as ithits the water (modeled using the VOF model). Gravity and the bouyancy forces drive themotion of the body and the dynamic mesh.

This tutorial demonstrates how to do the following:

• Use 6DOF solver to calculate motion of the moving body.

• Use VOF multiphase model to model the buoyancy force experienced by the movingbody.

• Set up and solve the dynamic mesh case.

• Create TIFF files for graphic visualization of the solution.

• Postprocess the resulting data.

Prerequisites

This tutorial is written with the assumption that you have completed Tutorial 1 fromANSYS FLUENT 13.0 Tutorial Guide, and that you are familiar with the ANSYS FLUENTnavigation pane and menu structure. Some steps in the setup and solution procedure willnot be shown explicitly.

In this tutorial, you will use the dynamic mesh model and the 6DOF model. If you havenot used these models before, see Sections 11.3 Using Dynamic Meshes and 11.3.7 Six DOFSolver Settings, respectively in the ANSYS FLUENT 13.0 User’s Guide.

Problem Description

The schematic of the problem is shown in Figure 1. The tank is partially filled with water.A box is dropped into the water at time t = 0. The box is subjected to a viscous dragforce and a gravitational force. When the box is immersed in water, it is also subjected toa buoyancy force.

c© ANSYS, Inc. November 24, 2010 1

Page 2: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

The walls of the box undergoes a rigid body motion and displaces according to the calcu-lation performed by 6DOF solver. Whenever the box and its surrounding boundary layermesh are displaced, the mesh outside the boundary layer is smoothed and/or remeshed.

Figure 1: Schematic of the Problem

Setup and Solution

Preparation

1. Copy the files (6dof-mesh.msh.gz and 6dof 2d.c) to your working folder.

2. Create a subfolder (tiff-files) to store the tiff files for postprocessing purpose.

3. Use FLUENT Launcher to start the 2D version of ANSYS FLUENT.

For more information about FLUENT Launcher see Section 1.1.2 StartingANSYS FLUENT Using FLUENT Launcher in ANSYS FLUENT 13.0 User’s Guide.

4. Enable Double-Precision in the Options list.

5. Click the UDF Compiler tab and ensure that the Setup Compilation Environment forUDF is enabled.

The path to the .bat file which is required to compile the UDF will be displayed as soonas you enable Setup Compilation Environment for UDF.

If the UDF Compiler tab does not appear in the FLUENT Launcher dialog box by default,click the Show Additional Options >> button to view the additional settings.

2 c© ANSYS, Inc. November 24, 2010

Page 3: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

The Display Options are enabled by default. Therefore, after you read in the mesh, itwill be displayed in the embedded graphics window.

Step 1: Mesh

1. Read the mesh file (6dof-mesh.msh.gz).

File −→ Read −→Mesh...

As the mesh file is read, ANSYS FLUENT will report the progress in the console.

Step 2: General Settings

1. Define the solver settings.

General −→ Transient

(a) Select Transient from the Time list.

2. Check the mesh (see Figure 2).

General −→ Check

Figure 2: Mesh Display

ANSYS FLUENT will perform various checks on the mesh and will report the progressin the console. Make sure the minimum volume reported is a positive number.

c© ANSYS, Inc. November 24, 2010 3

Page 4: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

Step 3: Models

1. Define the multiphase model.

Models −→ Multiphase −→ Edit...

(a) Select Volume of Fluid from the Model list to open Multiphase Model dialog box.

(a) Ensure that Number of Eulerian Phases is set to 2.

(b) Retain the default value of Courant Number.

(c) Enable Implicit Body Force in the Body Force Formulation group box.

(d) Click OK to close the Multiphase Model dialog box.

2. Enable the standard k-ε turbulence model.

Models −→ Viscous −→ Edit...

Step 4: User-Defined Functions

Define −→ User-Defined −→ Functions −→Compiled...

4 c© ANSYS, Inc. November 24, 2010

Page 5: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

1. Click Add... for the Source Files.

2. Select 6dof 2d.c in the Select File dialog box.

ANSYS FLUENT displays a Warning dialog box warning you to ensure that the UDFsource files are in the same folder that contains the case and data files. Click OK.

ANSYS FLUENT sets up the folder structure and compiles the code. The compilationis displayed in the console.

3. Click Load to load the UDF library.

Step 5: Materials

Materials −→ Create/Edit...

1. Retain the properties of air.

2. Copy water-liquid (h2o<l>) from the FLUENT Database....

3. Modify the properties of water-liquid (h2o<l>).

(a) Select user-defined from the Density drop-down list.

i. Select water density::libudf from the User-Defined Functions dialog box.

(b) Select user-defined from the Speed of Sound drop-down list.

i. Select water speed of sound::libudf from the User-Defined Functions dialogbox.

(c) Click Change/Create and close the Create/Edit Materials dialog box.

Step 6: Phases

1. Define the primary phase, water.

Phases −→ phase-1 −→ Edit...

c© ANSYS, Inc. November 24, 2010 5

Page 6: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

(a) Enter water for Name.

(b) Select water-liquid from the Phase Material drop-down list.

(c) Click OK.

2. Similarly, define the secondary phase, air.

Phases −→ phase-2 −→ Edit...

6 c© ANSYS, Inc. November 24, 2010

Page 7: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

Step 7: Boundary Conditions

1. Define the boundary conditions for tank outlet.

Boundary Conditions −→ tank outlet

(a) Set the boundary conditions for the mixture phase.

i. Ensure that mixture is selected from the Phase drop-down list and click Edit...

ii. Select Intensity and Viscosity Ratio from the Specification Method drop-downlist.

iii. Enter 1% for Backflow Turbulence Intensity and 10 for Backflow TurbulentViscosity Ratio.

iv. Click OK to close the Pressure Outlet dialog box.

(b) Set the boundary conditions for the air phase.

i. Select air from the Phase drop-down list and click Edit....

ii. Click the Multiphase tab and enter 1 for Backflow Volume Fraction.

iii. Click OK to close the Pressure Outlet dialog box.

Step 8: Operating Conditions

Boundary Conditions −→ Operating Conditions...

1. Retain 101325 pascal for Operating Pressure.

2. Enable Gravity.

The dialog box expands to show additional inputs.

3. Enter -9.81 m/s2 for Gravitational Acceleration in the Y direction.

c© ANSYS, Inc. November 24, 2010 7

Page 8: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

4. Enable Specified Operating Density and retain the default setting of 1.225 kg/m3 forOperating Density.

Step 9: Dynamic Mesh Setup

1. Set the dynamic mesh parameters.

Dynamic Mesh

(a) Enable Dynamic Mesh.

(b) Enable Six DOF Solver.

(c) Ensure that Smoothing is enabled.

(d) Enable Remeshing from the Mesh Methods group box ans click Settings....

i. Click Smoothing tab and set the Spring Constant Factor to 0.5.

ii. Click Remeshing tab and set the remeshing parameters.

8 c© ANSYS, Inc. November 24, 2010

Page 9: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

A. Enter 0.056 m for Minimum Length Scale and 0.13 m for MaximumLength Scale.

The Minimum Length Scale and the Maximum Length Scale can be ob-tained from the Mesh Scale Info dialog box. Click on the Mesh ScaleInfo... button to open the Mesh Scale Info dialog box.

B. Enter 0.5 for Maximum Cell Skewness.

iii. Click OK to close Mesh Method Settings dialog box.

Six DOF Solver Settings includes Gravitational Acceleration setting and the WriteMotion History option. You already have set the Gravitational Acceleration in theOperating Conditions dialog box. If you want the motion history, enable WriteMotion History and specify the File Name.

c© ANSYS, Inc. November 24, 2010 9

Page 10: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

2. Set up the moving zones.

Dynamic Mesh (Dynamic Mesh Zones)−→ Create/Edit...

(a) Create the dynamic zone, moving box.

i. Select moving box from the Zone Names drop-down list.

ii. Ensure that Rigid Body is selected in the Type group box.

iii. Ensure that test box::libudf is selected from the Six DOF UDF drop-down list.

iv. Ensure that On is enabled in the Six DOF Solver Options group box.

v. Click Create.

ANSYS FLUENTwill create the dynamic zone moving box which will beavailable in the Dynamic Mesh Zones list.

i. Similarly, create the dynamic zone, moving fluid by also enabling Passive fromthe Six DOF Solver Options group box.

Ensure that you enable Passive from the Six DOF Solver Options group box.When Passive for the rigid body is enabled, ANSYS FLUENT does not takeforces and moments on the zone into consideration.

ANSYS FLUENTwill create the dynamic zone moving fluid which will beavailable in the Dynamic Mesh Zones list.

10 c© ANSYS, Inc. November 24, 2010

Page 11: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

(b) Close the Dynamic Mesh Zones dialog box.

Step 10: Mesh Preview

The purpose of the preview is to verify the quality of the mesh yielded by the mesh motionparameters. Since the flow is not initialized, the motion of the box will be vertical due togravity.

1. Save the case file (6dof-init.cas.gz).

File −→ Write −→Case...

2. Display the mesh.

Graphics and Animations −→ Mesh −→ Set Up...

3. Preview the motion.

Dynamic Mesh −→ Preview Mesh Motion...

(a) Enter 0.0005 for Time Step Size.

(b) Enter 1000 for Number of Time Steps.

(c) Click Preview (see Figure 3).

Figure 3: Mesh Motion at t = 0.5 s

c© ANSYS, Inc. November 24, 2010 11

Page 12: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

The motion is acceptable.

(d) Close the Mesh Motion dialog box.

4. Exit ANSYS FLUENT without saving.

Step 11: Solution

1. Start the 2D version of ANSYS FLUENT and read the case file (6dof-init.cas.gz).

2. Set the solution method parameters.

Solution Methods

(a) Ensure that SIMPLE is selected from the Scheme drop-down list.

(b) Select Green-Gauss Node Based from the Gradient drop-down list.

(c) Select Second Order Upwind for all the equations except Volume Fraction.

(d) Retain the default discretization method of Geo-Reconstruct for Volume Fraction.

12 c© ANSYS, Inc. November 24, 2010

Page 13: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

3. Set the solution control parameters.

Solution Controls

(a) Enter 0.5 for Body Forces in the Under-Relaxation Factors group box.

(b) Enter 0.8 for Turbulent Viscosity.

(c) Retain the default values for other parameters.

c© ANSYS, Inc. November 24, 2010 13

Page 14: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

4. Initialize the solution.

Solution Initialization

(a) Enter 0.001 m2/s2 for Turbulent Kinetic Energy and 0.001 m2/s3 for TurbulentDissipation Rate.

(b) Enter 1 for air Volume Fraction.

(c) Click Initialize.

5. Create an adaption register for patching.

Adapt −→Region...

(a) Set the Input Coordinates as follows:

Parameters ValuesX Min (m), X Max (m) (-5, 5)Y Min (m), Y Max(m) (-5, -1.5)

(b) Click Mark.

(c) Close the Region Adaption dialog box.

14 c© ANSYS, Inc. November 24, 2010

Page 15: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

6. Patch the air volume fraction.

Solution Initialization −→ Patch...

(a) Select air from the Phase drop-down list.

(b) Select Volume Fraction from the Variable list.

(c) Select hexahedron-r0 from the Registers to Patch list.

(d) Retain 0 for Value.

(e) Click Patch.

(f) Close the Patch dialog box.

7. Enable the plotting of residuals.

Monitors −→ Residuals −→ Edit...

(a) Enter 400 for Iterations to Plot.

(b) Click OK to close the Residual Monitors dialog box.

c© ANSYS, Inc. November 24, 2010 15

Page 16: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

8. Define a surface monitor for Y Velocity.

Monitors (Surface Monitors)−→ Create...

(a) Enable Print to Console, Plot, and Write for surf-mon-1.

(b) Retain the default setting of 2 for Window.

(c) Enter 6dof yvel.out for File Name.

(d) Select Flow Time from the X Axis drop-down list.

(e) Select Time Step from the Every drop-down list.

(f) Select Area-Weighted Average from the Report Type drop-down list.

(g) Select Velocity... and Y Velocity from the Field Variable drop-down lists.

(h) Select moving box from the Surfaces list and click OK to close the Surface Monitordialog box.

16 c© ANSYS, Inc. November 24, 2010

Page 17: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

9. Set the auto save option.

Calculation Activities

(a) Enter 100 for Autosave Every (Time Steps) and click Edit....

i. Enable Retain Only the Most Recent Files.

ii. Set the Maximum Number of Data Files to 2.

iii. Enter falling-box.gz for File Name.

ANSYS FLUENTwill append the timestep number so that each file will havea unique filename.

iv. Click OK to close the Autosave dialog box.

10. Save the hardcopy of display.

File −→Save Picture...

(a) Select TIFF from the Format list.

(b) Ensure that Color is selected from the Coloring list.

(c) Ensure that Raster is selected from the File Type list.

(d) Enter 800 (pixels) for Width and 600 (pixels) for Height in the Resolution groupbox.

(e) Click Apply and close the Save Picture dialog box.

c© ANSYS, Inc. November 24, 2010 17

Page 18: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

11. Execute commands for the animation setup.

Calculation Activities (Execute Commands)−→ Create/Edit...

(a) Set the Defined Commands to 4.

(b) Enable Active for all commands.

(c) Enter 100 for Every and select Time Step from the When drop-down list.

(d) Enter the commands as shown in the Execute Commands dialog box.

Ensure to create the subfolder tiff-files before clicking the OK button.

(e) Click OK to close the Execute Commands dialog box.

12. Display filled contour plots, enter the following command in the ANSYS FLUENTconsole.

> display set contours filled-contours yes

13. Run the calculation.

Run Calculation

(a) Enter 0.0005 s for Time Step Size.

(b) Enter 10000 for Number of Time Steps.

(c) Set Max Iterations/Time Step to 50.

(d) Click Calculate.

Step 12: Postprocessing

1. Convert the TIFF files in the subfolder tiff-files to form an animation sequence forpostprocessing purpose, using the software package like QuickTime or Fast MoviePlayer.

The contours of volume fraction of water at different time steps are as shown in Figures 4through 23.

18 c© ANSYS, Inc. November 24, 2010

Page 19: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

Figure 4: Contours at t = 0.25 s Figure 5: Contours at t = 0.5 s

Figure 6: Contours at t = 0.75 s Figure 7: Contours at t = 1.0 s

Figure 8: Contours t = 1.25 s Figure 9: Contours t = 1.5 s

c© ANSYS, Inc. November 24, 2010 19

Page 20: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

Figure 10: Contours at t = 1.75 s Figure 11: Contours at t = 2.0 s

Figure 12: Contours of at t = 2.25 s Figure 13: Contours at t = 2.5 s

Figure 14: Contours at t = 2.75 s Figure 15: Contours at t = 3.0 s

20 c© ANSYS, Inc. November 24, 2010

Page 21: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

Figure 16: Contours at t = 3.25 s Figure 17: Contours at t = 3.5 s

Figure 18: Contours at t = 3.75 s Figure 19: Contours at t = 4.0 s

Figure 20: Contours at t = 4.25 s Figure 21: Contours at t = 4.5 s

c© ANSYS, Inc. November 24, 2010 21

Page 22: 1.pdf

Tutorial: Solving a 2D Box Falling into Water

Figure 22: Contours at t = 4.75 s Figure 23: Contours at t = 5.0 s

Summary

This tutorial demonstrated the setup and solution of a dynamic mesh case along with the6DOF solver and the VOF multiphase model. The 6DOF UDF was used to calculate themotion of the box dropped into the water. The TIFF files created in the tutorial can beused to provide a graphic visualization of the solution.

22 c© ANSYS, Inc. November 24, 2010