[FLASH-USERS] MAG_FACE_VAR and MAGI_FACE_VAR

dongwook at flash.uchicago.edu dongwook at flash.uchicago.edu
Wed Feb 8 15:35:18 EST 2012


Dear Nathan,

As you pointed out, there are two face variables MAG_FACE_VAR and
MAGI_FACE_VAR.
The first one (MAG_*) is the primary face variables that store magnetic
fields at the cell interfaces,
and the MAGI_* is the secondary (derived) one ("I" for the intermediate).

One difference between them is that MAG_ stores Bx,By,Bz at "n" states,
whereas MAGI_ stores Bx,By,Bz at "n+1/2" states.

So when you initialize face variables, you don't need to worry about
initializing MAGI_ variable, and only need to initialize MAG_ variable in
Simulation_initBlock.F90.

Once you initialize MAG_ variable MAGI_ will then store face variables at
the half time step (n+1/2) that are evolved from the initialized MAG_
variable at n time step. This is done in hy_uhd_staggeredDivb.F90 routine.

As MAGI_ will hold the derived secondary face variables, it won't harm to
initialize them in
Simulation_initBlock.F90 routine (as is done in BlastBS). MAGI_ will just
be recalculated anyway.

There is one case you want to take care of MAGI_ variable. In case you
need a customized boundary condition for your simulation, you then need to
apply the same boundary condition to MAGI_ variable as well. But if you
just want to use those boundary conditions that FLASH supports already,
you don't need to do anything for MAGI_ either.

In summary, you only need to initialize MAG_ but not MAGI_. And apply your
own use boundary condition to both MAG_ and MAGI_ variables.

Hope this helps,
Dongwook

=========================================
Dongwook Lee, Ph.D., Research Scientist
FLASH Center for Computational Science
University of Chicago
5747 S. Ellis Ave., Room 319
(773) 834-6830

> Hello all,
>
> I'm currently in the middle of porting a problem to use the unsplit
> staggered mesh MHD solver included with the newest release of FLASH.
> However, I'm unsure how to correctly the face[x,y,z] arrays in
> Simulation_initBlock.F90.  In Flash.h there are two preprocessor macros to
> index the first dimension of the array, MAG_FACE_VAR and MAGI_FACE_VAR.
> Some of the example initBlock routines (e.g. OrszagTang) in the magnetoHD
> directory only set MAG_FACE_VAR, leaving the MAGI_FACE_VAR entries zero.
> Others (e.g. BlastBS) set both the MAG_FACE_VAR and MAGI_FACE_VAR entries.
>
> I'm curious why there are two face variables - and what the difference is.
>  I'm also curious whether I should set one or both when I set up my
> problem.
>
> Thanks very much for your help with this!
>
> Best,
>
> Nathan Goldbaum
> Graduate Student
> Astronomy & Astrophysics, UCSC
> goldbaum at ucolick.org
> http://www.ucolick.org/~goldbaum
>




More information about the flash-users mailing list