Guest User

Code

a guest
Oct 22nd, 2019
113
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (* Plate dimensions *)
  2. L = 250;
  3. W = 200;
  4. H = 30;
  5.  
  6. (* Material properties *)
  7. rhocp = 4898556;
  8. lambda = 36;
  9. alpha = lambda/rhocp;
  10.  
  11. T0 = 293; (* Initial temperature *)
  12. Tinf = 293; (* Ambient temperature *)
  13.  
  14. Q = 4256; (*Source power*)
  15. xs0 = 6; (* Initial position of moving source *)
  16. xsf = L - xs0; (* final position of moving source *)
  17. r0 = 3; (* radius of source *)
  18. c = 1; (* source constant parameter *)
  19. vx = 1.61; (* moving source velocity x direction *)
  20. qmax = c Q/(Pi r0^2); (* source term *)
  21.  
  22. h = 10; (* heat convection coeffcient *)
  23.  
  24. tf = Round[(L - 2 xs0)/vx]; (* Final time of calculation *)
  25.  
  26. s = NDSolve[{(1.0/alpha) D[T[x, y, z, t], t] == D[T[x, y, z, t], {x, 2}] + D[T[x, y, z, t], {y, 2}] + D[T[x, y, z, t], {z, 2}], T[x, y, z, 0] == T0, -lambda D[T[x, y, 0, t], z] == Piecewise[{{qmax Exp[-c ((x - xs0 - vx t)^2 + y^2)/r0^2], (x - xs0 - vx t)^2 + y^2 <= r0^2}, {-h (T[x, y, 0, t] - Tinf), (x - xs0 - vx t)^2 + y^2 > r0^2}}], lambda D[T[0, y, z, t], x] == h (T[0, y, z, t] - Tinf), -lambda D[T[L, y, z, t], x] == h (T[L, y, z, t] - Tinf), D[T[x, 0, z, t], y] == 0, -lambda D[T[x, W/2, z, t], y] == h (T[x, W/2, z, t] - Tinf), -lambda D[T[x, y, H, t], z] == h (T[x, y, H, t] - Tinf)}, T, {x, 0, L}, {y, 0, W}, {z, 0, H}, {t, 0, tf}]
RAW Paste Data