Difference between revisions of "Gravitational Field"

From OSUPDOCS
Jump to navigation Jump to search
Line 16: Line 16:
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>(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>.


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. In <tt>XML</tt> files, any omitted forces are set to zero.
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 ==
== 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 an time (currently only available in [[OSParticulas]] and using <tt>XML</tt> commands). In <tt>XML</tt> files, body forces are added within the <tt>&lt;Gravity&gt;</tt> element:
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 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;Gravity&gt;
Line 30: Line 30:
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 units of mm/<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 units of mm/<sup>2</sup>.


You can use both
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.
 
== Notes ==
 
# If no <tt>Gravity</tt> command is used, 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.

Revision as of 10:41, 6 June 2014

Gravity Commands

MPM simulations can include gravity or any other constant body forces. In scripted files, the command to add gravity is:

Gravity <(gravX)>,<(gravX)>,<(gravX)>

In XML files, gravity is added with the the <Gravity> element:

<Gravity>
  <BodyXForce>(gravX)</BodyXForce>
  <BodyYForce>(gravY)</BodyYForce>
  <BodyZForce>(gravZ)</BodyZForce>
</Gravity>

where (gravX), (gravY), and (gravZ) are the accelerations due to gravity in the x, y, and z directions, respectively ((gravX) and (gravY) are for R and Z directions in axisymmetric calculations). In scripted files, the units are m/sec2, but in XML files, the units are mm/sec2.

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 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>

where (bodyX), (bodyY), and (bodyZ) are user-defined functions of position and time that evaluate to a body force acceleration in units of mm/2.

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.