[FLASH-USERS] Periodic boundary conditions for diffusion/conduction
Klaus Weide
klaus at flash.uchicago.edu
Mon Oct 12 22:17:00 EDT 2015
On Mon, 12 Oct 2015, Attal, Nitesh wrote:
> Hello,
>
> I tried using periodic BC (in y-direction) for a 2D thermal conduction
> problem (Temperature gradient was imposed only in x-direction). I found
> that the temperature at the y-boundary drops rapidly even though there is
> no gradient present.
> I tracked down the routine (gr_hypreApplyBcToFace) responsible for applying
> the BC for HYPRE matrix. Here appropriate modification to the Bmatrix is
> made to implement Dirichlet, Vacuum and other BC.
>
> I was wondering if there could be a quick-fix to get the wraparound
> solution variables to modify Bmatrix, i.e. a way to access appropriate
> neighbors (blocks) that contain the periodic BC.
The routine gr_hypreApplyBcToFace, called from gr_hypreCreateMatrix,
shouldn't really have anything to do for a periodic boundary. All the work
of coupling neigboring cells with each other should have happened earlier
in gr_hypreCreateMatrix.
Maybe all it takes to get this right is making HYPRE aware of the
perodicity of the index space? And maybe all THAT takes is calling
HYPRE_SStructGridSetPeriodic with the appropriate arguments, for each
direction that has periodic boundaries? This is at this point a completely
untested hypothesis.
If someone wants to experiment with it:
* Look at comments re SetPeriodic in source files like
hypre-2.10.0b/src/sstruct_mv/HYPRE_sstruct_mv.h
hypre-2.10.0b/src/sstruct_mv/F90_HYPRE_sstruct_grid.c
* Better, see what the HYPRE documentation has to say about
HYPRE_SStructGridSetPeriodic! (I haven't checked.)
* Calls should probably go into
gr_hypreSetupGrid.F90 .
* Initial testing should be done with the uniform grid (UG),
since AMR may, and probably will, add additional complications.
Klaus
More information about the flash-users
mailing list