You are on page 1of 1
%4 Diffasion equation - 2D - Explicit Method - Cylindrical / Polar °% Coordinates 0% Dirichlet BC conditions - Constant temperatures at boundaries clear de af chee 1e-4; 9 Thermal diffusivity of copper, m2/s, eg le-4(Heat Conduction - Ozisi & Hala) kt = 386; % Thermal concuctiity W /( * K), eg 386 1, % Inside Radias of polar coordinates, rin, say 0.1 m_ 9% Outside Radius of polar coordinates, «_out, say 4 m_ 100; % no. of sections divided between in andr cut eg 10, 100 *_out - ia): % section length, m nr = mrt: % total 20. of radial points %6 total angle = 2*pi nphi= 10000; % total time, s eg 3, 3000, 10000 ino. of time steps eg 18, 18000, 60000 delta_t = vit, % timest Tin= 1000; % IC, Inia Temperature inside heart, des. C Tmax = max(Tia, Te); ha a) + (-1)*delta_phi; ie ve phideg ~ [0-360lnphi'360+360'mphi} Ve phi = phideg. “pi/180 for j= Ea Ca) = 2. 2*sin(phi(i)) + (sin(phi())*sart(abs(cos(phiG)))))(sin(phiGi)) + 1.4): end r limit; % polarplot(phi.s_fimit) % heart profile d= alphatdelta tdeita r°2; % diffusion aumber 06 Cxeating intial and boundary conditions = eros(ar aphit?.21), for k= Lat+1 for #6Q >=<_mkD) Ti) = Tb. dsc Til) = Tin: end G1Gik) = 0.001; GAGjx)= 0.001; G3Gji9 = 0.001; GAGjiQ = 0.001, end sc = ‘stable’; fori= tet G2O = sart(1 - 444'D: if(G2@ > 1) % &E& (j=l) LK G-=Caphit2)) % Stability Criteria sc = "unstable"; a; else. end G3() = sar L-2")'2 + (@Paeka_r8)°2); #(G3@ > 1) % ee Hl) && G-HaphiAD) % Stablity Criteria sc = "unstable"; G3. ddse_ end G5Q = sam 1-4 *d* YD * eta P-Dldeta_phi“D) 2): (G5) > 1) % le H=1) && G-—aphi#D) % Stablty Critrin sc = "unstable"; Gs, else end G6@ = sart( (1 - 4 * d-4 * d* (1iD)*2 * Gelta_r“2ideka_phi*2) 2): if (G6@ > 1) % && (j-=1) && G-—(aphit2)) % Stability Criteria sc = "unstable"; 65; else. end, GI =satt((L-2* dA * a (LiGY2 * Geta Dideka_ phiD)Y2 + Aelia (DDI: #(GT@> 1) % Kee G1) && G-HlagkiAD)) % Stability Criteria sc "unstable" or. dsc, end end ve Creating T matrit #a—) Ti jet) = TEI: sei GG) >=1_finiGp) ij] ‘{hivk) ~ Glpha*delta t) *( (1/delka +°2)*(T(F 1.4.4) - 2* TG j.k) + Ti+] 46) + (Lr) *(1/ "deka 2)" Lk) - TG-Lj.k) ~ CirG)*2)*(1ideka_phi2)*(Taphir | de) - 2* TH j.e) + TE F+1.IQ)); we OOo