Professional Documents
Culture Documents
Introduction
The purpose of this tutorial is to illustrate how to use a user defined function (UDF) to
control the dynamic mesh of a generic flow device with a rotating blade and a flexible
oscillating membrane. The motion of the rotating blade and the oscillating membrane have
a large amplitude which requires the use of local remeshing. The rotation of the blade, the
oscillation of the membrane, and the sliding of the nodes along the top wall of the housing
are defined and controlled by means of a UDF that utilizes the three macros specific to the
dynamic mesh model.
In this tutorial you will learn how to:
• Use the three DM-specific macros in a UDF to control the dynamic mesh.
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.
Problem Description
A generic flow device with a flexible oscillating membrane beneath it is shown in Figure 1.
The valve radius is 0.1 m.
c Fluent Inc. April 1, 2005 1
Tutorial: Using a UDF to Control the Dynamic Mesh
Preparation
1. Copy the mesh file, butterfly-flex.msh and the source file, butterfly-flex.c to
your working directory.
2
c Fluent Inc. April 1, 2005
Tutorial: Using a UDF to Control the Dynamic Mesh
c Fluent Inc. April 1, 2005 3
Tutorial: Using a UDF to Control the Dynamic Mesh
Grid
FLUENT 6.2 (2d, segregated, lam)
4
c Fluent Inc. April 1, 2005
Tutorial: Using a UDF to Control the Dynamic Mesh
Step 2: Models
c Fluent Inc. April 1, 2005 5
Tutorial: Using a UDF to Control the Dynamic Mesh
3. Click Build.
5. Click Load.
6
c Fluent Inc. April 1, 2005
Tutorial: Using a UDF to Control the Dynamic Mesh
#include "udf.h"
cg_omega[0] = 0.0;
cg_omega[1] = 0.0;
cg_omega[2] = omega;
}
c Fluent Inc. April 1, 2005 7
Tutorial: Using a UDF to Control the Dynamic Mesh
{
/* Set flag to indicate that the current node’s */
/* position has been updated, so that it will not be */
/* updated during a future pass through the loop: */
NODE_POS_UPDATED (node_p);
x = NODE_X (node_p);
ymag = sqrt (R*R - x*x) + 0.03;
yfull = ymag - 0.1;
y = - 0.1 + yfull * sin(theta);
NODE_Y (node_p) = y;
}
}
}
end_f_loop (f, tf);
}
The first section (under DEFINE CG MOTION) prescribes a constant angular rotation about the
z-axis, and is used to spin the valve. The second section (under DEFINE GEOM) defines a line
at y = R = 0.109 m; this line is coincident with the top wall of the housing and guides the
nodes as they slide along the top wall. The third section (under DEFINE GRID MOTION) con-
trols the motion of the nodes belonging to the membrane. The initial shape of the membrane
is that of a circular arc, and then it moves up and down harmonically.
Step 4: Dynamic Mesh Setup
The mesh is controlled using a combination of local remeshing with sizing functions and
spring smoothing.
8
c Fluent Inc. April 1, 2005
Tutorial: Using a UDF to Control the Dynamic Mesh
c Fluent Inc. April 1, 2005 9
Tutorial: Using a UDF to Control the Dynamic Mesh
(d) In the Remeshing tab, enable Size Function and specify the parameters as follows:
Parameter Value
Minimum Length Scale (m) 0.00236
Maximum Length Scale (m) 0.02
Maximum Cell Skewness 0.65
Size Remesh Interval 1
Size Function Resolution 3
Size Function Variation 0.5
Size Function Rate 0.99
10
c Fluent Inc. April 1, 2005
Tutorial: Using a UDF to Control the Dynamic Mesh
c Fluent Inc. April 1, 2005 11
Tutorial: Using a UDF to Control the Dynamic Mesh
(e) In the Meshing Options tab, specify a value of 0.002 for Cell Height.
12
c Fluent Inc. April 1, 2005
Tutorial: Using a UDF to Control the Dynamic Mesh
c Fluent Inc. April 1, 2005 13
Tutorial: Using a UDF to Control the Dynamic Mesh
14
c Fluent Inc. April 1, 2005
Tutorial: Using a UDF to Control the Dynamic Mesh
5. Repeat the procedure (a) through (c) for the zone, membrane-shadow.
c Fluent Inc. April 1, 2005 15
Tutorial: Using a UDF to Control the Dynamic Mesh
Grid (Time=1.5650e+00)
FLUENT 6.2 (2d, segregated, dynamesh, lam, unsteady)
16
c Fluent Inc. April 1, 2005
Tutorial: Using a UDF to Control the Dynamic Mesh
Summary
In this tutorial you modeled an oscillating membrane in a generic flow device with a rotating
blade using the DM model in FLUENT. The local remeshing scheme was used to define the
mesh motion. DM specific macros of a UDF were used to govern the rotational motion of
the blade, deformation of the membrane, and the sliding of the nodes on the top wall of the
housing.
c Fluent Inc. April 1, 2005 17