[yt-users] Mass Flux Across Surface Binned By Velocity

Michael Zingale michael.zingale at stonybrook.edu
Mon Jul 7 12:42:00 PDT 2014


If you are ok with using the normal of the cell-center of the zone instead
of reconstructing how the surface cuts through a zone and computing the
normal to that surface (which seems a bit like a level-set technique),
then, taking the origin at 0,0,0, the normal velocity is just the radial
velocity:

v_r = v_x (x/r) e_x + v_y (y/r) e_y + v_z (z/r) e_z

where e_i is the unit vector in the respective Cartesian direction x,y,z
are the Cartesian coordinates (with respect to the center) and r is the
radial distance.




On Mon, Jul 7, 2014 at 3:16 PM, Melinda Soares-Furtado <
msoares.physics at gmail.com> wrote:

> This is great. Now I just need to figure out how to get the total velocity
> normal to the surface.
>
> Regards,
> Melinda Soares-Furtado
> msoares at princeton.edu
> http://cargo.ucsc.edu/msoares
> 415-860-0438
>
>
>
> On Thu, Jul 3, 2014 at 7:00 PM, Nathan Goldbaum <nathan12343 at gmail.com>
> wrote:
>
>> Hi Melinda,
>>
>> I believe you'll be able to construct that by extracting the x,y,z
>> velocity fields and Density fields from the surface object:
>>
>> vx, vy, vz = surf['x-velocity'], surf['y-velocity'], surf['z-velocity']
>> dens = surf['Density']
>>
>> These will be four flat numpy arrays which correspond to the values of
>> the velocity and density fields at the surface boundary.
>>
>> Hope that helps,
>>
>> Nathan
>>
>>
>> On Thu, Jul 3, 2014 at 2:19 PM, Melinda Soares-Furtado <
>> msoares.physics at gmail.com> wrote:
>>
>>> Hello, folks. I have a code that is computing the flux across a sphere
>>> of a given radius, as shown below. This code provides me with the
>>> summed flux across the surface, however what I am hoping to do is to bin
>>> this flux up into various velocities ranging from v_min to v_max. Thus,
>>> determine the mass flux across the surface for a chosen velocity bin.
>>>
>>> Does anyone know of a simple way to read out flux for a given velocity
>>> (normal to the surface) rather than the summed total?
>>>
>>> Code:
>>>
>>>
>>> from yt.mods import *
>>> pf=load("/trove/msoares/50Stars_LRefine5_Derefine0.05_velocity/50Stars_hdf5_plt_cnt_0200")
>>> rad=0.1/pf['pc']
>>> sp = pf.h.sphere([0,0,0],2.0*rad)
>>> surf = pf.h.surface(sp,"Radius",rad)
>>> flux = surf.calculate_flux("x-velocity","y-velocity","z-velocity","Density")
>>> print flux
>>>
>>>
>>> Regards,
>>> Melinda Soares-Furtado
>>>
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>>>
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>


-- 
Michael Zingale
Associate Professor

Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY
11794-3800
*phone*:  631-632-8225
*e-mail*: Michael.Zingale at stonybrook.edu
*web*: http://www.astro.sunysb.edu/mzingale
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140707/6fb4f9cd/attachment.htm>


More information about the yt-users mailing list