6dof
TRANSCRIPT
© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
UDF와 Dynamic Mesh를 이용한Coupled motion의 구현
2© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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. ANSYS, Inc. Proprietary
Lecture 1: Controlling
Inlet velocity using
DEFINE_PROFILE
4© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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
5© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
User Access to the FLUENT Solver
User-Defined Properties
User-Defined BCs
User Defined
INITIALIZE
Segregated PBCS
Exit Loop
Repeat
Check Convergence
Update Properties
Solve Turbulence Equation(s)
Solve Species
Solve Energy
Initialize Begin Loop
DBCS
Solve Other Transport Equations as required
Solver?
Solve Mass Continuity;
Update Velocity
Solve U-Momentum
Solve V-Momentum
Solve W-Momentum
Solve Mass
& Momentum
Solve Mass,
Momentum,
Energy,
Species
User-
defined
ADJUST
Source termsSource terms
Source terms
Source
terms
6© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
7© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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
8© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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
2
0745.0120)(
yyu
0y)(yu
9© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Step 1 – Prepare the Source Code
The DEFINE_PROFILE macro allows the function inlet_x_velocity tobe defined.
All UDFs begin with a DEFINE_macro.
inlet_x_velocity will be identifiable in solver GUI.
thread and nv are arguments ofthe DEFINE_PROFILE macro,which are used to identify the zoneand variable being defined,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
#include "udf.h“
DEFINE_PROFILE(inlet_x_velocity, thread, nv)
{
float x[3]; /* Position vector*/
float y;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
F_PROFILE(f, thread, nv)
= 20.*(1.- y*y/(.0745*.0745));
}
end_f_loop(f, thread)
}
10© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Compiled UDF
Add the UDF source code to the Source
Files list.
Click Build to create UDF library.
Click Load to load the library.
You can also unload a library if needed.
Interpreted UDF
Add the UDF source code to the Source
File Name list.
Click Interpret.
The assembly language code will
display in the FLUENT console.
Step 3 – Interpret or Compile the UDF
Define User-Defined Functions Interpreted… Define User-Defined Functions Compiled…
Define User-Defined Functions Manage…
11© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Interpreted vs. Compiled UDFs
Functions can either be read and interpreted at run time or compiledand 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.
12© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
13© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
14© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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…
15© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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
16© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
17© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Thread and Looping Utility Macros
cell_t c; Defines c as a cell thread index
face_t f; Defines f as a face thread index
Thread *t; t is a pointer to a thread
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
cell_t, face_t, Thread,
Domain are part of FLUENT
UDF data structure
18© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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 centroidin array x[]
F_CENTROID(x,f,t); Returns coordinates of face centroidin 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
19© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Cell Field Variable Macros
C_R(c,t); Density
C_P(c,t); Pressure
C_U(c,t); U-velocity
C_V(c,t); V-velocity
C_W(c,t); W-velocity
C_T(c,t); Temperature
C_H(c,t); Enthalpy
C_K(c,t); Turbulent kinetic energy (k)
C_D(c,t); Turbulent dissipation rate (ε)
C_O(c,t); Specific dissipation of TKE (ω)
C_YI(c,t,i); Species mass fraction
C_UDSI(c,t,i); UDS scalars
C_UDMI(c,t,i); UDM scalars
C_DUDX(c,t); Velocity derivative
C_DUDY(c,t); Velocity derivative
C_DUDZ(c,t); Velocity derivative
C_DVDX(c,t); Velocity derivative
C_DVDY(c,t); Velocity derivative
C_DVDZ(c,t); Velocity derivative
C_DWDX(c,t); Velocity derivative
C_DWDY(c,t); Velocity derivative
C_DWDZ(c,t); Velocity derivative
C_MU_L(c,t); Laminar viscosity
C_MU_T(c,t); Turbulent viscosity
C_MU_EFF(c,t); Effective viscosity
C_K_L(c,t); Laminar thermal conductivity
C_K_T(c,t); Turbulent thermal conductivity
C_K_EFF(c,t); Effective thermal conductivity
C_CP(c,t); Specific heat
C_RGAS(c,t); Gas constant
C_DIFF_L(c,t); Laminar species diffusivity
C_DIFF_EFF(c,t,i); Effective speciesdiffusivity
20© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
21© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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. ANSYS, Inc. Proprietary
Lecture 2: Controlling
Rigid Body Motion using
DEFINE_CG_MOTION
23© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
24© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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;
25© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
DEFINE_CG_MOTION; Example : Airdrop
#include "udf.h“
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
26© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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. ANSYS, Inc. Proprietary
Lecture 3: Overview of the
Dynamic Mesh (DM) Model
28© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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;
29© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
30© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
31© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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).
32© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
33© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
34© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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!
35© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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;
36© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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. ANSYS, Inc. Proprietary
Lecture 4: Layering for Linear Motion
38© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
39© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Layering Example 1: Piston
For 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
40© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Layering Example 1: Piston
Cells are being split or collapsed as
the piston wall comes near
(explanation on the next page):
41© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Layering Example 1: Piston
Split if:
Collapse if:
hideal is defined later, during the definition of the dynamic zones.
idealS hh )1(
idealchh
42© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Layering Example 1: Piston
Constant 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).
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
43© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Layering Example 1: Piston
Definition of the
dynamic zone:
piston (wall zone) moves as a
rigid body in the y-direction
44© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
45© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Layering: Other
Examples Fuel injector;
Flow solution on the next slide.
46© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Layering: Other Examples
Fuel injector;
Flow solution
(velocity contours).
47© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Layering: Other Examples
2-stroke engine;
Of course, a 4-stroke engine could be
simulated in the same way
Premixed combustion
48© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Layering: Other Examples
Vibromixer;
Layering;
Flow solution on
next slide.
49© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Layering: Other Examples
Vibromixer;
Layering;
Flow solution
(contours of
velocity).
50© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
51© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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. ANSYS, Inc. Proprietary
Lecture 5: Local Remeshing for Large,
General Motion
53© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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).
54© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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;
55© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
56© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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
57© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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)
)
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
58© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
59© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
60© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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: ssm
m
v
st 018.0
/16.0
003.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)
61© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
62© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
63© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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).
64© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
65© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
66© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
67© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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:
68© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Local Remeshing:
Short Example 5/12
Compressor with spring-loaded
intake and exhaust valves;
Flow solution.
69© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
70© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Local Remeshing: Short Example 7/12
An HVAC valve:
Remeshing and
smoothing;
Nonconformal grid
interface (circular
arc);
Flow solution on next
slide.
71© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Local Remeshing: Short Example 7/12
An HVAC valve:
Flow solution (contours of temperature);
The small gaps are fully blocked.
72© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Local Remeshing: Short Example 8/12
Automotive valve:
Remeshing,
smoothing, and
layering;
4 nonconformal grid
interfaces (vertical
lines);
The gaps are fully
blocked;
73© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Local Remeshing: Short Example 9/12
Two cars
passing
each other;
Wedge cells
move with
the car (as
rigid body).
74© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Local Remeshing: Short Example 10/12
Gear pump
75© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Local Remeshing: Short Example 11/12
Positive
displacement
pump
76© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Local Remeshing: Short Example 12/12
Airplane
wing‟s
control
surface
(aileron);
Flow
solution on
next slide:
77© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Local Remeshing: Short Example 12/12
Airplane
wing‟s
control
surface
(aileron):
2D flow
solution.
78© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
Local Remeshing: Short Example 12/12
Airplane
wing‟s
control
surface
(aileron):
3D.
79© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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;
80© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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;
81© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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. ANSYS, Inc. Proprietary
Lecture 6: Coupled Mesh Motion via
the 6 DOF Solver
83© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
84© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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
85© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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:
#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");
}
Excerpt from the 6 DOF UDF:
Mass of the rescue pod (5,000 kg)
Second moments of inertia of the rescue pod
86© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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");}
87© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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:
88© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
6 DOF; Example 1: Airdrop
Adjusts the gravity vector in the global coordinate system:
89© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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”):
“fluid-bl”
“wall-object”
90© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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:
“fluid-bl”
“wall-object”
Passive option will allow “fluid-bl” to
move with the “wall-object” but it does
not contribute to the force calculation
91© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.).
92© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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.
93© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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!
94© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
6 DOF coupled motion; short examples (2 of 4)
Silo launch; UDF computes thrust force;
95© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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;
96© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
6 DOF coupled motion; short examples (4 of 4)
Rocket
stage
separation;
Smoothing
and
remeshing.
97© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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. ANSYS, Inc. Proprietary
Lecture 7: Coupled Mesh Motion via
the 2 DOF User Defined Function
99© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
• Wigley hull advancing in calm water moves in 2 degrees of freedom – heave & pitch
Rotation as well as
Translation
Translation
Translation is in the direction of heave
Collapse & Split
Yellow lines are interfaces
2DOF Heave & Pitch
100© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
• Time-dependant calculation using Fluent‟s VOF multiphase model
2DOF Heave & Pitch
Pressure Inlet (air)
Pressure Inlet
(water) – use open
channel boundary
condition
Pressure Outlent
(water) – use open
channel boundary
condition
Pressure Outlet
(water)
101© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
• Use open channel boundary condition to resolve hydrostatic pressure distribution in water
2DOF Heave & Pitch
User-defined function is used to generate wave at water inlet
102© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
• Use open channel boundary condition to resolve hydrostatic pressure distribution in water
2DOF Heave & Pitch
User-defined function is used to generate wave at water inlet
103© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
• UDF for wave generation
2DOF Heave & Pitch
#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)
}
104© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
• 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.
2DOF Heave & Pitch
105© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
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_rotate”
“fluid_layer”
“moving_body”
106© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
2DOF Heave & Pitch Next we select “Stationary” zone for layering:
“top_wall_stat”
“bottom_wall_stat”
107© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
2DOF Heave & Pitch Initialize variables and patch water volume fraction as “1” to initial free
surface level
108© 2006 ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary
Fluent User Services Center
www.fluentusers.com
Dynamic Mesh Training Notes
UGM at Marine Industries 2007
2DOF Heave & Pitch Iterate until the solution converge without time advancement to get initial
hydrostatic pressure distribution.