0% found this document useful (0 votes)
23 views6 pages

Computational Fluid Dynamics Practical

Uploaded by

kmkrao5787
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views6 pages

Computational Fluid Dynamics Practical

Uploaded by

kmkrao5787
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

MCC518 Computational Fluid Dynamics Practical

Lab Manual
Department of Mathematics & Computing
Indian Institute of Technology (Indian School of Mines) Dhanbad

1
Primer
This lab manual gives programming problems in C or C++ and provides
instructions to implement them. The problems in this manual are carefully selected
from the accompanying theory course. The lecture plan/syllabus of the theory and
this lab should be available from respective instructors. Basic knowledge of
continuum mechanics is desirable. Students must also know about the simple
partial differential equations (PDEs), classification of PDEs of second order into
elliptic, parabolic and hyperbolic types, and PDEs governing flow and heat transfer
problems.
In order to prepare for conducting lab experiments, please learn C or C++ and git
by completing the corresponding (free) course from https://www.codecademy.com/
You are highly encouraged to take a look at this web-site! Our labs are equipped
with Linux machines. However, you are encouraged and welcome to bring your
laptops to the lab. Please install a CPP Integrated Development Environments
(IDE) and compiler on your laptops before coming to the first lab.
Electronic Lab Report
The lab report in electronic format should be maintained and is due at the end of
the semester. Please create a git directory and create a readme.txt file inside it with
following entries:
1. Name and Admission number of the student:
2. A table of experiments and the corresponding cpp filenames, e.g.,
Date Experiment No. Main filename Commit id
11.08.2020 1HE(a) heatequn.cpp wxyz3275f
3. You should regularly commit your assignment to the git repo.
4. Place all program files inside the same directory.
Grade
L -T-P: 0-0-3

2
LIST OF EXPERIMENTS

Sl. No. Name of Experiments

Experiment 1 (Solution of Heat Equation by Explicit FDM)


Aim To get acquainted with explicit scheme of finite difference method for
solution of parabolic partial differential equation with special
reference to one dimensional heat conduction equation.
Q1 Write the explicit form of finite difference equation corresponding
tothe partial differential equation (PDE) or ut = uxx and write
a C or C++ program to solve the above PDE with prescribed initial
condition and zero boundary values by explicit method.
Q2 Write a C or C++ program to solve the partial differential equation
with boundary conditions
0 by explicit method.

Experiment 2 (Solution of Heat Equation by Implicit FDM)


Aim To be familiar with implicit scheme of finite difference method for
solution of parabolic partial differential equation with special
reference to one dimensional heat conduction equation.
Q1 Write the implicit form of the difference equation corresponding tothe
partial differential equation (PDE) or ut = uxx and write a C or
C++ program to solve the above PDE with prescribed initial condition
and zero boundary values by implicit method. Discuss convergence of
the implicit form.
Q2 Write a C or C++ program to solve the equation or ut = 4uxx
with boundary conditions
0 by implicit method.

Experiment 3 (Solution of Heat Equation by Semi-Implicit FDM)


Aim To be conversant with semi-implicit scheme of finite difference
method for solution of parabolic partial differential equation with
special reference to one dimensional heat conduction equation.

3
Sl. No. Name of Experiments
Q1 Write a C or C++ program to solve the equation or ut = uxx
satisfying the conditions by
Crank-Nicolson’s method, which is a semi-implicit method.
Q2 Write a C or C++ program to solve the equation or ut = uxx
satisfying the conditions
by Crank-
Nicolson’s method, which is semi- implicit.
Experiment 4 (Solution of Elliptic PDE by FDM)
Aim To appreciate the importance of second order elliptic partial
differential equations viz. Laplace and Poisson equations and its
solution by finite difference method.
Q1 Write a C or C++ program to solve the Laplace equation =0
oruxx + uyy = 0 or at the interior grid points of a square mesh
with prescribed boundary conditions, using method of relaxation.
Q2 Find the steady state temperature distribution in a square metallic
plate, one side of which is maintained at 100°C and other three sides
maintained at 0°C.
Hint: The problem is that of solving Laplace equation in a rectangle.
Q3 Write a C or C++ program to solve the Poisson equation uxx + uyy = - 4
(x2 + y2) or over the square mesh with sides x =
0, y = 0, x = 3 and y = 3 with u = 0 on the boundary, using the method
of relaxation.
Experiment 5 (Solution of Wave Equation by FDM)
Aim To solve hyperbolic PDEs such as wave equation by finite difference
method.
Q1 Write a C or C++ program to solve the partial differential equation utt
= uxx, for x = 0 (0.2) 1 and t = 0 (0.2) 1, given that u(0, t) = 0, u(1, t) =
0, u (x, 0) = x(1 – x) and ut (x, 0) = 1.
Q2 Write a C or C++ program to solve the equation utt = uxx, up to t = 1
with step size 0.2, given that u(0, t) = 0, u(1, t) = 0, ut (x, 0) = 0 and u
(x, 0) = 10 + x(1 – x), 0 <x<1.

Experiment 6 (Solution of Heat Equation by FVM)


4
Sl. No. Name of Experiments
Aim To understand the application of the finite volume method (FVM) to
solve simple diffusionproblems involving conductive heat transfer.
Q1 Consider the problem of source-free heat conduction in an insulated
rodwhose ends are maintained at constant temperatures of 100°C and
500°Crespectively.Calculate the steady state temperature distribution
in the rod. Describe the numerical methodology behind the heat
conduction equation solver based on the finite volume method (FVM)
and write a C or C++ program to implement it.
Q2 Let us have a problem that includes sources other than those
arisingfrom boundary conditions. Consider a large plate of thicknessL
= 2cm with constant thermal conductivity k = 0.5 W/m.K and
uniformheat generation q = 1000 kW/m3. The faces A and B are at
temperaturesof 100°C and 200°C respectively. Assuming that the
dimensions in the y- andz-directions are so large that temperature
gradients are significant in the x-directiononly, calculate the steady
state temperature distribution by finite volume method (FVM). Write a
C or C++ program to implement itand comparethe numerical results
with the analytical solution.
Q3 Let us consider the two-dimensional steady statediffusion equation,
when the source term is represented in the linearised form. At the
boundaries, the temperatures are known. Applyfinite volume method
tocalculate conductive heat transfer in two-dimensional situations and
write the corresponding C or C++ program to implement it.
Experiment 7 (Solution of LaplaceEquation by FVM)
Aim To be familiar withfinite volume method for the Laplace equation on
two-dimensional grids.
Q1 Describe finite volume method for solution of Laplace equation on a
two-dimensional grid and write a C or C++ program to implement it.
Experiment 8 (Solution of Wave Equation by FVM)
Aim To understand finite volume method for the wave equation in two
dimensions. and write a C or C++ program to implement it.
Q1 Describe finite volume method for solution of linear wave equation on
a two-dimensional grid and write a C or C++ program to implement it.

Experiment 9 (SIMPLE ALGORITHM)

5
Sl. No. Name of Experiments
Aim To be conversant with the SIMPLE algorithm for calculating pressure
andvelocities.
Q1 Consider the steady, one-dimensional flow of a constant-density
fluidthrough a duct with constant cross-sectional area. Use the
staggered grid, where the pressure p is evaluated at the main nodes,
whilst the velocity u is calculated at the backwardstaggered nodes.
Use the SIMPLE algorithm to calculate pressurecorrections at main
nodes and obtain the corrected velocity field atbackward staggered
nodes. Write a C or C++ program to implement it.
Q2 A planar two-dimensional nozzle, wherein the flow is steadyand
frictionless and the density of the fluid is constant.Use the backward-
staggered grid with five pressure nodes and fourvelocity nodes. The
stagnation pressure is given atthe inlet and the static pressure is
specified at the exit. Using the SIMPLEalgorithm, write down the
discretised momentum and pressure correctionequations and solve for
the unknown pressures at the main nodes and velocities at the
staggered nodes. Write a C or C++ program to implement it.
Experiment 10 (QUICK ALGORITHM)
Aim To get acquainted with the Quadratic upwind differencing scheme: the
QUICK scheme.
Q1 A property φ is transported by means of convection and diffusion
throughthe one-dimensional domain as shown below.

u
φ=1 φ=0
x=0 x=L

The governing equation is given by


; the boundary conditions are φ0 = 1 at x = 0
and φL = 0 at x = L. Using the QUICK scheme solve the problem
considered foru = 0.2 m/s on a five-point grid.Write a C or C++
Program to implement it.

Q2 Discuss stability problems of the QUICK scheme and its remedies.

You might also like