You are on page 1of 108

UDF와 Dynamic Mesh를 이용한

Coupled motion의 구현

© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Outline

 Controlling Inlet velocity using DEFINE_PROFILE


 Controlling Rigid Body Motion using DEFINE_CG_MOTION
 Overview of the Dynamic Mesh (DM) Model
 Layering for Linear Motion
 Local Remeshing for Large, General Motion
 Coupled Mesh Motion via the 6 DOF Solver
 Coupled Mesh Motion via the 2 DOF User Defined Function

© 2006 ANSYS, Inc. All rights reserved. 2 ANSYS, Inc. Proprietary


Lecture 1: Controlling
Inlet velocity using
DEFINE_PROFILE

© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Introduction
 What is a User Defined Function?
 A UDF is a routine (programmed by the user) written in C which can be
dynamically linked with the solver.
 Standard C functions
s Trigonometric, exponential, control blocks, do-loops, file i/o, etc.
 Pre-Defined Macros
s Allows access to field variable, material property, and cell geometry
data.
 Why build UDF‟s?
 Standard interface cannot be programmed to anticipate all needs.
 Customization of boundary conditions, source terms, reaction rates,
material properties, etc.
 Adjust functions (once per iteration)
 Execute on Demand functions
 Solution Initialization

© 2006 ANSYS, Inc. All rights reserved. 4 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

User Access to the FLUENT Solver


Segregated PBCS DBCS

User-
Initialize Begin Loop defined Solver? Solve U-Momentum Source terms
ADJUST
Solve Mass,
Source terms Solve V-Momentum Momentum,
Solve Mass Source terms
User Defined Energy,
& Momentum
INITIALIZE Species
Solve W-Momentum

Repeat
Solve Mass Continuity;
Update Velocity

Exit Loop Check Convergence


Solve Energy

Update Properties Solve Species Source


terms
User-Defined Properties Solve Turbulence Equation(s)
User-Defined BCs

Solve Other Transport Equations as required

© 2006 ANSYS, Inc. All rights reserved. 5 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

UDF Basics
 UDF‟s assigns values (e.g., boundary data,
source terms) to individual cells and cell
faces
in fluid and boundary zones
 In a UDF, zones are referred to as threads
 A looping macro is used to access individual
cells belonging to a thread.
 For example, a face-loop macro visits 563
faces on face zone 3 (named inlet).
s Position of each face is available to
calculate and assign spatially varying
properties
 Thread and variable references are
automatically passed to the UDF when
assigned to a boundary zone in the GUI.
 Values returned to the solver by UDFs must
be in SI units.

© 2006 ANSYS, Inc. All rights reserved. 6 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Using UDFs in the Solvers


 The basic steps for using UDFs in FLUENT are as follows:

1. Create a file containing the UDF source code


2. Start the solver and read in your case/data files
3. Interpret or Compile the UDF
4. Assign the UDF to the appropriate variable and zone in BC panel.
5. Set the UDF update frequency in the Iterate panel
6. Run the calculation

© 2006 ANSYS, Inc. All rights reserved. 7 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Example – Parabolic Inlet Velocity Profile


 We would like to impose a parabolic inlet velocity to the 2D elbow
shown.
 The x velocity is to be specified as
  y 2 
u ( y )  20 1    
  0.0745 

u( y)
y0

© 2006 ANSYS, Inc. All rights reserved. 8 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Step 1 – Prepare the Source Code


 The DEFINE_PROFILE macro allows the function
inlet_x_velocity to #include "udf.h“
be defined. DEFINE_PROFILE(inlet_x_velocity, thread, nv)
{
 All UDFs begin with a DEFINE_ float x[3]; /* Position vector*/
macro. float y;
face_t f;
 inlet_x_velocity will be begin_f_loop(f, thread)
identifiable in solver GUI. {
F_CENTROID(x,f,thread);
 thread and nv are arguments of y = x[1];
the DEFINE_PROFILE macro, F_PROFILE(f, thread, nv)
= 20.*(1.- y*y/(.0745*.0745));
which are used to identify the zone }
and variable being defined, end_f_loop(f, thread)
respectively. }

 The macro begin_f_loop loops over all faces f, pointed by thread


 The F_CENTROID macro assigns cell position vector to x[]
 The F_PROFILE macro applies the velocity component to face f

© 2006 ANSYS, Inc. All rights reserved. 9 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Step 3 – Interpret or Compile the UDF


 Interpreted UDF  Compiled UDF
Define User-Defined Functions Interpreted… Define User-Defined Functions Compiled…

 Add the UDF source code to the Source  Add the UDF source code to the Source
File Name list. Files list.
 Click Interpret.  Click Build to create UDF library.
 The assembly language code will  Click Load to load the library.
display in the FLUENT console.  You can also unload a library if needed.
Define User-Defined Functions Manage…

© 2006 ANSYS, Inc. All rights reserved. 10 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Interpreted vs. Compiled UDFs


 Functions can either be read and interpreted at run time or compiled
and grouped into a shared library that is linked with the standard
FLUENT executable.
 Interpreted code vs. compiled code
 Interpreted
 Interpreter is a large program that sits in the computer‟s memory.
 Executes code on a “line by line” basis instantaneously
 Advantage – Does not require a third-party compiler.
 Disadvantage – Interpreter is slow and takes up memory.
 Compiled (refer to the FLUENT User‟s Guide for instructions)
 UDF code is translated once into machine language (object modules).
 Efficient way to run UDFs.
 Creates shared libraries which are linked with the rest of the solver
 Overcomes many interpreter limitations such as mixed mode arithmetic,
structure references, etc.

© 2006 ANSYS, Inc. All rights reserved. 11 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Step 4 – Activate the UDF


 Open the boundary condition
panel for the surface to which
you would like to apply the
UDF.

 Switch from Constant to the


UDF function in the X-Velocity
drop-down list.

© 2006 ANSYS, Inc. All rights reserved. 12 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Steps 5 and 6 – Run the Calculations


 You can change the UDF Profile Update Interval in the Iterate panel
(default value is 1).
 This setting controls how often (either iterations or time steps if unsteady)
the UDF profile is updated.

 Run the calculation as usual.

© 2006 ANSYS, Inc. All rights reserved. 13 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Macros
 Macros are functions defined by FLUENT.
 DEFINE_ macros allows definitions of UDF functionality.
 Variable access macros allow access to field variables and cell
information.
 Utility macros provide looping capabilities, thread identification, vector
and numerous other functions.
 Macros are defined in header files.
 The udf.h header file must be included in your source code.
#include “udf.h”
 The header files must be accessible in your path.
 Typically stored in Fluent.Inc/src/ directory.
 A list of often used macros is provided in the UDF User‟s Guide.
Help More Documentation…

© 2006 ANSYS, Inc. All rights reserved. 14 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

DEFINE Macros
 Any UDF you write must begin with a DEFINE_ macro:
 18 „general purpose‟ macros and 13 DPM and multiphase related macros
(not listed):
DEFINE_ADJUST(name,domain); general purpose UDF called every iteration
DEFINE_INIT(name,domain); UDF used to initialize field variables
DEFINE_ON_DEMAND(name); defines an „execute-on-demand‟ function
DEFINE_RW_FILE(name,fp); customize reads/writes to case/data files
DEFINE_PROFILE(name,thread,index); defines boundary profiles
DEFINE_SOURCE(name,cell,thread,dS,index); defines source terms
DEFINE_HEAT_FLUX(name,face,thread,c0,t0,cid,cir); defines heat flux
DEFINE_PROPERTY(name,cell,thread); defines material properties
DEFINE_DIFFUSIVITY(name,cell,thread,index); defines UDS and species diffusivities
DEFINE_UDS_FLUX(name,face,thread,index); defines UDS flux terms
DEFINE_UDS_UNSTEADY(name,cell,thread,index,apu,su); defines UDS transient terms
DEFINE_SR_RATE(name,face,thread,r,mw,yi,rr); defines surface reaction rates
DEFINE_VR_RATE(name,cell,thread,r,mw,yi,rr,rr_t); defines vol. reaction rates
DEFINE_SCAT_PHASE_FUNC(name,cell,face); defines scattering phase function for DOM
DEFINE_DELTAT(name,domain); defines variable time step size for unsteady problems
DEFINE_TURBULENT_VISCOSITY(name,cell,thread); defines procedure for calculating turbulent viscosity
DEFINE_TURB_PREMIX_SOURCE(name,cell,thread,turbflamespeed,source); defines turb. flame speed
DEFINE_NOX_RATE(name,cell,thread,nox); defines NOx production and destruction rates

© 2006 ANSYS, Inc. All rights reserved. 15 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Numerical Solution of the Example


 The figure at right shows the velocity field through
the 2D elbow.

 The bottom figure shows the velocity vectors at the


inlet. Notice the imposed parabolic profile.

© 2006 ANSYS, Inc. All rights reserved. 16 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Thread and Looping Utility Macros


cell_t c; Defines c as a cell thread index cell_t, face_t, Thread,
face_t f; Defines f as a face thread index Domain are part of FLUENT
Thread *t; t is a pointer to a thread
UDF data structure
Domain *d; d is a pointer to collection of all threads

thread_loop_c(t, d){} Loop that visits all cell threads t in domain d


thread_loop_f(t, d){} Loop that visits all face threads t in domain d

begin_c_loop(c, ct) {} end_c_loop(c, ct)


Loop that visits all cells c in cell thread ct

begin_f_loop(f, ft) {} end_f_loop(f, ft)


Loop that visits all faces f in a face thread ft

c_face_loop(c, t, n){} Loop that visits all faces of cell c in thread t

Thread *tf = Lookup_Thread(domain, ID); Returns the thread pointer of zone ID


ID = THREAD_ID(tf); Returns the zone integer ID of thread pointer tf

© 2006 ANSYS, Inc. All rights reserved. 17 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Geometry and Time Macros


C_NNODES(c,t); Returns nodes/cell
C_NFACES(c,t); Returns faces/cell
F_NNODES(f,t); Returns nodes/face
C_CENTROID(x,c,t); Returns coordinates of cell centroid
in array x[]
F_CENTROID(x,f,t); Returns coordinates of face centroid
in array x[]
F_AREA(A,f,t); Returns area vector in array A[]
C_VOLUME(c,t); Returns cell volume
C_VOLUME_2D(c,t); Returns cell volume (axisymmetric domain)

real flow_time(); Returns actual time


int time_step; Returns time step number
RP_Get_Real(“physical-time-step”); Returns time step size

© 2006 ANSYS, Inc. All rights reserved. 18 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Cell Field Variable Macros


C_R(c,t); Density C_DVDX(c,t); Velocity derivative
C_P(c,t); Pressure C_DVDY(c,t); Velocity derivative
C_U(c,t); U-velocity C_DVDZ(c,t); Velocity derivative
C_V(c,t); V-velocity C_DWDX(c,t); Velocity derivative
C_W(c,t); W-velocity C_DWDY(c,t); Velocity derivative
C_T(c,t); Temperature C_DWDZ(c,t); Velocity derivative
C_H(c,t); Enthalpy
C_K(c,t); Turbulent kinetic energy (k) C_MU_L(c,t); Laminar viscosity
C_D(c,t); Turbulent dissipation rate (ε) C_MU_T(c,t); Turbulent viscosity
C_O(c,t); Specific dissipation of TKE (ω) C_MU_EFF(c,t); Effective viscosity
C_YI(c,t,i); Species mass fraction C_K_L(c,t); Laminar thermal conductivity
C_UDSI(c,t,i); UDS scalars C_K_T(c,t); Turbulent thermal conductivity
C_UDMI(c,t,i); UDM scalars C_K_EFF(c,t); Effective thermal conductivity
C_CP(c,t); Specific heat
C_DUDX(c,t); Velocity derivative C_RGAS(c,t); Gas constant
C_DUDY(c,t); Velocity derivative C_DIFF_L(c,t); Laminar species diffusivity
C_DUDZ(c,t); Velocity derivative C_DIFF_EFF(c,t,i); Effective species
diffusivity
© 2006 ANSYS, Inc. All rights reserved. 19 ANSYS, Inc. Proprietary
Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Face Field Variable Macros


 Face field variables are only available when using the segregated solver
and generally, only at exterior boundaries.
F_R(f,t); Density
F_P(f,t); Pressure
F_U(f,t); U-velocity
F_V(f,t); V-velocity
F_W(f,t); W-velocity
F_T(f,t); Temperature
F_H(f,t); Enthalpy
F_K(f,t); Turbulent KE
F_D(f,t); TKE dissipation
F_O(f,t); Specific dissipation of tke
F_YI(f,t,i); Species mass fraction
F_UDSI(f,t,i); UDS scalars
F_UDMI(f,t,i); UDM scalars
F_FLUX(f,t); Mass flux across face f, defined out of domain at boundaries.

© 2006 ANSYS, Inc. All rights reserved. 20 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Other UDF Applications


 In addition to defining boundary values, source
terms, and material properties, UDFs can be
used for:
 Initialization
 Executes once per initialization.
 Solution adjustment
 Executes every iteration.
 Wall heat flux
 Defines fluid-side diffusive and radiative wall
heat fluxes in terms of heat transfer
coefficients
 Applies to all walls
 User-defined surface and volumetric reactions
 Read/write to/from case and data files
 Read order and write order must be same.
 Execute-on-Demand capability
 Does not participate in the solver iterations

© 2006 ANSYS, Inc. All rights reserved. 21 ANSYS, Inc. Proprietary


Lecture 2: Controlling
Rigid Body Motion using
DEFINE_CG_MOTION

© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

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.

© 2006 ANSYS, Inc. All rights reserved. 23 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

DEFINE_CG_MOTION; Example 1: Airdrop

 Let us revisit the airdrop of the


rescue pod
 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;

© 2006 ANSYS, Inc. All rights reserved. 24 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

DEFINE_CG_MOTION; Example : Airdrop


This is the complete UDF:

#include "udf.h“
DEFINE_CG_MOTION(pod_prescribed_UDF, dt, cg_vel, cg_omega, time, dtime)
{
cg_vel[0] = 0.0; dt = dynamic thread
if (time <= 3.0)
pointer
cg_vel[1] = - time/3.0;
else
cg_vel[1] = - 1.0;
cg_omega[0] = 0.0; Note this name
cg_omega[1] = 0.0;
cg_omega[2] = 0.3;
}

© 2006 ANSYS, Inc. All rights reserved. 25 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

DEFINE_CG_MOTION; Example 1: Airdrop


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

© 2006 ANSYS, Inc. All rights reserved. 26 ANSYS, Inc. Proprietary


Lecture 3: Overview of the
Dynamic Mesh (DM) Model

© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Dynamic Mesh (DM) Model: Features


 Several meshing schemes are available to handle all types of boundary
motion;
 Boundaries/Objects may be moved based on:
 In-cylinder motion (RPM, stroke length, crank angle, …);
 Prescribed motion via profiles;
 Prescribed motion via UDF (User-Defined Function);
 Coupled motion based on hydrodynamic forces from the flow solution, via
FLUENT‟s 6 DOF model.
 First order accurate in time;

© 2006 ANSYS, Inc. All rights reserved. 28 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

DM Model: Mesh Motion Schemes


 Fluent‟s DM (Dynamic Mesh) model offers three meshing schemes:
 Spring analogy (smoothing);
 Local remeshing;
 Layering
 Mesh motion may be applied to individual zones;
 Different zones may use different schemes for mesh motion;
 Connectivity between adjacent deforming zones may be non-
conformal, e.g., there might be a sliding interface between two
neighboring zones.

© 2006 ANSYS, Inc. All rights reserved. 29 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Spring Analogy (Spring Smoothing)


 The nodes move as if connected via
springs, or as if they were part of a
sponge;
 Connectivity remains unchanged;
 Limited to relatively small deformations
when used as a stand-alone meshing
scheme;
 Available for tri and tet meshes;
 May be used with quad, hex and wedge
mesh element types, but that requires a
special command;
 We will see the details of this method in
one of next lectures.

© 2006 ANSYS, Inc. All rights reserved. 30 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing
 As user-specified skewness and
size limits are exceeded, local
nodes and cells are added or
deleted;
 As cells are added or deleted,
connectivity changes;
 Available only for tri and tet
mesh elements;
 The animation also shows
smoothing (which one typically
uses together with remeshing).

© 2006 ANSYS, Inc. All rights reserved. 31 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering
 Cells are added or deleted as
the zone grows and shrinks;
 As cells are added or deleted,
connectivity changes;
 Available for quad, hex and
wedge mesh elements.

© 2006 ANSYS, Inc. All rights reserved. 32 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Motion Specification
 Internal node positions are automatically calculated based on user
specified boundary motion:
 Prescribed mesh motion:
 Position or velocity versus time, i.e., „profile‟ text file;
 UDF with expression for position or velocity versus time (independent of
the flow solution).
 Flow dependent motion (coupled motion):
 Motion is coupled with hydrodynamic forces from the flow solution via
FLUENT‟s 6 DOF model.

© 2006 ANSYS, Inc. All rights reserved. 33 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Mesh Preview
 Mesh motion can be previewed without calculating flow variables:
 Allows user to quickly check mesh quality throughout the

simulation cycle;
 Applicable to any dynamic mesh simulation;

 Accessed via GUI: Solve > Mesh Motion;

 Be careful with the time step.

 Save your case before doing the preview, else the setup will be lost!

© 2006 ANSYS, Inc. All rights reserved. 34 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Dynamic Mesh (DM) Model: Limitations


 Objects may not move from one fluid zone into another;
 Cannot (yet) be used in conjunction with hanging node adaption
(including dynamic adaption);
 Constrained motion, such as a motion about a hinge, is only allowed if
one uses a UDF;
 Bodies may not make contact, since that implies a change in topology;
one always leaves at least one layer of cells between bodies;

© 2006 ANSYS, Inc. All rights reserved. 35 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Dynamic Mesh (DM) Model: Tips


 Suppose you are moving an object and a small fluid zone that
encapsulates it – the remaining, larger fluid zone is not moving. If you
just turn the small fluid zone into a dynamic zone, you will obtain the
correct dynamic mesh behavior. However, if you run the flow
calculation, you will get incorrect wall velocities unless you also turn
the walls of the object into dynamic zones!

 The topic of the next lecture is the layering method.

© 2006 ANSYS, Inc. All rights reserved. 36 ANSYS, Inc. Proprietary


Lecture 4: Layering for Linear Motion

© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

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.

© 2006 ANSYS, Inc. All rights reserved. 38 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering Example 1: Piston


 For the piston, the piston wall is Complex geometry near cylinder head
moved up and down; is tri meshed
 The motion is governed by the “in-
cylinder” controls (see panel below):

Piston wall moves

© 2006 ANSYS, Inc. All rights reserved. 39 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering Example 1: Piston


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

© 2006 ANSYS, Inc. All rights reserved. 40 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering Example 1: Piston


 Split if: h  (1   S )hideal
 Collapse if: h   c hideal

 hideal is defined later, during


the definition of the
dynamic zones.

© 2006 ANSYS, Inc. All rights reserved. 41 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering Example 1: Piston


 Constant Height: Constant
 Every new cell layer has the same height; Height
 Constant Ratio:
Edges “i” and
 Maintain a constant ratio of cell heights
between layers (linear growth); “i+1” have
 Useful when layering is done in curved
same shape
domains (e.g. cylindrical geometry).

Constant
Piston at Ratio
top-most Edge “i+1”
position is an average
of edge “i”
and the
Edge “i” piston shape

© 2006 ANSYS, Inc. All rights reserved. 42 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering Example 1: Piston


 Definition of the
dynamic zone:

piston (wall zone) moves as a


rigid body in the y-direction

© 2006 ANSYS, Inc. All rights reserved. 43 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering Example 1: Piston


 Definition of the ideal
height of a cell layer;
 hideal is about the same as
the height of a typical
cell in the model.

© 2006 ANSYS, Inc. All rights reserved. 44 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering: Other
Examples
 Fuel injector;
 Flow solution on the next slide.

© 2006 ANSYS, Inc. All rights reserved. 45 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering: Other Examples

 Fuel injector;
 Flow solution
(velocity contours).

© 2006 ANSYS, Inc. All rights reserved. 46 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering: Other Examples

 2-stroke engine;
 Of course, a 4-stroke engine could be
simulated in the same way

 Premixed combustion

© 2006 ANSYS, Inc. All rights reserved. 47 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering: Other Examples

 Vibromixer;
 Layering;
 Flow solution on
next slide.

© 2006 ANSYS, Inc. All rights reserved. 48 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering: Other Examples

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

© 2006 ANSYS, Inc. All rights reserved. 49 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering: Limitations
 Layering is used for linear/translational motion;
 Layering is only available for quad, hex, and wedge cells (but you can have other
cell types in the stationary fluid zones);
 If the moving zone is bounded by a two-sided wall, then define a coupled, sliding
interface;
 In 2D, the sliding interfaces must be parallel, straight lines. In 3D, they must be
sides of a prismatic cylinder (i.e., a cylinder with constant cross section);
 One layer of quad cells must always remain, i.e., one cannot eliminate a dynamic
zone;
 If you turn a fluid zone into a dynamic zone, you should also turn the associated
moving walls into dynamic zones – otherwise the incorrect wall boundary
conditions will be applied, and you will get unphysical velocities adjacent to the
wall.

© 2006 ANSYS, Inc. All rights reserved. 50 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Layering: Tips & Tricks


 If you use the in-cylinder tool, be sure to set the in-cylinder parameters before you
define the dynamic zones;
 Similarly, delete the dynamic zones before making changes to the in-cylinder
parameters, and afterwards redefine the dynamic zones;

 While preparing a nonconformal (sliding) interface within Gambit, be sure that the
two fluid zones are totally disconnected. Even nodes on the interface must be
disconnected (i.e., duplicate). If one does not do this, then the typical symptom is
that the dynamic mesh fails, with nodes from the static fluid zone being dragged
along by nodes in the layering zone;
 Also, be sure that the cells are of similar size on both sides of the interface;
otherwise, the dynamic mesh may fail and report negative volumes.

 If you use sliding interfaces, keep the mesh density on both sides similar;

© 2006 ANSYS, Inc. All rights reserved. 51 ANSYS, Inc. Proprietary


Lecture 5: Local Remeshing for Large,
General Motion

© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Introduction


 If the relative motions of the
boundaries are large and
general (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 skewness
and/or fall outside the specified
range of cell volumes;
 In the flowmeter shown, the
cuff rocks and reciprocates
(rotates and translates
sinusoidally).

© 2006 ANSYS, Inc. All rights reserved. 53 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

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 three examples:
 Butterfly valve;
 Simple piston;

© 2006 ANSYS, Inc. All rights reserved. 54 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

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.

© 2006 ANSYS, Inc. All rights reserved. 55 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing Example 1: Butterfly Valve


 The mesh was made
in Gambit;
 Valve radius is 0.1 m
 Small 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

© 2006 ANSYS, Inc. All rights reserved. 56 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing Example 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)
)
 The valve first rotates Omega_z (rad/s)
CCW through 90
1.571
degrees, then CW;
3.2
 The maximum 0.0
0.6 Time (sec)
rotational speed is
15 RPM.

© 2006 ANSYS, Inc. All rights reserved. 57 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing Example 1: Butterfly Valve

 Use Mesh Scale Info… to find the


minimum and maximum length scale of the
initial mesh ;
 Base your specification of the minimum
and maximum length scale on 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.

© 2006 ANSYS, Inc. All rights reserved. 58 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing Example 1: Butterfly Valve


 Define > DynamicMesh > Zones
 Select 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.

© 2006 ANSYS, Inc. All rights reserved. 59 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing Example 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: t  s  0.003m  0.018s
v 0.16m / s

 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)

© 2006 ANSYS, Inc. All rights reserved. 60 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing Example 2: Piston


 Effect of Size Remesh
Interval (SRI):
 If SRI is high, then
remeshing is dominated
by skewness;
 Here SRI = 10;
 Note that cells adjacent
to the moving wall get
stretched/large
(especially on the way
down);
 Also note how localized
the remeshing is.

© 2006 ANSYS, Inc. All rights reserved. 61 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing Example 2: Piston


 Effect of Size
Remesh Interval
(SRI):
 If SRI is low,
then remeshing
is strongly
affected by both
size and
skewness;
 Here SRI = 1;
 Note that cells
adjacent to the
wall don‟t get
stretched as
much.

© 2006 ANSYS, Inc. All rights reserved. 62 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: 12 Short Examples


 Idealized valve (wall
and wall shadow
both move as rigid
bodies):
 Remeshing and
smoothing;
 Two fluid zones;
 Two deforming
symmetry
boundaries
(remeshing only);
 One deforming
non-conformal,
sliding interface
(remeshing only).

© 2006 ANSYS, Inc. All rights reserved. 63 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Short Example 2/12


 Piston with tri mesh
above and quad
mesh below:
 The “piston” (blue
interior edge) is
the dynamic zone,
moves as a rigid
body;
 Remeshing and
smoothing above;
 Layering below;
 Two fluid zones;
 Deforming side
walls only needed
next to tris.

© 2006 ANSYS, Inc. All rights reserved. 64 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Short Example 3/12


 Same as before, but
let us create cell
layers at the bottom:
 The “piston” (blue
interior edge) and
the quad-fluid are
moving as rigid
bodies;
 Two fluid zones;
 The bottom wall is
a dynamic zone of
type “stationary”;
 Deforming side
walls only needed
next to tris.

© 2006 ANSYS, Inc. All rights reserved. 65 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Short Example 4/12


 Another cylinder, but
here we first move the
quad-fluid and the blue
interior edge downward
as a rigid body, while
the tri-fluid expands
(remeshing and
smoothing, plus
deforming side walls)
 Then we freeze the blue
interior edge (as well as
the tri-fluid), and start
generating cell layers
there;
 Driven by two profiles,
one for the blue edge
and one for the quad-
fluid.

© 2006 ANSYS, Inc. All rights reserved. 66 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing:
Short Example 5/12
 Here is an application of the previous
set-up: a compressor with spring-
loaded intake and exhaust valves;
 Flow solution on the next slide:

© 2006 ANSYS, Inc. All rights reserved. 67 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing:
Short Example 5/12
 Compressor with spring-loaded
intake and exhaust valves;
 Flow solution.

© 2006 ANSYS, Inc. All rights reserved. 68 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Short Example 6/12


 An example involving
layering, remeshing,
smoothing, and
nonconformal
interfaces;
 4 dynamic zones:
 two bottom walls
are moving as rigid
bodies;
 the tri-side of the
nonconformal is
deforming;
 the right wall is
deforming.

© 2006 ANSYS, Inc. All rights reserved. 69 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Short Example 7/12


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

© 2006 ANSYS, Inc. All rights reserved. 70 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Short Example 7/12


 An HVAC valve:
 Flow solution (contours
of temperature);
 The small gaps are fully
blocked.

© 2006 ANSYS, Inc. All rights reserved. 71 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Short Example 8/12


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

© 2006 ANSYS, Inc. All rights reserved. 72 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Short Example 9/12


 Two cars
passing
each other;
 Wedge cells
move with
the car (as
rigid body).

© 2006 ANSYS, Inc. All rights reserved. 73 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Short Example 10/12


 Gear pump

© 2006 ANSYS, Inc. All rights reserved. 74 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Short Example 11/12


 Positive
displacement
pump

© 2006 ANSYS, Inc. All rights reserved. 75 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Short Example 12/12

 Airplane
wing‟s
control
surface
(aileron);
 Flow
solution on
next slide:

© 2006 ANSYS, Inc. All rights reserved. 76 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Short Example 12/12

 Airplane
wing‟s
control
surface
(aileron):
2D flow
solution.

© 2006 ANSYS, Inc. All rights reserved. 77 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Short Example 12/12

 Airplane
wing‟s
control
surface
(aileron):
3D.

© 2006 ANSYS, Inc. All rights reserved. 78 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Limitations


 One cannot use hanging-node adaption together with the local remeshing
method (this includes dynamic adaption);
 Local remeshing is only possible with tri and tet cells;
 Mixed zones are not allowed (e.g., a fluid zone with a mix of tet and wedge
cells);
 Nodes on a boundary can only be moved if we can project them onto a
simple geometric entity, such as: a plane, a cylinder, or a user-defined
surface;

© 2006 ANSYS, Inc. All rights reserved. 79 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Tips


 During the remeshing, the Fluent GUI reports a skewness: this is the
skewness before the boundaries/objects move, so the skewness at the end of
the time step will be higher;
 Start with a 2D problem, to develop a feel for the proper settings;
 Remember that the final skewness can only be controlled indirectly;
 Be prepared to spend time adjusting parameters (time step, ideal cell height,
minimum and maximum volumes, maximum skewness, size remesh interval,
etc.);
 If your model has small gaps (flow passages), then you generally need at
least 3-5 cells across that gap. Otherwise, you may get unphysical velocities.
This makes models with tight spaces (gear pumps, g-rotors, etc.) difficult,
and one often has to use even fewer cell layers in the gap;
 Set “Maximum Cell Skewness” to about 0.7 in 2D, and to about 0.85 in 3D;

© 2006 ANSYS, Inc. All rights reserved. 80 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

Local Remeshing: Tips


 Be sure to choose a sufficiently small time step – otherwise the dynamic
mesh may fail; a rule of thumb is that the mesh motion during one time step
should be less than one-half of the smallest cell dimension;
 The use of smoothing (in addition to remeshing) may allow you to use larger
time steps;
 Problems with the time step size may already become evident during the
preview;

 If the motion of the moving object is limited, it may be a good idea to split
the fluid domain into two fluid zones: you can thereby restrict the remeshing
to just one of those two zones and reduce the computational effort.

© 2006 ANSYS, Inc. All rights reserved. 81 ANSYS, Inc. Proprietary


Lecture 6: Coupled Mesh Motion via
the 6 DOF Solver

© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

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 forces
and 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);
 In other words, we want the motion/trajectory of the object to involve the
aerodynamic forces/moments: the motion and the flow field are thus
coupled, and we call this coupled motion;
 Fluent provides a dynamic mesh model 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.

© 2006 ANSYS, Inc. All rights reserved. 83 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

6 DOF Solver
 Motion is coupled with hydrodynamic forces from the flow solution via
FLUENT’s 6 DOF model.
 A udf is needed to specify the mass and the initial inertia matrix, which can be
time dependent
#include "udf.h“
DEFINE_SDOF_PROPERTIES(stage, prop, dt, time, dtime)
{
prop[SDOF_MASS] = 800.0;
prop[SDOF_IXX] = 200.0;
prop[SDOF_IYY] = 100.0;
prop[SDOF_IZZ] = 100.0;

Message("\nstage: updated 6DOF properties");


}

 Inertial matrix needs to be specified in global coordinate


 A udf is written to convert values from principle axis to global coordinate

© 2006 ANSYS, Inc. All rights reserved. 84 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

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. We begin with
the mass and second moments in the local coordinate system:

Excerpt from the 6 DOF UDF:


#include "udf.h"

DEFINE_SDOF_PROPERTIES(store, prop, dt, time, dtime)


{
Mass of the rescue pod (5,000 kg) /* Define the mass matrix */
prop[SDOF_MASS] = 5000.;
Second moments of inertia of the rescue pod
prop[SDOF_IZZ] = 5000.;

/* add ejector forces, moments */


if (time <= 0.3)
{
prop[SDOF_LOAD_F_X] = -10000;
prop[SDOF_LOAD_F_Y] = -80000;
prop[SDOF_LOAD_M_Z] = -2200.0;
}
Message0("\nUpdated 6DOF properties\n");
}

© 2006 ANSYS, Inc. All rights reserved. 85 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

6 DOF; Example 1: Airdrop


 The user continues by adjusting the ejector forces in the global coordinate system:
#include "udf.h"

DEFINE_SDOF_PROPERTIES(store, prop, dt, time, dtime)


{

/* Define the mass matrix */


prop[SDOF_MASS] = 5000.;

prop[SDOF_IZZ] = 5000.;

/* add ejector forces, moments */


if (time <= 0.3)
{
prop[SDOF_LOAD_F_X] = -10000;
prop[SDOF_LOAD_F_Y] = -80000;
prop[SDOF_LOAD_M_Z] = -2200.0;
}
Message0("\nUpdated 6DOF properties\n");
}

© 2006 ANSYS, Inc. All rights reserved. 86 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

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 (property.c),
then build a library (store::libudf), and finally load that library:

© 2006 ANSYS, Inc. All rights reserved. 87 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

6 DOF; Example 1: Airdrop


 Adjusts the gravity vector in the global coordinate system:

© 2006 ANSYS, Inc. All rights reserved. 88 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

6 DOF; Example 1: Airdrop


 Next we revisit the definition of the dynamic zones, and select “store::libudf”
as the UDF that drives the motion of the pod‟s walls (“wall-object”):

“wall-object”
“fluid-bl”

© 2006 ANSYS, Inc. All rights reserved. 89 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

6 DOF; Example 1: Airdrop


 Next we select “store::libudf” as the UDF that drives the motion of the fluid
zone (“fluid-bl”) consisting of the quad cells in the boundary layer adjacent to
the rescue pod:
“wall-object”
“fluid-bl”

Passive option will allow “fluid-bl” to


move with the “wall-object” but it does
not contribute to the force calculation

© 2006 ANSYS, Inc. All rights reserved. 90 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

6 DOF; Example 1: Airdrop


 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;
 One can observe the effect
of one‟s choices for the
dynamic mesh parameters
(such as the spring
constant, the maximum
skewness, etc.).

© 2006 ANSYS, Inc. All rights reserved. 91 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

6 DOF; Example 1: Airdrop


 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.

© 2006 ANSYS, Inc. All rights reserved. 92 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

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!

© 2006 ANSYS, Inc. All rights reserved. 93 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

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


 Silo launch; UDF computes thrust force;

© 2006 ANSYS, Inc. All rights reserved. 94 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

6 DOF coupled motion; short examples (3 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;

© 2006 ANSYS, Inc. All rights reserved. 95 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

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


 Rocket
stage
separation;
 Smoothing
and
remeshing.

© 2006 ANSYS, Inc. All rights reserved. 96 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

6 DOF coupled motion; Tips


 Even in cases with coupled motion, it is wise to preview the mesh motion
before carrying out the flow calculations (which can be expensive);
 Sometimes one can proceed without initialization, and observe a linear motion
in the direction of the gravity vector;
 Other times it is better to compute a steady solution to obtain an initial
distribution of pressures and shear stresses. After convergence, one switches
to the unsteady solver and hooks in the UDF. During the preview, the object
will move based on the forces that resulted from the steady calculation – the
motion usually involves both translation and rotation;

© 2006 ANSYS, Inc. All rights reserved. 97 ANSYS, Inc. Proprietary


Lecture 7: Coupled Mesh Motion via
the 2 DOF User Defined Function

© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

2DOF Heave & Pitch


• Wigley hull advancing in calm water moves in 2 degrees of freedom – heave
& pitch
Yellow lines are interfaces

Collapse & Split


Translation

Rotation as well as
Translation

Translation is in the direction of heave

© 2006 ANSYS, Inc. All rights reserved. 99 ANSYS, Inc. Proprietary


Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

2DOF Heave & Pitch


• Time-dependant calculation using Fluent‟s VOF multiphase model

Pressure Inlet (air) Pressure Outlet


(water)

Pressure Inlet Pressure Outlent


(water) – use open (water) – use open
channel boundary channel boundary
condition condition

© 2006 ANSYS, Inc. All rights reserved. 100 ANSYS, Inc. Proprietary
Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

2DOF Heave & Pitch


• Use open channel boundary condition to resolve hydrostatic pressure
distribution in water

User-defined function is used to generate wave at water inlet

© 2006 ANSYS, Inc. All rights reserved. 101 ANSYS, Inc. Proprietary
Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

2DOF Heave & Pitch


• Use open channel boundary condition to resolve hydrostatic pressure
distribution in water

User-defined function is used to generate wave at water inlet

© 2006 ANSYS, Inc. All rights reserved. 102 ANSYS, Inc. Proprietary
Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

2DOF Heave & Pitch


• UDF for wave generation

#include "udf.h"

DEFINE_PROFILE(unsteady_velocity, thread, position)


{
face_t f;
real t = CURRENT_TIME;

begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = 5.0 + 5.0*sin(10.0*t + M_PI*1.5);
}
end_f_loop(f, thread)
}

© 2006 ANSYS, Inc. All rights reserved. 103 ANSYS, Inc. Proprietary
Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

2DOF Heave & Pitch


• We can not use 6 DOF solver in Fluent, because we have to confine one
translational motion.

• Another UDF is needed to specify the mass and the initial inertia matrix,
compute forces and moment, and drive an object to move.

© 2006 ANSYS, Inc. All rights reserved. 104 ANSYS, Inc. Proprietary
Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

2DOF Heave & Pitch


 After compiling and loading the UDF, select “two_dof::libudf” as the UDF that
drives the motion of the fluid zones and wall zone:

“fluid_layer”
“fluid_rotate”

“moving_body”
© 2006 ANSYS, Inc. All rights reserved. 105 ANSYS, Inc. Proprietary
Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

2DOF Heave & Pitch


 Next we select “Stationary” zone for layering:

“top_wall_stat”

“bottom_wall_stat”

© 2006 ANSYS, Inc. All rights reserved. 106 ANSYS, Inc. Proprietary
Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

2DOF Heave & Pitch


 Initialize variables and patch water volume fraction as “1” to initial free
surface level

© 2006 ANSYS, Inc. All rights reserved. 107 ANSYS, Inc. Proprietary
Dynamic Mesh Training Notes Fluent User Services Center
UGM at Marine Industries 2007 www.fluentusers.com

2DOF Heave & Pitch


 Iterate until the solution converge without time advancement to get initial
hydrostatic pressure distribution.

© 2006 ANSYS, Inc. All rights reserved. 108 ANSYS, Inc. Proprietary

You might also like