Difference between revisions of "Gravitational Field"
(14 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
== Gravity Commands == | == Gravity Commands == | ||
MPM simulations can include gravity or any other | MPM simulations can include gravity or any other body forces by forces on the grid. These forces can depend on position and time, although gravity is usually constant in a fixed reference frame. In scripted files, the command to add body forces is: | ||
Gravity <( | Gravity <(bodyX)>,<(bodyY)>,<(bodyZ)> | ||
In <tt>XML</tt> files, | In <tt>XML</tt> files, body forces are added with a <tt><Gravity></tt> element: | ||
<Gravity> | <Gravity> | ||
<GridBodyXForce>(bodyX)</GridBodyXForce> | |||
<GridBodyYForce>(bodyY)</GridBodyYForce> | |||
<GridBodyZForce>(bodyZ)</GridBodyZForce> | |||
<BodyXForce>(gravX)</BodyXForce> | <BodyXForce>(gravX)</BodyXForce> | ||
<BodyYForce>(gravY)</BodyYForce> | <BodyYForce>(gravY)</BodyYForce> | ||
Line 14: | Line 17: | ||
</Gravity> | </Gravity> | ||
where <tt>( | where <tt>(bodyX)</tt>, <tt>(bodyY)</tt>, and <tt>(bodyZ)</tt> are [[User Defined Functions|user-defined functions]] of position and time that evaluate to a body force acceleration in [[ConsistentUnits Command#Legacy and Consistent Units|acceleration units]]. In XML files, the body forces can alternatively be entered using <tt>(gravX)</tt>, <tt>(gravY)</tt>, and <tt>(gravZ)</tt>, but these must be constant (by numeric value) accelerations due to gravity in the x, y, and z directions, respectively (in [[ConsistentUnits Command#Legacy and Consistent Units|acceleration units]]). In axisymmetric calculations, the X and Y forces set the R and Z forces. | ||
In scripted files, | In scripted files, the three parameters can either by constants or [[User Defined Functions|user-defined functions]] of position and time. Both should evaluate to acceleration in [[ConsistentUnits Command#Legacy and Consistent Units|acceleration units]]. All three parameters are optional. If any 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 <tt>Gravity 0,-9806.65,0</tt>). If no <tt>Gravity</tt> command is used at all, the simulation will have no gravitational forces. Thus to have the default Earth's gravity you still need a <tt>Gravity</tt> command, even if it has no parameters. | ||
In <tt>XML</tt> files, you can enter [[User Defined Functions|user-defined functions]] or constant values. If the desired result is a constant acceleration, it is more efficient to enter using <tt>(gravX)</tt>, <tt>(gravY)</tt>, or <tt>(gravZ)</tt> then to enter a function with a constant value (because it avoids needless function evaluations for each node). If you enter both constant values and functions, the two are added to get total body forces. Any omitted forces are set to zero. | |||
Latest revision as of 07:46, 3 June 2016
Gravity Commands
MPM simulations can include gravity or any other body forces by forces on the grid. These forces can depend on position and time, although gravity is usually constant in a fixed reference frame. In scripted files, the command to add body forces is:
Gravity <(bodyX)>,<(bodyY)>,<(bodyZ)>
In XML files, body forces are added with a <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 XML files, the 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 acceleration units). In axisymmetric calculations, the X and Y forces set the R and Z forces.
In scripted files, the three parameters can either by constants or user-defined functions of position and time. Both should evaluate to acceleration in acceleration units. All three parameters are optional. If any 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,-9806.65,0). If no Gravity command is used at all, the simulation will have no gravitational forces. Thus to have the default Earth's gravity you still need a Gravity command, even if it has no parameters.
In XML files, you can enter user-defined functions or constant values. If the desired result is a constant acceleration, it is more efficient to enter using (gravX), (gravY), or (gravZ) then to enter a function with a constant value (because it avoids needless function evaluations for each node). If you enter both constant values and functions, the two are added to get total body forces. Any omitted forces are set to zero.