[yt-users] Flux Across Surfaces

Matthew Turk matthewturk at gmail.com
Wed Jul 30 14:59:25 PDT 2014


Hi Melinda,

(As a quick note, we have test coverage for a few cases like this, but
non-spherical.  The rest of my email assumes that the flux calculation
is working as desired, but I can also attempt to set up a simple
problem to demonstrate this from first principles, which I will put on
my todo list.)

I can think of a few things that might be going on.  The first is that
the flux is typically computed using tri-linear interpolation, as well
as a dot product.  This will interpolate to the barycenter of the
triangles found through the marching cubes algorithm the velocity and
density.  Increasing the refinement will increase this value, but
we're still both approximating the sphere surface as a set of
triangles, as well as taking the interpolated velocities and
multiplying them by the area.  So the weak points:

 * Interpolation
 * Dot product of interpolated values
 * Approximating surface

One possible thing to try would be to examine the flux of "ones"
across the surface, where the fluxing field is defined radially
outward.  This would then give the total surface area.  So, we'd
create three new derived fields:

@derived_field(name="rad_x_vec")
def rad_x_vec(field, data):
    center = data.get_field_parameter("center")
    return data["x"] - center[0]

@derived_field(name="rad_y_vec")
def rad_y_vec(field, data):
    center = data.get_field_parameter("center")
    return data["y"] - center[1]

@derived_field(name="rad_z_vec")
def rad_z_vec(field, data):
    center = data.get_field_parameter("center")
    return data["z"] - center[2]

Then you can use "rad_x_vec", "rad_y_vec", "rad_z_vec" as the vector
fields, which should point radially outward, and the "ones" field as
the fluxing field.  This should return to you the total surface area,
which you can then compare against 4/3 pi r**3, and see the total
difference between the two.  That will at least indicate how different
they are, and provide a semblance of a normalization?

-Matt

On Mon, Jul 28, 2014 at 5:13 PM, Melinda Soares-Furtado
<msoares.physics at gmail.com> wrote:
> I have used yt to determine the flux calculation for a region surrounding a
> single star with a given mass loss rate. This region is right outside the
> stellar radius (see attached). Comparing the flux calculation to the known
> mass loss rate, I see that not all of the mass is accounted for and, what's
> more, improved refinement of the simulation enhances this percentage,
> however it is still below 70%. I need to calculate the flux for a region
> surrounding a large group of stars, so simply increasing the refinement is
> really not an option. Any suggestions as to how I can use yt for my flux
> diagnostics in a manner that is more accurate?
>
> Best,
> Melinda
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>



More information about the yt-users mailing list