tutorial 4. modeling unsteady compressible flow

44
Tutorial 4. Modeling Unsteady Compressible Flow Introduction In this tutorial, FLUENT’s density-based implicit solver is used to predict the time- dependent flow through a two-dimensional nozzle. As an initial condition for the transient problem, a steady-state solution is generated to provide the initial values for the mass flow rate at the nozzle exit. This tutorial demonstrates how to do the following: Calculate a steady-state solution (using the density-based implicit solver) as an initial condition for a transient flow prediction. Define an unsteady boundary condition using a user-defined function (UDF). Use dynamic mesh adaption for both steady-state and transient flows. Calculate a transient solution using the second-order implicit unsteady formulation and the density-based implicit solver. Create an animation of the unsteady flow using FLUENT’s unsteady solution ani- mation feature. Prerequisites This tutorial assumes that you are familiar with the menu structure in FLUENT and that you have completed Tutorial 1. Some steps in the setup and solution procedure will not be shown explicitly. Problem Description The geometry to be considered in this tutorial is shown in Figure 4.1. Flow through a simple nozzle is simulated as a 2D planar model. The nozzle has an inlet height of 0.2 m, and the nozzle contours have a sinusoidal shape that produces a 10% reduction in flow area. Due to symmetry, only half of the nozzle is modeled. c Fluent Inc. September 21, 2006 4-1

Upload: mohamad-asadi

Post on 06-Mar-2015

231 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Tutorial 4. Modeling Unsteady Compressible Flow

Tutorial 4. Modeling Unsteady Compressible Flow

Introduction

In this tutorial, FLUENT’s density-based implicit solver is used to predict the time-dependent flow through a two-dimensional nozzle. As an initial condition for the transientproblem, a steady-state solution is generated to provide the initial values for the massflow rate at the nozzle exit.

This tutorial demonstrates how to do the following:

• Calculate a steady-state solution (using the density-based implicit solver) as aninitial condition for a transient flow prediction.

• Define an unsteady boundary condition using a user-defined function (UDF).

• Use dynamic mesh adaption for both steady-state and transient flows.

• Calculate a transient solution using the second-order implicit unsteady formulationand the density-based implicit solver.

• Create an animation of the unsteady flow using FLUENT’s unsteady solution ani-mation feature.

Prerequisites

This tutorial assumes that you are familiar with the menu structure in FLUENT and thatyou have completed Tutorial 1. Some steps in the setup and solution procedure will notbe shown explicitly.

Problem Description

The geometry to be considered in this tutorial is shown in Figure 4.1. Flow through asimple nozzle is simulated as a 2D planar model. The nozzle has an inlet height of 0.2 m,and the nozzle contours have a sinusoidal shape that produces a 10% reduction in flowarea. Due to symmetry, only half of the nozzle is modeled.

c© Fluent Inc. September 21, 2006 4-1

Page 2: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

p = 0.9 atminlet p = 0.7369 atm

exit

0.2 m

plane of symmetry

p (t )exit

Figure 4.1: Problem Specification

Setup and Solution

Preparation

1. Download unsteady_compressible.zip from the Fluent Inc. User Services Centeror copy it from the FLUENT documentation CD to your working folder (as describedin Tutorial 1).

2. Unzip unsteady_compressible.zip.

The files nozzle.msh and pexit.c can be found in the unsteady compressible

folder created after unzipping the file.

3. Start the 2D (2d) version of FLUENT.

4-2 c© Fluent Inc. September 21, 2006

Page 3: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Step 1: Grid

1. Read in the mesh file nozzle.msh.

File −→ Read −→Case...

2. Check the grid.

Grid −→Check

FLUENT will perform various checks on the mesh and will report the progress inthe console. Make sure that the reported minimum volume is a positive number.

3. Display the grid.

Display −→Grid...

(a) Retain the default settings.

(b) Click Display and close the Grid Display panel.

To make the view more realistic, you will mirror it across the centerline in the stepthat follows.

c© Fluent Inc. September 21, 2006 4-3

Page 4: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

4. Mirror the view across the centerline (Figure 4.2).

Display −→Views...

(a) Select symmetry from the Mirror Planes selection list.

(b) Click Apply and close the Views panel.

GridFLUENT 6.3 (2d, pbns, lam)

Figure 4.2: 2D Nozzle Mesh Display with Mirroring

4-4 c© Fluent Inc. September 21, 2006

Page 5: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Step 2: Units

1. For convenience, change the unit of measurement for pressure.

The pressure for this problem is specified in atm, which is not the default unit inFLUENT. You will need to redefine the pressure unit as atm.

Define −→Units...

(a) Select pressure from the Quantities selection list.

Scroll down the list to find pressure.

(b) Select atm from the Units selection list.

(c) Close the Set Units panel.

c© Fluent Inc. September 21, 2006 4-5

Page 6: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Step 3: Models

1. Specify the solver settings.

The density-based implicit solver is the solver of choice for compressible, transonicflows without significant regions of low-speed flow. In cases with significant low-speed flow regions, the pressure-based solver is preferred. Also, for transient caseswith traveling shocks, the density-based explicit solver with explicit time steppingmay be the most efficient.

Define −→ Models −→Solver...

(a) Select Density Based from the Solver list.

(b) Retain the default selection of Implicit from the Formulation list.

(c) Retain the default selection of Steady from the Time list.

Note: You will solve for the steady flow through the nozzle initially. In latersteps, you will use these initial results as a starting point for an unsteadycalculation.

(d) Click OK to close the Solver panel.

4-6 c© Fluent Inc. September 21, 2006

Page 7: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

2. Enable the energy equation.

Define −→ Models −→Energy...

3. Enable the standard Spalart-Allmaras turbulence model.

Define −→ Models −→Viscous...

The Spalart-Allmaras model is a relatively simple one-equation model that solvesa modeled transport equation for the kinematic eddy (turbulent) viscosity. Thisembodies a class of one-equation models in which it is not necessary to calculate alength scale related to the local shear layer thickness. The Spalart-Allmaras modelwas designed specifically for aerospace applications involving wall-bounded flows andhas been shown to give good results for boundary layers subjected to adverse pressuregradients.

c© Fluent Inc. September 21, 2006 4-7

Page 8: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Step 4: Materials

1. Set the properties for air, the default fluid material.

Define −→Materials...

(a) Select ideal-gas from the Density drop-down list, so that the ideal gas law isused to calculate density.

Note: FLUENT automatically enables the solution of the energy equation whenthe ideal gas law is used, in case you did not already enable it manuallyin the Energy panel.

(b) Retain the default values for all other properties.

(c) Click the Change/Create button to save your change.

(d) Close the Materials panel.

4-8 c© Fluent Inc. September 21, 2006

Page 9: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Step 5: Operating Conditions

1. Set the operating pressure.

Define −→Operating Conditions...

(a) Enter 0 atm for Operating Pressure.

(b) Click OK to close the Operating Conditions panel.

Since you have set the operating pressure to zero, you will specify the boundarycondition inputs for pressure in terms of absolute pressures when you define themin the next step. Boundary condition inputs for pressure should always be relativeto the value used for operating pressure.

c© Fluent Inc. September 21, 2006 4-9

Page 10: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Step 6: Boundary Conditions

Define −→Boundary Conditions...

1. Set the boundary conditions for the nozzle inlet (inlet).

(a) Enter 0.9 atm for Gauge Total Pressure.

(b) Enter 0.7369 atm for Supersonic/Initial Gauge Pressure.

4-10 c© Fluent Inc. September 21, 2006

Page 11: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

The inlet static pressure estimate is the mean pressure at the nozzle exit. Thisvalue will be used during the solution initialization phase to provide a guessfor the nozzle velocity.

(c) Select Turbulent Viscosity Ratio from the Specification Method drop-down listin the Turbulence group box.

(d) Enter 1 for Turbulent Viscosity Ratio.

For low to moderate inlet turbulence, a viscosity ratio of 1 is recommended.

(e) Click OK to close the Pressure Inlet panel.

2. Set the boundary conditions for the nozzle exit (outlet).

(a) Enter 0.7369 atm for Gauge Pressure.

(b) Select Turbulent Viscosity Ratio from the Specification Method drop-down listin the Turbulence group box.

(c) Retain the default entry of 10 for Backflow Turbulent Viscosity Ratio.

If substantial backflow occurs at the outlet, you may need to adjust the backflowvalues to levels close to the actual exit conditions.

(d) Click OK to close the Pressure Outlet panel.

3. Close the Boundary Conditions panel.

c© Fluent Inc. September 21, 2006 4-11

Page 12: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Step 7: Solution: Steady Flow

In this step, you will generate a steady-state flow solution that will be used as an initialcondition for the time-dependent solution.

1. Initialize the solution.

Solve −→ Initialize −→Initialize...

(a) Select inlet in the Compute From drop-down list.

(b) Click Init and close the Solution Initialization panel.

4-12 c© Fluent Inc. September 21, 2006

Page 13: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

2. Set the solution parameters.

Solve −→ Controls −→Solution...

(a) Select Second Order Upwind from the Modified Turbulent Viscosity drop-downlist in the Discretization group box.

Second-order discretization provides optimum accuracy.

(b) Click OK to close the Solution Controls panel.

c© Fluent Inc. September 21, 2006 4-13

Page 14: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

3. Perform gradient adaption to refine the mesh.

You will activate dynamic adaption so that the solver periodically refines the meshin the vicinity of the shocks as the iterations progress. The shocks are identified bytheir large pressure gradients.

Adapt −→Gradient...

(a) Select Gradient from the Method list.

The mesh adaption criterion can either be the gradient or the curvature (secondgradient). Because strong shocks occur inside the nozzle, the gradient is usedas the adaption criterion.

(b) Select Scale from the Normalization list.

Mesh adaption can be controlled by the raw (or standard) value of the gradient,the scaled value (by its average in the domain), or the normalized value (by itsmaximum in the domain). For dynamic mesh adaption, it is recommended touse either the scaled or normalized value because the raw values will probablychange strongly during the computation, which would necessitate a readjust-ment of the coarsen and refine thresholds. In this case, the scaled gradient isused.

(c) Enable the Dynamic option in the Dynamic group box.

(d) Enter 100 for the Interval.

For steady-state flows, it is sufficient to only seldomly adapt the mesh—inthis case an interval of 100 iterations is chosen. For time-dependent flows, aconsiderably smaller interval must be used.

4-14 c© Fluent Inc. September 21, 2006

Page 15: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

(e) Retain the default selection of Pressure... and Static Pressure from the Gradientsof drop-down lists.

(f) Enter 0.3 for Coarsen Threshold.

(g) Enter 0.7 for Refine Threshold.

As the refined regions of the mesh get larger, the coarsen and refine thresholdsshould get smaller. A coarsen threshold of 0.3 and a refine threshold of 0.7result in a “medium” to “strong” mesh refinement in combination with thescaled gradient.

(h) Click Apply to store the information.

(i) Click the Controls... button to open the Grid Adaption Controls panel.

i. Retain the default selection of fluid from the Zones selection list.

ii. Enter 20000 for Max # of Cells.

To restrict the mesh adaption, the maximum number of cells can be lim-ited. If this limit is violated during the adaption, the coarsen and refinethresholds are adjusted to respect the maximum number of cells. Addi-tional restrictions can be placed on the minimum cell volume, minimumnumber of cells, and maximum level of refinement.

iii. Click OK to close the Grid Adaption Controls panel.

(j) Close the Gradient Adaption panel.

c© Fluent Inc. September 21, 2006 4-15

Page 16: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

4. Enable the plotting of residuals.

Solve −→ Monitors −→Residual...

(a) Enable Plot in the Options group box.

(b) Click OK to close the Residual Monitors panel.

5. Enable the plotting of mass flow rate at the flow exit.

Solve −→ Monitors −→Surface...

4-16 c© Fluent Inc. September 21, 2006

Page 17: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

(a) Set Surface Monitors to 1.

(b) Enable the Plot and Write options for monitor-1.

Note: When the Write option is selected in the Surface Monitors panel, themass flow rate history will be written to a file. If you do not select thewrite option, the history information will be lost when you exit FLUENT.

(c) Click the Define... button to open the Define Surface Monitor panel.

i. Select Mass Flow Rate in the Report Type drop-down list.

ii. Enter noz ss.out for File Name.

iii. Select outlet in the Surfaces list.

iv. Click OK to close the Define Surface Monitor panel.

(d) Click OK to close the Surface Monitors panel.

6. Save the case file (noz ss.cas).

File −→ Write −→Case...

c© Fluent Inc. September 21, 2006 4-17

Page 18: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

7. Start the calculation by requesting 2000 iterations.

Solve −→Iterate...

Convergence history of Mass Flow Rate on outletFLUENT 6.3 (2d, dbns imp, S-A)

Iteration

(kg/s)RateFlow

Mass

2000180016001400120010008006004002000

-14.0000

-14.5000

-15.0000

-15.5000

-16.0000

-16.5000

-17.0000

monitor-1

Figure 4.3: Mass Flow Rate History

The mass flow rate history shows that the solution is converged after around 1800iterations.

8. Save the case and data files (noz ss.cas and noz ss.dat).

File −→ Write −→Case & Data...

4-18 c© Fluent Inc. September 21, 2006

Page 19: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

9. Check the mass flux balance.

Report −→Fluxes...

! Although the mass flow rate history indicates that the solution is con-verged, you should also check the mass flux throughout the domain toensure that mass is being conserved.

(a) Retain the default selection of the Mass Flow Rate option.

(b) Select inlet and outlet in the Boundaries selection list.

(c) Click Compute and examine the values displayed in the panel.

! The net mass imbalance should be a small fraction (e.g., 0.2%) of the totalflux through the system. The imbalance is displayed in the lower rightfield under kg/s. If a significant imbalance occurs, you should decreaseyour residual tolerances by at least an order of magnitude and continueiterating.

(d) Close the Flux Reports panel.

c© Fluent Inc. September 21, 2006 4-19

Page 20: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

10. Display the steady-flow velocity vectors (Figure 4.4).

Display −→Vectors...

(a) Enter 10 for Scale.

(b) Select all of the surfaces from the Surfaces selection list, by clicking the shadedicon above the right corner of the list.

(c) Click Display and close the Vectors panel.

The steady flow prediction in Figure 4.4 shows the expected form, with peak velocityof approximately 336 m/s through the nozzle.

4-20 c© Fluent Inc. September 21, 2006

Page 21: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Velocity Vectors Colored By Velocity Magnitude (m/s)FLUENT 6.3 (2d, dbns imp, S-A)

3.36e+02

3.20e+02

3.03e+02

2.86e+02

2.69e+02

2.52e+02

2.36e+02

2.19e+02

2.02e+02

1.85e+02

1.69e+02

1.52e+02

1.35e+02

1.18e+02

1.01e+02

8.46e+01

6.78e+01

5.10e+01

3.42e+01

1.74e+01

6.02e-01

Figure 4.4: Velocity Vectors (Steady Flow)

c© Fluent Inc. September 21, 2006 4-21

Page 22: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

11. Display the steady flow contours of static pressure (Figure 4.5).

Display −→Contours...

(a) Enable Filled in the Options group box.

(b) Click Display and close the Contours panel.

The steady flow prediction in Figure 4.5 shows the expected pressure distribution,with low pressure near the nozzle throat.

4-22 c© Fluent Inc. September 21, 2006

Page 23: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Contours of Static Pressure (atm)FLUENT 6.3 (2d, dbns imp, S-A)

7.84e-01

7.66e-01

7.48e-01

7.30e-01

7.12e-01

6.94e-01

6.76e-01

6.57e-01

6.39e-01

6.21e-01

6.03e-01

5.85e-01

5.67e-01

5.49e-01

5.31e-01

5.12e-01

4.94e-01

4.76e-01

4.58e-01

4.40e-01

4.22e-01

Figure 4.5: Contours of Static Pressure (Steady Flow)

c© Fluent Inc. September 21, 2006 4-23

Page 24: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Step 8: Enable Time Dependence and Set Unsteady Conditions

In this step you will define a transient flow by specifying an unsteady pressure conditionfor the nozzle.

1. Enable a time-dependent flow calculation.

Define −→ Models −→Solver...

(a) Select Unsteady from the Time list.

(b) Select 2nd-Order Implicit from the Unsteady Formulation list.

(c) Click OK to close the Solver panel.

Implicit (dual) time-stepping allows you to set the physical time step used for thetransient flow prediction (while FLUENT continues to determine the time step usedfor inner iterations based on a Courant condition). Here, second-order implicittime-stepping is enabled: this provides higher accuracy in time than the first-orderoption.

4-24 c© Fluent Inc. September 21, 2006

Page 25: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

2. Read in the user-defined function (pexit.c), in preparation for defining the un-steady condition for the nozzle exit.

The pressure at the outlet is defined as a wave-shaped profile, and is described bythe following equation:

pexit(t) = 0.12 sin(ωt) + pexit (4.1)

where

ω = circular frequency of unsteady pressure (rad/s)pexit = mean exit pressure (atm)

In this case, ω = 2200 rad/s, and pexit = 0.7369 atm.

A user-defined function (pexit.c) has been written to define the equation (Equa-tion 4.1) required for the pressure profile.

Note: To input the value of Equation 4.1 in the correct units, the function pexit.c

has been multiplied by a factor of 101325 to convert from the chosen pressureunit (atm) to the SI unit required by FLUENT (Pa). This will not affect thedisplayed results.

See the separate UDF Manual for details about user-defined functions..

Define −→ User-Defined −→ Functions −→Interpreted...

(a) Enter pexit.c for Source File Name.

(b) Click Interpret.

The user-defined function has already been defined, but it needs to be compiledwithin FLUENT before it can be used in the solver.

(c) Close the Interpreted UDFs panel.

c© Fluent Inc. September 21, 2006 4-25

Page 26: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

3. Set the unsteady boundary conditions at the nozzle exit (outlet).

Define −→Boundary Conditions...

(a) Select udf unsteady pressure (the user-defined function) from the Gauge Pressuredrop-down list.

(b) Click OK to close the Pressure Outlet panel.

4. Update the gradient adaption parameters for the transient case.

Adapt −→Gradient...

(a) Enter 1 for Interval in the Dynamic group box.

For the transient case, the mesh adaption will be done every time step.

(b) Enter 0.3 for Coarsen Threshold.

(c) Enter 0.7 for Refine Threshold.

The refine and coarsen thresholds have been changed during the steady-statecomputation to meet the limit of 20000 cells. Therefore, you need to resetthese parameters to their original values.

(d) Click Apply to store the values.

(e) Click Controls... to open the Grid Adaption Controls panel.

i. Enter 8000 for Min # of Cells.

ii. Enter 30000 for Max # of Cells.

You need to increase the maximum number of cells to try to avoid readjust-ment of the coarsen and refine thresholds. Additionally, you need to limit

4-26 c© Fluent Inc. September 21, 2006

Page 27: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

the minimum number of cells to 8000, because it is not desired to have acoarse mesh during the computation (the current mesh has approximately10000 cells).

iii. Click OK to close the Grid Adaption Controls panel.

(f) Close the Gradient Adaption panel.

Step 9: Solution: Unsteady Flow

1. Set the time step parameters.

The selection of the time step is critical for accurate time-dependent flow predic-tions. Using a time step of 2.85596× 10−5 seconds, 100 time steps are required forone pressure cycle. The pressure cycle begins and ends with the initial pressure atthe nozzle exit.

Solve −→Iterate...

(a) Enter 2.85596e-5 s for Time Step Size.

(b) Enter 600 for Number of Time Steps.

(c) Enter 30 for Max Iterations per Time Step.

(d) Click Apply and close the Iterate panel.

c© Fluent Inc. September 21, 2006 4-27

Page 28: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

2. Modify the plotting of the mass flow rate at the nozzle exit.

Because each time step requires 30 iterations, a smoother plot will be generated byplotting at every time step.

Solve −→ Monitors −→Surface...

(a) Select Time Step from the When drop-down list for monitor-1.

(b) Click the Define... button to open the Define Surface Monitors panel.

i. Select Time Step from the X Axis drop-down list.

ii. Enter noz uns.out for File Name.

iii. Click OK to close the Define Surface Monitors panel.

(c) Click OK to close the Surface Monitors panel.

4-28 c© Fluent Inc. September 21, 2006

Page 29: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

3. Save the transient solution case file (noz uns.cas).

File −→ Write −→Case...

4. Start the transient calculation.

Solve −→Iterate...

! Calculating 600 time steps will require significant CPU resources. Insteadof calculating the solution, you can read the data file (noz uns.dat.gz)

with the precalculated solution. This data file can be found in the folderwhere you found the mesh and UDF files.

By requesting 600 time steps, you are asking FLUENT to compute six pressurecycles. The mass flow rate history is shown in Figure 4.6.

Convergence history of Mass Flow Rate on outlet (Time=1.7136e-02)FLUENT 6.3 (2d, dbns imp, S-A, unsteady)

Time Step

(kg/s)RateFlow

Mass

6005004003002001000

-4.0000

-6.0000

-8.0000

-10.0000

-12.0000

-14.0000

-16.0000

-18.0000

monitor-1

Figure 4.6: Mass Flow Rate History (Unsteady Flow)

5. Save the transient case and data files (noz uns.cas and noz uns.dat).

File −→ Write −→Case & Data...

c© Fluent Inc. September 21, 2006 4-29

Page 30: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Step 10: Saving and Postprocessing Time-Dependent Data Sets

At this point, the solution has reached a time-periodic state. To study how the flowchanges within a single pressure cycle, you will now continue the solution for 100 moretime steps. You will use FLUENT’s solution animation feature to save contour plots ofpressure and Mach number at each time step, and the autosave feature to save case anddata files every 10 time steps. After the calculation is complete, you will use the solutionanimation playback feature to view the animated pressure and Mach number plots overtime.

1. Request the saving of case and data files every 10 time steps.

File −→ Write −→Autosave...

(a) Enter 10 for Autosave Case File Frequency.

(b) Enter 10 for Autosave Data File Frequency.

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

(d) Enter noz anim for File Name.

When FLUENT saves a file, it will append the time step value to the filename prefix (noz anim). The standard extensions (.cas and .dat) will alsobe appended. This will yield file names of the form noz anim0640.cas andnoz anim0640.dat, where 0640 is the time step number.

Optionally, you can add the extension .gz to the end of the file name (e.g.,noz anim.gz), which will instruct FLUENT to save the case and data files incompressed format, yielding file names of the form noz anim0640.cas.gz.

(e) Click OK to close the Autosave Case/Data panel.

4-30 c© Fluent Inc. September 21, 2006

Page 31: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Extra: If you have constraints on disk space, you can restrict the number offiles saved by FLUENT by enabling the Overwrite Existing Files option andsetting the Maximum Number of Each File Type to a nonzero number. Aftersaving the specified number of files, FLUENT will overwrite the earliestexisting file.

2. Create animation sequences for the nozzle pressure and Mach number contour plots.

Solve −→ Animate −→Define...

(a) Set Animation Sequences to 2.

(b) Enter pressure for the Name of the first sequence and mach-number for thesecond sequence, as shown in the previous panel.

(c) Select Time Step from the When drop-down lists for both sequences.

With the default value of 1 for Every, this instructs FLUENT to update theanimation sequence at every time step.

c© Fluent Inc. September 21, 2006 4-31

Page 32: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

(d) Click the Define... button for pressure to open the associated Animation Se-quence panel.

i. Select In Memory from the Storage Type list.

The In Memory option is acceptable for a small 2D case such as this. Forlarger 2D or 3D cases, saving animation files with either the Metafile orPPM Image option is preferable, to avoid using too much of your machine’smemory.

ii. Set Window to 2.

iii. Click the Set button to open the FLUENT [2] graphics window.

4-32 c© Fluent Inc. September 21, 2006

Page 33: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

iv. Select Contours in the Display Type group box.

The Contours panel will open.

A. Make sure that Filled is selected under Options.

B. Deselect Auto Range.

C. Retain the default selections of Pressure... and Static Pressure fromthe Contours of drop-down lists.

D. Enter 0.25 atm for Min and 1.25 atm for Max.

This will set a fixed range for the contour plot and subsequent anima-tion.

E. Select all of the surfaces from the Surfaces selection list by clickingthe shaded icon above the right corner of the list.

F. Click Display and close the Contours panel.

Figure 4.7 shows the contours of static pressure in the nozzle after 600time steps.

v. Click OK to close the Animation Sequence panel associated with the pres-sure sequence.

(e) Click the Define... button for mach-number to open the associated AnimationSequence panel.

i. Make sure that In Memory is selected in the Storage Type list.

ii. Set Window to 3.

c© Fluent Inc. September 21, 2006 4-33

Page 34: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Contours of Static Pressure (atm) (Time=1.7136e-02)FLUENT 6.3 (2d, dbns imp, S-A, unsteady)

1.25e+00

1.20e+00

1.15e+00

1.10e+00

1.05e+00

1.00e+00

9.50e-01

9.00e-01

8.50e-01

8.00e-01

7.50e-01

7.00e-01

6.50e-01

6.00e-01

5.50e-01

5.00e-01

4.50e-01

4.00e-01

3.50e-01

3.00e-01

2.50e-01

Figure 4.7: Pressure Contours at t = 0.017136 s

iii. Click the Set button to open the FLUENT [3] graphics window.

iv. Select Contours in the Display Type group box.

The Contours panel will open.

A. Select Velocity... and Mach Number in the Contours of drop-down list.

B. Make sure that Filled is selected under Options.

C. Deselect Auto Range.

D. Enter 0.00 for Min and 1.30 for Max.

E. Make sure that all of the surfaces are selected in the Surfaces selectionlist.

F. Click Display and close the Contours panel.

Figure 4.8 shows the Mach number contours in the nozzle after 600time steps.

v. Click OK to close the Animation Sequence panel associated with the mach-number sequence.

(f) Click OK to close the Solution Animation panel.

4-34 c© Fluent Inc. September 21, 2006

Page 35: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Contours of Mach Number (Time=1.7136e-02)FLUENT 6.3 (2d, dbns imp, S-A, unsteady)

1.30e+00

1.23e+00

1.17e+00

1.11e+00

1.04e+00

9.75e-01

9.10e-01

8.45e-01

7.80e-01

7.15e-01

6.50e-01

5.85e-01

5.20e-01

4.55e-01

3.90e-01

3.25e-01

2.60e-01

1.95e-01

1.30e-01

6.50e-02

0.00e+00

Figure 4.8: Mach Number Contours at t = 0.017136 s

c© Fluent Inc. September 21, 2006 4-35

Page 36: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

3. Continue the calculation by requesting 100 time steps.

By requesting 100 time steps, you will march the solution through an additional0.0028 seconds, or roughly one pressure cycle. With the autosave and animationfeatures active (as defined previously), the case and data files will be saved approx-imately every 0.00028 seconds of the solution time; animation files will be savedevery 0.000028 seconds of the solution time.

Solve −→Iterate...

When the calculation finishes, you will have ten pairs of case and data files andthere will be 100 pairs of contour plots stored in memory. In the next few steps,you will play back the animation sequences and examine the results at several timesteps after reading in pairs of newly saved case and data files.

4-36 c© Fluent Inc. September 21, 2006

Page 37: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

4. Change the display options to include double buffering.

Double buffering will allow for a smoother transition between the frames of theanimations.

Display −→Options...

(a) Disable the Wireframe Animation option in the Rendering group box.

(b) Enable the Double Buffering option.

(c) Set Active Window to 2.

(d) Click the Set button.

(e) Click Apply and close the Display Options panel.

c© Fluent Inc. September 21, 2006 4-37

Page 38: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

5. Play the animation of the pressure contours.

Solve −→ Animate −→Playback...

(a) Retain the default selection of pressure from the Sequences selection list.

(b) Click the play button (the second from the right in the group of buttons inthe Playback group box).

(c) Close the Playback panel.

Examples of pressure contours at t = 0.017993 s (the 630th time step) and t =0.019135 s (the 670th time step) are shown in Figures 4.9 and 4.10.

6. In a similar manner to steps 4. and 5., select the appropriate active window andsequence name for the Mach number contours.

Examples of Mach number contours at t = 0.017993 s and t = 0.019135 s are shownin Figures 4.11 and 4.12.

4-38 c© Fluent Inc. September 21, 2006

Page 39: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Contours of Static Pressure (atm) (Time=1.7993e-02)FLUENT 6.3 (2d, dbns imp, S-A, unsteady)

1.25e+00

1.20e+00

1.15e+00

1.10e+00

1.05e+00

1.00e+00

9.50e-01

9.00e-01

8.50e-01

8.00e-01

7.50e-01

7.00e-01

6.50e-01

6.00e-01

5.50e-01

5.00e-01

4.50e-01

4.00e-01

3.50e-01

3.00e-01

2.50e-01

Figure 4.9: Pressure Contours at t = 0.017993 s

Contours of Static Pressure (atm) (Time=1.9135e-02)FLUENT 6.3 (2d, dbns imp, S-A, unsteady)

1.25e+00

1.20e+00

1.15e+00

1.10e+00

1.05e+00

1.00e+00

9.50e-01

9.00e-01

8.50e-01

8.00e-01

7.50e-01

7.00e-01

6.50e-01

6.00e-01

5.50e-01

5.00e-01

4.50e-01

4.00e-01

3.50e-01

3.00e-01

2.50e-01

Figure 4.10: Pressure Contours at t = 0.019135 s

c© Fluent Inc. September 21, 2006 4-39

Page 40: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Contours of Mach Number (Time=1.7993e-02)FLUENT 6.3 (2d, dbns imp, S-A, unsteady)

1.30e+00

1.23e+00

1.17e+00

1.11e+00

1.04e+00

9.75e-01

9.10e-01

8.45e-01

7.80e-01

7.15e-01

6.50e-01

5.85e-01

5.20e-01

4.55e-01

3.90e-01

3.25e-01

2.60e-01

1.95e-01

1.30e-01

6.50e-02

0.00e+00

Figure 4.11: Mach Number Contours at t = 0.017993 s

Contours of Mach Number (Time=1.9135e-02)FLUENT 6.3 (2d, dbns imp, S-A, unsteady)

1.30e+00

1.23e+00

1.17e+00

1.11e+00

1.04e+00

9.75e-01

9.10e-01

8.45e-01

7.80e-01

7.15e-01

6.50e-01

5.85e-01

5.20e-01

4.55e-01

3.90e-01

3.25e-01

2.60e-01

1.95e-01

1.30e-01

6.50e-02

0.00e+00

Figure 4.12: Mach Number Contours at t = 0.019135 s

4-40 c© Fluent Inc. September 21, 2006

Page 41: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Extra: FLUENT gives you the option of exporting an animation as an MPEG fileor as a series of files in any of the hardcopy formats available in the GraphicsHardcopy panel (including TIFF and PostScript).

To save an MPEG file, select MPEG from the Write/Record Format drop-downlist in the Playback panel and then click the Write button. The MPEG file willbe saved in your working folder. You can view the MPEG movie using anMPEG player (e.g., Windows Media Player or another MPEG movie player).

To save a series of TIFF, PostScript, or other hardcopy files, select HardcopyFrames in the Write/Record Format drop-down list in the Playback panel. Clickthe Hardcopy Options... button to open the Graphics Hardcopy panel and setthe appropriate parameters for saving the hardcopy files. Click Apply in theGraphics Hardcopy panel to save your modified settings. In the Playback panel,click the Write button. FLUENT will replay the animation, saving each frameto a separate file in your working folder.

If you want to view the solution animation in a later FLUENT session, youcan select Animation Frames as the Write/Record Format and click Write.

! Since the solution animation was stored in memory, it will be lost if you exitFLUENT without saving it in one of the formats described previously. Notethat only the animation-frame format can be read back into the Playbackpanel for display in a later FLUENT session.

7. Read the case and data files for the 660th time step (noz anim0660.cas andnoz anim0660.dat) into FLUENT.

File −→ Read −→Case & Data...

c© Fluent Inc. September 21, 2006 4-41

Page 42: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

8. Plot vectors at t = 0.018849 s (Figure 4.13).

Display −→Vectors...

(a) Make sure that 10 is entered for Scale.

(b) Click Display and close the Vectors panel.

The unsteady flow prediction in Figure 4.13 shows the expected form, with peakvelocity of approximately 243 m/s through the nozzle at t = 0.018849 seconds.

9. In a similar manner to step 7. and 8., read in the case and data files saved for othertime steps of interest and display the vectors.

4-42 c© Fluent Inc. September 21, 2006

Page 43: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

Velocity Vectors Colored By Velocity Magnitude (m/s) (Time=1.8849e-02)FLUENT 6.3 (2d, dbns imp, S-A, unsteady)

2.43e+02

2.31e+02

2.18e+02

2.06e+02

1.94e+02

1.82e+02

1.70e+02

1.58e+02

1.46e+02

1.34e+02

1.22e+02

1.10e+02

9.74e+01

8.53e+01

7.32e+01

6.11e+01

4.90e+01

3.69e+01

2.48e+01

1.27e+01

5.97e-01

Figure 4.13: Velocity Vectors at t = 0.018849 s

Summary

In this tutorial, you modeled the transient flow of air through a nozzle. You learned howto generate a steady-state solution as an initial condition for the unsteady case, and howto set solution parameters for implicit time-stepping.

You also learned how to manage the file saving and graphical postprocessing for time-dependent flows, using file autosaving to automatically save solution information as thetransient calculation proceeds.

Finally, you learned how to use FLUENT’s solution animation tool to create animationsof transient data, and how to view the animations using the playback feature.

Further Improvements

This tutorial guides you through the steps to generate a second-order solution. You maybe able to increase the accuracy of the solution even further by using an appropriatehigher-order discretization scheme and by adapting the grid further. Grid adaption canalso ensure that the solution is independent of the grid. These steps are demonstratedin Tutorial 1.

c© Fluent Inc. September 21, 2006 4-43

Page 44: Tutorial 4. Modeling Unsteady Compressible Flow

Modeling Unsteady Compressible Flow

4-44 c© Fluent Inc. September 21, 2006