67
© 2012 ANSYS, Inc. September 19, 2013 1 Release 14.5 PRACE Autumn School 2013 - Industry Oriented HPC Simulations, September 21-27, University of Ljubljana, Faculty of Mechanical Engineering, Ljubljana, Slovenia Express Introductory Training in ANSYS Fluent Workshop 03 MultiSpecies Flow and Postprocessing Dimitrios Sofialidis Technical Manager, SimTec Ltd. Mechanical Engineer, PhD

Express Introductory Training in ANSYS Fluent · –Under the Fluent File menu select "Import>Mesh". –Select the file "car_and_garage.msh" and click "OK" to import the mesh. –To

  • Upload
    others

  • View
    30

  • Download
    0

Embed Size (px)

Citation preview

© 2012 ANSYS, Inc. September 19, 2013 1 Release 14.5

PRACE Autumn School 2013 - Industry Oriented HPC Simulations, September 21-27,

University of Ljubljana, Faculty of Mechanical Engineering, Ljubljana, Slovenia

Express Introductory Training in ANSYS Fluent

Workshop 03

Multi–Species Flow and Postprocessing

Dimitrios Sofialidis

Technical Manager, SimTec Ltd.

Mechanical Engineer, PhD

© 2012 ANSYS, Inc. September 19, 2013 2 Release 14.5

Introduction to ANSYS Fluent

14.5 Release

Workshop 03 Multi–Species Flow and Postprocessing

© 2012 ANSYS, Inc. September 19, 2013 3 Release 14.5

• In this workshop you will analyze the release of heat and combustion gases from a single car with an engine fire in a ventilated parking garage. The simulation will be run steady state assuming the fire has reached a stable developed stage.

• Simulation Physics & Boundary Conditions. – Mixture of N2, O2, CO2 and H20. – 0.1 kg/s combustion gases (H2O and CO2) at 1200 [K]. – 80 [N/m3] momentum source in jets.

Introduction

Fresh Air Inlet

"velocity_inlet_fresh_air"

.

Jet Fan

"fluid_jet_fan".

Heat and gas release from fire

"mass_flow_inlet_car_fire_source".

Air Outlet

"pressure_outlet_all_air".

Symmetry Plane

"symmetry".

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 4 Release 14.5

Important Note

NOTE:

• This workshop has been designed to be completed in one of two ways. Please check with your trainer on whether you are to take the short or long option.

• [Short Option] This workshop can be used just to demonstrate post–processing in CFD–Post. Pre–prepared results files are supplied, so please jump straight to page 35 for post–processing.

• [Long Option] Follow all the instructions, which will demonstrate how to set up a multi–species simulation of a car fire. Once the model is set up, you can choose to wait for it to converge, or then replace your results with the supplied pre–prepared set.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 5 Release 14.5

If doing the short version (postprocessing only) please jump to page 35 now.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 6 Release 14.5

Learning Aims:

The first part of this workshop will show how to set up a multi–species problem. The domain will contain a blend of several different gases (nitrogen, oxygen, carbon dioxide, water vapor).

Other topics that will be introduced are:

• Including gravitational (buoyancy) effects.

• Setting a momentum source term to account for a jet fan.

Learning Objectives:

To understand how Fluent can be used to simulate mixtures of fluids, and account for buoyancy effects. Note that a multi–species problem like this assumes that the components are mixed at a molecular level (as normally happens with gases). The alternative is a multi–phase problem where there is an identifiable boundary between the components (either droplets/particles/bubbles, or a free–surface). Multi–phase workshops include Workshop 2 (DPM) and Workshop 7 (Tank Flush).

I Objectives (Flow Simulation Part)

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 7 Release 14.5

Starting Workbench • Open Workbench.

– "Start>Programs>ANSYS 14.5>Workbench 14.5".

– Drag a "FLUENT" Component System into the Project Schematic.

– Rename the system to "Garage" (RMB on Cell A1 to rename the system).

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 8 Release 14.5

Starting Fluent in Workbench • Start Fluent.

– Double click on the "Setup" cell to open Fluent.

– Choose "3D" and "Double Precision" under "Options" and retain the other default settings (if your computer has two or more nodes and parallel licenses are available, you also could start Fluent parallel).

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 9 Release 14.5

• Import the existing mesh file.

– Under the Fluent File menu select "Import>Mesh".

– Select the file "car_and_garage.msh" and click "OK" to import the mesh.

– To check for any problems in the mesh click "Check". There should be no problems reported in the TUI window.

– Reorder the mesh using "Mesh>Reorder>Domain" (from the menu).

– Reordering the domain can improve the computational performance of the solver by rearranging the nodes, faces and cells in memory.

– Retain defaults for the solver.

– Enable "Gravity" and set "z = –9.81 [m/s2]".

Import Mesh and General Setup

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 10 Release 14.5

Setting Physics (Turbulence) • Specify turbulence model.

– Select "Models" in the navigation pane.

– Double click "Viscous" in the model selection pane. The "Viscous Model" panel will open.

– Select "k–epsilon (2 eqn)" under "Model", "Realizable" under "k–epsilon Model" and "Enhanced Wall Treatment" under "Near–Wall Treatment".

– Turbulence modelling, as with all physics modelling, is a complex area. There are many application–specific options. The k–epsilon model is a simple but robust model. The documentation provides further guidance on which models to use for specific applications.

– Click "OK".

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 11 Release 14.5

Setting Physics (Species/Mixture) • Specify species model.

– Double click "Species" in the "Models" selection pane. The "Species Model" panel will open.

– In this workshop the products of combustion (heat & gases) will be modelled rather than the

reaction itself.

– Select "Species Transport" and click "OK". – Switching on the species model will introduce

new material properties.

– An information box will appear. Click "OK" to accept this.

– This setup will enable the tracking of non–reacting chemical species.

The species model requires the definition of a "mixture" representing the chemical species of interest. The default mixture contains nitrogen, oxygen and water vapour.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 12 Release 14.5

• Specify mixture.

– Select "Materials" in the navigation pane.

– Note that under Mixture in the Materials pane the default mixture is listed as containing nitrogen, oxygen and water–vapour.

– Double click mixture–template", this will open the "Create/Edit Materials" panel with the mixture preselected.

Defining Materials [1]

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 13 Release 14.5

Defining Materials [2] • Add a mixture species.

– In the "Create/Edit Materials" panel click on "Fluent Database".

– The "Fluent Database Materials" panel will appear.

– Select "fluid" as "Material Type".

– All predefined fluids materials will be listed under "Fluent Fluid Materials".

– Select "carbon–dioxide (co2)".

– Click "Copy".

– Close the "Fluent Database Materials" panel.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 14 Release 14.5

Defining Materials [3] • Copying "carbon–dioxide(co2)" from the fluid database has made the species available

to the simulation, now add it to the mixture.

– In the "Materials" panel ensure "Material Type" is set to "mixture".

– Alongside "Mixture Species", click Edit.

– In the Species panel select "co2" from the "Available Materials" list and select "Add".

– The "Selected Species" defines the component species of the mixture.

– The order of the species listed under "Selected Species" is important. The most abundant species should be listed last.

– Use the "Remove" button to remove "n2", followed by the "Add" button to replace n2 as the last species. Click "OK" (but don't close the mixture panel yet).

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 15 Release 14.5

Defining Materials [4] • Specify mixture.

– Modify the existing settings for "Thermal Conductivity" and "Viscosity" to be "mass–weighted–mixing–law".

– Click "Change/Create" to apply the changes.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 16 Release 14.5

Defining Materials [5] • Specify solid material.

– Select "Solid" under "Material Type", and edit (The default solid material is aluminum(al)).

– Modify "aluminum" ("Name", "Chemical Formula" & "Properties") as shown below.

– Click "Change/Create" and choose "No" for overwriting.

Selecting "No" preserves the original material ("aluminum") and adds the new material.

– Close the "Create/Edit Materials" panel.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 17 Release 14.5

Cell Zone Conditions • Set Cell Zone Conditions.

– Select "Cell Zone Conditions" from the Navigation Pane.

– Select "fluid_jet_fan", then "Edit...".

– Activate "Source Terms".

– Select the "Source Terms" tab and click on "Edit" for "Y Momentum".

– Add "1 source", select "constant" and enter a value of "–80 [N/m3]".

– Click "OK" in both panels.

Introduction part 1: long version Setup Solving Proceed to Part 2.

We need to account for the air movement produced by the ceiling jet fan. Here we have done this by adding momentum to the cell zone local to the jet. The advantage of this technique (over using a pair of velocity boundary conditions) is that we preserve the species (smoke) concentration through the fan. If we had used velocity boundary conditions, we would have needed a UDF to find the concentration at the intake to the jet fan and apply that to the jet fan discharge.

© 2012 ANSYS, Inc. September 19, 2013 18 Release 14.5

Boundary Conditions (Air Inlet) [1] • Set Boundary Conditions.

– Select "Boundary Conditions" from the Navigation Pane.

– Double–click "velocity_inlet_fresh_air" from the "Zone" list.

– Apply "Momentum" and "Thermal" settings as shown.

– Continued on next slide...

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 19 Release 14.5

Boundary Conditions (Air Inlet) [2] • Set Boundary Conditions.... Cont.

– Apply "Species" settings as shown.

– Click "OK".

Introduction part 1: long version Setup Solving Proceed to Part 2.

The mixture species contains 4 components (h2o, o2, co2, and n2). The most abundant species (n2) was entered last when the mixture was defined. You do not need to enter a mass fraction for n2. It will automatically account for the remaining fraction not used by the first three (in this case 0.77).

© 2012 ANSYS, Inc. September 19, 2013 20 Release 14.5

Boundary Conditions (Air Outlet) • Set Boundary Conditions.

– Double click "pressure_outlet_all_air" from the "Zone" list.

– For "Momentum", set "Turbulence" to "5% intensity", and "viscosity ratio 5".

– For "Thermal", set the "Temperature" to "293.15 K" (as for previous BC).

– For "Species", set the "o2 concentration" to "0.23".

– Click "OK".

Introduction part 1: long version Setup Solving Proceed to Part 2.

So long as there is only flow out of the domain here, these values for turbulence, temperature and species will not be needed. However during the solution process there may be some inflow though this boundary, and therefore Fluent needs to know what values to apply.

© 2012 ANSYS, Inc. September 19, 2013 21 Release 14.5

• Set Boundary Conditions.

– Double click "mass_flow_inlet_car_fire_source" from the "Zone" list.

– "Momentum": "Mass flow rate" to "0.1 [kg/s]", "normal to boundary".

– "Turbulence": "5% Turbulent Intensity", "Turbulent Viscosity Ratio 5".

– "Thermal": "1200K".

– "Species":

set "specify in mole fractions"

with "0.65 h2o" and "0.35 co2".

– "OK".

Boundary Conditions (Fire Source)

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 22 Release 14.5

Boundary Conditions (Walls) [1] • Set Boundary Conditions.

– Double click "walls_outer" from the "Zone" list.

– Apply "Thermal" settings as shown.

– Click "OK".

The Shell Conduction option enables

thin walls to solve for heat transfer in

both the normal and planar

directions without the need to

volume mesh them.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 23 Release 14.5

Boundary Conditions (Walls) [2] • Set Boundary Conditions.

– Select "Copy" from the "Boundary Conditions" Pane.

– Select "walls_outer" in the "From Boundary Zone" list and "wall_ceiling" and "wall_floor" in the To Boundary "Zones" list.

– Click "Copy", click "OK" in the question dialog box then "Close".

– This will copy all boundary settings from the boundary zone wall to both wall_ceiling and wall_floor.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 24 Release 14.5

Operating Conditions [1] • Set operating conditions.

– Select "Operating Conditions".

– Apply "Specified Operating Density" settings as shown.

– Click "OK".

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 25 Release 14.5

Operating Conditions [2] • Notes.

– ANSYS Fluent avoids the problem of roundoff error by subtracting the operating pressure (generally a large pressure roughly equal to the average absolute pressure in the flow) from the absolute pressure, and using the result (termed the gauge pressure). The absolute pressure is simply the sum of the operating pressure and the gauge pressure.

– Operating temperature is only used when using the Boussinesq density model, so in this case, it has no meaning.

– Operating density is also a value for avoiding roundoff errors. For simulations where pressure boundary conditions are present it is important to set the value correctly otherwise the pressure at the boundary will be incorrect and may lead to unphysical flow conditions. Here you have to set it to the density for the conditions at the pressure–inlet – a gas at 293.15 K with 23% O2 and 77% N2. You can initialize your flow field with these conditions to get the value for the operating density from the postprocessor (e. g. Reports –> Volume Integral). See the Users Guide "Natural Convection and Buoyancy–Driven Flows" for more details.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 26 Release 14.5

Solution Methods • Set solution methods [1].

– Select "Solution Methods" from the Navigation Pane.

– For "Pressure–Velocity Scheme", set to "Coupled".

– Under "Spatial Discretization" set "Pressure" to "Body Force Weighted".

– The Body Force Weighted scheme is recommended for problems involving large body forces.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 27 Release 14.5

Solution Controls • Set solution controls [2].

– Select "Solution Controls" from the Navigation Pane.

– Set the values shown below. – "Flow Courant Number" = 50. – "Density" = 1. – "Body Forces" = 1. – "Turbulent Kinetic Energy" = 0.5. – "Turbulent Dissipation Rate" = 0.5. – "Turbulent Viscosity" = 0.7. – "h2o" = 1. – "o2" = 1. – "co2" = 1. – "Energy" = 1.

Lower Under–Relaxation Factors will reduce the solution change between iterations leading to more stable convergence though requiring more iterations to reach convergence.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 28 Release 14.5

Monitors [1] • Set solution monitors.

– Select "Monitors" from the Navigation Pane.

– Click "Edit" and set the "Residual Monitors" as shown below.

– By default ANSYS Fluent will plot residuals to the window and print to the console. The default setting for the convergence criterion is Absolute which means that the solver will continue until all residuals fall below the Absolute Criteria values specified in the Equations box. Switching the Convergence Criterion to none will cause the solver to continue until a maximum number of iterations is reached.

– Click "OK".

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 29 Release 14.5

Monitors [2] • Set surface monitors [1].

– Under "Surface Monitors", click "Create".

– It is important to ensure that solution variables have converged to sensible stable values. Creating Surface Monitors enables solution values of interest to be monitored on specific surfaces within the domain.

– Set the Surface Monitor as shown below and click "OK".

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 30 Release 14.5

Monitors [3] • Set surface monitors [2].

There are many different types of calculations that can be performed over surfaces listed under Report Type.

– Create a monitor for the "Integral" of the "Total Surface Heat Flux" on the surface "wall_floor" plotting to "window 3" and "printing" to the console, as shown below.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 31 Release 14.5

Monitors [4] • Notes on monitors

Buoyancy driven flows often show transient behavior. For this reason, the residuals will often oscillate. Because of this, convergence should always be judged by solution variable monitors and flux reports. The residuals will however give an indication of overall convergence behavior and stability.

In cases of an oscillating steady state solution, a common approach is to continue the simulation in transient mode. In many cases the oscillations will reduce significantly after a few time steps.

The use of surface/volume monitors combined with residuals will provide the best overall judge of solution convergence.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 32 Release 14.5

• Set initialization values. – Select "Solution Initialization" and "Hybrid Initialization".

– "Hybrid Initialization" performs a basic flow simulation (Laplace equation) to set up the initial flow field. Simplified momentum and pressure equations are solved, and so the general flow field can be quickly determined (unlike standard initialization which puts a constant value in each grid cell). By having a more realistic starting point, less work will be needed by the solver to converge the model.

– Select "More Settings", and for "Species Settings", define the "initial o2". concentration to be "0.23", then "OK".

– Only flow and pressure equations are being solved with the "Hybrid" method, so we need to set a realistic, although constant, value for species.

– Select "Initialize", and watch the TUI window for progress.

Solution Initialization

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 33 Release 14.5

Running the Simulation This simulation will take a long time to compute a converged solution – this is not unusual

for such ventilation/natural convection cases. There are natural unsteady features in the flow and the equation set is somewhat "stiff" to converge.

• If you want to run the simulation yourself, set to run for 1000 iterations, and keep an eye on the solution progress.

• Alternatively, just import the results (data) file supplied with this workshop. "File>Import>Data>car_and_garage_1000its.dat.gz".

• You can reproduce the residual graph shown below by:

"Monitors>Residuals>Select "Residuals" then "Edit". Press the "Plot" button.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 34 Release 14.5

Check Convergence Select Reports from the Navigation Pane and select Fluxes under Reports. Click Setup. In the Flux Reports panel select the Mass Flow Rate and select the inlet/outlet

boundaries (shown below) then click compute. Note that the Net Results indicate the results are mostly, but not completely converged. It is likely that there are some unsteady effects present that may necessitate going to a transient (time dependent) simulation. This will be discussed in a later lecture. Note that the energy balance can be checked in a similar way by selecting "Total Heat Transfer Rate".

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 35 Release 14.5

Exit Close Fluent.

Close ANSYS Fluent by selecting "File>Close Fluent".

ANSYS Fluent contains basic built in post processing capabilities which can be used to quickly assess results graphically and numerically during and after the solution.

CFD POST is a powerful separate post processing application containing many more advanced features. The remainder of this workshop will introduce some features of CFD POST.

Introduction part 1: long version Setup Solving Proceed to Part 2.

© 2012 ANSYS, Inc. September 19, 2013 36 Release 14.5

Postprocessing in CFD_POST

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 37 Release 14.5

Learning Aims:

This workshop is designed to teach a range of skills in postprocessing Fluent results files using CFD–Post. Topics to be covered include:

• Creating surface groups. – Creating line graphs.

• Creating isosurfaces. – Creating expressions (CEL).

• Creating portable (.cvf) images. – Performing integrals.

• Creating automatic reports. – Volume rendering.

Learning Objectives:

To understand the ways in which CFD Post can be used both for high quality images, as well as producing quantitative data from volume/surface integrals, and writing custom functions.

I Objectives (Post Processing)

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 38 Release 14.5

Starting CFD–POST If you are doing the long version of this workshop:

• Go to the ANSYS Workbench project page. • Under "Component Systems", pick "Results" and drag onto the desktop. • Draw a line from the "Solution" cell of the "FLUENT" system to the "Results" cell (see

image).

• Start CFD–Post by clicking on the "Results" cell. If you are doing the short (postprocessing only) version of this workshop: • Start CFD Post from the "Start" menu:

"Start Menu>ANSYS 14.5>Fluid Dynamics>CFD–Post 14.5". • Within CFD–Post, select "File>Load Results" and pick the supplied file:

"car_and_garage_1000its.cas.gz".

• Press "OK" to the pop–up window.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 39 Release 14.5

Post Processing – Wall Temperature [1] • Add a "Location" representing a group of surfaces.

This lets you group a selection of entitles (in this case walls) and apply the same post–processing treatment to all items in the group.

Select "Locations>Surface Group", and enter the name "Walls".

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 40 Release 14.5

Post Processing – Wall Temperature [2] • Define "Location" details.

The details of the new location will be displayed in the bottom left pane.

Select Locations, click on "…" and select all walls EXCEPT "wall_car" (CTRL–click to multiple select).

Click "OK" in the "Location Selector".

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 41 Release 14.5

Postprocessing – Wall Temperature [3] Apply contour plot to Location.

Click the contour icon.

Select the "Color" tab, click on "Mode" and select:

"Variable": "Temperature".

"Range": "Local".

"Apply".

Modify the "Legend".

Select "Default Legend".

Under "Appearance":

"Precision": "1".

Change "Scientific"

to "Fixed".

"Apply".

This option has allowed us to produce a temperature contour plot of identical colour range on a group of surfaces.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 42 Release 14.5

Postprocessing – Generating a Figure Generate a figure for use later in a report.

– Click the "Figure" icon .

– Enter name "Figure 1 Wall Temperature".

– "OK" to the "Insert Figure" panel.

Remember where this option is (you will be asked to use it several times on subsequent slides). We will be creating several figures as we progress through this workshop. Later on we will demonstrate how to use these figures to automate report–writing.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 43 Release 14.5

Postprocessing – Section Plane [1] • Add a Location representing a section plane.

Select "Locations>Isosurface"

In the pop–up window Enter name "xzplane" and click "OK".

Under "Geometry" tab set "Definition" "Variable" to "Y".

Value to "9 [m]".

Click "Apply".

In the model outline tree,

de–select the "Walls" option

so only the new slice plane

is visible.

Continued on next slide…

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 44 Release 14.5

Postprocessing – Section Plane [2] Under "Color" set the "Variable" to "Temperature".

Under "Render" disable "Lighting", then "Apply" to display.

Generate a new "Figure", and name it "Figure 2 Temperature Slice".

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 45 Release 14.5

Postprocessing – Quick Animation The slice through the model gives us a useful indication of what is happening in the

middle of the domain. A "quick animation" will transverse this slice through the model so we can see what is happening elsewhere.

Click the "Animation" button in the top toolbar:

Select "Quick Animation".

Highlight the object "xzplane“.

Press the Play button , and watch the display.

When finished, use the stop button then "Close".

If required, this animation could be saved to disk in MPEG/AVI formats. The alternative to "Quick Animation" is "Keyframe Animation". To use this you set a series of key animation frames. These might have different objects visible, different points in a transient simulation, or might have the model rotated at a different viewing angle. The animation will progress smoothly between these states.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 46 Release 14.5

Postprocessing – 3D Isosurface [1] First, change the look of the display:

Hide the plane "xzplane" previously created by un–ticking in the model tree.

Expand the top of the model tree, expanding "fluid_main_garage".

Double–click on "wall_car".

Make sure the details box shows ("wall_car"), if not you will be modifying the wrong object!

For "Color" select constant, and pick "Yellow".

"Apply".

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 47 Release 14.5

Postprocessing – 3D Isosurface [2] Add a 3D Isosurface representing gases.

Select "Locations>Isosurfaces".

Keep the default name "Isosurface 1".

Set the Variable to "Co2.Mass.Fraction" and the value to "0.001".

Set "Color" to be "constant" (keep default grey colour), then "Apply".

Generate a new Figure: "Figure 3 CO2 Isosurface".

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 48 Release 14.5

Postprocessing – Streamlines Add 3D streamlines to visualize flow.

Hide the isosurface created in the previous step (un–tick in model tree).

Click the "Streamline button" and keep default name ("Streamline 1").

Start From: "velocity_inlet_fresh_air".

"# Points": "100".

Under "Color" set:

"Mode": "Use Plot Variable".

"Range": "Local".

"Apply".

Generate a new Figure of this image

"Figure 4 Streamlines".

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 49 Release 14.5

Postprocessing – Portable CVF Files [1]

Not only can CFD–Post export regular image formats (*.jpg/*.png), but in addition 3D images can be saved. These images have the file extension *.cvf.

They can be viewed using a free CFD viewer that can be downloaded from the ANSYS website. (Go to www.ansys.com, and search for "CFD Post Viewer").

No license is required to use the viewer, so you can install this on any computer (e.g. laptop used for presentations, or ask your client/customer to also download and install a copy).

The 3D image can be viewed using rotate/pan/zoom functionality just as in CFD–Post, and can also be embedded in MS–Powerpoint. However the user cannot modify the image, they cannot add/remove objects from the image, or alter color ranges.

This is a really powerful tool for when you come to present your project work. In many cases a 2D jpeg image cannot explain 3D flow features. However rotating the model "live" in front of your audience will help convey your findings.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 50 Release 14.5

Postprocessing – Portable CVF Files [2]

• In CFD–Post, click the "camera" icon:

• For Format, select "CFD–Viewer State(3D)".

• Click the folder icon to the right of the filename.

Pick the directory you are working in (remember this!).

Save as filename "car–streamlines.cvf".

Click "Save" in both windows.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 51 Release 14.5

Postprocessing – Portable CVF Files [3]

• Minimise CFD Post, and use Windows Explorer to browse to the folder used on the last slide.

• Note how this file ("car–streamlines.cvf") is quite small (in this case about 170kB, and therefore easy to email to your client or manager).

• Double–click to open this file (it will take a few moments to launch the viewer application).

If you have ANSYS R14.5 installed on your machine, your computer will already have the viewer, and will recognize this file extension. You only need to do a separate installation of CFD–Post Viewer (from the ANSYS website) on machines that do not have Workbench installed.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 52 Release 14.5

Postprocessing – Portable CVF Files [4]

• CFD Post Viewer will look just like the graphical window of CFD post.

• Use left mouse button to rotate.

• Middle mouse button (or wheel) to zoom.

• Right mouse button to translate.

• Type question mark "?" for a list of hotkeys.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 53 Release 14.5

Postprocessing – Volume Rendering • Close the standalone viewer and return to CFD–Post.

• Hide the streamlines plot by un–ticking in model view.

• Select "Volume Rendering", and use name "Gas Cloud".

Under "Geometry", set "Co2.Mass Fraction".

Keep range as "Default", then "Apply".

To make it easier to see the image, change the screen background colour to white:

"Edit>Options>CFD Post>Viewer".

Set "Color Type" to "Solid".

Pick "White" from the color options.

"OK".

This option applies a variable colour and transparency to each grid cell depending on the plot variable. For applications like this involving smoke movement it makes it easy for the eye to assess where the cloud is concentrated.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 54 Release 14.5

Postprocessing – Quantitative

Until now we have used CFD Post to create colour images to help interpret the CFD results Next we will look at some quantitative techniques for extracting numerical data (volume integrals), and producing line graphs. It is also possible to write your own arithmetic expressions for custom post–processing.

Create a line through the model: • Hide the "Gas Cloud" volume rendering. • "Locations>Line" and keep default name "Line 1". • Set "Method Two Points".

• From X=17.5 Y=3 Z=2. • To X=17.5 Y=18 Z=2.

• Set "40 samples" along this line. • "Apply".

This has created a horizontal line through the model, Passing above the car engine fire.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 55 Release 14.5

Postprocessing – Line Graph [1]

• Select the "Chart Icon" from the top Toolbar. • Keep the Default name "Chart 1" then "OK".

• Under "General", set the Title to "Temperature Profile". • Under "Data Series" Set location to "Line 1". • Under "X Axis", set variable to "Y". • Under "Y Axis" set variable to "Temperature". • "Apply".

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 56 Release 14.5

Postprocessing – Line Graph [2]

The resulting graph looks like this:

The computation domain exists from: 3m < y < 18m

The car (and fire source) is located at:

8m < y < 10m

The jet fan is located at: 13m < y < 15m

Notice that the peak temperature is located not above the middle of the car (y=9m) but moved some distance to the left (circa y=8m). This is a direct effect of the air movement from the jet fan.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 57 Release 14.5

Postprocessing – Volume Integrals

The only source of carbon dioxide (co2) in the model is from the car fire source (the inlet just comprises oxygen and nitrogen). We will perform a volume integral to find out how much co2 is present in the model. • Select "Calculators" tab. • Select "Function Calculator". • "Function": "VolumeInt" (for "Volume Integral"). • "Location": "fluid_main_garage". • "Variable": "Co2.Mass.Fraction". • Press "Calculate".

The result is about 0.93 [m3] of CO2.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 58 Release 14.5

Postprocessing – Expressions [1a]

It is possible to write your own arithmetic functions for post–processing, making use of the data exported by the solver. The resulting expression may either return a single value (first example, below), or produce a quantity that varies spatially for use in a contour plot/line graph (second example, to follow). • Select "Expressions" tab. • Right click in the window and select "New". • Enter name "PressureDrop" then "OK" • Enter the expression exactly as shown below, then "Apply" • The answer is approximately "35Pa" If you get any errors look at the next slide now, which will help you understand why.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 59 Release 14.5

Postprocessing – Expressions [1b]

• Note how "Pressure" turns to italics as soon as you type it.

• It is important to make the first letter a capital "P".

• For a full list of available variables, right click in this window and select Variables.

• This is the name of the boundary that you are performing the average function on.

• For a full list of locations, right–click and select "Locations".

• Note that to compute the pressure drop, we did not need to subtract the outlet boundary pressure: "ave(Pressure)@pressure_outlet_all_air".

The outlet boundary was set to be a pressure outlet in Fluent with a pressure of 0 Pa. This term would return a zero value – try it if you like!

• "ave" returns the average at the location specified by the "@".

• For a list of functions available, right–click in the window and select "Functions>CFD–Post".

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 60 Release 14.5

Postprocessing – Expressions [2a]

The procedure to create an expression that can be plotted spatially is very similar, there is just one additional step to assign it to a variable. As a simple example, lets convert temperature from K to °C and plot this on the graph. • "Expressions>New>name" "TemperatureConversion". • Enter the expression "Temperature/1[K]-273.15" then "Apply".

Note: • Initial capitals for Temperature. It will turn to italics if correct. • Expressions must balance dimensionally.

• We cannot just enter "Temperature-273.15" since Temperature has a unit [K] • By dividing by 1 [K] we remove the temperature unit.

• We could instead enter "Temperature-273.15[K]" This expression is valid, but

would return a value with units [K] which would be misleading.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 61 Release 14.5

Postprocessing – Expressions [2b]

Expressions cannot be plotted directly, they need to be assigned to a Variable. • "Variables>New" Enter name "TemperatureC". • From the pull down list, select the expression "TemperatureConversion" created on the last slide. • Select "Apply".

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 62 Release 14.5

Postprocessing – Expressions [2c]

Use this new temperature on the Chart created earlier. • (Top–Left) select "Outline" then

double–click on "Chart 1".

• Under "Y Axis" change the variable by clicking on the "..." icon.

• Select this expression "TemperatureC".

• "OK" then "Apply".

• At the bottom of the screen change from "3D Viewer" to "Chart Viewer".

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 63 Release 14.5

Postprocessing – Expressions [2d]

The graph now shows the result of our expression:

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 64 Release 14.5

Postprocessing – Reports

• In the options below the graphic window, select "Report Viewer".

• Select "Refresh".

• Review what is shown in the report

window. You can see: Names of the results file. Mesh summary. List of Boundary conditions. All the Figures and Charts

produced during this workshop. • If you select "Publish" this will be

written out in html format, along with copies of all the results images.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 65 Release 14.5

State Files and Optional Extra Work [1]

• Use "File>Save state as..." and save to your working directory. This state file stores all the post–processing settings you have created. If you have done the long version of this workshop, you will recall that we ran for a fixed number of iterations, and wanted to examine the results to help us determine if the model had converged or not. (The residuals were "stuck" and further iterations would not lower the residuals). It might be necessary to revisit the model setup, by moving to a transient scheme, or modifying the modelling settings. A useful assessment of convergence is to see if the results of interest remain unchanged as the solver settings are enhanced. The big advantage of having this state file is that if you choose to modify the solver settings and re–run this model, you can quickly reproduce the equivalent post–processing images. Simply load the new results file, then load this state file. Likewise, it is common in project work to have run a series of models to test the different operating conditions. This technique will let you generate equivalent images so as to produce a good like–for–like comparison in your presentation/report.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 66 Release 14.5

State Files and Optional Extra Work [2]

• The "Reports" feature just demonstrated will let you customise the format of your report.

• If you have finished this exercise ahead of the rest of the class, try experimenting with the "Report" options in the left–hand toolbar.

• You can choose which objects are visible, add your own company logo, or add lines of text to explain the content of the report.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary

© 2012 ANSYS, Inc. September 19, 2013 67 Release 14.5

Wrap–Up

• CFD–Post is a very powerful post–processing tool, and capable of producing high quality images quickly and easily.

• In this workshop we have shown how to produce contour plots, streamlines, and isosurfaces (as seen in some other workshops for this course).

• In addition you have used CFD–Post to perform volume integrals, create line graphs, and to create your own arithmetic expressions for post–processing.

• 3D images can be saved to disk, and viewed in a freeware viewer. This adds much impact to presentations, and can be run on any computer (no license needed).

• CFD–Post can also automate the report generation process.

• Postprocessing is best learnt by practice. If you have time now, try exploring the other buttons in the interface.

Part 2: Postprocessing Colour Images Line Graphs Expressions and Integrals Reports Summary