[yt-users] Flux through spherical surfaces

Morgan MacLeod morganmacleod at gmail.com
Thu Oct 24 07:03:36 PDT 2013


Dear all,

I am hoping to calculate the flux of mass ("mdot") and angular momentum
("Ldot") through a series of concentric spherical surfaces in a simulation
snapshot (centered around an absorbing "sink" within the grid).

So far, I've attempted this along these lines:

pf = load(fn) # load data
rad = 0.1
sp = pf.h.sphere([0,0,0],1.1*rad)
surf = pf.h.surface(sp,"Radius",rad)
flux = surf.calculate_flux("x-velocity","y-velocity","z-velocity","Density")

where flux gets assigned to the  mass accretion rate in this case. I
believe I could do the angular momentum by calculating the flux of a
derived variable  that is defined as
data["SpecificAngularMomentumZ"] * data["Density"]
such that the resulting units are angular momentum per volume.

I was wondering if there is a better way to go about this calculation, it
seems that others must have tried to look at similar questions. In
particular, defining an "isoradius" surface seems to accomplish what I was
hoping to do, but there must be a cleaner way.

Thanks so much for your advice,

Morgan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20131024/6c5d7a54/attachment.htm>


More information about the yt-users mailing list