# Modeling Transient Flows in Heterogeneous Layered Porous Media Using the Space-Time Trefftz Method
## 4 Numerical Examples
### Transient Flows in Four-Layered Porous Media  
The last example is modeling of transient flows in four-layered porous media, as depicted in Figure 12. The diffusion equation depicted in Equation (1) in two dimensions over a rectangular domain is considered. The geometry for this example is defined as  
\[\partial\Omega_{1}=\left\{(x,\;y,t)|-4.5\leq x\leq 0,\;-4.5\leq y\leq 0,0\leq t \leq 3\right\}, \tag{45}\]  
\[\partial\Omega_{2}=\left\{(x,\;y,t)|0\leq x\leq 4.5,\;-4.5\leq y\leq 0,0\leq t \leq 3\right\}, \tag{46}\]  
Figure 10: Comparison of results for solving two-layered porous media: (a) case I and (b) case II. Figure 9: Collocation points: (a) case I; (b) case II. \[\partial\Omega_{3}=\{(x,y,t)|-4.5\leq x\leq 0,\;0\leq y\leq 4.5,\;0\leq t\leq 3 \}, \tag{47}\] \[\partial\Omega_{4}=\{(x,\;y,t)|0\leq x\leq 4.5,\;0\leq y\leq 4.5,0\leq t \leq 3\}. \tag{48}\]  
The hydraulic diffusivity and hydraulic conductivity in the two subdomains are set to be \(D_{1}=4\) m\({}^{2}\)h\({}^{-1}\), \(D_{2}=3\) m\({}^{2}\)h\({}^{-1}\), \(D_{3}=1.5\) m\({}^{2}\)h\({}^{-1}\), and \(D_{4}=1\) m\({}^{2}\)h\({}^{-1}\), and \(k_{1}=4\) mh\({}^{-1}\), \(k_{2}=3\) mh\({}^{-1}\), \(k_{3}=1.5\) mh\({}^{-1}\), and \(k_{4}=1\) mh\({}^{-1}\). The initial condition is  
\[h(x,y,t=0)=5\;\text{m}. \tag{49}\]  
Figure 11: Accuracy of the proposed method: (**a**) case I and (**b**) case II. Figure 12: Configuration of sub-boundaries. The boundary condition is  
\[\partial\Omega_{1}=\left\{(x,\;y,t)|-4.5\leq x\leq 0,\;-4.5\leq y\leq 0,0\leq t \leq 3\right\}, \tag{45}\]0  
As this example may not have exact solutions to investigate the accuracy, we compare the approximations at different simulation times with the numerical solutions using the FDM. In this example, the final elapsed time is 3 h. The order of the basis functions needs to be 20. There are 6400 boundary points that exist for each domain, as illustrated in \[\partial\Omega_{1}=\left\{(x,\;y,t)|-4.5\leq x\leq 0,\;-4.5\leq y\leq 0,0\leq t \leq 3\right\}, \tag{45}\]1 For simulating transient flows in four-layered porous media, DDM is utilized [35]. The domain boundary can then be divided into several subdomains. The Dirichlet boundary conditions are prescribed. At the interface, the sub-boundaries, including \(\Gamma_{12}\), \(\Gamma_{22}\), \(\Gamma_{13}\), \(\Gamma_{41}\), \(\Gamma_{23}\), \(\Gamma_{31}\), \(\Gamma_{32}\), and \(\Gamma_{42}\), must satisfy the continuity of flows and the flux conservation based on the following equations:  
\[\partial\Omega_{1}=\left\{(x,\;y,t)|-4.5\leq x\leq 0,\;-4.5\leq y\leq 0,0\leq t \leq 3\right\}, \tag{45}\]2 \[\partial\Omega_{1}=\left\{(x,\;y,t)|-4.5\leq x\leq 0,\;-4.5\leq y\leq 0,0\leq t \leq 3\right\}, \tag{45}\]3 (52) \[\partial\Omega_{1}=\left\{(x,\;y,t)|-4.5\leq x\leq 0,\;-4.5\leq y\leq 0,0\leq t \leq 3\right\}, \tag{45}\]4 (53) \[\partial\Omega_{1}=\left\{(x,\;y,t)|-4.5\leq x\leq 0,\;-4.5\leq y\leq 0,0\leq t \leq 3\right\}, \tag{45}\]5  
The approximations at different simulation times from our approach are further compared with those of FDM. To apply FDM, discretization in the spatial and temporal domains must be considered. For the spatial discretization, the domain is divided into sections, and second derivatives of the diffusion equation for each grid point are approximated using central difference formulas. For the time discretization, the implicit scheme is adopted. For FDM, we consider each length of \(\Delta x\) along the \(x\) axis, each length of \(\Delta y\) along the \(y\) axis, and each length of \(\Delta t\) along the \(t\) axis to be 0.225 m, 0.225 m, and 0.01 h, respectively. Then, we compare the approximations of our method with those of FDM.