Difference between revisions of "Gravitational Field"

From OSUPDOCS
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
== Gravity Commands ==
== 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:
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)>
  Gravity <(bodyX)>,<(bodyY)>,<(bodyZ)>


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


  &lt;Gravity&gt;
  &lt;Gravity&gt;
Line 15: Line 15:
   &lt;BodyYForce&gt;(gravY)&lt;/BodyYForce&gt;
   &lt;BodyYForce&gt;(gravY)&lt;/BodyYForce&gt;
   &lt;BodyZForce&gt;(gravZ)&lt;/BodyZForce&gt;
   &lt;BodyZForce&gt;(gravZ)&lt;/BodyZForce&gt;
&lt;/Gravity&gt;
&lt;/Gravity&gt;
 
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 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 axisymmetric calculations, the X and Y forces set the R and Z forces.
 
(<tt>(gravX)</tt> and <tt>(gravY)</tt> are for R and Z directions in axisymmetric calculations). In scripted files, the units are [[ConsistentUnits Command#Legacy and Consistent Units|acceleration units]], but in <tt>XML</tt> files, the units are [[ConsistentUnits Command#Legacy and Consistent Units|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 <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. But, if no <tt>Gravity</tt> command is used at all, the simulation will have no gravitational forces. Thus to have Earth's gravity you need a <tt>Gravity</tt> command, even if it has no parameters. In <tt>XML</tt> files, any omitted forces are set to zero.


== Grid Body Forces ==
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.
 
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 <tt>XML</tt> commands). In <tt>XML</tt> files, body forces are added within the <tt>&lt;Gravity&gt;</tt> element:
 
&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;/Gravity&gt;


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.


You can use both [[#Gravity Commands|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 [[#Gravity Commands|constant gravity]] commands than to use body force functions.
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.