Hi all,
Standard velocity visualisation output for paraview give results in full vectors (arrows) and separated in x,y,z-directions. However, regarding a spherical set-up (eg. spherical shell, chunk or sphere) I would like to visualise the velocity field also in separate radial and tangential velocities.

I was wondering if someone already has written a postprocessor that creates vtu-files containing these spherical velocities and is willing to share it?

Or if anyone could give me a heads-up regarding an existing postprocessor which I could try to modify to make it myself and, of course, any tips in how to do so.

Hi Erik,
I do not have such a postprocessor, but you are right it would be very useful to have one. If nobody has one available and if you want to create one on your own I would start with a copy of one of the existing postprocessors that creates a vector or tensor quantity, e.g. source/postprocess/visualization/gravity.cc or source/postprocess/visualization/shear_stress.cc. The function evaluate_vector_field in these postprocessors is called once per cell whenever output is written, and the input parameter input_data contains the positions and velocities at every location we want to write output for in this cell. E.g. you can do input_data.solution_values[q][this->introspection().component_indices.velocities[d]] to access the velocity (as Tensor<1,dim>) at the q’th output vertex of that cell. Correspondingly input_data.evaluation_points[q] accesses the related positions (as Point<dim> in cartesian coordinates). You would then need to convert the velocities using the position into radius/longitude/latitude components and write those into the computed_quantities parameter. I think this would make a fine addition to the main code so please let us know if you do this or need any help.

This has the advantage that you don’t have to convert between different coordinate systems. It also works in 2d/3d, and in spherical/Cartesian coordinate systems. The only assumption is that the gravity vector indicates a good vertical direction – which is generally true.