Curs Fluent
Curs Fluent
What is CFD?
Computational Fluid Dynamics (CFD) is the science of predicting
fluid flow, heat and mass transfer, chemical reactions, and related
phenomena by solving numerically the set of governing mathematical
equations.
Conservation of mass, momentum, energy, species, ...
The results of CFD analyses are relevant in:
conceptual studies of new designs
detailed product development
troubleshooting
redesign
CFD analysis complements testing and experimentation.
Reduces the total effort required in the experiment design and data
acquisition
Material Properties
Boundary Conditions
Post-Processing
Initial Conditions
What results are you looking for, and how will they be used?
What are your modeling options?
What physical models will need to be included in your analysis?
What simplifying assumptions do you have to make?
What simplifying assumptions can you make?
Do you require a unique modeling capability?
User-defined functions (written in C) in FLUENT 6
User-defined subroutines (written in FORTRAN) in FLUENT 4.5
What degree of accuracy is required?
How quickly do you need the results?
pyramid prism/wedge
2-8 © Fluent Inc. 5/23/2005
Fluent User Services Center Introductory FLUENT Notes
FLUENT v6.2 Mar 2005
www.fluentusers.com
Solver Basics
Solver Execution
Solver Execution:
Menu is laid out such that order of
operation is generally left to right.
Import and scale mesh file.
Post-Processing
Feedback into Solver
Engineering Analysis
Mouse Functionality
Mouse button functionality depends on solver and can be configured in
the solver.
Display → Mouse Buttons...
Default Settings:
2D Solver
Left button translates (dolly)
Middle button zooms
Right button selects/probes
3D Solver
Left button rotates about 2-axes
Middle button zooms
Middle click on point in screen centers point in window
Right button selects/probes
Retrieve detailed flow field information at point with Probe enabled.
Right click on grid display.
wall
inlet
Fluid (cell zone)
Fluid Density
Define → Materials...
For ρ = constant, incompressible flow:
Select constant for density
For variable density, incompressible flows:
ρ = poperating/RT
Use incompressible-ideal-gas for density
Set poperating close to the mean pressure in the problem
For compressible flow:
ρ = pabsolute/RT
use ideal-gas for density
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).
Density can also be defined as a function of temperature:
polynomial or piecewise-polynomial
Boussinesq model to be discussed in heat transfer lecture
For compressible liquids, density variation is specified by a user-defined
density function
3-11 © Fluent Inc. 5/23/2005
Fluent User Services Center Introductory FLUENT Notes
FLUENT v6.2 Mar 2005
www.fluentusers.com
Material Assignment
Materials are assigned to cell zone where
assignment method depends upon models
selected:
Single-Phase, Single Species Flows
Assign material to fluid zone(s) in
Fluid Panel (within DefineB.C.)
Multiple Species (Single Phase) Flows
Assign mixture material to fluid zones in
DefineSpecies Panel or in Pre-PDF.
All fluid zones consist of the ‘mixture’
Multiphase (Single Species) Flows
Primary and secondary phases selected
in Define Phases Panel.
All fluid zones consist of the ‘mixture’
Post-Processing
Many post-processing tools are available.
Post-Processing functions typically operate on surfaces
Surfaces are automatically created from zones
Additional surfaces can be created by users
Example: an Iso-Surface of a
constant grid coordinate can be
created for viewing data within a
plane.
Reports
Flux Reports
Net flux is calculated.
Total Heat Transfer Rate
includes radiation.
Surface Integrals
slightly less accurate on
user-generated surfaces due
to interpolation error.
Volume Integrals
Examples:
Boundary Conditions
General Guidelines
Upper pressure boundary modified to ensure that
flow always enters domain.
General guidelines:
If possible, select boundary
location and shape such that flow
either goes in or out.
Not necessary, but will typically
observe better convergence.
Should not observe large
gradients in direction normal to
boundary.
Indicates incorrect set-up.
Minimize grid skewness near the
boundary.
Otherwise it would introduce 1 2
error early in calculation.
Velocity Inlet
Specify Velocity by:
Magnitude, Normal to Boundary
Components
Magnitude and Direction
Velocity profile is uniform by default
Intended for incompressible flows.
Static pressure adjusts to accommodate
prescribed velocity distribution.
Total (stagnation) properties of flow also varies.
Using in compressible flows can lead to non-physical results.
Can be used as an outlet by specifying negative velocity.
You must ensure that mass conservation is satisfied if multiple inlets are used.
Pressure Outlet
Specify static gauge pressure
Interpreted as static pressure of
environment into which flow exhausts.
Radial equilibrium pressure
distribution option available
Doubles as inlet pressure (total gauge)
for cases where backflow occurs
Backflow
Can occur at pressure outlet during iterations
or as part of final solution.
Backflow direction can be normal to the
boundary, set by direction vector or from neighboring cell .
Backflow boundary data must be set for all transport variables.
Convergence difficulties are reduced by providing realistic backflow quantities
Suitable for compressible and incompressible flows
Specified pressure is ignored if flow is locally supersonic at the outlet
Can be used as a “free” boundary in an external or unconfined flow
For ideal gas (compressible) flow, non-reflecting outlet boundary conditions (NRBC) are
available
Outflow
No pressure or velocity information is required.
Data at exit plane is extrapolated from interior.
Mass balance correction is applied at boundary.
Flow exiting Outflow boundary exhibits zero
normal diffusive flux for all flow variables.
Appropriate where the exit flow is “fully-developed.”
Intended for incompressible flows:
Cannot be used with a Pressure-Inlet boundary: must use Velocity-Inlet BC at
the inlet.
Combination does not uniquely set pressure gradient over whole domain.
Cannot be used for unsteady flows with variable density.
Poor rate of convergence when back flow occurs during iteration.
Cannot be used if back flow is expected in final solution.
Outflow:
Mass flow rate fraction determined from Flow Rate Weighting by:
Wall Boundaries
Used to bound fluid and solid regions.
In viscous flows, no-slip condition
enforced at walls:
Tangential fluid velocity equal
to wall velocity.
Normal velocity component = 0
Shear stress can also be specified.
Thermal boundary conditions:
several types available
Wall material and thickness can be defined for 1-D or shell conduction heat transfer
calculations.
Wall roughness can be defined for turbulent flows.
Wall shear stress and heat transfer based on local flow field.
Translational or rotational velocity can be assigned to wall boundaries.
Periodic Boundaries
Used to reduce computational effort in
problem.
Flow field and geometry must be either
translationally or rotationally periodic.
For rotationally periodic boundaries:
∆p = 0 across periodic planes. Rotationally
Axis of rotation must be defined in fluid periodic planes
zone.
For translationally periodic boundaries:
∆p can be finite across periodic planes.
Models fully developed conditions. flow
Specify either mean ∆p per period Translationally
or net mass flow rate. periodic planes
Periodic boundaries defined in
Gambit are translational.
2D tube heat exchanger
4-18 © Fluent Inc. 5/23/2005
Fluent User Services Center Introductory FLUENT Notes
FLUENT v6.2 Mar 2005
www.fluentusers.com
Summary
Zones are used to assign boundary conditions.
Wide range of boundary conditions permit flow to enter and exit the
solution domain.
Wall boundary conditions are used to bound fluid and solid regions.
Periodic boundaries are used to reduce computational effort.
Internal cell zones are used to specify fluid, solid, and porous regions
and heat-exchanger models.
Internal face boundaries provide way to introduce step-changes in flow
properties.
Solver Settings
Outline
Using the Solver
Setting Solver Parameters
Convergence
Definition
Monitoring
Stability
Accelerating Convergence
Accuracy
Grid Independence
Grid Adaption
Summary
Appendix
Outline
Using the Solver (solution procedure overview)
Setting Solver Parameters
Convergence
Definition
Monitoring
Stability
Accelerating Convergence
Accuracy
Grid Independence
Grid Adaption
Summary
Appendix
Adaption No
Yes
Stop
Choosing a Solver
Choices are Coupled-Implicit, Coupled-Explicit, or Segregated (Implicit)
The coupled solvers are recommended if a strong inter-dependence exists between density,
energy, momentum, and/or species
e.g., high speed compressible flow or finite-rate reaction flows
In general, the coupled-implicit solver is recommended over the coupled-explicit solver
Time required: Implicit solver runs roughly twice as fast
Memory required: Implicit solver requires roughly twice as much memory as coupled-
explicit or segregated solvers!
Improved pre-conditioning in Fluent v6.2 for the coupled-implicit solver enhances
accuracy and robustness for low-Mach number flows
The coupled-explicit solver should only be used for unsteady flows when the characteristic
time scale of problem is on same order as that of the acoustics
e.g., tracking transient shock wave
Pressure-Velocity Coupling
Initialization
Iterative procedure requires that all solution variables be initialized before
calculating a solution.
Solve → Initialize → Initialize...
Realistic ‘guesses’ improves solution stability and accelerates convergence.
In some cases, correct initial guess is required:
Example: high temperature region to initiate chemical reaction.
“Patch” values for individual
variables in certain regions.
Solve → Initialize → Patch...
Free jet flows
(patch high velocity for jet)
Combustion problems
(patch high temperature
for ignition)
Cell registers (created by marking
the cells in the Adaption panel) can
be used for “patching” different values
in cell zones
Outline
Using the Solver
Setting Solver Parameters
Convergence
Definition
Monitoring
Stability
Accelerating Convergence
Accuracy
Grid Independence
Grid Adaption
Summary
Appendix
Convergence
At convergence:
All discrete conservation equations (momentum, energy, etc.) are
obeyed in all cells to a specified tolerance.
Solution no longer changes with more iterations.
Overall mass, momentum, energy, and scalar balances are achieved.
Monitoring convergence with residuals’ history:
Generally, a decrease in residuals by 3 orders of magnitude indicates at
least qualitative convergence.
Major flow features established.
Scaled energy residual must decrease to 10-6 for segregated solver.
Scaled species residual may need to decrease to 10-5 to achieve species
balance.
Monitoring quantitative convergence:
Monitor other relevant key variables/physical quantities for a
confirmation.
Ensure that property conservation is satisfied.
10-3
10-6
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:
Continuity equation convergence
Ensure the problem is well posed. trouble affects convergence of
Compute an initial solution with all equations.
a first-order discretization scheme.
Decrease under-relaxation for
equations having convergence
trouble (segregated solver).
Reduce Courant number (coupled
solver).
Re-mesh or refine cells with high
aspect ratio or highly skewed cells.
Accelerating Convergence
Convergence can be accelerated by:
Supplying good initial conditions
Starting from a previous solution
Increasing under-relaxation factors or Courant number
Excessively high values can lead to instabilities
Recommend saving case and data files before continuing iterations.
Controlling multigrid solver settings
Default settings define robust Multigrid solver and typically do not need
to be changed
A c tu a l P r o b le m In itia l C o n d itio n
n a tu ra l c o n v e c tio n lo w e r R a so lu tio n
tu rb u le n t flo w E u le r so lu tio n
Multigrid Solver
The Multigrid solver accelerates convergence by solving the discretized
equations on multiple levels of mesh densities so that the “low-frequency” errors
of the approximate solution can be efficiently eliminated
Influence of boundaries and far-away points are more easily transmitted to
interior of coarse mesh than on fine mesh.
Coarse mesh defined from original mesh fine (original) mesh
Multiple coarse mesh ‘levels’ can be created.
Algebraic Multigrid (AMG): ‘coarse mesh’
emulated algebraically.
Full Approx. Storage Multigrid (FAS):
‘cell coalescing’ defines new grid. ‘solution
– a coupled-explicit solver option transfer’
Final solution is for original mesh
Multigrid solver operates automatically in the background
Consult FLUENT User’s Guide for additional options
and technical details
coarse mesh
Outline
Using the Solver
Setting Solver Parameters
Convergence
Definition
Monitoring
Stability
Accelerating Convergence
Accuracy
Grid Independence
Grid Adaption
Summary
Appendix
Solution Accuracy
A converged solution is not necessarily a correct one!
Always inspect and evaluate the solution by using available data,
physical principles and so on.
Use the second-order upwind discretization scheme for final results.
Ensure that solution is grid-independent:
Use adaption to modify the grid or create additional meshes for the
grid-independence study
If flow features do not seem reasonable:
Reconsider physical models and boundary conditions
Examine mesh quality and possibly re-mesh the problem
Reconsider the choice of the boundaries’ location (or the domain):
inadequate choice of domain (especially the outlet boundary) can
significantly impact solution accuracy
Outline
Using the Solver
Setting Solver Parameters
Convergence
Definition
Monitoring
Stability
Accelerating Convergence
Accuracy
Grid Independence
Grid Adaption
Summary
Appendix
Non-iterative time advancement (NITA) schemes reduce the splitting error to O(∆t2)
by using sub-iterations (not the more expensive outer iterations to eliminate the
splitting errors used in ITA) per time step
NITA runs about twice as fast as ITA scheme
Two flavors of NITA schemes available in Fluent v6.2:
PISO (NITA/PISO)
Energy and turbulence equations are still loosely coupled
NITA schemes have a wide range of applications for unsteady simulations: e.g.,
incompressible, compressible (subsonic, transonic), turbomachinery flows, etc.
NITA schemes are not available for multiphase (except VOF), reacting flows, porous
media, and fan models, etc. Consult Fluent User’s Guide for additional details.
5-28 © Fluent Inc. 5/23/2005
Fluent User Services Center Introductory FLUENT Notes
FLUENT v6.2 Mar 2005
www.fluentusers.com
Summary
Solution procedure for the segregated and coupled solvers is the same:
Calculate until you get a converged solution
Obtain second-order solution (recommended)
Refine grid and recalculate until grid-independent solution is obtained
All solvers provide tools for judging and improving convergence and
ensuring stability
All solvers provide tools for checking and improving accuracy
Solution accuracy will depend on the appropriateness of the physical
models that you choose and the boundary conditions that you specify.
Appendix
Background
Finite Volume Method
Explicit vs. Implicit
Segregated vs. Coupled
Transient Solutions
Flow Diagrams of NITA and ITA Schemes
Background: Linearization
Equation sets are solved iteratively.
Coefficients ap and anb are typically functions a pφ p + ∑ anbφnb = bp
of solution variables (nonlinear and coupled). nb
Implicit linearization - φp and φnb are assumed unknown and are solved
using linear equation techniques.
Equations that are implicitly linearized tend to have less restrictive stability
requirements.
The equation set is solved simultaneously using a second iterative loop (e.g.,
point Gauss-Seidel).
Coupled Solver nb
Outline
Introduction
Conjugate Heat Transfer
Natural Convection
Radiation
Periodic Heat Transfer
Introduction
Energy transport equation:
∂
∂t
( )
(ρE ) + ∇ ⋅ V (ρE + p ) = ∇ ⋅ keff ∇T − ∑ h j J j + (τ eff ⋅V ) + S h
j
Energy source due to chemical reaction is included for reacting flows.
Energy source due to species diffusion included for multiple species flows.
Always included in coupled solver; can be disabled in segregated solver.
Energy source due to viscous heating:
Describes thermal energy created by viscous shear in the flow.
Important when shear stress in fluid is large (e.g., lubrication) and/or in high-
velocity, compressible flows.
Often negligible
not included by default for segregated solver; always included for coupled solver.
In solid regions, simple conduction equation solved.
Convective term can also be included for moving solids.
Velocity vectors
Temperature contours
Radiation
Radiation effects should be accounted for when Qrad = σ (Tmax − Tmin ) is of equal or
4 4
greater magnitude than that of convective and conductive heat transfer rates.
To account for radiation, radiative intensity transport equations (RTEs) are solved.
Local absorption by fluid and at boundaries links RTEs with energy equation.
Radiation intensity, I(r,s), is directionally and spatially dependent.
Intensity, I(r,s), along any direction can be modified by:
Local absorption
Out-scattering (scattering away from the direction)
Local emission
In-scattering (scattering into the direction)
Five radiation models are provided:
Discrete Ordinates Model (DOM)
Discrete Transfer Radiation Model (DTRM)
P-1 Radiation Model
Rosseland Model
Surface-to-Surface (S2S)
Advantages:
Relatively simple model.
Can increase accuracy by increasing number of rays.
Applies to wide range of optical thicknesses.
Limitations:
Assumes all surfaces are diffuse.
Effect of scattering not included.
Solving a problem with a large number of rays is CPU-intensive.
P-1 Model
Main assumption: Directional dependence in RTE is integrated out,
resulting in a diffusion equation for incident radiation.
Advantages:
Radiative transfer equation easy to solve with little CPU demand.
Includes effect of scattering.
Effects of particles, droplets, and soot can be included.
Works reasonably well for combustion applications where optical
thickness is large.
Limitations:
Assumes all surfaces are diffuse.
May result in loss of accuracy, depending on complexity of geometry, if
optical thickness is small.
Tends to overpredict radiative fluxes from localized heat sources or sinks.
inflow outflow
T − Twall
θ=
Tb − Twall
Tb = suitably defined bulk temperature
Can also model flows with specified wall heat flux.
Summary
Heat transfer modeling is available in all Fluent solvers.
After activating heat transfer, you must provide:
Thermal conditions at walls and flow boundaries
Fluid properties for energy equation
Available heat transfer modeling options include:
Species diffusion heat source
Combustion heat source
Conjugate heat transfer
Natural convection
Radiation
Periodic heat transfer
What is Turbulence?
Unsteady, irregular (aperiodic) motion in which transported quantities
(mass, momentum, scalar species) fluctuate in time and space
Identifiable swirling patterns characterize turbulent eddies.
Natural Convection
where
But the cost is too prohibitive! Not practical for industrial flows - DNS is not
available in Fluent.
Large Eddy Simulation (LES)
Solves the spatially averaged N-S equations. Large eddies are directly
resolved, but eddies smaller than the mesh sizes are modeled.
Less expensive than DNS, but the amount of computational resources and
efforts are still too large for most practical applications.
Reynolds-Averaged Navier-Stokes (RANS) Equations Models
Solve ensemble-averaged Navier-Stokes equations
There is not yet a single turbulence model that can reliably predict all
turbulent flows found in industrial applications with sufficient accuracy.
6-5 © Fluent Inc. 5/23/2005
Fluent User Services Center Introductory FLUENT Notes
FLUENT v6.2 Mar 2005
www.fluentusers.com
LES in FLUENT
LES has been most successful for high-end applications where the RANS models
fail to meet the needs. For example:
Combustion
Mixing
Implementations in FLUENT:
Sub-grid scale (SGS) turbulent models:
Smagorinsky-Lilly model
WALE model
Dynamic Smagorinsky-Lilly model
Dynamic kinetic energy transport model
Detached eddy simulation (DES) model
LES is applicable to all combustion models in FLUENT
Basic statistical tools are available: Time averaged and root-mean-square (RMS)
values of solution variables, built-in FFT
Before running LES, one should consult guidelines in the “Best Practices For
LES” (containing advice for mesh, SGS models, numerics, BC’s, and more)
(µ + ρν )
~~ ~
= Cb1S ν − Cw1 f w + + ...
Dt d σ ∂x j
ν
~ ∂x j
d = min (d w , C DES ∆ )
ui ( x , t ) = U i ( x , t ) + ui′( x , t )
r r r
U
Mean fluctuation
where Rij = − ρ ui′u ′j is called the Reynolds stresses. The Reynolds stresses are
additional unknowns introduced by the averaging procedure, hence they must be
modeled (related to the averaged flow quantities) in order to close the equations.
µ t = ρ ν~ f v1 ,
(
f v1 ≡ ~ 3
ν~ / ν )3
(ν /ν ) + Cv31
The variation of ν~ very near the wall is easier to resolve than k and ε.
Mainly intended for aerodynamic/turbo-machinery applications with mild
separation, such as supersonic/transonic flows over airfoils, boundary-
layer flows, etc.
Realizable k-ε (RKE) model ensures “realizability” of the k-ε model, i.e.,
Positivity of normal stresses
Schwarz’ inequality for Reynolds shear-stresses
Good performance for flows with axisymmetric jets.
Belongs to the general 2-equation EVM family. Fluent 6 supports the standard k-ω
model by Wilcox (1998), and Menter’s SST k-ω model (1994).
k-ω models have gained popularity mainly because:
Can be integrated to the wall without using any damping functions
Accurate and robust for a wide range of boundary layer flows with pressure
gradient
Most widely adopted in the aerospace and turbo-machinery communities.
Several sub-models/options of k-ω : compressibility effects, transitional flows and
shear-flow corrections.
Near-Wall Treatments:
The Structure of Near-Wall Flows
The structure of turbulent boundary layers in the near-wall region:
Use post-processing (e.g., xy-plot or contour plot) to double check the near-
wall grid placement after the flow pattern has been established.
Inviscid, Laminar,
or Turbulent
Contour plots
The Standard k-ε model is
of turbulent known to give spuriously
kinetic energy large TKE on the font face
(TKE) of the plate
0.2 m
6-28 © Fluent Inc. 5/23/2005
Fluent User Services Center Introductory FLUENT Notes
FLUENT v6.2 Mar 2005
www.fluentusers.com
Time-averaged streamwise
velocity along the wake centerline
Iso-contours of instantaneous vorticity
magnitude
CL spectrum
6-30 © Fluent Inc. 5/23/2005
Fluent User Services Center Introductory FLUENT Notes
FLUENT v6.2 Mar 2005
www.fluentusers.com
Appendix
Summary of RANS Turbulence Models: Description, Model Behavior
and Usage
More Details on Near-wall Modeling
Turbulent Heat Transfer Modeling
Additional Information on Menter’s SST k-ω Model
V2F Turbulence Model
Initial Velocity Field for LES/DES
A two transport equation model solving for k and ω, the specific dissipation rate (ε/k) based on
Standard k-ω Wilcox (1998). This is the default k -ω model. Demonstrates superior performance for wall
bounded and low-Re flows. Shows potential for predicting transition. •Options account for
transitional, free shear, and compressible flows.
A variant of the standard k-ω model. Combines the original Wilcox model (1988) for use near
SST k-ω walls and standard k-ε model away from walls using a blending function. Also limits turbulent
viscosity to guarantee that τt ~ k. •The transition and shearing options borrowed from SKO. No
compressibility option.
Reynolds stresses are solved directly with transport equations avoiding isotropic viscosity
RSM assumption of other models. Use for highly swirling flows. •Quadratic pressure-strain option
improves performance for many basic shear flows.
6-34 © Fluent Inc. 5/23/2005
Fluent User Services Center Introductory FLUENT Notes
FLUENT v6.2 Mar 2005
www.fluentusers.com
Standard k-ω Superior performance for wall-bounded b.l., free shear, and low Re flows. Suitable for complex
boundary layer flows under adverse pressure gradient and separation (external aerodynamics and
turbomachinery). Can be used for transitional flows (though tends to predict early transition).
Separation is typically predicted to be excessive and early.
SST k-ω Similar benefits as SKO. Dependency on wall distance makes this less suitable for free shear
flows.
Physically the most sound RANS model. Avoids isotropic eddy viscosity assumption. More CPU
RSM time and memory required. Tougher to converge due to close coupling of equations. Suitable for
complex 3D flows with strong streamline curvature, strong swirl/rotation (e.g. curved duct,
rotating flow passages, swirl combustors with very large inlet swirl, cyclones).
Less reliable for high transpiration or body forces, low Re or highly 3D flows.
The Standard and Non-Equilibrium Wall functions are options for the k-ε and RSM
turbulence models.
law-of-the-wall (Kader).
Similar blended ‘wall laws’ apply for energy, species, and ω.
Kader’s form for blending allows for incorporation of additional physics.
Pressure gradient effects
Thermal (including compressibility) effects
Two-layer zonal model
A blended two-layer model is used to determine near-wall ε field.
Domain is divided into viscosity-affected (near-wall) region and turbulent core region.
– Based on ‘wall-distance’ turbulent Reynolds number: Re y ≡ ρ k y / µ
– Zoning is dynamic and solution adaptive.
High Re turbulence model used in outer layer.
‘Simple’ turbulence model used in inner layer.
Solutions for ε and µt in each region are blended, e.g., λε (µ t )outer + (1 − λε ) (µ t )inner
The Enhanced Wall Treatment option is available for the k-ε and RSM turbulence
models ( EWT is the sole treatment for Spalart Allmaras and k-ω models).
6-37 © Fluent Inc. 5/23/2005
Fluent User Services Center Introductory FLUENT Notes
FLUENT v6.2 Mar 2005
www.fluentusers.com