[yt-users] AMR iscontour flux units

Nathan Goldbaum nathan12343 at gmail.com
Thu Feb 6 16:11:01 PST 2014


I think I know how to handle this.  As usual, I figured out the issue
five minutes after hitting the 'send' button....

It doesn't matter that the resolution changes, since the conversion
from code unit area to CGS area is constant across AMR levels.

Here is a script snippet that converts a radial mass flux into solar
masses per year:

mass_sun = 1.9891e33
year = 3.15569e7
kpc = 3.08567758e21

iso = pf.h.surface(dd, 'Radius', 5*kpc)
flux = iso.calculate_flux('x-velocity', 'y-velocity', 'z-velocity', 'Density')
flux_msun_year = flux/msun*year*pf['Length']**2

Hope that's helpful for future isocontouring adventures :)

-Nathan

On Thu, Feb 6, 2014 at 4:01 PM, Nathan Goldbaum <nathan12343 at gmail.com> wrote:
> Hi all,
>
> I have a question about the calculate_flux function defined for
> AMRSurface objects.
>
> The docstrings for calculate_flux note that the returned fluxes are
> the code unit area multiplied by the local flux density.
>
> I'm curious what this means for AMR simulations, where the 'area' will
> depend on the local resolution.  Does the fluxing calculation account
> for that?  What about isocontours that cross level boundaries?
>
> Thanks for your advice,
>
> Nathan



More information about the yt-users mailing list