Difference between revisions of "Gravitational Field"

From OSUPDOCS
Jump to navigation Jump to search
(Created page with "__TOC__ == Gravity Commands == MPM simulations can include gravity or any other constant body forces. In scripted files, the command to add gravity is: Gravity <(gravX)>,<(...")
 
 
(15 intermediate revisions by the same user not shown)
Line 2: Line 2:
== Gravity Commands ==
== Gravity Commands ==


MPM simulations can include gravity or any other constant body forces. In scripted files, the command to add gravity is:
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 <(gravX)>,<(gravX)>,<(gravX)>
  Gravity <(bodyX)>,<(bodyY)>,<(bodyZ)>


In <tt>XML</tt>, gravity is added with the element:
In <tt>XML</tt> files, body forces are added with a <tt>&lt;Gravity&gt;</tt> element:


  &lt;Gravity&gt;
  &lt;Gravity&gt;
  &lt;GridBodyXForce&gt;(bodyX)&lt;/GridBodyXForce&gt;
  &lt;GridBodyYForce&gt;(bodyY)&lt;/GridBodyYForce&gt;
  &lt;GridBodyZForce&gt;(bodyZ)&lt;/GridBodyZForce&gt;
   &lt;BodyXForce&gt;(gravX)&lt;/BodyXForce&gt;
   &lt;BodyXForce&gt;(gravX)&lt;/BodyXForce&gt;
   &lt;BodyYForce&gt;(gravY)&lt;/BodyYForce&gt;
   &lt;BodyYForce&gt;(gravY)&lt;/BodyYForce&gt;
Line 14: Line 17:
  &lt;/Gravity&gt;
  &lt;/Gravity&gt;


where <tt>(gravX)</tt>, <tt>(gravY)</tt>, and <tt>(gravZ)</tt> are the accelerations due to gravity in the x, y, and z directions, respectively (<tt>(gravX)</tt> and <tt>(gravY)</tt> are for R and Z directions in axisymmetric calculations). In scripted files, the units are m/sec<sup>2</sup>, but in <tt>XML</tt> files, the units are mm/sec<sup>2</sup>.
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, 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 <tt>Gravity 0,-9.8,0</tt>). If <tt>(gravX)</tt> is included, but <tt>(gravY)</tt> and/or <tt>(gravZ)</tt> are omitted, the omitted parameters will be set to zero. In <tt>XML</tt> files, any omitted forces are set to zero.
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.


== Notes ==
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.
 
# If no Gravity command is used, the simulation will have no gravitational forces. Thus to have Earth's gravity you need a command, even if it has no parameters.

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.