Hi all, I'm trying to use "gas", "radial velocity" to compare inflows and outflows in a simulation, but the results don't really look right.
using radial_velocity as a binary field, I defined new fields as follows
def inflow_density(field,data):
tr = data['gas','density']*((data['gas','radial_velocity'])<0).astype(float)
return tr
def outflow_density(field,data):
tr = data['gas','density']*((data['gas','radial_velocity'])>0).astype(float)
return tr
A ProjectionPlot gives one side which is all inflow, one side which is all outflow. This resembles what you get if you have an incorrect bulk_velocity field, but when I correct for it like this
sp = ds.sphere(center, (Rvir, "kpc"))
bulk_velocity = sp.quantities.bulk_velocity()
plot = yt.ProjectionPlot(ds, 0, center=center, fields=('gas','inflow_density'), width = (w,"kpc"), field_parameters={'bulk_velocity':bulk_velocity})
it doesn't change at all. Am I using this right?
Thanks,
Clayton