PrincetonUniversity / athena-public-version

(MOVED) Athena++ GRMHD code and adaptive mesh refinement (AMR) framework. Active repository --->
https://github.com/PrincetonUniversity/athena
BSD 3-Clause "New" or "Revised" License
160 stars 118 forks source link

Configure 2D --coord=cylindrical to use r-z plane #24

Closed TevaIlan closed 5 years ago

TevaIlan commented 5 years ago

It seems that 2D cylindrical simulations are set up to run with r and the azimuthal angle. Is there a way to do it with r and z instead?

felker commented 5 years ago

Unfortunately this is not possible. Would running 2D --coord=cartesian with custom source terms that model the cylindrical coordinate terms work for your application?

felker commented 5 years ago

@tomidakn suggests either to use spherical coordinates (r-theta), or use only 4 cells in the azimuthal direction in cylindrical coordinates.

beresnyak commented 5 years ago

Currently you have to use 4 zones in angle, nx2=4, to achieve this effect. You can also set x2_slice=0.0 in the output to have only rz output. Feature request: allow nx2=1

TevaIlan commented 5 years ago

The reason I was trying to do this is that I wanted the density of something I was adding to the simulation to go as 1/r^2 and that only made sense in 3D or a kind of pseudo-3D (in 2D it'd go as 1/r). I was initially doing cartesian 3D but wondered if I might be able to do a sort of pseudo-3D by doing something in the r-z plane which would allow the density to go as 1/r^2 but would run faster as it would only be 2D really. Sounds like that's not really possible and I'm probably best off going to cartesian 3D like I did initially even though it will take longer to run.

Thanks.