Professional Documents
Culture Documents
Solution.
The first step is to gather data completely and represent the problem effectively.
The second step is to write the governing equations of the phenomenon. Since equations gained by
energy balance have the temperature variable, solving them would generate a temperature profile.
Hence we start by writing energy balance for the two control volumes.
{
1
( ) =
( ) =
1: = ; i
2: + =
( 103 );
( ) = 103
(:
3
4 2 3
=
= )
4 3
3
103 . . . .
( ) =
[1]
Eq.1 is the governing equation of the control volume 1, solving this equation will result
in a function of temperature (for the sphere/water) with regard to time. But as can be
seen the equation has two dependent variables and time as one independent variable. It
is an ODE which its dependent variables also depend on each other. In case was
constant this ODE would be easily solved by defining a parameter (i.e. = ),
however is not constant.
We need another equation with two variables , . Hence we write the energy balance
for the second control volume.
( ) =
+ ( )
103 .
+ = + + ( ) =
C
( + + ) =
( ) =
( + + ) =
[2]
= 100
In order to solve this system we need two initial values: at t=0 {
,
= 20
ode45 in Matlab will solve these systems. Hence the result is:
Matlab script
function []=sphere()
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This script generates the results for hot sphere problem.
%
% 12/2013 by Arash Nasiri.
%
%
arash.nasiris@gmail.com
%
% This script is published on line for educational purposes so feel free to modify and use.
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Tsio=100;
Twio=20;
x0=[Tsio Twio];
tspan=[0,600];
[t,x]=ode45(@sub,tspan,x0)
plot(t,x(:,1),'r',t,x(:,2),'b',[0:30:600],25,'.g')
xlabel('Time[s]')
ylabel('Temperature[C]')
axis([0,600,15,100])
legend('Sphere Temp','Water bath Temp')
end
function xprime = sub(t,x)
rs=.02;
%[m]
radius of the immersed sphere
Vt=5;
%[cubic m]
total volume of the bath(which is constant!)
As=4*pi*(rs^2);
%[m^2]
interference cross section(between sphere and the bath)
Cs=8.32/1000;
ROs=7830;
%[kg/m^3]
density of the sphere
Ms=55.84;
%[g-mol/mol] molecular weight of the sphere's substance (here iron)
Mw=18.02;
%[g-mol/mol] molecular weight of the bath's substance(water)
ROw=1000;
%[kg/m^3]
density of the bath substance(water)
Tin=25;
%[C]
the constant temperature of the entering fresh flow into the bath
Cw=4.18*18.02;
%[J/mol.C]
heat capacity of the bath substance(water)
q=0.01;
%[m^3/sec]
debi of the entering flow
m=q*Row*Mw*1000;
%[mol/sec]
debi of the entering flow
h=400;
%[W/m^2.C]
convection's heat transfer coefficient for water
%*************************************
Alpha=-(h*3)/(1000*Ms*ROs*Cs*rs);
Beta=(1000*Mw*ROw*Cw*Vt);
C=m*Cw*Tin;
Del=h*As;
Gamma=-h*As-m*Cw;
%*************************************
xprime=[Alpha*x(1)-Alpha*x(2);(1/Beta)*(Del*x(1)+Gamma*x(2)+C)];
end
A lumped system is one in which the dependent variables of interest are a function of time alone. In general, this will mean
solving a set of ordinary differential equations (ODEs), meanwhile a distributed system is one in which all dependent
variables are functions of time and one or more spatial variables. In this case, we will be solving partial differential
equations (PDEs)