[FLASH-USERS] Novice FLASH3 questions

Klaus Weide klaus at flash.uchicago.edu
Tue May 26 10:51:40 EDT 2009


On Mon, 25 May 2009, Andrew Szymkowiak wrote:

> I am working on constructing a new problem setup.  For my problem I will need
> to supply (time-variable) boundary conditions, including magnetic fields.
> I am a big fan of starting with a (working) example, and modifying it.  So
> I've been working through the included demos, 

Andrew,

That's a good use of the included examples. :)

> and have not found quite enough of relevance.
>
> Here are a list of questions/comments I've generated - I'd appreciate any
> feedback any gurus wish to contribute...
> 
> (1) Does anyone have a setup along the lines I've mentioned that they are
> willing to let me see?
> 
> WindTunnel is the only demo I'm finding w/ its own boundary condition
> routines:
> 
> (2) am I correct that the user_bnd.F90 routine is not used in FLASH3? (I
> suspect that this may be a FLASH2 remnant, and perhaps should be removed from
> the distribution, as it is potentially confusing for the newbies).

That is corrrect, user_bnd.F90 is an unused remnant.  I agree it should be 
removed.
  
> (3) The BC routine in the WindTunnel sim is Grid_applyBCEdge.F90. It
> explicitly errors out if called with a face variable, and I'm relatively sure
> I need to able to set face variables in order to insert magnetic fields at the
> boundaries. Am I correct that I should probably do my setup with a custom
> Grid_bcApplyToRegion.F90 (or Grid_bcApplyToRegionSpecialized.F90)?

Whether you can use the one-row routine, Grid_applyBCEdge.F90, or need to 
use one of the more general routines, depends on the inputs that your BC 
implementation needs.  In principle the Grid_applyBCEdge.F90 interface can 
be used for face variables as well as for cell-centered variables; see
the default version Grid/GridBoundaryConditions/OneRow/Grid_applyBCEdge.F90 
which is meant for FACE{X,Y,Z} as well as CENTER, for the simple BC types
REFLECTING, OUTFLOW, DIODE.  Note that (assuming NGUARD=4) 
Grid_applyBCEdge.F90 may act on vectors of length 9 instead of 8, in the
face var case.

In general the Grid_bcApplyToRegion{,Specialized}.F90 interfaces should be
preferrable, you just have to implement additional outer loops and figure
out the cell indexing from the arguments.

> (4) I'm examining CurrentSheet which has an example of establishing
> divergenceless conditions in the initBlock routine - are there any obvious
> gotchas as I'm going to try to implement similar conditions in the guard cells
> in the Grid_bcApplyToRegion routine?

(Of course CurrentSheet itself has periodic BCs, so Grid_bcApplyToRegion 
etc. don't come into play at all.)

Maybe someone with more knowledge of details of the MHD simulations can 
help more here.

Klaus



More information about the flash-users mailing list