## 2 Materials and Methods
### Numerical Integration of the Nonlinear Shallow Water Equations
#### 2.2.3 The Relaxation Zone  
The relaxation zone is a kind of non-reflecting boundary layer. It absorbs all the reflected waves in a region that lies at the inlet boundary. It is usually one wavelength long [26; 30]. In practice, it can modify an incident wave field to any desired target function. This also extends the applicability of the sponge layer to inlet boundaries, as the target function could be that of the generated wave train. The relaxation zone works as a blend between a target solution and the computed solution. The modified velocity can be described by  
\[u=c_{relax}\ u_{target}+(1-c_{relax})\ u_{model}\, \tag{33}\]  
where \(u_{target}\) is a target velocity, \(u_{model}\) is the unaltered computed velocity, and \(c_{relax}\) is the relaxation coefficient. This technique has been discussed in many papers, such as [PERSON] et al. [31; 32; 33; 34; 35]. As the relaxation is applied explicitly as a postprocessing step, it is possible to apply it at the inlet. If there is no proper relaxation, the waves may propagate upstream toward the inlet boundary, be reflected back into the computational domain and pollute the flow field.  
To obtain a smoothly modified internal flow field, it is required that \"\(c_{relax}\)\" and its spatial derivatives are equal to zero along the interface connecting the relaxation zone and the internal field of the computational domain. There are many options to build a proper function of the relaxation coefficient. In this paper, we use the form  
\[c_{relax}(\beta)=b\beta^{3}+(1-b)\beta^{6}\, \tag{34}\]  
where \(b\in[0,2]\) is a free parameter, and \(\beta=1-(x-x_{start})/(x_{end}-x_{start})\) (\(x_{start}\) and \(x_{end}\) are coordinates of the relaxation zone boundaries) is the nondimensional distance function.  
The choice of the relaxation coefficient \(c_{relax}\) depends strongly on the problem and the length of the relaxation zone. What is important is that the choice is not unique for a given problem.  
In numerical simulations, reflected waves from the beach will interact with the wave generation boundary, which will pollute the final results, especially for breaking waves. Therefore, we can test the applicability of the relaxation zone through the modeling of standing waves. If it can absorb reflected waves in front of the inlet, the incident wave profile is kept in the relaxation zone and the standing wave pattern is simulated in the non-relaxed part of the computational zone.  
The standing wave is modeled as sketched in Figure 4. The relaxation zone at the left boundary is one wavelength long. The total horizontal length of the domain is three wavelengths. The incident wave amplitude is \(\eta_{0}=1\) m, the wave period is \(T=40\) s, and the water depth is \(h_{0}=20\) m. One can see that the relaxation zone can simulate a standing wave pattern well in the non-relaxed part of the computational domain.  
Figure 4: (**a**) The geometry of a flat bottom connected to a vertical wall. (**b**) The modeled numerical solution to standing wave problem on the geometry of panel (**a**).  
The relaxation zone makes the boundary as \"open\". Compared with the ITBC, which can only be applied to regular waves, it can be wildly used for any type of wave, regular or irregular, long or short.