Gravity
The gravity package adds a gravitational body force to the hydrodynamics of Chapter Hydrodynamics. It sources the bulk momentum and total energy without introducing any transported field of its own, and requires hydrodynamics to be enabled.
Governing Equations
Gravity enters through a gravitational potential \(\Phi\), which exerts an acceleration \(\vec{g} = -\nabla\Phi\) on the fluid. This acceleration appears as a source on the right-hand sides of the bulk momentum and total-energy equations of Chapter Hydrodynamics,
where \(\rho\) is the bulk density and \(\vec{v}\) the common cell velocity. The momentum source is the body force per unit volume, \(-\rho\nabla\Phi\), and the energy source is the rate at which that force does work on the fluid, \(-\rho\,\vec{v}\!\cdot\!\nabla\Phi\). The gravitational force acts on the bulk fluid as a whole; it does not distinguish between the materials in a mixed cell.
RIOT currently supports a spatially uniform acceleration directed along a single mesh axis. Writing \(g\) for the (signed) acceleration and \(\hat{\vec{e}}_d\) for the chosen axis, the potential is \(\Phi = -g\,x_d\) so that
and the sources above reduce to \(\rho\,g\) on the \(d\)-component of the momentum and \(\rho\,v_d\,g\) on the energy. The acceleration magnitude and direction are set by gravity_g and gravity_dim, respectively.
Input Parameters
Gravity is enabled with the gravity toggle in the <physics> block (Section Enabling Physics: the <physics> Block); hydro must also be enabled. The acceleration is configured in the <gravity> block.
Parameter |
Type |
Default |
Description |
|---|---|---|---|
gravity_dim |
int |
|
Axis along which gravity acts (\(0=x\), \(1=y\), \(2=z\)). |
gravity_g |
Real |
|
Signed gravitational acceleration \(g\) (cm/s\(^2\)). |
Example
A uniform downward gravitational acceleration along the \(y\) axis:
riot.input("physics", hydro=True, gravity=True)
riot.input("gravity", gravity_dim=1, gravity_g=-9.7998e2)