# Adaptive Refinement in Advection-Diffusion Problems by Anomaly Detection: A Numerical Study
## 3 Numerical Results
### Example 4: Parabolic and Exponential Boundary Layers  
As the last example, we consider the problem reported in [6]. The computational domain \(\Omega\) is the unit square. The input data are \(\varepsilon=10^{-6}\), \(\mathbf{b}=[1;0]\), \(\alpha=0\), \(f=1\), \(\Gamma=\Gamma_{D}\) and \(u_{D}=0\). The solution exhibits two parabolic layers for \(y=0\) and \(y=1\), and one boundary layer on the right edge of \(\Omega\). In Figure 21, we show a 3D plot of the computed solution on the final adapted mesh obtained with \(\eta_{R}\). The results of the refined meshes are shown in Figures 22 and 23 for the residual-based, gradient-based and \(\eta_{N}\) error estimators, respectively. In Table 10, we report the results obtained by using \(c=\)auto and \(c=0.3\) when \(\eta_{R}\) is employed. By setting a contamination value that differs from the default setting, we can better refine the regions with the interested layers. Finally, in Tables 11 and 12, we report the error estimates computed with \(\eta_{Z}\) and \(\eta_{N}\), respectively, and \(c=\)auto. This final benchmark is the only one where the use of \(\eta_{N}\) failed to capture the boundary layers. In fact, the values of \(\eta_{N,T}\) are very small almost for every triangle \(T\), at every level; thus, at the end, the adaptive refinement almost appeared as a uniform global refinement. In this case, even the use of a contamination parameter could not help to significantly improve the final result. The test was also repeated with smaller values of contamination, but the final mesh was still not satisfactory. In Figure 23, on the right, the final mesh obtained at level \(n=5\) with \(c=0.1\) is shown. We cannot appreciate a significant difference with the error obtained with \(\eta_{R}\) or \(\eta_{Z}\) but simply because we are comparing with a solution obtained exactly by uniformly and globally refining the initial mesh. Only the mesh obtained with \(\eta_{R}\) and \(\eta_{Z}\) is correctly refined at the boundary layer location. In Figure 24, we show the comparison of \(\eta_{R}\) against the global refinement strategy. In this example, the \(L^{2}\) norm of the global refinement is more accurate than the adaptive mesh obtained either with \(c=\)auto or with \(c=0.3\). The \(H^{1}\) seminorm of the global refinement is very unstable, instead. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & \multicolumn{2}{c}{\(\epsilon=\)auto} & \multicolumn{4}{c}{\(c=\)0.3} \\ \hline \(n\) & **NT** & \(L^{2}\) & \(H^{1}\) & **NT** & \(L^{2}\) & \(H^{1}\) \\ \hline
0 & 200 & \(5.2\times 10^{-2}\) & \(6.4\times 10^{-1}\) & - & - & - \\
1 & 375 & \(5.3\times 10^{-2}\) & \(3.4\times 10^{-1}\) & 232 & \(4.7\times 10^{-2}\) & \(1.9\times 10^{-1}\) \\
2 & 1125 & \(2.9\times 10^{-2}\) & \(1.9\times 10^{-2}\) & 970 & \(5.2\times 10^{-2}\) & \(1.4\times 10^{-1}\) \\
3 & 2912 & \(3.3\times 10^{-2}\) & \(1.9\times 10^{-2}\) & 1436 & \(2.7\times 10^{-2}\) & \(1.2\times 10^{-2}\) \\
4 & 8798 & \(3.9\times 10^{-2}\) & \(1.5\times 10^{-2}\) & 5246 & \(3.7\times 10^{-2}\) & \(1.0\times 10^{-2}\) \\
5 & 15,276 & \(4.1\times 10^{-2}\) & \(2.6\times 10^{-3}\) & 16,689 & \(3.9\times 10^{-2}\) & \(3.9\times 10^{-4}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 10: Error in \(L^{2}\) norm and \(H^{1}\) seminorm for example 4 obtained with the residual-based error estimator. \begin{table}
\begin{tabular}{c c c c} \hline \hline \(n\) & **NT** & \(L^{2}\) & \(H^{1}\) \\ \hline
0 & 200 & \(5.2\times 10^{-2}\) & \(6.4\times 10^{-1}\) \\
1 & 264 & \(6.1\times 10^{-2}\) & \(3.1\times 10^{-1}\) \\
2 & 459 & \(6.6\times 10^{-2}\) & \(2.3\times 10^{-1}\) \\
3 & 803 & \(5.1\times 10^{-2}\) & \(3.3\times 10^{-2}\) \\
4 & 1298 & \(5.0\times 10^{-2}\) & \(4.3\times 10^{-2}\) \\
5 & 4428 & \(4.4\times 10^{-2}\) & \(4.5\times 10^{-2}\) \\
6 & 11,323 & \(3.6\times 10^{-2}\) & \(1.8\times 10^{-2}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 11: Error in \(L^{2}\) norm and \(H^{1}\) seminorm for example 4 obtained with \(\eta_{Z}\).