Professional Documents
Culture Documents
CERTIFICATE
Department of Aeronautical Engineering Certified that this is a bonafide record of work done by
_________________________________
(AEROSPACE
ENGINEERING)
Roll
First
.No:
Year
______________
______
of
M.
Semester
Tech.
in
Date:
Internal Examiner
Staff Incharge
HOD
External Examiner
the
MRCET
INDEX
S.NO
EXPERIMENT
Page
No
Signature
1.
Flow over an airfoil
2.
Supersonic flow over a wedge
3.
4.
Laminar pipe flow
5.
6.
7.
8.
9.
10.
11.
12.
13.
MRCET
MRCET
2. Mesh geometry:
MRCET
Fluid
Location
FLUID
Materials
Material Library
Morphology
Continuous Fluid
Settings
Buoyancy Model
Non Buoyant
Domain Motion
Stationary
Reference Pressure
1.0000e+00 [atm]
Isothermal
2.5000e+01 [C]
Turbulence Model
SST
Scalable
Domain
Boundaries
Boundary - inlet
Type
INLET
Location
Default Domain Modified
IN_1
Settings
Flow Regime
Mass And Momentum
Normal Speed
2|Digital Simulation Lab - I
Subsonic
Normal Speed
1.3000e+02 [m s^-1]
Turbulence
low Intensity = 1%
Boundary - outlet
Type
OUTLET
Location
OUT_1
Settings
Flow Regime
Subsonic
5.0000e-02
Relative Pressure
Pressure Averaging
1.0132e+05 [Pa]
Average Over Whole Outlet
Boundary - WALL
Type
WALL
Airfoil_1, Top_1, Bot _1
Location
Settings
No Slip Wall
Wall Roughness
Smooth Wall
POST PROCESSING
Create plane
Create contour pressure, mach number
Create streamlines
Create chart for velocity along plate.
MRCET
Results:
MRCET
MRCET
MRCET
Fluid
Location
FLUID
Materials
Material Library
Morphology
Continuous Fluid
Settings
Buoyancy Model
Non Buoyant
Domain Motion
Stationary
Reference Pressure
1.0000e+00 [atm]
Isothermal
2.5000e+01 [C]
Turbulence Model
K- epsilon
Scalable
Domain
Boundaries
Boundary - inlet
Type
INLET
IN_1
Settings
Flow Regime
6|Digital Simulation Lab - I
Supersonic
Normal Speed
1.04000e+02 [m s^-1]
1 atm
Static temp
300 K
Boundary - outlet
Type
OUTLET
Location
OUT_1
Settings
Flow Regime
Supersonic
WALL
Location
No Slip Wall
Wall Roughness
Smooth Wall
POST PROCESSING
5. Analyze results in CFX POST:
Create plane
Create contour pressure, mach number
Create streamlines
Create chart for velocity along plate.
MRCET
RESULTS:
Temperature contour
Pressure contour
MRCET
MRCET
MRCET
Fluid
Location
FLUID
Materials
Material Library
Morphology
Continuous Fluid
Settings
Buoyancy Model
Non Buoyant
Domain Motion
Stationary
Reference Pressure
1.0000e+00 [atm]
Isothermal
2.5000e+01 [C]
Turbulence Model
SST
Scalable
Domain
Boundaries
Boundary - inlet
Type
INLET
IN_1
Settings
Flow Regime
10 | D i g i t a l S i m u l a t i o n L a b - I
Subsonic
MRCET
Normal Speed
Normal Speed
0.3000e+02 [m s^-1]
Turbulence
low Intensity = 1%
Boundary - outlet
Type
OUTLET
Location
OUT_1
Settings
Flow Regime
Subsonic
5.0000e-02
Relative Pressure
1.0132e+05 [Pa]
Pressure Averaging
Type
WALL
flat_ns_1, back_ns_1 and front _ ns_1
Location
Settings
No Slip Wall
Wall Roughness
Smooth Wall
POST PROCESSING
5. Analyze results in CFX POST:
Create plane
Create contour pressure, mach number
Create streamlines
Create chart for velocity along plate.
11 | D i g i t a l S i m u l a t i o n L a b - I
RESULTS:
12 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
MRCET
13 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
Fluid
Location
FLUID
Materials
Material Library
Morphology
Continuous Fluid
Settings
Buoyancy Model
Non Buoyant
Domain Motion
Stationary
Reference Pressure
1.0000e+00 [atm]
Isothermal
2.5000e+01 [C]
Turbulence Model
K- epsilon
Scalable
Domain
Boundaries
Boundary - inlet
Type
INLET
IN_1
Settings
Flow Regime
14 | D i g i t a l S i m u l a t i o n L a b - I
Supersonic
Normal Speed
0.01000 [m s^-1]
1 atm
Static temp
300 K
Boundary - outlet
Type
OUTLET
Location
OUT_1
Settings
Flow Regime
Subsonic
WALL
Top_1, Bot_1, Wed_1
Location
Settings
No Slip Wall
Wall Roughness
Smooth Wall
POST PROCESSING
5. Analyze results in CFX POST:
Create plane
Create contour pressure, mach number
Create streamlines
Create chart for velocity along pipe.
15 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
RESULTS:
meshed model
velocity contour
Pressure contour
16 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
MRCET
17 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
Fluid
Location
FLUID
Materials
Material Library
Morphology
Continuous Fluid
Settings
Buoyancy Model
Non Buoyant
Domain Motion
Stationary
Reference Pressure
1.0000e+00 [atm]
Isothermal
Fluid Temperature
Ideal gas
Turbulence Model
K- epsilon
Scalable
Domain
Boundaries
Boundary - inlet
Type
INLET
IN_1
Settings
Flow Regime
18 | D i g i t a l S i m u l a t i o n L a b - I
Supersonic
MRCET
Normal Speed
Normal Speed
34.01000 [m s^-1]
1 atm
Static temp
300 K
Boundary - outlet
Type
OUTLET
Location
OUT_1
Settings
Flow Regime
Subsonic
Type
WALL
Wall_1
Location
Settings
Mass And Momentum
free Wall
Wall Roughness
Smooth Wall
Boundary Cyl_1
Type
WALL
Wall_1
Location
Settings
Mass And Momentum No slipWall
Wall Roughness
19 | D i g i t a l S i m u l a t i o n L a b - I
Smooth Wall
POST PROCESSING
5. Analyze results in CFX POST:
Create plane
Create contour pressure, mach number
Create streamlines
Create chart for velocity along pipe.
RESULTS:
velocity contour
pressure contour
20 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
MRCET
Aim: Consider the nozzle having a cross sectional area A varies with axial distance from the
throat, according to the formula A = 0.1+X2; where X varies from -0.5<X<0.5.
Stagnation pressure Po = 101325 pa; stagnation temperature To = 300K;
21 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
Fluid
Location
FLUID
Materials
Material Library
Morphology
Continuous Fluid
Settings
Buoyancy Model
Non Buoyant
Domain Motion
Stationary
Reference Pressure
1.0000e+00 [atm]
Isothermal
2.5000e+01 [C]
Turbulence Model
k epsilon
Scalable
Domain
Boundaries
Boundary - inlet
Type
INLET
Location
IN
Settings
Flow Regime
Subsonic
Normal Speed
Turbulence
Normal Speed
2.8000e+02 [m s^-1]
Medium Intensity and Eddy Viscosity
Ratio
Boundary - outlet
Type
OUTLET
Location
OUT
Settings
Flow Regime
22 | D i g i t a l S i m u l a t i o n L a b - I
Subsonic
Pressure Profile
Blend
5.0000e-02
Relative Pressure
Pressure Averaging
1.0132e+05 [Pa]
Average Over Whole Outlet
Boundary - WALL
Type
WALL
Location
Wall
Settings
No Slip Wall
Wall Roughness
Smooth Wall
POST PROCESSING
6. Analyze results:
Create plane
Create contour pressure, mach number
Create streamlines
Create chart for temperature along nozzle axis.
23 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
Pressure contour
24 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
MRCET
X1=reshape(X',length(x)*length(y),1);
Y1=reshape(Y',length(x)*length(y),1); %Coordinates of the node
25 | D i g i t a l S i m u l a t i o n L a b - I
26 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
MRCET
27 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
Discussion of Results Enter the number of grid points in the i direction: 50 Enter the number of
grid points in the j direction: 50 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. 0 0.5 1 1.5 2 2.5
3 0 0.2 0.4 0.6 0.81 1.2 1.4 1.6 1.82 x y Algerbraic Grid.
28 | D i g i t a l S i m u l a t i o n L a b - I
Burgers Programm
clear all;
%Selection of equation and method.
xend = 2; % x-axis size.
tend = 2; % t-axis size.
N = input('Enter the number of grid points: ');
dx = xend/N; % Grid spacing
dt = input('Enter time step dt: ');
x = 0:dx:xend;
nt = floor(tend/dt);
dt = tend / nt;
%Set up the initial solution values.
u0=(0:0.2:2);
u=u0;
unew = 0*u;
%Implementation of the numerical methods.
for i = 1 : nt
us = u(1:end-1) - dt/dx * (f(u(2:end)) - f(u(1:end-1)));
unew(2:end-1)= 0.5*(u(2:end-1) + us(2:end)) - ...
0.5*dt/dx* (f(us(2:end)) - f(us(1:end-1)));
unew(1) = u(1);
unew(end) = u(end);
u = unew;
U(i,:) = u(:);
end
U=[u0;U];
T=0:dt:tend;
%Plot of the solutions.
figure(1)
29 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
30 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
MRCET
EXPERIMENT 10: Write a Program for Blasius solution for laminar boundary layer over
a flat plate.
% This script animates the solution to the Balsius' model for a boundary
% layer flow over a flat plate. This model assumes steady flow, constant
% density and viscosity. First one must solve the Blasius differential
% equation f'''+0.5*f*f''= 0 with f(0)=0, f'(0)=0 AND f'(infinity)=0 where
% the prime denotes differentiation wuth respect to eta=y*(U*rho/mu)^.5.
clear all
set(0,'DefaultAxesFontSize',12);
set(0,'DefaultTextFontSize',12);
eta=linspace(0,10,2001);
deta=.005;
z1=0;
z2=0;
z3=.33193;%input('The second derivative at eta = 0 is');
% Found by trial and error assuming various values until the final
% condition was satisfied.
X=[z1;z2;z3];
for i=1:2000
z1=z1+z2*deta;
z2=z2+z3*deta;
z3=z3-0.5*z1*z3*deta;
X=[X [z1;z2;z3]];
end
figure(1);clf;
subplot(3,1,1)
plot(eta,X(1,:))
xlabel('Variable, \eta')
ylabel('Solution, f(\eta)')
subplot(3,1,2)
plot(eta,X(2,:))
xlabel('Variable, \eta')
ylabel('Solution, df(\eta)/d\eta')
subplot(3,1,3)
plot(eta,X(3,:))
xlabel('Variable, \eta')
ylabel('Solution, d^2f(\eta)/d\eta^2')
F=eta.*X(2,:)-X(1,:);
text(5,1.5,'Press Enter to Continue')
pause
figure(2);clf;
plot(eta,F)
xlabel('Variable, \eta')
ylabel('Solution, \etadf(\eta)/d\eta-f(\eta)')
text(4,.8,'Press Enter to Continue')
pause
y=linspace(0,.003,51);
x=[0 .05 .1 .15 .2 .25 .3 .35 .4 .45 .5]*.1;
figure(3);clf;
31 | D i g i t a l S i m u l a t i o n L a b - I
32 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
33 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
34 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
35 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
36 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
EXPERIMENT 11: Write a Program Riemann solver for shock tube problem
% Riemann solver for solving shock-tube problem
% 6 possible cases of formation of shock waves and expansionfan have been
% considered including the case of cavitation. The cavitationcheck is
% incorporated in the code. It further prevents plotting formathematically
% possible but physically unlikely case of expansion shocks.
%
clear;
clc;
close all;
% Ratio of specific heats for air
gamma = 1.4;
% Problem definition: Conditions at time t=0
% Case 1 : Sod's Problem
ch=0;
while(ch==0)
fprintf ('Choose one of the following cases :- \n');
fprintf ('\n \t Case 1: Sods problem \n');
fprintf ('\t Case 2: Left running expansion and right running "STRONG" shock \n');
fprintf ('\t Case 3: Left running shock and right running expansion \n');
fprintf ('\t Case 4: Double shock \n');
fprintf ('\t Case 5: Double expansion \n');
fprintf ('\t Case 6: Cavitation \n');
cas=input ('\nEnter a case no. <1-6>: ');
if cas==1
% Case 1:Left Expansion & right Shock
fprintf('Case 1:Sods problem \n');
rho1=1;
rho4=0.125;
u1=0;
u4=0;
p1=1;
p4=0.1;
fprintf ('P1 = %f \n',p1);
fprintf ('P4 = %f \n',p4);
fprintf ('U1 = %f \n',u1);
fprintf ('U4 = %f \n',u4);
fprintf ('rho1 = %f \n',rho1);
fprintf ('rho4 = %f \n',rho4);
ch=1;
elseif cas==2
% Case 2:Strong Expansion & Shock
fprintf('Case 2:Strong Expansion & Shock \n');
rho1=3;
rho4=2;
u1=0;
u4=0;
p1=1000;
p4=0.01;
fprintf ('P1 = %f \n',p1);
fprintf ('P4 = %f \n',p4);
fprintf ('U1 = %f \n',u1);
fprintf ('U4 = %f \n',u4);
fprintf ('rho1 = %f \n',rho1);
37 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
38 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
MRCET
u4=20;
p1=0.40;
p4=0.40;
fprintf ('P1 = %f \n',p1);
fprintf ('P4 = %f \n',p4);
fprintf ('U1 = %f \n',u1);
fprintf ('U4 = %f \n',u4);
fprintf ('rho1 = %f \n',rho1);
fprintf ('rho4 = %f \n',rho4);
ch=1;
else
fprintf ('Please enter an appropriate choice \n');
end % for case selection if-else loop
end % for case selection while loop
% Calculation of flow parameters at initial condition
a1=sqrt(gamma*p1/rho1);
a4=sqrt(gamma*p4/rho4);
M1=u1/a1;
M4=u4/a4;
if u1<0 && u4>0 && (u1+(2/(gamma-1))*a1)<=(u4-(2/(gamma-1))*a4)
%chk for cavitation
fprintf('\n Cavitation is observed in this case of double expansion. No solution possible \n');
break;
else
% Secant Method for getting pressure P*
p23up=(((gamma-1)/2*(u1-u4)+a1+a4)/((a1*(p1)^((2*gamma)/(gamma-1)))+(a4*(p4)^((2*gamma)/(gamma1)))))^((2*gamma)/(gamma-1)); % upper limit
p23down=(rho1*a1*p4+rho4*a4*p1-(rho1*a1*rho4*a4*(u4-u1)))/(rho1*a1+rho4*a4); %lower limit by linear
theory
s=0;
if p23down>=p1
s=1;
end
ss=0;
if p23down>=p4
ss=1;
end
if s==1
m1=rho1*a1*sqrt(1+((gamma+1)*(p23up-p1)/(2*gamma*p1)));
m1d=rho1*a1*sqrt(1+((gamma+1)*(p23downp1)/(2*gamma*p1)));
else
m1=rho1*a1*(gamma-1)/(2*gamma)*(1-p23up/p1)/(1-(p23up/p1)^((gamma-1)/(2*gamma)));
m1d=rho1*a1*(gamma-1)/(2*gamma)*(1-p23down/p1)/(1-(p23down/p1)^((gamma-1)/(2*gamma)));
end
if ss==1
m4=rho4*a4*sqrt(1+((gamma+1)*(p23up-p4)/(2*gamma*p4)));
m4d=rho4*a4*sqrt(1+((gamma+1)*(p23down-p4)/(2*gamma*p4)));
else
m4=rho4*a4*(gamma-1)/(2*gamma)*(1-p23up/p4)/(1-(p23up/p4)^((gamma-1)/(2*gamma)));
m4d=rho4*a4*(gamma-1)/(2*gamma)*(1-p23down/p4)/(1-(p23down/p4)^((gamma-1)/(2*gamma)));
end
p23=(m1*p4+m4*p1-m1*m4*(u4-u1))/(m1+m4);
f=p23up-p23;
p23d=(m1d*p4+m4d*p1-m1d*m4d*(u4-u1))/(m1d+m4d);
ff=p23d-p23;
j=0;
39 | D i g i t a l S i m u l a t i o n L a b - I
40 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
41 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
42 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
MRCET
44 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
45 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
MRCET
MRCET
12. Solve 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 % Setup initial temperature profile
T = ones(size(x))*Tr;
T(abs(x)<=W/2) = Td;
time = 0;
for n=1:nt % Timestep loop % Compute new temperature
Tnew = zeros(1,nx);
for i=2:nx-1
Tnew(i) = T(i) + (kappa*dt/(dx)^2)*(T(i+1)-(2*T(i))+T(i-1));
end % Set boundary conditions
Tnew(1) = T(1);
Tnew(nx) = T(nx); % Update temperature and time
T = Tnew;
time = time+dt;
end % Plot solution
plot(x,Tnew);
xlabel('x [m]')
ylabel('Temperature [oC]')
title(['Temperature evolution after ',num2str(time/day),' days']) % draw the dike boundaries
x1 = -2.5;
x2 = 2.5;
y = linspace(300,800); % Plot the dike boundaries
hold on
plot(x1,y, x2, y);
47 | D i g i t a l S i m u l a t i o n L a b - I
48 | D i g i t a l S i m u l a t i o n L a b - I
MRCET
MRCET
13. Solve the one dimensional scalar wave equation du/dt + du/dx = 0 [0,2*pi] Using LAX
METHOD
clc;
clear;
t0 = 0; tf = 1;
M = 100;
% number of points in x direction
N = 100;
% number of points in y direction
% define the mesh in space
dx = 2*pi/M;
x = 0:dx:2*pi;
% define the mesh in time
dt = (tf-t0)/N;
t = t0:dt:tf;
% calculate value for lamda
c = 1;
lambda=c*dt/dx
display('lambda should be less than 1 for stability:')
% 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;
% Implement the time marching Lax scheme:
for n=1:N
for i=2:M
u(i,n+1) = (u(i+1,n)+u(i-1,n))/2-(lambda/2)*(u(i+1,n)-u(i-1,n));
end % Introduce exact values at the endpoints.
u(1,n+1)=1;
u(M+1,n+1)=0;
end
% plot the result in 21 intervals
for j=0:20
plot(x,u(:,1+5*j),'LineWidth',2);
axis([0,2*pi,-0.5,1.5]);
title('1D wave equation using explicit Lax Method','FontSize',12)
xlabel('x');
ylabel('u');
pause(1)
end
%plot(x,u(:,101));
49 | D i g i t a l S i m u l a t i o n L a b - I
50 | D i g i t a l S i m u l a t i o n L a b - I
MRCET