metu mechanical engineering department me 582 finite...

21
ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU Mechanical Engineering Department ME 582 Finite Element Analysis in Thermofluids Spring 2018 (Dr. C. Sert) Handout 17 – COMSOL 1 Tutorial 4 This fourth COMSOL tutorial is about the solution of flow over a cylinder. Problem domain is a 30x10 rectangular box with a circular hole of diameter 1. It is the same problem solved as Example 6.1 of Handout 16 with one difference. Here the top and bottom walls are assigned a special slip type BC, instead of sliding wall. Fluid enters the domain with a uniform speed of . Flow is incompressible and the exit pressure is set to a reference pressure of zero. To do this the exit boundary need to be located far away from the cylinder so that the effect of cylinder’s wake vanishes at the exit. The value of the exit pressure is not important because for incompressible flows pressure has no thermodynamic meaning. It is just a variable that adjust itself inside the flow domain such that the velocity field remains divergence free, i.e. mass is conserved. If instead of setting the exit pressure to zero, we set it to 100 Pa, all computed pressures would be 100 Pa higher and the velocity field would not be affected by this change. To simulate the case of a cylinder placed inside uniform flow, top and bottom boundary conditions are set as “slip”, meaning that these boundaries apply no shear force on the flow. This way we minimize the undesired wall effects. No-slip boundary condition is used on the cylinder itself. The problem is governed by the following Reynolds number = For small values (< 50) flow remains steady and becomes time periodic for higher values. We’ll simulate two cases; = 40 and = 100. For both cases we’ll use =1 and =1, and use two different inlet speeds as = 40 and = 100. Warning: It is possible to use a real fluid, such as water or air, and its properties. But the only important parameter in this problem is the Reynolds number, and as long as you set it to the desired value, it does not matter how you do it. 1 COMSOL 5.3a is used to prepare this tutorial = =0 (0,0) =1, Center: (5,5) No-slip (30,10) Slip Slip =0

Upload: others

Post on 30-Mar-2020

6 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-1

METU Mechanical Engineering Department ME 582 Finite Element Analysis in Thermofluids

Spring 2018 (Dr. C. Sert) Handout 17 – COMSOL1 Tutorial 4

This fourth COMSOL tutorial is about the solution of flow over a cylinder. Problem domain is a 30x10 rectangular box with a circular hole of diameter 1. It is the same problem solved as Example 6.1 of Handout 16 with one difference. Here the top and bottom walls are assigned a special slip type BC, instead of sliding wall.

Fluid enters the domain with a uniform speed of 𝑈𝑜. Flow is incompressible and the exit pressure is set to a reference pressure of zero. To do this the exit boundary need to be located far away from the cylinder so that the effect of cylinder’s wake vanishes at the exit. The value of the exit pressure is not important because for incompressible flows pressure has no thermodynamic meaning. It is just a variable that adjust itself inside the flow domain such that the velocity field remains divergence free, i.e. mass is conserved. If instead of setting the exit pressure to zero, we set it to 100 Pa, all computed pressures would be 100 Pa higher and the velocity field would not be affected by this change.

To simulate the case of a cylinder placed inside uniform flow, top and bottom boundary conditions are set as “slip”, meaning that these boundaries apply no shear force on the flow. This way we minimize the undesired wall effects. No-slip boundary condition is used on the cylinder itself.

The problem is governed by the following Reynolds number

𝑅𝑒 =𝜌𝑈𝑜𝐷

𝜇

For small 𝑅𝑒 values (< 50) flow remains steady and becomes time periodic for higher values.

We’ll simulate two cases; 𝑅𝑒 = 40 and 𝑅𝑒 = 100. For both cases we’ll use 𝜌 = 1 and 𝜇 = 1, and use two different inlet speeds as 𝑈𝑜 = 40 and 𝑈𝑜 = 100.

Warning: It is possible to use a real fluid, such as water or air, and its properties. But the only important parameter in this problem is the Reynolds number, and as long as you set it to the desired value, it does not matter how you do it.

1 COMSOL 5.3a is used to prepare this tutorial

𝑢 = 𝑈𝑜 𝑣 = 0

(0,0)

𝑥

𝑦

𝐷 = 1, Center: (5,5) No-slip

(30,10) Slip

Slip

𝑝 = 0

Page 2: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-2

Step 1. Start COMSOL.

Press Model Wizard.

Select 2D.

Select Fluid Flow – Single Phase Flow – Laminar Flow (spf).

Press the Add button.

Press the Study button.

Select Stationary.

Press the Done button.

Step 2a. Right click Geometry 1 and select Rectangle.

Set the width and the height of the rectangle as follows

Click Build Selected.

Step 2b. Right click Geometry 1 and select Circle.

Set its radius and the center coordinates as follows

Click Build Selected.

Step 2c. Right click Geometry 1 and select Booleans and Partitions -> Difference.

For the “Objects to Add”, select the rectangle.

Activate “Objects to subtract” and select the circle.

Click Build Selected.

You should see the problem domain as a rectangle with a circular hole in it.

Page 3: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-3

Step 3. Under Laminar Flow (spf) and select Fluid Properties 1 and set the density and viscosity of the fluid to 1.

Step 4a. By default, all boundaries are set as no slip wall. Let’s change them.

Right click Laminar Flow (spf) and select Inlet.

Select the inlet boundary with the mouse.

Set the inlet speed to 40.

Step 4b. Right click Laminar Flow (spf) and select Outlet.

Select the outlet boundary with the mouse.

The default outlet BC type is pressure and the default value of outlet pressure is zero. Do not change them.

Important: If you expand the “Equation” part of “Outlet 1” BC, you’ll see the following general equation, which is the same as the traction (Neumann) BC that we studied in our lectures.

The term in the bracket is the total stress tensor �̿�. At an outlet boundary, we specify the traction force, i.e. dot product of the total stress tensor and the unit normal vector (�̿� ⋅ �⃗� ), as seen on the left hand side of the following equation.

For a 2D flow in the 𝑥𝑦 plane, the left hand side of this equation is

Page 4: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-4

{

[−𝑝 00 −𝑝

] + 𝜇

(

[ 𝜕𝑢

𝜕𝑥

𝜕𝑢

𝜕𝑦𝜕𝑣

𝜕𝑥

𝜕𝑣

𝜕𝑦]

+

[ 𝜕𝑢

𝜕𝑥

𝜕𝑣

𝜕𝑥𝜕𝑢

𝜕𝑦

𝜕𝑣

𝜕𝑦]

)

}

⋅ �⃗� =

[ −𝑝 + 2𝜇

𝜕𝑢

𝜕𝑥𝜇 (𝜕𝑢

𝜕𝑦+𝜕𝑣

𝜕𝑥)

𝜇 (𝜕𝑢

𝜕𝑦+𝜕𝑣

𝜕𝑥) −𝑝 + 2𝜇

𝜕𝑣

𝜕𝑦 ]

⋅ �⃗�

Taking the dot product gives the following traction force components at a boundary

𝑡𝑥 = (−𝑝 + 2𝜕𝑢

𝜕𝑥) 𝑛𝑥 + 𝜇 (

𝜕𝑢

𝜕𝑦+𝜕𝑣

𝜕𝑥)𝑛𝑦

𝑡𝑦 = 𝜇 (𝜕𝑢

𝜕𝑦+𝜕𝑣

𝜕𝑥)𝑛𝑥 + (−𝑝 + 2

𝜕𝑣

𝜕𝑦)𝑛𝑦

At the outlet boundary of our problem 𝑛𝑥 = 1, 𝑛𝑦 = 0, and the traction force components become

𝑡𝑥 = (−𝑝 + 2𝜕𝑢

𝜕𝑥) , 𝑓𝑦 = 𝜇 (

𝜕𝑢

𝜕𝑦+𝜕𝑣

𝜕𝑥)

When we specify a constant pressure at an outlet boundary, we assume that 𝜕𝑢

𝜕𝑥= 0 ,

𝜕𝑢

𝜕𝑦= 0 and

𝜕𝑣

𝜕𝑥= 0 at the

outlet. Under these conditions 𝑓𝑥 = −𝑝, which is the negative of the pressure that we specify, and 𝑓𝑦 = 0. To

achieve such a condition, i.e. to have vanishing derivatives of the velocity components, the outlet boundary need to be placed far away from the cylinder. The question “How far is enough?” is not easy to answer.

Step 4c. Right click Laminar Flow (spf) and select Wall.

Select top and bottom boundaries of the rectangle.

Set the Wall condition to Slip.

Important: Slip wall condition sets the traction force component parallel to the boundary to zero. For walls that are parallel to the 𝑥 axis, this means 𝑡𝑥 = 0. Using the 𝑡𝑥 expression derived above and using 𝑛𝑥 = 0 and 𝑛𝑦 = ∓1 (+1 for the upper wall and -1 for the lower wall), slip wall condition becomes

𝑡𝑥 = 𝜇 (𝜕𝑢

𝜕𝑦+𝜕𝑣

𝜕𝑥)

⏟ Shear stress

(∓1) = 0 → 𝜕𝑢

𝜕𝑦+𝜕𝑣

𝜕𝑥= 0

which is nothing but setting the shear stress exerted by the wall on the fluid to zero. This is what slip wall means, fluid can slip over it freely. It is important to understand that fluid can pass across a slip wall boundary.

Question: How can this slip BC be implemented in practice? At those boundaries we set 𝑡𝑥 = 0, but what about 𝑡𝑦? With 𝑛𝑥 = 0, and 𝑛𝑦 = ∓1, 𝑡𝑦 becomes

𝑡𝑦 = (−𝑝 + 2𝜕𝑣

𝜕𝑦) (∓1)

which is not known directly. Can we use the results of the previous iteration to calculate 𝑡𝑦 and use it to specify

an NBC?

Page 5: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-5

Step 5. Select Mesh 1 and by using the default settings (Physics-controlled mesh and Normal mesh size) press Build All.

The following mesh with 2462 elements will be generated. The mesh is automatically fine around the cylinder.

A close up view of the mesh is as follows. As seen, two layers of structured quadrilateral elements are used around the cylinder, known as the boundary layer mesh. All other elements are triangular.

Page 6: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-6

Step 6. Select Study 1 and press Compute.

The solution will finish in a couple of seconds.

The following convergence plot will be generated (which is probably hidden behind the Graphics tab).

Navier-Stokes equations are nonlinear and this is the convergence plot of the nonlinear solution. Error drops to 10−4 in 13 iterations.

To Do: Read COMSOL’s documentation for the definition of the “Error” that is plotted above.

Page 7: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-7

The default plot generated is the following velocity magnitude contour.

Inlet speed is set as 40 and above and below the cylinder we see values higher than this, i.e. the flow accelerates as it goes over the cylinder, as expected.

Zoomed in view of this plot is given below.

There is a stagnation point with zero speed on the front of the cylinder. Also there is a low speed wake region behind it.

Page 8: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-8

Step 7. To see the pressure field, click Pressure (spf) under Results.

Pressure contours will be shown as lines.

Zoomed in view is the following. Stagnation point has the highest pressure, which is above 1000 Pa, as seen from the legend of the contour plot. Note that this pressure is with respect to the zero pressure that we specified at the outlet. Pressure distribution is symmetric on the upper and lower parts of the cylinder.

To change this to a “filled” contour plot, select Contour under Pressure (spf) and change Contour type to Filled.

Pres Plot.

Page 9: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-9

Step 8. It is possible to have a look at the 2D contours plots as 3D by giving them a height.

Right click Contour under Pressure (spf) and select Height Expression.

It is easier to understand the changes in pressure in this view. Rotate the 3D plot and zoom in to see the details of the pressure variation. Note the double suction peaks behind the cylinder.

Important: Also note the pressure build up in front of the cylinder, which results in a non-uniform pressure variation at the inlet boundary. This is a warning about the inflow boundary not being placed far enough from the cylinder to simulate a cylinder in uniform flow.

Important: After a certain distance behind the cylinder, pressure becomes uniform, which is a sign of fully developed flow condition. This is good news as far as the validity of specifying constant pressure at the outlet boundary is concerned.

To go back to the previous 2D view, right click Height Expression 1 under Contour and Disable it.

Page 10: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-10

To see the velocity magnitude contour in 3D, right click Surface under Velocity (spf) and select Height Expression.

Acceleration and deceleration zones can be understood better in this view.

Warning: As seen in the zoomed-in figures given below, there are some oscillations right behind the cylinder and right before the exit. These can be seen as a sign of the mesh used in these regions not being fine enough. Remember that we used the default settings in generating the mesh.

Page 11: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-11

Step 9. Let’s plot streamlines.

First, disable the Height Expression under Velocity (spf) – Surface.

Right click Velocity (spf) and select Streamline.

Select the inlet boundary to release the streamlines.

By default, 20 streamlines starting from the inlet boundary will be shown.

Streamlines in the wake region are not seen in this view. We need to place them individually.

Right click Velocity (spf) and select Streamline.

Change the settings as follows to put a single streamline starting from point (5.5, 5.1).

The additional streamline is show below. You can place several such streamlines by providing their starting coordinates separated by commas. This view is a bit misleading about the symmetry of the flow field, may be due to the coarse mesh used. Also remember that streamlines are not directly solved variables, but rather extra post processing features and their calculation involve extra errors. You can make them more accurate and look more smooth by changing their “Quality” properties.

Note that to see the streamline in the wake region better, I removed the contour plot by right clicking Surface under Velocity (spf) and selecting Disable.

Important: Streamlines are almost parallel to the top and bottom boundaries of the problem domain, where slip BC is specified. Actually slip BC allows mass transfer across, but in our case top and bottom boundaries seem to be selected far away from the cylinder and mass flow across them are almost zero.

Page 12: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-12

Step 10a. Let’s create a line along the 𝑦 = 5 line and plot the variation of pressure and 𝑥 velocity component along it.

Right click Data Sets under Results and select Cut Line 2D.

Set the start and end coordinates of the line as follows.

Press Plot to see the line.

Step 10b. To plot something along this line right click Results and select 1D Plot Group. A new item called 1D Plot Group 1 will be generated.

Right click on the newly generated 1D Plot Group 1 and select Line Graph.

Change the y-Axis Data to u, which is the 𝑥 velocity component.

By default the quantity to be plotted is set to spf.U, which is the 𝑥 velocity component. Do not change it.

Press Plot.

This is the variation of the 𝑥 velocity component along the 𝑦 = 5 horizontal line. Starting from the inlet speed of 40 it drops to zero at the stagnation point in front of the cylinder. No values are shown over the cylinder. In the wake region there is recirculation part, where we see negative values. This part extends up to about 𝑥 = 7.2. Therefore the recirculation bubble has a length of roughly 7.2 – 5.5 = 1.7. After the recirculation region, velocity recovers and reaches a value of 32 at the exit.

Page 13: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-13

Step 10c. Let’s also plot the variation of the pressure along this horizontal line.

To see both 𝑢 and 𝑝 on the same plot (which is not necessarily a god idea) let’s create a second vertical axis.

Select 1D Plot Group 1 and check Two y-axes.

Right click 1D Plot Group 1 and select Line Graph.

Change the y-Axis Data to p, which is the pressure.

Check Plot on secondary y-axis.

The result is the following.

The new pressure variation is shown in green color and its values are read from the new vertical axis located on the right. Pressure is zero at the outlet, because we set it that way. The maximum value is seen at the front stagnation point, which is about 1140 Pa. Pressure at the centerline of the inlet is about 200 Pa. Note again that all these pressure values are with respect to the zero reference value that we set at the outlet.

Warning: It is better to change the plot title and the axes names.

Page 14: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-14

Step 11a. Let’s calculate the mass flow rates at the 4 boundaries of the rectangle and check how good mass conservation is satisfied.

Right click Derived Values under Results and select Integration – Line Integration.

Select the inlet boundary with the mouse.

Change the Expression as follows. When we integrate this along a boundary we get the mass flow rate along that boundary per unit depth. Here spf.rho is the density of the fluid.

Change the Description as “m-dot (inlet)”.

Press Evaluate and the result will be shown in Table 1 as -400 kg/(ms).

This value is of course equal to

�̇�𝑖𝑛𝑙𝑒𝑡 = −𝜌𝑈𝑜(Inlet height) = −(1)(40)(10)

where the minus sign is due to the classical sign convention for mass flow rate (negative at inlets and positive at outlets).

Step 11b. To check mass conservation, let’s calculate flow rates at the other boundaries.

In Line Integration 1, deselect the inlet boundary and select the outlet boundary. Change the description to m-dot (outlet). Press Evaluate.

In Line Integration 1, deselect the outlet boundary and select the top boundary. Change the description to m-dot (top). Press Evaluate.

In Line Integration 1, deselect the top boundary and select the bottom boundary. Change the description to m-dot (bottom). Press Evaluate.

In Line Integration 1, select all 4 boundaries of the rectangle. Change the description to m-dot (all). Press Evaluate.

All 5 mass flow rates are shown below.

Outlet �̇� turns out to be identical as inlet. This is because flow rate from the top and bottom boundaries are very small.

The sum of all 4 mass flow rates is 0.015085, which is close enough to zero. For perfect mass conservation the sum should be zero. Note that in these calculation we also introduce some post-processing errors.

Page 15: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-15

Step 12a. Let’s plot the variation of 𝑢 velocity component along 6 vertical lines, namely 𝑥 = 4, 5, 6, 7, 8.

Right click Data Sets under Results and select Cut Line 2D.

Enter the end point coordinates of the lines as shown below.

To define all other 5 lines at once check Additional parallel lines and provide the Distances of them as shown.

Warning: distances need to entered as negative values to define lines on the right of the first line. This is probably due to the end point selections and corresponding normal definition of the first line.

Press Plot to see the lines.

Page 16: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-16

Step 12b. To plot the variation of 𝑢 along these lines right click Results and select 1D Plot Group.

Select the cut line we just generated as the Data set.

Select Flip the x- and y-axes because I want to see 𝑢 vs. 𝑦, not 𝑦 vs. 𝑢.

Right click 1D Plot Group 2 and select 1D Line Graph.

Change the Expression to u. Change the Legends as follows

Press Plot.

Note that the plot title, the axis names and the legend position are modified. The high speed zones above and below the cylinder and the low speed zone in the wake of the cylinder can be seen.

Page 17: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-17

Step 13a. Let’s calculate the drag force acting on the cylinder.

Right click Derived Values under Results and select Integration – Line Integration.

Select the 4 curves that form the cylinder with the mouse.

Press the Replace Expression button and select Model – Component 1 – Laminar Flow – Auxiliary Variables – Total Stress – spf.T_stressx. This is the x component of the total stress, integration of which along the cylinder will give the drag force per unit length of the cylinder.

Press Evaluate.

The result will be seen as -1443.5 N/m.

Warning: The result is negative because this is the force acting by the cylinder on the fluid. The drag force acting by the fluid on the cylinder is the opposite of this , i.e. ,in +𝑥 direction.

Drag coefficient can be calculated as

𝐶𝐷 =𝐹𝐷

12𝜌𝑈𝑜

2 𝜋𝐷2

4

=1443.5

12(1)(40)2

𝜋(1)2

4

= 2.3

which is consistent with the 𝐶𝐷 vs. 𝑅𝑒𝐷 plot of a cylinder that I found in my fluid mechanics textbook.

Page 18: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-18

Step 13b. Let’s perform a mesh independency analysis for the drag force by solving the problem with different meshes and calculating the drag force for each.

Element Size Setting

Number of elements

Drag Force (N/m)

Coarser 872 1495,6

Coarse 1666 1462,3

Normal 2462 1443.5

Fine 4798 1433.9

Finer 7214 1430.3

Extra Fine 11428 1429.0

Extremely Fine 43126 1426.4

Graphical representation of this data is as follows.

As the mesh is refined the drag force converges to a value around 1425 N/m. The difference between the first and the last solutions is

1495,6 − 1426,4

1426,4× 100% = 5 %

which is quite small, meaning that even the 872 element mesh can calculate an acceptable drag force for this very small Reynolds number flow.

Note: In my computer, the solution with the 43126 element “Extremely Fine” mesh takes about 10 seconds to calculate.

Warning: Here we use the built-in mesh settings of COMSOL, which is not the best way to generate a mesh. COMSOL’s naming strategy such as “Coarse”, “Normal”, “Fine”, etc. can be misleading. The figure on the right shows a portion of the “Extremely Fine” mesh. This also has two layers of boundary layer mesh, similar to the one shown earlier in Step 5. It is possible to control the generated mesh in many different ways, which will not be shown in this tutorial.

Number of cells

𝐹𝐷 [N/m]

Page 19: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-19

Step 14a. Let’s have a look at the Discretization and Stabilization used by COMSOL.

First click on the Show button and make sure that Discretization and Stabilization details are set as visible.

Select Laminar Flow (spf) and expand the Discretization part. By default, P1+P1 type discretization is selected, which corresponds to bilinear approximation for both velocity and pressure. Other options are available, such as P2+P1, which uses biquadratic approximation for velocity and bilinear approximation for pressure. So it is possible to use both equal order and non-equal order approximations for velocity and pressure.

As seen, COMSOL can use elements up to 3rd order for the solution of Navier-Stokes equations, but not higher.

Warning: As mentioned in COMSOL’s Help if you select an equal-order discretization, the streamline diffusion stabilization, that is discussed in the next page, should be activated.

Page 20: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-20

Step 14b. Select Laminar Flow (spf) and expand the Consistent Stabilization and Inconsistent Stabilization parts. By default, both the Streamline diffusion and Crosswind diffusion options are selected and the Isotropic diffusion is not selected.

Streamline diffusion is a type of GLS stabilization. It adds artificial diffusion in the streamline direction. In our lectures we studied crosswind diffusion as something that needs to be avoided, but here COMSOL presents it as an option to eliminate oscillations around discontinuities such as shock waves and other sharp gradients such as those in boundary layers especially seen with the use of relatively coarse meshes. It adds a controlled amount of artificial diffusion normal to the streamlines.

Isotropic diffusion is adding artificial diffusion equally in all directions, which introduces too much crosswind diffusion and therefore not suggested.

Let’s see what happens if we turn of all stabilization options.

Turn off both streamline diffusion and crosswind diffusion options.

Change the Element size setting to “Normal” and regenerate the mesh.

Solve the problem again.

Following figure compares the pressure contours around the cylinder with and without stabilization. With P1+P1 elements and with no stabilization the pressure field has spurious oscillations.

With stabilization Without stabilization

Page 21: METU Mechanical Engineering Department ME 582 Finite ...courses.me.metu.edu.tr/courses/me582/files/Handouts/Handout 17 - … · ME 582 – Handout 17 –COMSOL Tutorial 4 17-1 METU

ME 582 – Handout 17 –COMSOL Tutorial 4

17-21

But if we use P2+P1 discretization (unequal orders for velocity and pressure), we can again obtain the following smooth pressure contours without any stabilization.

Important: Stabilization is not used only for getting rid of spurious pressure oscillations when equal order discretization is used for velocity and pressure. As the Reynolds number gets higher, i.e. the problem becomes more advection dominated, it becomes more difficult to get a converged result with GFEM especially on relatively coarse meshes. Stabilization helps us to get solutions for high Reynolds number problems. Here the Reynolds number is 40, which is a very small value. For comparison, Reynolds number of 30 km/h wind flowing over a 9 cm diameter steel cable of a suspension bridge is

𝑅𝑒 =(8.33 m/s)(0.09 m)

1.5 × 10−5 m2/s= 50,000

Exercise: For Reynolds numbers higher than about 80 the flow becomes unsteady with a periodic Karman vortex street seen at the back of the cylinder. Try to simulate such a case. Define the drag force as a convergence monitor. Plot it during the solution and stop the solution when it begins to show time periodic oscillations. The frequency of the oscillations is used to define the non-dimensional Strouhal number. Calculate it and compare with the results available in the literature.

Without stabilization P2+P1