152
Dynamic Mesh Case Studies (FLUENT 6.1) Christoph Hiemcke 9 June 2004

41658132 Dynamic Mesh

Embed Size (px)

Citation preview

Page 1: 41658132 Dynamic Mesh

Dynamic Mesh Case Studies (FLUENT 6.1)

Christoph Hiemcke

9 June 2004

Page 2: 41658132 Dynamic Mesh

Purpose of this session

• Show you how to use the controls for the Dynamic Mesh (DM) model, based on a few examples

• Show you how to write simple UDFs that control the dynamic zones, based on a few examples

• Show you the new features in FLUENT 6.2

• To have the examples motivate you – what application might you use the model for ?

Slide 0-1

Page 3: 41658132 Dynamic Mesh

Agenda

Overview of the Dynamic Mesh (DM) Model

Dynamic Meshing Schemes:i. Layering for Linear Motionii. Spring Smoothing for Small, General Motioniii. Local Remeshing for Large, General Motioniv. Local Remeshing with Size Functions

UDF Macros to Govern the Dynamic Mesh:v. Coupled Mesh Motion via the 6 DOF UDFvi. Controlling Rigid Body Motion using

DEFINE_CG_MOTIONvii. Controlling Projection onto Deforming Boundaries using

DEFINE_GEOM viii. Controlling the Motion of Individual Nodes using

DEFINE_GRID_MOTIONix. Miscellaneous UDF Examples

New Features in FLUENT 6.2

Slide 0-2

Page 4: 41658132 Dynamic Mesh

I. Overview of the Dynamic Mesh (DM) Model

Slide 1-1

Page 5: 41658132 Dynamic Mesh

What is the Dynamic Mesh (DM) Model?

A method by which the solver (FLUENT) can be instructed to moveboundaries and/or objects, and to adjust the mesh accordingly

Examples:Automotive piston moving inside a cylinderA flap moving on an airplane wingA valve opening and closingAn artery expanding and contracting

Volumetric fuel pump

Slide 1-2

Page 6: 41658132 Dynamic Mesh

Why Use the Dynamic Mesh Model?

Used when rigid boundaries move with respect to each other, e.g.,

Piston moving w.r.t. an engine cylinder (linear motion)Flap moving w.r.t. an airplane wing (rotating motion)Two stages of a rocket that move away from each other (stage separation)A rescue pod being dropped from an airplane (store separation)

Used when boundaries deform, e.g.,

A balloon that is being inflatedAn arterial wall responding to the pressure pulse from the heartA solid propellant retreating as it is being consumed by the flameThe shrinking or extending walls of an engine cylinder as the piston moves in and out

Slide 1-3

Page 7: 41658132 Dynamic Mesh

Dynamic Mesh (DM) Model: Schemes

The DM model makes use of three meshing schemes, and we will look at them one at a time in the next three sections:

LayeringSpring SmoothingLocal Remeshing

The topic of the next section is the layering method.

Slide 1-4

Page 8: 41658132 Dynamic Mesh

II. Layering for Linear Motion

Slide 2-1

Page 9: 41658132 Dynamic Mesh

Layering: Introduction

Layering involves the creation and destruction of cells;Available for quad, hex and wedge mesh elements;Layering is used for purely linear motion – two examples are:

A piston moving inside a cylinder (see animation);A box on a conveyor belt.

We will now look at these two examples.

Slide 2-2

Page 10: 41658132 Dynamic Mesh

Layering Example 1: PistonFor the piston, the piston wall is moved up and down;The motion is governed by the “in-cylinder” controls (see panel below):

Piston wall moves

Complex geometry near cylinder head is tri meshed

Slide 2-3

Page 11: 41658132 Dynamic Mesh

Layering Example 1: Piston

Cells are being split or collapsed as the piston wall comes near (explanation on the next page):

Slide 2-4

Page 12: 41658132 Dynamic Mesh

Layering Example 1: PistonSplit if: Collapse if:

hideal is defined later, during the definition of the dynamic zones.

idealS hh )1( α+>

idealchh α<

Slide 2-5

Page 13: 41658132 Dynamic Mesh

Layering Example 1: PistonConstant Height:

Every new cell layer has the same height;Constant Ratio:

Maintain a constant ratio of cell heights between layers (linear growth);Useful when layering is done in curved domains (e.g. cylindrical geometry).

Initially, piston at

bottom-most position

Piston at top-most position

Edge “i”

Edges “i” and “i+1” have same shape

Edge “i+1” is an average of edge “i” and the piston shape

Constant Height

Constant Ratio

Slide 2-6

Page 14: 41658132 Dynamic Mesh

Layering Example 1: Piston

Definition of the dynamic zone:

piston (wall zone) moves as a rigid body in the y-direction

Slide 2-7

Page 15: 41658132 Dynamic Mesh

Layering Example 1: PistonDefinition of the ideal height of a cell layer;hideal is about the same as the height of a typical cell in the model.

Slide 2-8

Page 16: 41658132 Dynamic Mesh

Layering Example 2: Conveyor Belt

A box on a conveyor belt moves through a curing oven;Layering is limited to the fluid zone adjacent to the box;Cell layers in the dynamic zone slide past the static zone at a non-conformal, sliding grid interface.

Oven interior

box

Hot air

Cool exterior

Dynamic zone

Static zone

Grid interface

Slide 2-9

Page 17: 41658132 Dynamic Mesh

Layering Example 2: Conveyor Belt

Layering is limited to the fluid zone adjacent to the box;Cell layers in the dynamic zone slide past the static zone at a non-conformal, sliding grid interface.

Slide 2-10

Page 18: 41658132 Dynamic Mesh

Layering Example 2: Conveyor Belt

TIP: Within Gambit, be sure that the two fluid zones are totally disconnected;Even nodes on the interface must be disconnected (i.e., duplicate).

Dynamic zone

Static zone

Faces are disconnected here at the interface!

Slide 2-11

Page 19: 41658132 Dynamic Mesh

Layering Example 2: Conveyor Belt

Dynamic Mesh Parameters:Layering enabled;“Constant Height” option (explained before);Set up split and collapse factors (explained before).

Slide 2-12

Page 20: 41658132 Dynamic Mesh

Layering Example 2: Conveyor Belt

A profile is read in to drive the motion at a constant 1 m/s in the x-direction (File > Read > Profile)The fluid zone adjacent to the box will be moved as a rigid body at constant speed;Similarly, the box walls move as rigid bodiesas well (otherwise the velocity boundary conditions will not be correct).

((oven 2 point)

(time 0 15.0)

(v_x 1.0 1.0)

)x-velocity

(m/s)

Time (sec)

1.0

0.0 15.0

FLUENT profile:

Slide 2-13

Page 21: 41658132 Dynamic Mesh

Layering Example 2: Conveyor Belt

Cell layers in the dynamic zone slide past the static zone at a non-conformal, sliding grid interface;Define > Grid InterfacesThe geometry of the interface is shown on the next slide.

Slide 2-14

Page 22: 41658132 Dynamic Mesh

Layering Example 2: Conveyor Belt

Geometry of the non-conformal, sliding grid interface:

interface-top (three line segments)

interface-bottom (single line segment)

fluid-moving

fluid-static

Slide 2-15

Page 23: 41658132 Dynamic Mesh

Layering Example 2: Conveyor Belt

The fluid zone adjacent to the box (called “fluid-moving”) is moved as a rigid body at constant speed;The walls of the box (“wall-box”) should also be specified as dynamic zones that move as a rigid body: otherwise the wall velocities will be wrong;The motion is governed by the profile with the identifier “oven”;The CG location is given but not needed, since there is no rotation;The next slide will discuss the other two dynamic zones;

Slide 2-16

Page 24: 41658132 Dynamic Mesh

Layering Example 2: Conveyor Belt

Cells are being split or collapsed at two edges on the domain boundary, to the left and right of the box;The two edges are defined as “stationary zones”.

Cell creation at stationary edge “inlet-left-bottom”

Cell destruction at stationary edge “outlet-right-bottom”

“fluid-moving”

Slide 2-17

Page 25: 41658132 Dynamic Mesh

Layering Example 2: Conveyor Belt

The two “stationary zones” are defined as shown;The ideal cell height is 0.1 m at both stationary zones;A new layer is created when an old layer is stretched beyond (1+0.4)*

0.1 = 0.14 mAn old layer is removed once it shrinks to smaller than 0.4 * 0.1 = 0.04 mLet’s look at the motion again.

Slide 2-18

Page 26: 41658132 Dynamic Mesh

Layering Example 2: Conveyor Belt

Let’s look at the motion again:

Slide 2-19

Page 27: 41658132 Dynamic Mesh

Layering: Further Examples

Fuel injector;Flow solution on the next slide.

Slide 2-20

Page 28: 41658132 Dynamic Mesh

Layering: Further Examples

Fuel injector;Flow solution (velocity contours).

Slide 2-21

Page 29: 41658132 Dynamic Mesh

Layering: Further Examples

2-stroke engine;Layering.

Slide 2-22

Premixed combustion (temperature contours)

Page 30: 41658132 Dynamic Mesh

Layering: Further Examples

Vibromixer;Layering;Flow solution on next slide.

Slide 2-23

Page 31: 41658132 Dynamic Mesh

Layering: Further Examples

Vibromixer;Layering;Flow solution (contours of velocity).

Slide 2-24

Page 32: 41658132 Dynamic Mesh

Agenda

Overview of the Dynamic Mesh (DM) Model

Dynamic Meshing Schemes:i. Layering for Linear Motionii. Spring Smoothing for Small, General Motioniii. Local Remeshing for Large, General Motioniv. Local Remeshing with Size Functions

UDF Macros to Govern the Dynamic Mesh:v. Coupled Mesh Motion via the 6 DOF UDFvi. Controlling Rigid Body Motion using

DEFINE_CG_MOTIONvii. Controlling Projection onto Deforming Boundaries using

DEFINE_GEOM viii. Controlling the Motion of Individual Nodes using

DEFINE_GRID_MOTIONix. Miscellaneous UDF Examples

New Features in FLUENT 6.2

Slide 0-2

Page 33: 41658132 Dynamic Mesh

III. Spring Smoothing for Small, General Motion

Slide 3-1

Page 34: 41658132 Dynamic Mesh

Spring Smoothing: Introduction

If the relative motions of the boundaries are small, then we would simply like to compress or stretch the existing cells;FLUENT uses a spring analogy, whereby any two neighboring nodes are connected with a spring. If any boundary deforms, the nodal positions adjust until equilibrium is re-established. We call this spring smoothing.Examples:

Arterial walls responding to the pressure pulse from the heart;Pistons with small strokes;Ablation of the internal surface in a rocket engine, as the solid propellant is used up.

Slide 3-2

Page 35: 41658132 Dynamic Mesh

Spring Smoothing

We will demonstrate the spring smoothing feature of the dynamic mesh (DM) model by means of an example:

Motion of a small-stroke, irregularly shaped piston:

The iterative smoothing algorithm is controlled via the Convergence Tolerance and the Number of Iterations

Slide 3-3

Page 36: 41658132 Dynamic Mesh

Spring Smoothing Ex. 1: Irregular pistonThe bottom wall (“piston”) moves up and down;Motion is via “in-cylinder” toolSmoothing uses default parameters in this case.

piston

Slide 3-4

Page 37: 41658132 Dynamic Mesh

Spring Smoothing Ex. 1: Irregular pistonThe bottom wall (“piston”) moves as a rigid body;Under “Meshing Options” the ideal cell height is specified as 0.02 meters;What will happen?

“piston”

Slide 3-5

Page 38: 41658132 Dynamic Mesh

Spring Smoothing Ex. 1: Irregular piston

Everything OK, except the nodes on the vertical walls need to move – they need to be smoothed also!

Note how this cell collapses

Slide 3-6

Page 39: 41658132 Dynamic Mesh

Spring Smoothing Ex. 1: Irregular piston

The nodes belonging to “walls-vertical” are set to “deforming”The nodes will be projected onto the walls of a cylinder of radius 0.15 m that is aligned with the y-axis:

“walls-vertical”

x

yR 0.15

Cylinder walls (used for projection)

Slide 3-7

Page 40: 41658132 Dynamic Mesh

Spring Smoothing Ex. 1: Irregular piston

The nodes belonging to “walls-vertical” are deformed by means of the smoothing algorithm

For more info about deforming zones, please refer to the appendix of this lecture

Remeshing is not used here, so none of the parameters are relevant

So what happens with these settings?

Slide 3-8

Page 41: 41658132 Dynamic Mesh

Spring Smoothing Ex. 1: Irregular piston

Everything OK!One can also project onto planes or user-defined edges/surfaces.

Note how these nodes move

Slide 3-9

Page 42: 41658132 Dynamic Mesh

What happens if we change the spring constant, k ?We saw what happens with the default value:

k = 1The effect of the moving wall is felt mostly near the moving wall, but not at larger distances.

Spring Smoothing Ex. 1: Irregular Piston

k = 1

Slide 3-10

Page 43: 41658132 Dynamic Mesh

k ranges from 0 to 1;Let us try k = 0, which means the stiffness is maximal;The effect of the moving wall is felt everywhere, even near the top wall.

Spring Smoothing Ex. 1: Irregular Piston

k = 0

Slide 3-11

Page 44: 41658132 Dynamic Mesh

k ranges from 0 to 1;Let us try k = 0.5, which implies a medium stiffness;The effect of the moving wall is strongly felt throughout the bottom half of the domain.

Spring Smoothing Ex. 1: Irregular Piston

k = 0.5

Slide 3-12

Page 45: 41658132 Dynamic Mesh

So far, we have seen the impact of changing the spring constant factor, k;Next we will consider the impact of changing the boundary node relaxation, ββ controls the extent to which the motion of adjacent interior nodes, , affects the position of nodes, , on the deforming boundary wall:

Spring Smoothing Ex. 1: Irregular Piston

adjnb

nb xxx rrr

∆+=+ β1

adjxr∆bxr

Slide 3-13

Page 46: 41658132 Dynamic Mesh

So far, we used β = 1, the default value;This means the interior nodes fully affect the movement of the nodes on the deforming boundary wall;The nodes on the deforming wall move in such a way as to create nice cells nearby.

Spring Smoothing Ex. 1: Irregular Piston

β = 1

Slide 3-14

Page 47: 41658132 Dynamic Mesh

If we use β = 0, the nodes on the deforming boundary wall will not move at all;We quickly get degenerate cells next to the deforming boundary.

Spring Smoothing Ex. 1: Irregular Piston

β = 0

Slide 3-15

Page 48: 41658132 Dynamic Mesh

If we use β = 0.5, the nodes on the deforming boundary wall will move only slightly;We obtain very poor cells next to the deforming boundary wall.

Spring Smoothing Ex. 1: Irregular Piston

β = 0.5

Slide 3-16

Page 49: 41658132 Dynamic Mesh

Agenda

Overview of the Dynamic Mesh (DM) Model

Dynamic Meshing Schemes:i. Layering for Linear Motionii. Spring Smoothing for Small, General Motioniii. Local Remeshing for Large, General Motioniv. Local Remeshing with Size Functions

UDF Macros to Govern the Dynamic Mesh:v. Coupled Mesh Motion via the 6 DOF UDFvi. Controlling Rigid Body Motion using

DEFINE_CG_MOTIONvii. Controlling Projection onto Deforming Boundaries using

DEFINE_GEOM viii. Controlling the Motion of Individual Nodes using

DEFINE_GRID_MOTIONix. Miscellaneous UDF Examples

New Features in FLUENT 6.2

Slide 0-2

Page 50: 41658132 Dynamic Mesh

IV. Local Remeshing for Large, General Motion

Slide 4-1

Page 51: 41658132 Dynamic Mesh

Local Remeshing: Introduction

If the relative motions of the boundaries are large andgeneral (both translation and rotation may be involved), then we need to remesh locally;Why local remeshing? For efficiency, FLUENT remeshes only those cells that exceed the specified maximum skewnessand/or fall outside the specified range of cell volumes;In the flowmeter shown, the cuff rocks and reciprocates (rotates and translates sinusoidally).

Slide 4-2

Page 52: 41658132 Dynamic Mesh

Local Remeshing: Algorithm

1. At the beginning of every time step:Mark all cells whose skewness is

2. If ( time = (“Size Remesh Interval”) ) thenMark all cells whose volume is below “Minimum Cell Volume” or above “Maximum Cell Volume”

3. Locally remesh only the marked cells“Must Improve Skewness”: remesh only if the resulting cell will be less skewed than before (almost always selected);Several meshing strategies are tried to arrive at the best result;

4. Perform smoothing iterations (if smoothing is turned on);

above “Maximum Cell Skewness”

Slide 4-3

t∆⋅

Page 53: 41658132 Dynamic Mesh

Local Remeshing: Introduction

Local Remeshing is used for cases involving large, general motion:Cars passing (overtaking) each other;Rescue capsule dropped from an airplane (store separation);The motion of two intermeshing gears;Two stages of a rocket separating from each other (stage separation).

Local remeshing is available for tri/tet meshes only.We will look at one major example:

Butterfly valve;

Slide 4-4

Page 54: 41658132 Dynamic Mesh

Local Remeshing Example 1: Butterfly Valve

The butterfly valve rotates, governed by a profile;Flow is from left to right;One challenge is that the mesh is much finer at the valve’s tips than at its center;The tip tends to leave a “wake” of small cells;Small gaps require 3-5 cells, otherwise one gets unphysical velocities.

Slide 4-5

Page 55: 41658132 Dynamic Mesh

Local Remeshing Ex. 1: Butterfly Valve

The mesh was made in Gambit;Valve radius is 0.1 mSmall gap (9 mm) has 3 cells across;The rounded portion of the housing has a variable cell size;Minimum cell length is about 3 mm (0.003 m);1674 cells, max. skewness 0.39

Slide 4-6

Page 56: 41658132 Dynamic Mesh

Local Remeshing Ex. 1: Butterfly Valve

The motion of the butterfly valve is governed by a profile:

((butterfly 6 point)(time 0 0.6 1.0 2.2 2.6 3.2)(omega_z 0.0 1.571 1.571 -1.571 -1.571 0.0)

)

Time (sec)3.2

1.571

0.0

Omega_z (rad/s)The valve first rotates CCW through 90 degrees, then CW;The maximum rotational speed is 15 RPM.

0.6

Slide 4-7

Page 57: 41658132 Dynamic Mesh

Local Remeshing Ex. 1: Butterfly Valve

Use contours of Grid/CellVolume (deselect “node values”) to find the minimum and maximum cell volumes of the initial mesh (in this case 3.06e-6 and 2.12e-4 m3);Base your specification of the minimum and maximum cell volumes on the initial mesh;Use contours of Grid/EquiangleSkew (deselect “node values”) to find the maximum skewness of the initial mesh;Base your specification of the maximum cell skewness on the initial mesh, and on the rule-of-thumb: 0.7 for 2D, 0.85 for 3D.

Slide 4-8

Page 58: 41658132 Dynamic Mesh

Local Remeshing Ex. 1: Butterfly Valve

Define > DynamicMesh > ZonesSelect the wall of the valve (“wall-butterfly”) and make it move as a rigid body, driven by the profile “butterfly”;The CG is located at (0,0);Ideal cell height is 0.003 m, based on the smallest cell length of the initial mesh; hideal controls the cell size adjacent to the moving wall.

Slide 4-9

Page 59: 41658132 Dynamic Mesh

Local Remeshing Ex. 1: Butterfly Valve

Previewing the mesh motion:Choose a first time step based on the length of the smallest cell and on the maximum velocity;In our case:

ssm

mvst 018.0

/16.0003.0

==∆

=∆We chose to display the mesh motion to the screen, and to:Capture every seventh frame to disk (be sure to visit File > Hardcopy before you begin)

Slide 4-10

Page 60: 41658132 Dynamic Mesh

Local Remeshing Ex. 1: Butterfly Valve

The preview fails with these settings!It is normal to have to make some adjustmentsWe analyze the failed mesh:

The spots of large cells indicate that our preview time step is too large

Spots with large cells

“Wake” of small cells, as expected

Slide 4-11

Page 61: 41658132 Dynamic Mesh

Local Remeshing Ex. 1: Butterfly Valve

We succeed with a preview time step of 0.005 secLet us analyze the mesh motion, to make improvements laterGenerally, we look for:

Cell quality (skewness)Jumps in cell sizeCell count

Slide 4-12

Page 62: 41658132 Dynamic Mesh

Local Remeshing Ex. 1: Butterfly Valve

We are wasting too many cells in the “wake” of the valveLet us revisit the dynamic mesh parameters and zones

Large cells adjacent to the coarsely meshed part of the housing

“Wake” of small cells, as expected

Slide 4-13

Page 63: 41658132 Dynamic Mesh

Local Remeshing Ex. 1: Butterfly Valve

Effect of minimum cell volume:We had used 2e-6 m3

before;Based on the smallest cell dimension (3 mm), we obtain a volume of 4.5e-6 m3

Here we have tried 5e-6 m3 (to help avoid the “wake” of small cells).

Before:

More efficient use of cellsSize jump

Slide 4-14

Page 64: 41658132 Dynamic Mesh

Local Remeshing Ex. 1: Butterfly Valve

Effect of ideal height:We had used 0.003 mbefore, and got excessively small cellsHere we tried 0.006 m

Before:

Size jumps

Stretched cells near the moving wall

Slide 4-15

Page 65: 41658132 Dynamic Mesh

Local Remeshing Ex. 1: Butterfly Valve

Remeshing controls summary:

Use the minimum cell volume to steer overall size uniformity;Use the ideal height to steer cell size adjacent to the moving wall;We will gain more control by using size functions (next lecture).

Control via min. cell volume

Control via ideal heightSlide 4-16

Page 66: 41658132 Dynamic Mesh

Local Remeshing: Short Example 1/5Compressor with spring-loaded intake and exhaust valves;Flow solution (contours of velocity).

Slide 4-17

Page 67: 41658132 Dynamic Mesh

Local Remeshing: Short Example 2/5

An HVAC valve:Remeshing and smoothing;Nonconformal grid interface (circular arc);Flow solution on next slide.

Slide 4-18

Page 68: 41658132 Dynamic Mesh

Local Remeshing: Short Example 3/5

Automotive valve:Remeshing, smoothing, and layering;4 nonconformal grid interfaces (vertical lines);The gaps are fully blocked;

Slide 4-19

Page 69: 41658132 Dynamic Mesh

Local Remeshing: Short Example 4/5

Gear pump

Slide 4-20

Page 70: 41658132 Dynamic Mesh

Local Remeshing: Short Example 5/5

Positive displacement pump

Slide 4-21

Page 71: 41658132 Dynamic Mesh

Agenda

Overview of the Dynamic Mesh (DM) Model

Dynamic Meshing Schemes:i. Layering for Linear Motionii. Spring Smoothing for Small, General Motioniii. Local Remeshing for Large, General Motioniv. Local Remeshing with Size Functions

UDF Macros to Govern the Dynamic Mesh:v. Coupled Mesh Motion via the 6 DOF UDFvi. Controlling Rigid Body Motion using

DEFINE_CG_MOTIONvii. Controlling Projection onto Deforming Boundaries using

DEFINE_GEOM viii. Controlling the Motion of Individual Nodes using

DEFINE_GRID_MOTIONix. Miscellaneous UDF Examples

New Features in FLUENT 6.2

Slide 0-2

Page 72: 41658132 Dynamic Mesh

V. Local Remeshing with Size Functions

Slide 5-1

Page 73: 41658132 Dynamic Mesh

Size Functions: Introduction

This section builds on what we have learned about local remeshing;The purpose of size functions is to gain additional control over the markingpreceding the local remeshing;In general, a size function is a function that starts with a small value at the moving object’s surface, and whose value grows as we move away from the object; it is a size distribution;In FLUENT, we mark those cells whose size (length scale) is higher than the local value of the size function;Note that the size function is only used for marking cells before remeshing –it is not used to govern the cell size during the remeshing; thus it is an indirect control;The overall remeshing algorithm (which we discussed before) has only one change (shown in blue):

Slide 5-2

Page 74: 41658132 Dynamic Mesh

Remeshing & Size Functions: Algorithm

1. At the beginning of every time step:Mark all cells whose skewness is above “Maximum Cell Skewness”

2. If ( time = (“Size Remesh Interval”) ) thenMark all cells whose volume is below “Minimum Cell Volume” or above “Maximum Cell Volume”Mark all cells whose size is above or below the local value of the size function

3. Locally remesh only the marked cells:“Must Improve Skewness”: remesh only if the resulting cell will be less skewed than before (almost always selected);Several meshing strategies are tried to arrive at the best result (marked cells are agglomerated/fused into cavities, which are then remeshed [initialize, refine]);

4. Move the object/boundary;5. Perform smoothing iterations (if smoothing is turned on);6. Interpolate the solution onto the new mesh;

Slide 5-3

t∆⋅

Page 75: 41658132 Dynamic Mesh

Let us use the example of an airdrop of a rescue pod;We select “remeshing”, “sizing function”, and “Must Improve Skewness”;We only want to see the effect of the size function, so we:

Set the minimum and maximum cell volumes to extreme values, so that no cells will be marked based on volume;Set the maximum cell skewness very high, so that no cells will be marked based on skewness;

Accept the other defaults;

Remeshing & Size Functions, Example 1: Airdrop

Slide 5-4

Page 76: 41658132 Dynamic Mesh

Remeshing & Size Functions, Example 1: Airdrop

The defaults work quite well overall, except for some squished cells below and behind the pod, and except for the creation of spots of small cells;The problem here is that as the pod draws near, those cells become marked based on the size function; since they were originally moderately skewed, the remeshing improves their skewness, so they end up being remeshed, unfortunately with small cells.

Slide 5-5

Cluster of small cells

Squished cells

Page 77: 41658132 Dynamic Mesh

Remeshing & Size Functions, Example 1: Airdrop

One cannot improve the situation significantly by changing the settings for the size function, or by changing remeshing parameters;We can avoid the squished cells by making the influence of the pod felt at larger distances from the pod: we turn on smoothing, with the default spring constant of 0.05:

Slide 5-6

With smoothing!

Page 78: 41658132 Dynamic Mesh

Remeshing & Size Functions, Example 1: Airdrop

Finally, let us add all of our previous experience: we keep the smoothing (k = 0.05), but also change the remeshing controls to the best values we had found: Vmin = 0.006 m3, Vmax = 1, maximum skewness = 0.65.The result is good, and computes quickly! During certain time steps, one does still see some clusters of small cells.

Slide 5-7

Best mesh

without size

functions

With size functions!

Page 79: 41658132 Dynamic Mesh

We can even plot contours of the size function (i.e., of sizeP):In the TUI, use solve/set/expert and then answer as shown below;This makes available the plotting of contours of background sizing function:

Remeshing & Size Functions: Tips, Limitations

Slide 5-8

Page 80: 41658132 Dynamic Mesh

Here is a plot of contours of the size function (i.e., of sizeP) for the airdrop:

Remeshing & Size Functions: Tips, Limitations

Slide 5-9

This is a useful debugging tool:

Page 81: 41658132 Dynamic Mesh

Agenda

Overview of the Dynamic Mesh (DM) Model

Dynamic Meshing Schemes:i. Layering for Linear Motionii. Spring Smoothing for Small, General Motioniii. Local Remeshing for Large, General Motioniv. Local Remeshing with Size Functions

UDF Macros to Govern the Dynamic Mesh:v. Coupled Mesh Motion via the 6 DOF UDFvi. Controlling Rigid Body Motion using

DEFINE_CG_MOTIONvii. Controlling Projection onto Deforming Boundaries using

DEFINE_GEOM viii. Controlling the Motion of Individual Nodes using

DEFINE_GRID_MOTIONix. Miscellaneous UDF Examples

New Features in FLUENT 6.2

Slide 0-2

Page 82: 41658132 Dynamic Mesh

VI. Coupled Mesh Motion via the 6 DOF UDF

Slide 6-1

Page 83: 41658132 Dynamic Mesh

6 DOF Coupled Motion: Introduction

So far, we have only used prescribed motion: we specified the location or velocity of the object using the in-cylinder tool or a profile;Now we would like to move the object as a result of the aerodynamic forcesand moments acting together with other forces, such as the force due to gravity, thrust forces, or ejector forces (i.e., forces used to initially push objects away from an airplane or rocket, to avoid collisions); we call this coupled motion;Fluent provides a UDF (user-defined function) that computes the trajectory of an object based on the aerodynamic forces/moments, gravitational force, and ejector forces. This is often called a 6 DOF Solver (Six Degree Of Freedom Solver), and we refer to it as the 6 DOF UDF;The 6 DOF UDF is fully parallelized.

Slide 6-2

Page 84: 41658132 Dynamic Mesh

6 DOF; Example 1: Airdrop

We will learn about the 6 DOF UDF by applying it to the airdrop of the rescue pod;Let us begin by making changes to the UDF before we compile it. The user defines several parameters: we begin with the ID of the wall of the moving object and with the mass and second moments in the local coordinate system:

Slide 6-3

/**********************************************************/#include "udf.h“/*********************************************************** 6DOF UDF ***********************************************************/#define ZONE_ID1 10 /* face ID of the moving object */

/* properties of moving object: */#define MASS 15000.0 /* mass of object, kg */#define IXX 1.0e+6 /* moment of inertia, Nms^2 */#define IYY 3.0e+6 /* moment of inertia, Nms^2 */#define IZZ 3.0e+6 /* moment of inertia, Nms^2 */#define IXZ 0.0 /* moment of inertia, Nms^2 */#define IXY 0.0 /* moment of inertia, Nms^2 */#define IYZ 0.0 /* moment of inertia, Nms^2 */#define NUM_CALLS 1 /* number of times routine called

(number of moving zones) */#define R2D 180./M_PI

ID of the wall zone of the moving object

Excerpt from the 6 DOF UDF:

Mass of the rescue pod (15,000 kg)

Second moments of inertia of the rescue pod

Page 85: 41658132 Dynamic Mesh

6 DOF; Example 1: Airdrop

The user continues by adjusting the ejector forces in the global coordinate system:

Slide 6-4

/****************************************************************/* Add ejector forces *****************************************************************/static voidadd_injector_forces (real *x_cg, real *euler_angle, real *force, real *momentum){ /* (needs to be updated) */ /* distances from body to ejectors (front/back) */register real dfront = fabs (x_cg[2] - (0.179832 * euler_angle[1])); register real dback = fabs (x_cg[2] + (0.329184 * euler_angle[1])); Message0 ("\nfront/back distance ejectors = %g, %g", dfront, dback);

if (dfront <= 0.100584) { force[2] += 0.0; momentum[1] += 0.0; Message0 ("\nAdded front ejector force."); }

if (dback <= 0.100584) { force[2] += 0.0; momentum[1] += 0.0; Message0 ("\nAdded back ejector force."); }

}

In this case, the ejector forces and moments are zero

Page 86: 41658132 Dynamic Mesh

6 DOF; Example 1: Airdrop

Notice the Fluent-provided macro (DEFINE_CG_MOTION), which we will discuss in the next section;Also notice the name “six_dof”:

Slide 6-5

/******************************************************* * Main 6DOF UDF

*******************************************************/DEFINE_CG_MOTION(six_dof, dt, cg_vel, cg_omega, time, dtime)/* six_dof = name shown in Fluent GUI dt = thread cg_vel = old/updated cg velocity (global) cg_omega = old/updated angular velocity (global) time = current time dtime = time step */{ real f_glob[3]; /* Total forces (global) */

Page 87: 41658132 Dynamic Mesh

6 DOF; Example 1: Airdrop

The user finally adjusts the gravity vector in the global coordinate system:

Slide 6-6

/* Initialize gravity acceleration */ grav_acc[0] = 0.0; grav_acc[1] = -9.81; grav_acc[2] = 0.0;/* Read data previous time step */ read_velocities (v_old_glob, om_old_body, euler_angle);/* Get CG position */ for (i = 0; i < ND_ND; i++) x_cg[i] = DT_CG(dt)[i];/* Count number of calls done */ if ((++calls) == NUM_CALLS) last_call = TRUE;/* Get aerodynamic forces and moments */ Compute_Force_And_Moment (domain, tf1, x_cg, f_glob, m_glob, TRUE);

In this 2D case, the gravity vector points into the negative y-direction

Function call to read from file “velocities_3d”

Obtain current CG location from the GUI

Fluent-provided macro to compute the viscous and pressure forces and moments

Page 88: 41658132 Dynamic Mesh

6 DOF; Example 1: Airdrop

We are done modifying the 6DOF UDF;If desired, the user next creates an initial file “velocities_3d” using a simple text processor;In this case, we specify one initial nonzero angular velocity component;Note that since the case is 2D, we only specify two linear velocity components:

Slide 6-7

0.000000e+000 0.000000e+000 0.000000e+000 0.000000e+000 3.000000e-001 0.000000e+000 0.000000e+000 0.000000e+000

Linear velocity

components vx and vy in

m/s

“velocities_3d”

Angular velocity components , and in rad/sec and in body

coordinates

Euler angles in radians

Nonzero angular speed, zω

xω yω zω

Page 89: 41658132 Dynamic Mesh

6 DOF; Example 1: Airdrop

Having made the changes to the 6 DOF UDF, we are ready to hook it into the case;We load the case we had already set up (for which we had driven the motion with a profile);Then we compile the 6 DOF UDF as shown: first add the UDF (six_dof_airdrop.c), then build a library (libudf-airdrop), and finally loadthat library:

Slide 6-8

Page 90: 41658132 Dynamic Mesh

6 DOF; Example 1: Airdrop

Next we revisit the definition of the dynamic zones, and select “six_dof” as the UDF that drives the motion of the pod’s walls (wall-object) and the fluid zone (fluid-bl) consisting of the quad cells in the boundary layer adjacent to the rescue pod:

Slide 6-9

“fluid-bl”

“wall-object”

Page 91: 41658132 Dynamic Mesh

6 DOF; Example 1: Airdrop

Slide 6-10

Even in cases with coupled motion, it is wise to preview the mesh motion before carrying out the flow calculations;In this case, one can start without initializing, and the object will simply drop under the influence of gravity (it will also rotate because of the velocities_3d file that we have supplied);One can observe the effect of one’s choices for the dynamic mesh parameters (such as the spring constant, the maximum skewness, etc.).

Page 92: 41658132 Dynamic Mesh

6 DOF; Example 1: Airdrop

Slide 6-11

Finally, one can re-load the case (to get back to the original mesh) and compute the flow and the coupled motion;The figure shows pressure contours corresponding to a freestream Mach number of 0.8 – note how the object has drifted aft;This problem exists as a tutorial.

Page 93: 41658132 Dynamic Mesh

6 DOF coupled motion; short examples (1 of 4)

Store dropped from a delta wing (NACA 64A010) at Mach 1.2;Ejector forces dominate for a short time;All-tet mesh;Smoothing; remeshing with size function;Fluent results agree very well with wind tunnel results!Tutorial exists.

Slide 6-12

Page 94: 41658132 Dynamic Mesh

6 DOF coupled motion; short examples (2 of 4)

Projectile moving inside and out of a barrel;Initial patch in the chamber drives the motion;User-defined real gas law (Abel-Nobel Equation of State);Layering;Tutorial exists.

Slide 6-13

Page 95: 41658132 Dynamic Mesh

Outer Interface (3 edges)

bulletbarrel

Muzzle brake

axis

moving mesh zone (3 faces)static mesh zone

non-conformal interface

static mesh zone

Inner Interface (2 edges)

Slide 6-14

Page 96: 41658132 Dynamic Mesh

6 DOF coupled motion; short examples (3 of 4)

Slide 6-15

How well do the 6DOF UDF and the dynamic mesh (DM) model work?Consider a classic problem: the Lagrange gun;Initial patch in the chamber drives the motion of the 50 kg bullet/piston;User-defined real gas law (Abel-Nobel Equation of State);Layering;Superb agreement (red and green data) all the way to shot exit!

Initial condition at time t = 0

Final condition at shot exit

Page 97: 41658132 Dynamic Mesh

Agenda

Overview of the Dynamic Mesh (DM) Model

Dynamic Meshing Schemes:i. Layering for Linear Motionii. Spring Smoothing for Small, General Motioniii. Local Remeshing for Large, General Motioniv. Local Remeshing with Size Functions

UDF Macros to Govern the Dynamic Mesh:v. Coupled Mesh Motion via the 6 DOF UDFvi. Controlling Rigid Body Motion using

DEFINE_CG_MOTIONvii. Controlling Projection onto Deforming Boundaries using

DEFINE_GEOM viii. Controlling the Motion of Individual Nodes using

DEFINE_GRID_MOTIONix. Miscellaneous UDF Examples

New Features in FLUENT 6.2

Slide 0-2

Page 98: 41658132 Dynamic Mesh

VII. Controlling Rigid Body Motion using DEFINE_CG_MOTION

Slide 7-1

Page 99: 41658132 Dynamic Mesh

DEFINE_CG_MOTION : Introduction

In the previous lecture, we used the 6DOF UDF to couple the motion of objects to the flow solution;We saw that the heart of the 6DOF UDF is the DEFINE_CG_MOTION macro;The macro simply governs how far the object will move/rotate during each time step (it is called every time step);The object moves as a rigid body: all nodes and boundaries/walls associated with it move as one, without any relative motion (deformation);The translational and rotational motions of the rigid body are specified with respect to the CG (Center of Gravity) of the body;The macro works for both prescribed and coupled motions.

Slide 7-2

Page 100: 41658132 Dynamic Mesh

DEFINE_CG_MOTION; Example 1: Airdrop

Slide 7-3

Let us revisit the airdrop of the rescue pod – at one point we prescribed the rigid body motion by means of a profile;Let us repeat the same example, but use a UDF instead;The horizontal velocity component will be zero, while the vertical one will rise linearly and then stay constant at –1 m/s. We will also use a constant rotation of 0.3 rad/sec;

Page 101: 41658132 Dynamic Mesh

DEFINE_CG_MOTION; Example 1: Airdrop

Slide 7-4

#include "udf.h“#define ZONE_ID1 3 /* face ID of the moving object */DEFINE_CG_MOTION(pod_prescribed_UDF, dt, cg_vel, cg_omega, time, dtime){ cg_vel[0] = 0.0;if (time <= 3.0)

cg_vel[1] = - time/3.0;else

cg_vel[1] = - 1.0;cg_omega[0] = 0.0;cg_omega[1] = 0.0;cg_omega[2] = 0.3;

}

dt = dynamic thread pointer

This is the complete UDF:

Note this name

Page 102: 41658132 Dynamic Mesh

DEFINE_CG_MOTION; Example 1: Airdrop

Slide 7-5

We hook the UDF in and preview the motion (250 time steps of 0.03 seconds each)

Page 103: 41658132 Dynamic Mesh

DEFINE_CG_MOTION; Example 2: Pump

This piston pump is a bent-axis pumpbecause the reciprocating piston is driven by a thrust plate whose axis is bent with respect to the axis of the reciprocating motion;Observe that the cylinder rotates andreciprocates.

Slide 7-6

Page 104: 41658132 Dynamic Mesh

DEFINE_CG_MOTION; Example 2: Pump

The figure shows the labels for the different zones;The cylinder rotates, so that rot_int slides over stat_int;rot_int and stat_int form a nonconformal grid interface;The cylinder rotates because we define rot_fluid as a moving zone (SMM, sliding mesh method) with a rotational speed of 10 RPM about the z-axis (see next slide)

Slide 7-7

wall and rot_fluid

inlet

stat_int

rot_int (the circular cap on the cylinder)

wall:001

rot-wall-bot

Page 105: 41658132 Dynamic Mesh

DEFINE_CG_MOTION; Example 2: PumpThe bottom figure shows how we cause the cylinder to rotate;In addition, we cause the cylinder to reciprocate by moving the piston face rot_wall_bot as a rigid body – also see the UDF on the next slide.

Slide 7-8

Page 106: 41658132 Dynamic Mesh

DEFINE_CG_MOTION; Example 2: Pump

The UDF prescribes the rigid body motion of the piston face as a sinusoidal function of time;

Slide 7-9

#include "udf.h“DEFINE_CG_MOTION(piston, dt, vel, omega, time, dtime){ real A=2.0; /*Amplitude of sine oscillation with period T*/real n=10.0; /*rpm of pump*/real phi=-45.0; /*phase offset*/phi=phi*M_PI/180; /* set z-component of velocity */vel[0] = 0.0; vel[1] = 0.0; vel[2] = 2.0*M_PI*n*A/60.0*cos(2.0*M_PI*n*time/60.0-phi); omega[0] = 0.0; omega[1] = 0.0; omega[2] = 0.0;}

No space !

Page 107: 41658132 Dynamic Mesh

DEFINE_CG_MOTION; Example 2: Pump

The physical piston is driven by connecting rods that are connected to a thrust plate (wobble plate) that acts like a camshaft;This example has demonstrated how to combine the dynamic mesh (DM) model with the sliding mesh model (SMM).

Slide 7-10

Page 108: 41658132 Dynamic Mesh

VIII: Controlling Projection onto Deforming Boundaries using DEFINE_GEOM

Slide 8-1

Page 109: 41658132 Dynamic Mesh

DEFINE_GEOM : Introduction

This macro allows us to define geometry that we can project the boundary nodes of a mesh onto. It is used in conjunction with deforming boundary zones;We had previously projected the boundary nodes of a mesh onto a circular cylinder; only the circular cylinder and the plane are available through the GUI; for more complex geometry, one must use this macro;Such a projection allows the nodes to slide along the walls of the physical object, or along other boundary zones – we had called such zones deforming boundary zones, or simply deforming zones;We also refer to the sliding of the nodes on these deforming zones as the repositioning of nodes;

Slide 8-2

Page 110: 41658132 Dynamic Mesh

DEFINE_GEOM; Example 1: Butterfly Valve

Slide 8-3

Let us revisit the butterfly valve to learn how to apply DEFINE_GEOM;Could we turn the curved housing into a deforming boundary zone?Yes, but only by using DEFINE_GEOM since we may not point the axis of the cylinder that is available via the GUI into the page;

Page 111: 41658132 Dynamic Mesh

DEFINE_GEOM; Example 1: Butterfly Valve

Slide 8-4

The problem had been that the clustered cells on the housing could not follow the motion of the valve;Let us now allow them to slide along the arcs;The equation of the circular housing is:

Or:

222 Ryx =+

22 xry −=

Best result without sizing functions

(Slide 4-19)

Best result with sizing functions

(Slide 5-14)

Page 112: 41658132 Dynamic Mesh

DEFINE_GEOM; Example 1: Butterfly Valve

Slide 8-5

Here is the complete UDF!

#include "udf.h"#define R 0.109

DEFINE_GEOM(slippery_arcs, domain, dt, position){

real y;

y = position[1];

if (y >= 0.0)position[1] = sqrt(R*R - position[0]*position[0]);

elseposition[1] = - sqrt(R*R - position[0]*position[0]);

}

22 xry −=

Page 113: 41658132 Dynamic Mesh

DEFINE_GEOM; Example 1: Butterfly Valve

Slide 8-6

Details of the setup for the deforming/slippery zone “wall-circular-housing” are shown:The result would remain the same if we would turn on “Remeshing” here as well, because this regional remeshing would only happen if the deforming/slippery zone would be touched by the moving zone (“wall-butterfly” in this case).

Page 114: 41658132 Dynamic Mesh

DEFINE_GEOM; Example 1: Butterfly Valve

Slide 8-7

If we do not use sizing functions, the result is as shown;We note that the boundary nodes have moved along with the valve until it reached the corner, as desired;But they get stuck at the corner, with the rest of the arc being sparsely meshed;The mesh also looks skewed in general, so let us use sizing functions.

Clustered cells at corner

Sparse region

Page 115: 41658132 Dynamic Mesh

DEFINE_GEOM; Example 1: Butterfly Valve

Slide 8-8

Once we turn on the sizing functions, the result is as shown;We have eliminated the sparse regions;The clusters near two of the corners remain;The clusters can be slightly improved by decreasing the boundary node relaxation from one to 0.5.

Page 116: 41658132 Dynamic Mesh

DEFINE_GEOM; Example 1: Butterfly Valve

Slide 8-9

Here is the animation (320 frames at 0.005 seconds each);Note how the nodes slide along the housing.

Page 117: 41658132 Dynamic Mesh

IX: Controlling the Motion of Individual Nodes using DEFINE_GRID_MOTION

Slide 9-1

Page 118: 41658132 Dynamic Mesh

DEFINE_GRID_MOTION : Introduction

This macro allows us to move any nodes belonging to the fluid zones or to the boundary zones;The macro offers the maximum level of control over the deforming mesh;One is able to combine rigid body motion, deformations, and relative motions, and one may use projection zones at the same time;The macro is called every time step;

Slide 9-2

Page 119: 41658132 Dynamic Mesh

DEFINE_GRID_MOTION; Example 1: Compliant Wing Profile

In this example, we sinusoidally (in time and space) change the shape of a small portion of the top skin, just aft of the rounded leading edge;This is a fluid-structures interaction (FSI) problem;

Slide 9-3

Page 120: 41658132 Dynamic Mesh

DEFINE_GRID_MOTION; Example 1:Compliant Wing Profile

This image shows the location of the skin segment that will be moved – it is called “wall-compliant”, and is shown in red;

Slide 9-4

“wall-compliant”

Page 121: 41658132 Dynamic Mesh

DEFINE_GRID_MOTION; Example 1:Compliant Wing Profile

Here we are setting up the dynamic zone;As the wall section moves, the all-quad mesh adjacent to it will be smoothed, so we specify spring smoothing as the dynamic mesh scheme (we also need to use an rpsetvar).

Slide 9-5

Page 122: 41658132 Dynamic Mesh

DEFINE_GRID_MOTION; Example 1:Compliant Wing Profile

As the wall section moves, the all-quad mesh adjacent to it is smoothed;The spring constant was 0.5

Slide 9-6

Page 123: 41658132 Dynamic Mesh

DEFINE_GRID_MOTION; Example 1:Compliant Wing Profile

So what does the UDF look like?This UDF is a bit trickier;We need to show it over several slides:

Slide 9-7

#include "udf.h"#define L 0.4 /* Length of the compliant strip (m) */#define NUM_PERIODS 20 /* Number of bumps in the surface */#define AMP 0.00070 /* Amplitude (meters) */#define ORIGINCX 0.08 /* Coordinates of the upstream end */#define ORIGINCY 0.08 /* of the compliant strip */#define FREQ 1000.0 /* Frequency in Hertz (cycle/sec) */

DEFINE_GRID_MOTION(compliant, domain, dt, time, dtime){ Thread *tf = DT_THREAD (dt); face_t f; Node *node_p; real X_TILD, X_TILD_STAR, Y_TILD;real A; int n;

Page 124: 41658132 Dynamic Mesh

DEFINE_GRID_MOTION; Example 1:Compliant Wing Profile

Page 2 (of 4) of the UDF:

Slide 9-8

/* Set/activate the deforming flag on adjacent cell zone, which *//* means that the cells adjacent to the deforming wall will also be *//* deformed, in order to avoid skewness. */

SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf));

/* Compute the amplitude as a function of time: */

A = AMP * sin (2.0 * M_PI * FREQ * time);

Page 125: 41658132 Dynamic Mesh

DEFINE_GRID_MOTION; Example 1:Compliant Wing Profile

Page 3 (of 4) of the UDF:

Slide 9-9

/* Loop over the deforming boundary zone's faces; *//* inner loop loops over all nodes of a given face; */

begin_f_loop (f, tf){

f_node_loop (f, tf, n) {

node_p = F_NODE (f, tf, n);

/* Update the current node only if it has not been previously visited: */

if (NODE_POS_NEED_UPDATE (node_p))

{

Page 126: 41658132 Dynamic Mesh

DEFINE_GRID_MOTION; Example 1:Compliant Wing Profile

Page 4 (of 4) of the UDF:

Slide 9-10

/* 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_TILD = NODE_X (node_p) - ORIGINCX;X_TILD_STAR = NUM_PERIODS *2.0* M_PI * X_TILD /L;Y_TILD = A * ( 1.0 + sin (X_TILD_STAR - 0.5 * M_PI) );NODE_Y (node_p) = Y_TILD + ORIGINCY;

} /* end if */} /* end node loop */

} /* end face loop */end_f_loop (f, tf);

}/* End */

New y-position of

node_p

Page 127: 41658132 Dynamic Mesh

DEFINE_GRID_MOTION; Example 1:Compliant Wing Profile

Here is the animation again;As the wall section moves, the all-quad mesh adjacent to it is smoothed;In this example, we only moved the nodes on a wall zone;

Slide 9-11

Page 128: 41658132 Dynamic Mesh

DEFINE_GRID_MOTION: Fly with Beating Wings

Slide 9-12

Page 129: 41658132 Dynamic Mesh

Agenda

Overview of the Dynamic Mesh (DM) Model

Dynamic Meshing Schemes:i. Layering for Linear Motionii. Spring Smoothing for Small, General Motioniii. Local Remeshing for Large, General Motioniv. Local Remeshing with Size Functions

UDF Macros to Govern the Dynamic Mesh:v. Coupled Mesh Motion via the 6 DOF UDFvi. Controlling Rigid Body Motion using

DEFINE_CG_MOTIONvii. Controlling Projection onto Deforming Boundaries using

DEFINE_GEOM viii. Controlling the Motion of Individual Nodes using

DEFINE_GRID_MOTIONix. Miscellaneous UDF Examples

New Features in FLUENT 6.2

Slide 0-2

Page 130: 41658132 Dynamic Mesh

X. Miscellaneous Dynamic Mesh UDF Examples

Slide 10-1

Page 131: 41658132 Dynamic Mesh

UDF Example: Valve with Membrane

Let us study the set-up for a problem that involves a butterfly valve and a flexible membrane;We use three UDFs:1. CG_MOTION to

spin the valve2. CG_GEOM for

projecting the topmost nodes onto the horizontal top wall

3. GRID_MOTION to move the membrane

Slide 10-2

Page 132: 41658132 Dynamic Mesh

UDF Examples: Valve with Membrane

Here is a listing of the combined UDF (Slide 1 of 3):

Slide 10-3

#include "udf.h“#define omega 1.0 /* rotational speed, rad/sec */#define R 0.109 /* radius of the arc, meters */DEFINE_CG_MOTION(butterfly_flex_UDF, dt, cg_vel, cg_omega, time, dtime){

cg_vel[0] = 0.0;cg_vel[1] = 0.0;cg_vel[2] = 0.0;

cg_omega[0] = 0.0;cg_omega[1] = 0.0;cg_omega[2] = omega;

}

DEFINE_GEOM(plane, domain, dt, position){position[1] = R;

}

Projection onto the horizontal top wall

Valve rotation

Page 133: 41658132 Dynamic Mesh

UDF Examples: Valve with Membrane

Listing of the combined UDF (Slide 2 of 3):

Slide 10-4

DEFINE_GRID_MOTION(moving_arc, domain, dt, time, dtime){

Thread *tf = DT_THREAD (dt);face_t f;Node *node_p;real alpha, theta, x, ymag, yfull, y;int n;SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf));alpha = omega * CURRENT_TIME;theta = 2.0 * alpha + 3.0 * M_PI / 2.0;

Flexing membrane

Page 134: 41658132 Dynamic Mesh

UDF Examples: Valve with Membrane

Listing of the combined UDF (Slide 3 of 3):

Slide 10-5

begin_f_loop (f, tf){

f_node_loop (f, tf, n){

node_p = F_NODE (f, tf, n);if (NODE_POS_NEED_UPDATE (node_p))

{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);}

Flexing membrane

Page 135: 41658132 Dynamic Mesh

UDF Examples: Valve with Membrane

Here is the animation again;The motions of the valve and the membrane are synchronized;Smoothing and remeshing with size functions were used;The preview consisted of 626 time steps of 0.005 sec each.Applications: biomed, synthetic jets, etc.

Slide 10-6

Page 136: 41658132 Dynamic Mesh

Agenda

Overview of the Dynamic Mesh (DM) Model

Dynamic Meshing Schemes:i. Layering for Linear Motionii. Spring Smoothing for Small, General Motioniii. Local Remeshing for Large, General Motioniv. Local Remeshing with Size Functions

UDF Macros to Govern the Dynamic Mesh:v. Coupled Mesh Motion via the 6 DOF UDFvi. Controlling Rigid Body Motion using

DEFINE_CG_MOTIONvii. Controlling Projection onto Deforming Boundaries using

DEFINE_GEOM viii. Controlling the Motion of Individual Nodes using

DEFINE_GRID_MOTIONix. Miscellaneous UDF Examples

New Features in FLUENT 6.2

Slide 0-2

Page 137: 41658132 Dynamic Mesh

XI. New Dynamic Mesh Features in FLUENT 6.2

Slide 11-1

Page 138: 41658132 Dynamic Mesh

New Dynamic Mesh Features in FLUENT 6.2: 2.5 D Remeshing/Smoothing

Slide 11-2

For mapable (2.5D; extruded) geometries in particular pumps

Page 139: 41658132 Dynamic Mesh

New Dynamic Mesh Features in FLUENT 6.2: Boundary Region Remeshing (Slide 1 of 2)

Slide 11-3

In FLUENT 6.1 we had the following restrictions:

– Single zone– Closed loop

Page 140: 41658132 Dynamic Mesh

New Dynamic Mesh Features in FLUENT 6.2: Boundary Region Remeshing (Slide 2 of 2)

Slide 11-4

New in FLUENT 6.2:Symmetric boundariesAcross multiple zonesFeature preservation (e.g., corners are preserved)Non-closed loops

Page 141: 41658132 Dynamic Mesh

New Dynamic Mesh Features in FLUENT 6.2: Remeshing/Smoothing with Dynamic Adaption

Slide 11-5

Limitation: Dynamic adaption cannot be used in conjunction with layering or with boundary remeshing

Page 142: 41658132 Dynamic Mesh

New Dynamic Mesh Features in FLUENT 6.2: Layering at Periodics

Slide 11-6

Page 143: 41658132 Dynamic Mesh

New Dynamic Mesh Features in FLUENT 6.2: Full Compatibility with VOF

Slide 11-7

Note: The DM is now fully compatible with ALL multiphase models

Page 144: 41658132 Dynamic Mesh

New Dynamic Mesh Features in FLUENT 6.2: 6-DOF Solver

Slide 11-8

6-DOF solver now built into the GUIGUI panels still do not provide for constraints (such as hinges), but constrained motion is possible via UDF;The dynamic mesh UDFs contain hooks for load forces/moments;Transformations can be customized (although we use a transformation between local and global coordinate systems that is widely used in the aerospace and shipbuilding industries)

Page 145: 41658132 Dynamic Mesh

New Dynamic Mesh Features in FLUENT 6.2: Dynamic Mesh Events

Slide 11-9

Events based on time (not just based on the crank angle as before), and without having to use the in-cylinder tools (where they were called in-cylinder events);New events:

Activate/Deactivate cell zonesChange URF

Page 146: 41658132 Dynamic Mesh

New Dynamic Mesh Features in FLUENT 6.2: Miscellaneous

Slide 11-10

Improved parallel performance, in particular ICReduced number of cell migrations during mesh updateEncapsulation of non-conformals not required anymore

Zone motion previewMotion history for 6-DOF applications

Page 147: 41658132 Dynamic Mesh

FLUENT 6.2: Sneak Preview

Slide 11-11

Page 148: 41658132 Dynamic Mesh

FLUENT 6.2: Sneak Preview

Slide 11-12

Page 149: 41658132 Dynamic Mesh

FLUENT 6.2: Sneak Preview

Slide 11-13

Page 150: 41658132 Dynamic Mesh

How to obtain support for using the Dynamic Mesh (DM) model

• Study the manuals;• Work through the dynamic mesh tutorials;• Attend Fluent’s advanced training on the dynamic mesh;• Search the Solutions using the Online Technical Support

(OTS) at www.fluentusers.com ;• Create a case using the Online Technical Support (OTS) at

www.fluentusers.com ; the case will be answered by Fluent’s support staff, and your support engineer may contact the dynamic mesh developers if difficulties arise;

• If the problem is particularly intimidating, consider having Fluent’s Consulting Team develop a prototype for you

Slide 0-3

Page 151: 41658132 Dynamic Mesh

Purpose of this session

• Show you how to use the controls for the Dynamic Mesh (DM) model, based on a few examples

• Show you how to write simple UDFs that control the dynamic zones, based on a few examples

• Show you the new features in FLUENT 6.2

• To have the examples motivate you – what application might you use the model for ?

Slide 0-4

Questions?

Page 152: 41658132 Dynamic Mesh

Dynamic Mesh Case Studies (FLUENT 6.1)

Christoph Hiemcke

9 June 2004

Thank you for your attention!