geo-fluid-dynamics / phaseflow-fenics

Phaseflow simulates the convection-coupled melting and solidification of phase-change materials.
MIT License
52 stars 22 forks source link

Reproduce "Melting of PCM" benchmark from danaila2014newton #79

Open agzimmerman opened 7 years ago

agzimmerman commented 7 years ago

We've successfully tested the basic capability in issue #14, but it still may be difficult to obtain a solution for the exact parameters from danaila2014newton.

agzimmerman commented 6 years ago

Reducing r to 0.005 (from 0.05) makes the Newton method rapidly diverge.

agzimmerman commented 6 years ago

I was able to converge one time step of the melting octadecane PCM benchmark here: https://github.com/geo-fluid-dynamics/phaseflow-fenics/tree/benchmark/melting_octadecane_pcm

There are some deficiencies:

agzimmerman commented 6 years ago

Maybe relaxing the Newton solver would do the trick, since this has seemed to handle rapid divergence pretty well before. I added issue #154 for this.

agzimmerman commented 6 years ago

So far relaxing the solver isn't helping.

agzimmerman commented 6 years ago

In this lid-driven cavity example, the metric u[0]fenics.dx was not useful, while u[0]u[0]*fenics.dx worked very well. So maybe I just need to get more creative with the metric for this melting case.

agzimmerman commented 6 years ago

I just noticed that when solving the nonlinear variational problem, a Krylov solver is being mentioned, e.g.

Solving nonlinear variational problem. Newton iteration 0: r (abs) = 1.817e+01 (tol = 1.000e-08) r (rel) = 1.000e+00 (tol = 1.000e-04) Solving linear system of size 8244 x 8244 (PETSc LU solver, umfpack). PETSc Krylov solver starting to solve 8244 x 8244 system. Newton iteration 1: r (abs) = 1.182e-02 (tol = 1.000e-08) r (rel) = 6.507e-04 (tol = 1.000e-04) Solving linear system of size 8244 x 8244 (PETSc LU solver, umfpack). PETSc Krylov solver starting to solve 8244 x 8244 system. Newton iteration 2: r (abs) = 1.146e-03 (tol = 1.000e-08) r (rel) = 6.306e-05 (tol = 1.000e-04) Newton solver finished in 2 iterations and 2 linear solver iterations.

This is perplexing. I began exploring this in issue #156 .

Having had no luck pinpointing this problem yet, I think it's about time I try making a minimal script that solves the melting octadecane PCM benchmark (without Phaseflow). If the new script also somehow invokes a Krylov method, then maybe that will get me closer to a MWE that reproduces the issue.

agzimmerman commented 6 years ago

At this point, I think I should verify the coupled problem with MMS (see issue #158) before getting too worried about the benchmark case not working. Maybe my implementation is wrong.

agzimmerman commented 6 years ago

As of PR #172 , we have a pretty good result for the octadecane PCM melting benchmark. The PCI doesn't advance quite far enough. We still need to study the sensitivity of parameters such as the time step size, the initial mesh, the adaptive solver tolerance, etc.