Fluent - Tutorial - Dynamic Mesh - 2D Adiabatic Compression
Fluent - Tutorial - Dynamic Mesh - 2D Adiabatic Compression
Smoothing)
Introduction
This tutorial illustrates the setup and solution of a basic deforming mesh in FLUENT 6.2
using the remeshing and spring-based smoothing approaches.
In this tutorial you will learn how to:
• Set up a problem for a dynamic mesh
The dynamic mesh model in FLUENT can be used to model flows where the shape of the
domain changes with time due to motion on the domain boundaries. The motion can be
either a prescribed motion (e.g., you can specify the linear and angular velocities about the
center of gravity of a solid body with time), or an unprescribed motion where the subsequent
motion is determined by a user-defined function (UDF). The update of the volume mesh
is handled automatically by FLUENT at each time step based on the new positions of the
boundaries. To use the dynamic mesh model, you need to provide a starting volume mesh
and the description of the motion of any moving zone in the model.
In this tutorial, you will use the spring-based smoothing and remeshing mesh motion meth-
ods to update the volume mesh in the deforming region. For zones with a triangular or
tetrahedral mesh, spring-based smoothing can be used to adjust the interior node locations
based on known displacements at the boundary nodes. The spring-based smoothing method
updates the volume mesh without changing the mesh connectivity.
When the boundary displacement is large compared to the local cell sizes, the cell quality
may deteriorate or the cells may become degenerate. This leads to convergence problems
when the solution is updated to the next time step. To circumvent this problem, FLU-
ENT agglomerates poor-quality cells (cells that are too large, too small, or are excessively
stretched) and locally remeshes the agglomeration.
c Fluent Inc. June 17, 2005 1
2D Adiabatic Compression (Remeshing and Spring Smoothing)
Prerequisites
This tutorial assumes that you are familiar with the FLUENT interface and that you have
a good understanding of the basic setup and solution procedures. In this tutorial, you will
use the dynamic mesh model. If you have not used this model before, refer to Section 10.6:
Dynamic Meshes in the FLUENT 6.2 User’s Guide.
Problem Description
The problem to be considered is shown schematically in Figure 1. A simplified 2D geom-
etry consisting of a box is used. The bottom wall of the box represents the piston which
moves upward from the bottom dead center position (BDC), slowly compressing the fluid
adiabatically. After reaching the top dead center (TDC), the piston moves back downward
to the initial position, to complete a cycle.
Preparation
2
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
c Fluent Inc. June 17, 2005 3
2D Adiabatic Compression (Remeshing and Spring Smoothing)
Grid
FLUENT 6.2 (2d, segregated, lam)
4
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
Step 2: Models
c Fluent Inc. June 17, 2005 5
2D Adiabatic Compression (Remeshing and Spring Smoothing)
Step 3: Materials
The only material property you need to modify is density. The default values for all other
properties are acceptable.
In this tutorial, you need not visit the Boundary Conditions panel to set any conditions.
You will use the default adiabatic thermal conditions for all walls. No inlets or outlets are
present. Dynamic mesh motion and other related parameters are specified using the items
in the Define/Dynamic Mesh submenu, not through the Boundary Conditions panel. You will
set these conditions in the next step.
6
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
c Fluent Inc. June 17, 2005 7
2D Adiabatic Compression (Remeshing and Spring Smoothing)
i. Under Options, retain the default settings for Size Function and Must Improve
Skewness.
By default, the Size Function option is disabled and the Must Improve Skew-
ness option is enabled.
ii. Specify the Minimum Length Scale and the Maximum Length Scale.
If a cell exceeds these limits, the cell is marked for remeshing. Hence, you
need to specify problem-specific values for these remeshing parameters.
A. Click Mesh Scale Info....
The Mesh Scale Info panel opens. The values displayed for minimum and
maximum length scale, and maximum cell skewness are obtained from
the initial mesh.
B. Specify the values for Minimum Length Scale and Maximum Length Scale
as obtained from the Mesh Scale Info panel.
For a uniform mesh as in this problem, the values obtained from the
Mesh Scale Info panel are sufficient. For a non-uniform mesh, you can
use these values as an initial approximation and later modify the values
to improve the mesh quality.
iii. Set the Maximum Cell Skewness to 0.5.
A value of 0.6 to 0.7 is recommended for Maximum Cell Skewness for 2D
problems. Smaller values of maximum skew result in improved grid quality
at increased computational cost.
8
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
c Fluent Inc. June 17, 2005 9
2D Adiabatic Compression (Remeshing and Spring Smoothing)
(g) Plot the piston motion profile using the text command interface as shown.
You may need to press the <Enter> key to get the > prompt.
> define/models/dynamic-mesh-controls
/define/models/dynamic-mesh-controls> icp
/define/models/dynamic-mesh-controls/in-cylinder-parameter> ppl
#f
Lift Profile:(1) [()] **piston-full**
Lift Profile:(2) [()] <Enter>
Start: [180] 0
End: [720] <Enter>
Increment: [10] 5
Plot lift? [yes] <Enter>
/define/models/dynamic-mesh-controls/in-cylinder-parameter>
8.00e+00
7.00e+00
6.00e+00
5.00e+00
4.00e+00
3.00e+00
2.00e+00
1.00e+00
0.00e+00
0 100 200 300 400 500 600 700 800
10
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
c Fluent Inc. June 17, 2005 11
2D Adiabatic Compression (Remeshing and Spring Smoothing)
12
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
iv. Click the Meshing Options tab and set the following:
To determine the Minimum Length Scale and the Maximum Length Scale, you
need to know the approximate average length scale. The average length scale
can be calculated using the length scale values in the Zone Scale Info panel.
Click Zone Scale Info... to open the Zone Scale Info panel. For this case, the
average length scale is 0.65.
A. Specify the Minimum Length Scale as 0.26.
The Minimum Length Scale is recommended to be (0.4 × 0.65) where 0.65
is the average length scale.
B. Specify the Maximum Length Scale as 0.91.
The Maximum Length Scale is recommended to be (1.4 × 0.65) where 0.65
is the average length scale.
C. Click Create.
v. Close the Dynamic Mesh Zones panel.
c Fluent Inc. June 17, 2005 13
2D Adiabatic Compression (Remeshing and Spring Smoothing)
i. Retain the settings for Motion History Integration and click Integrate.
This allows FLUENT to create a table of surface positions in time.
14
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
1. Enable the plotting of volume-averaged temperature in the domain during the calcu-
lation by defining a volume monitor.
Solve −→ Monitors −→Volume...
The Volume Monitors panel is displayed.
(a) Increase the number of Volume Monitors to 1.
(b) Enable Plot, Print, and Write for the first monitor (vol-mon-1).
When the Write option is enabled, the volume-averaged temperature history is
written to a file. If you do not select the Write option, the history information
will be lost when you exit FLUENT.
(c) In the Every drop-down list, select Time Step for the monitor frequency.
(d) Click Define... to define the monitor.
The Define Volume Monitor panel opens automatically.
c Fluent Inc. June 17, 2005 15
2D Adiabatic Compression (Remeshing and Spring Smoothing)
16
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
c Fluent Inc. June 17, 2005 17
2D Adiabatic Compression (Remeshing and Spring Smoothing)
The solution is initialized at this point in the problem setup so that the contours for
setting up the view for the animation can be displayed.
(a) Retain the default values for all variables, including an initial Temperature value
of 300 K.
(b) Click Apply.
The Apply button does not initialize the flow field data. It only allows you to
save the initialization parameters for later use. You need to use the Init button
to initialize the solution.
(c) Click Init to initialize the solution.
(d) Click Close.
18
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
c Fluent Inc. June 17, 2005 19
2D Adiabatic Compression (Remeshing and Spring Smoothing)
5.00e+02
4.90e+02
4.80e+02
4.70e+02
4.60e+02
4.50e+02
4.40e+02
4.30e+02
4.20e+02
4.10e+02
4.00e+02
3.90e+02
3.80e+02
3.70e+02
3.60e+02
3.50e+02
3.40e+02
3.30e+02
3.20e+02
3.10e+02
3.00e+02
20
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
c Fluent Inc. June 17, 2005 21
2D Adiabatic Compression (Remeshing and Spring Smoothing)
(a) Set the Autosave Case File Frequency and Autosave Data File Frequency to 90.
Since the mesh changes during the simulation, you must save both the case and
data files.
(b) In the Filename field, enter box2d remesh and click OK.
When FLUENT saves a file, it appends the time step value to the file name prefix
(box2d remesh). The standard extensions (.cas and .dat) are also appended.
22
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
(a) Set the Under-Relaxation Factors for Pressure and Momentum to 0.6 and 0.9
respectively.
(b) Under Discretization, select PRESTO! for Pressure.
(c) Under Pressure-Velocity Coupling, select PISO.
i. Set the Skewness Correction to 0.
ii. Retain the default settings for the other parameters.
(d) Click OK.
c Fluent Inc. June 17, 2005 23
2D Adiabatic Compression (Remeshing and Spring Smoothing)
The Time Step Size displayed in the read-only text field (0.008333333) corresponds to
1
2 degree crank angle and is based on the crankshaft speed and crank angle increment
parameters defined earlier.
(a) Specify the Number of Time Steps as 720.
This corresponds to one full revolution of the crankshaft.
(b) Click Preview to preview the mesh motion.
As the mesh is updated by FLUENT, messages appear in the console window
reporting the progress of the update.
24
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
Step 8: Solution
c Fluent Inc. June 17, 2005 25
2D Adiabatic Compression (Remeshing and Spring Smoothing)
Monitors
vol-mon-1
600.0000
550.0000
500.0000
450.0000
Volume
Weighted 400.0000
Average
(k)
350.0000
300.0000
250.0000
0.0000 1.0000 2.0000 3.0000 4.0000 5.0000 6.0000
Flow Time
Step 9: Postprocessing
1. Inspect the solution at the bottom dead center (final time step).
(a) Display filled contours of static temperature (Figure 6).
Display −→Contours...
i. Select Temperature... and Static Temperature in the Contours of drop-down
lists.
ii. Under Options, select only Filled and Node Values.
iii. Enter 300 for Min and 500 for Max.
iv. Click Display.
(b) Display filled contours of density (Figure 7).
i. Select Density... and Density in the Contours of drop-down lists,
ii. Under Options, select only Filled and Node Values.
iii. Enter 1.18 for Min and 5.88 for Max.
iv. Click Display.
The temperature and density at the end of one full cycle closely replicate those
at the beginning of the simulation.
26
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
5.00e+02
4.90e+02
4.80e+02
4.70e+02
4.60e+02
4.50e+02
4.40e+02
4.30e+02
4.20e+02
4.10e+02
4.00e+02
3.90e+02
3.80e+02
3.70e+02
3.60e+02
3.50e+02
3.40e+02
3.30e+02
3.20e+02
3.10e+02
3.00e+02
Figure 6: Contours of Static Temperature at Bottom Dead Center (final time step)
5.88e+00
5.64e+00
5.41e+00
5.18e+00
4.94e+00
4.70e+00
4.47e+00
4.24e+00
4.00e+00
3.77e+00
3.53e+00
3.30e+00
3.06e+00
2.83e+00
2.59e+00
2.36e+00
2.12e+00
1.88e+00
1.65e+00
1.41e+00
1.18e+00
c Fluent Inc. June 17, 2005 27
2D Adiabatic Compression (Remeshing and Spring Smoothing)
5.88e+00
5.64e+00
5.41e+00
5.18e+00
4.94e+00
4.70e+00
4.47e+00
4.24e+00
4.00e+00
3.77e+00
3.53e+00
3.30e+00
3.06e+00
2.83e+00
2.59e+00
2.36e+00
2.12e+00
1.88e+00
1.65e+00
1.41e+00
1.18e+00
The temperature very closely obeys the analytical result for a reversible, adiabatic
compression:
γ−1
T2 ρ2
=
T1 ρ1
For γ = 1.4 and a compression ratio of 5:1, the theoretical temperature at the
top dead center is 571 K.
28
c Fluent Inc. June 17, 2005
2D Adiabatic Compression (Remeshing and Spring Smoothing)
5.00e+02
4.90e+02
4.80e+02
4.70e+02
4.60e+02
4.50e+02
4.40e+02
4.30e+02
4.20e+02
4.10e+02
4.00e+02
3.90e+02
3.80e+02
3.70e+02
3.60e+02
3.50e+02
3.40e+02
3.30e+02
3.20e+02
3.10e+02
3.00e+02
Summary
In this tutorial, you learned how to use the dynamic mesh feature in FLUENT. If you
have to set up and solve real-life simulations that involve valve movement as well as piston
movement, you will need to perform some additional steps that could not be illustrated
with the geometry in this problem.
c Fluent Inc. June 17, 2005 29