Computational Aerodynamics Lab Manual
Computational Aerodynamics Lab Manual
Computational Aerodynamics Lab Manual
LABORATORY MANUAL
www.jntufastupdates.com
CONTENTS
S.No Experiment Name Pg.No
2 Solution for the one dimensional wave equations using explicit method of lax 13
using finite difference method (code development)
3 Solution for the one dimensional heat conduction equation using explicit 16
method using finite difference method (code development)
www.jntufastupdates.com
PROGRAMME EDUCATIONAL OBJECTIVES
PEO1: PROFESSIONALISM & CITIZENSHIP
To create and sustain a community of learning in which students
acquire knowledge and learn to apply it professionally with due
consideration for ethical, ecological and economic issues.
PEO2: TECHNICAL ACCOMPLISHMENTS
To provide knowledge based services to satisfy the needs of society and
the industry by providing hands on experience in various technologies
in core field.
PEO3: INVENTION, INNOVATION AND CREATIVITY
To make the students to design, experiment, analyze, interpret in the
core field with the help of other multi disciplinary concepts wherever
applicable.
PEO4: PROFESSIONAL DEVELOPMENT
To educate the students to disseminate research findings with good
soft skills and become a successful entrepreneur.
PEO5: HUMAN RESOURCE DEVELOPMENT
To graduate the students in building national capabilities in technology,
education and research.
www.jntufastupdates.com
CODE OF CONDUCT FOR THE LABORATORIES
All students must observe the Dress Code while in the laboratory.
All students are liable for any damage to the accessories due to their own negligence.
All interfacing kits connecting cables must be RETURNED if you taken from the lab
supervisor.
Students are strictly PROHIBITED from taking out any items from the laboratory.
Students are NOT allowed to work alone in the laboratory without the Lab Supervisor
USB Ports have been disabled if you want to use USB drive consult lab supervisor.
Report immediately to the Lab Supervisor if any malfunction of the accessories, is there.
www.jntufastupdates.com
CA LAB MANUAL
A model is a mathematical object that has the ability to predict the behaviour of a real system
under a set of defined operating conditions and simplifying assumptions
The term modeling refers to the development of a mathematical representation of a physical
situation
WHAT IS MODELING?
• Modeling is the process of producing a model.
• A model is a representation of the construction and working of some system of
interest.
• A model is similar to but simpler than the system it represents.
• One purpose of a model is to enable the analyst to predict the effect of changes to the
system. Generally, a model intended for a simulation study is a mathematical model
developed with the help of simulation software.
• Mathematical model classifications include
• Deterministic (input and output variables are fixed values) or Stochastic (at least one of the
input or output variables is probabilistic);
• Static (time is not taken into account) or
• Dynamic (time-varying interactions among variables are taken into account).
• Typically, simulation models are stochastic and dynamic.
Simulation is the process of exercising a model for a particular instantiation of the system
and specific set of inputs in order to predict the system response.
simulation refers to the procedure of solving the equations that resulted from model
development
WHAT IS SIMULATION?
• A simulation of a system is the operation of a model of the system.
• The operation of the model can be studied, and hence, properties concerning the
behavior of the actual system or its subsystem can be inferred.
• In its broadest sense, simulation is a tool to evaluate the performance of a system,
existing or proposed, under different configurations of interest and over long periods
of real time.
• Simulation is used
• before an existing system is altered or a new system built,
• to reduce the chances of failure to meet specifications,
• to eliminate unforeseen bottlenecks,
• to prevent under or over-utilization of resources,
• to optimize system performance.
www.jntufastupdates.com
• Modeling flexibility
• Ease of use
• Modeling structure (hierarchical v/s flat; object-oriented v/s nested)
• Code reusability
• Graphic user interface
• Animation, dynamic business graphics, hardware and software requirements
• Statistical capabilities
• Output reports and graphical plots
• Customer support and documentation
• Mathematical modeling - Aerospace Applications
• Using basic equations from dynamics, mathematical equations are written that
describe how the vehicle will move in response to forces that are applied to the
vehicle. For example, it is pretty easy to describe how a rocket will accelerate when a
constant thrust is provided by the rocket's engine.
• Another type of modeling problem would be to understand and predict, in a
mathematical equation, how an aircraft will respond to hitting an updraft in the
atmosphere, or how the aircraft will respond to the deflection of various control
surfaces at different airspeeds.
• An aerodynamic subsystem model describes how the vehicle will respond to forces
caused by motion of the vehicle through the atmosphere, and predicts the effects of
each different control surface (such as the flaps, rudders, ailerons, etc.) upon the
motion of the vehicle.
• A propulsion subsystem model describes how any motors or engines will behave and
what forces will act on the vehicle to which they are attached.
• A landing gear subsystem model is required when the vehicle is in contact with the
ground in order to model how the ground reaction forces are created and how they
affect the motion of the vehicle.
• An inertial properties subsystem model provides details about how the mass and
inertia of the vehicle might change with time.
• any electrical, mechanical, or electronic system that assists the pilot in moving the
control surfaces has to be described mathematically
The steps involved in developing a simulation model, designing a simulation experiment, and
performing simulation analysis are:
Step 1. Identify the problem.
Step 2. Formulate the problem.
Step 3. Collect and process real system data.
Step 4. Formulate and develop a model.
Step 5. Validate the model.
Step 6. Document model for future use.
Step 7. Select appropriate experimental design.
Step 8. Establish experimental conditions for runs.
Step 9. Perform simulation runs.
Step 10. Interpret and present results.
Step 11. Recommend further course of action.
www.jntufastupdates.com
MATLAB (matrix laboratory) is a multi-paradigm numerical computing environment and fourth-
generation programming language. Developed by MathWorks, MATLAB Allows matrix manipulations,
plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing
with programs written in other languages, including C, C++, Java, Fortran and Python.
Although MATLAB is intended primarily for numerical computing, an optional toolbox uses
the MuPAD symbolic engine, allowing access to symbolic computing capabilities. An additional
package, Simulink, adds graphical multi-domain simulation and model-based design for
dynamic and embedded systems.
Syntax
The MATLAB application is built around the MATLAB scripting language. Common usage of the
MATLAB application involves using the Command Window as an interactive mathematical shell or
executing text files containing MATLAB code.
Variables
Variables are defined using the assignment operator, = . MATLAB is a weakly typed programming
language because types are implicitly converted. It is an inferred typed language because variables can be
assigned without declaring their type, except if they are to be treated as symbolic objects, [9] and that their
type can change. Values can come from constants, from computation involving values of other variables,
or from the output of a function. For example:
>> x = 17
x =
17
>> x = 'hat'
x =
hat
>> y = x + 0
y =
104 97 116
>> y = 3*sin(x)
y =
-1.6097 3.0000
www.jntufastupdates.com
array =
1 3 5 7 9
defines a variable named array (or assigns a new value to an existing variable with the name array )
which is an array consisting of the values 1, 3, 5, 7, and 9. That is, the array starts at 1 (the init value),
increments with each step from the previous value by 2 (the increment value), and stops once it reaches
(or to avoid exceeding) 9 (the terminator value).
the increment value can actually be left out of this syntax (along with one of the colons), to use a default
value of 1.
assigns to the variable named ari an array with the values 1, 2, 3, 4, and 5, since the default value of 1 is
used as the incrementer.
Indexing is one-based,[10] which is the usual convention for matrices in mathematics, although not for
some programming languages such as C, C++, and Java.
Matrices can be defined by separating the elements of a row with blank space or comma and using a
semicolon to terminate each row. The list of elements should be surrounded by square brackets: [].
Parentheses: () are used to access elements and sub arrays (they are also used to denote a function
argument list).
>> A(2,3)
ans =
11
Sets of indices can be specified by expressions such as "2:4", which evaluates to [2, 3, 4]. For example, a
sub matrix taken from rows 2 through 4 and columns 3 through 4 can be written as:
>> A(2:4,3:4)
ans =
11 8
7 12
14 1
www.jntufastupdates.com
A square identity matrix of size n can be generated using the function eye, and matrices of any size with
zeros or ones can be generated with the functions zeros and ones, respectively.
>> eye(3,3)
ans =
1 0 0
0 1 0
0 0 1
>> zeros(2,3)
ans =
0 0 0
0 0 0
>> ones(2,3)
ans =
1 1 1
1 1 1
Most MATLAB functions can accept matrices and will apply themselves to each element. For
example, mod(2*J,n) will multiply every element in "J" by 2, and then reduce each element modulo
"n". MATLAB does include standard "for" and "while" loops, but (as in other similar applications such
as R), using the vectorized notation often produces code that is faster to execute. This code, excerpted
from the function magic.m, creates a magic square M for odd values of n (MATLAB
function meshgrid is used here to generate square matrices I and J containing 1:n).
[J,I] = meshgrid(1:n);
A = mod(I + J - (n + 3) / 2, n);
B = mod(I + 2 * J - 2, n);
M = n * A + B + 1;
Structures
MATLAB has structure data types.[11] Since all variables in MATLAB are arrays, a more adequate name
is "structure array", where each element of the array has the same field names. In addition, MATLAB
supports dynamic field names (field look-ups by name, field manipulations, etc.). Unfortunately,
MATLAB JIT does not support MATLAB structures, therefore just a simple bundling of various
variables into a structure will come at a cost.
Functions
When creating a MATLAB function, the name of the file should match the name of the first function in
the file. Valid function names begin with an alphabetic character, and can contain letters, numbers, or
underscores.
Function handles
MATLAB supports elements of lambda calculus by introducing function handles, or function references,
which are implemented either in .m files or anonymous/nested functions.
www.jntufastupdates.com
Classes and Object-Oriented Programming
MATLAB's support for object-oriented programming includes classes, inheritance, virtual dispatch,
packages, pass-by-value semantics, and pass-by-reference semantics. However, the syntax and calling
conventions are significantly different from other languages. MATLAB has value classes and reference
classes, depending on whether the class has handle as a super-class (for reference classes) or not (for
value classes).
Method call behavior is different between value and reference classes. For example, a call to a method
object.method();
can alter any member of object only if object is an instance of a reference class.
An example of a simple class is provided below.
classdef hello
methods
function greet(this)
disp('Hello!')
end
end
end
When put into a file named hello.m, this can be executed with the following commands:
>> x = hello;
>> x.greet();
Hello!
x = 0:pi/100:2*pi;
y = sin(x);
plot(x,y)
www.jntufastupdates.com
A MATLAB program can produce three-dimensional graphics using the functions surf, plot3 or mesh.
[X,Y] = meshgrid(-10:0.25:10,-10:0.25:10);
f = sinc(sqrt((X/pi).^2+(Y/pi).^2));
mesh(X,Y,f);
axis([-10 10 -10 10 -0.3 1])
xlabel('{\bfx}')
ylabel('{\bfy}')
zlabel('{\bfsinc} ({\bfR})')
hidden off
[X,Y] = meshgrid(-10:0.25:10,-10:0.25:10);
f = sinc(sqrt((X/pi).^2+(Y/pi).^2));
surf(X,Y,f);
axis([-10 10 -10 10 -0.3 1])
xlabel('{\bfx}')
ylabel('{\bfy}')
zlabel('{\bfsinc} ({\bfR})')
This code produces a surface 3D plot of the two-dimensional unnormalized sinc function:
www.jntufastupdates.com
ANSYS ICEM CFD meshing software starts with advanced CAD/geometry readers and repair tools to
allow the user to quickly progress to a variety of geometry-tolerant meshers and produce high-quality
volume or surface meshes with minimal effort. Advanced mesh diagnostics, interactive and automated
mesh editing, output to a wide variety of computational fluid dynamics (CFD) and finite element analysis
(FEA) solvers and multiphysics post-processing tools make ANSYS ICEM CFD a complete meshing
solution. ANSYS endeavors to provide a variety of flexible tools that can take the model from any
geometry to any solver in one modern and fully scriptable environment.
ANSYS ICEM CFD is a popular proprietary software package used for CAD and mesh generation. Some
open source software includes OpenFOAM, FeatFlow, Open FVM etc. Present discussion is applicable
to ANSYS ICEM CFD software.
It can create structured, unstructured, multi-block, and hybrid grids with different cell geometries.
GEOMETRY MODELLING
ANSYS ICEM CFD is meant to mesh a geometry already created using other dedicated CAD packages.
Therefore, the geometry modelling features are primarily meant to 'clean-up' an imported CAD model.
Nevertheless, there are some very powerful geometry creation, editing and repair (manual and
automated) tools available in ANSYS ICEM CFD which assist in arriving at the meshing stage quickly.
Unlike the concept of volume in tools like GAMBIT, ICEM CFD rather treats a collection of surfaces
which encompass a closed region as BODY. Therefore, the typical topological issues encountered in
GAMBIT (e.g. face cannot be deleted since it is referenced by higher topology) don't show up here. The
emphasis in ICEM CFD to create a mesh is to have a 'water-tight' geometry. It means if there is a source
of water inside a region, the water should be contained and not leak out of the BODY.
www.jntufastupdates.com
Apart from the regular points, curves, surface creation and editing tools, ANSYS ICEM CFD especially
has the capability to do BUILD TOPOLOGY which removes unwanted surfaces and then you can view
if there are any 'holes' in the region of interest for meshing. Existence of holes would mean that the
algorithm which generates the mesh would cause the mesh to 'leak out' of the domain. Holes are typically
identified through the colour of the curves. The following is the colour coding in ANSYS ICEM CFD,
after the BUILD TOPOLOGY option has been implemented:
YELLOW: curve attached to a single surface - possibly a hole exists. In some cases this might be
desirable for e.g., thin internal walls require at least one curve with single surface attached to it.
RED: curve shared by two surface - the usual case.
BLUE: curve shared by more than two surface.
Green: Unattached Curves - not attached to any surface
O-grid
C-grid
Quarter O-grid
H-grid
Octree (easiest from the user's perspective; robust but least control over the final cell count which is
usually the highest)
www.jntufastupdates.com
Delaunay (better control over the final cell count but may have sudden jumps in the size of the elements)
Advancing front (performs very smooth transition of the element sizes and may result in quite accurate
but high cell count)
Best practices
If using Octree -
use the left mouse button and drag to rotate the view
use the middle mouse button to pan the view
importing data
Tip Also, different parts of the grid can be saved under a part
A tip that is quite useful is the use of name which can be switched off or on if you want certain things
the F9 key to "pause" the tool being to be invisible like points or curves or certain surfaces. You can
used so the grid can be moved or also copy an entire set of geometry by selecting the parts you
zoomed in to. want and translating it to a specified point using the
www.jntufastupdates.com
'translation' tool. This is useful, especially when creating a symmetrical object such as a wing, where
the aerofoil can be copied to another location and then joined up to the original aerofoil with curve s.
Once the geometry is created, the next step is to create the actual grid. Note that the tolerance s of the
geometry plays an important role in the accuracy of the grid. So make sure that depending on what you
want, the tolerances are high enough. Using the blocking tab, a block can be created around the entire
geometry and then split up into sections. The mesh is created by specifying the distribution of points
along the edges of the blocks. Therefore the more blocks you have, the more flexibility you have in
changing the distribution of points along the edges. The edges and vertices of the block s must be
assosciated with the geomery curves and points.
Once the blocks have been created and all the required points and curves assosciated , the number of
points and the distribution can be set along each edge. In somecases, you want the density of cells to be
high, for example at the boundary layer of an object, whereas to save time, you may want the cells
further away to be large. There are various types of distribution such as linear, geometrical and
exponential variation that can be used. The premesh tool can then be used to view the meshing. There is
also a quality check tool, where one can specify how you want to check the quality of the blocking. For
example, one can check the variation in volume size to see if it varies smoothly, or if there are any
negative volumes, which would suggest that the grid crosses into solid surfaces.
The blocking is saved as a .blk file. When all is done, the mesh can be made readable by a solver by
specifying what type of solver is to be used in the "output tab".
Apply 10 Oisrnlssj
www.jntufastupdates.com
The surface menu is shown on the right, and to select surfaces, click the button next to it and start
selecting surfaces, using middle-click when done. Then select a mesh density (0.05 in this case, but will
vary with each case) and checkremesh selected surfaces if needed, and click ok.
Then, click volume mesh, and select the method (tetra for tetragonal unstructured meshes) to generate the
unstructured grid, press 'ok' and wait for the grid to be generated and review the result.
ANSYS computational fluid dynamics (CFD) simulation software allows you to predict, with
confidence, the impact of fluid flows on products — throughout design and manufacturing as
well as during end use. The software's unparalleled fluid flow analysis capabilities can be used
to design and optimize new equipment and to troubleshoot already existing installations.
Whatever phenomena you are studying — single- or multi-phase, isothermal or reacting,
compressible or not — ANSYS fluid dynamics solutions give you valuable insight into your
product's. ANSYS CFD analysis tools include the widely used and well-validated ANSYS
Fluent and ANSYS CFX, available separately or together in the ANSYS CFD bundle. Because
of solver robustness and speed, development team knowledge and experience, and advanced
modeling capabilities, ANSYS fluid dynamics solutions provide results you can trust. The
technology is highly scalable, providing efficient parallel calculations from a few to thousands
of processing cores. Combining Fluent or CFX with the full-featured ANSYS CFD-Post post-
processing tool allows you to perform advanced quantitative analysis or create high-quality
Visualizations and animations.
As a result of these tight connections, ANSYS CFX delivers benefits that include the ability TO:
Quickly prepare product/process geometry for flow analysis without tedious rework.
Avoid duplication through a common data model that is persistently shared across physics —
beyond basic fluid flow.
Easily define a series of parametric variations in geometry, mesh, physics and post-processing,
enabling automatic new CFD results for that series with a single mouse click
Improve product/process quality by increasing the understanding of variability and design
sensitivity.
Easily set up and perform multiphysics simulations
www.jntufastupdates.com
2. SOLUTION FOR THE ONE DIMENSIONAL WAVE EQUATION
USING EXPLICIT METHOD OF LAX (CODE DEVELOPMENT).
This equation represents a linear advection process with wave speed c = constant, which is
the speed of the travelling wave or the speed of propagation. u(x,t) is the signal or wave
information. The wave propagates at constant speed to the right if c > 0 and to the left if c <
1. The spatial domain can vary from -∞ to ∞. Suppose the initial conditions are
where is any function. The exact solution to the wave equation then is
is called the wave shape of wave form. Travelling or propagation here means that the
shape of the signal function with respect to x stays constant, however the function is
translated left or right with time at the speed c.
Numerical Solution
Method of descretisation – finite difference form
Replace the spatial partial derivative with a central difference expression
We then have
Now let us replace by an average value between grid points j+1 and j-1 as
Substituting this in equation (1) we get the explicit method of Lax for the 1D scalar wave
equations as,
www.jntufastupdates.com
Test Case for the numerical solution
Solve the one dimensional wave equation in the spatial domain of [0, 2*pi] with an initial
step function condition given by
U0(x,0) = 1 for x pi-1
= 0 otherwise
Choose 100 grid points with and find the wave form at t = 0.2 s.
% choose the wave number of the initial data and give its decay rate
u0 = x<=(pi-1);
u = zeros(M+1,N+1);
u(:,1) = u0;
www.jntufastupdates.com
ylabel('u');
pause(1)
end
%plot(x,u(:,101));
Results:
1D wave equation using explicit Lax Method
1.5
0.5
u
-0.5
0 1 2 3 4 5 6
x
www.jntufastupdates.com
3. SOLUTION FOR THE ONE DIMENSIONAL TRANSIENT HEAT
CONDUCTION EQUATION USING EXPLICIT METHOD (CODE
DEVELOPMENT)
The one dimensional transient (unsteady) heat conduction equation is given as
Numerical Solution
Method of discretization – finite difference form
Replace the time derivative with a forward difference expression
We then have
i.e. (2)
where
Equation (2) is the final explicit update equation for the one dimensional transient heat
conduction equation.
A country rock has a temperature of 300oC and the dike a width of 5m, with a magma
temperature of 1200oC. Total length of the rock formation is 100m. Initial conditions are
temperatures of 300oC and 1200oC for the rock and dike respectively. Boundary conditions at
x = -L/2 and x = L/2 are at 300oC (see figure). Find the temperature distribution after 100
days. Use 200 grid points in the x direction with a 1 day time interval.
ROCK DIKE ROCK
300oC 1200oC 300oC
www.jntufastupdates.com
L
Matlab code for the one dimensional transient heat conduction equation
% Solves the 1D heat equation with an explicit finite difference scheme
clear all
clc
%Physical parameters
L = 100; % Length of modeled domain [m]
Td = 1200; % Temperature of magma [C]
Tr = 300; % Temperature of country rock [C]
kappa = 1e-6; % Thermal diffusivity of rock [m2/s]
W = 5; % Width of dike [m]
day = 3600*24; % # seconds per day
dt = 1*day; % Timestep [s]
% Numerical parameters
nx = 200; % Number of gridpoints in x-direction
nt = 100; % Number of timesteps to compute
dx = L/(nx-1); % Spacing of grid
x = -L/2:dx:L/2;% Grid
end
% Plot solution
plot(x,Tnew);
xlabel('x [m]')
ylabel('Temperature [ˆoC]')
title(['Temperature evolution after ',num2str(time/day),' days'])
www.jntufastupdates.com
Results:
750
700
650
Temperature [ˆoC]
600
550
500
450
400
350
300
-50 -40 -30 -20 -10 0 10 20 30 40 50
x [m]
www.jntufastupdates.com 18
4. GENERATION OF THE ALGEBRAIC GRIDS
Problem
Generate an algebraic grid about the upper surface of the airfoil. Points are clustered in j
direction near the lower surface (using β=1.05 in algebraic grid). Make sure the number of
points in i and j are flexible.
As can be seen, Eq. (1) simply states that the x coordinate is the ξ coordinate, as there exists
no irregularities to alter that axis. The precise relationship in Eq. (2) is due to a required
clustering near the bottom surface. Here, β represents the clustering parameter, which is
given, and H represents the total height along the y axis. However, this does not account for
the geometry of the airfoil, wherein its top surface coordinate is a function of the distance
along the x axis. The exact equation is:
Here, y represents the max height of the airfoil, which would thus be the correspond to y=0 in
Eq.(2). Height is determined by subtracting this value from maximum height. This allows a
total expression for the grid y coordinative can be obtained. Note that the x used in Eq. (3)
assumes 0 at the nose of the airfoil and 1 at the tail. The previous equations effectively define
all that is needed to generate an algebraic grid. However, this grid will simply be used as a
starting point for the generation of an elliptic grid. Thus, once x and y are obtained
algebraically, they will be set as initial conditions for the x and y values used in order to
perform iterations of the developed finite difference equations.
www.jntufastupdates.com
MATLAB code for Algebraic Grid Generation
www.jntufastupdates.com
Discussion of Results
1.8
1.6
1.4
1.2
1
y
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3
x
Figure shows the algebraic grid generation with the growth rate β=1.05 the grids are very fine
at y=0 and it gets coarser as the y increases.
The value of growth rate β can be varied and you can see the difference in the growth rate of
the grid.
www.jntufastupdates.com
5. GENERATION OF THE ELLIPTIC GRIDS
Problem
Starting with an algebraic grid, generate an elliptic grid about the upper surface of the airfoil.
Points are clustered in j direction near the lower surface (using β=1.05 in algebraic grid).
Make sure the number of points in i and j are flexible.
Using a predetermined algebraic grid, an elliptic grid can be generated in order to fine tune
the results for airfoil flow. Coding an algebraic grid necessitates an accounting for the
geometry of the airfoil, as well as clustering via appropriate equations. Once these issues are
addressed, partial differential equations can be utilized in order to generate an elliptic grid.
As can be seen, Eq. (1) simply states that the x coordinate is the ξ coordinate, as there exists
no irregularities to alter that axis. The precise relationship in Eq. (2) is due to a required
clustering near the bottom surface. Here, β represents the clustering parameter, which is
given, and H represents the total height along the y axis. However, this does not account for
the geometry of the airfoil, wherein its top surface coordinate is a function of the distance
along the x axis. The exact equation is:
Here, y represents the max height of the airfoil, which would thus be the correspond to y=0 in
Eq.(2). Height is determined by subtracting this value from maximum height. This allows a
total expression for the grid y coordinative can be obtained. Note that the x used in Eq. (3)
assumes 0 at the nose of the airfoil and 1 at the tail. The previous equations effectively define
all that is needed to generate an algebraic grid. However, this grid will simply be used as a
starting point for the generation of an elliptic grid. Thus, once x and y are obtained
algebraically, they will be set as initial conditions for the x and y values used in order to
perform iterations of the developed finite difference equations.
Two elliptic partial differential equations must be solved in order to fully define the desired
grid. In doing this, boundary conditions are required. For this case, x and y values along the
www.jntufastupdates.com
edges of the defined physical domain will be left in place. These being predefined allows all
interior coordinates to be developed. The following system of elliptic partial differential
equations can be used to define the domain:
Here, the subscripts denote second order derivative of that variable. Notice that these
equations do not express x and y as dependent variables. Rather, they are treated as the
independent variables, requiring a transformation. When such a mathematical transformation
is preformed Eqs. (4) And (5) become, respectively:
Where,
The previously stated equations must all be expressed in terms of finite differences. Once this
is done, x and y at each grid point can be found through iterations. Expanding Equation (8)
through (10) explicitly in central space yields:
www.jntufastupdates.com
Here, the superscript, n, indexes the iteration, where n is the current iteration and n+1 is the
following iteration. These equations are written this way due to the fact that points above and
to the right of the point being evaluated are unknown, and, thus, old values must be used. The
same procedure of finite differencing can be applied to Eqs. (6) and (7). However, results
from these will be of the same form; that is, only the terms x and y will be different.
Considering the expansion of Eq. (6) yields:
Considering,
This equation can then be explicitly solved for the value which is the coordinate of
interest.
Doing so yields:
Similarly,
Considering the expansion of Eq.(7) and solving it for value of :
This formula can then be implemented through coding in order to find all values of x. The
formulation is exactly the same for the y value. Through code, multiple iterations will occur
until convergence is reached; that is, the desired x values will be found once the difference
between and is below tolerance and the desired y values will be found once
the difference between and falls below said tolerance. These values, when
plotted, should produce an elliptic grid that can be utilized to determine flow within the
domain containing the airfoil.
www.jntufastupdates.com
MATLAB code for Elliptic Grid Generation
www.jntufastupdates.com
%Nested loop to determine elliptic grid
xdiff=0;
ydiff=0;
count=0;
while dy > tol || dx > tol
for i=2:n-1
for j=2:m-1
a1=(xold(i,j+1)-x(i,j-1))/(2*delta_eta);
a2=(yold(i,j+1)-y(i,j-1))/(2*delta_eta);
a=a1^2+a2^2;
c1=(xold(i+1,j)-x(i-1,j))/(2*delta_xi);
c2=(yold(i+1,j)-y(i-1,j))/(2*delta_xi);
c=c1^2+c2^2;
b=a1*c1+a2*c2;
alpha=a/delta_xi^2;
beta=-2*b/(4*delta_xi*delta_eta);
gamma=c/delta_eta^2;
theta=1/(2*alpha+2*gamma);
phi_1=beta*(xold(i+1,j+1)-xold(i+1,j-1)-xold(i-1,j+1)+x(i-1,j-1));
x(i,j)=theta*(alpha*(xold(i+1,j)+x(i-1,j))+gamma*(xold(i,j+1)+x(i,j-
1))+phi_1);
xdiff=x(i,j)-xold(i,j)+xdiff;
phi_2=beta*(yold(i+1,j+1)-yold(i+1,j-1)-yold(i-1,j+1)+y(i-1,j-1));
y(i,j)=theta*(alpha*(yold(i+1,j)+y(i-1,j))+gamma*(yold(i,j+1)+y(i,j-
1))+phi_2);
ydiff=y(i,j)-yold(i,j)+ydiff;
end
end
dx=xdiff;
dy=ydiff;
xdiff=0;
ydiff=0;
xold=x;
yold=y;
count=count+1;
end
fprintf('The solution took %i iterations to converge. \n \n', count);
surface(x,y,z);
xlabel ('x');
ylabel ('y');
title ('Elliptic grid over an Airfoil');
www.jntufastupdates.com
Result and Discussion
In the plot of an Elliptical, the Grid lines have been smoothed out due to the elliptic
equations, eliminating extreme jaggedness resulting from the algebraic grid. This would
ensure a more accurate flow model.
1.8
1.6
1.4
1.2
1
y
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3
x
Overall, an elliptic grid was shown to provide desired results for discretization. It succeeded
in smoothing out otherwise rough edges created through algebraic grid generation. At the
same time, the algebraic grid provided a suitable starting point for the generation of the
elliptic grid.
www.jntufastupdates.com
Numerical simulation of the following flow problems using commercial
software packages:
Problem description:
Consider air flowing over NACA 0012 airfoil. The free stream mach number is 1.2
and the angle of attack is 5°. Assume standard sea-level values for the free stream properties:
Pressure = 101,325 Pa
Density = 1.2250 kg/m3
Temperature = 288.16 K
Kinematic viscosity v = 1.4607e-5 m2/s
Steps Involved In ICEM
CFD: Creation of Geometry in ICEM CFD:
www.jntufastupdates.com
Importing the Aerofoil coordinates
FileImport GeometryFormatted point dataSelect the file of aerofoil
coordinates which is in DAT formatok. Now the coordinates will be
displayed.
GeometryCreate/modify curveFrom pointsSelect above points and
leave last 2 pointsmiddle click
Similarly on bottom side
Join the end points of the curves
1) Creation of parts:
Parts in the treeRight clickCreate part
Select Upper curve: Suction
Select Lower curve: Pressure
3rd Line: TE
2) Creation of Domain:
Create points (-1,1),(-1,-1),(2,1),(2,-1)
Join these points
Create parts as Inlet, Outlet, Top & Bottom
GeometryCreate/Modify surfaceSimple surfaceSelect all the lines of
domainok
www.jntufastupdates.com
Create the new part as: Surface
3) Saving the Geometry:
FileChange working directoryChoose the folder
FileGeometrySave Geometry asGive the name.
4) Creation of Blocking and Association:
BlockingCreate blockInitialize blocksType as:2D Planarok
AssociateAssociate vertex to pointSelect a vertex and a pointApply
Similarly associate remaining 3 vertices to points
AssociateAssociate edge to curveSelect a edge and a curve Apply
Similarly associate remaining 3 edges to curves
Split blockSelect the edgesCreate the blocks as shown in figure
www.jntufastupdates.com
Thus the 0 grid has been generated as shown in below fig.
.MISYS,
c::::::::::::: ..
+ 0
Associate-7 Associate vertex to point-7Select the vertex of the 0 grid and the
2nd point on the upper curve(suction)-7ok
Similarly associate remainin g 3 vertices of the 0 grid to the points on the
aerofoil as shown in the below fig.
v v
................
l
c I 1 1 1I I I
0
X
www.jntufastupdates.com
Associate
Associate edge to curveSelect the 3 edges of block which is
inside of the aerofoil and select the suction & pressure curvesok
Similarly associate the TE edge to TE curve.
Delete blockSelect the block inside the aerofoilok
5) Generation of Mesh:
Pre-mesh parametersEdge parametersSwitch ON the Copy Parameters
Select the edges and give desired no. of nodesok
Switch ON Pre-mesh in the treeclick yes to compute the meshing
Pre-meshRight clickConvert to unstructured mesh
Now the required mesh has been generated as shown in below fig.
www.jntufastupdates.com
8) Importing the mesh file:
FileReadmeshChoose the output file written in ICEM CFD
Now the mesh has imported into the fluent solver.
9) Problem setup:
GeneralType as: Pressure based
ModelsEnergy ONViscous-laminar
MaterialsAir
Cell zone conditions
Type as: fluidok
Boundary conditionsSelect inletEditGive velocity magnitude as:
400m/s.
Boundary conditionsSelect outletEditGive gauge pressure as: 0 Pa
10) Solution:
Select the required monitors
Solution initializationCompute from: inletInitialize
Run calculationsEnter the no. of iterations as: 1000Calculate
11) Results:
Graphics and animationselect the required flow parameters in the contours
and vectors.
The results are shown below as:
www.jntufastupdates.com
www.jntufastupdates.com
7. SUPERSONIC FLOW OVER A WEDGE
Problem description:
Consider air flowing over wedge. The free stream Mach number is 3 and the angle of
attack is 5°. Assume standard sea-level values for the free stream properties:
Pressure =101,325Pa
Density =1.2250kg/m3
Temperature =288.16K
Kinematic viscosity v = 1.4607e-5 m2/s
y
G
0 1.259
0.5
1.259
' 1.259 0268 0
e
L 0 0 0 0 0 0
0 .
J\N SYS
L:.x
www.jntufastupdates.com
13) Creation of parts:
Parts in the treeRight clickCreate part
Select Left curve: Inlet
Select Right curve: Outlet
Select Top curve: Top
Select inclined curve: Wedge
Select bottom curve: Front_wedge
14) Saving the Geometry:
FileChange working directoryChoose the folder
FileGeometrySave Geometry asGive the name.
15) Creation of Blocking and Association:
BlockingCreate blockInitialize blocksType as:2D Planarok
AssociateAssociate vertex to pointSelect a vertex and a pointApply
Similarly associate remaining 3 vertices to points
AssociateAssociate edge to curveSelect a edge and a curve Apply
Similarly associate remaining 3 edges to 5 curves
www.jntufastupdates.com
Switch ON Pre-mesh in the treeclick yes to compute the meshing
Pre-meshRight clickConvert to unstructured mesh
Now the required mesh has been generated as shown in below fig:
www.jntufastupdates.com
Boundary conditionsSelect inletGive type as: pressure-far-
fieldEditGive Gauge pressure as: 101325PaSet Mach as: 3ok
Boundary conditionsSelect outletEditGive gauge pressure as: 0Pa
21) Solution:
Select Solution ControlsSet Courant number as: 1
Select the required monitors
Solution initializationCompute from: inletInitialize
Run calculationsEnter the no. of iterations as: 1000Calculate
22) Results:
Graphics and animations
Select the required flow parameters in the contours
and vectors.
The results are shown below as:
www.jntufastupdates.com
8. FLOW OVER A FLAT PLATE
Aim: To study the characteristics of flow over a flat plate
Description: Consider a plate of 1m and the flow of air is 0.00133 m/s. The plate is an
stationary solid wall having no slip as its boundary condition.
Procedure:
www.jntufastupdates.com
Change the working directory
output→ output solver→ fluent V6→ common-ansys→ ok
FLUENT:
www.jntufastupdates.com
Results→ graphics and animations→ contour→ set up→ display options→
filled→ display
Contour→ velocity→ display
vector→ velocity→ display
For residue→ contour→ residue→ display
www.jntufastupdates.com
9. LAMINAR FLOW THROUGH PIPE
AIM: To study characteristics of laminar flow through a pipe.
DESCRIPTION: Consider a pipe of radius 0.05 and 1 mt length. The freestream velocity
considered is 40m/s.
STEPS INVOLVED:
1) Create A Geometry:
a) Create a point: Geometry create point explicit coordinates
(X, Y, Z) =
(0, 0, 0) apply(X, Y, Z) = (1, 0, 0) ok.
2) Generation of parts:
Part
create part outlet select outlet
ok.
Part
create part pipe select pipe without inlet and outlet
ok.
3) Generation of blocking:
www.jntufastupdates.com
Blockingassociate edge to curveselect the 4 edges of the blocking at
outlet
applyselect the outlet curveok.
Associate
faces to surface
select outlet face
apply
select as outlet
accept ok.
Blocking split block O grid block select the 2 faces (inlet & outlet)
apply ok.
4) Generation of Meshing:
Repeat the above steps to the remaining edges also and then apply.
Blocking
pre-mesh
compute.
Blocking
pre-mesh
convert to unstructured mesh.
Outputselect solveransys.cfxANSYSok.
Output
write input
done
check the file is saved folder
ok.
www.jntufastupdates.com
6) Solution in CFX Solver:
Change the working directory (where ICEM CFD mesh file was
saved)-7Click on CFX-PRE.
7) CFX-PRE:
File-7 new case-7 general-7 ok.
www.jntufastupdates.com
8) CFX-Solver Manager:
9) CFX-POST:
FileLoad resultsOk.
www.jntufastupdates.com
pressure contour
velocity vector
www.jntufastupdates.com
10. FLOW PAST OVER A CYLINDER
AIM : To study the characteristics of flow over a cylinder.
DESCRIPTION: Consider a cyclinder of 3m radius and 6m height. The free stream velocity
considered 20m/s. the properties of air is ρ=1.18kg/m3.
PROCEDURE:
CREATION OF GEOMETRY:
www.jntufastupdates.com
Output → outpur solver- ANSYS CFX → common solver → ANSYS →
APPLY
WRITE INPUT → OK
www.jntufastupdates.com
Solver:
Post processing:
www.jntufastupdates.com
Vectors → domain: plane 1 → local → conservative →
apply
www.jntufastupdates.com