Analytical solution of 1-D transient heat transfer

47 次查看(过去 30 天)
Can you please help me code the analytical solution equation for 1D transient heart transfer to get the temperature profile? I need to include multiple terms, I suppose it need "for loop" but I'm not familiar how to code loops or sereies.
  4 个评论
Torsten
Torsten 2023-6-11
编辑:Torsten 2023-6-11
  • Plot the function f(x) = x*J1(x)/J0(x) - Bi to get an impression where its zeros are located.
  • From the plot, choose good starting guesses to determine the first - say ten - zeros of f using "fzero".
  • Compute the array C_n.
  • Sum the first - say ten - terms of the series for theta_star for different values of r_star and t.
  • Make a surface plot of theta_star over r_star and t (or whatever you want to plot).
Nour
Nour 2023-6-12
编辑:KSSV 2023-6-12
I'm asked to do so before we move to numerical method to solve this problem.
Below is my code for the one term method, but it is unvalid for my fourier number so I have to include multiple terms to make it work. I would appreciate if you can help me build the code for multiple terms.
clc
clear all;
%-----------------------------Input----------------------------------------
% Inputs
r0=0.05; % wall thickness(m)
k=0.1; % conductivity(W/m-K)
rho=821.42; % density(kg/m^3)
cp=1399; % specific heat capacity(J/kg-K)
T_ini=400; % initial temperature(K)
T_inf=298; % external temperature(K)
h=5; % heat transfer coefficient(w/m^2-K)
t_f=100 % Final time (sec)
lampda1=1.694 % Eigen root
C1=1.3787 % constant
R=0.05;
T_i=400;
T_inf=298;
r=linspace(0,0.05,20)
t=linspace(0,100,t_f)
%-----------------------------Main parameters -----------------------------
% Parameters
Bi=(h*r0)/k % Biot number
alpha=k/(rho*cp) % Thermal diffusivity
F0=(alpha*t)/(r0*r0) % Fourier number
r_div=20;
epsilon=1.694;
C_1=1.3787;
T=zeros(1,r_div);
u=zeros(1,r_div);
t=0;
%-----------------------------Temperature calculation ---------------------
for j=1:5
for i=1:0.05
u(i)=epsilon*r(i) /R;
T(i)=T_inf+(T_i-T_inf)*C_1*exp(-epsilon^2*alpha*t/R^2)*besselj(0,u(i));
end
end

请先登录,再进行评论。

回答(1 个)

Nipun
Nipun 2023-12-29
Hi Nour,
I understand that you are trying to code the analytical solution equation for 1D transient heart transfer to get the temperature in profile in MATLAB.
Based on the provided system of equations, I propose the following steps to approach the solution:
Start with getting the roots of the transcendental equations. Plot the function and observe the first n zeroes of the equation
syms x
f(x) = x*J1(x)/J0(x) - Bi
fplot(f(x))
Say the interval of the roots is [a,b] then, use "vpasolve" to obtain the roots in that interval
roots = vpasolve(f(x)==0, x, [a,b])
Based on the array of roots, compute Cn using the relation:
C(i) = (2/x)*(J1(x)/(J1(x)^2 + J0(x)^2)) % where x = roots(i)
% You can also represent it in vector format
Compute the temperature profile using sum
temp_profile = sum(C.* exp(-roots.^2 * F0)* J0(roots*r) ) % vector representation
On increasing the size of roots (by appending more zeroes to the array and increasing the interval [a,b]), the accuracy of "temp_profile" will increase.
Link to documentation:
  1. symbolic representation : Equation Solving - MATLAB & Simulink - MathWorks India
  2. fplot in MATLAB : Plot expression or function - MATLAB fplot - MathWorks India
  3. vpasolve : Solve symbolic equations numerically - MATLAB vpasolve - MathWorks India
Hope this helps.
Regards,
Nipun

类别

Help CenterFile Exchange 中查找有关 Thermal Analysis 的更多信息

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by