You are on page 1of 60

CHANDIGARH UNIVERSITY

Artificial Neural Networks


- Introduction -

Birinderjit Singh Kalyan


DEPARTMENT OF MECHANICAL ENGG.
EE
UNIVERSITY INSTITUTE OF ENGINEERING
CHANDIGARH UNIVERSITY,
Assistant ProfessorMOHALI

www. cuchd.in
11/22/2021 Department of Mechanical Engineering 1
www. cuchd.in Campus : Gharaun, Campus : Gharaun, Mohali
CHANDIGARH UNIVERSITY

Computational Fluid Dynamics


MEA-657
Session : Jan- May 2019

Gurpreet Singh– E2560


Asst. Prof
Chandigarh University
codmasters.me@cumail.in

Department of Mechanical Engineering


www. cuchd.in Campus : Gharaun, Mohali
CHANDIGARH UNIVERSITY

Unit 1

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Objectives

Specific objectives may be summarized as:


• To understand mathematical characteristics of partial differential equations.

• To understand basic properties of computational methods – accuracy, stability,


consistency
• To learn computational solution techniques for time integration of ordinary
differential equations
• To learn computational solution techniques for various types of partial
differential equations
• To learn how to computationally solve Euler and Navier-Stokes equations

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Course Pre-requisites
Basic knowledge of mathematics, heat transfer, fluid
mechanics subjects

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Introduction to
Computational Fluid Dynamics

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

1.1 COMPUTATIONAL FLUID DYNAMICS

•Computational fluid dynamics (CFD) is one of the branch of Engineering ,Finding


numerical solutions of governing equations, using high-speed digital computers.

•CFD simulations used to model fluid flows over a wide range of physical scales. The
fundamental of the CFD simulation is the conservation of equations[1]

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Computational Fluid Dynamics (CFD) provides a qualitative (and


sometimes even quantitative) prediction of fluid flows by means of
• mathematical modeling (partial differential equations)
• numerical methods (discretization and solution techniques)
• software tools (solvers, pre- and postprocessing utilities)

CFD enables scientists and engineers to perform ‘numerical


experiments’(i.e. computer simulations) in a ‘virtual flow laboratory’
real experiment CFD simulation[1]

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

1.2 METHODS OF INVESTIGATION[2]

1.2.1 EXPERIMENTAL METHOD:

Understanding fluid behavior using laboratory models and experiments.


Important for validating theoretical solutions.

Example: Water tanks, wind tunnels

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

METHODS OF INVESTIGATION [2]

• Experimental investigation:
– full scale
• expensive and often impossible
• measurement errors
– on a small scale model
• simplified
• difficult to extrapolate results
• measurement errors

• Theoretical calculation:
– analytical solutions
• exist only for a few cases
• sometimes complex
• for almost any problem

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

1.3 MATHEMATICAL MODELING [2]

• Mathematical representation of a real system with certain assumptions

• A model has a clear purpose to solve a particular problem

• It is based on certain conservation principle to satisfy the physics of the


problem

• A model is a simplification of a real problem which is very complex

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

1.4 SIMULATION

• The process of predicting the situations that have not yet been
observed because they do not yet exist

• Mathematical models are the tools used in Simulation

• Accuracy of predictions depend on the amount of assumptions made


in the models

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

1.5 MODELING VS EXPERIMENTATION

• Advantages of modeling:
– cheaper
– more complete information
– can handle any degree of complexity as long as…

• Disadvantages of modeling:
– deals with a mathematical description not with reality
– multiple solutions can exist

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Experiments
Quantitative description of flow phenomena using measurements

 for one quantity at a time


 at a limited number of points and time instants
 for a laboratory-scale model
 for a limited range of problems and operating conditions

Error sources: measurement errors, flow disturbances by the probes

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Simulations

Quantitative prediction of flow phenomena using CFD software

 for all desired quantities


 with high resolution in space and time
 for the actual flow domain
 for virtually any problem and realistic operating conditions.

Error sources: modeling, discretization, iteration, implementation

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Experiments vs. Simulations [2]

As a rule, CFD does not replace the measurements completely but the amount
of experimentation and the overall cost can be significantly reduced.

Equipment and personnel are difficult to transport


CFD software is portable, easy to use and modify

The results of a CFD simulation are never 100% reliable because

• the input data may involve too much guessing or imprecision


• the mathematical model of the problem at hand may be inadequate
• the accuracy of the results is limited by the available computing power
Department of Mechanical Engineering
CHANDIGARH UNIVERSITY

How Does a Commercial CFD code work [3]


All codes contain three main elements

i) Pre-processor
• Definition of the geometry of the region of interest
• Grid Generation (mesh generation): Sub division of domain into a number
of smaller sub domains (grid/ cells/ control volumes)

• Specification of appropriate boundary conditions

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

ii) Solver
• Integration of the governing eqns. of fluid flow over all the control volumes of
the domain
• Discretisation- conversion of the resulting integral eqns. Into a system of
algebraic equations
• Solution of the algebraic equations by an iterative method

iii) Post processor


• Domain geometry and grid display.
• Vector, contour plots and other plots to visualize the results

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Problem statement [1]


• What is known about the flow problem to be dealt with?
• What physical phenomena need to be taken into account?
• What is the geometry of the domain and operating conditions?
• Are there any internal obstacles or free surfaces/interfaces?
• What is the type of flow (laminar/turbulent, steady/unsteady)?
• What is the objective of the CFD analysis to be performed?
– computation of integral quantities (lift, drag, yield)
– shape optimization aimed at an improved performance
• What is the easiest/cheapest/fastest way to achieve the goal?

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

2.1 Discretization process


The PDE system is transformed into a set of algebraic equations
1. Mesh generation (decomposition into cells/elements)
• structured or unstructured, triangular or quadrilateral?
• CAD tools + grid generators (Delaunay, advancing front)
• mesh size, adaptive refinement in ‘interesting’ flow regions
2. Space discretization (approximation of spatial derivatives)
• finite differences/volumes/elements
• high- vs. low-order approximations
3. Time discretization (approximation of temporal derivatives)
• explicit vs. implicit schemes, stability constraints
• local time-stepping, adaptive time step control

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

CFD simulations
The computing times for a flow simulation depend on
• the choice of numerical algorithms and data structures
• linear algebra tools, stopping criteria for iterative solvers
• discretization parameters (mesh quality, mesh size, time step)
• cost per time step and convergence rates for outer iterations

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

• programming language (most CFD codes are written in Fortran)


• many other things (hardware, vectorization, parallelization etc.)
The quality of simulation results depends on
• the mathematical model and underlying assumptions
• approximation type, stability of the numerical scheme
• mesh, time step, error indicators, stopping criteria . . .

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Postprocessing and analysis


Postprocessing of the simulation results is performed in order to
extract the desired information from the computed flow field
• calculation of derived quantities (streamfunction, vorticity)
• calculation of integral parameters (lift, drag, total mass)
• visualization (representation of numbers as images)

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

– 1D data: function values connected by straight lines


– 2D data: streamlines, contour levels, color diagrams
– 3D data: cutlines, cutplanes, isosurfaces, isovolumes
– arrow plots, particle tracing, animations . . .
• Systematic data analysis by means of statistical tools
• Debugging, verification, and validation of the CFD model

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

2.2 Applications of CFD

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

• Where is CFD used? [4]


– Aerospace
– Appliances
– Automotive
– Biomedical
– Chemical Processing
– HVAC&R F18 Store Separation

– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports

Wing-Body Interaction Hypersonic Launch


Vehicle

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical
– Chemical Processing
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
Surface-heat-flux plots of the No-Frost
– Power Generation refrigerator and freezer compartments helped
– Sports BOSCH-SIEMENS engineers to optimize the
location of air inlets.

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Where is CFD used? (Automotive)


• Where is CFD used?
– Aerospace
– Appliances
– Automotive
– Biomedical
– Chemical Processing
– External Aerodynamics Undercarriage
HVAC&R Aerodynamics
– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports

Interior Ventilation
Engine Cooling

Department of Mechanical Engineering 28


CHANDIGARH UNIVERSITY

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical
– Chemical Processing
– HVAC&R Medtronic Blood Pump
– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports
Temperature and natural
convection currents in the eye
following laser heating.

Department of Mechanical Engineering 29


CHANDIGARH UNIVERSITY

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical Polymerization reactor vessel - prediction
– Chemical Processing of flow separation and residence time
effects.
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
– Power Generation Twin-screw extruder
– Sports modeling

Shear rate distribution in twin-


screw extruder simulation

Department of Mechanical Engineering 30


CHANDIGARH UNIVERSITY

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical Particle traces of copier VOC emissions
colored by concentration level fall
– Chemical Processing Streamlines for workstation behind the copier and then circulate
ventilation through the room before exiting the
– HVAC&R exhaust.

– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports
Flow pathlines colored by
pressure quantify head loss
Mean age of air contours indicate
in ductwork
location of fresh supply air

Department of Mechanical Engineering 31


CHANDIGARH UNIVERSITY

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical
– Chemical Processing
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports

Department of Mechanical Engineering 32


CHANDIGARH UNIVERSITY

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical
– Chemical Processing
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports

Department of Mechanical Engineering 33


CHANDIGARH UNIVERSITY

• Where is CFD used?


– Aerospace
– Appliances Volume fraction of gas

– Automotive
– Biomedical
– Chemical Processing Flow vectors and pressure Volume fraction of oil

– distribution on an offshore oil rig


HVAC&R
– Hydraulics
– Marine Volume fraction of
– Oil & Gas water
Analysis of multiphase
– Power Generation separator

– Sports

Flow of lubricating
mud over drill bit

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical
– Chemical Processing Flow around cooling Flow in a
towers burner
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports
Pathlines from the inlet
Flow pattern through a water colored by temperature
turbine. during standard
operating conditions

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

• Where is CFD used?


– Aerospace
– Appliances
– Automotive
– Biomedical
– Chemical Processing
– HVAC&R
– Hydraulics
– Marine
– Oil & Gas
– Power Generation
– Sports

Department of Mechanical Engineering 36


CHANDIGARH UNIVERSITY

Physics • CFD codes typically designed for representation of


specific flow phenomenon
• Viscous vs. inviscid (no viscous forces) (Re)
• Turbulent vs. laminar (Re)
• Incompressible vs. compressible (Ma)
• Single- vs. multi-phase (Ca)
• Thermal/density effects and energy equation (Pr, g, Gr, Ec)
• Free-surface flow and surface tension (Fr, We)
• Chemical reactions, mass transfer
• etc…

37

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Physics Fluid Mechanics

Inviscid Viscous

Laminar Turbulence

Internal External
Compressible Incompressible (airfoil, ship)
(pipe,valve)
(air, acoustic) (water)

Components of Fluid Mechanics


38

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

CFD process [3]


• Geometry description
• Specification of flow conditions and properties
• Selection of models
• Specification of initial and boundary conditions
• Grid generation and transformation
• Specification of numerical parameters
• Flow solution
• Post processing: Analysis, and visualization

39

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Selection of models for flow field [5,6]


• Direct Numerical Simulations (DNS) is to solve the N-S equations directly without
any modeling. Grid must be fine enough to resolve all flow scales. Applied for
laminar flow and rare be used in turbulent flow.
• Reynolds Averaged Navier-Stokes (NS) equations (RANS) is to perform averaging
of NS equations and establishing turbulent models for the eddy viscosity. Too many
averaging might damping vortical structures in turbulent flows
• Large Eddy Simulation (LES), Smagorinsky’ constant model and dynamic model.
Provide more instantaneous information than RANS did. Instability in complex
geometries
• Detached Eddy Simulation (DES) is to use one single formulation to combine the
advantages of RANS and LES.

40

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

CFD - how it works


• Analysis begins with a mathematical model Filling
Nozzle
of a physical problem. Bottle

• Conservation of matter, momentum, and


energy must be satisfied throughout the
region of interest.
• Fluid properties are modeled empirically.
• Simplifying assumptions are made in order to
make the problem tractable (e.g., steady-state,
incompressible, inviscid, two-dimensional). Domain for bottle filling
problem.

• Provide appropriate initial and boundary


conditions for the problem.
41

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

CFD - how it works [2]


• CFD applies numerical methods (called
discretization) to develop approximations of the
governing equations of fluid mechanics in the fluid
region of interest.
• Governing differential equations: algebraic.
• The collection of cells is called the grid.
• The set of algebraic equations are solved
numerically (on a computer) for the flow field
variables at each node or cell.
• System of equations are solved simultaneously to
provide solution. Mesh for bottle filling
problem.
• The solution is post-processed to extract quantities of
interest (e.g. lift, drag, torque, heat transfer, 42
separation, pressure loss, etc.).
Department of Mechanical Engineering
CHANDIGARH UNIVERSITY

Discretization [7,8]
• Domain is discretized into a finite set of control volumes
or cells. The discretized domain is called the “grid” or the “mesh.”
• General conservation (transport) equations for mass, momentum,
energy, etc., are discretized into algebraic equations.
• All equations are solved to render flow field.


t V
dV   V  dA     dA   S dV
A A V

unsteady convection diffusion generation Fluid region of


pipe flow
discretized into
Eqn.  control
finite set of
continuity 1 volum
control volumes
e
x-mom. u (mesh).
y-mom. v
energy h

43

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Design and create the grid


• Should you use a quad/hex grid, a tri/tet grid, a hybrid grid, or a non-
conformal grid?
• What degree of grid resolution is required in each region of the domain?
• How many cells are required for the problem?
• Will you use adaption to add resolution?
• Do you have sufficient computer memory?

tetrahedron pyramid
triangle

arbitrary polyhedron
hexahedron prism or wedge
quadrilateral

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Tri/tet vs. quad/hex meshes


• For simple geometries, quad/hex meshes can provide high-quality solutions
with fewer cells than a comparable tri/tet mesh.

• For complex geometries, quad/hex meshes show no numerical advantage,


and you can save meshing effort by using a tri/tet mesh.

Department of Mechanical Engineering 45


CHANDIGARH UNIVERSITY

Hybrid mesh example

• Valve port grid. tet mesh

• Specific regions can be meshed with hex


different cell types. mesh

• Both efficiency and accuracy are


enhanced relative to a hexahedral or
tetrahedral mesh alone.

wedge mesh

Hybrid mesh for an


IC engine valve port

Department of Mechanical Engineering 46


CHANDIGARH UNIVERSITY

Set up the numerical model


• For a given problem, you will need to:
• Select appropriate physical models.
• Turbulence, combustion, multiphase, etc.
• Define material properties.
• Fluid.
• Solid.
• Mixture.
• Prescribe operating conditions.
• Prescribe boundary conditions at all boundary
zones.
• Provide an initial solution.
• Set up solver controls.
• Set up convergence monitors. 47

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Initial and boundary conditions [9]


• For steady/unsteady flow
• IC should not affect final solution, only convergence path, i.e. iteration
numbers needed to get the converged solution.
• Robust codes should start most problems from very crude IC, . But more
reasonable guess can speed up the convergence.
• Boundary conditions
• No-slip or slip-free on the wall, periodic, inlet (velocity inlet, mass
flow rate, constant pressure, etc.), outlet (constant pressure, velocity
convective, buffer zone, zero-gradient), and non-reflecting
(compressible flows, such as acoustics), etc.

48

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Compute the solution


• The discretized conservation equations are solved iteratively. A number of
iterations are usually required to reach a converged solution.
• Convergence is reached when:
• Changes in solution variables from one iteration to the next are
negligible.
• Residuals provide a mechanism to help monitor this trend.
• Overall property conservation is achieved.
• The accuracy of a converged solution is dependent upon:
• Appropriateness and accuracy of the physical models.
• Grid resolution and independence.
• Problem setup. 49

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Numerical parameters & flow


solution
• Typical time history of residuals
• The closer the flow field to the converged solution, the smaller the speed of
the residuals decreasing.

50

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Post-processing
• Analysis, and visualization
• Calculation of derived variables
• Vorticity
• Wall shear stress
• Calculation of integral parameters: forces, moments
• Visualization (usually with commercial software)
• Simple X-Y plots
• Simple 2D contours
• 3D contour carpet plots
• Vector plots and streamlines (streamlines are the
lines whose tangent direction is the same as the
velocity vectors)
• Animations (dozens of sample pictures in a series 51
of time were shown continuously)
Department of Mechanical Engineering
CHANDIGARH UNIVERSITY

Examine the results


• Visualization can be used to answer such questions as:
• What is the overall flow pattern?
• Is there separation?
• Where do shocks, shear layers, etc. form?
• Are key flow features being resolved?
• Are physical models and boundary conditions
appropriate?
• Numerical reporting tools can be used to calculate
quantitative results, e.g:
• Lift, drag, and torque.
• Average heat transfer coefficients.
• Surface-averaged quantities.
52

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Advantages of CFD [7,8]

• Relatively low cost.


• Using physical experiments and tests to get essential engineering data for
design can be expensive.
• CFD simulations are relatively inexpensive, and costs are likely to decrease as
computers become more powerful.
• Speed.
• CFD simulations can be executed in a short period of time.
• Quick turnaround means engineering data can be introduced early in the
design process.
• Ability to simulate real conditions.
• Many flow and heat transfer processes can not be (easily) tested, e.g.
hypersonic flow. 53

• CFD provides the ability to theoretically simulate any physical condition.


Department of Mechanical Engineering
CHANDIGARH UNIVERSITY

Limitations of CFD
• Physical models.
• CFD solutions rely upon physical models of real world processes (e.g.
turbulence, compressibility, chemistry, multiphase flow, etc.).
• The CFD solutions can only be as accurate as the physical models on which
they are based.
• Numerical errors.
• Solving equations on a computer invariably introduces numerical errors.
• Round-off error: due to finite word size available on the computer. Round-
off errors will always exist (though they can be small in most cases).
• Truncation error: due to approximations in the numerical models. Truncation
errors will go to zero as the grid is refined. Mesh refinement is one way to 54

deal with truncation error.


Department of Mechanical Engineering
CHANDIGARH UNIVERSITY

Limitations of CFD
• Boundary conditions.
• As with physical models, the accuracy of the CFD solution is
only as good as the initial/boundary conditions provided to
the numerical model.
• Example: flow in a duct with sudden expansion. If flow is
supplied to domain by a pipe, you should use a fully-
developed profile for velocity rather than assume uniform
conditions.
Computational Computational
Domain Domain

Fully Developed Inlet


Uniform Inlet Profile
Profile
poor better

55

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

Home Assignment
 Use the explicit method to solve for the temperature distribution of a long,
thin rod with a length of 10 cm. Obtain the temperature distribution after
0.6s. Following data may be used
 Initial condition: t=0. T=00C
 Boundary conditions: T(0) = 1000 C and T(10) = 500C for all time. K =
0.835 cm2/s

 2. Use any suitable difference method to solve for the temperature of the
heated plate. Use over the relaxation with a value of 2 for the weighting
factor and εs=4%. Consider two grid points in x & y directions
 Initial condition T= 00C at x =0
 Boundary condition ∆y at x=0 T= 750c top plate 1300C and right side ∆x
at max. x= T=600 C

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

1. http://www.fluent.com/
2. http://www.cfdrc.com/
3. Computational Dynamics: http://www.cd.co.uk/
4. CFX/AEA: http://www.software.aeat.com/cfx/
5. Gridgen: http://www.pointwise.com
6. GridPro: http://www.gridpro.com/
7. Hypermesh
8. Tecplot: http://www.amtec.com/
9. Fieldview: http://www.ilight.com/

57

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

• FAQ
• Why CFD needed
• What are the applications of CFD
• What is difference between error and uncertainty
• What is discretization and what are the discretization error
• What are common boundary conditions imposed on the physical boundaries
• Which error has most contribution in CFD results and why

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

• Course Outcomes:

• After successfully completing the course, students should be able to do


the following:
• To be able to understand the various discretization techniques
• To be able to understand the basis of equations used in
computational dynamics
• To be able to understand concepts of various models of CFD

Department of Mechanical Engineering


CHANDIGARH UNIVERSITY

THANK YOU

60

Department of Mechanical Engineering

You might also like