ME C180 / CE C133 Spring 2019

8
ME C180 / CE C133 Spring 2019 Engineering Analysis using the Finite Element Method University of California, Berkeley, Spring 2019 Instructor: Sanjay Govindjee GSI: Linus Mettler Lab 6 In this lab you will perform a 2D computational fluid dynamics simulation of von K´ arm´ an vortex shedding of a flow over a cylinder. In the course of the lab you will - generate a 2D geometry and mesh - specify fluid properties, flow boundary conditions, solution parameters etc. in Ansys Fluent - examine the resulting velocity, pressure and vorticity using Ansys CFD Post No report is required to check off this lab - simply show a screen shot of the velocity profile as evidence of the observed vortex shedding. 1 Overview: von K´ arm´ an vortex street A von K´ arm´ an vortex street is a repeating pattern of swirling vortices arising in the wake of flows around blunt objects. This phenomenon is often exemplified on 2-dimensional flow around a cylinder. Vortex shedding is of practical interest as it exerts a (typically undesirable) cyclic load on the body (i.e. the cylinder). The phenomenon arises under certain flow conditions, expressed commonly by the dimen- sionless Reynolds number. Re = ρuL μ (1) where ρ is the density, u is a measure of velocity, L is the characteristic length and μ is the viscosity (with units of mass per length and time). For cylinders, vortex shedding is observed roughly in the range 10 2 < Re < 10 7 . For lower Reynolds numbers, the flow is laminar (i.e. no separation of flow) and for larger Reynolds numbers, the flow becomes increasingly turbulent. In other words, 1 Lab 6

Transcript of ME C180 / CE C133 Spring 2019

Page 1: ME C180 / CE C133 Spring 2019

ME C180 / CE C133 Spring 2019

Engineering Analysis using the Finite Element Method

University of California, Berkeley, Spring 2019Instructor: Sanjay Govindjee

GSI: Linus Mettler

Lab 6

In this lab you will perform a 2D computational fluid dynamics simulationof von Karman vortex shedding of a flow over a cylinder. In the course ofthe lab you will

− generate a 2D geometry and mesh− specify fluid properties, flow boundary conditions, solution parameters

etc. in Ansys Fluent− examine the resulting velocity, pressure and vorticity using Ansys CFD

Post

No report is required to check off this lab - simply show a screen shot of thevelocity profile as evidence of the observed vortex shedding.

1 Overview: von Karman vortex street

A von Karman vortex street is a repeating pattern of swirling vortices arising inthe wake of flows around blunt objects. This phenomenon is often exemplified on2-dimensional flow around a cylinder. Vortex shedding is of practical interest asit exerts a (typically undesirable) cyclic load on the body (i.e. the cylinder). Thephenomenon arises under certain flow conditions, expressed commonly by the dimen-sionless Reynolds number.

Re =ρuL

µ(1)

where ρ is the density, u is a measure of velocity, L is the characteristic length andµ is the viscosity (with units of mass per length and time).

For cylinders, vortex shedding is observed roughly in the range 102 < Re < 107.For lower Reynolds numbers, the flow is laminar (i.e. no separation of flow) and forlarger Reynolds numbers, the flow becomes increasingly turbulent. In other words,

1 Lab 6

Page 2: ME C180 / CE C133 Spring 2019

ME C180 / CE C133 Spring 2019

for given cylinder size and fluid properties, we need to tweak the flow velocity towithin the desired range of the corresponding Reynolds number in order to observevortices.

To describe fluid flow, we have to solve the Navier-Stokes equations. These equationsare derived from the balance of linear momentum as well as the constitutive relations(which describe the stress in terms of the velocity field of the fluid). For incompress-ible Newtonian fluids without external body forces the Navier-Stokes equations read

ρ(∂u

∂t+(∇u

)u)

= −∇p+ µ div(∇u

)(2)

div(u)

= 0 (3)

In equation [2] p is the pressure, ∇u is the velocity gradient. Equation [3] enforcesthe incompressibility condition.

2 CFD model

Create a new Ansys Workbench problem and select a fluid flow (fluent) block.

2.1 Geometry

We are modeling the 2D fluid region1 depicted in the following figure. Draw a sketchin DesignModeler and create a surface from sketches. The dimensions are given (inmeters) by D1 = 0.1, H2 = 0.4, H3 = 2, V4 = V5 = 0.4.

Figure 1: 2D fluid region around a solid cylinder.

1As before, this calls for the behavior of the geometry to be set to 2D

2 Lab 6

Page 3: ME C180 / CE C133 Spring 2019

ME C180 / CE C133 Spring 2019

2.2 Mesh

Due to the viscous nature of the fluid we will later apply a no-slip condition onthe surface of the cylinder. As a result, we expect the velocity gradient to be largearound the cylinder. Accordingly the mesh size should be small around the cylinder.However, due to the complex vortex flow field expected in the wake of the cylinder(to the right of the hole in figure 1) we need an overall mesh of reasonable quality.

As usual, it is up to you to play with the different mesh sizing tools available in AnsysMechanical. However, here are some recommendations you may want to follow: Usea combination of body sizing, edge sizing (around the cylinder) and inflation. Forexample, you could specify a partition length of 3mm around the cylinder (no bias).In addition, it is then useful to specify inflation (under mesh control) around the holeas to produce a clean mesh. In details of inflation select the entire face as geometry,pick the cylinder edge as boundary, set inflation option to first layer thickness, firstlayer height to 3mm, maximum layers to 20 and growth rate to 2. The resultingmesh is shown in figure 2.

Figure 2: Mesh of the 2D fluid region.

2.3 Named selections

Before passing the mesh on to Ansys Fluent, it is convenient to perform the followingsteps. Firstly, set the thickness of the surface body to zero. Secondly, create namedselections for all edges and rename them cylinder, wall (the top and bottom edges),inlet (left edge) and outlet (right edge). Recall that you can define named selec-tions either by RMB in the tree on model → insert → named selection, or by firstpicking edges and then RMB → create named selection. Don’t forget to rename theselections. Fluent will recognize these objects and predefine some of the boundaryconditions. Now exit Ansys Mechanical and in Workbench RMB mesh → update.

3 Lab 6

Page 4: ME C180 / CE C133 Spring 2019

ME C180 / CE C133 Spring 2019

2.4 Model setup

Double-click on setup to launch Fluent. A fluent launcher window appears. Checkthat the dimension is already set to 2D. Under options tick single precision, serialprocessing and click ok to open Fluent.

The Fluent GUI is similar to Mechanical in that it consists of a tree on the left, somefunctionality at the top and a large graphics window on the right. We’ll work ourway through the tree in order to define all relevant parameters.

Double-click general in the tree. Pick the transient solver and planar 2D space.Expand models and verify that we are using a viscous (laminar) model. Under ma-terials add liquid water by clicking on the fluent database, scrolling down to water-liquid and clicking copy and close. The density is ρ = 998.2 kg m−3 and viscosityµ = 0.001 003 kg m−1 s−1.

Having added water to the fluid materials, we need to change the material assigmentfor the surface body. Go to cell zone conditions → surface body (fluid) and changethe material name to water.

Now we will set the boundary conditions. In particular, we need to change wall →shear condition → specified shear → 0 (for both x and y components). This meansthat the fluid at the wall will flow horizontally without friction. We also specifyinlet → velocity magnitude → 0.002 m s−1. Question: What is the correspondingReynolds number under these conditions?

Lastly in reference values pick compute from → inlet. With this, we have completedthe model setup.

2.5 Solution

We now have to specify the solution parameters appropriate for our problem. Inmethods we select transient formulation → first order implicit.

Optional: In order to store output data in separate files, you can create for exam-ple report definitions → force report → lift on the cylinder. This will write the lift(vertical force on the cylinder) into a file at each time step. The file can be furtheredited under monitors → report files.

In initialization tick hybrid initialization and click on initialize.

4 Lab 6

Page 5: ME C180 / CE C133 Spring 2019

ME C180 / CE C133 Spring 2019

Under calculation activities specify the autosave frequency at which to save data.We are going to aim for 1000 time steps so pick a reasonably large value as to savedisk space (say, every 25 time steps). Optional: In solution animations you maywant to define a new animation object, for example in order to plot the velocity fieldat each iteration (in real-time during the calculation). However, this will slow downthe computation.

Lastly, double-click run calculation and choose 1000 steps at a time step of 5 s. Wecan now run the simulation.

2.6 Post-processing

To examine the results of our simulation it is more convenient to use CFD-Post,which launches upon double-clicking on results in Workbench.

We can now create contour plots of various variables by clicking the contour plot iconin the tool bar at the top. In details of the contour plot you should to choose domains→ surface body, locations → symmetry 1 and variable → velocity u, pressure, etc.Plot also the vorticity (that is, the curl of the velocity field, ∇× u) by clicking thebox (...) to the right of variable. A variable selector window pops up, where you willfind derived → vortex core → velocity.curl → velocity.curl z 2.

Similarly you can create vector plots, for example of the velocity field (click on theicon in the toolbar), or streamline plots (icon in toolbar). The vortices caused in thewake of the cylinder are clearly visible in all plots.

Legends to each plot have to be created separately. Also, there is a timestep selectoricon in the toolbar that allows plotting the results at different times, as well as ananimation icon to animate results.

Using the graph icon from the toolbar we can plot the lift coefficient (which weearlier specified under report definitions) with respect to time, by browsing to thecorresponding output file.

3 Selected results

The following images depict some results.

2Note that for 2D flows only the z-component of the vorticity vector will be non-zero.

5 Lab 6

Page 6: ME C180 / CE C133 Spring 2019

ME C180 / CE C133 Spring 2019

Figure 3: Velocity u (x-component of u).

Figure 4: Velocity v (y-component of u).

Figure 5: Pressure.

6 Lab 6

Page 7: ME C180 / CE C133 Spring 2019

ME C180 / CE C133 Spring 2019

Figure 6: Vorticity.

Figure 7: Velocity streamlines.

Figure 8: Velocity vector plot.

7 Lab 6

Page 8: ME C180 / CE C133 Spring 2019

ME C180 / CE C133 Spring 2019

Figure 9: Velocity vector plot (closeup).

Figure 10: Net lift and drag forces exerted on the cylinder as a function of time.

8 Lab 6