Guest User

Packed Bed heat transfer UPDATED

a guest
Sep 12th, 2020
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 5.07 KB | None | 0 0
  1. %% BEP MST Mohammed
  2. %% PBR cooling function Method of lines
  3. %% Contains both substrate and purge gas temp functions
  4. %% Initial condition is from TMA half-reaction
  5. %% NEGLECTS RADIAL HEAT TRANSFER
  6. %% Dealing with PDE and ODE coupling
  7.  
  8. P = parameters();
  9. P = bedPorosity(P);
  10. [h,P] = heatTransferCoefficient(P);
  11.  
  12. % Defining Initial conditions
  13. % Tf initial = 398.15K & Ts initial = 548.3K
  14. N=10;
  15. Tf(N+1,1)=0;
  16. Tf(:,:)=398.15;
  17. Ts(N+1,1)=0;
  18. Ts(:,:) = 548.3;
  19. y = zeros(N*2,1);
  20. y(1:N)=Tf(1:N);
  21. y(N+1:2*N)=Ts(1:N);
  22.  
  23. y0=y;
  24.  
  25. tSpan = linspace(0,60,120000);
  26.  
  27. tic
  28. [t,y] = ode15s(@(t,y) heatPBR(t,y,h,P), tSpan, y0);
  29. toc
  30. % plot results
  31. plot(t,y);
  32.  
  33.  
  34. function [P] = parameters()
  35. P = zeros(1,100);
  36. %% All important variables are stored in the P array
  37.  
  38. % all important parameters for fluid PDE
  39. P(1) = 1.0;         % [m/s] Velocity of N2
  40. P(2) = 0.85;        % [kg/m3] Density of N2 | 400K,1bar
  41. P(3) = 1044;        % [J/kgK] Heat capacity N2 | 400K
  42.  
  43. % all important parameters for Solid PDE
  44. P(4) = 889.2506;    % [J/kgK] heat capacity of substrate
  45. P(5) = 2330;        %[kg/m3] density of silica
  46. %
  47. % P6 = E, P7 = Av
  48. %
  49. P(8) = 1.0;                     % [m/s] velocity of N2
  50. P(9) = 3E-3;                    % [m] diameter of silica particle
  51. P(10) = 0.01;                   % [kg] Mass of particle
  52. P(11) = 0.25*pi*0.2*(0.025^2);  % [m3] reactor volume
  53.                                 % Ruud: Length = 200mm, diam = 25mm.
  54. P(12) = pi*(P(9)^2);            % [m2] Surface area of one particle
  55. % P13 = Volume of all particles
  56. P(14) = 2.12E-5;                % [Pa*s] Viscosity of N2
  57. P(15) = 37E-6;                  % [m2/s] thermal diffusivity N2 at 1 Bar!!
  58. P(16) = 32.81E-3;               % [W/mK] thermal conductivity N2 at 400K
  59. %
  60. % P17 = Nu, P18 = Re, P19 = Pr
  61. %
  62. P(20) = P(16)/(P(2)*P(3));      % [] Gamma
  63. P(21) = P(16)/(P(8)*P(2)*P(3)); % R variable in BC's
  64. P(22) = 398.15;                 % [K] initial value N2
  65. P(23) = 1.4;                    % [W/mK] thermal conductivity silica
  66. end
  67.  
  68. % calculate porosity of bed
  69. function [P] = bedPorosity(P)
  70. d = P(9);                   % [m] diameter of silica particle
  71. rho = P(5);                 % [kg/m3] density of silica particle
  72. m = P(10);                  % [kg] mass of particles
  73. vs = m/rho;                 % [m3] volume of particles
  74. v = P(11);                  % [m3] Volume reactor
  75.                             % Ruud: Length = 200mm, diam = 25mm.                        
  76. vVoid = v-vs;
  77. E = vVoid/v;                % porosity
  78.  
  79. Ap = P(12);                             % [m2] Surface area of one particle
  80. Vsp = 0.25*(pi*(0.025^2))*0.2*(1-E);    % [m3] Volume of all particles;                            % [m3] volume all substrate
  81. Av =  Ap/Vsp;                           % [m2/m3] this Av is calculated as:
  82.                                         % Area 1 sphere / Volume all spheres
  83.                                         % Area 1 sphere: pi*(3E-3)^2
  84.                                         % Volume all spheres: 0.25*(pi*(0.025^2))*0.2*(1-E)
  85. P(6) = E;
  86. P(7) = Av;
  87. P(13) = Vsp;
  88. end
  89.  
  90. function [h,P] = heatTransferCoefficient(P)
  91. rho = P(2);         % [kg/m3] density of N2
  92. v = P(1);           % [m/s] velocity ACTUALLY related to phiV!!!
  93. d = P(9);           % [m] diameter of 1 silica particle
  94. mu = P(14);         % [Pa*s] Viscosity of N2
  95. a = P(15);          % [m2/s] thermal diffusivity N2 at 1 Bar!!
  96. nu = mu/rho;        % [m2/s] kinematic viscosity
  97. lambda = P(16);     % [W/mK] thermal conductivity at 400K
  98.  
  99. Re = (rho*v*d)/mu;      % Reynolds number. Depends on density, velocity,
  100.                         % viscosity of fluid. d is diameter of substrate
  101. Pr = nu/a;              % Prandtl number, nu is kinematic viscosity of
  102.                         % fluid, a is thermal diffusivity
  103. E = P(6);
  104.  
  105. %% Gnielinski method
  106. % E < 0.935, Pr>0.7, Re/E<2E4
  107. Nut = (0.037*((Re/E)^0.8)*Pr)/(1+2.433*((Re/E)^-0.1)*(Pr^(2/3)-1));
  108. Nul = 0.664*(Pr^(1/3))*((Re/E)^0.5);
  109. Nusp = 2+((Nut+Nul)^0.5);
  110. fE = (1+1.5*(1-E));
  111. Nu = Nusp*fE;           % Nusselt number | not to be confused with 'nu'
  112.  
  113. h = (Nu*lambda)/d;      % Heat transfer coefficient
  114. P(17) = Nu;
  115. P(18) = Re;
  116. P(19) = Pr;
  117. end
  118.  
  119. %% Method of Lines
  120. function dTdt = heatPBR(t,y,h,P)
  121. % Parameters
  122. alpha= -P(1)/P(6);
  123. gamma= P(20);
  124. beta= (h*P(7))/(P(2)*P(3)*P(6));
  125. omega= P(23)/(P(2)*P(3)*(1-P(6)));
  126.  
  127. % Getting temperatures
  128. N = length(y);
  129. M = length(y)/2;
  130. dz = 0.2/N;                 % length of reactor is 200mm
  131. dz2 = dz^2;
  132. Tf = zeros(M,1);
  133. Ts = zeros(M,1);
  134. Tf(1:M)=y(1:M);
  135. Ts(1:M)=y(M+1:2*M);
  136.  
  137. % Define dT/dt
  138. dTfdt=zeros(M,1);
  139. dTsdt=zeros(M,1);
  140.  
  141. % Boundary conditions
  142. R = P(21);
  143. T0 = P(22);
  144. a = P(1)*P(2)*P(3);
  145.  
  146. for i=1:M
  147.     if i==1
  148.         dTfdt(i) = alpha*((-a/P(16))*(T0-Tf(i))) + gamma*((-2*Tf(i)-2*a*dz*(T0-Tf(i))/dz2)) + beta*(Ts(i)-Tf(i));
  149.     elseif i==M
  150.         dTfdt(i) = gamma*((2*Tf(i-1)-2*Tf(i))/dz2) + beta*(Ts(i)-Tf(i));
  151.     else
  152.         dTfdt(i) = (alpha/(2*dz))*(Tf(i+1)-Tf(i-1)) + (gamma/dz2)*(Tf(i+1)-2*Tf(i)+Tf(i-1)) + beta*(Ts(i)-Tf(i));
  153.     end
  154. end
  155.  
  156. for i=1:M
  157.     dTsdt(i) = omega*(Ts(i)-Tf(i));
  158. end
  159.  
  160. dTdt=zeros(2*M,2);
  161. dTdt=[dTfdt;dTsdt];
  162. end
  163.  
  164.  
  165.  
  166.  
Advertisement
Add Comment
Please, Sign In to add comment