diffusion1 broken?
Closed this issue · 9 comments
running
asgard(diffusion1,'lev',3,'deg',3,'timestep_method','BE', 'dt',0.05,'num_steps',10)
seems to break.
However, changing (in diffusion1.m
)
pterm1 = GRAD(num_dims,g1,+1,'N','N');
pterm2 = GRAD(num_dims,g2,-1,'D','D',BCL_fList,BCR_fList);
to
pterm1 = GRAD(num_dims,g1,+1,'D','D');
pterm2 = GRAD(num_dims,g2,-1,'N','N',BCL_fList,BCR_fList);
seems to fix it?
@MollyRaver do you have any thoughts on this?
I am wondering if the problem is related to the presence of the source term. When I take it out and put in the correct solution, it messes up the problem further.
Is this a manufactured test case? If so, I’m not sure what you mean by taking out the source term?
No I mean you can have a correct solution without the source term. It's cos(pix) exp(-pi^2t). But when I put in that solution and take out the source term, it gives me a weird curve that isn't correct.
I have just added a new pde to the reference
branch called projecti_diff1
which is a 1D diffusion problem with an analytic solution with no source terms. It seems to work fine. So this still points to a problem with diffusion1
Yes. For flux as "central flux", that means value 0. We can observe the odd-even convergence rate if we ignore the error with respect to t. It means: if Deg = 2 (actually linear P1 element), it converges at the order O(h); if Deg = 3 (actually P2 element), it converges at the order O(h^4); if Deg = 4 (actually P3 element), it converges at the order O(h^3).
The errors from flux choice, related to boundary terms, sometimes give the oscillation at the boundary. The central flux can fix it.
Is the flux problem related to the size of the diffusion coefficient? I noticed that David's pde did not have the problem in diffusion1, but the diffusion coefficient is much lower. That may be because the diffusion occurs rapidly in diffusion1 and thus requires a central flux to capture? When I change diffusion1 to have nu = 0.01, it works perfectly even with the current flux terms.
The bigger coefficient may make the issue worse. If we assume -1 (left flux) and that means the boundary condition is purely from left. In this case, the right end is free. However, it should be fixed as the Dirichlet bc. There will be some un-fitted issues.
@MollyRaver perhaps this is a good candidate to try the global lax-freidrichs method for?