You are on page 1of 117

Modeling Transient Flows

Modeling Transient Flows


with Fluent 6
with Fluent 6
Frank Kelecy Frank Kelecy
Fluent Inc. Fluent Inc.
June 9, 2005 June 9, 2005
Agenda
Motivation and Goals
Algorithms
Temporal Discretization
Sub-iteration and Dual Time Stepping
Non-iterative Schemes
Setting Up Unsteady Problems
Solving and Post-processing
Physical Models and Unsteady Flows
Summary
Appendix
Additional Material on Solver Features and Physical Models
Motivation
Nearly all flows in nature are unsteady!
Steady-state assumption is possible if we
Ignore unsteady fluctuations
Employ ensemble/time-averaging to remove
unsteadiness (e.g. turbulence modeling)
In CFD, steady-state methods are preferred
Lower computational cost
Easier to post-process and analyze
Many applications, however, require resolution of unsteady flow
Typical Applications
Aerodynamics (aircraft, land vehicles,etc.)
Vortex shedding
Rotating Machinery
Rotor-stator interaction
Rotating stall, surging
Multiphase Flows
Free surface motions
Bubble dynamics (fluidized beds, bubble columns)
Deforming Domains
In-cylinder combustion
Store separation
Unsteady Heat Transfer
Transient heating, cooling
Origin of Unsteady Flow
Natural unsteadiness
Unsteady flow due to growth of instabilities within the fluid or a non-
equilibrium initial fluid state
Examples: natural convection flows, turbulent eddies of all scales, fluid
waves (gravity waves, shock waves)
Forced unsteadiness
Time-dependent boundary conditions, source terms drive the unsteady flow
field
Examples: pulsing flow in a nozzle, rotor-stator interaction in a turbine stage
Kelvin-Helmholtz cloud instability Rotor-stator interaction in an axial compressor
Goals of Unsteady CFD Analysis
Simulate transient flow field over a specified time period
Solution may approach
Steady-state solution flow variables stop changing with time
Time-periodic solution flow variables fluctuate with a repeating
temporal pattern
Goal may also be to simply track the flow over the simulation
period
Free surface flows, moving shock waves
Extract quantities of interest
Natural frequencies (e.g. Strouhal Number)
Time, RMS averages
Time-related parameters (e.g. time required to cool a hot solid,
residence time of a pollutant)
Spectral data (FFT)
Agenda
Motivation and Goals
Algorithms
Temporal Discretization
Sub-iteration and Dual Time Stepping
Non-iterative Schemes
Setting Up Unsteady Problems
Solving and Post-processing
Physical Models and Unsteady Flows
Summary
Appendix
Additional Material on Solver Features and Physical Models
Unsteady Equations

+ = +

V A A V
dV S A d A d V dV
t

r r r
unsteady
convection diffusion generation
Eqn.
continuity 1
x-mom. u
y-mom. v
energy h

Generic unsteady transport equation
Finite Volume Discretization
V S A A V V
t
f
faces
f f f
faces
f f f
+ = +

r r r
) (
) (
control
volume
Evaluate surface and volume
integrals over control volume using
finite volume approach
Variables now represent averages
evaluated at cell or face centers
Temporal discretization to be
determined
Temporal Discretization
(

A + V I +
A
=
=
c
c

V S A A V
V
F
F
t
f
faces
f f f
faces
f f f | |
| | |
|
|
r r r
) ( ) (
1
) (
) (
) (
Write discrete unsteady equations as
Need to discretize the time derivative
Temporal Discretization (2)
First-Order Scheme
) (
) ( ) (
1


F
t
n n
=

+
) (
2
) ( ) ( 4 ) ( 3
1 1


F
t
n n n
=

+
+
time
t
t-t
t+t
n
n+1
n-1
n = time step index
t = physical time
Second-Order Scheme
How is F() evaluated?
Explicit Time Integration
Evaluate F() at current time level (n)
Example: First order explicit scheme
) ( ) ( ) (
1 n n n
tF + =
+
Implications
Simplest approach data known at current time level
All cells are marched in time with the same time step
Time step is restricted by stability limits, typically in the form of the
Courant number:
Since Courant number < 1, maximum stable time step is mesh
dependent, and is tied to the smallest cell in the domain!
1 No. Courant <

x
t V
V = fluid velocity scale
t = time step
x = characteristic mesh size
Explicit Runge-Kutta Scheme
Fluents Coupled-Explicit Solver uses a multi-stage Runge-Kutta
scheme
Runge-Kutta scheme provides better stability and a less-restrictive
time step limit for non-linear equations than simple explicit scheme
For compressible flows, time step is computed as
m n
i
i
n i
n
tF
) ( ) (
) ( ) ( ) (
) ( ) (
1
1
0
1,2,3...m i



=
+ =
=
+

=
a u
x
CFL t
+

=
x = local grid size
u = local fluid velocity
a = speed of sound
CFL=Courant number
Implicit Time Integration
Evaluate F() at future (n+1) time level
Example: First order (Euler) implicit scheme
) ( ) ( ) (
1 1 + +
+ =
n n n
tF
Implications
Solution unknowns are coupled together at future time level (n+1)
Time step is not tied to Courant number stability restrictions
We can theoretically use as large a time step as we want
(unconditionally stable) though this is only strictly true for
linear equations, for which unconditional stability can be proven
mathematically
How do we handle the coupling at future time levels?
Sub-iteration
We can deal with the coupling of the discrete equations at the
future time level by iteratively solving the implicit equations as
follows:
Define a provisional solution
i
which is initialized with
the current solution
n
Iteratively solve the implicit equations until the provisional
solution satisfies the equations

i

n+1
as the sub-iteration process converges
Example: First Order Implicit Scheme
1,2,3... i ) ( ) ( ) ( = + =
i n i
tF
(i = iteration count)
Implications of Sub-iteration
Solution of implicit equations for a single time step is identical to the
solution of a steady-state problem
Sub-iteration process is similar to solving a steady-state solution
from a prescribed initial condition
The number of sub-iterations required to converge the sub-iteration
process will depend upon the time step
In general, the number of sub-iterations increases as the time
step is increased
Residuals are a general guide to convergence, but
you may wish to observe other solution monitors as functions of
iteration to ensure that the solution is converging properly
Sub-iteration is also deals with non-linearity and coupling in the
unsteady equations
Sub-iteration can be applied to both the segregated and coupled
solvers
Sub-iteration Convergence Behavior
t 10t
Dual-Time Stepping
Dual time stepping is a variation of sub-iteration which is better
suited to the coupled solver algorithms
Essential idea add an extra unsteady term to the equations
which is integrated in a pseudo-time
) (
~
) (
) (






=

t
t

terms) source (fluxes, vector RHS


variables dependent coupled of vector
=
=


Dual-Time Stepping (2)
We note that the new form of the equations is identical in form to
the old so we can employ the same algorithms
Example: m-stage Runge-Kutta scheme
m p
i
i
p i
p
tF
) ( ) (
) ( ) ( ) (
) ( ) (
1
1
0
1,2,3...P p 1,2,3...m i



=
+ =
=
+

= =
P = number of pseudo-time steps
Implications of Dual-Time Stepping
Dual-time stepping permits explicit schemes (like Runge-
Kutta) to be used with an implicit temporal discretization
Like sub-iteration, dual-time stepping requires convergence of
the solution in pseudo-time to obtain the solution at the next
time level
The number of pseudo-time steps required depends on the
time step
Improved preconditioning for coupled implicit (in time)
solver
Mainly benefits accuracy and robustness for low Mach
number flows
Coupled Solver Efficiency Improvements in
Fluent 6.2
Old preconditioning
New preconditioning
Baseline solution
(Four-stage R-K)
Pressure wave
propagation
.One of the downsides of sub-iteration schemes is that they can be
inefficient (i.e. solver uses more sub-iterations than it really needs)
Time derivative discretization introduces truncation error
Splitting of the operators in the solver introduces a time step related
splitting error
Sub-iteration tries to eliminate the splitting error.BUT
the overall time-accuracy can be preserved as long as the
splitting error is O(t
2
)
Truncation error
O( t
2
)
Splitting error
O( t
n
)
Overall time-discretization
error for 2
nd
-order scheme
O( t
2
)
Non-iterative Schemes (Segregated Solver)
New in 6.2 for the segregated solver
No outer (pressure-velocity) iteration
within a time-step
Sub-iterations are needed to account for
the deferred-corrections, non-linearity in
and coupling among the equations

Splitting error ~ O(t


2
)
Speed-up by a factor ~ N
ITA
/2 (N
ITA
is the
number of iterations per time step)
Two flavors
PISO
Fractional-step method
Solve k and
Solve U,V,W Eq.
Solve Pressure Correction
Correct Velocity, Pressure,Flux
Next time-step
n += 1
t = t + nt
Solve other scalars
Non-Iterative Time-Advancement (NITA)
Schemes
Originally proposed as a non-iterative scheme (Issa, 1985)
Splitting error in the PISO scheme can be made smaller
than the truncation error (by multiple corrector steps).
Consists of 1 predictor and N corrector steps (N =2 for
2
nd
-order accuracy)
Fluent 6.2 newly offers a new NITA version of PISO
scheme
Energy & turbulence equations and compressibility
effects are still loosely coupled.
You can still use PISO in a sub-iterative manner is
desired
The NITA PISO Scheme
The NITA Fractional-Step Method (FSM)
Employs an Approximate Factorization technique to solve
the momentum and pressure correction equations
|
|
.
|

\
|
+
|
|
.
|

\
|
=
|
|
.
|

\
|
(

+
+
c
m
n
n
b p
D
G A b r u
0 0
1
1
matrix - block Original
o
43 42 1
( ) [ ]
2
1
1
matrices Factorized
0 0
0
t
b p
I
tG I
DG t D
A
c
m
n
n
A +
|
|
.
|

\
|
+
|
|
.
|

\
|
=
|
|
.
|

\
|
(

A
(

A
+
+
O
b r u
o
4 4 4 4 8 4 4 4 4 7 6
Exact
approximate
factorization
Approximate
|
|
.
|

\
|
+
|
|
.
|

\
|
=
|
|
.
|

\
|
(

A
(

A
|
|
.
|

\
|
+
+
+
c
m
p
n
n
b p
I
tG I
DG t D
A
n
b r u
u
0 0
0
1

1
1
4 4 4 3 4 4 4 2 1
o
o
|
|
.
|

\
|
=
|
|
.
|

\
|
(

A
|
|
.
|

\
|
+
|
|
.
|

\
|
=
|
|
.
|

\
|
(

A
+
+
+
+
1
1
1
1

0
0

0
n
n
n
c
m
n
p
p
I
tG I
b
p
DG t D
A
o
o
o
u
u
b r
u
1 1
1

+ +
+
A =
= A
+ =
n n
c n
m
p tG
b p DG t
A
o
o
u u
b r u
NITA FSM Splitting of Equations
The FSM is very similar to the segregated algorithm.
Closely resembles the SIMPLEC scheme on a per-iteration
basis
Cheaper (by approx. 20 %) than the PISO scheme on a
per-time-step basis
Splitting errors will be different than the PISO
Best choice between PISO and FSM will be somewhat
problem dependent
NITA FSM Implications
Sub-iterations are introduced to the individual equations and/or
a group of the individual equations.
Accounts for non-linearity in and coupling among the
equations, deferred-correction terms, BCs and solution-
dependent source terms
New convergence criteria for the sub-iterations
Use initial residuals at each time-step as the reference
values for the convergence for the sub-iterations and the
AMG cycle
The default criteria were determined based on an extensive
testing.
Solutions can be explicitly under-relaxed in the sub-iterations.
The mass-flux is updated after each momentum sub-iteration.
Default for second-order time-discretization
NITA Sub-iteration
Supported physical models
Incompressible and weakly compressible (up to high
subsonic)
Laminar (DNS)
All turbulence models including LES, DES and RANS
models
Passive scalars (heat transfer with constant properties,
species transport w/o reaction)
VOF
Compressible liquid (UDF)
Sliding mesh
1-D coupling (WAVE, GT-Power, Optimal Power)
Compressible flows (transonic, supersonic)
Non-Newtonian fluids
MDM
NITA Schemes and Physical models
NITA Schemes and Physical models (2)
Not supported (NITA schemes cannot be selected with these
models)
Multiphase models (except VOF)
Radiation models
Reacting species and all combustions models
DPM, spark, crevice models
Phase change (solidification & melting)
UDS transport
Inviscid ideal gas
Porous media, porous jump, fan model
t u u & sin
0
=
y
Non-iterative fractional-step (NITA) method vs. fully-
iterative method (ITA) and exact solution
NITA Example: Oscillating Plate
Non-iterative scheme vs. fully-iterative scheme
NITA Example: Exhaust Manifold
Non-iterative solution identical to
standard sub-iteration scheme
Comparison of total CPU-time
Non-iterative scheme reduces CPU time by factor of 5!
0
0.2
0.4
0.6
0.8
1
Iterative Non-iterative
Iterative
Non-iterative
NITA Example: Exhaust Manifold (2)
FLUENT 6.1
ITERATIVE PISO
CPU=29,591
FLUENT 6.2
ITERATIVE PISO
CPU=15,794
FLUENT 6.2
NITA
Fractional Step
CPU=4,043
FLUENT 6.2
NITA PISO
CPU=3,450
NITA Example: VOF Tank Sloshing
Agenda
Motivation and Goals
Algorithms
Temporal Discretization
Sub-iteration and Dual Time Stepping
Non-iterative Schemes
Setting Up Unsteady Problems
Solving and Post-processing
Physical Models and Unsteady Flows
Summary
Appendix
Additional Material on Solver Features and Physical Models
Unsteady Schemes: Segregated Solver
Implicit Schemes only
First or Second order
accuracy in time
NITA schemes
PISO or FSM set in
SolveControls
Frozen Flux Formulation
Not applicable to NITA
schemes
Frozen Flux Formulation
An option for the segregated solver which reduces the non-
linearity of the convection terms
Advantage: Improves convergence of the sub-iteration loop
Limitations
Only available for single phase flows
Cannot be used with moving/deforming meshes
f
faces
n
f
n
f
n
f
n
f
faces
f f f
A V A V

+
+

(

1
1
| |
Segregated Solver Notes - Sub-iteration
Use PISO scheme for Pressure-Velocity coupling
Provides faster convergence for unsteady flows than the
standard SIMPLE approach
Select number of sub-iterations per time step to obtain good
convergence
Ideally, you should observe residuals decline by several orders of
magnitude to levels similar to that of a steady-state calculation
(actual residual level will be problem dependent)
If convergence is not adequate
Adjust solver controls (under-relaxations, discretizations)
Reduce the time step
In general, try to employ second order accurate scheme unless
Numerical stability is a concern
Transient is not of interest (time march to steady-state or time
periodic solution)
Activate second order when time-periodicity is achieved
Beginning a calculation from an approximate initial condition (e.g.
impulsive start-up)
Segregated Solver Notes - NITA
Choose PISO or FSM under
Pressure-Velocity Coupling
NITA Controls The BASIC
Solution Process
Inner sub-iterations are
performed for both PISO
and FSM until a termination
criterion is satisfied
(described on next slide)
A final sub-iteration is then
performed before exiting
the loop a residual
tolerance is applied to
ensure this final sub-
iteration is well converged
Note convergence within
each sub-iteration is controlled
by the AMG solver settings in
SolveControlsMultigrid
Segregated Solver Notes NITA (2)
NITA Controls
Max. Corrections
maximum number of (inner) sub-iterations performed for each equation
Correction Tolerance
Sub-iterations terminate when ratio of current sub-iteration initial (0
th
) AMG
residual and the first sub-iteration initial (0
th
) AMG residual fall below this value
Residual Tolerance
During the final iteration, the AMG solver is converged until the ratio of the
current AMG residual and the first sub-iteration initial (0
th
) AMG residual fall
below this value
Relaxation Factor
Explicit underrelaxation factor applied to variables between sub-iterations
Segregated Solver Notes NITA (3)
NITA Controls Recommendations
Default settings should be good for most problems
Convergence of the AMG solver can be monitored by Verbosity
in the Multigrid Controls panel to 1
For problems involving very small time steps, diagonal
dominance is high and convergence should be driven down
further by reducing the Residual Tolerance
For problems involving larger time steps, Residual Tolerance
may be increased to avoid wasting AMG iterations due to
residual tolerance threshold not being met
If divergence is detected in the sub-iteration process, reduce the
Relaxation Factor values to 0.7 0.8.
Unsteady Schemes: Coupled Solvers
Coupled Explicit
Explicit time marching scheme
NOTE For this scheme,
the time step is chosen by
the solver based on
stability considerations
First and second order implicit
schemes (dual-time stepping)
Coupled Implicit
First and second order implicit
schemes (dual-time stepping)
Coupled Solver Notes
Use coupled explicit solver with the explicit time stepping
formulation for transient shock waves and related flows
More accurate and less expensive than the implicit
formulations
The FAS multigrid and residual smoothing should not be used
for time-accurate calculations when using the explicit-time
stepping formulation.
The 2nd-order time-implicit formulation should not be used in
capturing time accurate shock propagation. The scheme is
dispersive.
The 1st-order time-implicit formulation can be used to capture time
accurate shock propagation if sufficiently small time step is
specified and if the solution is allowed to converge at each time
level.
Unsteady Boundary Conditions
Most boundary conditions can be prescribed as functions of
time through
User-Define Functions (UDF)
Profile files
Unsteady UDF Macros
Several macros are available for accessing various time
related quantities in your UDF
Unsteady UDF Example
/**********************************************************************
unsteady.c
UDF for specifying a transient velocity profile boundary condition
***********************************************************************/
#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) = 20. + 5.0*sin(10.*t);
}
end_f_loop(f, thread)
}
Macro for accessing physical time
Unsteady Profile Files (1)
((profile-name transient n periodic?)
(field_name-1 a1 a2 a3 .... an)
(field_name-2 b1 b2 b3 .... bn)
.
.
.
.
(field_name-r r1 r2 r3 .... rn))
Flag for time periodic
profile (0=no, 1=yes)
Number of data points
per field
((sampleprofile transient 3 0)
(time 1 2 3)
(u 10 20 30)
)
Sample file
Standard Format
Read into FLUENT using FileReadProfile
Unsteady Profile Files (2)
profile-name n_field n_data periodic?
field-name-1 field-name-2 field-name-3 .... field-name-n_field
v-1-1 v-2-1 ... ... ... ... v-n_field-1
v-1-2 v-2-2 ... ... ... ... v-n_field-2
.
.
.
v-1-n_data v-2-n_data ... ... ... ... v-n_field-n_data
Flag for time periodic
profile (0=no, 1=yes)
Number of data points
per field
sampletabprofile 2 3 1
time u
1 10 2
20 3 30
Sample file
Number of fields
Tabular Format
Read into FLUENT using TUI Command:
file/read-transient-table
Agenda
Motivation and Goals
Algorithms
Temporal Discretization
Sub-iteration and Dual Time Stepping
Non-iterative Schemes
Setting Up Unsteady Problems
Solving and Post-processing
Physical Models and Unsteady Flows
Summary
Appendix
Additional Material on Solver Features and Physical Models
Running an Unsteady Solution
Basic Steps
Select unsteady option in
Define Models Solver
Set up physical models, BCs as usual
Prescribe initial conditions
Set solver settings and monitors
If using segregated solver with sub-iteration
or dual time stepping
Select time step and max iterations per
time step
Prescribe the number of time steps
Run the calculation (Iterate)
Initial Conditions
Accurate initial conditions are just as important as boundary
conditions for unsteady problems
Initial solution should be physically realistic
Arbitrary initial guess may lead to unphysical transients
If the solution is time-periodic or a steady-state solution is
sought (transients are not important), the initial condition can be
more approximate
Some suggest ways of setting initial conditions
Use a steady-state solution
Example run a nozzle with steady flow BC before
activating unsteady BC
Write an Initial Condition UDF - DEFINE_INIT( name, d)
Initial Condition UDF Example
/********************************************************************
UDF for initializing flow field variables
*********************************************************************/
#include "udf.h"
DEFINE_INIT(my_init_func,d)
{
cell_t c;
Thread *t;
real xc[ND_ND];
/* loop over all cell threads in the domain */
thread_loop_c(t,d) {
/* loop over all cells */
begin_c_loop_all(c,t) {
C_CENTROID(xc,c,t);
if (sqrt(ND_SUM(pow(xc[0] - 0.5,2.),
pow(xc[1] - 0.5,2.),
pow(xc[2] - 0.5,2.))) < 0.25)
C_T(c,t) = 400.;
else
C_T(c,t) = 300.;
}
end_c_loop_all(c,t)
}
}
Initial Transients
Unsteady rotor lift becomes
periodic after initial transient
Solution started from steady-state
Rotor lift coefficient for 2D unsteady turbine stage
Autosaving Files
Fluent permits files to be saved
automatically during a transient run
File Write Autosave
The frequency is the number of
time steps between saves
Fluent automatically appends the
time step count to the filename
(e.g. 0001, 0002, etc.)
Compression suffix in filename will
cause stored files to be
compressed in desired format (.gz
or .Z)
Overwriting existing files
New in Fluent 6.2
Defines the maximum number
of files of each type (case
and.or data) which are stored
When maximum is reached
the earliest file will be
overwritten when Fluent writes
another file
Monitors
Surface and Force monitors can be
set up to compute and save
unsteady data as a function of time
step
Select Time Step under Every
column in GUI
By default, Force monitors are
written every time step for unsteady
calculations
Choosing Your Time Step
Simple estimate
Fluid particle should move no more than one cells
distance in one time step.
V
x
t

~
x = representative cell size
V = characteristic velocity
t
t+ t
Choosing Your Time Step (2)
Physically-based estimate
Choose time step which resolves the unsteady physics of
interest (t < T)
t

t < T
T
T = characteristic
time scale of unsteady
flow
Choosing Your Time Step (3)
Time Scale Examples
Vortex Shedding
Buoyant Flows
Rotor-Stator Interaction
V St
L
T

~
&
)
p
T

~
TL g
L
T
*
~
velocity Freestream V
length stic Characteri
Number Strouhal
=
=
=
L
St
difference re temperatu Freestream - Surface T
t coefficien expansion Thermal
on accelerati nal Gravitatio g
length stic Characteri
=
=
=
=
*
L
speed rotational Rotor
angle pitch Blade
=
=
&
)
p
Choosing Your Time Step (4)
Adaptive time stepping
Adaptive time stepping (ATS) permits automatic adjustment of
time step size as the calculation proceeds
Based on local truncation error analysis
Available for both segregated and coupled solvers
Compatible with first and second order temporal discretization
schemes
Customization possible via UDF
Limitations
Not compatible with VOF model
Not available for coupled explicit solver
Additional information provided in the Appendix
Data Sampling
FLUENT can save and store unsteady solution data in order to derive
useful field variables, namely
Time averages
Root mean square (RMS)
( ) ( )
1,2,...N i
1

1
0 0
0
=

i
i
i
f
t
t
f
t
t t
t d
t t
f

1,2,...N i
2
=

=
i
i RMS

Activating Data Sampling
Select data sampling option in the
Iterate panel
Sampled variables are computed
and stored on the fly for
subsequent time steps
Sampled variables are also stored
in case and data files
Available time-averaged and RMS
variables
Static pressure
Velocity magnitude and
components
Temperature
Combustion variables (e.g.
mixture fracture)
Sampled Data Contour Plots
Instantaneous Time-Average
Sliding mesh solution:
2D Turbine Stage
Sliding interface
Post-processing Unsteady Solutions
Unsteady data from solution monitors can be viewed using Fluents
x-y plotting tools
FFT can be applied to unsteady x-y plot data
Animation of solutions
Setup animations in SolveAnimate panel
Write image files on the fly using macros in SolveExecute
Commands panel
Instantaneous solution case/data files (written using Autosave
feature) can be reread into FLUENT for further processing
Can be automated using journal files
Solution data can also be exported in formats compatible with
dedicated third-party post-processing software (e.g. Fieldview,
Ensight, etc.).
Additional information is provided in the Appendix
Agenda
Motivation and Goals
Algorithms
Temporal Discretization
Sub-iteration and Dual Time Stepping
Non-iterative Schemes
Setting Up Unsteady Problems
Solving and Post-processing
Physical Models and Unsteady Flows
Summary
Appendix
Additional Material on Solver Features and Physical Models
Turbulence Unsteady RANS
Unsteady solutions are possible using the Reynolds-Averaged Navier-
Stokes (RANS) equations provided the time scale of the unsteadiness is
much larger than the turbulent time scales
( )
( )
( )

=
+ (
=
N
n
n
i
N
i
t x u
N
t x U
1
,
1
lim ,
r r
( ) ( ) ( ) t x u t x U t x u
i i i
, , ,
r r r
,
+ =
U
Long time scale unsteadiness
preserved in ensemble average
Unsteady RANS Modeling
Unsteady RANS Momentum Equations
Turbulence closure models available in Fluent
Spalart-Allmaras (1 eqn)
k-c (standard, RNG, Realizable) (2 eqn)
k-e (2 eqn)
V2F (4 eqn)
Reynolds Stress Model (RSM) (7 eqn)
j
ij
j
i
j i k
i
k
i
x
R
x
U
x x
p
x
U
U
t
U
c
c
+
|
|
.
|

\
|
c
c
c
c
+
c
c
=
|
|
.
|

\
|
c
c
+
c
c

j i ij
u u R
' '
=
Reynolds Stress
Unsteady RANS Notes
Unsteady RANS is the most practical approach for unsteady
turbulent flows
Modest mesh requirements
Reasonable run times
Applicable to a wide range of problems
Large scale unsteady flow features can usually be resolved on a
RANS mesh
Example vortex shedding at High Reynolds numbers
For flows where unsteady RANS is unsuitable, you can attempt to
use LES or DES
Large Eddy Simulation (LES)
LES is recommended for high-end applications where the RANS
models are not adequate ( e.g. mixing, combustion, external
aerodynamics)
LES dispenses with Reynolds-averaging, and instead solves the N-S
equations directly to capture turbulent fluctuations resolvable by the
mesh
Eddies smaller than the grid size are removed and modeled by a
sub-grid scale model (SGS)
Larger eddies are directly solved numerically by the filtered
transient N-S equations.
Sufficiently long solution time is required to reach statistically stationary
state and obtain stable statistics of the solution.
LES Setup
Activate LES Model in
Define Models Viscous Model GUI
Three sub-grid scale (SGS) models
are available
Smagorinsky-Lilly
WALE
Kinetic-Energy Transport
Simple near-wall model (two-layer
wall functions similar to the model
by Werner and Wengle)
Second-order spatial and temporal
discretizations (including new
bounded central differencing
scheme)
Need to provide appropriate initial and
boundary conditions
Note: You can use NITA for LES/DES models
Vortex shedding over a cylinder
with Re = 90,000
The simulation uses
large eddy simulation
(LES) turbulence model
a fine grid with 170,000
quadrilateral elements
A transient calculation is
performed for many cycles until
periodic flow is achieved
Example: LES Vortex Shedding
Fine scale vortices captured by LES
LES Solution: Pressure Field
NITA Example - LES of Channel Flow
(Re

= 180)
NITA/FSM, node-based
gradient, BCD
72 x 72 x 72 hex. mesh
Detached Eddy Simulation (DES)
DES is a hybrid model which
uses LES in the bulk (core
turbulent) and a RANS model
(Spalart-Allmaras) in the near-
wall region
DES is a practical alternative to
LES for high-Reynolds number
flows over airfoils in the external
aerodynamic applications
New in Fluent 6.2 - access to
DES through viscous model GUI
Unsteady DPM Modeling
Discrete Phase Model (DPM) in FLUENT can be run within an
unsteady flow calculation
Particle paths are updated in time along with the flow
Can be used with sliding mesh and moving/deforming mesh
Applications
Particle flows through rotating machinery
Unsteady settling, erosion, and accretion problems
Unsteady DPM Setup
Specify DPM model parameters
in Define Models Discrete
Phase
Create injections
For unsteady DPM, you
need to set the Start Time
and End Time to define
when particles will be
introduced
Run unsteady solution
Use DisplayParticle Tracks To
display particle positions at
current time
Unsteady DPM Example
Moving Reference Frames
Unsteady solutions can be carried out in a moving reference frame
Only Single Reference Frame (SRF) models are applicable!
Multiple Reference Frame (MRF) and Mixing Plane models are by
definition steady-state models
SRF solutions will capture unsteadiness in the relative frame
Example: vortex shedding from the trailing edge of a turbine rotor
blade
Sliding Mesh Model
The sliding mesh model permits motion multiple domains sliding relative to one
another along interface boundaries
Numerous applications
Mixing tanks
Rotor-stator interaction
Vehicles in tunnels
The governing equations are solved in the inertial reference frame for absolute
quantities (e.g. absolute velocities).
For each time step, the meshes are moved and the fluxes at the sliding
interfaces are recomputed.
cells at time t
cells at time t+t
moving mesh zone
Sliding interface requirements:
Interfaces are non-conformal
For rotating domains, the interface between a rotating subdomain
and the adjacent stationary/rotating subdomain must be a surface
of revolution with respect to the axis of rotation of the rotating
subdomain.
Many failures of sliding mesh models can be traced to interface
geometries which are not surfaces of revolution!
Any translation of the interface cannot be normal to itself.
A sliding mesh preview is now available in Fluent 6.1 to help detect
sliding mesh problems before you run your calculation
time t = 0
t + t
Elliptic interface
is not a surface of
revolution.
Solve Mesh Motion
Sliding Interfaces
Sliding Mesh Setup
Enable unsteady solver.
Define overlapping zones as Interface
types
For moving zones, select Moving Mesh
as Motion Type in Fluid BC panel.
By default, velocity of walls are zero
relative to the adjacent mesh's
motion.
For each interface zone pair, create a
non-conformal interface
Enable Periodic option if
sliding/rotating motion is periodic.
Enable Coupled for conjugate heat
transfer.
Sliding Mesh Example
Accelerating Reference Frames
Fluents moving reference frame model does not account for
accelerating reference frames
Two additional acceleration terms are required
You can incorporate acceleration effects in two ways
Use Moving Reference Frame option for the fluid zone and add the
additional acceleration terms as source terms using UDFs
Use Moving Mesh option for the fluid zone and adjust the
translation and/or rotational frame velocities through UDFs
Illustration of Reference Frames
x
y
z
z
y
x
stationary
frame
moving
frame
axis of
rotation
r
r
&
r
CFD domain
o
r
r
R
Note: R is perpendicular
to axis of rotation
) (
) (
0 0
t r r
t
r r
r r
=
=& &
Additional Acceleration Terms
Additional acceleration terms need to be added to the RHS of
the MRF momentum equations when rotation or translation of
the frame is time dependent
|
|
.
|

\
|
+ =
2
0
2
dt
r d
r
dt
d
S
accel
r
r
r
r
e

tangential
acceleration
linear
acceleration
Add these terms
using a Source
term UDF
applied to the
momentum
equations
Example: Tank Sloshing
A rectangular tank is 20% filled
with liquid
The periodic accelerations of tank
introduced using source term
UDFs
Results are compared to
experiment
1
for
general flow patterns
pressures recorded at three
sites (shown)
1
Hadzic, et al., Numerical Simulation of
Sloshing, Proc. SRI-TUHH Mini Workshop on
Numerical Simulation of Two-phase Flows, Ship
Research Institute, Tokyo, Japan, 2001.
Example: Tank Sloshing (2)
The volume of fluid (VOF) model is
used in FLUENT
A user-defined function (UDF) is used
to simulate the periodic swaying
motion
At one instant, the liquid sloshes up
the right side of the tank (top)
The FLUENT simulation captures this
motion accurately (bottom)
Velocity vectors colored by static pressure
Moving Mesh Option
Another way of handling accelerating reference frames is to employ the
Moving Mesh option
Advantage no additional acceleration terms are required in the
momentum equations
This is because the momentum equations are referred to the
absolute frame (no MRF transformation is used)
Accelerations are prescribed by defining the time dependent grid
locations
For rotation, you need only prescribe &(t).
Example: Flapping Airfoil
Flapping NACA 0012 airfoil (+/- 8 deg)
Moving zone
Sliding interface
Moving Mesh UDF
/**********************************************/
/* flap.c */
/* UDF for specifying a time-varying omega */
/* */
/* Simulates +/- 8 deg flapping with cycle of */
/* of 1 sec. */
/* */
/**********************************************/
#include "udf.h
#define PI 3.141592654
DEFINE_ADJUST(speed, domain)
{
real omega;
Thread *t;
real time = RP_Get_Real("flow-time");
omega = 0.8773*cos(2.*PI*time); /* rotational speed about axis */
thread_loop_c(t,domain)
{
if (THREAD_VAR(t).cell.motion_spec == MOTION_TYPE_MOVING_GRID)
{
THREAD_VAR(t).cell.omega = omega;
}
}
}
Flapping Airfoil: Unsteady Velocity
Additional Physical Models
Other models/features in FLUENT 6 which employ unsteady
solutions
Dynamic mesh refinement
Moving Deforming Mesh
Acoustics
Additional information on these topics provided in the
Appendix
Agenda
Motivation and Goals
Algorithms
Temporal Discretization
Sub-iteration and Dual Time Stepping
Non-iterative Schemes
Setting Up Unsteady Problems
Solving and Post-processing
Physical Models and Unsteady Flows
Summary
Appendix
Additional Material on Solver Features and Physical Models
Summary
CFD analysis of unsteady flows are becoming more
commonplace
FLUENT 6 has the ability to address a wide range of unsteady
problems
In this lecture we have discussed
Unsteady algorithms in FLUENT 6
Setting up, running, and post-processing unsteady solutions
Physical models and unsteady flows
New algorithms in Fluent 6.2 will make the solution of unsteady
flows more efficient than ever!
Thank you for your attention!
Appendix
Dynamic Mesh Refinement
Fast Fourier Transforms (FFT)
Animations
Automatic Time Step Adjustment
Moving/Deforming Mesh
Acoustics
Dynamic Mesh Refinement
Gradient adaption can be used to dynamically adapt the mesh
to a time-evolving solution
This approach can be useful for a wide range of applications
Moving shock waves
Free surface flows
Unsteady wakes
Dynamic Adaption Setup
Method
Curvature (smooth flows)
Gradient (strong gradients, shocks)
Normalization
Standard
No scaling (not recommended
for dynamic adaption)
Scale
Normalizes with average value
Normalize
Normalizes with max value
Dynamic Interval
Set value from to 1 10, depending
on the unsteady flow Coarsen Threshold
Scale (0.3 0.5)
Normalize (0.2 0.4)
Refine Threshold
Scale (0.7 0.9)
Normalize (0.5 0.9)
Shock Waves in a Channel
Mesh Colored by Contours of Static Pressure
Fast Fourier Transform (FFT)
FFT utility is available for general analysis of unsteady data
Features
Plot and pruning utility
Enables users to inspect and select signal
Multiple choices of window functions
X-axis function
Frequency
Strouhal number
Y-axis function
Power spectral density
Magnitude
Sound Pressure Level (db)
Sound Amplitude (db)
FFT How It Works
An FFT performs a discrete Fourier transform of an unsteady signal (t)
to derive spectral information about the signal, e.g.
vortex shedding frequency
higher harmonics associated with rotor-stator interaction
For an unsteady function
k
sampled uniformly at a finite number of
points, N, the coefficients of the Fourier transform are given by

=
1
0
/ 2
1

N
k
N ikn
k n
e
N
/

FFT How It Works (2)
The variables define the relative influence of discrete frequencies
contained in the signal
Derived variables
Power Spectral Density (E)
Amplitude (A)
k

2
2
0 0

2 ) (

) (
n n
f E
f E

=
=
) ( ) (
n n
f E f A =
FFT - Windowing
FFT assumes sampled data are periodic in time
Windowing addresses cases where the data are not periodic, thereby
leading to aliasing errors
Windowing applies filters to the signal to remove the influence of the
ends of the data range (approximately of the entire range)
Four windowing filters are available in Fluent 6.1
Hamming
Hanning
Barlett
Blackman
FFT Main Interface
Usage
1. Read in plot file containing
data
2. Apply pruning to remove
unwanted portions of the
data set
3. Select Window option and
x-y axes functions
4. Plot the FFT
Can optionally write FFT data
to file
FFT Pruning Interface
Pruning permits you to set the
x-data range (typically time)
Removes unwanted regions
of the signal such as a start-
up transient
Pruned data will then be
used by the FFT
You can plot the pruned signal
and compute statistics
FFT Example
Original Data
Pruned Data
FFT Example (2)
Animations
FLUENT 6 provides a facility for creating animations
Define a sequence of frames for subsequent playback
Can use for contours, meshes, XY plots, vectors, and monitors
Options for storing data
Memory - Meta files are saved that allow user to select the
animation view (pan, zoom, rotate, etc.) after performing the
simulation
Disk - User chooses a hardcopy option (MPEG, series of .tifs,
etc.) and the animation parameters are fixed a priori
Limitation
MPEG is the only currently supported movie format
No AVI export yet
Animation Setup
Set up as many animation
sequences as desired
Animation Playback
Playback interface permits
selection of sequences
frame-by-frame analysis of
sequences
export of animations or
individual animation frames
Use individual frames if
you want to use third party
animation software
Adaptive time stepping (ATS) permits automatic adjustment of time
step size as the calculation proceeds
Based on local truncation error analysis
Available for both segregated and coupled solvers
Compatible with first and second order temporal discretization
schemes
Customization possible via UDF
Limitations
Not compatible with VOF model
Not available for coupled explicit solver
Adaptive Time Stepping
GUI Panel for ATS
Specify initial time step and
total number of time steps
desired
Set control parameters for
ATS
Set the sub-iteration
parameters as usual
Click on Iterate to begin
computation
ATS Controls (1)
Truncation Error Tolerance (TE
tol
)
Trunction Error = a measure of solution error
TE
tol
is a user-specified threshold value which is compared to the
actual truncation error for the purpose of determining if the time
step should be increased or decreased
Default value (0.01) is acceptable for most cases, but you can
decrease this value if you want to maintain a smaller time step
Ending Time
The maximum time permitted for the calculation
Note that the calculation will terminate sooner if the number of time
steps equals the user-specified number in the GUI panel
ATS Controls (2)
Minimum/Maximum Time Step Size
Maximum/Minimum limits placed on time step size
Choose the minimum based on simple estimate (x/V)
Choose maximum as no more than one or two orders of magnitude
greater than this (too large a value may lead to inaccuracy)
Minimum/Maximum Step Change Factor (f)
Define step change factor as the ratio of the truncation error
tolerance and the actual (computed) truncation error value:
Limiting f results in smoother changes in the time step size,
especially in flows with high frequency fluctuations.
actual
tol
TE
TE
f ~
ATS Controls (3)
The algorithm for computing the time step based on f proceeds as
follows:
If f > 1 and f < f
max
, then t is increased (since TE < TE
tol
)
If f > 1 and f > f
max
, then t is increased, but limited to f
max
t
n-1
Prevents time step from increasing too rapidly
If f < 1 and f < f
min
, then t is decreased (since TE > TE
tol
)
If f < 1 and f > f
min
, then t is unchanged
Prevents time step from getting too small
Number of Fixed Time Steps
The number of fixed time steps which are performed before ATS is
applied to the calculation
It is recommended that a number of fixed-size time steps be
performed, especially for impulsive initial conditions
UDFs for ATS
A UDF can be hooked to ATS
using the drop down list in the
ATS GUI panel
Sample UDF shown on right
Uses DEFINE_DELTAT
macro
Returns time step (in units
of seconds)
DEFINE_DELTAT(mydeltat, domain)
{
real time_step;
real t = CURRENT_TIME;
if (t < 0.5)
time_step = 0.1;
else
time_step = 0.2;
return time_step;
}
Example: Transient Heating in a Cavity
Contours of Velocity Magnitude (m/s) Contours of Static Temperature (K)
Final Solution at Steady-State
Transient Temperature History
Total Volume
Integral of
Temperature
(K/m3)
Flow Time (s)
Comparison of Computational Effort
Total Volume Integral of Temperature (K/m3)
Adaptive Time Stepping Constant Time Stepping
# of Time Steps # of Time Steps

You might also like