Changing the order of the spatial derivative (stencil).

27 views
Skip to first unread message

SimonC (Iomsn)

unread,
Oct 18, 2024, 8:45:06 AM10/18/24
to pencil-code-discuss
Hi,

For a numerical study I would like to change the order of the spatial derivatives. While I can easily change the time integration order with itorder in the start.in file, I cannot see where we can easily choose the different stencils.

Best

Simon

Philippe-A. Bourdin

unread,
Oct 18, 2024, 8:59:58 AM10/18/24
to pencil-code-discuss
Dear Simon,

not sure if this is what you mean, but the accuracy order of derivatives is easily changed with setting another derivative module in "Makefile.local".

I have recently developed some more modules with different strategies:
- 2nd order accuracy for all derivatives up to 6th derivative ("deriv_2nd_all" => nghost=3)
- 4th order accuracy for all derivatives up to 6th derivative ("deriv_4th_all" => nghost=4)
- 4th order accuracy for the 1st and 2nd derivative, 2nd order for 3rd and 4th derivative, no 5th or 6th derivatives ("deriv_4th" => nghost=2)

Furthermore we have:
- 2nd order accuracy for up to 2nd derivative, no higher derivatives ("deriv_2nd" => nghost = 1)
- 4th order accuracy for up to 2nd derivative, 2nd order for 3rd and 4th derivative, no higher derivatives ("deriv_4th" => nghost = 2)
- 8th order accuracy for up to 2nd derivative, 6th order for 3rd and 4th derivative, 4th order for higher ("deriv_8th" => nghost = 4)
- 10th order accuracy for up to 2nd derivative, 8th order for 3rd and 4th derivative, 6th order for higher ("deriv_10th" => nghost = 5)

The default is of course:
- 6th order accuracy for up to 2nd derivative, 4th order for 3rd and 4th derivative, 2nd order for higher ("deriv" => nghost = 3)

Best greetings,
Philippe.

SimonC (Iomsn)

unread,
Oct 18, 2024, 9:37:26 AM10/18/24
to pencil-code-discuss
Dear Philippe,

Thanks! That was what I was looking for. I could not find it anywhere.

Best

Simon
Reply all
Reply to author
Forward
0 new messages