Predicting the optimal CFL number for pseudo time-stepping
with machine learning in the COMSOL CFD module
More Info
expand_more
Abstract
Commercial finite element software like COMSOL is build to be user-friendly. For example, the user does not have to find weak formulations, or discretise the partial differential equations by hand. One of the more difficult parts of using finite element software is deciding which solver method and solver parameters to choose, as the performance of the solver, and hence the performance of the whole simulation, depends on it.
Pseudo time-stepping is a stabilisation method that is designed to lead to a stationary solution for a wider range of initial guesses compared to traditional Newton methods. During pseudo time-stepping, a CFL number is used. This CFL number is adapted each nonlinear iteration. In COMSOL the CFL number either depends on the iteration count, or the nonlinear error estimate and previous CFL number. In this case, the CFL number is a global value, but the pseudo time-step itself is local since it also depends on the mesh cell size.
In this research, a neural network is created to predict a local CFL number for pseudo time-stepping,
such that the network accelerates convergence compared to the two CFL numbers for pseudo time-stepping in COMSOL and is generalisable. The convergence is assumed to be accelerated if the
network predictions result in convergence in fewer nonlinear iterations compared to solvers that use
each one of the two CFL numbers in COMSOL. The network is assumed to be generalisable if it is able to accelerate the convergence for different laminar flow problems in COMSOL on which the network has not been trained.
A network with 2 hidden layers with each 16 neurons is trained on local data from element patches in order to make it generalizable. The element patch data points contain information of the central triangular element vertices, and of the vertices of the three adjacent elements. The local data consist of the velocities, pressure and residuals, as well as the cell Reynolds number and the element edge lengths. The loss of this network is the root mean squared error between the network output and a previously computed CFL target. This target is the optimised value for the local CFL number such
that the difference between the solution obtained from the pseudo time-step and the exact solution is
minimised.
The network predictions were able to accelerate convergence compared to to the two CFL numbers in COMSOL for several different 2D laminar flow simulations. Therefore, the conclusion is that a network trained on optimised local CFL numbers is able to generalize well and accelerate the existing pseudo time-stepping method.