Skip to content

Minimal working examples applying Finite Element Method with Firedrake framework

License

Notifications You must be signed in to change notification settings

volpatto/firedrake_scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Firedrake Scripts (NOTE: this repo is not being tested following firedrake updates)

This repo contains several MWE (minimal working examples) scripts which exemplify the usage of Finite Element Methods (FEM) to solve some problems I faced around or the ones I found interest. The implementation is done with Firedrake Project framework, a very powerful FEM toolkit that provides a Python high-level syntax (more specifically, a Domain Specific Language - DSL) and automatic code generation.

Available scripts (outdated)

  • 1D cases:
    • Poisson with two variations, one shows how to check Stiffness Matrix inputs;
    • Linear parabolic (transient Poisson);
    • A simple linear transport problem (advection + diffusion) stabilized with SUPG;
    • Transient linear reaction-diffusion with a simple exponential growth as reaction term (inspired by simplified Tumor Growth). Available time stepping examples:
      • Crank-Nicolson;
      • 2nd order Backward Differentiation (BDF2).
    • Gray-Scott non-linear transient reaction-diffusion system of PDE (two coupled PDEs), a very interesting case which exhibits self-replication in autocatalytic gel reactors. The code reproduces studies provided in this paper. Currently I provide two different implementations for time stepping integration method:
      • Implicit Euler;
      • Crank-Nicolson (shows overall better performance and accuracy than Implicit Euler);
      • SDIRK4, a singly diagonally implicit Runge-Kutta scheme of order 4 (see here). This method is suitable for stiff problems. As Gray-Scott is highly non-linear in reaction terms, it may presents some stiff behavior. The method perform better than Crank-Nicolson, but demands more execution time.
    • Linear Darcy flow with homogeneous permeability coefficient;
    • Linear Darcy flow with heterogeneous (discontinuous) permeability coefficient;
    • Non-linear transient Darcy flow coupled with Peng-Robinson Equation of States (PR-EoS) to mimic compressible flow in rigid porous medium with low permeability (inspired by Shale rocks reservoirs);
    • A generic reaction-diffusion with high Damkohler number (low diffusion coefficient, high reaction rate coefficient) stabilized with GGLS (Galerkin-gradient/least-squares) which was proposed in this paper;
    • A simplified Population Dynamics case (reaction-diffusion, advection can be considered) with Allee effect reproducing the results available in this paper and exact solution from this one. The study is performed only in reaction-diffusion case, although modification to address advective contribution is straightforward (and already present in the code). To solve the problem, classical continuous Galerkin method. To integrate over the time, there are three MWE provided:
      • Crank-Nicolson;
      • 2nd order Backward Differentiation (BFD2);
      • SDIRK4, a singly diagonally implicit Runge-Kutta scheme of order 4. This method can handle stiff problems, which is required to solve problems with reaction and complex dynamics. The implementation is based on this paper. A general review of DIRK family methods can be found in this report from NASA.
  • 2D cases:
    • Non-linear steady-state Helmholtz based on the example provided by Firedrake's repo;
    • A simple linear transport problem (advection + diffusion) stabilized with SUPG;
    • Non-linear Darcy flow inspired by compressible gas flow in a rigid porous medium with low permeability, such as reservoir composed by Shale rocks. There are slightly distinct sub-cases:
      • With .pvd (Paraview compatible) output files (solved with Newton method);
      • With matplotlib/Firedrake output (solved with Newton method);
      • A case exemplifying how to implement Picard linearization within Firedrake for non-linear problems;
    • (Primal) Linear elasticity problem based on the example provided by Firedrake's notebooks;
    • The extensions to 2D of a generic scalar reaction-diffusion with high Damkohler number stabilized with the GGLS method;
    • Stabilized mixed Finite Element method for Darcy flow as proposed by Masud and Hughes;
    • Stabilized mixed discontinuous Galerkin method for Darcy flow as suggested by Hughes et al;
    • An unconditionally stable mixed finite element method for Darcy flow named as CGLS, which was proposed by Correa and Loula in this paper.

About Me

I'm a Numerical Developer at ESSS. Also I currently pursue a DSc in Computational Modeling at LNCC. Feel free to contact me.

About

Minimal working examples applying Finite Element Method with Firedrake framework

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages