Version 2 (modified by 12 years ago) ( diff ) | ,
---|
Ghost Cells
Managing ghost cells involves two aspects. One is ensuring that an isolated grid has enough boundary data to complete two full steps. The other is ensuring that non-isolated grids are aware of each other and can fill in each-other's boundary data where available.
Isolated Grids
Hydro
Lets first consider an isolated AMR grid in hydrodynamics. This grid is created with prolongated data from its parent. Let's also assume that we are using constant interpolation from coarse to fine grids. Since the parents data will only be available at the start of coarse steps, we need to ensure that we have enough information to advance the grid a full coarse time step. This usually means taking two fine grid time steps. It is easiest to work backwards.
- 0 - number of ghost zones with good data required after completing 2nd step
- hyperbolic_mbc - number of ghost zones required before completing 2nd step
- hyperbolic_mbc - number of ghost zones required after completing 1st step
- 2*hyperbolic_mbc - number of ghost zones required before completing 1st step.
Here each time we take a hyperbolic step, we loose hyperbolic_mbc ghost zones of valid data. We therefore need to start out with 2*hyperbolic_mbc so that when we are done we have a grid with valid data.
Note we could also have used temporal interpolation to update the ghost zones from our parents… Then we would have only needed hyperbolic_mbc worth of data since after completing the first step we could advance the ghost region using temporal derivatives. Of course for shock dominated problems this is usually a bad idea. We will see that for elliptic variables this is a useful and necessary option…
Hydro + Gravity
Adding self gravity introduces two complexities.
- The first is needing to supply boundary conditions to an elliptic solver
- The second is needing an extra ghost row of phi to use to take the gradient
We can express these requirements using a stencil notation…
- Hyperbolic Step - Q → Q[hmbc] & Phi[hmbc+1] !Hyperbolic Step
- Elliptic Step - Phi → Q[0] or Phi_Dot[0]