[yt-users] cell volume for 2d cylindrical FLASH data

Matthew Turk matthewturk at gmail.com
Sat Sep 15 04:15:10 PDT 2012


Hi Suoqing,

Yes, this is the case -- as a bit of background, in the 2.x series, yt
only formally supports cartesian coordinates.  In the 3.0 series,
which is still under heavy development, we will be supporting generic
coordinate systems.  Anthony Scopatz, John ZuHone and I added support
for cylindrical (rz) and polar (rt) coordinates recently.

While adding cylindrical coordinates had some challenges, the point
you bring up is one of the easier ones to solve, albeit in a limited
fashion.  To fix the specific field CellVolume, you can add a new
field called CellVolume to your parameter file once it has loaded:

def CylCellVolume(field, data):
    data["x"] ...
pf.add_field("CellVolume", function=CylCellVolume)

Note that there may still be other assumptions of cartesian values,
although none are immediately coming to mind.  In the new branch, we
also change the coordinates to r, theta so as to reduce confusion and
ensure that the correct values are being used and calculated.  For
visualization, I believe everything should work properly as is.  The
item you note about summation of volume (and also mass, since that is
defined by density * volume) weighted quantities is a good one, and I
appreciate you bringing it up.  I believe this should address that
issue.

If you want to follow along about the development of 3.0, which will
include this as well as a number of other things (but which will not
be ready for some time!) you can subscribe to yt-dev, where it gets
discussed regularly.  The most recent discussion was from Anthony, who
recently developed a cylindrical ray tracing technique.

-Matt

On Fri, Sep 14, 2012 at 4:51 PM, Ji Suoqing <jisuoqing at gmail.com> wrote:
> Hi all,
>
> I've just found something confusing when dealing with 2d cylindrical data: the CellVolume is defined as cartesian form instead of cylindrical form. In FLASH, the cell volume for 2d cylindrical is defined as:
>
> r * dr * dz * 2pi
>
> While in YT, all the cell volumes have the same value. Although it's not difficult to define our own cell volume by ourselves, I just wonder this might lead to problems when calculating other quantities, such as any summation of volume-average quantities.
>
> Best wishes,
> Suoqing
> _______________________________________________
> 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