Its only natural when the mesh ends As you are trying to get J.N to zero you
could also set D to zero [edit lol ] there. Preventing flow across the border just applies to
normal component.
See if this helps, I was going to test it first but apparently my FF doesn’t support
mmg2d and I didn’t have time to change it
https://community.freefem.org/t/normal-boundary-condition/341