AMReX-Astro / Castro

Castro (Compressible Astrophysics): An adaptive mesh, astrophysical compressible (radiation-, magneto-) hydrodynamics simulation code for massively parallel CPU and GPU architectures.
http://amrex-astro.github.io/Castro
Other
302 stars 98 forks source link

address rotation source in spherical 2d coordinate #2967

Open zhichen3 opened 2 months ago

zhichen3 commented 2 months ago

PR summary

This addresses #2927 regarding the rotation bit. I mainly separated get_omega() to return magnitude of the angular frequency, then made get_omega_vec() to depend on j, since $\Omega \hat{z} = \Omega[\cos(\theta) \hat{r} - \sin(\theta) \hat{\theta})]$. To 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