jdonnert / WVTICs

SPH initial conditions using Weighted Voronoi Tesselations
MIT License
8 stars 4 forks source link

Fix Gresho Phi #17

Closed elehcim closed 3 years ago

elehcim commented 3 years ago

I noticed some inconsistencies in the gresho vortex. Ultimately, they were due to the phi computation. Gresho_old Gresho_fixed

To obtain the figures:

import pynbody
import numpy as np
import matplotlib.pyplot as plt

fig, ax = plt.subplots()
v = pynbody.load('IC_Gresho_fixed')
pynbody.plot.sph.velocity_image(v, width=2, subplot=ax,
                                vmin=0, vmax=1, log=False,
                                quiverkey=False)
ax.set_title('Gresho fixed')
ax.set_xlim(0,1)
ax.set_ylim(0,1)
fig.savefig('Gresho_fixed.png',bbox_inches='tight')

fig, ax = plt.subplots()
v = pynbody.load('IC_Gresho_old')
pynbody.plot.sph.velocity_image(v, width=2, subplot=ax,
                                vmin=0, vmax=1, log=False,
                                quiverkey=False)
ax.set_title('Gresho old')
ax.set_xlim(0,1)
ax.set_ylim(0,1)
fig.savefig('Gresho old.png',bbox_inches='tight')
jdonnert commented 3 years ago

@YominCarr this looks good to me. I am merging it.