3、 Fast Heat Solver in Spherical Coordinates
3.3 Mass Conservation
3.3.1 The Mass of Solvers with the Central Difference Method … 27
28
Figure 7: The domain is a spherical surface with R = 5.
Case 1: Pizza-like initial condition as follows,
u(1:0.5*M,0.5*N:0.5*N+5)=1; others are set to be zero.
Figure 8: Initial value u; T = 0; Total mass = 14.7321.
Figure 9: Left, T = 0.25, mass = 14.7321, relative error = 1.8087e − 015.
Mid-left, T = 0.5, mass = 14.7321, relative error = 7.3552e − 015.
Mid-right, T = 0.75, mass = 14.7321, relative error = 9.8873e − 015.
Right, T = 0.1, mass = 14.7321, relative error = 1.2058e − 014.
29
Figure 10: Left, T = 5, mass = 14.7321, relative error = 7.8099e − 014.
Right, T = 20, mass = 14.7321, relative error = 2.8661e − 013.
Figure 11: Left, the values of u on the equator change with time.
Right, total mass of u changes with time in 0~20 seconds.
According to Figure 9, Figure 10, Figure 11, u was diffused as time goes by to be like the look of the original domain. Consider that total mass has little machine error. Therefore, Case 1 complies with the mass conservation law.
Case 2: Initial condition was set as one point as follows,
u(0.5*M,0.5*N+5)=1; others are set to be zero.
Figure 12: Initial value u; T = 0; Total mass = 0.24067.
30
Figure 13: Left, T = 1/64, mass = 0.24067, relative error = 5.0167e − 007.
Mid-left, T = 1/32, mass = 0.24067, relative error = 1.0033e − 006.
Mid-right, T = 3/64, mass = 0.24067, relative error = 1.505e − 006.
Right, T = 1/16, mass = 0.24067, relative error = 2.0067e − 006.
Figure 14: Left, T = 5, mass = 0.24063, relative error = 0.00014728.
Right, T = 20, mass = 0.24061, relative error = 0.00024238.
Figure 15: Left, the values of u on the equator change with time.
Right, total mass of u changes with time in 0~20 seconds.
According to Figure 13, Figure 14, Figure 15, u was diffused as time goes by to be like the look of the original domain. Total mass is getting decreasing a little bit, but it will turn to stable that means mass will not change any more in a long time. Case 2 does not comply with the mass conservation law.
31
Case 3: Chapeau-like initial condition as follows,
u(1:3,1:N)=1; others are set to be zero.
Figure 16: Initial value u; T = 0; Total mass = 6.7665.
Figure 17: Left, T = 0.25, mass = 6.7665, relative error = 0.00017029.
Mid-left, T = 0.5, mass = 6.7686, relative error = 0.00030516.
Mid-right, T = 0.75, mass = 6.7693, relative error = 0.00040749.
Right, T = 1, mass = 6.7698, relative error = 0.00040878.
Figure 18: Left, T = 5, mass = 6.773, relative error = 0.00095451.
Right, T = 20, mass = 6.7743, relative error = 0.001145.
32
Figure 19: Left, the values of u on the equator change with time.
Right, total mass of u changes with time in 0~20 seconds.
According to Figure 17, Figure 18, Figure 19, u was diffused as time goes by to be like the look of the original domain. Total mass is getting increasing a little bit, but it will turn to stable that means mass will not change any more in a long time. Case 3 does not comply with the mass conservation law.
Case 4: Smooth initial condition as follows, u(m,n)=abs(sin((m-0.5)*π
M))+abs(cos((n-1)* 2πN)), ∀ m, n.
Figure 20: Initial value u; T = 0; Total mass = 446.6597.
Figure 21: Left, T = 0.25, mass = 446.658, relative error = 3.7503e − 006.
33
Mid-left, T = 0.5, mass = 446.6566, relative error = 6.9874e − 006.
Mid-right, T = 0.75, mass = 446.6553, relative error = 9.8891e − 006.
Right, T = 1, mass = 446.6541, relative error = 1.2529e − 006.
Figure 22: Left, T = 5, mass = 446.6434, relative error = 3.6478e − 005.
Right, T = 20, mass = 446.6373, relative error = 5.0161e − 005.
Figure 23: Left, the values of u on the equator change with time.
Right, total mass of u changes with time in 0~20 seconds.
According to Figure 21, Figure 22, Figure 23, u was diffused as time goes by to be like the look of the original domain. Total mass is getting decreasing a little bit, but it will turn to stable that means mass will not change any more in a long time. Case 4 does not comply with the mass conservation law.
In above Case 1~Case 4, we derive that Case 1 can get the perfect result by mass conservation with some machine error;the others show up a little bit derivation that is less than one percent in our relative error.
3.3.2 The Mass of Solvers with the Symmetric Discretization
Initial settings as Figure 7: M = 32, N = 64, R = 5, ∆t =2π1 ∆x =N1.34
Case 1: Initial values are the same as Figure 8,
Figure 24: Left, T = 0.25, mass = 14.7321, relative error = 1.2058e − 015.
Mid-left, T = 0.5, mass = 14.7321, relative error = 4.8231e − 015.
Mid-right, T = 0.75, mass = 14.7321, relative error = 1.4469e − 015.
Right, T = 0.1, mass = 14.7321, relative error = 1.6881e − 015.
Figure 25: Left, T = 5, mass = 14.7321, relative error = 5.6671e − 015.
Right, T = 20, mass = 14.7321, relative error = 1.1455e − 014.
Figure 26: Left, the values of u on the equator change with time.
Right, total mass of u changes with time in 0~20 seconds.
According to Figure 24, Figure 25, Figure 26, u was diffused as time goes by to be like the look of the original domain. Consider that total mass has little machine error. Therefore, Case 1 complies with the mass conservation law.
35
Case 2: Initial values are the same as Figure 12,
Figure 27: Left, T = 1/64, mass = 0.24067, relative error = 6.9197e − 016.
Mid-left, T = 1/32, mass = 0.24067, relative error = 8.0729e − 016..
Mid-right, T = 3/64, mass = 0.24067, relative error = 1.1533e − 016.
Right, T = 1/16, mass = 0.24067, relative error = 2.3066e − 015.
Figure 28: Left, T = 5, mass = 0.24067, relative error = 5.6511e − 015.
Right, T = 20, mass = 0.24067, relative error = 4.9591e − 015.
Figure 29: Left, the values of u on the equator change with time.
Right, total mass of u changes with time in 0~20 seconds.
According to Figure 27, Figure 28, Figure 29, u was diffused as time goes by to be like the look of the original domain. Consider that total mass has little machine error. Therefore, Case 2 complies with the mass conservation law.
36
Case 3: Initial values are the same as Figure 16,
Figure 30: Left, T = 0.25, mass = 6.7665, relative error = 1.3126e − 016.
Mid-left, T = 0.5, mass = 6.7665, relative error = 3.019e − 016..
Mid-right, T = 0.75, mass = 6.7665, relative error = 0.
Right, T = 1, mass = 6.7665, relative error = 4.8567e − 016.
Figure 31: Left, T = 5, mass = 6.7665, relative error = 1.3126e − 015.
Right, T = 20, mass = 6.7665, relative error = 6.563e − 016.
Figure 32: Left, the values of u on the equator change with time.
Right, total mass of u changes with time in 0~20 seconds.
According to Figure 30, Figure 31, Figure 32, u was diffused as time goes by to be like the look of the original domain. Consider that total mass has little machine error. Therefore, Case 3 complies with the mass conservation law.
37
Case 4: Initial values are the same as Figure 20,
Figure 33: Left, T = 0.25, mass = 446.6597, relative error = 6.1086e − 015.
Mid-left, T = 0.5, mass = 446.6597, relative error = 3.8179e − 016.
Mid-right, T = 0.75, mass = 446.6597, relative error = 3.4361e − 015 Right, T = 1, mass = 446.6597, relative error = 3.0543e − 015.
Figure 34: Left, T = 5, mass = 446.6597, relative error = 4.1997e − 015.
Right, T = 20, mass = 446.6597, relative error = 3.3088e − 015.
Figure 35: Left, the values of u on the equator change with time.
Right, total mass of u changes with time in 0~20 seconds.
According to Figure 33, Figure 34, Figure 35, u was diffused as time goes by to be like the look of the original domain. Consider that total mass has little machine error. Therefore, Case 4 complies with the mass conservation law.
In above Case 1~Case 4, we derive that all these cases can comply with the mass conservation
38
law and leave some machine error here.