FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

20
Tutorial: Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model Introduction The dynamic mesh model in FLUENT can be used to model flows where the shape of the domain is changing with time due to motion on the domain boundaries. The motion can be either a prescribed motion (e.g., you can specify the linear and angular velocities about the center of gravity of a solid body with time) or an unprescribed motion where the subsequent motion is determined through a user-defined function (UDF). The update of the volume mesh is handled automatically by FLUENT at each time step based on the new positions of the boundaries. To use the dynamic mesh model, you need to provide a starting volume mesh and the description of the motion of any moving zones in the model. This tutorial demonstrates the use of FLUENT’s dynamic mesh capabilities for a vibromixer, a device with a perforated (cylindrical) plate of small thickness that moves with a sinusoidal motion which is implemented through a UDF. In this tutorial you will learn how to: Set up a problem for a dynamic mesh Specify dynamic mesh modeling parameters Specify the motion of dynamic zones Preview the dynamic mesh before starting the calculation Perform basic dynamic mesh calculations with residual plotting Examine the pressure and velocity fields using graphics Prerequisites This tutorial assumes that you are familiar with the FLUENT interface and have completed Tutorial 1 from the FLUENT 6.2 Tutorial Guide. Some of the basic steps in the setup and solution procedures will not be shown explicitly. You should be familiar with the dynamic mesh model. If you are not, you can refer Section 10.6: Dynamic Meshes in the FLUENT 6.2 User’s Guide. c Fluent Inc. April 1, 2005 1

Transcript of FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Page 1: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Tutorial: Solving a 2D Vibromixer Problem Using the

Dynamic Mesh Model

Introduction

The dynamic mesh model in FLUENT can be used to model flows where the shape of thedomain is changing with time due to motion on the domain boundaries. The motion can beeither a prescribed motion (e.g., you can specify the linear and angular velocities about thecenter of gravity of a solid body with time) or an unprescribed motion where the subsequentmotion is determined through a user-defined function (UDF).

The update of the volume mesh is handled automatically by FLUENT at each time stepbased on the new positions of the boundaries. To use the dynamic mesh model, you needto provide a starting volume mesh and the description of the motion of any moving zonesin the model.

This tutorial demonstrates the use of FLUENT’s dynamic mesh capabilities for a vibromixer,a device with a perforated (cylindrical) plate of small thickness that moves with a sinusoidalmotion which is implemented through a UDF.

In this tutorial you will learn how to:

• Set up a problem for a dynamic mesh

• Specify dynamic mesh modeling parameters

• Specify the motion of dynamic zones

• Preview the dynamic mesh before starting the calculation

• Perform basic dynamic mesh calculations with residual plotting

• Examine the pressure and velocity fields using graphics

Prerequisites

This tutorial assumes that you are familiar with the FLUENT interface and have completedTutorial 1 from the FLUENT 6.2 Tutorial Guide. Some of the basic steps in the setup andsolution procedures will not be shown explicitly. You should be familiar with the dynamicmesh model. If you are not, you can refer Section 10.6: Dynamic Meshes in the FLUENT6.2 User’s Guide.

c© Fluent Inc. April 1, 2005 1

Page 2: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

Preparation

1. Copy the files, vibromix2d.msh, vibromix bin.scm, vibromix.bin and vibromix-2d.cto your working directory.

2. Start the 2D version of FLUENT.

Setup and Solution

Step 1: Grid

1. Read the grid file, vibromix2d.msh.

File −→ Read −→Case...

As the mesh file is read in, messages will appear in the console window reporting theprogress of the reading.

2. Check the grid.

Grid −→Check

FLUENT will perform various checks on the mesh and will report the progress in theconsole window. Pay attention to the reported minimum volume and make sure thisis a positive number.

3. Display the grid (Figure 1).

Display −→Grid...

2 c© Fluent Inc. April 1, 2005

Page 3: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

(a) Under Surfaces, keep the default selection of the surfaces.

(b) Click Display and close the panel.

Figure 1 displays the three fluid zones: bottom-zone, moving zone (mid zone) andtop zone.

Figure 1: Grid for the 2D Vibromixer Geometry

c© Fluent Inc. April 1, 2005 3

Page 4: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

Step 2: Models

1. Enable a time-dependent calculation.

Define −→ Models −→Solver...

(a) Select Unsteady under Time.

(b) Keep the default Unsteady Formulation of 1st-Order Implicit.

Dynamic mesh simulations currently work only with first-order time advance-ment.

4 c© Fluent Inc. April 1, 2005

Page 5: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

2. Turn on the standard k-ε viscous model with standard wall functions.

Define −→ Models −→Viscous...

3. Read the scheme file for specifying motion parameters (vibromix bin.scm).

File −→ Read −→Scheme...

The scheme file, vibromix bin.scm, loads the vibromix.bin file, which creates theDefine/User-Defined/Motion Parameters... menu item. This panel that is opened usingthis menu item is used to specify the frequency and amplitude values of the motion.

4. Set the frequency and amplitude motion parameters.

Define −→ User-Defined −→Motion Parameters...

(a) Set the Frequency to 10 Hz.

(b) Set the Amplitude to 0.1 m.

c© Fluent Inc. April 1, 2005 5

Page 6: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

Step 3: Materials

1. Copy liquid water from the materials database.

Define −→Materials...

(a) Click the Fluent Database... button in the Materials panel.

The Fluent Database Materials panel will open.

(b) In the list of Fluent Fluid Materials, select water-liquid (h2o<l>).

(c) Click Copy to copy the information for liquid water to your model.

(d) Close the Fluent Database Materials panel and the Materials panel.

6 c© Fluent Inc. April 1, 2005

Page 7: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

Step 4: Boundary Conditions

Define −→Boundary Conditions...

In this step, you will change the fluid type to water for each one of the three fluid zones -bottom-zone, moving zone, and top zone

1. Set the conditions for the fluid, bottom-zone.

(a) Select water-liquid in the Material Name drop-down list.

c© Fluent Inc. April 1, 2005 7

Page 8: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

2. Set the conditions for the fluid, moving zone.

(a) Select water-liquid in the Material Name drop-down list.

3. Set the conditions for the fluid, top zone.

(a) Select water-liquid in the Material Name drop-down list.

Step 5: User-Defined Function

1. Compile the UDF, vibromix-2d.c, using the Compiled UDFs panel.

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

(a) Make sure that the UDF source file, vibromix-2d.c, is in the same directorythat contains your case and data files.

(b) Select the UDF source file by clicking Add... under Source Files in the CompiledUDFs panel.

This will open the Select File panel.

(c) In the Select File panel, select vibromix-2d.c.

(d) In the Compiled UDFs panel, enter the name of your library directory (e.g.,libudf2d) and click Build to build a shared library for your source file.

(e) Click Load to link your shared library to the FLUENT executable.

8 c© Fluent Inc. April 1, 2005

Page 9: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

Step 6: Mesh Motion Setup

1. Activate dynamic mesh motion and specify the associated parameters.

Define −→ Dynamic Mesh −→Parameters...

(a) Under Models, select Dynamic Mesh.

The panel will expand to show additional inputs.

(b) Under Mesh Methods, deselect Smoothing and select Layering.

Make sure the Smoothing and Remeshing methods are turned off.

(c) Retain the default settings for the split and collapse factors.

These factors allow you to vary the cell split and collapse characteristics alongwith the motion of the moving zone.

(d) Click OK.

c© Fluent Inc. April 1, 2005 9

Page 10: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

2. Specify the dynamic zones.

Define −→ Dynamic Mesh −→Zones...

(a) In the Zone Names drop-down list, select bottom-interior.

(b) Under Type, keep the default setting of Rigid Body.

(c) Click the Meshing Options tab.

(d) Set the Cell Height for the adjacent moving zone and bottom-zone to 0.03 and0.05 respectively.

(e) Click Create.

(f) In the Zone Names drop-down list, select top-interior.

(g) Under Type, keep the default setting of Rigid Body.

(h) Click the Meshing Options tab.

(i) Keep the default of 0.03 and 0.05 for Cell Height of the adjacent moving zoneand top zone respectively.

(j) Click Create.

(k) In the Zone Names drop-down list, select moving zone.

(l) Under Type, keep the default setting of Rigid Body.

(m) Click Create.

(n) Close the Dynamic Mesh Zones panel.

10 c© Fluent Inc. April 1, 2005

Page 11: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

3. Initialize the computational domain.

Solve −→ Initialize −→Initialize...

(a) Set the Turbulence Kinetic Energy to 0.001 m2/s2.

(b) Set the Turbulence Dissipation Rate to 0.001 m2/s3.

(c) Click Init and close the panel.

4. Set the display options.

Display −→Options...

c© Fluent Inc. April 1, 2005 11

Page 12: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

(a) Select Double Buffering to ensure a non-flickering display of the mesh motion.

5. Save the case and data file.

File −→ Write −→Case & Data...

6. Preview the mesh motion.

Solve −→Mesh Motion...

The zone motion preview utility is useful for quickly checking rigid body motion set-tings. User errors, such as an improperly scaled mesh, can be quickly identified usingthis procedure.

(a) Under Time, set the Time Step Size to 0.001 s.

(b) Under Time, set the Number of Time Steps to 100.

(c) Click Preview.

Step 7: Solution

1. Read the previously saved case and data file back into FLUENT.

File −→ Read −→Case & Data...

Since the preview of the mesh altered the initial location of moving part, it is recom-mended that you read the case and data file that you have saved before the preview.

2. Enable the plotting of static pressure in the domain during the calculation by defininga volume monitor (see Figure 3).

Solve −→ Monitors −→Volume...

12 c© Fluent Inc. April 1, 2005

Page 13: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

(a) Increase the number of Volume Monitors to 1.

(b) Turn on Plot and Write for the first monitor.

Note: When the Write option is selected in the Volume Monitors panel, thevolume-averaged temperature history will be written to a file. If you do notselect the Write option, the history information will be lost when you exitFLUENT.

(c) In the Every drop-down list, select Time Step for the monitor frequency.

(d) Click Define... to define the monitor.

The Define Volume Monitor panel will open automatically.

i. In the Report Type drop-down list, keep Volume Integral.

ii. In the X-Axis drop-down list, select Flow-Time.

c© Fluent Inc. April 1, 2005 13

Page 14: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

iii. In the Field Variable drop-down lists, select Pressure... and Static Pressure.

iv. In the Cell Zones list, select all zones.

v. In the File Name field, enter total-vol.out.

vi. Click OK in the Define Volume Monitor panel, and then in the Volume Mon-itors panel.

3. Enable the plotting of residuals during the calculation.

Solve −→ Monitors −→Residuals...

(a) Select Plot under Options.

(b) Click OK to close the Residual Monitors panel.

4. Open the command monitor window.

Solve −→Execute Commands...

14 c© Fluent Inc. April 1, 2005

Page 15: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

(a) Increase the number of Defined Commands to 6.

(b) Turn each command on by clicking the check buttons under On.

(c) For all commands set Every to 5 and When to Time Step.

(d) Specify the commands as shown in the Execute Commands panel.

Note: These commands capture the contours of velocity magnitude, static pres-sure, and velocity vectors after every five timesteps. and save the images inthe working directory. The ’%t’ appended to the file name instructs FLUENTto append the timestep index to the filename. It is possible to specify multipletext commands in a single entry. Be sure to maintain at least a single spacebetween commands.

(e) To save the images in tiff format, set the options in the Graphics Hardcopy panel.In the panel, select TIFF under Format and Color under Coloring and keep all theother options unchanged.

(f) Click OK.

(g) For filled contour plots enter the following command in the FLUENT console.

> display set contours filled-contours yes

(h) To set the scale factor for the vector display, you can enter the following commandin the FLUENT console.

> display set velocity-vectors scale 8

The default length scale is 1.

c© Fluent Inc. April 1, 2005 15

Page 16: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

5. Specify the time-stepping parameters.

Solve −→Iterate...

(a) Set the Time Step Size to 0.001 s.

(b) Set the Number of Time Steps to 215.

6. Start the calculation.

7. Save the case and the data files.

File −→ Write −→Case & Data...

16 c© Fluent Inc. April 1, 2005

Page 17: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

Scaled Residuals (Time=2.1500e-01)FLUENT 6.2 (2d, segregated, dynamesh, ske, unsteady)

Iterations450040003500300025002000150010005000

1e+01

1e+00

1e-01

1e-02

1e-03

1e-04

1e-05

1e-06

1e-07

1e-08

epsilonky-velocityx-velocitycontinuityResiduals

Figure 2: Scaled Residuals

Convergence history of Static Pressure on bottom-zone etc. (Time=2.1500e-01)FLUENT 6.2 (2d, segregated, dynamesh, ske, unsteady)

Flow Time

(pascal)(m3)IntegralVolume

Total

0.22500.20000.17500.15000.12500.10000.07500.05000.02500.0000

1500000.0000

1000000.0000

500000.0000

0.0000

-500000.0000

-1000000.0000

-1500000.0000

total-volMonitors

Figure 3: Convergence History of Static Pressure

c© Fluent Inc. April 1, 2005 17

Page 18: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

Step 8: Postprocessing

1. Display filled contours of static pressure (Figure 4).

Display −→Contours...

(a) Under Options, select Filled.

(b) In the Contours of drop-down lists, select Pressure... and Static Pressure.

(c) Click Display.

2. Display filled contours of velocity magnitude (Figure 5).

(a) In the Contours of drop-down lists, select Velocity... and Velocity Magnitude.

(b) Click Display.

18 c© Fluent Inc. April 1, 2005

Page 19: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

Contours of Static Pressure (pascal) (Time=2.1500e-01)FLUENT 6.2 (2d, segregated, dynamesh, ske, unsteady)

1.35e+051.02e+056.97e+043.72e+044.62e+03-2.79e+04-6.05e+04-9.30e+04-1.26e+05-1.58e+05-1.91e+05-2.23e+05-2.56e+05-2.88e+05-3.21e+05-3.53e+05-3.86e+05-4.19e+05-4.51e+05-4.84e+05-5.16e+05

Figure 4: Contours of Static Pressure

Contours of Velocity Magnitude (m/s) (Time=2.1500e-01)FLUENT 6.2 (2d, segregated, dynamesh, ske, unsteady)

2.73e+012.60e+012.46e+012.32e+012.19e+012.05e+011.91e+011.78e+011.64e+011.50e+011.37e+011.23e+011.09e+019.57e+008.20e+006.83e+005.47e+004.10e+002.73e+001.37e+000.00e+00

Figure 5: Contours of Velocity Magnitude

c© Fluent Inc. April 1, 2005 19

Page 20: FLUENT - Tutorial - Dynamic Mesh - Solving a 2D Vibromixer Problem

Solving a 2D Vibromixer Problem Using the Dynamic Mesh Model

3. Display the velocity vectors (Figure 6).

Display −→Vectors...

(a) Select Velocity... and Velocity Magnitude in the Color by drop-down list.

(b) Click Display.

Velocity Vectors Colored By Velocity Magnitude (m/s) (Time=2.1500e-01)FLUENT 6.2 (2d, segregated, dynamesh, ske, unsteady)

2.74e+012.60e+012.46e+012.33e+012.19e+012.05e+011.92e+011.78e+011.64e+011.51e+011.37e+011.23e+011.10e+019.59e+008.22e+006.85e+005.48e+004.11e+002.74e+001.37e+008.13e-04

Figure 6: Velocity Vectors

Summary

In this tutorial you learned how to use the dynamic mesh model in FLUENT to model avibromixer.

20 c© Fluent Inc. April 1, 2005