Advanced Thermal and Fluid Engineering: (Email Address)
Advanced Thermal and Fluid Engineering: (Email Address)
Engineering
301023
user
[Email address]
Contents
Analysis of Part 1..................................................................................................1
Governing equation..........................................................................................1
Governing equations.........................................................................................8
1
Introduction
This project deals with computational fluid dynamics analysis with the help of
MATLAB. There are two parts one is composed of energy production from
damping and the second one is the analysis of heat transfer in soil.
Computational methods are used to analyze the governing equations and the
governing equations are converted into algebraic form. The analysis field is
divided into nodes and initial as well as boundary conditions are applied in the
numeric forms of governing equations. The stability conditions are considered
and thereby implicit equations are used rather than explicit conditions. The
objective of this project is to understand the numerical methods and its
importance in differential equations. Complicated differential equations are
simply converted into algebraic forms using numerical methods and the system
is analyzed with the help of software tool. The CFD analysis is not just the flow
of fluid, it also involves the heat transfer analysis. It became so much important
nowadays that without CFD the analysis of complicated parts is impossible or it
will become time-consuming. This project helps to learn how governing
equations are formed and the methods to use the Matlab codes correspond to the
governing equations. Two tasks in this project use two different governing
equations. Task 1 is deals with the newtons law of motion and task 2 is dealing
with the heat transfer conduction equation. Matlab is a software tool can be used
to solve complex equations once it can be numerically converted. The loop
system in Matlab helps to iterate the solution till converges. There are many
software tools that can be used for this purpose. But in both task Matlab is used
and no inbuilt functions are used. Error is restricted in this task is no more than
1E-4.
2
Analysis of Part 1
Governing equation
In this problem, the power produced by a generator fitted with a cylinder. A
cylinder, spring, and generator device are placed in flowing water. The motion
of water imparts a force on the cylinder and the cylinder start moving. The
velocity of water is given as a sin function. There is a steady and oscillatory
flow.
2∗pi∗t
U =U 0 +U m sin(¿ )¿
T
T Um
KC = D
T is the oscillatory time period of moving water, t is the time at which the
velocity is calculated. U0 is the steady flow part and Um is the oscillatory
moving part. Spring and damper arrangement has adjusted the motion of
cylinder mass and tries to restrict and make it stable in time. When the cylinder
mass starts moving damper in the generator tribes oppose the motion and brings
to equilibrium. Since there is a continuous motion of fluid over the cylinder
surface and the fluid imparts a force on the surface the movement of the
cylinder will be fluctuating. During this process, the damper/generator keep its
motion to restrict and thereby power is developed in the generator. The
governing equation for this case is formed by force balance of mass, spring,
damper and the force due to water. When a spring, mass, and damper comes to
equilibrium the total force must be zero.
d2 x
Force due to mass = m (m = mass of the cylinder)
dt2
dx
Force due to spring = c dt
3
Therefore the equilibrium condition if there is no continuous force is acting on
it is can be written as
d 2 x dx
m +c +k x=0 (Thomson)
dt2 dt
Since there is a continuous force due to the flow of water over the cylinder the
force balance will become
d2 x dx
m 2 +c +k x=F
dt dt
Force acting on the cylinder is generally drag force and this drag force is due to
the momentum of the water flow and also due to the frictional drag.
d Vr
Force due to momentum = C A md
dt
1
Force due to frictional drag = 2 ρ C D A |V r|V r (White, nd)
d2 x dx d Vr 1
m 2
+c +k x = C A m d
dt
+ 2 ρ C D A |V r|V r
dt dt
This differential equation is in the second order; thus, it needs two initial
conditions. This governing equation is used to find the velocity of the cylinder
and it is further used to find power.
1
P= ∫ c V 2 dt
T
4
Find the power obtained for different values of KC number
Find the power at different values of the damping coefficient.
dx x i+1− xi−1
= (Anderson,2010)
dt 2 Δt
d V r V r i +1−V
=
dt Δt
It can be used with forwarding or backward difference approach, but since the
error is less in central difference approach first order differential equations are
converted to the above form. In the case, of second-order differential terms are
described as follows
d 2 x x i +1−2 x + x i−1
= (Anderson,2010)
d t2 Δ t2
V r i +1−V U −U ( x (i−1)−2 x )
= i+1 +
Δt Δt Δt2
5
From this numerical solution xi+1 needed to find out using Matlab.
{ % case 1
clear all
close all
clc
j = 0 ; % last number of the ID
n = 50 ;
k = 200 ; % spring constant
c = 100 ; %Damping coefficient
L = 1 ; % length of the cylinder
m = 50 ; % mass of the cylinder
CD =1.8 ; % Drag coefficient
CA = 1 ; % Added mass coefficient
D = (10+j)/100; % Diameter of the cylinder
A = L*D ; % Area of the projected surface
time = 10 ;% analysis is carried out for 10 seconds
t = linspace(0,time,n);
for nu = 2:2:20
U_m = 1+j/10 ; % mean velocity of water
U0 = 0.1*U_m ; % initial velocity of water
rho = 1024 ; % density of water
dt = t(2)-t(1);
m_d = rho*pi/4*(D^2);
T = nu *D/U_m; x(1) = 0 ;
U = U0 + U_m*sin(2*pi*t/T);
i=1; V (i) = 0; Vr = U(i)-V(i);P(1) = 0;
x(i+1) = ((2*m*x(i)+2*m*dt*U0)/(dt^2)+c*U0+k*x(i)+CA*m_d*(U(i+1)-
U(i))/dt+CA*m_d*(2*x(i)+2*dt*U0)/dt^2+0.5*rho*A*abs(Vr)*Vr)/(2/dt^2)/
(m+CA*m_d);
for i = 2:n-1
V(i) = (x(i)-x(i-1))/dt ;
Vr = U(i)-V(i);
x(i+1) = (m*(2*x(i)-x(i-1))/dt^2-c*x(i-1)/2/dt-k*x(i)+CA*m_d*(U(i+1)-
U(i))/dt-CA*m_d*(x(i-1)-2*x(i))/dt^2+0.5*rho*CD*A*abs(Vr)*Vr)/((m/dt^2)-
(c/2/dt)+(CA*m_d/dt^2));
P(i) = c*(V(i)^2);
end
plot(t(1:end-1),P,"DisplayName",[num2str(nu)])
xlabel("time (s)")
ylabel("Power")
title(" variation of power with KC number")
hold on
legend show
end
}
{ % case 2
clear all
close all
clc
j = 0 ; % last number of the ID
KC = 10 ;
6
D = (10+j)/100 ; % Diameter of the cylinder
L = 1 ; % length of the cylinder
m = 50 ; % mass of the cylinder
n = 500 ;
time = 10 ;% analysis is carried out for 10 seconds
k = 200 ; % spring constant
CD =1.8 ; % Drag coefficient
CA = 1 ; % Added mass coefficient
A = L*D ; % Area of the projected surface
rho = 1024 ; % density of water
Um = 1+j/10 ; % mean velocity of water
U0 = 0.1*Um ; % initial velocity of water
for c = 0:50:2000
t = linspace(0,time,n);
dt = t(2)-t(1); md = rho*pi/4*(D^2);
T = KC *D/Um; x(1) = 0 ;
U = U0 + Um*sin(2*pi*t/T);
i=1; V (i) = 0; Vr = U(i)-V(i);
x(i+1) = ((2*m*x(i)+2*m*dt*U0)/(dt^2)+c*U0+k*x(i)+CA*md*(U(i+1)-
U(i))/dt+CA*md*(2*x(i)+2*dt*U0)/dt^2+0.5*rho*A*abs(Vr)*Vr)/(2/dt^2)/
(m+CA*md);
for i = 2:n-1
V(i) = (x(i)-x(i-1))/dt ;
Vr = U(i)-V(i);
x(i+1) = (m*(2*x(i)-x(i-1))/dt^2-c*x(i-1)/2/dt-k*x(i)+CA*md*(U(i+1)-
U(i))/dt-CA*md*(x(i-1)-2*x(i))/dt^2+0.5*rho*CD*A*abs(Vr)*Vr)/((m/dt^2)-
(c/2/dt)+(CA*md/dt^2));
P(i) = c*(V(i)^2);
end
plot(t(1:end-1),P,"DisplayName",[num2str(c)])
xlabel("time (s)")
ylabel("Power")
title('variation of power with daming coefficient')
hold on
legend show
end
Matlab Result 1
Graphs are plotted with power on Y-axis and time on X-axis. The power at a
higher damping coefficient is more than the power at a low value of the
damping coefficient.
7
Figure 1: Variation of power with time for different damping coefficient
8
Analysis of power with KC number shows that as the KC number increases the
power increases. The yellow line in the graph indicates the KC number 20. The
nature of the graph looks similar at all KC number value only magnitude and
time is changes.
From the result as the damping coefficient increases, more energy is produced
in the generator. The more resistance produced by the damper causes generates
more heat or the same quantity of power. A higher value of damping stops the
motion in a short time. As the energy is converted in a short time means the
power developed is more. KC number is a dimensionless number helps to find
how much effect the moment can impact on a body. The more KC number
means the force due to the fluid can easily push the cylindrical mass. A low
value of KC number merely pushes the mass in an oscillatory flow. As the KC
number increases the time for the oscillatory force cycle is more.
From the analysis, it can be concluded that if the system restricts more force the
power generation will be more. It is also important to keep the time cycle of the
forces acting on the mass as high as possible to increase the power.
Analysis of Part 2
Governing equations
In this problem, the soil is getting in equilibrium condition. The temperature is
being distributed due to conductions as well as due to the flow of water into the
deep ground. The heat transfer, in this case, is more than the heat transfer due to
just conduction. The conduction equation with the mass flow is derived from
the energy equation for a control volume.
9
This analysis is performed as one-dimensional heat conduction as the heat
transfer is only needed to analysis in the vertical direction. The is no
temperature variation in the horizontal direction.
∂T ∂T ∂2 T
∂t
+u
∂x
=α 2 (Çengel, nd)
∂x
This governing equation is simply a diffusion equation. The first term on the left
side represents the variation of temperature with respect to time. The second
term represents the heat transferred from the water to the soil. The term in the
right side represents the conduction through the soil, and is formed due to the
variation of heat transfer with respect to space. Since it is one dimensional heat
transfer the equation has only one independent variable. The presence of
thermal diffusivity is an important factor in transient heat conduction. Thermal
diffusivity is defined as the heat conducted upon the heat stored. If the soil has
very good thermal conductivity over this thermal capacitance, then the
temperature distribution will be super-fast. If the material with less thermal
conductivity and more heat capacity will store heat rather than conducting it.
The temperature distribution in the soil will not reach uniform quickly. These
are the reason sometimes the analysis is considered as lumped parameter
analysis. According to if the material is changing temperate everywhere
uniformly, then lumped parameter system can be used as the biot number will
be less than 0.1. If the biot number is more than 0.1 means the temperature
distribution with thin the material is not uniform and takes time to become
uniform.
10
Fin the time for when the temperature reaches 25C at location 1.5m from
the top surface at different values of the thermal diffusivity
∂T T i +1 ,n−T
=
∂t 2 Δt
∂T T i +1−T
=
∂x 2 Δx
In this case the T i+1 ,n represent the time for n+1 th level as the other temperature
in the numerical form represent the time at n th level. The final form of
temperature at n+1 time step will be
T
i+1 −T T i +1−2 T +T i−1
(−u 2 Δx +α )2 Δt +T = T i+1 ,n
Δ x2
The total length of the system is divided into 200 nodes and for each node the
T i+1 ,n value is calculated from the past history temperature. This analysis is
performed explicitly as the analysis may goes wrong due to stable condition.
The result may diverge and will not converge for some particular value of
thermal diffusivity, nodal difference and time step. Each time step is carefully
checked to get a converged solution
In the Matlab iteration, each nodal values are calculated based on the boundary
values. For each time step, the corresponding value of temperature is calculated
11
at each node. Once one node temperature is determined the nearby node
temperature is calculated based on the nearby previous time step values. For
simplicity, the codes can be created in explicit form but the stability criteria
have to be taken into account. At the bottom, boundary temperature and the
node just before the bottom boundary is the same as there is no heat transfer. It
can also be treated as an insulator. In transient heat conduction, the initial value
of the soil has to be used. It chosen state is also a factor of quick convergence of
the result if the initial condition was selected wisely. In this task the initial
boundary condition is 10C.
{% case 1
clear all
close all
clc
j = 0 ; % last number of the ID
u = 0.002*(1+j); %velocity of water
alpha = 0.0002 ; % thermal diffucivity
n = 200 ;
x = linspace(0,2,n);
dx = x(2)-x(1);
T = (10+j)+zeros(1,n);
T(1) = 30; % top boundary condition
T1 = T ;
T_old = T ;
dt = .1 ;
time = 1850 ;
for t = 1:time/dt
for i = 2:(n-1)
T(i) = (((T_old(i+1))+(T_old(i-1)))/dx^2-(u/alpha)*(T_old(i+1))/2/dx+
(u/2/alpha/dx+1/alpha/dt-2/(dx^2))*(T_old(i)))*dt*alpha ;
T_old(n) = T_old(n-1); % bottom boundary condition
end
T_old = T ;
end
T_15 = T(150);
12
plot(x,T)
xlabel('location')
ylabel('Temperature')
title(["Temperature at x 1.5m =" num2str(T_15)])
}
{% case 2
clear all
close all
clc
s = 0 ;
alpha = 0.0002:0.0001:0.001; % variation of thermal diffucivity
n = 200 ;
j = 0 ; % last number of the ID
u = 0.002*(1+j); %velocity of water
for a = 0.0002:0.0001:0.001
s = s + 1 ;
x = linspace(0,2,n); dx = x(2)-x(1);
T = (10+j)+zeros(1,n);
T(1) = 30; % top boundary condition
T1 = T ;
T_old = T ;
dt = .01 ;
time = 0 ;
while T(151)<25
time = time+1 ;
for i = 2:(n-1)
T(i) = (((T_old(i+1))+(T_old(i-1)))/dx^2-(u/a)*(T_old(i+1))/2/dx+
(u/2/a/dx+1/a/dt-2/(dx^2))*(T_old(i)))*dt*a ;
T_old(n) = T_old(n-1); % bottom boundary condition
end
T_old = T ;
end
t(s) = time*dt ;
end
figure(1)
plot(alpha,t)
xlabel('alpha')
ylabel('time (s)')
13
obtain the second graph the thermal diffusivity value is changed from 0.0002 to
0.001 m2/s. The interval kept in between them was0.0002 m2/s. There obtained
a difference of 500seconds of time when the thermal diffusivity is varied from
0.0002 to 0.001m2/s. That means for a five-time increment in thermal
diffusivity there is a 500 seconds of difference in the time to become uniform
temperature inside the material.
14
Figure 3" Variation of time with alpha
From the analysis, it can be concluded that for when a material with more
thermal diffusivity will come in thermal equilibrium in a short time. Material
with a large size will have less thermal diffusivity and will take some time to
get equal temperature everywhere inside the material.
References
Anderson, J. (2010). Computational fluid dynamics. New York, NY: McGraw-Hill.
Çengel, Y., Ghajar, A. and Kanoǧlu, M. (n.d.). Heat and mass transfer.
Thomson, W. and Dahleh, M. (2014). Theory of vibration with applications. Upper
Saddle River, N.J.: Prentice Hall.
White, F. and Chul, R. (n.d.). Fluid mechanics.
15