New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change order of spherical unit vectors from theta, phi to phi,theta #2820
Change order of spherical unit vectors from theta, phi to phi,theta #2820
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I absolutely agree we should get this right before a release. I would prefer to reorder the terms in the equations a bit more as suggested (no functional change), but then this should be good to go. Thanks for the cleanup 👍
source/utilities.cc
Outdated
- std::sin(phi)*u_theta | ||
- std::cos(phi)*std::cos(theta)*u_phi; // X | ||
+ std::cos(theta)*std::cos(phi)*u_theta | ||
- std::sin(phi)*u_phi; // X |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make the reordering consistent by also here and below always using a*u_r + b*u_phi + c*u_theta
, and order the individual terms as cos(phi)cos(theta)
instead of cos(theta)cos(phi)
?
@gassmoeller I've addressed your comment :) |
Thanks 👍 |
@gassmoeller Just a question, existing prm files from users will be interpreted differently now, do we note that down somewhere? |
Good point. Usually we note that in the changelog entries, and if possible also provide an update script in |
…ectors Change order of spherical unit vectors from theta, phi to phi,theta
When setting up a chunk model with boundary velocities using the
function
plugin, I noticed that although the variables in the spherical coordinate system are interpreted as radius, longitude and latitude, the spherical unit vectors point in the direction of radius, latitude and then longitude. It seems more intuitive and in line with the general order of spherical coordinates in aspect to switch to radius, longitude, latitude. Did I understand this correctly and would you agree @bartniday ?