Solving the heat equation using ADI method
ADI Method ADI is Alternating Direction Implicit Method. It is finite difference method to solve the parabolic ,hyperbolic, elliptical PDE’s. It splits the finite difference equations into two, one with the x-derivative taken implicitly and the next with the y-derivative taken implicitly.
ADI Method to Heat equation Solve Step 1: y-direction fixed Step 2: x-direction fixed α α
ADI Method to Heat equation Step 1: Step 2:
Step 1(Predictor) Predicted solutions are shown in red and corrected solutions are in black
Step 2(Corrector) Predicted solutions are shown in red and corrected solutions are in black
ADI Method to Heat equation Step 1: [Ax].Ujn+1/2 = Rxi,j where Ax = I + Cx Cx = a. Ujn+1/2 = Rxi,j = Uj at the time step n+1/2 is solved by the tridiagonal algorithms with the unknowns ordered by rows I = 1 to M-1.
ADI Method to Heat equation Step 2: [Ay].Uin+1 = Ryi,j where Ay = I + Cy Cy = b. Uin+1 = Ryi,j = Ui at the time step n+1 is solved by columns j =1 to N-1.
Peaceman-Rachford scheme Splitting step 1 and 2 equations using Peaceman- Rachford scheme Where F0x=(alpha*dt)/(2*dx*dx) F0y=(alpha*dt)/(2*dy*dy)
By Simplifying those equations
Algorithm An outline of numerical algorithm is: Compute Ax_m, Ax_p, Ay_m, and Ay_p. Solve Ax_m.Un+1/2 = Ay_p.Un and Ay_m.Un+1 = Ax_p. Un+1/2 . Update U for all interior grid points.
Sequential Implementation Initialize variables NX, NY, dt, Time, Lx, Ly and Alpha. Calculate dx, dy, 𝑓 𝑜𝑥 , 𝑓 𝑜𝑦 Assign initial temperatures. Calculate matrices Ax_m, Ax_p, Ay_m and Ay_p. Use LU factorization for Ax_m, Ay_m matrices For each time step Solve Ax_m . 𝑈 𝑛+1/2 =Ay_p . 𝑈 𝑛 Solve Ay_m . 𝑈 𝑛+1 =Ax_p . 𝑈 𝑛+1/2 dt is time step, Time is end of time evolving, Lx,Ly are domain length and width, alpha. dx=Lx/(Nx-1),dy=Ly/(Ny-1);
Libraries Used Numerical libraries (Open Source) TNT (Template Numerical Toolkit) JAMA (Java Matrix Package) Time taken for this implementation: 2 sec (appox.) including Ax_m, Ax_p, Ay_m, Ay_p calculation with Nx=100, Ny=50, Lx=1.0, Ly=1.0, alpha=0.2 and Time = 0.55 with dt=0.015.
Results The grid size is n = 100. The top boundary has temperature of 20.0 at the ends and 100.0 in the middle. The bottom, left and right boundaries have a temperature of 20.0 at the ends and 0.0 inside the room.
Parallel Implementation cuSPARSE library. 3 Kernel functions Matrix calculation (Ax_m, Ax_p, Ay_m, Ay_p). Solving step 1 and step 2 equations. Update U.
Thank you.
Questions?? & Suggestions