Surface average with spherical coordinates

63 views
Skip to first unread message

Bhargav Mantravadi

unread,
Oct 7, 2025, 1:03:11 PMOct 7
to dedalu...@googlegroups.com
Dear Team,

I hope you are doing well. I am currently working on simulations in spherical shells using the Dedalus code and have encountered an issue when trying to add diagnostic parameters. I am working with the shell IVP script file. Here is my question:

I have a scalar field, T, defined as T = dist.Field(name='T', bases=shell). I would like to compute the surface average of T to obtain a radial function, v(r). Furthermore, I want to differentiate v(r) at the inner sphere and dump it as a diagnostic parameter. Could you please advise on the correct workflow to achieve this?

I attempted several methods, and the following is one of the methods, but I believe I am implementing it incorrectly:
phi_ave = lambda A: d3.Average(A,'phi')
theta_ave = lambda A: d3.Average(A,'theta')
surface_ave = lambda A: theta_ave(phi_ave(A))

Thank you in advance.

Regards,
Bhargav

Bhargav Mantravadi

unread,
Oct 7, 2025, 1:03:11 PMOct 7
to dedalu...@googlegroups.com
Dear All,

I realized that the question regarding the surface average had already been addressed in the group using coords.S2coordsys. I am currently doing the following and getting the expected output: 
d3.grad(d3.Average(T, coords.S2coordsys)))

Please let me know if you have any additional thoughts on my query.

Thanks again,
Bhargav

Reply all
Reply to author
Forward
0 new messages