












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













Ideally we would cover the Universe with a uniform mesh: ● (^) Numerical diffusivity/resistivity constant ● (^) Properties mathematically simple ● (^) Easy to parallelize (domain decomposition) But this would be a colossal waste of resources! For explicit hydro schemes in 3D, Storage ∝ N 3 Cost ∝ N 4 If we wanted to resolve interstellar distances in a cosmological volume, we would need We would need 10 28 bytes per variable... a computer requiring 1 ns to update each zone would take 3× 10 29 yr for one timestep! And most of it would be voids...
~ 1 pc }
9
Clearly we need a way to concentrate resources where interesting things are happening. We need – ● (^) More sophisticated bookkeeping ● (^) Operators to transfer information between grids ● (^) A way to determine where to concentrate resources
Use when region to be refined is known and static Advantages: ● (^) Simple to implement – no extra bookkeeping Disadvantages: ● (^) Must derive difference expressions for nonconstant zone spacing ● (^) Still somewhat wasteful (grid stretches in regions of no interest) ● (^) Must limit change in zone spacing to at most 5 10% Example: COSMOS (Ricker et al. 2000)
Mesh is tied to the fluid – stretches when it expands, squeezes when it contracts Advantages: ● (^) Constant mass resolution ● (^) Sharp resolution of contacts Disadvantages: ● (^) Grid stretching causes numerical dissipation to be very different in one direction than in others ● (^) Grid tangling in 2/3D rotational flows Usually used only in 1D (e.g., 1D stellar evolution codes)
Mesh is allowed to move arbitrarily with respect to fluid – can be Lagrangian where flow is irrotational and Eulerian where mesh distortion would be a problem Application to stellar evolution: DJEHUTY code (D. Dearborn et al., LLNL)
Static meshes with different resolutions – usually best when region to be refined doesn't move Meshes evolve independently; fine grids take boundary conditions by interpolation from coarser grids Sometimes interaction is one way, ie. coarse fine, but not fine coarse This is only justifiable if no matter escapes from fine grid region (and, preferably, inflow is supersonic)
Each block contains n d zones in d dimensions Blocks stored in 2 d tree data structure (^) Factor of 2 refinement per level (^) Blocks assigned indices via space filling curve 1 3 4 5 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 10 (^611) 12 18 Refinement Level 5 1 3 4 15 16 17 13 20 14 19 8 9 2 7 21
When implementing AMR on a parallel computer, commonly one uses a space filling curve to assign a 1D ordering to the 2D/3D blocks on different levels of refinement Once blocks are ordered, the list can be divided up evenly among processors: Blocks can also be weighted by the work needed to update them Space filling curves tend to preserve locality – nearby blocks tend to have adjacent indices Example: Morton curve used by FLASH (Fryxell et al. 2000) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2021 22 23 24 25 26 27 28 29 30 (^31 ) 33 34 35 (^36 ) 1 – 9 10 – 18 19 – 27 28 – 37 Proc 0 Proc 1 (^) Proc 2 Proc 3
Different from initializing a uniform mesh: ● (^) Multiple blocks or patches of zones ● (^) Don't know block structure in advance (depends on solution!) Initialization is done one block/patch at a time.
i
i i+
i+
i
i
i
i+
i i+
i
i+
i+
i+
3. Update mesh refinement. a) For each block, compute a figure of merit that will determine whether the block should be refined or derefined (“refinement marking”) b) For each block: i) If it is to be refined, create child blocks and set their solution information by interpolating from the parent ii) If it is to be derefined, restrict solution information to its parent block, then free up the memory allocated to the block to be derefined c) Compute block indices using space filling curve d) Redistribute blocks by communication among processors so that all processors have about the same amount of work to do during the next step
Magnitude of density Used to capture peaks in gravitational problems. Refine blocks to different levels depending on the ratio of their maximum densities to some reference density. Truncation error estimate Use Richardson extrapolation of solution on coarser grids to estimate mesh spacing required for a given level of error. Physical criteria Keep instabilities resolved by computing local critical wavelengths crit and asking whether crit < x. Example : Truelove et al. (1997) criterion for Jeans unstable fluid:
reference density refine at least once if max in this interval { 2x 3x 4x 5x log x log x0.25 J
J ≡c s (^)
G 1 / 2
14 levels of refinement: 65, 2