Skip to content
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

bug: splash_to_grid in Cylindrical coordinates - Incorrect densities and velocities near leftmost (angular boundary) boundary #23

Open
GeoffBryan opened this issue Dec 6, 2019 · 3 comments

Comments

@GeoffBryan
Copy link

Nature of the issue
I'm using ssplash to interpolate a Phantom dump file onto a cylindrical grid. The Phantom dump file is the 137 time-step (~27,000 yrs) of a Phantom "Jet" simulation of the collapse of protostar to the first core. The flow is almost axis-symmetric (but not quite :) )

When I use ssplash 2.9.1 to interpolate onto a cylindrical grid, t_he density and velocity fields are deformed near the \phi = -\pi boundary_ (I use \theta instead of \phi in the attached plots). The density and velocity fields at \phi = +\pi should be identical to those at the -\pi boundary but this is not the case.

Plots of constant density along meridional planes

scalar_000
Fig. 1. Contours of constant density at the $\phi = -\pi$ boundary - the contours are "deformed"

scalar_002

Fig. 2 Contours of constant density at $\phi = +\pi$. Note this should be identical to Fig. 1 but is quite different.

scalar_001
Fig. 3 Contours of constant density at $\phi = 0$ Because the flow and density are almost axisymmetric the contours for $\phi = 0$ should be very close in form to Fig. 1 and Fig. 2. However they are actually similar only to Fig. 3

Plot from dump to a Cartesian grid

The plot below is generated by using ssplash to dump to a Cartesian grid and plotting the density along the y = 0.0 au plane. This should be identical to plotting the $\phi = + or-\pi$ meridional plane on the cylindrical grid.

scalar_001
Fig. 4 Plots of constant density on the y = 0 au plane from a Cartesian grid generated by ssplash 2.9.1

Notes on the above
The plots generated from the cylindrical grid were generated on a cylindrical grid that is twice as large in its negative vertical extent as it positive vertical extent. These grids are then truncated in their negative vertical extent. This is done to reduce the effect of another ssplash issue - the fact that the interpolation produces errors at the -z boundary of the grid (See a previous issue listed in this Wiki).

There are also issues with the vector fields produced by interpolation of Phantom data onto cylindrical grids. You can check this using the codes supplied by me to Daniel Price.

Reproducing this issue
I have given Daniel Craig a thumbdrive with an archive of the data and codes necessary to reproduce this error I attach below the README.TXT file from this archive:

README.TXT

@GeoffBryan GeoffBryan changed the title ISSUE: SPLASH_TO_GRID in Cylindrical coordinates - Incorrect densities and velocities near leftmost (angular boundary) boundary Bug: splash_to_grid in Cylindrical coordinates - Incorrect densities and velocities near leftmost (angular boundary) boundary Dec 6, 2019
@danieljprice
Copy link
Owner

can you confirm that you specified SPLASH_TO_GRID_PERIODIC=no,yes,no to enforce periodicity on the phi boundary? (because this is NOT automatic)

@GeoffBryan
Copy link
Author

Hi Daniel, Sorry that I referred to you as Daniel Craig above! By default I do not specify the second coordinate cyclic. I have done so in the past and it made no difference. My script has an argument to do so So after lunch I will get back to you with the result. Cheers, Geoff

@GeoffBryan
Copy link
Author

Hi Daniel,
I've plotted out the results with the SPLASH_TO_GRID_PERIODIC=no,yes,no on and the results are much better. For the medium sized grid the results look like this:

vector_000
vector_002

So while not identical they are much closer than if the cyclic boundary condition is not turned on:
vector_000
vector_002

The 2d-stream line plots for \theta = -pi and \theta =pi are also much more alike:

stream_01

stream_03

So I think you can mark this issue resolved - though you probably need a note in the documentation to remind people to turn the SPLASH_TO_GRID_PERIODIC=no,yes,no on.

This still leaves the -z boundary issue open.

Thanks again for your help - speak to you in the New Year!

@GeoffBryan GeoffBryan changed the title Bug: splash_to_grid in Cylindrical coordinates - Incorrect densities and velocities near leftmost (angular boundary) boundary bug: splash_to_grid in Cylindrical coordinates - Incorrect densities and velocities near leftmost (angular boundary) boundary Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants