Guest User

Packed Bed heat transfer

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