Possible correctness bug in PowerLawConvectionTerm #916
Replies: 5 comments
-
There are no ghost cells in FiPy. In your derivation, For You might find this notebook helpful to understand some potentially non-intuitive things about FiPy's boundaries. |
Beta Was this translation helpful? Give feedback.
-
Thanks. I agree this test case can be explained by using However, that process doesn't seem to be consistently applied to other convection boundary conditions. If we take the same code and change In that case, FiPy returns [0, 0]. I’ve attached my derivation for the v=[0,1,1] case: minfail2.pdf Any idea why the boundary conditions seem to be handled differently for v=[1, 1, 0] than for v=[0, 1, 1]? Any idea what is the correct process to follow (instead of ghost cell + alpha weighting) to derive [0, 0] in the v=[0, 1, 1] case? Thanks in advance. I've looked at the linked notebook and didn't find a connection to this issue. The linked notebook is all about diffusion, and I've been able to successfully predict the behavior of diffusion term boundary conditions. I'm pretty sure the issue I'm describing here is specific to convection, and I'm guessing related to the way that convection uses alpha weighting when calculating face values. |
Beta Was this translation helpful? Give feedback.
-
What I said earlier was incorrect. FiPy does not use ghost cells, but the boundary constraints for a so there is an |
Beta Was this translation helpful? Give feedback.
-
Thanks! I understand it now. I confirm the semi-implicit approach explains both of my test cases. |
Beta Was this translation helpful? Give feedback.
-
Great. I'm going to convert this to a "Discussion". |
Beta Was this translation helpful? Give feedback.
-
PowerLawConvectionTerm
seems to handle constraints at boundary faces incorrectly, or at least differently than I would expect.This gist contains a minimal example, solving one step of an equation with a Grid1D with just 2 cells:
https://gist.github.com/opensourcefan314/c7fa68bf44e069406f617439a9417518
I would expect it to print [2/3, 2/3] but it prints [1/2, 1/2].
I think I'm doing the math correctly because I've been able to do the math to reproduce FiPy exactly for diffusion terms and for slightly different convection problems. I think the problem is specifically with the boundary conditions because I always match FiPy exactly if I set convective strength to 0 at the outermost faces.
The attached PDF contains my derivation of the [2/3, 2/3] expected result.
minfail.pdf
Beta Was this translation helpful? Give feedback.
All reactions