0% found this document useful (0 votes)
41 views4 pages

Problem 5: Cooling A Pipe by External Flow: 1. Sumary

The document provides an analytical and numerical solution to cooling a pipe by external flow. It gives the initial and boundary conditions, as well as data values used in the problem. The analytical solution provides a closed form equation. The numerical solution discretizes the domain and sets up the matrix form of the partial differential equation as an ordinary differential equation that can be solved using ODE solvers. Plots of the temperature along the pipe length over time are shown for both the analytical and numerical solutions.

Uploaded by

Nguyễn Thiện
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)
41 views4 pages

Problem 5: Cooling A Pipe by External Flow: 1. Sumary

The document provides an analytical and numerical solution to cooling a pipe by external flow. It gives the initial and boundary conditions, as well as data values used in the problem. The analytical solution provides a closed form equation. The numerical solution discretizes the domain and sets up the matrix form of the partial differential equation as an ordinary differential equation that can be solved using ODE solvers. Plots of the temperature along the pipe length over time are shown for both the analytical and numerical solutions.

Uploaded by

Nguyễn Thiện
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/ 4

Problem 5: Cooling a pipe by external flow

1. Sumary

Initial condition:

Boundary condition:

Data: ; ; ; ; ; ;

a) Analytical solution
The analytical solution is:

b) Numerical solution
The finite different method is applied for solving the PDE.

Discrete the domain

(Up-wind scheme)

Equation (1) at node 1, (node 0 is boundary condition):

At node 2:

At node n:

We can rewrite at matrix form:

1
And

then we can use the ODE solver to solve that equation.

2. Solution
global K1 K2 Tw Tini Tbound A b
% --- declare constant variable
F = 0.001; %[m3/s]
U = 50000; %[W/m2K]
rho = 997; %[kg/m3]
Cp = 4182; %[J/kg]
D = 0.1; %[m]
Tw = 300; %[K]
Tbound = 373; %[K]
Tini = 373; %[K]

% --- compute the coefficient


K1 = 4*F/(pi()*D^2);
K2 = 4*U/(rho*Cp*D);

% --- Domain
L = 1; %[m]

% --- Computation
tstop = 10; %[s]

a) Analytical solution
% Plot
L = 1; % The length of pipe
x = linspace(0,1,50);
t = linspace(0,tstop,20);
Temp=[];

figure;
subplot(1,2,1)
for i = 1:length(t)
Temp = [Temp; asol(x,t(i))];
plot(x,Temp(i,:))
hold on
end
title('Analytical solution'); xlabel('Length (m)'); ylabel('Temperature K');

2
b) Numerical solution
% --- Construct the matrix A and b
N = 100; % Number of node you want to devide the domain
x = linspace(0,L,N+1);
dx = x(2)-x(1);

% --- The right hand side equation : A*T+b


% --- A is Diagonal matrix NxN
% --- B is vector Nx1
A = diag(ones(N-1,1),-1)*(K1/dx)+diag(ones(N,1))*(-K2-K1/dx); %
b = ones(N,1)*(K2*Tw);
b(1) = K2*Tw + K1/dx*Tbound;

% --- solving

T0 = ones(N,1)*Tini; % vector initial value

[t u] = ode15s(@nsol,[0 tstop],T0);

v = [ones(1,length(t))*Tbound; u'];

subplot(1,2,2)
plot(x,v);
title('Numerical solution');xlabel('Length (m)');ylabel('Temperature K');

3
4

You might also like