Beruflich Dokumente
Kultur Dokumente
Agenda
9:00 Overview of Dynamic Mesh (DM)
9:30 Global Controls
10:00 Dynamic Zones
10:30 Motion Specification
11:00 Step-by-Step Procedure
11:15 Tutorial 1
12:00 Lunch
1:00 Step-by-Step Procedure
1:30 Tutorial 2
2:30 Examples
3:00 Tips-and-Tricks and Technical Discussion Session
2-2 © Fluent Inc. 11/7/2005
Fluent User Services Center FLUENT Software Training
DM Model March 2003
www.fluentusers.com
Overview of DM
Spring Analogy
Interior nodes behave like a spring
or sponge
Connectivity remains unchanged
Limited to relatively small
deformation when used as a stand-
alone meshing scheme
Available for tri, tet, quad, hex and
wedge mesh element types
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
Dynamic 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
Combination of Approaches
Initial mesh needs
proper decomposition
Layering
z Valve travel region
z Lower cylinder
region
Remeshing
z Upper cylinder
region
Non-conformal
interface between
zones
Combination of Approaches
Motion Specification
Internal node positions are automatically calculated based on user
specified boundary motion
Mesh motion scheme in each zone is automatically chosen based on
element type in that zone
Prescribed mesh motion
z Position or velocity versus time i.e. ‘profile’ text file
z UDF with expression for position or velocity
Flow dependant motion
z Mesh motion is coupled with the flow solution through a UDF
z Can integrate forces (pressure, gravity and viscous etc)
z Six degree of freedom UDF provided
z UDF readily customized for desired mesh motion
Mesh Preview
Mesh motion can be previewed without calculating flow variables
z Allows user to quickly check mesh quality throughout the simulation cycle
z Applicable to any dynamic mesh simulation
Global Controls
Overview
Define > Dynamic Mesh > Parameters z Dynamic Mesh model enables generic
z Methods functionality
toggle spring analogy, layering, z In-Cylinder option adds specific
remeshing approaches functionality
GUI dynamically changes to reflect definition of RPM, starting crank angle,
selected methods crank period, etc...
option enables IC specific profile format
for valve motion
Overview
Smoothing (spring) parameters Layering parameters
z ‘stiffness’ z split/collapse factor
z boundary node relaxation Remeshing parameters
z convergence tolerance z min/max volume
z (max) number of iterations z max skewness
Smoothing
Edges between any two mesh nodes are idealized as a
network of interconnected springs. A set of linear
equations are derived based on force balance at the
nodes. The node positions at each time-step are solved
iteratively.
By default smoothing is applied on tet/tri mesh.
To apply smoothing for all type of mesh use:
(rpsetvar 'dynamesh/spring/all-element-type? #t)
Spring Constant Factor: It adds “damping” to the
springs [1,0]
Boundary Node Relaxation: Under-relaxation used
for the boundary nodes. Use a value of 0 if no
smoothing on the boundaries
z A default value of 1.0 is used for interior nodes
Convergence Tolerance: Used when solving for node
positions.
Number of Iterations: Max number of iterations.
Smoothing
Spring
Constant
Factor = 1.0
Smoothing
Spring
Constant
Factor = 0.1
Smoothing
Spring
Constant
Factor = 0.05
Smoothing
Spring
Constant
Factor = 0
Smoothing
Smoothing on Quads
(rpsetvar 'dynamesh/spring/all-element-type? #t)
Smoothing
The rpsetvar command is
not used here. Smoothing is
not applied automatically on
quad/hex meshes.
Layering
Constant Height
z Useful for uniform layer height
Constant Ratio:
z Maintain a constant ratio of cell
heights between layers
z Useful when layering is done in
curved domains (e.g. cylindrical
geometry).
Split if:
Collapse if:
Layering
Layering
Remeshing
Sizing Function Controls:
Resolution: determines the size of the
background bins used to evaluate the
size distribution with respect to the
minimum characteristic length of the
current mesh.
Sizing Function Variation Rate: How
the background mesh increases in size
(from the boundary to the interior) [-
1,+inf]
Distance Threshold: Is the degree of
polynomial that handles the size
variation of the background cell size.
(values in [-1,1]).
Size Remesh Interval: How often the
remeshing is done based on min and
max cell volume.
Remeshing
Meaning of Variation Rate:
A value of -0.5 means that the minimum mesh size (cell edge length)
in the interior is half of the mesh size at the boundary,
A value of 50 means that the maximum mesh size in the interior can be
50 times higher than the mesh size at the boundary.
Meaning of Distance Threshold:
The higher the value, the slower the change of the mesh size close to
the boundary.
A threshold value of 0 corresponds to linear in-/de-crease from the
boundary.
Negative threshold values enforce a faster (than linear) in-/de-crease at
the boundary.
Default Values work fine most of the time.
Remeshing
Minimum Cell Volume: mark cells for remeshing if their size gets
smaller than this value
Maximum Cell Volume: mark cells for remeshing if their size gets
larger than this value
Maximum Skewness: mark cells if their skewness increases this value
z Use 0.9 for tet mesh and
z 0.75 for tris
Remeshing
No Smoothing
Effect of Size Remesh
Interval (SRI)
z SRI = 10
z Note that cells
adjacent to moving
wall get stretched.
Remeshing
No Smoothing
Effect of Size
Remesh Interval
(SRI)
z SRI = 1
z Note cells
adjacent to wall
don’t get
stretched as
much.
Dynamic Zones
Motion Specification
In-Cylinder Motion
For any simple sinusoidal (single-
degree, rigid-body, and
prescribed) motion, we can use
the built-in piston motion: A
L
L ps
θ
c Valve/Piston
Axis
A
Table Profile
For any type of rigid-body, single-degree, and prescribed motion, you
can use a profile table having the following format:
((profile_name_1 3 point)
(time 0 1 2)
(x 2 3 4) where,
(v_y 0 -5 0)) {“time”,“angle”};
{ "x", "y", "z"};
((profile_name_2 3 point) {"v_x", "v_y", "v_z"};
(time 0 1 2) {"theta_x", "theta_y", "theta_z"};
(omega_x 2 3 4)) {"omega_x", "omega_y", "omega_z"};
UDFs
Fluent also provides the following macros for DM calculations:
z DEFINE_CG_MOTION
z DEFINE_GEOM
z DEFINE_GRID_MOTION
DEFINE_CG_MOTION Macro
Used to define the motion of the center of gravity for rigid body motion
z Used for un-prescribed and prescribed motion
z Multiple-Degree of freedom
Macro: DEFINE_CG_MOTION ( name, dt, vel, omega, time, dtime)
Argument types:
z void *dt (dynamic thread pointer; common in all macros)
z real vel[] (array that returns the CG velocity)
z real omega[] (array that returns the ω of the CG)
z real time (time)
z real dtime (time step)
Function returns: void
DEFINE_CG_MOTION Example
#include "udf.h" /* compute pressure force on body by looping through all
#include "dynamesh_tools.h" faces */
force = 0.0;
static real v_prev = 0.0; begin_f_loop (f, t)
{
DEFINE_CG_MOTION(piston, dt, vel, omega, time, dtime)
F_AREA (A, f, t);
{
Thread *t; force += F_P (f, t) * NV_MAG (A);
face_t f; }
real NV_VEC (A); end_f_loop (f, t)
real force, dv;
/* compute change in velocity, i.e., dv = F * dt / mass
/* reset velocities */ velocity update using explicit euler formula */
NV_S (vel, =, 0.0); dv = dtime * force / 50.0;
NV_S (omega, =, 0.0); v_prev += dv;
Message ("time = %f, x_vel = %f, force = %f\n", time, v_prev,
if (!Data_Valid_P ())
force);
return;
/* get the thread pointer for which this motion is defined */ /* set x-component of velocity */
t = DT_THREAD ((Dynamic_Thread *)dt); vel[0] = v_prev;
}
DEFINE_GEOM Macro
The DEFINE_GEOM macro is used to define geometry in a deforming
zone
Macro: DEFINE_GEOM ( name, d, dt, position)
Argument types:
z char name
z Domain *d
z void *dt
z real *position (this matrix is overwritten with the node position on the
boundary)
Function returns: void
DEFINE_GEOM Example
/************************************************************
*
* defining parabola through points (0, 1), (1/2, 5/4), (1, 1)
*
************************************************************/
#include "udf.h"
The new position (after projection to the geometry defining the zone)
is returned to FLUENT by overwriting the position array
DEFINE_GRID_MOTION Macro
Useful when defining the position of the nodes individually, e.g. fluid-
structure interaction.
DEFINE_GRID_MOTION ( name, d, dt, time, dtime)
Argument types:
z char name
z Domain *d
z void *dt
z real time
z real dtime
Function returns: void
DEFINE_GRID_MOTION Example
Case: Specify the deflection of a beam based on local coordinate x and
time t according to
− 10 .4 x sin( 27 .178 t ), x > 0.02
ω ( x, t ) = {
0, x < 0.02
r n +1 = r n + Ω × r n Δt
DEFINE_GRID_MOTION Example
NV_S (omega, =, 0.0);
/********************************************************** NV_D (axis, =, 0.0, 1.0, 0.0);
* NV_D (origin, =, 0.0, 0.0, 0.152);
* node motion based on simple beam deflection equation
* compiled UDF begin_f_loop (f, tf)
* {
**********************************************************/ f_node_loop (f, tf, n)
#include "udf.h" {
v = F_NODE (f, tf, n);
DEFINE_GRID_MOTION(beam, domain, dt, time, dtime)
{ /* update node if x position is greater than 0.02
Thread *tf = DT_THREAD (dt); and that the current node has not been previously
face_t f; visited when looping through previous faces */
Node *v; if (NODE_X (v) > 0.020 && NODE_POS_NEED_UPDATE (v))
real NV_VEC (omega), NV_VEC (axis), NV_VEC (dx); {
real NV_VEC (origin), NV_VEC (rvec); /* indicate that node position has been update
real sign; so that it's not updated more than once */
int n; NODE_POS_UPDATED (v);
/* set deforming flag on adjacent cell zone */ omega[1] = sign * pow (NODE_X (v)/0.230, 0.5);
SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf)); NV_VV (rvec, =, NODE_COORD (v), -, origin);
NV_CROSS (dx, omega, rvec);
sign = -5.0 * sin (26.178 * time); NV_S (dx, *=, dtime);
NV_V (NODE_COORD (v), +=, dx);
Message ("time = %f, omega = %f\n", time, sign); }
}
}
end_f_loop (f, tf);
}
Summary
Mesh schemes available
z Spring Smoothing
z Layering
z Remeshing
If there is relative motion between the boundary and its adjacent cell zone,
Fluent will automatically choose the appropriate mesh scheme
z If the adjacent cell type is hex/quad, or wedge, it will use layering.
z If the adjacent cell type is tet/tri, it will use Spring Smoothing and Remeshing
The initial mesh needs to be decomposed according to the mesh scheme
desired.
Motion can be specified to face zones as well as to cell zones.
Motion can be defined using profile, built-in in-cylinder piston profile, or UDF
Motion can be prescribed or un-prescribe
sides
1
V_y 0
(m/s) 1cm
-1
bot 0.07cm
V_y
cells-tri
0.07cm
bot
2 - 58 © Fluent Inc. 11/7/2005
Fluent User Services Center FLUENT Software Training
DM Model March 2003
www.fluentusers.com
sides
0.07cm
2 - 59 © Fluent Inc. 11/7/2005
Fluent User Services Center FLUENT Software Training
DM Model March 2003
www.fluentusers.com
sides
1 x
1cm
V_y 0
(m/s)
-1 .07cm cells-tri int
V_y
0 .005 .01 .015 .02
Time (s) 0.1cm
cells-quad
.033cm
.07cm
cells-tri V_y
cells-quad
0.033 .033cm
int
2 - 64 © Fluent Inc. 11/7/2005
Fluent User Services Center FLUENT Software Training
DM Model March 2003
www.fluentusers.com
sides
.07cm
V_y
cells-quad
cells-quad
.033cm bot
2 - 69 © Fluent Inc. 11/7/2005
Fluent User Services Center FLUENT Software Training
DM Model March 2003
www.fluentusers.com
.07cm
V_y
cells-tri
cells-quad
int
2 - 70 © Fluent Inc. 11/7/2005
Fluent User Services Center FLUENT Software Training
DM Model March 2003
www.fluentusers.com
sides-tri
.07cm
cells_quad
(m/s) 0
-1 cells-quad
0 .005 .01 .015
.02 ((cells-quad 5 point)
-1 Time (s) (time 0 .005 .01 .015 .02)
(v_y 0 -1 0 1 0))
int
-0 ((int 7 point)
(m/s)
(time 0 .005 .005 .01 .015 .015 .02)
-1 (v_y 0 -1 0 0 0 1 0))
0 .005 .01 .015
.02
Time (s)
Profile File
2 - 74 © Fluent Inc. 11/7/2005
Fluent User Services Center FLUENT Software Training
DM Model March 2003
www.fluentusers.com
Simple Non-Conformal
What if we have
non-conformal
interface?
It is used for:
z Closing
valves.
z Must have it
between
layering and
remeshing.
Simple Non-Conformal
DefineÆGrid Interfaces
z Select int_quad under Interface Zone 1
z Select int_tri under Interface Zone 2
z Specify name under Grid Interface
cells-quad cells-tri
z Click on Create
Note: Motion Specification to the bottom walls
are not shown.
int-quad int-tri
Simple Non-Conformal
Define Dynamic Zones
z Only the sides that is part of the tri
should be declared as Deforming.
cells-quad cells-tri
int-quad int-tri
Simple Non-Conformal
Define Dynamic Zones
z Define sides as Deforming
cells-tri
side-tri
cyl-side:
deforming
piston:
rigid-body
piston motion
v_y
-0
(m/s)
-1
0 .005 .01 .015
.02
Time (s) Low pressure
Current Limitations
Can’t have two deforming face zones attached.
For deforming face zone, one need to have complete edge-loop
You may also need to use deforming on a face zone if the adjacent
cell zone is only being smoothed.
Examples
Passing Cars
Passing Cars
Prism layers
move with the car.
Check Valves
Fluid-structure interaction
Spring loaded valve.
Determine ball position as a
function of flow forces
z Implemented through a UDF
Check Valves
The max displacement of the ball
was known to be small. So only
smoothing is used.
Fuel Injectors
Transient flow rates
Cavitation
Flow forces
Pure Layering
Fuel Injectors
Velocity
Contours
Compressors
Spring loaded valves
Valve motion coupled to the flow
solution via a UDF
Compressors
As the piston moves to BDC,
intake valve opens and exhaust
valve closes
As the piston moves to TDC,
intake valve closes and exhaust
valve opens
2-Stroke Engines
Premixed combustion
Mesh motion
4-Stroke Engines
Gear Pumps
Volumetric Pump
Pump diameter of 6 cm
Water
Eccentric (offset) rotor
z Blades move in and out
of the rotor
All-hex grid
z 100,000 cells
Mesh motion specified via
user-defined function
z Constant RPM of 1,500
Volumetric Pump
Geometry
and motion
Volumetric Pump
Pressure
contours
Vibromixer
Contours of
Velocity
Vibromixer
Pure
Layering
Store Separation
Fluent
Versus
Wind
Tunnel
Store Separation
Contours of
pressure
Note partition
interface move.
z Dynamic
partitioning is
performed.