Tutorial Ansys Fluent [PDF]

  • 0 0 0
  • Gefällt Ihnen dieses papier und der download? Sie können Ihre eigene PDF-Datei in wenigen Minuten kostenlos online veröffentlichen! Anmelden
Datei wird geladen, bitte warten...
Zitiervorschau

Vortex Shedding 1. Introduction The purpose of this workshop is to introduce different techniques for transient flow modeling. You will study: • Selecting a suitable time step • Using custom-field-functions (CFF) • Generating Fast Fourier Transforms (FFT) • Auto-saving results during the simulation • Generating images during the simulation • Transient post-processing in CFD-Post

2. Prerequisites This tutorial assumes that you are already familiar with the ANSYS Workbench interface and its project workflow. This tutorial also assumes that you have completed the first workshop and that you are familiar with the ANSYS Fluent tree and ribbon structure. Some steps in the setup and solution procedure will not be shown explicitly.

3. Problem Description The case considered here is flow around a cylinder with a Reynolds number of 100. Vortex shedding will be observed. The workshop starts with a steady state analysis assuming that you did not anticipate this behavior.

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

1

Vortex Shedding

The computational domain was created in ANSYS DesignModeler and has the dimensions shown in the table: Name

Location

Dimension

Cylinder

D1

2 m (dia.)

Inlet Length

D2

20 m = 10 D

Outlet Length

D3

30 m = 15 D

Width

D4

40 m = 20 D

This workshop demonstrates iterative and non-iterative time advancement, Fast Fourier Transforms (FFT) and animations.

4. Setup and Solution 4.1. Starting Fluent and Loading a Mesh 1.

Copy the files (vortex-shedding-coarse.msh, fft-data-2000-timesteps.out, and vortexshedding-converged.cas/dat.gz) to your working folder.

2.

Start ANSYS Fluent.

Note This workshop shows how to set up the simulation in standalone Fluent and CFD-Post. You can set up the simulation in Workbench as shown in the other workshops.

3. 2

In the Fluent Launcher dialog box, select 2D under Dimension. Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

Setup and Solution 4.

Ensure that Display Mesh After Reading is enabled under Display Options.

5.

Click OK to open ANSYS Fluent.

Note IF HPC licenses are available, you can select Parallel under Processing Options and enter the number of processes.

6.

Load the mesh, vortex-shedding-coarse.msh. File → Read → Mesh...

4.2. Setting Up Domain 1.

Scale the mesh. Setting Up Domain → Mesh → Transform → Scale... a.

In the Scale Mesh dialog box, select Specify Scaling Factors from the Scaling group box.

b.

In the Scaling Factors group box, enter 0.5 for X and Y.

c.

Click Scale.

Note Ensure that you click Scale only once.

d. 2.

Close the Scale Mesh dialog box.

Check the mesh. Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

3

Vortex Shedding Setting Up Domain → Mesh → Check

Note Ensure that the minimum volume is not negative as ANSYS Fluent cannot begin a calculation when this is the case.

3.

Review the mesh quality. Setting Up Domain → Mesh → Quality ANSYS Fluent will report the results of the mesh quality below the results of the mesh check in the console.

Note The quality of the mesh plays a significant role in the accuracy and stability of the numerical computation. Checking the quality of your mesh is therefore an important step in performing a robust simulation. Minimum cell orthogonality is an important indicator of mesh quality. Values for orthogonality can vary between 0 and 1, with lower values indicating poorer quality cells.

4.

Display the mesh once scaling has been performed. Setting Up Domain → Mesh → Display...

4

a.

In the Mesh Display dialog box, click Display.

b.

Close the Mesh Display dialog box.

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

Setup and Solution

4.3. Setting Up Physics In the steps that follow, you will select a solver and specify physical models, material properties, and zone conditions for your simulation using the Setting Up Physics ribbon tab. 1.

In the Solver group of the Setting Up Physics ribbon tab, retain the default selection of the Steady, Pressure-Based solver. Setting Up Physics → Solver

2.

Retain the default selection of Laminar from the Model selection list in the Viscous Model dialog box. Setting Up Physics → Models → Viscous...

3.

Change the properties of the default material, air. Setting Up Physics → Materials → Create/Edit...

In the Create/Edit Materials dialog box, the material selected is air. a.

Enter 1 for Density (kg/m3).

b.

Enter 0.01 for Viscosity (kg/m-s).

c.

Click Change/Create and close the Create/Edit Materials dialog box.

Note Later, you will compare the Fluent results with those from a literature search. You have changed to non-default values of the material properties for air to aid that comparison.

4.

In the Setting Up Physics tab, click Boundaries (Zones group) and select All from the drop-down list. Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

5

Vortex Shedding Setting Up Physics → Zones → Boundaries → All a.

b.

In the Boundary Conditions task page, in the Zone list, double-click in.

i.

In the Velocity Inlet dialog box, enter 1 for Velocity Magnitude (m/s).

ii.

Click OK to close the Velocity Inlet dialog box.

Retain the default boundary conditions for out, sym1, sym2, and cylinder.

4.4. Solving the Steady State Solution In the steps that follow, you will set up and run the calculation, using the Solving ribbon tab. 1.

Create a point surface to monitor the air velocity. Postprocessing → Surface → Create → Point...

a.

6

In the Point Surface dialog box, enter 2 for x0 and 1 for y0, respectively.

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

Setup and Solution

2.

b.

Enable Point Tool to check the location of the point on the mesh.

c.

Enter monitor-pt for New Surface Name.

d.

Click Create.

e.

Clear the selection of Point Tool, and close the Point Surface dialog box.

Create a surface report definition to monitor the velocity at the point. Solving → Reports → Definitions → New → Surface Report → Vertex Average...

a.

In the Surface Report Definition dialog box, enter vertex-avg-vel for the Name.

b.

Under the Create group, enable Report File and Report Plot.

c.

Select Velocity... and Y Velocity from the Field Variable drop-down lists.

d.

Select monitor-pt from the Surfaces selection list.

e.

Click OK to save the surface report definition and close the Surface Report Definition dialog box. Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

7

Vortex Shedding 3.

Initialize the flow field using the Initialization group of the Solving ribbon tab. Solving → Initialization

4.

8

a.

Select Standard for Method.

b.

Click Options....

i.

In the Solution Initialization task page that opens, select in from the Compute from dropdown list.

ii.

Click Initialize.

Save the case and data files as 09_Vortex_Shedding-init.cas/dat.gz.

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

Setup and Solution File → Write → Case & Data...

Note Adding the .gz extension will compress the case and data files, reducing hard disk usage. Fluent can read in these compressed files. You do not need to manually uncompress them.

5.

Calculate the solution. Solving → Run Calculation a.

Enter 400 for No. of Iterations.

b.

Click Calculate.

Note You have tried to solve this vortex-shedding problem in a steady-state manner. You can see from the monitors that the solution is not converging, and the monitor shows a regular periodic behavior.

6.

Display velocity vectors. Postprocessing → Graphics → Vectors → Edit... a.

In the Vectors dialog box, retain the default settings and click Display.

Note Since this is a 2D simulation, you do not need to select any surface. Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

9

Vortex Shedding

As you can see from the vectors, the steady state solution is asymmetric, which is not physical. b. 7.

Close the Vectors dialog box.

Save the case and data files (09_Vortex_Shedding-steady.cas/dat.gz). File → Write → Case & Data...

4.5. Solving the Transient Solution To obtain a more realistic solution to this problem, you will solve it again, but in a transient (time dependent) manner. 1.

Change the Time option to Transient. Setting Up Physics → Solver

2.

Change the pressure-velocity coupling scheme. Solving → Solution → Methods...

Note For the transient scheme, the default pressure-velocity coupling (SIMPLE) may require more iterations to converge than other available choices.

10

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

Setup and Solution

3.

a.

In the Solution Methods task page, select PISO from the Scheme drop-down list.

b.

Select Bounded Second Order Implicit from the Transient Formulation drop-down list.

Change the under-relaxtion factors. Solving → Controls → Controls...

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

11

Vortex Shedding

4.

a.

In the Solution Controls task page, enter 0.7 for Pressure.

b.

Retain the default settings for the rest.

Change the surface monitor definition. Solution →

12

Report Plots → vertex-avg-vel-rplot

Edit...

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

Setup and Solution

5.

a.

In the Edit Report Plot dialog box, select time-step from the drop-down list below Get Data Every.

b.

This sets the X-Axis Label selection to flow-time.

c.

Click OK to set and close the Edit Report Plot dialog box.

Edit the residuals monitor. Solving → Reports → Residuals...

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

13

Vortex Shedding

a.

In the Residual Monitors dialog box, enter 100 for Iterations to Plot.

Note This will make the residuals scroll across the plot, making it easier to see the current time step.

b. 6.

Click OK to close the Residual Monitors dialog box.

Save the case and data files, as 09_Vortex_Shedding-transient.cas/dat.gz. File → Write → Case & Data...

7.

Start the calculation.

Note There are different ways to identify a suitable time step size for this problem. • One way is to do a hand-calculation to see how long it takes for the flow to pass through a typical grid cell. Run using this value for the time-step, and check that convergence occurs in less that 20 iterations per time step. • Another approach is to determine the characteristic response of the system. By performing a literature search, you can determine that the Strouhal number will be approximately 0.165 at this Reynolds number. From this, you can predict the period of the oscillation:

14

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

Setup and Solution

For each oscillation cycle, you will aim to solve 60 time steps, Hence you will run the solver using a time step size of 0.1s.

Solving → Run Calculation a.

Click Advanced....

b.

In the Run Calculation task page, enter 0.1 for Time Step Size (s).

c.

Enter 120 for Number of Time Steps.

d.

Enable Extrapolate Variables.

Note The Extrapolate Variables option will speed up convergence. Without this option, each time step would start with the solution at the previous time step. This option Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

15

Vortex Shedding provides a better starting point for the new time step, based on how the solution is changing with time. Notice that, as the solver runs, convergence is attained in 5-10 iterations at each time step.

e.

Click Calculate.

Note Do not click on any option in the Calculate dialog box that appears.

8.

Save the transient case and data files. File → Write → Case & Data...

Note If you add the string %t to the filename (09_Vortex_Shedding-transient-%t.gz), then Fluent will append the current time value to the filename. This file just contains the results at the current time step. If you require interim results as the solution progresses, use the Autosave feature prior to running the model. Although you now have simulated a couple of oscillations, in order to obtain a true representation of the vortex shedding, you need to simulate many more cycles. With each cycle, the ‘starting position’ converges with time until eventually all cycles are identical.

16

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

Setup and Solution It will take many cycles to achieve this, so you are provided with case and data files that have already been converged (simulation time of 84 seconds). You will then run this for a further couple of cycles to extract the details of the fluctuating flow patterns.

4.6. Using the Non Iterative Time Advancement Method 1.

You can run for 720 more time steps, or read the supplied case and data file, 09_Vortex_Shedding_Converged.cas/dat.gz. File → Write → Case & Data...

2.

Enable the Non Iterative Time Advancement Method (NITA). Solving → Solution → Methods...

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

17

Vortex Shedding a.

In the Solution Methods task page, enable Non-Iterative Time Advancement.

Note NITA is an algorithm used to speed up the transient solution process. NITA runs about twice as fast as the iterative time advancement (ITA) scheme.

b.

From the Scheme drop-down list select Fractional Step.

Note Two sub-types of NITA schemes are available: • PISO (NITA/PISO) • Fractional Step method (NITA/FSM). Computationally, this is about 20% cheaper than NITA/PISO on a per time-step basis.

3.

Define custom field functions. User-Defined → Field Functions → Custom...

Note One of the ways of quantifying the wake vortices is through the use of the ‘Q-Criterion’. The formula for this is below. It is not a standard quantity computed by Fluent for laminar flows, however since the formula is known, you can ask Fluent to compute it at each grid cell.

18

a.

In the Custom Field Function Calculator dialog box, select Derivatives... and dX-Velocity/dx from the Field Functions drop-down lists.

b.

Click Select.

c.

Click the X button.

d.

Retaining the selection of Derivatives..., select dY-Velocity/dy from the Field Functions drop-down lists, and click Select.

e.

Click the − button.

f.

Select dX-Velocity/dy and click Select.

g.

Click the X button.

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

Setup and Solution

4.

h.

Select dY-Velocity/dx and click Select.

i.

Enter q-criterion for New Function Name and click Define.

j.

Close the Custom Field Function Calculator dialog box.

Save interim results. Solving → Activities → Autosave...

Note Unless specifically requested, Fluent will not save interim results during a transient simulation. It is possible, however, to save the results data every (n) time steps to disk. This will give a collection of files that can be post-processed at a later date, either using Fluent or CFD-Post. However, having to load in a large number of files can be time consuming.

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

19

Vortex Shedding

a.

In the Autosave dialog box, enter 5 forSave Data File Every (Time Steps).

b.

Enter 09_Vortex_Shedding-transient-detail.gz for File Name.

c.

Retain the selection of time-step from the Append File Name with drop-down list.

Note The file name will be appended with the current time step.

d. 5.

Click OK to close the Autosave dialog box.

Save every other image. Solving → Activities → Create → Solution Animations

Note One alternative to saving interim results is to extract the required result (like an image from which to build an animation) from Fluent during the solution process. Since all the data is in memory at that instant, this is very quick to perform.

20

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

Setup and Solution

a.

In the Solution Animation dialog box, enter 1 for Animation Sequences.

b.

Enter 2 for Every.

c.

Select Time Step from the When drop-down list.

d.

Click Define.... i.

In the Animation Sequence dialog box that opens, enter 3 for Window and click Set next to it.

ii.

Select Contours from the list of Display Type.

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

21

Vortex Shedding A.

In the Contours dialog box, enable Filled and disable Auto Range from the list of Options.

B.

Select Custom Field Functions... and q-criterion from the Contours of drop-down lists.

C.

Enter 0.1 for Min and 1.25 for Max, respectively.

D.

Click Display and close the Contours dialog box.

Zoom in to set the display. iii. e. 6.

Click OK to close the Animation Sequence dialog box.

Close the Solution Animation dialog box.

Save the case and data files, as 09_Vortex_Shedding-NITA.cas/dat.gz. File → Write → Case & Data...

7.

Start the calculation. Solving → Run Calculation a.

Enter 0.05 for Time Step Size (s).

b.

Enter 240 for No. of Time Steps.

Note This corresponds to roughly 2 periods.

22

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

Setup and Solution c.

Click Calculate.

Note Do not click on any option in the Calculate dialog box that appears.

8.

Run the animation. Postprocessing → Animation → Solution Playback...

a.

In the Playback dialog box, click the play button

to review the animation.

b.

You can select MPEG from the Write/Record drop-down list and click Write to save the animation. The Animation Playback tool can also be used to generate a sequence of picture frames.

Note If you are running Fluent in Workbench, the the .mpeg file from the animation sequence is written in the Workbench project directory. a.

To locate the file in Workbench, select Files in the Workbench View menu. View → Files

c. 9.

b.

Locate the file sequence-1.mpeg in the list of Files.

c.

Right-click on sequence-1.mpeg and select Open Containing Folder from the context menu.

d.

The folder which opens shows the file sequence-1.mpeg. The .mpeg file can be played in Windows Media Player or similar programs.

Close the Playback dialog box after checking the animation.

Check the FFT plot. Postprocessing → Plots → FFT... a.

In the Fourier Transform dialog box, select Magnitude from the Y Axis Function drop-down list. Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

23

Vortex Shedding b.

Select Strouhal Number from the X Axis Function drop-down list.

c.

Click Load Input File... and select the file fft-data-2000-timesteps.out.

d.

Click Axes....

e.

24

i.

In the Axes - Fourier Transform dialog box, select X from the Axis list.

ii.

Clear Auto Range from the list of Options.

iii.

In the Range group box, enter 0.05 for Minimum and 1 for Maximum, respectively.

iv.

Click Apply and close the Axes - Fourier Transform dialog box.

Click Plot FFT and close the Fourier Transform dialog box.

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

Setup and Solution

Note The peak Strouhal number is 0.171, which is close to the value of 0.165 that was suggested by the literature search. To extract the exact peak value from this graph, enable Write FFT to File and click Write FFT. Then look at the text file on disk. The second peak is a harmonic as the input signal is not perfectly sinusoidal.

10. Exit Fluent. File → Close Fluent

4.7. Displaying Results in CFD-Post 1.

Start CFD-Post.

2.

Create an animation.

Note Animations done in CFD-Post can be based on all the data files already saved. Thus, you can create animations of anything after the calculation is finished. File → Load Results...

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

25

Vortex Shedding

3.

26

a.

In the Load Results File dialog box, select the data file from the last time step.

b.

Select Load Complete history as: and A single case from the Run history and multi-configuration options group box.

c.

Click Open.

Draw velocity vectors. a.

Click the vector button

in the toolbar.

b.

Retain the default name Vector 1, in the Insert Vector dialog box, and click OK.

c.

In Details of Vector 1, select symmetry 1 from the Locations drop-down list.

d.

Click Apply.

e.

Click on the Z axis of the triad to align the view

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

Setup and Solution

4.

Create an animation. a.

Open the Timestep Selector dialog box by clicking on the Timestep Selector icon toolbar.

b.

In the Timestep Selector dialog box, click on the Animate timesteps icon i.

In the Animation dialog box that opens, click the Pay button the saved steps.

on the

.

, for a quick animation of all

Note To save the animation file, enable Save Movie, enter a name next to it and then click Pay

ii.

.

Close the Animation dialog box after viewing the animation.

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

27

Vortex Shedding c.

Close the Timestep Selector dialog box.

Note If you want, you can save the state file (09_Vortex_Shedding.cst) in your working directory. File → Save State As.... The state file stores all the post-processing settings you have created. The next time you start CFD-Post, you can go to File → Load State... and it will automatically load all the results files and recreate all the graphics objects and views you have created during this session. You will also be asked if you would like to save the animation state 09_Vortex_Shedding.can file.

5.

Close CFD-Post.

5. Summary In this workshop you were interested in calculating flow around a cylinder, and assessing the vortex shedding frequency. You checked with FFT analysis that the predicted frequency is in good agreement with results from literature. This workshop has shown the basic steps that are applied in all CFD simulations: • Setting boundary conditions and solver settings • Running steady and transient models • Using iterative and non-iterative time advancement schemes • Post-processing the results, both in Fluent and CFD-Post for transient cases

6. Further Improvements If you would like to experiment further with this example, you could check: Mesh independence • Check that results do not depend on mesh • Re-run simulations with finer mesh(es) – Generated in meshing application – From adaptive meshing in Fluent Reynolds number effects You can investigate other flow patterns by changing the Reynolds number. • For lower Reynolds numbers, steady state, laminar analysis is possible.

28

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

References • For increasing Reynolds numbers, unsteady transitional turbulent models (k-kl-omega, Transition SST) have to be considered • For Reynolds numbers above 3.5×106, the standard or SST k-omega turbulence models would be used

7. References • Braza, M., Chassaing, P., and Minh, H.H., Numerical Study and Physical Analysis of the Pressure and Velocity Fields in the Near Wake of a Circular Cylinder, J. Fluid Mech., 165:79-130, 1986. • Coutanceau, M. and Defaye, J.R., Circular Cylinder Wake Configurations - A Flow Visualization Survey, Appl. Mech. Rev., 44(6), June 1991. • Williamson, C.H.K,“Vortex Dynamics in The Cylinder Wake,” Annu. Rev. Fluid Mechanics 1996. 28:447539

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.

29

30

Release 17.0 - © SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information of ANSYS, Inc. and its subsidiaries and affiliates.