Gravitational Field

From OSUPDOCS
Revision as of 10:38, 13 January 2016 by Nairnj (talk | contribs)
Jump to navigation Jump to search

Gravity Commands

MPM simulations can include gravity or any other body forces, including forces that depend on position and time. In scripted files, the command to add body forces is is:

Gravity <(bodyX)>,<(bodyY)>,<(bodyZ)>

In XML files, body forces are added with the the <Gravity> element:

<Gravity>
  <GridBodyXForce>(bodyX)</GridBodyXForce>
  <GridBodyYForce>(bodyY)</GridBodyYForce>
  <GridBodyZForce>(bodyZ)</GridBodyZForce>
  <BodyXForce>(gravX)</BodyXForce>
  <BodyYForce>(gravY)</BodyYForce>
  <BodyZForce>(gravZ)</BodyZForce>

</Gravity>

where (bodyX), (bodyY), and (bodyZ) are user-defined functions of position and time that evaluate to a body force acceleration in acceleration units. In body forces can alternatively be entered using (gravX), (gravY), and (gravZ), but these must be constant (by numeric value) accelerations due to gravity in the x, y, and z directions, respectively. In axisymmetric calculations, the X and Y forces set the R and Z forces.

((gravX) and (gravY) are for R and Z directions in axisymmetric calculations). In scripted files, the units are acceleration units, but in XML files, the units are acceleration units.

In scripted files, all three parameters are optional. If all are omitted, the gravitational force field is set to Earth's gravity with down being in the negative y direction (i.e., it is equivalent to the command Gravity 0,-9.8,0). If (gravX) is included, but (gravY) and/or (gravZ) are omitted, the omitted parameters will be set to zero. But, if no Gravity command is used at all, the simulation will have no gravitational forces. Thus to have Earth's gravity you need a Gravity command, even if it has no parameters. In XML files, any omitted forces are set to zero.

Grid Body Forces

Gravity (in general) is a constant body force. The commands in this section let you apply a more general body force that can depend on position and time (currently only available in OSParticulas and then only when using XML commands). In XML files, body forces are added within the <Gravity> element:

<Gravity>
  <GridBodyXForce>(bodyX)</GridBodyXForce>
  <GridBodyYForce>(bodyY)</GridBodyYForce>
  <GridBodyZForce>(bodyZ)</GridBodyZForce>
</Gravity>


You can use both constant gravity commands and grid body force functions in the same input commands. When both are used, the resulting body force is the sum of the two forces. When body forces are constant, it is more efficient to use constant gravity commands than to use body force functions.