[FLASH-USERS] Elongated Box with Pfft Hybrid Multigrid Solver (fwd)

Klaus Weide klaus at flash.uchicago.edu
Fri Jun 17 17:33:21 EDT 2016


Here a message (slightly shortened) I wrote recently in response to a 
question about using mixed boundary conditions with the Hybrid multigrid 
solver in FLASH:

---------- Forwarded message ----------
Date: Tue, 7 Jun 2016 14:54:03 -0500 (CDT)
From: Klaus Weide <klaus at flash.uchicago.edu>
To: ***
Subject: Re: Elongated Box with Pfft Hybrid Multigrid Solver

On Mon, 6 Jun 2016, *** wrote:
> [Question about using the Hybrid Multigrid solver for self-gravity for
> an elongated box: periodic BCs in x and y and outflox BCs in z]
>
> Is it possible to use the Hybrid Multigrid Poisson solver for this
> geometry? Is it necessary to use different boundary conditions?

Hello,

The elongated shape of your domain should not be a problem for FLASH
at all; there is more of a problem regarding the boundary conditions.

First, if you haven't already done so, I would recommend you look at 
older flash-users messages about Gravity boundary conditions and the 
Multigrid solver. A (Google) search like this may be helpful:

  flash-users boundary condition multigrid site:flash.uchicago.edu

I think you will likely find some useful information (in addition to 
what's in the Users Guide). It's just not all collected in one place...

Regarding your attempt to use a

    periodic x periodic x outflow  BC

for self-gravity - I wonder how you went about this.  There is no way
in the released code to specify a "mixed" boundary for gravity, at least
when using the multigrid Poisson solver; the only available runtime
parameter for specifying a gravity BC is: (source/physics/Gravity/Config)

D grav_boundary_type Type of gravitational boundary condition if a Poisson solve
D           &        is used for Gravity; string-valued version of grav_boundary.
D           &        Accepts:
D           &        "isolated", "periodic", "dirichlet", and maybe others,
D           &        depending on the Poisson solver used.
D           &        This is declared in the stub level of the Gravity unit
D           &        to allow the Grid unit to refer to this runtime parameter
D           &        even when no Gravity implementation is included.
PARAMETER grav_boundary_type STRING "isolated"

(and source/physics/Gravity/GravityMain/Poisson/Multigrid/Gravity_init.F90)
only accepts "isolated" and "periodic".)

Since you want an "outflow" Grid BC in the z-direction, you MUST also use
a non-periodic BC for the Poisson solver. (I believe you will find this
discussed in some of those older flash-users messages.) Yet there is no
way, with the currently available runtime parameters, to request a

    periodic x periodic x non-periodic  BC

when using Gravity/GravityMain/Poisson/Multigrid. So it is currently
not possible to do this correctly with FLASH, unless you are willing
to change it (and ideally contribute your changes back to the FLASH
community!)

That was the bad news. However, I believe that
 * the lower levels - i.e., the actual implementation of the hybrid
   Multigrid Poisson solver under source/Grid/GridSolvers -
   either already support some form of mixed outer boundaries,
   or can be easily be made to support them.  In part this may be
   just a matter of passing the desired bcTypes properly along to
   called routines and of removing unnecessary restrictions.
 * At the level of Gravity_potentialListAllBlocks, there is already
   a mechanism for choosing "mixed" BCs in the BHTree implementation,
   which could be used as a template for the Multigrid case.

Let me know if you are interested in this and would like some
further pointers.

Two other notes:

1)
For the *hybrid* multigrid, there are also the runtime parameters
  xl_mg_boundary_type, etc.,
declared in
  source/Grid/GridSolvers//Multigrid/PfftTopLevelSolve/Config .

They should (HAVE TO?) be set to be consistent with the gravity
boundary conditions (or, in general, Poisson solver boundary
conditions) chosen in some other way. However, I don't think they can
be used to specify the overall boundary conditions for the Poisson
problem. They only are meant to apply to the coarsest-level multigrid
solve where PFFT is used.
 
2) You have to decide what Gravity BC you actually want to apply to the
z-direction. "outflow" is not a choice. "isolated" may be difficult
to combine with periodic BCs in other directions, I think. Easiest
would be (homogeneous) "dirichlet" if that is acceptable, equivalent
to fixing the grav. potential to be = 0 on the high-z and low-z
boundaries.

...



More information about the flash-users mailing list