Tutorial: 2D Adiabatic Compression (Remeshing and Spring 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 • Specify dynamic mesh modeling parameters • Specify the motion of dynamic zones • Preview the dynamic mesh before starting the calculation • Perform basic dynamic mesh calculations with residual plotting • Examine the temperature and density fields using graphics 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
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Tutorial: 2D Adiabatic Compression (Remeshing and Spring
Smoothing)
Introduction
This tutorial illustrates the setup and solution of a basic deforming mesh in FLUENT 6.2using the remeshing and spring-based smoothing approaches.
In this tutorial you will learn how to:
• Set up a problem for a dynamic mesh
• Specify dynamic mesh modeling parameters
• Specify the motion of dynamic zones
• Preview the dynamic mesh before starting the calculation
• Perform basic dynamic mesh calculations with residual plotting
• Examine the temperature and density fields using graphics
The dynamic mesh model in FLUENT can be used to model flows where the shape of thedomain changes with time due to motion on the domain boundaries. The motion can beeither a prescribed motion (e.g., you can specify the linear and angular velocities about thecenter of gravity of a solid body with time), or an unprescribed motion where the subsequentmotion is determined by a user-defined function (UDF). The update of the volume meshis handled automatically by FLUENT at each time step based on the new positions of theboundaries. To use the dynamic mesh model, you need to provide a starting volume meshand 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 ortetrahedral mesh, spring-based smoothing can be used to adjust the interior node locationsbased on known displacements at the boundary nodes. The spring-based smoothing methodupdates the volume mesh without changing the mesh connectivity.
When the boundary displacement is large compared to the local cell sizes, the cell qualitymay deteriorate or the cells may become degenerate. This leads to convergence problemswhen 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 excessivelystretched) and locally remeshes the agglomeration.
2D Adiabatic Compression (Remeshing and Spring Smoothing)
Prerequisites
This tutorial assumes that you are familiar with the FLUENT interface and that you havea good understanding of the basic setup and solution procedures. In this tutorial, you willuse 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 whichmoves upward from the bottom dead center position (BDC), slowly compressing the fluidadiabatically. After reaching the top dead center (TDC), the piston moves back downwardto the initial position, to complete a cycle.
Figure 1: Schematic of the Problem
Preparation
1. Copy the file, box2d remesh.msh to your working directory.
2D Adiabatic Compression (Remeshing and Spring Smoothing)
Setup and Solution
Step 1: Grid
1. Read the mesh file (box2d remesh.msh.gz).
File −→ Read −→Case...
As the mesh file is read in, messages appear in the console window reporting theprogress of the reading.
2. Check the grid.
Grid −→Check
FLUENT performs various checks on the mesh and reports the progress in the consolewindow. Pay attention to the reported minimum volume and make sure this is apositive number.
3. Display the grid (Figure 2).
Display −→Grid...
(a) Under Surfaces, select all the surface zones.
(b) Click Display and close the panel.
Extra: Use the right mouse button to check the zone number corresponding toeach boundary. When you click the right mouse button on one of the bound-aries in the graphics window, its zone number, name, and type are printedin the FLUENT console window. This feature is especially useful when youhave several zones of the same type and you want to distinguish between themquickly.
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 otherproperties are acceptable.
1. Specify that the flow is compressible.
Define −→Materials...
(a) Select ideal-gas in the drop-down list for Density.
(b) Click Change/Create and close the panel.
FLUENT automatically enables the energy equation when the ideal-gas law isselected, so you need not visit the Energy panel.
Step 4: Boundary Conditions
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 arepresent. Dynamic mesh motion and other related parameters are specified using the itemsin the Define/Dynamic Mesh submenu, not through the Boundary Conditions panel. You willset these conditions in the next step.
2D Adiabatic Compression (Remeshing and Spring Smoothing)
i. Under Options, retain the default settings for Size Function and Must ImproveSkewness.
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, youneed 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 andmaximum length scale, and maximum cell skewness are obtained fromthe initial mesh.
B. Specify the values for Minimum Length Scale and Maximum Length Scaleas obtained from the Mesh Scale Info panel.
For a uniform mesh as in this problem, the values obtained from theMesh Scale Info panel are sufficient. For a non-uniform mesh, you canuse these values as an initial approximation and later modify the valuesto 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 2Dproblems. Smaller values of maximum skew result in improved grid qualityat increased computational cost.
2D Adiabatic Compression (Remeshing and Spring Smoothing)
(f) Set the In-Cylinder parameters.
i. Click the In-Cylinder tab.
The In-Cylinder parameters are displayed.
ii. Set the Crank Shaft Speed to 10 rpm.
This simulation is run at low speed to approximate the ideal process.
iii. Set the Starting Crank Angle to 180 degrees.
The piston is currently at the bottom dead center (BDC) position. The BDCposition is defined as 180 degrees crank angle, while the top dead center(TDC) position is defined as 0 degrees crank angle.
iv. Retain the default Crank Period of 720 degrees.
A value of 720 degrees is used for four-stroke engines, while a value of 360degrees is used for two-stroke engines. This governs the periodicity associatedwith valve events and valve lift profiles.
v. Set the Crank Angle Step Size to 0.5 degrees.
This value is used along with the crankshaft speed to determine the timestep.
vi. Set the Piston Stroke to 8 m.
vii. Set the Connecting Rod Length to 14 m.
viii. Set both the Piston Stroke Cutoff and Minimum Valve Lift to 0 m.
These two parameters are not utilized in the current simulation.
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, youneed to know the approximate average length scale. The average length scalecan 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, theaverage 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.65is 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.65is the average length scale.
2D Adiabatic Compression (Remeshing and Spring Smoothing)
3. Preview the zone motion.
The zone motion preview utility is useful for quickly checking the rigid body motion set-tings. The mesh coordinates are not actually modified during this procedure. Instead,dynamic zones with rigid body motion settings are simply translated in the displaywindow to emulate the actual grid motion. User errors such as an improperly scaledmesh or valve lift profile, incorrect valve/piston axis definition, etc., can be quicklyidentified using this procedure. Only the motion of zones with rigid body motion isrepresented, remeshing on deforming zones is not depicted.
(a) Display the grid outline.
Display −→Grid...
i. Deselect all surfaces.
ii. Click the Outline button to select the outline surfaces.
iii. Click Display to display the grid outline.
iv. Close the Grid Display panel.
(b) Initiate the zone motion.
Display −→Zone Motion...
i. Retain the settings for Motion History Integration and click Integrate.
This allows FLUENT to create a table of surface positions in time.
2D Adiabatic Compression (Remeshing and Spring Smoothing)
The Preview Controls are highlighted.
ii. Retain the default settings for Preview Controls and click Preview.
If the case is set up properly, you should see the piston move through twocomplete cycles.
iii. Close the Zone Motion panel.
Step 6: Solution Setup
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 iswritten to a file. If you do not select the Write option, the history informationwill 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.
2D Adiabatic Compression (Remeshing and Spring Smoothing)
3. Initialize the solution.
Solve −→ Initialize −→Initialize...
The solution is initialized at this point in the problem setup so that the contours forsetting up the view for the animation can be displayed.
(a) Retain the default values for all variables, including an initial Temperature valueof 300 K.
(b) Click Apply.
The Apply button does not initialize the flow field data. It only allows you tosave the initialization parameters for later use. You need to use the Init buttonto initialize the solution.
It is possible to specify multiple text commands in a single entry. Be sure tomaintain at least a single space between commands. The above command willfirst activate ‘window 2’, restore the saved view ‘view-0’, display contours ofstatic temperature and then make a hardcopy of the resulting image. The‘%t’ appended to the file name instructs FLUENT to append the timestepindex to the filename.
2D Adiabatic Compression (Remeshing and Spring Smoothing)
(d) Set hardcopy settings.
File −→Hardcopy...
The Graphics Hardcopy panel is displayed.
i. Under Format, select TIFF.
ii. Under Coloring, select Color.
iii. Click Apply and close the panel.
5. Request saving of case and data files every 90 time steps.
File −→ Write −→Autosave...
(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 anddata 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.
2D Adiabatic Compression (Remeshing and Spring Smoothing)
Step 7: Mesh Preview
1. Save the case file.
Since the mesh changes during the preview, ensure that you save the case before meshpreview.
2. Display the grid.
Display −→Grid...
(a) Select all the surfaces.
(b) Click Display.
(c) Close the Grid Display panel.
3. Set up the mesh preview.
Solve −→Mesh Motion...
The Time Step Size displayed in the read-only text field (0.008333333) corresponds to12 degree crank angle and is based on the crankshaft speed and crank angle incrementparameters 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 windowreporting the progress of the update.
2D Adiabatic Compression (Remeshing and Spring Smoothing)
Step 8: Solution
1. Read the case file back into FLUENT.
File −→ Read −→Case...
2. Initialize the solution.
Solve −→ Initialize −→Initialize...
(a) Click Init.
(b) Close the Solution Initialization panel.
3. Start the calculation.
Solve −→Iterate...
(a) Set the Number of Time Steps to 720.
(b) Set the Max Iterations per Time Step to 10.
(c) Click Iterate.
The plot for volume-averaged temperature is shown in Figure 5. The values may bedifferent for different computers. Hence, the plot that appears on your screen may notbe exactly the same as the one shown here.
In this tutorial, you learned how to use the dynamic mesh feature in FLUENT. If youhave to set up and solve real-life simulations that involve valve movement as well as pistonmovement, you will need to perform some additional steps that could not be illustratedwith the geometry in this problem.