PDF

Unsteady 3D Flow Past a Cylinder
Introduction
Fluid flow past a cylinder is a common test case in computational fluid dynamics. The flow pattern is characterized by the Reynolds number which is defined as
where ρ is the density, Umean is the mean velocity of the free stream, D is the cylinder diameter, and μ is the dynamic viscosity.
The flow patterns around a cylinder in a free stream for different Reynolds numbers are shown in Ref. 1. At Re below 5, the flow remains attached to the cylinder. For Re between 5 and 15, steady wake vortices start forming on the downstream side of the cylinder. The wake becomes unsteady and forms a laminar vortex street for Re between 40 and 150.
Flow around a cylinder in a channel is even more complicated due to the effect of wall boundaries. Computer simulations of this problem at the intermediate Re regime (between 40 and 150) are challenging since they need to be 3D and time-dependent.
In this verification model, a benchmark problem of unsteady, incompressible 3D flow past a cylinder for Re = 100 during a period of 8 seconds is considered. The lift and drag coefficients are computed and are compared with those in Ref. 2.
Model Definition
The geometry is a cylinder of radius R with the axis parallel to the z-axis, and placed at , inside the box . Figure 1 shows the geometry corresponding to R = 0.05 m , L = 2.5 m, H = 0.5 m, and xc = 0.5 m, yc = 0.2 m.
The fluid to be considered is incompressible and Newtonian with a kinematic viscosity of 10-3 m2/s. The inflow velocity profile varies in time according to
The lift and drag coefficients CD and CL are computed as functions of time,
where FD and FL are the drag and lift forces, and A is the projected area, A = 2RH.
Figure 1: The geometry is a cylinder placed inside a box.
The simulation is performed with a relatively coarse mesh with 7200 hexahedral elements shown in Figure 2. P2+P2 shape functions are chosen for the velocity and pressure to allow for better conservation and higher accuracy compared to P2+P1 and P1+P1. The generalized alpha method with automatic time stepping is chosen since it has less damping than the BDF method.
Figure 2: The relatively coarse mesh, with 7,200 hexahedral elements, used in the simulation.
Results and Discussion
Figure 3 shows the flow pattern at t = 7.95 s, the last saved time before the inflow velocity returns to zero.
The lift and drag coefficients versus time are shown in Figure 4 and Figure 5 respectively. They capture the general shape of those published Ref. 2 quite well.
When the mesh size is reduced by a factor of 2, resulting in 57,600 elements, the computational time increases by a factor of 8 but the agreement is excellent.
Figure 3: Computed velocity field at t = 7.95 s.
Figure 4: Lift coefficient versus time.
Figure 5: Drag coefficient versus time.
Notes About the COMSOL Implementation
The space discretization P2+P2 coupled with the generalized alpha time discretization works efficiently for this application. P2+P2 elements allow for a coarser mesh, better conservation, and more accuracy compared to P2+P1 and P1+P1 elements. The generalized alpha method has less damping than the BDF method. Automatic time-stepping works well and relatively large time steps can be used, and thus less computational time is needed compared to Ref. 2.
References
1. M. Van Dyke, An album of fluid motion, the Parabolic Press, ISBN 0-915760-03-7, 1982.
2. E. Bayraktar, O. Mierka, and S. Turek, “Benchmark Computation of 3D Laminar Flow Around a Cylinder with CFX, OpenFOAM and FeatFlow,” IJCSE, vol. 7, no. 3, pp. 253–266, 2012.
Application Library path: CFD_Module/Verification_Examples/cylinder_flow_3d_periodic
Modeling Instructions
From the File menu, choose New.
New
In the New window, click  Model Wizard.
Model Wizard
1
In the Model Wizard window, click  3D.
2
In the Select Physics tree, select Fluid Flow>Single-Phase Flow>Laminar Flow (spf).
3
Click Add.
4
Click  Study.
5
In the Select Study tree, select General Studies>Time Dependent.
6
Global Definitions
Parameters 1
1
In the Model Builder window, under Global Definitions click Parameters 1.
2
In the Settings window for Parameters, locate the Parameters section.
3
Geometry 1
First, create the box [0,  L]×[0,  H]×[0,  H].
Block 1 (blk1)
1
In the Geometry toolbar, click  Block.
2
In the Settings window for Block, locate the Size and Shape section.
3
In the Width text field, type L.
4
In the Depth text field, type H.
5
In the Height text field, type H.
Next, create a smaller box around the cylinder. This box will be used later on in the meshing sequence.
Block 2 (blk2)
1
In the Geometry toolbar, click  Block.
2
In the Settings window for Block, locate the Size and Shape section.
3
In the Width text field, type 4*R.
4
In the Depth text field, type 4*R.
5
In the Height text field, type H.
6
Locate the Position section. In the x text field, type xc-2*R.
7
In the y text field, type yc-2*R.
Now, create the cylinder.
Cylinder 1 (cyl1)
1
In the Geometry toolbar, click  Cylinder.
2
In the Settings window for Cylinder, locate the Size and Shape section.
3
In the Radius text field, type R.
4
In the Height text field, type H.
5
Locate the Position section. In the x text field, type xc.
6
In the y text field, type yc.
7
Locate the Rotation Angle section. In the Rotation text field, type 45.
8
In the Geometry toolbar, click  Build All.
The following operations divide the flow domain into a number of subdomains. This way, a coarser mesh can be used far from the cylinder.
Line Segment 1 (ls1)
1
In the Geometry toolbar, click  More Primitives and choose Line Segment.
2
On the object cyl1, select Point 2 only.
3
In the Settings window for Line Segment, locate the Endpoint section.
4
Find the End vertex subsection. Select the  Activate Selection toggle button.
5
On the object blk2, select Point 5 only.
Line Segment 2 (ls2)
1
In the Geometry toolbar, click  More Primitives and choose Line Segment.
2
On the object cyl1, select Point 6 only.
3
In the Settings window for Line Segment, locate the Endpoint section.
4
Find the End vertex subsection. Select the  Activate Selection toggle button.
5
On the object blk2, select Point 7 only.
Line Segment 3 (ls3)
1
In the Geometry toolbar, click  More Primitives and choose Line Segment.
2
On the object cyl1, select Point 8 only.
3
In the Settings window for Line Segment, locate the Endpoint section.
4
Find the End vertex subsection. Select the  Activate Selection toggle button.
5
On the object blk2, select Point 8 only.
Line Segment 4 (ls4)
1
In the Geometry toolbar, click  More Primitives and choose Line Segment.
2
On the object cyl1, select Point 4 only.
3
In the Settings window for Line Segment, locate the Endpoint section.
4
Find the End vertex subsection. Select the  Activate Selection toggle button.
5
On the object blk2, select Point 6 only.
6
Click  Build All Objects.
7
Click the  Wireframe Rendering button in the Graphics toolbar, and rotate the geometry to get a better view.
Block 3 (blk3)
1
In the Geometry toolbar, click  Block.
2
In the Settings window for Block, locate the Size and Shape section.
3
In the Width text field, type L.
4
In the Depth text field, type 2*R.
5
In the Height text field, type H.
Block 4 (blk4)
1
Right-click Block 3 (blk3) and choose Duplicate.
2
In the Settings window for Block, locate the Size and Shape section.
3
In the Depth text field, type H-6*R.
4
Locate the Position section. In the y text field, type 6*R.
5
Click  Build All Objects.
Now, create the final computational domain with a hollow cylinder.
Difference 1 (dif1)
1
In the Geometry toolbar, click  Booleans and Partitions and choose Difference.
2
Select the objects blk1 and blk2 only.
3
In the Settings window for Difference, locate the Difference section.
4
Find the Objects to subtract subsection. Select the  Activate Selection toggle button.
5
6
In the Geometry toolbar, click  Build All.
7
Click the  Wireframe Rendering button in the Graphics toolbar. The geometry looks like the following image.
Laminar Flow (spf)
1
Click the  Show More Options button in the Model Builder toolbar.
2
In the Show More Options dialog box, in the tree, select the check box for the node Physics>Stabilization.
3
4
In the Model Builder window, under Component 1 (comp1) click Laminar Flow (spf).
5
In the Settings window for Laminar Flow, click to expand the Consistent Stabilization section.
6
Find the Navier-Stokes equations subsection. Clear the Crosswind diffusion check box.
7
Click to expand the Discretization section. From the Discretization of fluids list, choose P2+P2. P2+P2 is used because it is more conservative and more accurate than P2+P1 and P1+P1.
Fluid Properties 1
1
In the Model Builder window, under Component 1 (comp1)>Laminar Flow (spf) click Fluid Properties 1.
2
In the Settings window for Fluid Properties, locate the Fluid Properties section.
3
From the ρ list, choose User defined. In the associated text field, type rho.
4
From the μ list, choose User defined. In the associated text field, type mu.
Inlet 1
1
In the Physics toolbar, click  Boundaries and choose Inlet.
2
3
In the Settings window for Inlet, locate the Velocity section.
4
In the U0 text field, type 36*U_mean*z*y*(H-y)*(H-z)/H^4*sin(pi*t/8[s]).
Here, 1/[s] is used to make the input of sin() dimensionless.
Outlet 1
1
In the Physics toolbar, click  Boundaries and choose Outlet.
2
Mesh 1
Use advanced operations such as Map and Sweep to create a hexahedral mesh.
Mapped 1
In the Mesh toolbar, click  Boundary and choose Mapped.
Size
1
In the Model Builder window, click Size.
2
In the Settings window for Size, locate the Element Size section.
3
From the Calibrate for list, choose Fluid dynamics.
4
From the Predefined list, choose Coarse.
Mapped 1
1
In the Model Builder window, click Mapped 1.
2
Distribution 1
1
Right-click Mapped 1 and choose Distribution.
2
3
In the Settings window for Distribution, click  Build Selected.
Distribution 2
1
Right-click Mapped 1 and choose Distribution.
2
3
In the Settings window for Distribution, locate the Distribution section.
4
From the Distribution type list, choose Predefined.
5
In the Element ratio text field, type 2.
6
From the Growth formula list, choose Geometric sequence.
Distribution 3
1
Right-click Mapped 1 and choose Distribution.
2
3
In the Settings window for Distribution, locate the Distribution section.
4
From the Distribution type list, choose Predefined.
5
In the Element ratio text field, type 2.
6
From the Growth formula list, choose Geometric sequence.
7
Click  Build All.
Mapped 2
1
In the Mesh toolbar, click  Boundary and choose Mapped.
2
Distribution 1
1
Right-click Mapped 2 and choose Distribution.
2
Distribution 2
1
In the Model Builder window, right-click Mapped 2 and choose Distribution.
2
3
In the Settings window for Distribution, locate the Distribution section.
4
From the Distribution type list, choose Predefined.
5
In the Number of elements text field, type 8.
6
In the Element ratio text field, type 3.
7
From the Growth formula list, choose Geometric sequence.
Distribution 3
1
Right-click Mapped 2 and choose Distribution.
2
3
In the Settings window for Distribution, locate the Distribution section.
4
From the Distribution type list, choose Predefined.
5
In the Number of elements text field, type 30.
6
In the Element ratio text field, type 6.
7
From the Growth formula list, choose Geometric sequence.
8
Select the Reverse direction check box.
Mapped 3
1
In the Mesh toolbar, click  Boundary and choose Mapped.
2
Distribution 1
1
Right-click Mapped 3 and choose Distribution.
2
3
In the Settings window for Distribution, locate the Distribution section.
4
From the Distribution type list, choose Predefined.
5
In the Element ratio text field, type 4.
6
From the Growth formula list, choose Geometric sequence.
Distribution 2
1
In the Model Builder window, right-click Mapped 3 and choose Distribution.
2
3
In the Settings window for Distribution, locate the Distribution section.
4
From the Distribution type list, choose Predefined.
5
In the Element ratio text field, type 4.
6
From the Growth formula list, choose Geometric sequence.
7
Select the Reverse direction check box.
Distribution 3
1
Right-click Mapped 3 and choose Distribution.
2
3
In the Settings window for Distribution, locate the Distribution section.
4
From the Distribution type list, choose Predefined.
5
In the Number of elements text field, type 43.
6
In the Element ratio text field, type 1.6.
7
From the Growth formula list, choose Geometric sequence.
Swept 1
In the Mesh toolbar, click  Swept.
Distribution 1
1
Right-click Swept 1 and choose Distribution.
2
In the Settings window for Distribution, locate the Distribution section.
3
From the Distribution type list, choose Predefined.
4
In the Number of elements text field, type 10.
5
In the Element ratio text field, type 4.
6
From the Growth formula list, choose Geometric sequence.
7
Select the Symmetric distribution check box.
8
Click  Build All.
The mesh in Figure 2 is now generated.
Study 1
Step 1: Time Dependent
1
In the Model Builder window, under Study 1 click Step 1: Time Dependent.
2
In the Settings window for Time Dependent, locate the Study Settings section.
3
In the Output times text field, type range(0,0.05,8).
4
From the Tolerance list, choose User controlled.
5
In the Relative tolerance text field, type 0.001.
Solution 1 (sol1)
Choose the generalized alpha method for the time stepping. It has less damping than the BDF.
1
In the Study toolbar, click  Show Default Solver.
2
In the Model Builder window, expand the Solution 1 (sol1) node.
3
In the Model Builder window, click Time-Dependent Solver 1.
4
In the Settings window for Time-Dependent Solver, click to expand the Time Stepping section.
5
From the Method list, choose Generalized alpha.
6
Select the Initial step check box.
7
8
From the Maximum step constraint list, choose Constant.
9
In the Study toolbar, click  Compute.
Evaluate the drag and lift coefficients.
Results
Surface 2
1
In the Results toolbar, click  More Datasets and choose Surface.
2
Integral 1
1
In the Results toolbar, click  More Datasets and choose Evaluation>Integral.
2
In the Settings window for Integral, locate the Data section.
3
From the Dataset list, choose Surface 2.
Point Evaluation 1
1
In the Results toolbar, click  Point Evaluation.
2
In the Settings window for Point Evaluation, locate the Data section.
3
From the Dataset list, choose Integral 1.
4
Locate the Expressions section. In the table, enter the following settings:
5
Click  Evaluate.
Table
1
Go to the Table window.
2
Click Table Graph in the window toolbar.
Table
1
Go to the Table window.
2
Click Table Graph in the window toolbar.
Plot the lift coefficient versus time as shown in Figure 4.
3
In the Model Builder window, click Table Graph 1.
4
In the Settings window for Table Graph, locate the Data section.
5
From the Plot columns list, choose Manual.
6
In the Columns list, select Lift coefficient (1), Integral 1.
Results
Lift coefficient
1
In the Model Builder window, under Results click 1D Plot Group 3.
2
In the Settings window for 1D Plot Group, type Lift coefficient in the Label text field.
3
Locate the Plot Settings section. Select the y-axis label check box.
4
Drag coefficient
Plot the drag coefficient versus time as shown in Figure 5.
1
Right-click Lift coefficient and choose Duplicate.
2
In the Settings window for 1D Plot Group, type Drag coefficient in the Label text field.
3
Locate the Plot Settings section. In the y-axis label text field, type c<sub>D</sub>.
Table Graph 1
1
In the Model Builder window, expand the Drag coefficient node, then click Table Graph 1.
2
In the Settings window for Table Graph, locate the Data section.
3
In the Columns list, select Drag coefficient (1), Integral 1.
4
In the Drag coefficient toolbar, click  Plot.
Point Evaluation 1
Evaluate the maximum and minimum of the coefficients.
Point Evaluation 2
1
In the Model Builder window, under Results>Derived Values right-click Point Evaluation 1 and choose Duplicate.
2
In the Settings window for Point Evaluation, locate the Data Series Operation section.
3
From the Operation list, choose Maximum.
4
Clicknext to  Evaluate, then choose New Table.
Table
Go to the Table window.
Point Evaluation 3
1
Right-click Point Evaluation 2 and choose Duplicate.
2
In the Settings window for Point Evaluation, locate the Expressions section.
3
4
5
Locate the Data Series Operation section. From the Operation list, choose Minimum.
6
Click  Evaluate (Table 2 - Point Evaluation 2).
Surface 3
1
In the Results toolbar, click  More Datasets and choose Surface.
2
Now, visualize the velocity field as shown in Figure 3.
Velocity (spf)
1
In the Model Builder window, click Velocity (spf).
2
In the Settings window for 3D Plot Group, locate the Color Legend section.
3
Clear the Show legends check box.
4
Locate the Plot Settings section. Clear the Plot dataset edges check box.
5
Locate the Data section. From the Time (s) list, choose 7.95. Since the inlet velocity vanishes at the final time step, the solution at t=7.95s is chosen for a better visualization of the streamlines.
Slice
Create a slice in the middle of the computational domain, parallel to the xy plane to see the flow pattern more clearly.
1
In the Model Builder window, expand the Velocity (spf) node, then click Slice.
2
In the Settings window for Slice, locate the Plane Data section.
3
From the Plane list, choose xy-planes.
4
In the Planes text field, type 1.
5
Locate the Coloring and Style section. From the Color table list, choose JupiterAuroraBorealis.
Deformation 1
Shift the slice back to the wall to get a better view.
1
Right-click Slice and choose Deformation.
2
In the Settings window for Deformation, locate the Expression section.
3
In the z component text field, type -0.205.
4
Locate the Scale section. Select the Scale factor check box.
5
Streamline 1
Create and add arrows to the streamlines.
1
In the Model Builder window, right-click Velocity (spf) and choose Streamline.
2
In the Settings window for Streamline, locate the Streamline Positioning section.
3
In the Number text field, type 10.
4
5
Locate the Coloring and Style section. Find the Line style subsection. From the Type list, choose Tube.
6
Select the Radius scale factor check box.
7
8
Find the Point style subsection. From the Type list, choose Arrow.
9
From the Color list, choose Custom.
10
11
Click Define custom colors.
12
13
Click Add to custom colors.
14
Click Show color palette only or OK on the cross-platform desktop.
Surface 1
1
Right-click Velocity (spf) and choose Surface.
2
In the Settings window for Surface, locate the Data section.
3
From the Dataset list, choose Surface 3.
4
Locate the Expression section. In the Expression text field, type 1.
5
Locate the Coloring and Style section. From the Coloring list, choose Uniform.
6
From the Color list, choose Gray.