Upload
others
View
8
Download
0
Embed Size (px)
Citation preview
TUTORIAL 1
1. CREATING AND MESHING BASIC GEOMETRY (PRE-PROCESSING)
This tutorial illustrates geometry creation and mesh generation for a simple geometry using
GAMBIT.
In this tutorial you will learn how to:
Start GAMBIT
Use the Operation toolpad
Create a vertices, edges and face
Mesh a face
Examine the quality of mesh
Set Boundary Types
Save the session and exit GAMBIT
1.1 Problem Description
The model consists of a T-junction cylindrical pipe. The basic geometry is shown
schematically in Figure 1.
Figure 1: Problem specification
Consider fluid flowing through a T-junction pipe of constant cross-section. The pipe
diameter d = 0.1 m and length L=1 m. The velocity for both inlet V=1 m/ s. Consider
the velocity to be constant over the inlet cross-section. The fluid exhausts into the
ambient atmosphere which is at a pressure of 101325 Pa (1 atm). The material of fluid
is water-liquid with density = 998.2 kg/m3 and coefficient of viscosity μ = 1.003 x 10-
3 kg/ms.
This is a simple flow problem and we will use FLUENT to determine the flow
behavior inside the pipe. Graphical display the pressure distribution in pipe, and
velocity distribution in pipe. Plot the centerline velocity.
L
L
1.2 Strategy for Creating and Meshing Geometry
This first tutorial illustrates some of the basic operations for generating a mesh using
GAMBIT. In particular, it demonstrates:
How to build 2-D geometry
How to create a hexahedral mesh automatically
The steps you will follow in this tutorial are listed below:
Create vertices, edge and face.
Automatically generate the mesh.
Examine the quality of the resulting mesh.
Setting continuum types (for example, identifying which mesh zones are fluid and
which are solid) and boundary types
These details, as well as others, are covered in subsequent tutorials.
1.3 Procedure to create the geometry
Type
gambit -id basgeom
to start GAMBIT.
This command opens the GAMBIT graphical user interface (GUI). (See Figure 2.)
GAMBIT uses the name you specify (in this example, basgeom) as a prefix to all files
it creates: for example, basgeom.jou.
Figure 2: The GAMBIT graphical user interface (GUI)
Step 1: Run the software GAMBIT to create the geometry and to mesh it.
Now Gambit is launched. Click on Solver menu at the top of the Gambit window and choose
FLUENT 5/6.
Figure 3: The solver change to FLUENT 5/6
Step 2: Create a vertices
In order to create the T shapes geometry, first put the coordinate system on the
geometry and label it.
Figure 4: The coordinate system on the geometry
Create Vertex-From Coordinates. In Create Real Vertex-Global, enter 0, 0, and 0 for
x, y, and z coordinates respectively. Type an appropriate label for this vertex, e.g.,
“A”, and Apply. A vertex is created, as indicated by a small white plus sign at this
location. Do the same operation until I.
Figure 5: Steps to create a vertex
Click Fit to Window Button to fits the geometry into the available screen space.
Figure 6: Global control toolpad
1
2
3
4
5
6
Undo button Fit to Window
Button
Figure 7: All 9 vertices on screen
Step 3: Create an edges
Join vertex A and B by straight lines to form the "edge" and name as “AB”. Figure 8
show that all edges name.
Figure 8: Namely all edges
Click left mouse on Geometry Command Button and Edge Command Button. Click
on “down arrow button” and selects A and B in vertex list. Then click on button
and put AB as a label. Click Apply and Close. Follow in Figure 9. Do the same
operation for BC, CD, DE, EF, FG, HI and IA.
Figure 9: Steps to join vertex to create a straight line
Figure 10: All vertices joint to create T shape geometry
1
2
3
4
5
6
7
8
Step 4: Create a face
Lastly, create a "face" corresponding to the area enclosed by the edges. Under
Geometry, Face Command Button-R-Form Face-Wireframe. It is important to select
the edges in order when creating a face from existing edges. (I like to select them in
mathematically positive clockwise order). Select the “AB” edge first, followed by the
“BC” edge, the “CD” edge, the “DE” edge, and until “IA” edge or just click ALL.
Type in a label for this face “PIPE CROSS SECTION”, Apply and Close.
Figure 11: Steps to generate face from edges
If all went well, a pretty blue outline of the face should appear on the screen; this is a
face, which is now ready to be meshed.
Figure 12: Blue outline will appear after face created
1
2
3
4
5
6
1.5 Procedure to mesh a face
Generate the mesh on the face:
If you have zoomed in, you will now want to zoom out. Zoom back out so that the
entire mesh can be clearly seen. This is most easily accomplished by clicking on Fit to
Window in the Graphics/Windows Control (near the bottom right of the screen).
Under Operation, Mesh Command Button-Face Command Button. The default
window that pops up should be Mesh Faces. If not, Mesh Faces.
Select the face by shift clicking on one of its edges. Elements should be Quad by
default; if not, change it. Also change Type to Submap. Change to interval size in
spacing option and put the value 0.005.
Generate the mesh by Apply. If all goes well, a structured mesh should appear. Zoom
in to see how the cells are nicely clustered close to the T-junction of geometry.
You can now close the Mesh Faces window.
Figure 13: Steps to generate face mesh
1
2
3
4
5
6
7
8
9
(a) (b)
Figure 14: Comparison mesh using different interval size (a) 0.005 (b) 0.010
1.6 Procedure to Examine the quality of the mesh
Check the quality of mesh before write out mesh file to FLUENT format.
Figure 15: Steps to check the quality of mesh
1.7 Procedure to define the boundary zones
Specify Boundary Types
Under the Operations panel, click on Zones
Under the Zones panel, click on Specify Boundary Types
In the Specify Boundary Type window, put in a name as “INLET 1”, right click on
the button below Type, hold and choose VELOCITY INLET from the drop-down list.
Click on arrow button and pick AB and IA. Apply and Close.
Do the same operation for all edges based on Table 1.
Figure 16: Steps to namely boundary zone
Table 1: List of boundary zone
EDGE NAME TYPE
AB & IA INLET 1 VELOCITY
INLET
FG INLET 2 VELOCITY
INLET
CD OUTLET PRESSURE
OUTLET
BC, DE, EF, GH
& HI
WALL WALL
1
2
3
4
5
6
Specify Continuum Types
Under the Zones panel, click on Specify Continuum Types
In the Specify Continuum Types window, put the name as “INTERIOR” and select
FLUID type, right click on the button below Entity, hold and choose faces from the
drop-down list. Select PIPE CROSS SECTION.
Click on the button Apply and Close.
Figure 17: Steps to namely continuum zone
1
2
3
4
5
6
1.8 Procedure to write out the mesh in the format used by Fluent
In the main Gambit window, File-Export-Mesh. (The default file name can be
changed at this point if desired.) Check the option to export a 2-D mesh, and Accept.
When the Transcript (at lower left) informs you that the mesh is done, File-Exit-Yes.
The mesh file should now be ready for use by Fluent.
Figure 18: Steps to write out mesh in the fluent format
2. RUN SIMULATION USING FLUENT 6 SOLVER (PROCESSING)
2.1 Procedure to load mesh file
Run the software FLUENT 6. The FLUENT Version tab will be appear, choose 2d
and Full Simulation for Mode. Then, FLUENT 6 interface will be appearing as Figure
20.
Figure 19: FLUENT Version Tab
Figure 20: The FLUENT 6 Text User Interface (TUI)
Click File on Main Menu Bar, select Read and then select Case. Browse to and select
the file “T JUNCTION PIPE.msh”. Make sure change All Files from the drop-down
list.
Figure 21: How to load previous mesh file to FLUENT 6.
Main Menu Bar
2.2 Procedure to Check and Display Mesh in FLUENT solver
FLUENT will report the results of the mesh check in the console. Follow below steps:
Main Menu > Grid > Check
Main Menu > Grid > Info > Size
Main Menu > Display > Grid
Figure 22: Grid Check on FLUENT interface
The mesh check ensures that each
cell is in a correct format and
connected to other cells as expected.
It is recommended to check every
mesh immediately after reading it.
Failure of any check indicates a
badly formed or corrupted mesh
which will need repairs prior to
simulation.
2.3 Procedure to Define Solver Properties
Click Define on Main Menu Bar, then select Models and Solver. Use default setting
of the Solver.
Figure 23: The drop-down list from Define Command on Main Menu Bar
Figure 24: The default setting of the FLUENT Solver Tab
Click Define on Main Menu Bar, then select Models and Viscous. Enable the
Laminar model.
Figure 25: The Viscous Model Tab
2.4 Procedure to Define New Material Properties
Click Define Command on Main Menu Bar, then select Material. Materials Tab will
be appear as Figure 25. Left click on Fluent Database, choose “Fluid” on Material
Type and search Water-Liquid. Click Copy and Close button. Change density = 998.2
kg/m3 and coefficient of viscosity μ = 1.003 x 10-3 kg/ms. Click Change/Create button
and Close.
Figure 26: The Materials Tab
Figure 27: Fluent Database Materials Tab
2.5 Procedure to Define Operating Conditions
Click Define Command on Main Menu Bar, then select Operating Conditions. Use default
setting which is the operating pressure = 101325 Pascal (1atm). This simulation ignores the
gravitational effect.
Figure 28: Operating Conditions Tab
2.6 Procedure to Define Boundary Conditions
Click Define Command on Main Menu Bar, then select Boundary Conditions. Select
inlet 1 zone, click Set button and enter value velocity magnitude =1m/s. Click OK. Do
the same operation for inlet 2 zone.
Figure 29: Set the Boundary Condition for Inlet 1
Remain the default setting for outlet zone and wall zone. For this problem the outlet
gauge pressure is 0 and no slip wall will be used.
Figure 30: Pressure Outlet setup
Figure 31: Wall zone setup
Change the material in interior zone from air to water-liquid. Choose interior zone,
then click Set and change water liquid on material name. Click OK and Close.
Figure 32: Material setup in interior zone.
2.7 Procedure to set solution method
This simulation will be use First Order Upwind for the momentum (to get better
result, change to second order upwind that can increase the accuracy). This simulation
also use default number for under-relaxation factors.
Main Menu > Solve > Controls > Solution
Figure 33: The drop-down list from Solve Command on Main Menu Bar
Figure 34: Solution Controls Tab
Discretization schemes define
how the solver calculates
gradients and interpolates
variables to non-stored
locations. First-order schemes
are more stable but less accurate
than higher order schemes. This
case is well defined and will be
stable using second-order
numerics from the start.
Set Initial Guess
Main Menu > Solve > Initialize > Initialize.
Initialize the flow field to the values at all zones. Select “all-zones”, click Init button
and Apply. Press Close button.
Figure 35: Solution Initialization Tab
Set Convergence Criteria
Iterate the solution until the residual for each equation falls below 1x10-3.
Main Menu>Solve > Monitors > Residual.
Figure 36: Click Residual Command
Figure 37: Set the value 0.001 on Absolute Criteria for all residual
2.7 Run the simulation
Iterate Until Convergence
Start the calculation by running 500 iterations:
Main Menu > Solve > Iterate.
Figure 38: Set number of iteration
Wait the simulation complete until solution is converging.
Figure 39: Simulation complete
Save the solution to a data file by follow the step below:
Main Menu > File > Write > Data.
3. DATA ANALYSIS USING FLUENT 6 (POST-PROCESSING)
3.1 Analysis Data
To see the contour of pressure distribution in pipe. Click Display Command on Main
Menu Bar and select contours.
Figure 40: Contours command selected
Tick Filled on Options, the click Display button. The pressure distribution contour
will be display. The minimum and maximum value also will be display.
Figure 41: Contours tab
Figure 42: Contour of static pressure in T junction pipe
To see the vector of velocity magnitude in pipe. Click Display Command on Main
Menu Bar and select vector. Just click Display button. The velocity vector will be
display.
Figure 43: Vectors tab
Figure 44: Vector of velocity magnitude in T junction pipe
Create the line along centerline. Put the origin coordinate for first point, x0 = 0 and y0
= 0. For second point, x1 = 1 and y1 = 0. Type “centre-line) on the new surface name,
then click create button and close.
Main menu > surface > line/rake
Figure 45: Coordinate to create center line
Plot the variation of the axial (x) velocity along the centerline.
Main Menu > Plot > XY Plot.
Figure 46: XY Plot command selected
Select centre-line on Surfaces option, then click Plot button. Axes button is to
customize the graph plot.
Figure 47: Solution XY Plot tab
Figure 48: Graph velocity magnitude against x direction of center line.
Saving the Plot
File > Hardcopy
3.2 Export Data
Export data to excel file and open it in Microsoft Office Excel. Follow steps below:
Main Menu > File > Export
Choose ASCII > centre-line > Velocity Magnitude > Write
Save on Desktop and put the file name as “CENTRE LINE VELOCITY
MAGNITUDE”. Click OK.
Run Microsoft Office Excel Software.
Office button > Open > search file save location
Click Yes on below tab appear.
Click Next >
Tick Tab, Semicolon, and Comma. Click finish button.