express introductory training in ansys fluent€¦ · •the different boundary condition types in...

61
© 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 Lecture 2 Boundary Conditions & Solver Settings Dimitrios Sofialidis Technical Manager, SimTec Ltd. Mechanical Engineer, PhD

Upload: others

Post on 06-Mar-2021

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

© 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

Lecture 2

Boundary Conditions & Solver Settings

Dimitrios Sofialidis

Technical Manager, SimTec Ltd.

Mechanical Engineer, PhD

Page 2: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

14.5 Release

Introduction to ANSYS Fluent

Lecture 2 Boundary Conditions & Solver Settings

Page 3: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Introduction

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

Lecture Theme: The problem definition for all CFD simulations includes boundary conditions,

cell zone conditions and material properties. The accuracy of the simulation results depends on defining these properly.

Learning Aims: You will learn:

•How to define material properties. •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including solid zones and

porous media. •How to specify well–posed boundary conditions.

Learning Objectives: You will know how to perform these essential steps in setting up a CFD

analysis.

Part 1. Boundary Conditions

Page 4: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Introduction

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

Lecture Theme: The problem definition for all CFD simulations includes boundary conditions,

cell zone conditions and material properties. The accuracy of the simulation results depends on defining these properly.

Learning Aims: You will learn:

•How to define material properties. •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including solid zones and

porous media. •How to specify well–posed boundary conditions.

Learning Objectives: You will know how to perform these essential steps in setting up a CFD

analysis.

Page 5: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Material Properties

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• FLUENT provides a standard database of materials and the ability to create a custom user–defined database.

• Your choice of physical models may require multiple materials and dictate which material properties must be defined. – Multiphase (multiple materials).

– Combustion (multiple species).

– Heat transfer (thermal conductivity).

– Radiation (emissivity and absorptivity).

• Material properties can be customized as function of temperature, mass fraction or pressure (density). – Use of other solution variable(s) requires a User–Defined Function (UDF).

Page 6: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Materials Databases

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• FLUENT materials database – Provides access to a number

of pre–defined fluid, solid and mixture materials.

– Materials can be copied to the case file and edited if required.

• User–Defined material database – Custom databases can be created, accessed

and modified from the standard materials panel in FLUENT

Page 7: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Fluid Density

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• For incompressible flow with = constant. – Select constant for density.

• Ideal gas properties – Incompressible flow, = f(T).

• Polynomial or piecewise–polynomial function of temperature.

• Incompressible ideal gas law ( = poperating/RT).

– Set poperating close to the mean pressure in the problem see Slide 8.

– Compressible flow, = f(p,T)

• Use ideal–gas for density ( = pabsolute/RT).

– For low–Mach–number flows, set poperating close to mean pressure of the problem to avoid round–off errors.

– Use Floating Operating Pressure for unsteady flows with large, gradual changes in absolute pressure (segregated solver only).

Page 8: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Options for Defining Common Properties

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

Density – Constant. – Incompressible Ideal Gas. – Ideal Gas. – Real Gas (5 Built–in Models). – Temperature Dependent1. – Boussinesq. – User–defined.

Viscosity – Constant. – Temperature–Dependent1. – Sutherland. – Power Law. – Kinetic Theory. – Non–Newtonian (4 Built–in Models). – User–defined.

Thermal Conductivity – Constant. – Temperature–Dependent1. – Kinetic Theory. – User–defined.

Specific Heat – Constant. – Temperature–Dependent1. – User–defined.

1 Temperature–Dependent options include definition of properties as piecewise linear, polynomial or piecewise polynomial functions temperature.

Page 9: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Operating Pressure

Ex. 2: Poperating= 100,000 Pa

Pressure Pressure

Ex. 1: Poperating= 0 Pa

Pref

Prel,max=100,001 Pa

Prel,min=99,999 Pa

Prel,max=1 Pa

Prel,min=-1 Pa

Pref

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• Represents the absolute pressure datum from which all relative pressures are measured.

Pabsolute = Poperating + Prelative

– Pressures specified at boundary conditions and initial conditions are relative to the Operating Pressure.

• Used to avoid problems with round–off errors which occur when the dynamic pressure differences in a fluid are small compared to the absolute pressure level.

Page 10: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Cell Zones and Boundary Zones

Simple 3D mesh

Boundary

Face

Cell

Cell zone conditions are applied to all cell zones. Boundary conditions are applied to all boundary zones.

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• The mesh consists of a large number of finite volumes, or cells.

• The cells are grouped into one or more cell zones. – For instance in a conjugate heat transfer

calculation there may be one cell zone for the fluid region and a second cell zone for the solid material.

• Each cell is bounded by a number of faces.

• These faces are grouped into a number of face zones.

• Some of these faces are located on the boundaries of the model.

• The zones to which such faces belong are called boundary zones.

Page 11: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Cell Zones

• A fluid cell zone, or more simply, a fluid zone, is a group of cells for which all active equations are solved.

e.g. A simulation of a copper heating coil in water

will require a fluid zone and a solid zone Using

water properties, the equations of flow and heat

transfer will be solved in the fluid zone Using

copper properties, only the heat transfer equation

will be solved in the solid zone.

e.g. To account for rotational motion, the rotor is

placed in a rotating domain. The rotor fluid zone

will use equations in the rotating frame of

reference. The stator fluid zone will use

equations in the stationary frame of reference.

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

Page 12: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Cell Zone Definition – Fluid

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• Fluid material selection is required – For multiple species or multiphase

flows, the material is not shown Instead, the fluid zone consists of the mixture of the phases.

• Optional inputs – Frame/Mesh Motion.

– Porous region.

– Source terms.

– Laminar region.

– Fixed Values.

Page 13: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Cell Zone Definition - Porous Media

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• A porous zone is a special type of fluid zone – Enable "Porous Zone" option in the "Fluid" panel.

– Pressure loss in flow determined via user inputs of resistance coefficients to lumped parameter model.

• Used to model flow through porous media and other uniformly distributed flow resistances. – Packed beds.

– Filter papers.

– Perforated plates.

– Flow distributors.

– Tube banks.

• Inputs are directional viscous and inertial resistance coefficients.

Page 14: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Cell Zones Definition – Solid

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• A solid zone is a group of cells for which only the heat conduction equation is solved. Flow equations are not solved.

– The only required input is the Material Name

(defined in the Materials panel).

– Optional inputs allow you to set volumetric heat generation rate (Heat Source).

– Motion can be defined for a solid zone.

– Rotation axis must be specified if the solid zone is rotating or if rotationally periodic boundaries are adjacent to the solid zone.

Page 15: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Defining Boundary Conditions

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• To define a problem that results in a unique solution, you must specify information on the dependent (flow) variables at the domain boundaries. As the governing equations are differential and their solution requires integration, the boundary conditions are the mathematical equivalent of the constant of integration, the value of which is required to gain a unique solution.

– Specify fluxes of mass, momentum, energy, etc. into the domain.

• Poorly defined boundary conditions can have a significant impact on your solution (you are solving "another" problem).

Page 16: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Defining Boundary Conditions

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• Defining boundary conditions involves: – Identifying types (e.g., inlets, walls, symmetry).

– Identifying location.

– Supplying required data depending on type, location and physical model.

• Choice depends on: – Geometry.

– Availability of data.

– Numerical considerations.

Page 17: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Available Boundary Condition Types

• External Boundaries – General.

• Pressure Inlet. • Pressure Outlet.

– Incompressible .

• Velocity Inlet. • Outflow (not recommended) .

– Compressible.

• Mass Flow Inlet. • Pressure Far Field.

– Other.

• Wall. • Symmetry. • Axis. • Periodic.

– Special.

• Inlet/Outlet Vent. • Intake/Exhaust Fan.

• Internal Boundaries – Fan. – Interior. – Porous Jump. – Radiator. – Wall.

orifice

outlet

inlet

plate

plate-shadow

wall

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

Page 18: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Changing Boundary Condition Types

• Zones and zone types are initially defined in the preprocessing phase.

• To change the boundary condition type for a zone: – Choose the zone name in the Zone list.

– Select the type you wish to change it to in the Type pull-down list.

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

Page 19: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Setting Boundary Condition Data

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• Explicitly assign data in BC panels. – To set boundary conditions for particular zone:

• Select "Boundary Conditions" in the project tree.

• Choose the boundary name in the Zone list.

• Click the "Edit…" button.

– Boundary condition data can be copied from one zone to another.

• Boundary conditions can also be defined by User–Defined Functions (UDFs) and profiles. – Profiles can be generated by:

• Writing a profile from another CFD simulation.

• Creating an appropriately formatted text file with boundary condition data.

• See Lecture 11 for details of UDFs.

• See Appendix for details of using profiles.

Page 20: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Velocity Inlet

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• Velocity Specification Method. – Magnitude, Normal to Boundary.

– Components.

– Magnitude and Direction.

– Turbulence quantities (if applicable).

– Thermal conditions (if applicable).

• Applies a uniform velocity profile at the boundary ,unless UDF or profile is used.

• Velocity Magnitude input can be negative,

implying that you can prescribe the exit velocity.

• Velocity inlets are intended for use in incompressible flows and are not recommended for compressible flows.

Page 21: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Pressure Outlet • Required information

– Gauge Pressure (static) – static pressure of the

environment into which the flow exits.

• Specified pressure is ignored if flow is locally

supersonic at the outlet.

– Backflow quantities – used as inlet conditions if/when backflow occurs (outlet acts like an inlet).

• Can be used as a "free" boundary

in an external or unconfined flow.

• Target Mass Flow Rate Option can be applied.

• Suitable for compressible and incompressible flows

– Non-reflecting outlet boundary conditions (NRBC) are available for ideal gas (compressible) flow.

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

Page 22: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

• In viscous flows, no–slip condition is applied at walls. – Shear stress can be applied.

– Wall roughness can be defined for turbulent flows.

• Modification of the Logarithmic Standard Wall Function.

• More information in moving zone and heat transfer presentation.

Wall Boundaries

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

Page 23: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Symmetry and Axis Boundaries

Symmetry

Planes

Axis

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• Symmetry Boundary. – No inputs are required.

– Flow field and geometry must be symmetric:

• Zero normal velocity at symmetry plane.

• Zero normal gradients of all variables at symmetry plane.

• Must take care to correctly define symmetry boundary locations.

• Axis Boundary. – Used at the center line for 2d axisymmetric problems.

– No user inputs required.

– The axis boundary must coincide with the x–axis.

Page 24: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Periodic Boundaries

• Used to reduce the overall mesh size.

• Flow field and geometry must contain either rotational or translational periodicity.

– Rotational periodicity • ΔP = 0 across periodic planes.

• Axis of rotation must be defined in fluid zone.

– Translational periodicity • ΔP can be finite across periodic planes.

• Models fully developed conditions.

• Specify either mean ΔP per period or net mass flow rate.

• Periodic boundaries can be either conformal or non–conformal.

– See next two slides.

Translationally

periodic

planes.

2D Tube Heat Exchanger.

Flow

Rotationally

periodic

planes.

Page 25: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Internal Face Boundaries

• Defined on the cell faces only: – Thickness of these internal faces is zero.

– These internal faces provide means of introducing step changes in flow properties.

• Used to implement various physical models including: – Fans.

– Radiators.

– Porous–jump models.

• Preferable over porous media for its better convergence behavior.

– Interior walls.

Page 26: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Non–conformal Periodic Boundary Conditions

• Fluent permits the use of non–conformal rotationally periodic BCs.

• Non–conformal periodics do not require a matching mesh on the boundaries.

– Coupling of the periodic zones is accomplished using the same algorithms employed in non–conformal interfaces.

• Non–conformal periodic can now be created in the Create/Edit Mesh Interfaces GUI!

– Select Periodic Boundary Condition option and choose the Type (Translational or Rotational).

– Offset is computed automatically, but check this value to make sure it is evenly divisible into 360 deg!

Page 27: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

General Guidelines

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

• If possible, select inflow and outflow boundary locations and shapes such that flow either goes in or out normal to the boundaries. – Typically better convergence.

• Should not observe large gradients in direction normal to boundary. – Indicates incorrect set–up.

– Move the boundary further upstream or downstream so it is located away from gradients.

• Minimize grid skewness near the boundary. – Introduction of an error.

Page 28: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Fuel

Air

Manifold box 1 Nozzle

1

2 3

Specifying Well Posed Boundary Conditions

1 Upstream of manifold.

• Can use uniform profiles since natural profiles will develop in the supply pipes.

• Requires more elements.

2 Nozzle inlet plane.

• Requires accurate velocity profile data for the air and fuel.

3 Nozzle outlet plane.

• Requires accurate velocity profile data and accurate profile data for the mixture fractions of air and fuel.

• Consider the following case which contains separate air and fuel supply pipes.

• Three possible approaches in locating inlet boundaries:

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

Page 29: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

• When there is 1 Inlet and 1 Outlet:

– Most Robust: Velocity at inlet with static pressure at outlet (Velocity Inlet :: Pressure Outlet).

• The inlet total pressure is an implicit result of the prediction.

– Robust: Mass flow rate at inlet with static pressure at outlet (Mass Flow Inlet :: Pressure Outlet).

• The total pressure at the inlet will be adjusted to set the given mass flow.

– Sensitive to Initial Guess: Total pressure at inlet with static pressure at outlet (Pressure Inlet :: Pressure Outlet).

• The system mass flow is part of the solution.

– Very Unreliable:

• Total pressure or mass flow rate at inlet with Outflow boundary at outlet (Pressure Inlet :: Outflow or Mass Flow Inlet :: Outflow).

– This combination should not be used, because the static pressure level is not fixed.

– Mass Flow Inlet :: Outflow combination is ok if the density is constant.

• Velocity at inlet and velocity at outlet – system is numerically unstable.

Specifying Well Posed Boundary Conditions

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

Page 30: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Profile Boundary Conditions

• Select Profiles in the Boundary Conditions panel (left figure).

• After reading the profile, open the panel for the boundary where it is to be applied.

• Select the arrow and scroll down in the drop–down list until the desired profile is reached (right figure).

– The first three items in the list will usually be the coordinates of the profile variables – do not select these.

• Profiles can be created from experimental data by creating an appropriately formatted file.

– The file format details are in the User’s Guide.

Page 31: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Introduction

Introduction Material Properties Cell Zone Conditions Boundary Conditions Summary

Lecture Theme: The problem definition for all CFD simulations includes boundary conditions,

cell zone conditions and material properties. The accuracy of the simulation results depends on defining these properly.

Learning Aims: You will learn:

•How to define material properties. •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including solid zones and

porous media. •How to specify well–posed boundary conditions.

Learning Objectives: You will know how to perform these essential steps in setting up a CFD

analysis.

Part 2. Solver Settings (Convergence & Accuracy)

Page 32: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Lecture Theme:

Fluent requires inputs (solver settings) which tell it how to calculate the solution. By introducing the concepts of accuracy, stability and convergence, the purpose of each setting can be understood. Emphasis will be placed on convergence, which is critical for the CFD simulation.

Learning Aims: You will learn: How to choose the solver and the discretization schemes. How to initialize the solution. How to monitor and judge solution convergence and accuracy.

Learning Objectives:

You will be able to choose appropriate solver settings for your CFD simulation and be able to monitor and judge solution convergence.

Introduction

Introduction Solver Theory Initialization Convergence Summary

Page 33: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Solution Procedure Overview • The sketch to the right shows the

basic workflow for any simulation.

• This lecture will look at all the items in the chart. – Solution parameters.

• Choosing the solver. • Discretization schemes.

– Initialization. – Convergence.

• Monitoring convergence. • Stability.

– Setting Under–relaxation. – Setting Courant number. – Setting Pseudo–timestep.

• Accelerating convergence.

– Accuracy. • Higher Order Numerical Schemes. • Appropriateness of BCs. • Grid Independence. • Adaption.

No

Set the solution parameters

Initialize the solution

Enable the solution monitors of interest

Modify solution

parameters or grid Calculate a solution

Check for convergence

Check for accuracy

Stop

Yes

Yes

No

Introduction Solver Theory Initialization Convergence Summary

Page 34: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Available Solvers

Segregated Coupled Implicit

Solve Mass

Continuity;

Update Velocity

Solve U–Momentum

Solve V–Momentum

Solve W–Momentum

Coupled

Solve Turbulence Equation(s)

Solve Species

Solve Energy

Solve Other Transport Equations as required

Solve Mass

& Momentum

Solve Mass,

Momentum,

Energy,

Species

Coupled–Explicit

Solve Mass,

Momentum,

Energy,

Species

Pressure–Based Density–Based

• There are two kinds of solvers available in Fluent. • Pressure–based.

• Density–based.

Introduction Solver Theory Initialization Convergence Summary

Page 35: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Pressure–based Solver (PBS)

• Pressure–based solvers.

– Velocity field is obtained from the momentum equation.

– Mass conservation (continuity) is achieved by solving a pressure correction equation. • Pressure–velocity coupling algorithms are derived by

reformatting the continuity equation.

• The pressure equation is derived in such a way that the velocity field, corrected by the pressure, satisfies continuity.

– Energy equation (where appropriate) is solved sequentially.

– Additional scalar equations are also solved in a segregated (sequential) fashion.

Segregated

Solve Mass

Continuity;

Update Velocity

Solve U–Momentum

Solve V–Momentum

Solve W–Momentum

Coupled

Solve Turbulence Equation(s)

Solve Species

Solve Energy

Solve Other Transport Equations as required

Solve Mass

& Momentum

Pressure–Based

Introduction Solver Theory Initialization Convergence Summary

Page 36: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Density–based Solver (DBS)

• Density–based Solvers (DBS).

– The governing equations of continuity, momentum, and (where appropriate) energy and species transport are solved simultaneously (i.e., coupled together).

– Additional scalar equations are solved in a segregated fashion.

– The density–based solver can be run implicit or explicit.

Coupled Implicit

Solve Turbulence Equation(s)

Solve Other Transport Equations as required

Solve Mass,

Momentum,

Energy,

Species

Coupled Explicit

Solve Mass,

Momentum,

Energy,

Species

Density–Based

Introduction Solver Theory Initialization Convergence Summary

Page 37: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Choosing a Solver – Pressure Based

• The pressure–based solver (segregated) is applicable for a wide range of flow regimes from low speed incompressible flow to high–speed compressible flow. – Requires less memory (storage) compared to coupled solvers.

– Allows flexibility in the solution procedure – damping of all equations separately.

– Examples: Good for the majority of day–to–day applications; for convergence issues switch to PBCS or DBCS.

• The pressure–based coupled solver is applicable for most flows, and yields superior performance to the standard (segregated) pressure–based solver.

– Requires 1.5–2 times more memory

than the segregated solver.

– Examples: More demanding applications where pressure–velocity coupling rules convergence, e.g. high inertia or body forces.

Introduction Solver Theory Initialization Convergence Summary

Page 38: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

PBS: Pressure–Velocity Coupling

• Pressure–velocity coupling refers to the numerical algorithm which uses a combination of continuity and momentum equations to derive an equation for pressure correction when using the PBS.

• Five algorithms are available in Fluent.

– Semi–Implicit Method for Pressure–Linked Equations (SIMPLE).

• The default scheme, robust (memory–efficient).

– Coupled.

• Enable the Pressure–based coupled Solver (faster convergence than segregated).

– SIMPLE–Consistent (SIMPLEC).

• Allows faster convergence than SIMPLE for simple problems (allow high under–relaxation factors) (e.g., laminar flows with no physical models employed).

– Pressure–Implicit with Splitting of Operators (PISO).

• Useful for unsteady flow problems or for meshes containing cells with higher than average skewness.

– Fractional Step Method (FSM) for unsteady flows only.

• Used with the NITA scheme; similar characteristics as PISO (used in LES for example).

Introduction Solver Theory Initialization Convergence Summary

Page 39: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

PBS Segregated Procedure: URFs

• Implicit Under–Relaxation Factors (URFs) are used for SIMPLE, SIMPLEC, PISO. – The under–relaxation factor, α, is included to stabilize the iterative process for the

pressure–based solver.

– The final, converged solution is independent of the under–relaxation factor. • Only the number of iterations required

for convergence is dependent (rate of convergence).

• Default settings are suitable for a wide range of problems. – You can reduce the values when necessary (to avoid divergence or convergence difficulties).

– Appropriate settings are best learned from experience!

• Note : For the density–based solver, under–relaxation factors for equations outside the coupled set are modified as in the pressure–based solver.

Introduction Solver Theory Initialization Convergence Summary

Page 40: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

• Two main options to control convergence: – Piloted by Courant number: default =200.

• Can be reduced for more complex physics to 10–50 (multiphase, combustion).

– Pseudo–transient (similar to CFX solver).

• Pseudo time step is determined from velocity and domain size.

• User–specified: Characteristic physical time is chosen.

Pressure–Based Coupled Solver

Introduction Solver Theory Initialization Convergence Summary

Pseudo–transient:

Better convergence

for meshes with

large aspect ratio

cells.

Page 41: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Pressure–Based Coupled Solver: Convergence

• Pressure based coupled solver with default settings.

– Approximately 2250 iterations of SIMPLE (default) in 3.5 hours.

– Approximately 120 iterations of coupled 13 minutes.

Coupled: ~120 iterations SIMPLE: ~2250 iterations Rotating propeller 1500 rpm.

Introduction Solver Theory Initialization Convergence Summary

Page 42: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Choosing a Solver – Density Based

• The density–based solver is applicable when there is a strong coupling, or interdependence, between density, energy, momentum, and/or species.

• Density–Based Coupled Implicit. – The implicit option is generally preferred over explicit since explicit has a very strict limit on

time scale size (CFL constraint) as implicit does not have.

– Examples: High speed compressible flow with combustion, hypersonic flows, shock interactions.

• Density–Based Coupled Explicit. – The explicit approach is used for cases where the characteristic time scale of the flow is on

the same order as the acoustic time scale.

– Example: propagation of high–Mach shock waves, shock tube problem.

Introduction Solver Theory Initialization Convergence Summary

Page 43: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Discretization (Interpolation Methods)

• Field variables (stored at cell centers) must be interpolated to the faces of the control volumes.

• Interpolation schemes for the convection term:

– First–Order Upwind – Easiest to converge, only 1st–order accurate.

– Power Law – More accurate than first–order for flows when Recell < 5 (typically low Re flows).

– Second–Order Upwind – Uses larger stencils for 2nd order accuracy, essential with tri/tet mesh or when flow is not aligned with grid; convergence may be slower.

– Monotone Upstream–Centered Schemes for Conservation Laws (MUSCL) – Locally 3rd order convection discretization scheme for unstructured meshes; more accurate in predicting secondary flows, vortices, forces, etc.

– Quadratic Upwind Interpolation (QUICK) – Applies to quad/hex and hybrid meshes, useful for rotating/swirling flows, 3rd–order accurate on uniform Quad mesh.

Introduction Solver Theory Initialization Convergence Summary

Page 44: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Effects of Discretization

• If b = 0 we get the 1st–Order–Upwind convection scheme, i.e. no correction. – This is robust but only 1st–Order accurate.

– Sometimes useful for initial runs.

• If b = 1 we get the 2nd–Order–Upwind convection Scheme, i.e. with correction. – Additional Limiters must be added to guarantee the solution is

bounded (fC0<ff<fC1).

• The QUICK Resolution scheme 'maximizes' b throughout the flow domain while keeping the solution bounded.

1st–Order Upwind

Scheme

b = 0.

Flow is misaligned

with mesh.

2nd–Order

Scheme

b=1.00.

Theory

0

1

QUICK

Resolution

Scheme.

ff

0Cf 1Cf0dr

000 drC

RG

Cf fbff

Introduction Solver Theory Initialization Convergence Summary

Page 45: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Discretization (Interpolation Methods)

• Interpolation schemes for the diffusive term:

– Always central–differenced & 2nd–order accuracy.

Introduction Solver Theory Initialization Convergence Summary

Page 46: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Initialization

• Fluent requires that all solution variables be initialized before starting iterations. – A realistic initial guess improves solution stability and accelerates convergence.

– In some cases a poor initial guess may cause the solver to fail during the first few iterations.

• Five ways to initialize the flow field.

– Standard initialization.

– Patch values.

– Hybrid initialization (solves potential equation).

– FMG initialization (solves Euler equations).

– Starting from a previous solution.

Introduction Solver Theory Initialization Convergence Summary

Page 47: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Standard Initialization and Patch Values

• Standard Initialization – Generally the user selects an inlet boundary

under 'Compute from' to automatically fill the initialization values with the values that are specified at the inlet boundary.

• Patch values for individual variables in certain regions. – Free jet flows (high velocity for jet).

– Combustion problems (high temperature region to initialize reaction).

– Cell registers (created by marking the cells in the Adaption panel) can be used for patching values into various regions of the domain.

– Multiphase flows (patch different phase volume fractions in one or more regions).

Introduction Solver Theory Initialization Convergence Summary

Page 48: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Hybrid Initialization

• The default initialization method.

• This provides a quick approximation of the flow field, by a collection of methods.

• It solves Laplace's equation to determine the velocity and pressure fields.

• All other variables, such as temperature, turbulence, species fractions, volume fractions, etc., will be automatically patched based on domain averaged values or a particular interpolation method.

Introduction Solver Theory Initialization Convergence Summary

Page 49: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

FMG Initialization

• Full Multigrid (FMG) Initialization. – Can be used to create a better initialization of the flow field.

• FMG Initialization is useful for complex flow problems involving large pressure and velocity gradients on large meshes.

– FMG uses the Full Approximation Storage (FAS) Multigrid method to solve the flow problem on a sequence of coarser meshes.

• Euler equations are solved with first–order accuracy on the coarse–level meshes.

• To enable FMG initialization, execute the TUI command. /solve/init/fmg–initialization

• Settings can be accessed by the TUI command. /solve/init/set–fmg–initialization

Introduction Solver Theory Initialization Convergence Summary

Page 50: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Starting from a Previous Solution

• A previously calculated solution can be used as an initial condition when changes are made to the case setup. – Use solution interpolation to initialize a run

(especially useful for starting fine–mesh cases when coarse–mesh solutions are available).

– Once the solution is initialized, additional iterations always use the current data set as the starting point.

• Sometimes solving a simplified version of the problem first will provide a good initial guess for the real problem.

Actual Problem Initial Condition

Heat Transfer Isothermal

Natural convection Low Rayleigh number

Combustion / reacting flow Cold flow (no combustion)

Turbulence Inviscid (Euler) solution

Introduction Solver Theory Initialization Convergence Summary

Page 51: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Convergence [1]

• The solver must perform enough iterations to achieve a converged solution

• At convergence, the following should be satisfied: – All discrete conservation equations (momentum, energy, etc.) are obeyed in all cells to a

specified tolerance (Residual). • The Residual measures the imbalance of the current numerical solution and is related but NOT EQUAL to

the numerical error.

– Overall mass, momentum, energy, and scalar balances are achieved.

– Target quantities reach constant values (in steady state solver). • Integral: e.g. Pressure drop.

• Local: e.g. Velocity at specified position.

Ise

ntr

op

ic E

ffic

ien

cy

Iteration Number

Res

idu

als

Iteration Number

Introduction Solver Theory Initialization Convergence Summary

Page 52: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Convergence [2]

• Monitoring convergence using residual history: – Generally, a decrease in residuals by three orders of magnitude can be a sign of

convergence (but not necessarily).

– Scaled energy residual should decrease to 10–6 (for the pressure–based solver).

– Scaled species residual may need to decrease to 10–5 to achieve species balance.

• Best practice is to also monitor quantitative variables to decide convergence: – Ensure that overall mass/heat/species conservation is satisfied.

– Monitor other relevant key variables/physical quantities for confirmation.

Introduction Solver Theory Initialization Convergence Summary

Page 53: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Checking Overall Flux Conservation

• The net flux imbalance (shown in the GUI as Net Results) should be less than 1% of the smallest flux through the domain boundary.

Introduction Solver Theory Initialization Convergence Summary

Page 54: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

• In addition to residuals, you can also monitor.

– Lift, drag and moment coefficients.

– Relevant variables or functions (e.g. surface integrals) at a boundary or any defined surface.

• These additional monitored quantities are important convergence indicators.

Convergence Monitors – Forces and Surfaces

Introduction Solver Theory Initialization Convergence Summary

Page 55: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Convergence Difficulties

• Numerical instabilities can arise with an ill–posed problem, poor–quality mesh and/or inappropriate solver settings. – Exhibited as increasing (diverging) or 'stuck' residuals.

– Diverging residuals imply increasing imbalance in conservation equations.

– Unconverged results are very misleading!

• Troubleshooting. – Ensure that the problem is well–posed.

– Compute an initial solution using a

first–order discretization scheme.

– For the pressure–based solver, decrease

underrelaxation factors for equations

having convergence problems.

– For the density–based solver, reduce

the Courant number.

– Remesh or refine cells which have large

aspect ratio or large skewness.

• Remember that you cannot improve

cell skewness by using mesh adaption!

Continuity equation convergence

trouble affects convergence of

all equations.

Introduction Solver Theory Initialization Convergence Summary

Page 56: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Accelerating Convergence

• Convergence can be accelerated by:

– Supplying better initial conditions.

• Starting from a previous solution (using file/interpolation when necessary).

– Gradually increasing under–relaxation factors or Courant number.

• Excessively high values can lead to solution instability and convergence problems.

• You should always save case and data files before continuing iterations.

– Starting with a good quality mesh with appropriate mesh resolution.

• The orthogonal quality reported in Mesh > Info > Quality should have a minimum value of .01 and an average value that is much higher.

Introduction Solver Theory Initialization Convergence Summary

Page 57: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Convergence vs Accuracy

• A converged solution is not necessarily an accurate solution.

– Accuracy depends on:

• Order of the discretization schemes (2nd order schemes are recommended).

• Mesh resolution.

• Boundary Conditions.

• Model limitations.

• Geometry simplifications.

• Precision of the solver (2d/3d or 2ddp/3ddp).

• …

Introduction Solver Theory Initialization Convergence Summary

Page 58: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

Adaption Example – 2D Planar Shell

• Adapt grid in regions of large pressure gradient to better resolve the sudden pressure rise across the shock.

Initial Mesh. Pressure Contours on Initial Mesh.

Large pressure gradient indicating a shock (poor resolution on coarse mesh).

Introduction Solver Theory Initialization Convergence Summary

Page 59: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

2D Planar Shell – Solution on Adapted Mesh

• Solution–based mesh adaption allows better resolution of the bow shock and expansion wave.

Adapted Mesh. Pressure Contours on Adapted Mesh.

Mesh adaption yields much–improved resolution of the bow shock.

Adapted cells in locations of large pressure gradients.

Introduction Solver Theory Initialization Convergence Summary

Page 60: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

• Serial.

• Local Parallel. – Shared Memory.

• Distributed Parallel. – Distributed Memory.

• Different communication methods are available (MPICH2, HP MPI, PVM). – See documentation 'When To Use MPI or PVM' for more details, but HP MPI is recommended in most

cases.

Running Simulations in Parallel [1]

Page 61: Express Introductory Training in ANSYS Fluent€¦ · •The different boundary condition types in FLUENT and how to use them. •How to define cell zone conditions in FLUENT including

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

• In the Fluent Launcher you can choose Parallel and set the Parameter.

• If you choose Distributed Memory, you have to specify the names of the computers which you want to connect.

– You can specify the names directly.

– You can specify a file which contains the names.

• For further information see Chapter 34 in User Guide.

Running Simulations in Parallel [2]