The significant flexibility of COMSOL Multiphysics represents one of the primary reasons AltaSim uses this software as our main simulation tool. In this installment of our Tips & Tricks, we are going to review the discontinuous Galerkin (DG) method that COMSOL has implemented. AltaSim has found that for the cases described in this article, DG provides a valuable resource for the simulation engineer. The purpose of this article is to provide a technical overview of the DG method and to highlight general solution features that can help engineers determine when to implement this non-standard approach. the DG method is not the best numerical method for all problems, it is another powerful tool that has been added to the COMSOL toolbox, extending the range of problems that can be solved accurately and efficiently.
Although COMSOL Multiphysics primarily utilizes the finite element (FE) method, the software also enables the user to take advantage of several other numerical methods, including the discontinuous Galerkin method. The DG method can be thought of as a hybrid of the FE method and the finite volume (FV) method, combining features of both numerical methods. Like the FE method, the DG method uses shape functions within each element. And like the FV method, the solution is discontinuous between elements, and the elements interact by means of fluxes across the element interfaces.
The properties of the DG method make it an attractive option for simulations of certain types of physical phenomena. This method can be a computationally efficient approach for solving transport and propagation equations that are dominated by first-order terms. In recent years, COMSOL has introduced several interfaces that use the DG method for applications in fluid dynamics, electromagnetics and acoustics:
- Shallow Water Equations, Time Explicit
- Compressible Euler Equations
- Electromagnetic Waves, Time Explicit
- Pressure Acoustics, Time Explicit
- Nonlinear Pressure Acoustics, Time Explicit
- Elastic Waves, Time Explicit
- Convected Wave Equation, Time Explicit
Figure 1. Wave impact on a column simulated using the DG method (“Dam Breaking on a Column, Shallow Water Equations” in the Application Library for the CFD Module).
In addition to these physics-specific interfaces, COMSOL users can implement custom DG models using the Wave Form PDE interface that is found in the Mathematics>PDE Interfaces section of the Select Physics and Add Physics windows. The Wave Form PDE interface enables the user to specify the equation to be solved, the element order, and the formulations of the numerical flux that connects adjacent elements. The flux vector and source term may be functions of the dependent variables, but they cannot be functions of the derivatives of the dependent variables, so it is not possible to create second-order (or higher) partial differential equations. A filter can be used to create absorbing layers, while a WENO (Weighted Essentially Non-oscillatory) limiter is available to improve numerical stability during the solutions process.
Figure 2. Wave Form PDE interface.
Compared to the FE method, the DG method can be more efficient, accurate and numerically stable for systems that are described by hyperbolic PDEs. When deciding whether to use the DG method for a particular problem in COMSOL, it may be helpful to keep the following items in mind:
- The DG method is well-suited for handling sharp jumps in the solution variables (such as shock waves or phase transitions).
- Unlike the FE method, the DG method can stably and accurately solve advection equations with no diffusion.
- For large problems, the memory usage of DG models can be much less than FE models.
- The solver time per timestep is usually much less for DG models than for FE models.
- Timesteps for DG analyses typically need to be much smaller than for FE analyses with implicit time-stepping, so the DG method commonly requires many more timesteps than the FE method.
- At present, DG analyses in COMSOL must be solved as transient problems.
- The current COMSOL implementation of the DG method does not allow for diffusive effects.
- Depending on the problem, DG models may require some tuning of the limiter, filter and solver setting to enable reasonably large timesteps while maintaining numerical stability.
While the DG method is not the best numerical method for all problems, it is another powerful tool that has been added to the COMSOL toolbox, extending the range of problems that can be solved accurately and efficiently.
AltaSim provides services to simulation engineers that allows them to take advantage of the most advanced features in COMSOL Multiphysics. Our services are focused on enabling engineers to experience these benefits at the level of independence from AltaSim that works best for them. From training to consulting services, AltaSim finds the best mix for simulation engineers to experience the benefits of simulations while they come up the learning curve. To learn more about our training visit the training center on our website. To learn more about our consulting, review our consulting services page and reach out to us to start a discussion.