[FLASH-BUGS] Hydrodynamics PPM solver in non-Cartesian geometries

stnv005 at hs.uni-hamburg.de stnv005 at hs.uni-hamburg.de
Mon Jul 23 06:26:58 CDT 2018


Dear FLASH Code developers,

this is about the hydrodynamics PPM solver in FLASH version 4.5, but might
apply to previous versions as well (I haven’t checked).

If I’m not mistaken, the solver supports non-Cartesian geometries. In the
routine hy_ppm_sweep (lines 360 and following in hy_ppm_sweep.F90, I
copied and pasted the lines below) velocities in dimensions that are not
simulated are set to zero, for example velocities in the second and third
dimension in 1D simulations:

if (hy_cvisc .ne. 0.0) then !! zero all velocities in transverse directions
  if (NDIM == 1) then
    solnData(VELY_VAR:VELZ_VAR,:,:,:)=0.0
  else if (NDIM == 2) then
    solnData(VELZ_VAR,:,:,:) = 0.0
  end if
else   !! zero velocities in transverse directions on guardcells
  if (NDIM == 1) then
    do k = blkLimitsGC(LOW,KAXIS),blkLimitsGC(HIGH,KAXIS)
      do j = blkLimitsGC(LOW,JAXIS),blkLimitsGC(HIGH,JAXIS)
        do i = blkLimitsGC(LOW,IAXIS),blkLimitsGC(HIGH,IAXIS)
          if(isGc(i,j,k))solnData(VELY_VAR:VELZ_VAR,i,j,k)=0.0
        end do
      end do
    end do
  else if (NDIM == 2) then
    do k = blkLimitsGC(LOW,KAXIS),blkLimitsGC(HIGH,KAXIS)
      do j = blkLimitsGC(LOW,JAXIS),blkLimitsGC(HIGH,JAXIS)
        do i = blkLimitsGC(LOW,IAXIS),blkLimitsGC(HIGH,IAXIS)
          if(isGc(i,j,k))solnData(VELZ_VAR,i,j,k)=0.0
        end do
      end do
    end do
  end if
end if

To me this seems to be correct in Cartesian geometries. However, for
instance in 1D or 2D cylindrical geometries the azimuthal velocity
(velocity in the third dimension) should not be set to zero, because it
contributes to the radial velocity (velocity in the first dimension) via
the centrifugal force term (the force is correctly calculated in the
routine hy_ppm_force).

Am I correct or am I missing something here? I’m not sure this actually is
a bug, because in that case I think somebody else would have noted it by
now.

Best regards,

Urs Schäfer
Hamburger Sternwarte
Universität Hamburg
Gojenbergsweg 112
21029 Hamburg



More information about the flash-bugs mailing list