Replies: 1 comment
|
On a grid of this size you might get some larger errors, since you're essentially interpolating cos(pi y) and it actually varies a fair amount over the domain. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
For the Darcy equation, I've been having an issue where the top half of my solution is positive and the bottom is negative. For example on a 4x4x4 grid my solution is:
[[ 0. 0. 0. 0. ]
[ 0. 0.82210677 0.82210677 0. ]
[-0. -0.82210677 -0.82210677 -0. ]
[-0. -0. -0. -0. ]]
[[ 0. 0. 0. 0. ]
[ 0. 0.82210677 0.82210677 0. ]
[-0. -0.82210677 -0.82210677 -0. ]
[-0. -0. -0. -0. ]]
(for the middle 2 y levels, the rest are 0) and the exact solution is:
[[0. 0. 0. 0. ]
[0. 0.64951905 0.64951905 0. ]
[0. 0.64951905 0.64951905 0. ]
[0. 0. 0. 0. ]]
[[0. 0. 0. 0. ]
[0. 0.64951905 0.64951905 0. ]
[0. 0.64951905 0.64951905 0. ]
[0. 0. 0. 0. ]]
Since we have cos(pi*y) in the left hand side it makes sense that this would be the case, as for y>0.5 this term is negative. I've tested my stencil with k=1 as you suggested in a previous answer, and this seems to work, but I'm having trouble pinpointing where in the stencil I'm going wrong, either with the cos(pi * y) part or the part involving the derivative of k.
All reactions