-
Notifications
You must be signed in to change notification settings - Fork 117
Boundary Conditions
The boundary condition flags must be specified in the input file.
<mesh>
ix1_bc = user # inner-X1 boundary flag
ox1_bc = user # outer-X1 boundary flag
ix2_bc = outflow # inner-X2 boundary flag
ox2_bc = outflow # outer-X2 boundary flag
ix3_bc = periodic # inner-X3 boundary flag
ox3_bc = periodic # outer-X3 boundary flag
The following flags are available:
- outflow : outflowing (zero-gradient) boundary condition
- reflecting : reflecting boundary condition
- periodic : periodic boundary condition
- polar : geometric boundary condition at the pole, available only for the x2-direction in spherical polar and similar coordinates
- user : user-defined boundary condition
For cylindrical- and spherical-like coordinates one often has the azimuthal angle run from 0 to 2π with periodic boundaries. In addition, spherical-like coordinates often have the polar angle run from 0 to π with polar boundaries. See the next section for restrictions on polar boundary conditions.
While Athena++ supports having a reflecting wall or even outflow conditions along the polar axes in spherical-like coordinates, it also supports physically connecting the domain across the axes, allowing fluid to flow from one side to the other with no artificial boundary. This is done by specifying "polar" as the boundary condition for the polar angle. The following restrictions affect this mode:
- The polar angle must extend to exactly 0 if connecting across the inner (North) pole, and to exactly π (3.141592653589793) if connecting across the outer (South) pole.
- The azimuthal angle must extend from 0 to 2π (6.283185307179586), and it must have both inner and outer boundaries be periodic, if any polar boundary is used.
- There must be an even number of cells in the azimuthal direction.
- The number of MeshBlocks in the azimuthal direction must be either 1 or an even number.
- All MeshBlocks touching a given pole, no matter at what radius, must be at the same level of refinement.
The last condition is not currently checked by the code. Polar boundaries work with static mesh refinement, but the user must make sure the refinement scheme does not violate the same-level requirement. Currently adaptive mesh refinement does not protect against the grid evolving to an invalid refinement state.
In order to use the user-defined boundary conditions, the user-defined boundary conditions must be enrolled in Mesh::InitUserMeshData in the problem generator file.
First, the boundary condition function must be defined. This function has a certain prototype:
void MyBoundary_ix1(MeshBlock *pmb, Coordinates *pco, AthenaArray<Real> &prim, FaceField &b,
Real time, Real dt, int is, int ie, int js, int je, int ks, int ke);
And then enroll it:
EnrollUserBoundaryFunction(INNER_X1, MyBoundary_ix1);
For details, see the Programmer Guide.
Getting Started
User Guide
- Configuring
- Compiling
- The Input File
- Problem Generators
- Boundary Conditions
- Coordinate Systems and Meshes
- Running the Code
- Outputs
- Using MPI and OpenMP
- Static Mesh Refinement
- Adaptive Mesh Refinement
- Load Balancing
- Special Relativity
- General Relativity
- Passive Scalars
- Shearing Box
- Diffusion Processes
- General Equation of State
- FFT
- High-Order Methods
- Super-Time-Stepping
- Orbital Advection
- Rotating System
- Reading Data from External Files
Programmer Guide