You are on page 1of 20

Create Geometry in GAMBIT

Start GAMBIT

Create a new directory called cylinder and start GAMBIT from that directory by typing gambit
-id cylinder at the command prompt.

Under Main Menu, select Solver > FLUENT 5/6 since the mesh to be created is to be used in
FLUENT 6.x.x version.

Operation Toolpad > Geometry Command Button > Vertex Command Button > Create
Vertex

Create the vertices as listed in the following table. Again, the units can be arbitrary, and you may scale
the lengths proportionally.

Label X Y Z

A 0 0 0

B 0.5 0 0

C 0 0.5 0

D -0.5 0 0

E -5 0 0

F -5 5 0

G 0 5 0

H 20 5 0

I 20 0 0

J 20 -5 0

K 0 -5 0

L -5 -5 0

Operation Toolpad > Geometry Command Button > Edge Command Button > Create
Edge
1.Create circle

Right click Create Edge button, then choose Create Full Circle. Choose A as Center, B and C as
End-Points,  click Apply then we get circle ABC.

2.Split the circle

Choose Split/Merge Edges. Choose circle ABC for Edge box, and select Split With: Vertex.

Then choose vertex D as reference vertex, click Apply. Then circle will be split to two parts:
BCD and BMD.

3.Create the straight line.

Under Edge, choose Create Straight Edge:  D and E, E and F,  F and G, G and H, H and I, E and
L, L and K, K and J, J and I , then B and I.

Operation Toolpad > Geometry Command Button > Face Command Button > Form Face

Right click and choose Create Face from Wireframe.

Choose Edge DE, EF, FG, GH, HI, IB, and BCD to create face1. Similarly, choose DE, EL, LK,
KJ, JI, IB and  BMD to create face2.

Mesh Geometry in GAMBIT

Mesh Faces

Operation Toolpad > Mesh Command Button > Edge Command Button > Mesh Edges

Edge BCD and BMD: interval count 50 for each

Edge DE: Ratio 1.05 and interval count 40

Edge BI: Ration 1.05 and interval count 70

Edge EF and EL: Ration 1 and interval count 10 for each

Edge HI and JI: Ration 1 and interval count 10 for each


Edge FG and LK: Ration 1 and interval count 5 for each

Edge GH and KJ: Ration 1 and interval count 21 for each

Operation Toolpad > Mesh Command Button > Face Command Button > Mesh Faces

Select Face1, choose Tri for Element and Pave for Type, and click Apply.

Repeat this for Face2.

Your mesh should look similar as follows:

Specify Boundary Types in GAMBIT

Define Boundary Types

Operation Toolpad > Zones Command Button > Specify Boundary Types

Select Add, fill in inlet for Name, VELOCITY_INLET for Type, select EF and EL for Edges,
then click Apply.

Similarly, define FG, GH, LK and KJ named wall as WALL Type.

Define BCD and BMD named cylinder as WALL Type.

Define HI and JI named outlet as PRESSURE_OUTLET Type.

Save Your Work

Main Menu > File > Save

Export Mesh

Main Menu > File > Export > Mesh...

Save the file as cylinder.msh.

Set Up Problem in FLUENT

Launch FLUENT
Start > Programs > Fluent Inc > FLUENT 6.3.26

Select 2ddp from the list of options and click Run.

Import File

Main Menu > File > Read > Case...

Navigate to your working directory and select the cylinder.msh file. Click OK.

Analyze Grid

Grid > Info > Size

Check how many cells and nodes the mesh has.

Display > Grid

Display the grid information.

Define Properties

Define > Models > Solver...

Under the Solver box, select Pressure Based.

Click OK.

Define > Models > Viscous

Select Laminar under Model

Click OK.

Define > Models > Energy

Do not select Energy Equation.

Define > Materials

Make sure air is selected under Fluent Fluid Materials. Set Density to constant and equal to 1
kg/m 3 and Viscosity to 0.025 kg/m-s. We choose these numbers so that Re = 40.
Click Change/Create.

Define > Operating Conditions

We'll work in terms of gauge pressures in this example. So set Operating Pressure to the
ambient value of 101,325 Pa.

Click OK.

Define > Boundary Conditions

Set inlet, click Set... and set the Velocity Magnitude to 1 m/s. Click OK.

Set outlet, click Set... and set the Gauge Pressure at this boundary to 0. Click OK.

Solve

Solve > Control > Solution

Under Discretization, set Momentum to Second-Order Upwind.

Solve > Initialize > Initialize...

Select inlet under Compute From. We'll set these values to be equal to those at the inlet.

Solve > Monitors > Residual...

Now we will set the residual values (the criteria for a good enough solution). Once again, we'll
set this value to 1e-06.

Select Print and Plot under Options.

Click OK.

Solve > Monitors > Force...


Under Coefficient, choose Drag. Under Options, select Print and Plot. Then, Choose cylinder
under Wall Zones.

Set the Force Vector components for the drag. The drag is the force in the direction of the
freestream. So to get the drag coefficient, set X to 1 and Y to 0.

Record the histories of Cd. Under Options, select Write. Fill in the name in the box under File
Name, then the text file containing drag coefficients at each iteration will be stored in the file.

Click Apply for these changes to take effect.

Similarly, set the Force Monitor options for the Lift force. The lift is defined as the force
component perpendicular to the direction of the freestream. So under Force Vector, set X to 0
and Y to 1.

Click Apply.

Report > Reference Values

Now, set the reference values to set the base cases for our iteration. Select inlet under Compute
From.

Main Menu > File > Write > Case...

Save the case file before you start the iterations.

Solve > Iterate

Make note of your findings, make sure you include data such as:

What does the convergence plot look like?


How many iterations does it take to converge?

Main Menu > File > Write > Case & Data...
Save case and data after you have obtained a converged solution.

Analyze Results

Drag / Lift coefficients

Report > Forces >

Under Force Vector, we set X = 1 and Y = 0 to identify the direction of drag force. Click Print
to see what's displayed in the main window.

Plot convergence of the drag coefficient versus the number of iterations. Report the drag
coefficient and compare it with the result in literature as shown in Table 1.

Plot>File

Click Add... choose the file with drag or lift coefficient.

Before you plot, you can adjust the Axes and Curves to get a better view.
Similarly, you can plot the lift coefficient, which should be zero for the symmetric flow. As you can see,
the drag coefficient is around 2.1, which is significantly higher than the result in the table. Next, we will
try to increase the domain size and repeat the simulation.

Re 40 300 1000

Mittal 2 1.53 1.36 1.45

Henderson 3 1.54 1.37 1.51

Marella et al 4 1.52 1.28 -


Mittal&Balachandar 5 - 1.37 -

Table 1 Mean drag coefficient in literature for the flow past a 2D cylinder.

Change the Domain Size.

Change the domain size to 50D*50D

Keep the points on the cylinder unchanged.

Label X Y Z

E -15 0 0

F -15 25 0

G 0 25 0

H 35 25 0

I 35 0 0

J 35 -25 0

K 0 -25 0

L -15 -25 0

Keep the number of mesh vertex on the cylinder the same with 10d x 20d geometry.

Edge DE: Ratio 0.94 and interval count 50

Before meshing DE, we change the direction of DE: first shift + left click the edge, then middle
click the edge, the direction changes from DE to ED. It looks as below:
The red arrow shows the direction of the edge.

Edge BI: Ration 1.03 and interval count 120

Edge EF and EL: Ration 1.05 and interval count 25 for each

Edge HI and JI: Ration 1 and interval count 20 for each

Edge FG and LK: Ration 1 and interval count 15 for each

Edge GH and KJ: Ration 1 and interval count 36 for each

Repeat the mesh steps and export a new mesh for simulation. Also, repeat the solution procedure
to solve the flow.

Plot convergence of the drag coefficient versus the number of iterations. Report the drag
coefficient and compare it with the result in literature as shown in Table 1.

Plot streamlines. Plot pressure, velocity, vorticity contours.

Streamline

Display > Contours >


Contours

Contour of the dimensionless pressure

Contour of the velocity magnitude (normalized by the freestream velocity)


Vorticity Magnitude (normalized by U/a)

Unsteady Flow

For Re > 47, the flow becomes unsteady. We simulate two cases, Re = 300 and 1000, using the
large domain and mesh created in Step 7. For unsteady flow we need to change some setups in
Fluent.

1. Define > Models > Solver...

Select Unsteady under Time. Choose 2nd-Order Implicit under Unsteady Formulation.
2. Define>Materials...

Use 1 for Density and proper Viscosity so that Re = 300.

For Re = 1000, you will again need to adjust the viscosity.

3. Record the histories of Cd and Cl.

Solve> Monitors > Force...

Select Print, Plot and Write. Fill in the name in the box under File Name, then the text file
containing Cd or Cl each time step will be recorded in the file.

4.Iteration
Because the flow is unsteady, we need to define the size of the time step. In this case we use
0.05s as the time step and run the simulation for 3000 time steps. Note that in terms of the
dimensionless scale, the time step is 5% of the residence time (d/U).

The drag and lift coefficients as functions of nondimensional time, tU/d, for Re=300 are shown
below. The mean values of Cd and Cl are taken after the periodic oscillations are established.
Plot the vorticity contour.

Plot streamlines.

5. Making animations

Solve> Animate> Define...


Choose Time Step under When. Type 10 (or up to 50) in Every box so that a frame is recorded
every 10 time steps. Note that the more frequently you record a frame, the larger data the code
will produce. You may delete the data files generated by Fluent after creating the animation
(sequence.xxx.hmf). Click Define...

For Window, we use number 3, which means that the velocity magnitude window is being
recorded (You need to choose proper window number if you have different windows); then click
Set and the figure window 3 will show up. Under Display Type, choose Contours:
Choose Velocity Magnitude. Click Display and Close.

Click OK for Animation Sequence panel.

Click OK for Solution Animation panel.

Adjust the size of the velocity contour for a better view of the flow over the cylinder. Use middle
button to choose the view you want: Press the middle button, move the arrow from upper left to
lower right to zoom in and from lower right to upper left to zoom out.

This window will record the velocity contours every a few time steps as specified while the flow
is evolving.

After the time-stepping is finished, we can make the animation from the recorded frames.

Solve>Animate>Playback...
Under Sequences, select sequence-1. For Write/Record Format, choose MPEG.

Click Write and a MPEG file will export to your work directory. You may also specify the
playback speed here.

Problem Description

(a)

(b)

Figure 1. Two dimensional flow past a cylinder. (a) Steady flow; (b) Karman vortices.

Consider a uniform viscous fluid flow past an infinitely cylinder whose diameter is d. The
Reynolds number Re is based on the incident velocity and cylinder diameter.
where is density, is velocity magnitude, is the effective viscosity (laminar plus turbulent).

When Re is sufficiently low (less than 47), the flow is symmetric and steady, and a pair of
vortices are formed behind the cylinder (Fig. 1a). When Re is higher than the critical value, the
flow becomes unstable to the perturbations and leads to periodic Karman vortex shedding from
the cylinder surface (Fig. 1b). When Re is higher than 180, the flow will become three-
dimensional. 1

Flow past a cylinder is a simplified model problem to study the unsteady wake be hind a bluff
body. In some real applications, the vortex shedding may cause the structure to vibrate, a
phenomenon called flow-induced vibration, which could b e detrimental if the vortex shedding
frequency happens to be close to the resonant frequency of the structure. In some other
applications, the vortex shedding may cause noise, e.g., whining of the hanging wires in wind.

In this project, we perform 2D simulations at Reynolds numbers of 40, 300, and 1000, and
compute the drag and lift coefficients for both steady and unsteady situations.

Figure 2. Computational domain.

h4. Computational Domain

A rectangular box is chosen as the computational domain, as shown in Fig. 2. Note that the flow
is normalized by three repeating parameters: the density, free stream velocity, and the cylinder
diameter. The only governing dimensionless parameter for the flow is the Reynolds number.

Therefore, in Fluent we may simply set d = 1m, U = 1m/s, = 1kg/m3, and choose viscosity to
match specified Re. The units for these parameters can be arbitrary as long as they are consistent
and the desired Re is achieved. The results should also be presented in a nondimensional form,
e.g., the normalized velocity, u/U, as a function of the normalized time, tU/d.
In this project, we will try different domain sizes to make sure the domain truncation does not
introduce significant error.

You might also like