Closed agzimmerman closed 6 years ago
One easy idea would be to always solve the grid also on something with every cell uniformly refined. Some thought would need to be put into how to compute the error between those two solutions on each cell of the fine mesh.
This paper discusses a hierarchical error estimator for the solution of the Stefan problem with adaptive finite elements.
Now I'm having some luck using fenics.AdaptiveNonlinearVariationalSolver here.
I got the built-in fenics.AdaptiveNonlinearVariationalSolver to work on the branch https://github.com/geo-fluid-dynamics/phaseflow-fenics/tree/feature/adaptive_solver
Here's the result:
On that branch I've thrown away a lot of features of Phaseflow that were complicating the code and making it too difficult to debug. So the branch requires plenty of cleaning up before we can use it as master.
@julekowalski , regarding our conversation yesterday: Now the adaptive solver, using the dual-problem error estimator, works as expected :)
We can begin with the coarsest possible mesh and this still works great:
Here is the source code where the error is estimated: https://bitbucket.org/fenics-project/dolfin/src/3d1f687ec9ee39afc0fe6e01800431995b42ad04/dolfin/adaptivity/ErrorControl.cpp?at=2017.1.0&fileviewer=file-view-default
The implementation now fails when solving problems where some of the unknowns are trivial, e.g. the lid-driven cavity problem where T_k and P(T_k) are constant. I'm investigating this in issue #137.
Update: The issue is not related to trivial unknowns, or at least we have working examples with trivial unknowns.
The estimator worked well for the toy PCM problem, but is not working well for the octadecane melting benchmark (issue #79).
The adaptive goal functional M = $\phi(T)$ is working well for the Stefan problem and the octadecane PCM melting benchmark as of PR #180.
Still our selection of the functional and of the adaptive solver tolerance is ad-hoc. For now the plan is to let the user provide any functional (see issue #192).
Ideally we could provide a selection of useful goal functionals and recommendations for the tolerance. These will be demonstrated with the tests, examples, and notebooks. For now we have much to learn before this can be done robustly.
Right now our adaptive mesh refinement is much too ad-hoc.