Documente Academic
Documente Profesional
Documente Cultură
Introduction
In this tutorial, FLUENTs coupled implicit solver is used to predict the time-dependent
flow through a two-dimensional nozzle. As an initial condition for the transient problem,
a steady-state solution is generated to provide the initial values for the mass flow rate at
the nozzle exit.
In this tutorial you will learn how to:
Use dynamic mesh adaption for both steady-state and transient flows
Create an animation of the unsteady flow using FLUENTs unsteady solution ani-
mation feature
Prerequisites
This tutorial assumes that you are familiar with the menu structure in FLUENT and that
you have completed Tutorial 1 . Some steps in the setup and solution procedure will not
be shown explicitly.
Problem Description
The geometry to be considered in this tutorial is shown in Figure 4.1. Flow through a
simple nozzle is simulated as a 2D planar model. The nozzle has an inlet height of 0.2 m,
and the nozzle contours have a sinusoidal shape that produces a 10% reduction in flow
area. Due to symmetry, only half of the nozzle is modeled.
c Fluent Inc. January 11, 2005 4-1
Modeling Unsteady Compressible Flow
plane of symmetry
0.2 m p (t )
exit
2. Unzip unsteady_compressible.zip.
nozzle.msh and pexit.c can be found in the /unsteady compressible folder cre-
ated after unzipping the file.
4-2
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
Step 1: Grid
1. Read in the mesh file nozzle.msh.
File Read Case...
To make the view more realistic, you will need to mirror it across the centerline.
c Fluent Inc. January 11, 2005 4-3
Modeling Unsteady Compressible Flow
Grid
FLUENT 6.2 (2d, segregated, lam)
4-4
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
Step 2: Units
1. For convenience, define new units for pressure.
The pressure for this problem is specified in atm, which is not the default unit. You
will need to redefine the pressure unit as atm.
Define Units...
c Fluent Inc. January 11, 2005 4-5
Modeling Unsteady Compressible Flow
Step 3: Models
1. Select the coupled implicit solver.
The coupled implicit solver is the solver of choice for compressible, transonic flows
without significant regions of low-speed flow. In cases with significant low-speed
flow regions, the segregated solver is preferred. Also, for transient cases with trav-
eling shocks, the coupled explicit solver with explicit time stepping may be the most
efficient.
Define Models Solver...
Note: Initially, solve for the steady flow through the nozzle. Later, after obtaining
the steady flow as a starting point, this panel to enable an unsteady calculation.
4-6
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
c Fluent Inc. January 11, 2005 4-7
Modeling Unsteady Compressible Flow
Step 4: Materials
1. Set the properties for air, the default fluid material.
Define Materials...
4-8
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
Here, the operating pressure is set to zero and boundary condition inputs for pressure
will be defined in terms of absolute pressures. Boundary condition inputs should
always be relative to the value used for operating pressure.
c Fluent Inc. January 11, 2005 4-9
Modeling Unsteady Compressible Flow
4-10
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
c Fluent Inc. January 11, 2005 4-11
Modeling Unsteady Compressible Flow
4-12
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
(a) Under Discretization, select Second Order Upwind for Modified Turbulent Vis-
cosity.
Second-order discretization provides optimum accuracy.
We will now activate dynamic adaption. Our purpose here is to have the solver
periodically refine the mesh in the vicinity of the shocks as the iterations progress.
We identify the shocks by looking for large gradients of the pressure.
c Fluent Inc. January 11, 2005 4-13
Modeling Unsteady Compressible Flow
4-14
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
(f) Turn on the Dynamic option under Dynamic and set the Interval to 100.
For steady-state flows, it is sufficient to only seldomly adapt the meshin
this case an interval of 100 iterations is chosen. For time-dependent flows, a
considerably smaller interval must be used.
(g) Click Apply to store the information.
(h) Click on Controls... to modify the adaption controls.
c Fluent Inc. January 11, 2005 4-15
Modeling Unsteady Compressible Flow
4-16
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
c Fluent Inc. January 11, 2005 4-17
Modeling Unsteady Compressible Flow
The mass flow rate history is shown in Figure 4.3. It shows that the solution is
converged after around 1800 iterations.
-13.5000
-14.0000
-14.5000
-15.0000
Mass
Flow -15.5000
Rate
(kg/s)
-16.0000
-16.5000
-17.0000
0 200 400 600 800 1000 1200 1400 1600 1800 2000
Iteration
4-18
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
Although the mass flow rate history indicates that the solution is con-
! verged, you should also check the mass fluxes through the domain to ensure
that mass is being conserved.
The net mass imbalance should be a small fraction (say, 0.5%) of the total
!
flux through the system. If a significant imbalance occurs, you should
decrease your residual tolerances by at least an order of magnitude and
continue iterating.
c Fluent Inc. January 11, 2005 4-19
Modeling Unsteady Compressible Flow
4-20
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
3.45e+02
3.27e+02
3.10e+02
2.93e+02
2.76e+02
2.59e+02
2.41e+02
2.24e+02
2.07e+02
1.90e+02
1.73e+02
1.55e+02
1.38e+02
1.21e+02
1.04e+02
8.64e+01
6.92e+01
5.20e+01
3.48e+01
1.76e+01
3.72e-01
c Fluent Inc. January 11, 2005 4-21
Modeling Unsteady Compressible Flow
11. Display the steady flow contours of static pressure (Figure 4.5).
Display Contours...
4-22
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
7.84e-01
7.66e-01
7.47e-01
7.28e-01
7.09e-01
6.90e-01
6.71e-01
6.53e-01
6.34e-01
6.15e-01
5.96e-01
5.77e-01
5.59e-01
5.40e-01
5.21e-01
5.02e-01
4.83e-01
4.65e-01
4.46e-01
4.27e-01
4.08e-01
c Fluent Inc. January 11, 2005 4-23
Modeling Unsteady Compressible Flow
4-24
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
where
= circular frequency of unsteady pressure (rad/s)
pexit = mean exit pressure (atm)
In this case, = 2200 rad/s, and pexit = 0.7369 atm.
A user-defined function (pexit.c) has been written to define the equation (Equa-
tion 4.1) required for the pressure profile.
Note: To input the value of Equation 4.1 in the correct units, the function pexit.c
has been multiplied by a factor of 101325 to convert from the chosen pressure
unit (atm) to the SI unit required by FLUENT (Pa). This will not affect the
displayed results.
See the separate UDF Manual for details about user-defined functions..
(a) Read in the user-defined function.
Define User-Defined Functions Interpreted...
c Fluent Inc. January 11, 2005 4-25
Modeling Unsteady Compressible Flow
i. Select udf unsteady pressure (the user-defined function) in the Gauge Pres-
sure drop-down list.
4-26
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
c Fluent Inc. January 11, 2005 4-27
Modeling Unsteady Compressible Flow
2. Modify the plotting of the mass flow rate at the nozzle exit.
Because each time step requires 30 iterations, a smoother plot will be generated by
plotting at every time step.
Solve Monitors Surface...
(a) For monitor-1, select Time Step in the drop-down list under Every.
(b) Click Define... to modify the surface monitor parameters.
i. In the Define Surface Monitor panel, change the File Name to noz uns.out.
ii. In the X Axis drop-down list, select Time Step.
iii. Click OK.
(c) Click OK in the Surface Monitors panel.
4-28
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
Calculation of 600 time steps will require significant CPU resources (about
!
three hours on a single CPU with a 2.6 GHz clock speed). Instead of
calculating, you can read the data file saved after the iterations have been
completed:
noz uns.dat
(The data file is available in the same directory where you found the mesh
and UDF files.)
By requesting 600 time steps, you are asking FLUENT to compute six pressure
cycles. The mass flow rate history is shown in Figure 4.6.
Monitors
monitor-1
-4.0000
-6.0000
-8.0000
-10.0000
Mass -12.0000
Flow
Rate -14.0000
(kg/s)
-16.0000
-18.0000
-20.0000
0 100 200 300 400 500 600
Time Step
c Fluent Inc. January 11, 2005 4-29
Modeling Unsteady Compressible Flow
(a) Set the Autosave Case File Frequency and Autosave Data File Frequency to 10.
(b) In the Filename field, enter noz anim.
(c) Click OK.
If you have constraints on the disc space, you can restrict the number of files
saved by FLUENT using the Maximum Number of Files at Any Instance field.
After saving the specified number of files, FLUENT will overwrite the earliest
existing file. The default value of zero will save all the files.
When FLUENT saves a file, it will append the time step value to the file
name prefix (noz anim). The standard extensions (.cas and .dat) will also
be appended. This will yield file names of the form noz anim0640.cas and
noz anim0640.dat, where 0640 is the time step number.
Optionally, you can add the extension .gz to the end of the file name (e.g.,
noz anim.gz), which will instruct FLUENT to save the case and data files in
compressed format, yielding file names of the form noz anim0640.cas.gz.
4-30
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
2. Create animation sequences for the nozzle pressure and Mach number contour plots.
Solve Animate Define...
c Fluent Inc. January 11, 2005 4-31
Modeling Unsteady Compressible Flow
4-32
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
i. In the Contours panel, keep the default selections of Pressure... and Static
Pressure.
ii. Make sure that Filled is selected under Options, and deselect Auto Range.
iii. Enter 0.25 under Min and 1.25 under Max.
This will set a fixed range for the contour plot and subsequent animation.
iv. In the Surfaces list, select all of the surfaces.
v. Click Display.
Figure 4.7 shows the contours of static pressure in the nozzle after 600 time
steps.
(e) Click OK in the Animation Sequence panel.
c Fluent Inc. January 11, 2005 4-33
Modeling Unsteady Compressible Flow
1.25e+00
1.20e+00
1.15e+00
1.10e+00
1.05e+00
1.00e+00
9.50e-01
9.00e-01
8.50e-01
8.00e-01
7.50e-01
7.00e-01
6.50e-01
6.00e-01
5.50e-01
5.00e-01
4.50e-01
4.00e-01
3.50e-01
3.00e-01
2.50e-01
4-34
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
1.30e+00
1.23e+00
1.17e+00
1.11e+00
1.04e+00
9.75e-01
9.10e-01
8.45e-01
7.80e-01
7.15e-01
6.50e-01
5.85e-01
5.20e-01
4.55e-01
3.90e-01
3.25e-01
2.60e-01
1.95e-01
1.30e-01
6.50e-02
0.00e+00
c Fluent Inc. January 11, 2005 4-35
Modeling Unsteady Compressible Flow
When the calculation finishes, you will have ten pairs of case and data files and
there will be 100 pairs of contour plots stored in memory. In the next few steps,
you will play back the animation sequences and examine the results at several time
steps after reading in pairs of newly-saved case and data files.
4-36
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
c Fluent Inc. January 11, 2005 4-37
Modeling Unsteady Compressible Flow
8. Repeat steps 6 and 7, selecting the appropriate active window and sequence name
for the Mach number contours.
Examples of Mach number contours at t = 0.01799 s and t = 0.0191 s are shown
in Figures 4.11 and 4.12.
4-38
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
1.25e+00
1.20e+00
1.15e+00
1.10e+00
1.05e+00
1.00e+00
9.50e-01
9.00e-01
8.50e-01
8.00e-01
7.50e-01
7.00e-01
6.50e-01
6.00e-01
5.50e-01
5.00e-01
4.50e-01
4.00e-01
3.50e-01
3.00e-01
2.50e-01
1.25e+00
1.20e+00
1.15e+00
1.10e+00
1.05e+00
1.00e+00
9.50e-01
9.00e-01
8.50e-01
8.00e-01
7.50e-01
7.00e-01
6.50e-01
6.00e-01
5.50e-01
5.00e-01
4.50e-01
4.00e-01
3.50e-01
3.00e-01
2.50e-01
c Fluent Inc. January 11, 2005 4-39
Modeling Unsteady Compressible Flow
1.30e+00
1.23e+00
1.17e+00
1.11e+00
1.04e+00
9.75e-01
9.10e-01
8.45e-01
7.80e-01
7.15e-01
6.50e-01
5.85e-01
5.20e-01
4.55e-01
3.90e-01
3.25e-01
2.60e-01
1.95e-01
1.30e-01
6.50e-02
0.00e+00
1.30e+00
1.23e+00
1.17e+00
1.11e+00
1.04e+00
9.75e-01
9.10e-01
8.45e-01
7.80e-01
7.15e-01
6.50e-01
5.85e-01
5.20e-01
4.55e-01
3.90e-01
3.25e-01
2.60e-01
1.95e-01
1.30e-01
6.50e-02
0.00e+00
4-40
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
Extra: FLUENT gives you the option of exporting an animation as an MPEG file
or as a series of files in any of the hardcopy formats available in the Graphics
Hardcopy panel (including TIFF and PostScript).
To save an MPEG file, select MPEG from the Write/Record Format drop-down
list in the Playback panel and then click the Write button. The MPEG file will
be saved in your working directory. You can view the MPEG movie using an
MPEG player (e.g., Windows Media Player or another MPEG movie player).
To save a series of TIFF, PostScript, or other hardcopy files, select Hardcopy
Frames in the Write/Record Format drop-down list in the Playback panel. Click
on the Hardcopy Options... button to open the Graphics Hardcopy panel and set
the appropriate parameters for saving the hardcopy files. Click Apply in the
Graphics Hardcopy panel to save your modified settings. In the Playback panel,
click the Write button. FLUENT will replay the animation, saving each frame
to a separate file in your working directory.
If you want to view the solution animation in a later FLUENT session, you
can select Animation Frames as the Write/Record Format and click Write.
Since the solution animation was stored in memory, it will be lost if you
! exit FLUENT without saving it to one of the formats described above. Note
that only the animation-frame format can be read back into the Playback
panel for display in a later FLUENT session.
c Fluent Inc. January 11, 2005 4-41
Modeling Unsteady Compressible Flow
10. Repeat step 9 using case and data files saved for other time steps of interest.
4-42
c Fluent Inc. January 11, 2005
Modeling Unsteady Compressible Flow
2.42e+02
2.30e+02
2.18e+02
2.06e+02
1.94e+02
1.82e+02
1.70e+02
1.58e+02
1.46e+02
1.34e+02
1.22e+02
1.10e+02
9.75e+01
8.54e+01
7.34e+01
6.13e+01
4.92e+01
3.71e+01
2.50e+01
1.30e+01
8.97e-01
Summary
In this tutorial, you modeled the transient flow of air through a nozzle. You learned how
to generate a steady-state solution as an initial condition for the unsteady case, and how
to set solution parameters for implicit time-stepping.
You also learned how to manage the file saving and graphical postprocessing for time-
dependent flows, using file autosaving to automatically save solution information as the
transient calculation proceeds.
Finally, you learned how to use FLUENTs solution animation tool to create animations
of transient data, and how to view the animations using the playback feature.
c Fluent Inc. January 11, 2005 4-43
Modeling Unsteady Compressible Flow
4-44
c Fluent Inc. January 11, 2005