[FLASH-USERS] MAG_FACE_VAR and MAGI_FACE_VAR

dongwook at flash.uchicago.edu dongwook at flash.uchicago.edu
Thu Feb 9 14:44:35 EST 2012


Hi Seyit,

In general, it's fair to say that it is important to initialize BOTH
(cell-centered & cell interface-centered) correctly in
Simulation_initBlock.F90.

But if you want to pay more attention to only one of them, it should be
MAG_FACE_VAR and this is what you can do:

(1) initialize your MAG_FACE_VAR
(2) take an average of the face variables to initialize cell-centered fields.

An example is in

  soure/Simulation/SimulationMain/magnetoHD/FieldLoop

And it is very important to initialize MAG_FACE_VAR in order to keep
divB=0 on the staggered grid (also an example using magnetic vector
potential is in the FieldLoop directory).

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

> Hi,
>
> You can also update the cell-centered magnetic field strengths, see
> below. Am I right in saying that it is more important to write the
> correct face centered values (MAG_FACE_VAR), as the cell-centered values
> get updatde from them?
>
> magx(i) = some value
> call Grid_putRowData(blockID, CENTER, MAGX_VAR, EXTERIOR, &
>               IAXIS, startingPos, magx, sizeX)
>
>
> Seyit
>
>
>
> On 02/08/2012 09:35 PM, dongwook at flash.uchicago.edu wrote:
>> 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