You are on page 1of 17

Tutorial: Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

Introduction
The purpose of this tutorial is to demonstrate how to simulate a check valve with small displacement using the dynamic mesh model in FLUENT. As the displacement of the check valve ball in this case is small, the spring smoothing approach is suitable for this problem. A pure hex mesh is used for this case since only smoothing is used. Two dynamic mesh UDFs are used, one for the valve motion specication and one for the axis deformation specication. This tutorial demonstrates how to do the following: Set up a problem using the dynamic mesh model. Specify dynamic mesh modeling parameters. Specify a rigid body motion zone. Specify a deforming zone. Preview the dynamic mesh before starting the calculation. Set up an animation for the stream function. Perform the calculation with residual plotting. Examine the pressure and velocity elds using graphics.

Prerequisites
This tutorial assumes that you are familiar with the FLUENT interface and have completed Tutorial 1 from the FLUENT 6.3 Tutorial Guide. You should also be familiar with the dynamic mesh model. Refer to Section 11.7: Steps in Using Dynamic Meshes in the FLUENT 6.3 Users Guide for more information on the use of the dynamic mesh model.

Problem Description
The problem considered is shown schematically in Figure 1. A 2D axisymmetric check valve geometry is used. A velocity inlet and pressure outlet are used. The valve is not driven by the ow in this case. Instead, a prescribed motion is used. 1

c Fluent Inc. July 21, 2006

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

The motion of the check valve ball is limited to a small distance and hence, the spring smoothing approach is suitable. The motion of the ball is prescribed by a user-dened function (UDF). The mesh axis is set to deforming to prevent formation of skewed cells at the intersection of the check valve ball and the axis.

Outlet Inlet Ball

Deforming Axis

Figure 1: Problem Schematic

Preparation
1. Copy the les, check-valve-2d.msh and check-valve-2d.c to your working folder. 2. Start the 2D (2d) version of FLUENT.

Setup and Solution


Step 1: Grid 1. Read the mesh le check-valve-2d.msh. 2. Check the grid. FLUENT will perform various checks on the mesh and report the progress in the console. Make sure that the minimum volume reported is a positive number. 3. Display the grid (Figure 2). (a) Retain the default settings. (b) Click Display and close the Grid Display panel.

c Fluent Inc. July 21, 2006

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

Grid

FLUENT 6.3 (2d, pbns, lam)

Figure 2: Grid Display

Step 2: Models 1. Enable axisymmetric, time-dependent calculations. Dene Models Solver... (a) Select Axisymmetric from the Space list. (b) Select Unsteady from the Time list. (c) Retain the default Unsteady Formulation of 1st-Order Implicit. Dynamic mesh simulations currently work only with rst-order time advancement. (d) Click OK to close the Solver panel. 2. Enable the standard k-epsilon model with standard wall functions. Dene Models Viscous... Step 3: Materials Dene Materials... 1. Retain the default properties of air. 2. Close the Materials panel.

c Fluent Inc. July 21, 2006

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

Step 4: Operating Conditions Dene Operating Conditions... 1. Retain the default settings for all the parameters. 2. Close the Operating Conditions panel. Step 5: Boundary Conditions In this step, you will set the inlet conditions and change some wall zones to axis zones. Dene Boundary Conditions... 1. Dene boundary conditions for the inlet zone. (a) Enter 2 m/s for the Velocity Magnitude. (b) Retain the selection of Magnitude, Normal to Boundary in the Velocity Specication Method drop-down list. (c) Select Intensity and Viscosity Ratio from the Specication Method drop-down list in the Turbulence group box. (d) Retain the default settings for Turbulent Intensity and Turbulent Viscosity Ratio. (e) Click OK to close the Velocity Inlet panel. 2. Change the wall left zone to an axis zone. (a) Select wall left from the Zone list and axis from the Type list. A Question dialog box will open, asking if you want to change wall lefts type to axis. (b) Click Yes to close the Question dialog box. The Axis panel will open, giving the default name for the axis zone.

i. Enter axis1 for Zone Name. ii. Click OK to close the Axis panel. 3. Similarly, change the wall right zone to an axis zone named axis2. 4. Close the Boundary Conditions panel.

c Fluent Inc. July 21, 2006

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

Step 6: Compile the UDF Two UDFs are used in this example. The DEFINE CG MOTION UDF is used to prescribe the velocity of the valve. The DEFINE GEOM UDF is used for the axis. Without this UDF, the nodes on the axis will be stationary and will cause skewed elements. To allow for smoothing, you will dene a deforming zone. The DEFINE GEOM UDF used for the deforming zone denes the projection of the nodes on the deforming zones back to the axis. Dene User-Dened Functions Compiled... 1. Click the Add... button in the Source Files group box. The Select File dialog will open. 2. Select the le check-valve-2d.c and click OK to close the Select File dialog. 3. Click Build to build the library. A Warning dialog box will open, warning you to make sure that the UDF source les are in the directory that contains the case and data les. 4. Click OK to close the Warning dialog box. FLUENT will set up the directory structure and compile the code. The compilation will be displayed in the console. 5. Click Load to load the library. 6. Close the Compiled UDFs panel.

c Fluent Inc. July 21, 2006

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

Step 7: Mesh Motion Setup 1. Enable dynamic mesh motion and specify the associated parameters. Dene Dynamic Mesh Parameters... (a) Enable Dynamic Mesh in the Models group box. The Dynamic Mesh Parameters panel will expand to show additional inputs.

(b) Enable Smoothing in the Mesh Methods group box. Make sure that the Layering and Remeshing options are disabled. (c) Enter 0.1 for the Spring Constant Factor. (d) Enter 50 for Number of Iterations. (e) Click OK to close the Dynamic Mesh Parameters panel.

c Fluent Inc. July 21, 2006

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

2. Specify the motion of the check valve ball and the deforming axis. Dene Dynamic Mesh Zones... (a) Specify the motion of the check valve ball.

i. Select valve from the Zone Names drop-down list. ii. Retain the selection of Rigid Body in the Type list. iii. Select valve::libudf from the Motion UDF/Prole drop-down list. iv. Retain the default value of 0 m for Cell Height in the Meshing Options tab. v. Click Create. FLUENT will create the dynamic zone valve which will be available in the Dynamic Zones list.

c Fluent Inc. July 21, 2006

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

(b) Specify the motion of the deforming axis.

i. Select axis1 from the Zone Names drop-down list. ii. Select Deforming from the Type list. iii. Click the Geometry Denition tab and set the following parameters: A. Select user-dened from the Denition drop-down list. B. Select axis1::libudf from the Geometry UDF drop-down list.

c Fluent Inc. July 21, 2006

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

iv. Click the Meshing Options tab and set the following parameters: A. Enable Smoothing and disable Remeshing in the Methods group box. B. Retain the default settings for the remaining parameters. v. Click Create. FLUENT will create the dynamic zone axis1 which will be available in the Dynamic Zones list. vi. Select axis2 from the Zone Names drop-down list. vii. Retain the selection of Deforming in the Type list. viii. Click the Geometry Denition tab and set the following parameters: A. Select user-dened from the Denition drop-down list. B. Select axis2::libudf from the Geometry UDF drop-down list. ix. Click the Meshing Options tab and set the following parameters: A. Enable Smoothing and disable Remeshing in the Methods group box. B. Retain the default settings for the remaining parameters. x. Click Create. FLUENT will create the dynamic zone axis2 which will be available in the Dynamic Zones list.

c Fluent Inc. July 21, 2006

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

(c) Close the Dynamic Mesh Zones panel. 3. Enable hex-mesh smoothing using the TUI commands shown in boxes. You may need to press the <Enter> key to get the > prompt.
> define/models/dynamic-mesh-controls <Enter> <Enter> <Enter>

define/models/dynamic-mesh-controls > sp

define/models/dynamic-mesh-controls/smoothing-parameter > soas spring-based smoothing for all cell types [no] yes <Enter>

4. Preview the mesh motion. (a) Save the case le (check-valve-2d.cas.gz). (b) Display the grid. i. Select all the surfaces and click Display. ii. Zoom in to the area of interest. iii. Close the Grid Display panel. (c) Preview the mesh motion. Solve Mesh Motion... i. Enter 0.02 s for Time Step Size. ii. Enter 200 for Number of Time Steps. iii. Click Preview. Make sure that the grid does not get too skewed. iv. Close the Mesh Motion panel.

10

c Fluent Inc. July 21, 2006

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

Step 8: Solution 1. Read the case le check-valve-2d.cas.gz. 2. Request saving of case and data les every 50 time steps. File Write Autosave...

(a) Enter 50 for both Autosave Case File Frequency and Autosave Data File Frequency. (b) Enter check-valve-2d for File Name. (c) Click OK to close the Autosave Case/Data panel. 3. Retain the default solution control parameters. Solve Controls Solution... 4. Enable the plotting of residuals during the calculation. Solve Monitors Residual... (a) Enable Plot in the Options group box. (b) Click OK to close the Residual Monitors panel. 5. Initialize the ow eld using the boundary conditions set at the inlet. Solve Initialize Initialize... (a) Select inlet from the Compute From drop-down list. (b) Click Init and close the Solution Initialization panel. 6. Create an animation sequence to view the stream function during the motion of the check valve ball. Solve Animate Dene... (a) Set Animation Sequences to 1. (b) Set Every to 5 and select Time Step from the When drop-down list for sequence-1.

c Fluent Inc. July 21, 2006

11

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

(c) Click the Dene... button to open the Animation Sequence panel.

i. Set Window to 1 and click Set. ii. Select Contours from the Display Type list. The Contours panel will open.

A. Retain the default settings in the Options group box. B. Select Velocity... and Stream Function from the Contours of drop-down lists. C. Click Display and close the Contours panel.

12

c Fluent Inc. July 21, 2006

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

iii. Click OK to close the Animation Sequence panel. The Active checkbox for sequence-1 will be enabled in the Solution Animation panel. (d) Click OK to close the Solution Animation panel. 7. Save the case le (check-valve-2d.cas.gz). 8. Start the calculation for 200 time steps. Solve Iterate... (a) Enter 0.02 s for Time Step Size. (b) Enter 200 for Number of Time Steps. (c) Click Iterate. (d) Close the Iterate panel. Step 9: Postprocessing 1. Play back the animation. Solve Animate Playback...

(a) Set the Replay Speed slider to Fast. (b) Click the button.

As the animation starts playing, you can see the movement of the check valve ball. You may enable Double Buering in the Display Options panel to improve the visualization.

c Fluent Inc. July 21, 2006

13

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

(c) Save the animation in MPEG movie format. i. Select MPEG from the Write/Record Format drop-down list. ii. Click Write. (d) Close the Playback panel. 2. Inspect the solution. (a) Display lled contours of velocity magnitude (Figure 3). Display Contours... i. Select Velocity... and Velocity Magnitude from the Contours of drop-down lists. ii. Enable Filled in the Options group box. iii. Click Display.

Figure 3: Contours of Velocity Magnitude

14

c Fluent Inc. July 21, 2006

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

(b) Display lled contours of static pressure (Figure 4). i. Select Pressure... and Static Pressure from the Contours of drop-down lists. ii. Display the mirrored view. Display Views...

A. Select axis-1 and axis-2 from the Mirror Planes selection list. B. Click Apply and close the Views panel. iii. Click Display and close the Contours panel.

6.03e+01 5.46e+01 4.89e+01 4.32e+01 3.75e+01 3.18e+01 2.61e+01 2.04e+01 1.47e+01 9.01e+00 3.32e+00 -2.38e+00 -8.07e+00 -1.38e+01 -1.95e+01 -2.52e+01 -3.08e+01 -3.65e+01 -4.22e+01 -4.79e+01 -5.36e+01

Contours of Static Pressure (pascal) (Time=4.0000e+00) FLUENT 6.3 (axi, pbns, dynamesh, ske, unsteady)

Figure 4: Contours of Static Pressure

c Fluent Inc. July 21, 2006

15

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

(c) Display velocity vectors (Figure 5). Display Vectors...

i. Set Scale to 5. ii. Increase Skip to 1. iii. Select Velocity... and Stream Function from the Color by drop-down lists. iv. Click Display and close the Vectors panel.

16

c Fluent Inc. July 21, 2006

Simulating a 2D Check Valve using FLUENTs Dynamic Mesh Model and Spring Smoothing

1.86e+00 1.76e+00 1.67e+00 1.58e+00 1.49e+00 1.39e+00 1.30e+00 1.21e+00 1.11e+00 1.02e+00 9.29e-01 8.36e-01 7.43e-01 6.51e-01 5.58e-01 4.65e-01 3.72e-01 2.79e-01 1.86e-01 9.35e-02 6.44e-04

Velocity Vectors Colored By Stream Function (kg/s) (Time=4.0000e+00) FLUENT 6.3 (axi, pbns, dynamesh, ske, unsteady)

Figure 5: Velocity Vectors

Summary
In this tutorial, you used the spring smoothing option for the dynamic mesh feature in FLUENT. The motion was limited to small distances. The spring smoothing option was activated using the TUI since the grid used is a pure hex mesh. The motion was prescribed by a user-dened function (UDF) which was compiled and loaded into FLUENT. The axis was also set to deforming to prevent formation of skewed cells at the intersection of the check valve ball and the axis.

c Fluent Inc. July 21, 2006

17

You might also like