Version 11 (modified by 13 years ago) ( diff ) | ,
---|
New Users Page
Hi and welcome to the New Users club— the best on campus!
Here you can find material on stuff we cover in our weekly meetings, or other interesting information about the AstroBEAR code.
SPECIAL TOPICS
Effectively Implementing AMR
There are some additional controls for AMR other than setting the number of levels in global.data. One can also make use of the namelist variable in physics.data named "refineVariableFactor". If this is not currently in your physics.data file, you can add it under the line for InterpOpts. The input for this variable represents the different q array elements (rho, px, py, pz, E, Bx, By, Bz, tracer1, tracer2, …, tracerM).
Example:
refineVariableFactor = 1.d-21,0d0,0d0,0d0,0d0,0d0,0d0,0d0,0d0,0d0,0d0,0d0,0d0
The input here controls the variable to which refinement is triggered. By setting a slot = 0 means that refinement will not be triggered for this variable. The smaller the number, the less the refinement. The max value for input to this array is 1, and if this line is not included in your physics.data, all the vector components will be initialized to 1. That is, refinement will occur for gradients in any of the flow variables, and hence, you can focus refinement to certain variables by setting others to zero.
This control refineVariable works with other controls in physics.data for controlling AMR: 1. qTolerance and 2. fillingRatios. Essentially, qTolerance defines how sensitive the code is to gradients, whereas filling ratios tell the code the degree to which new grids should contain areas of refinement. Small values of qtolerance lead to increased refinement and small values for fill ratios leads to smaller regions within sub grids that are to be refined. The input to each of these arrays DOES NOT represent the flow variables. Instead they are linked to the different levels - 0, 1, 2,.., n. It is important to learn how each of these variables work together.
For instance, refineVariableFactor is called in module_control.f90, in the subroutine SetErrFlag, which cycles over the cells and looks for gradients in each of the flow variables. If the gradient exceeds some threshold, refinement is triggered. However, there is a section of the module which takes qTolerance/refineVariable. If, these two values are equal — there will be no change to the refinement criterion. Note, too, that refineVariable must not equal zero, else there will be a divide by zero. So you can take refineVariable close to zero, just never equal to zero.
Additionally, one can modify the SetErrFlags subroutine in problem.f90 to indicate precise regions of refinement.
Example:
Here, I am asking astrobear to refine within a sphere of r = clump_rad*0.1, where clump_rad is a module specific parameter. Now, all of the refinement will be restricted to this smaller region. This means, less cells, and less computational cost. (A nice reference on cost is here: Tutorials/JobSizes).
Some tests on these things can be found in Erica's blog, titled: AMR control.
Helpful Links
http://www.mpia.de/homes/dullemon/lectures/fluiddynamics/Chapter_5.pdf - Nicely composed introduction chapter on numerical hydrodynamics.
Attachments (7)
-
BEModwithoutobjects-1.pdf
(59.2 KB
) - added by 14 years ago.
My simple BE module for a sample on module writing
-
sampleoutfile.out.pdf
(814.4 KB
) - added by 14 years ago.
a sample outfile.out
- index.jpeg (6.7 KB ) - added by 13 years ago.
- 1.jpg (50.3 KB ) - added by 13 years ago.
- subroutine.png (19.8 KB ) - added by 13 years ago.
- page1.png (4.0 MB ) - added by 13 years ago.
- page2.png (4.6 MB ) - added by 13 years ago.