<div dir="ltr">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:<div>
<br></div><div>v_r = v_x (x/r) e_x + v_y (y/r) e_y + v_z (z/r) e_z</div><div><br></div><div>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.</div>
<div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 7, 2014 at 3:16 PM, Melinda Soares-Furtado <span dir="ltr"><<a href="mailto:msoares.physics@gmail.com" target="_blank">msoares.physics@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This is great. Now I just need to figure out how to get the total velocity normal to the surface. </div>
<div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div><font face="georgia, serif">Regards,</font></div>
<font face="georgia, serif">Melinda Soares-Furtado</font><div><font face="georgia, serif"><a href="mailto:msoares@princeton.edu" target="_blank">msoares@princeton.edu</a><br></font><div></div></div><div><font face="georgia, serif"><a href="http://cargo.ucsc.edu/msoares" target="_blank">http://cargo.ucsc.edu/msoares</a></font></div>

<div><div><div><font face="georgia, serif"><a href="tel:415-860-0438" value="+14158600438" target="_blank">415-860-0438</a></font><br><br></div></div></div></div></div><div><div class="h5">
<br><br><div class="gmail_quote">On Thu, Jul 3, 2014 at 7:00 PM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">Hi Melinda,<div><br></div><div>I believe you'll be able to construct that by extracting the x,y,z velocity fields and Density fields from the surface object:</div><div><br></div><div>vx, vy, vz = surf['x-velocity'], surf['y-velocity'], surf['z-velocity']</div>



<div>dens = surf['Density']</div><div><br></div><div>These will be four flat numpy arrays which correspond to the values of the velocity and density fields at the surface boundary.</div><div><br></div><div>Hope that helps,</div>



<div><br></div><div>Nathan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Thu, Jul 3, 2014 at 2:19 PM, Melinda Soares-Furtado <span dir="ltr"><<a href="mailto:msoares.physics@gmail.com" target="_blank">msoares.physics@gmail.com</a>></span> wrote:<br>



</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><span style="font-size:13.333333969116211px;font-family:arial,sans-serif">Hello, folks. I have a code that is computing the flux across a sphere of a given radius, as shown below</span><span style="font-size:13.333333969116211px;font-family:arial,sans-serif">. 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.</span><div style="font-size:13.333333969116211px;font-family:arial,sans-serif">




<br></div><div style="font-size:13.333333969116211px;font-family:arial,sans-serif">Does anyone know of a simple way to read out flux for a given velocity (normal to the surface) rather than the summed total? </div><div style="font-size:13.333333969116211px;font-family:arial,sans-serif">




<br></div><div style="font-size:13.333333969116211px;font-family:arial,sans-serif">Code:</div><div style="font-size:13.333333969116211px;font-family:arial,sans-serif"><pre style="margin-top:0px;margin-bottom:0px;padding:5px 0px;font-family:'Bitstream Vera Sans Mono',monospace;font-size:13px;color:rgb(0,0,0)">

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</pre><pre style="margin-top:0px;margin-bottom:0px;padding:5px 0px;font-family:'Bitstream Vera Sans Mono',monospace;font-size:13px;color:rgb(0,0,0)"><br></pre></div><div><div dir="ltr"><div><font face="georgia, serif">Regards,</font></div>




<font face="georgia, serif">Melinda Soares-Furtado</font></div></div>
</div>
<br></div></div>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Michael Zingale</div><div>Associate Professor</div><div><br></div><div>Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800</div>
<div><i>phone</i>:  631-632-8225</div><div><i>e-mail</i>: <a href="mailto:Michael.Zingale@stonybrook.edu" target="_blank">Michael.Zingale@stonybrook.edu</a></div><div><i>web</i>: <a href="http://www.astro.sunysb.edu/mzingale" target="_blank">http://www.astro.sunysb.edu/mzingale</a></div>

</div>