-
Notifications
You must be signed in to change notification settings - Fork 97
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
address rotation source in spherical 2d coordinate #2967
address rotation source in spherical 2d coordinate #2967
Conversation
…to 2d_spherical_rotation
…to 2d_spherical_rotation
|
||
Array2D<Real, 0, 2, 0, 2> dt_omega_matrix = {}; | ||
|
||
if (implicit_rotation_update == 1) { |
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.
what happened to this check on implicit_rotation_update
?
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.
I think it is missing in fill_dt_omega_matrix
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.
fill_dt_omega_matrix
is only called within if (implicit_rotation_update == 1)
I think.
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.
yes, you are right.
GpuArray<Real, 3> omega_cross_v; | ||
cross_product(omega, v, omega_cross_v); | ||
|
||
if (c1) { | ||
// For Spherical coordinate, the physical position vector is just r rhat, | ||
// but the input r will be in the format of (r,theta,0). So change it to (r,0,0) |
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.
why can we do this?
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.
in spherical coord, the position vector is just
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.
Oh, this is because it is the position vector from the origin?
okay, everything looks good. can you also update the docs? |
done |
PR summary
This addresses #2927 regarding the rotation bit.$\Omega \hat{z} = \Omega[\cos(\theta) \hat{r} - \sin(\theta) \hat{\theta})]$ .
I mainly separated
get_omega()
to return magnitude of the angular frequency,then made
get_omega_vec()
to depend on j, sinceTo deal with the problem of position vector, I just made sure
r
is (r,0,0) before the cross_product call.I also made computing dt_omega_matrix into a separate function since omega vector now varies.
PR motivation
PR checklist
CHANGES
file has been updated, if appropriate