wiki:ControllingRefinement

Version 3 (modified by Jonathan, 13 years ago) ( diff )

Controlling Refinement in AstroBEAR 2.0

Overview

Refinement is triggered by various sections of code evaluating various refinement criteria described below. To mark cell i,j,k for refinement, each routine sets Info%ErrFlag(i,j,k)=1. If a cell is marked for refinement by more then one routine there is no problem since it will still be refined. Setting Info%ErrFlag(i,j,k)=0 however, is generally not a good idea since another flagging routine may have previously marked the cell for refinement with good reason.

After all of the cells in a given parent info have been potentially marked for refinement, the subroutine NewSubGrids in data_info_ops.f90 groups the flagged cells into rectangular patches so that every cell is within a patch and that no patch has a filling ratio less then the DesiredFillRatio for that level set in global.data. Having a DesiredFillRatio of 1.0 will effectively limit refinement to only cells marked for refinement however the MinimumGridSize also set in global.data may limit the actual desired fill ratios. Having many small grids is generally not as efficient as having a few larger grids even if they comprise more cells and so a desired fill ratio of 1.0 does not usually give the best performance. Values of .7 to .9 are recommended for optimal performance.

Fill Ratio = .7 Fill Ratio = .9 Fill Ratio = 1.0

Additionally one can increase the minimum grid size to reduce the prevalence of long slender grids. Below we increased the minimum refined patch to be 4 parent cells. (This results in actual child grids that are at least 8x8)

After the new patches are determined, the distribution algorithm may split these patches to accommodate load balancing. For example running on 3 processors we get

Fill Ratio = .7 Fill Ratio = .9 Fill Ratio = 1.0

Field Gradient Refinement

AstroBEAR 2.0 comes with the ability to refine on field gradients. For each fluid variable, AstroBEAR checks if…

and marks cell i+1 and cell i for refinement. This is essentially . The is for the current grid resolution and results in coarser levels being more sensitive to fluid gradients for a given tolerance. The values of tol is found by multiplying the qTolerance for the level with the refineVariableFactor for the fluid variable and MinScale is dependent on which field you are considering.

Jeans Criteria

When Self Gravity is turned on, refinement is flagged based on the Jeans criterion

ProblemSetErrFlag

Users can manually set error flags based on any other criteria (position, etc…) in their problem module

Particles

Sink Particles have a buffer array that triggers refinement within a certain distance of a particle.

Visualizing Error Flags

You can plot the value of Info%ErrFlag by turning on lOutputErrFlag in process.data

Attachments (13)

Note: See TracWiki for help on using the wiki.