On Wed, Jan 15, 2020 at 4:21 AM Pavel Aleynikov <pavel.aleyni...@ipp.mpg.de> wrote: > > Hi, > > How are "mesh.cellVolumes" defined in fp.CylindricalGrid1D case? > The surface of a circle grid is not equal pi*r^2. > > import fipy as fp > L = 1.; nx = 1000 > mesh = fp.CylindricalGrid1D(dx=L/nx, nx=nx) > print(mesh.cellVolumes.sum()) > >> 0.5 > > Why not pi?
I'm not sure. It's an arbitrary choice though. The angle was chosen as "1" rather than "2 * pi". The volume of an element is "theta * r * dr" where "theta" is the angle, "r" are the cell centers and "dr" is the cell spacing. It's possible that by choosing "theta=1", then the "theta" can be omitted saving an extra operation. > How should I integrate Variables on such a grid? > (2*pi*Var*mesh.cellVolumes).sum()? Makes sense. Argulably, these quantities should be calculated in some sort of ratio so the absolute value of the volume won't matter. -- Daniel Wheeler _______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]