Skip to content

Boundary conditions

Vedant Dhruv edited this page Sep 10, 2021 · 7 revisions

Radial boundary conditions

The typical boundary condition in the radial direction is outgoing. This includes,

  1. Assigning the primitives in the radial ghost zones to the corresponding value in the nearest physical zone and rescaling by a factor of equation. See set_bounds in bounds.c

  2. Ensuring there is no radial inflow (see inflow_check in bounds.c). This means setting the radial component of uµ to zero.

Polar boundary conditions

We employ reflecting boundary condition at the polar boundaries. The primitives in the ghost zones are set by reflecting about the boundary between the ghost and physical zones. For eg. let the number of ghost zones at each X2 boundary be NG and number of physical zones along X2 be N2. This means the total length of the primitive array (S->P) along X2 (indexed by j) is 2*NG+N2. Let's consider the X2=0 boundary. The appropriate pseudocode for enforcing polar boundary conditions would be,

  • loop over [0,NG-1]

  • index physical zone to be reflected as jrefl = NG+(NG-j)-1

  • For all primitives, S->P[j] = S->P[jrefl]

In addition, the fluid velocity and magnetic field primitives along X2 (U2 and B2) are reflected in the ghost zones.

Boundary condition along X3

iharm3d applies periodic boundary condition along X3. MPI handles this by creating a communicator with Cartesian topology and enabling periodicity along X3.