The Numerical Method
The physics interface solves the shallow water equations using the Discontinuous Galerkin (DG) method in space together with explicit time stepping. The computations are restricted to transient problems. The basis functions are the nodal discontinuous Lagrange shape functions with constant order.
The numerical method used solves wave problems of the form
When solving the shallow water equations, da is an identity matrix, w is the vector of conservative variables, Γ represents the conservative fluxes, and f includes the source terms:
Here, Γh and Γq represent the fluxes of the continuity and momentum equations, respectively.
Discontinuous Galerkin methods use shape functions that are continuous in the interior of each mesh element, but discontinuous across element boundaries. A numerical flux must be defined between element boundaries and the dependent variables are not required to be continuous on faces between adjacent mesh elements. The default numerical flux is the Lax-Friedrichs flux, which uses an average of the physical fluxes together with a penalty term.
After discretization in space, the system of equations is integrated in time. The standard procedure is to use an explicit Runge-Kutta method. The physics interface uses the third-order SSP (strong stability preserving) Runge–Kutta method per default.
The time step in explicit computations is limited by the CFL condition; see Time Explicit Integrator in the COMSOL Multiphysics Reference Manual. The maximum stable time step is proportional to the smallest mesh element size h and inversely proportional to the maximum wave speed in the domain. On unstructured meshes with local refinement regions only a few elements are small, yet these dictate the overall time step for the whole problem. In such cases, the use of Local Time Stepping is advisable. COMSOL Multiphysics provides the Adams-Bashforth 3 (local) time stepping method.
Theory for the Wave Form PDE in the COMSOL Multiphysics Reference Manual.
The bottom topography hb is entered as a user-defined expression. In order to ensure that its gradient can be evaluated and is constant on every element, it is first projected onto the variable swe.hb_linear using linear Lagrangian shape functions. For plotting purposes, the provided expression for hb is also projected onto the variable swe.hb_constant using the same piecewise discontinuous shape functions as for h. These projections are done in a Stationary study step that must be computed before the Time Dependent study step is used to compute the shallow water equations. When starting a new model from the Model Wizard, the stationary study step is added per default when selecting a Time Dependent study.