Version 20 (modified by 12 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
Forming Sinks
The first step in forming a sink particle is — a cell somewhere in the grid must exceed the density threshold given by the code. Currently, Astrobear implements a density threshold that is the Truelove criterion.
So say you have a situation like that drawn below:
Astrobear then progresses through the checking for new sink particles routine, located in the particle directory in the file called particle_info_ops.f90
. The subroutine is called CheckForNewParticle(Info). Essentially, this subroutine goes through a series of checks that ensures the conditions are suitable for sink particle formation. After the grid has been swept and a cell has been detected that violates the Truelove criteria then a control region, 4 cells in radius centered on the zone in question, is evaluated for the following:
- Is this flow converging?
- Is this cell a potential minima within a radius of 4dx?
- Is the surrounding region Jean's unstable?
- Is this region gravitationally bound?
- Is this cell within a small enough proximity to an already formed sink?
A sink will form only if all of these conditions are satisfied.
Now, sometimes insufficient resolution can impede the formation of sinks. If you have a zone that has exceeded the density threshold, you may work through some algebra to show the size of dx that is required for collapse. Also, there are a series of print statements in the subroutine mentioned above that you can uncomment. This will show you what has passed and what has not.
The sink routines are more or less taken from Federrath et al. I have added a summary of this paper and its findings on my page, under the library section. Also, note that the accretion radius is 4dx: IR_ACC = 4, as defined in particle_declarations.f90 and is used in particle_control.f90 to set r_acc.
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.