INP-PM / FEDM

Finite Element Discharge Modelling code
https://inp-pm.github.io/FEDM/
GNU Lesser General Public License v3.0
10 stars 4 forks source link

Stabilization and theta scheme #12

Open RaphaelPile opened 1 year ago

RaphaelPile commented 1 year ago

I need to implement and compare different stabilization methods (e.g. SUPG and Taylor-Galerkin) for my own research work. My first step is to reproduce 1D results I got with GetDP software, using theta time scheme (Crank-Nicholson and Euler implicit).

So, I am working on both of these features.

I have a question of architecture: would you rather have a different "weak_form_balance_equation_mymethod" for each case, or a generic (but more complex) "weak_form_balance_equation" function?

Moreover, I can commit the results from GetDP as a small test (see discussions in #3).

AleksandarJ1984 commented 1 year ago

I have already implemented stabilisation methods, i.e. SUPG and bubble-enriched stabilisation, in my internal test version. I will add these examples at some point in the future. You can find the minimum working example of the bubble-enriched stabilisation implementation here.

As for the form of functions, I think that one generalised function is better than multiple ones. I even considered splitting the time discretisation part and implementing additional methods, but I did not want to change the initial code too much.

RaphaelPile commented 1 year ago

I have already a working example on SUPG (it was really easy with the current architecture). I have not tested the Bulle-enriched one, but I don't see any problem for adding it.

Okay, I will propose something generic but readable which includes the theta scheme and your current time scheme, and it would a base for further discussion. Working on this PR from now on.

RaphaelPile commented 1 year ago

Hello everyone,

I got some issues on my personal branch (compare_stab) where I am trying to compare several stabilization methods and how they degrade over time. I perform these simulation in the example/square_convection/smooth_square_1d_compare_stab.py.

However, I have convergence issues with the logarithmic method (with or without the theta scheme) that I don't understand. Even with very thin mesh and small time steps. Do you have some references about this method ?

Secondly, there is a Fenics bug with the Bubble method: Not working : *** FFC warning: evaluate_dof(s) for enriched element not implemented. @AleksandarJ1984 did you found a workaround on your side ?

Best,

Raphaël

AleksandarJ1984 commented 1 year ago

Hi Raphaël,

This logarithmic representation is used in Welland et al. Phys. Rev. E 89 (2014) 012409 (the preprint is available here) and briefly discussed here. For our purpose it worked quite good, and I did not have any issues with the convergence. Usually, when I had some convergence issue, it turned out it was either a typo or an error in boundary conditions.

Regarding the theta scheme, I have not used it before. However, a few examples with the theta scheme and SUPG stabilisation method that might be useful to you are given here.

As for the bubble-enriched stabilisation, I did not have this kind of problem before. MWE I used to test the method worked quite well.

Maybe it would be good if I made a branch where I could add more examples and also merge your suggestions. Note that I try to keep the main branch as close as possible to the preprint (at least for now).

Best regards, Aleksandar

RaphaelPile commented 1 year ago

Hi Aleksandar,

Thanks for the reference. I have implemented periodic boundary condition, I don't know if this can be an issue.

We can add a new branch, but you can also create a release of the current code version and link it to the pre-print (better in my opinion).