Subsections


20.2 Externally Applied Fields

The FLASH distribution includes three externally applied gravitational fields, along with a placeholder module for you to create your own. Each provides the acceleration vector $ {\bf g}({\bf x})$ directly, without using the gravitational potential $ \phi({\bf
x})$ (with the exception of UserDefined, see below).

When building an application that uses an external, time-independent Gravity implementation, no additional storage in unk for holding gravitational potential or accelerations is needed or defined.

20.2.1 Constant Gravitational Field

This implementation creates a spatially and temporally constant field parallel to one of the coordinate axes. The magnitude and direction of the field can be set at runtime. This unit is called Gravity/GravityMain/Constant.

20.2.2 Plane-parallel Gravitational field

This PlanePar version implements a time-constant gravitational field that is parallel to one of the coordinate axes and falls off with the square of the distance from a fixed location. The field is assumed to be generated by a point mass or by a spherically symmetric mass distribution. A finite softening length may optionally be applied.

This type of gravitational field is useful when the computational domain is large enough in the direction radial to the field source that the field is not approximately constant, but the domain's dimension perpendicular to the radial direction is small compared to the distance to the source. In this case the angular variation of the field direction may be ignored. The PlanePar field is cheaper to compute than the PointMass field described below, since no fractional powers of the distance are required. The acceleration vector is parallel to one of the coordinate axes, and its magnitude drops off with distance along that axis as the inverse distance squared. Its magnitude and direction are independent of the other two coordinates.

20.2.3 Gravitational Field of a Point Mass

This PointMass implementation describes the gravitational field due to a point mass at a fixed location. A finite softening length may optionally be applied. The acceleration falls off with the square of the distance from a given point. The acceleration vector is everywhere directed toward this point.

20.2.4 User-Defined Gravitational Field

The UserDefined implementation is a placeholder module for the user to create their own external gravitational field. All of the subroutines in this module are stubs, and the user may copy these stubs to their setup directory to write their own implementation, either by specifying the gravitational acceleration directly or by specifying the gravitational potential and taking its gradient. If your user-defined gravitational field is time-varying, you may also want to set PPDEFINE FLASH_GRAVITY_TIMEDEP in your setup's Config file.