scikit-finite-diff, a new tool for PDE solving - Département de mécanique Accéder directement au contenu
Article Dans Une Revue Journal of Open Source Software Année : 2019

scikit-finite-diff, a new tool for PDE solving

Résumé

Scikit-FDiff is a new tool for Partial Differential Equation (PDE) solving, written in purePython, that focuses on reducing the time between the development of the mathematicalmodel and the numerical solving. It allows easy and automated finite difference discretization, thanks to symbolic processing(using the SymPy library (Meurer et al., 2017)) which can deal with systems of multi-dimensional partial differential equations and complex boundary conditions. Using finite differences, and the method of lines, Scikit-FDiff allows for the transforma-tion of the original PDE into an Ordinary Differential Equation (ODE), providing fastcomputation of the temporal evolution vector and the Jacobian matrix. The latter ispre-computed in a symbolic way and is sparse by nature. An efficient vectorization al-lows one to formulate the numerical system in such a way as to facilitate the numericalsolver work, even for complex multi-dimensional coupled cases. Systems can be evaluatedwith as few computational resources as possible, enabling the use of implicit and explicitsolvers at a reasonable cost. Scikit-FDiff stands out in comparison to other competitors, such as the FEniCS Project,Clawpack, or the Dedalus Project, in terms of its simplicity. Despite the fact that Scikit-FDiff uses a relatively simple method (finite-differences), which allows one to code in away which is close to the mathematical model, it is able to solve real-world problems. Itis however less suited than other packages for building specialized solvers. Scikit-FDiff also contains several classic ODE solver implementations (some of which havebeen made available from dedicated python libraries), including the backward and forwardEuler scheme, Crank-Nicolson, and explicit Runge-Kutta. More complex approaches, likethe improved Rosenbrock-Wanner schemes (Rang, 2015) up to the 6th order, are alsoavailable in Scikit-FDiff. The time-step is managed by a built-in error computation,which ensures the accuracy of the solution. The main goal of this software is to minimize the time spent writing numerical solversallowing one to focus on model development and data analysis. Therefore, Scikit-Fdiffhas been formulated such that it can solve both simple examples and complex models inonly a few line of code. In addition, extra tools are provided, such as data saving duringthe simulation, real-time plotting, and post-processing. Scikit-FDiff can be used for a wide range of applications including thermal diffusion,heterogeneous chemical reactor modelling, wave propagation, and a large number of non-linear phenomena modelled as systems of PDEs. To date the authors have used it forsolving heated falling-films (Cellier, 2018), dropplet spread on windshield and simplemoisture flow in a porous medium. Furthermore, Scikit-Fdiff has been validated forsolving the shallow-water equation on dam-breaks (LeVeque, 2002) (and the steady-lakecase).

Dates et versions

hal-02404312 , version 1 (20-12-2019)

Identifiants

Citer

Nicolas Cellier, Christian Ruyer-Quil. scikit-finite-diff, a new tool for PDE solving. Journal of Open Source Software, 2019, 4 (38), pp.1356. ⟨10.21105/joss.01356⟩. ⟨hal-02404312⟩
438 Consultations
0 Téléchargements

Altmetric

Partager

Gmail Facebook X LinkedIn More