Difference between revisions of "Setting Material Point Initial Velocity"
Line 12: | Line 12: | ||
<vel0Z>(function)</vel0Z> | <vel0Z>(function)</vel0Z> | ||
These commands set each component of initial velocity of the particles created in the current region after the command using the supplied [[User Defined Functions|user defined functions]] of particle position (x, y, and z). If used, they override the values used in <tt>vx</tt>, <tt>vy</tt>, and <tt>vz</tt> attributes of the [[MPM Region and Hole Commands#Region Commands|<tt><Body></tt> command]]. The function value should be in [[Consistent Units|velocity units]]. If multiple commands are used in a single region, the new function replaces the previous one for all subsequently created material points. A command with empty value reverts to zero initial velocity. | These commands set each component of initial velocity of the particles created in the current region after the command using the supplied [[User Defined Functions|user defined functions]] of particle position (x, y, and z). If used, they override the values used in <tt>vx</tt>, <tt>vy</tt>, and <tt>vz</tt> attributes of the [[MPM Region and Hole Commands#Region Commands|<tt><Body></tt> command]]. The function value should be in [[Legacy and Consistent Units|velocity units]]. If multiple commands are used in a single region, the new function replaces the previous one for all subsequently created material points. A command with empty value reverts to zero initial velocity. | ||
Note that <tt>XML</tt> input files, unlike scripted files, can apply different functions to different groups of particles within a single [[MPM Region and Hole Commands#Region Commands|<tt><Body></tt> command]]. To do the same in scripted input files, simple create multiple [[MPM Region and Hole Commands#Region Commands|Region command blocks]]. | Note that <tt>XML</tt> input files, unlike scripted files, can apply different functions to different groups of particles within a single [[MPM Region and Hole Commands#Region Commands|<tt><Body></tt> command]]. To do the same in scripted input files, simple create multiple [[MPM Region and Hole Commands#Region Commands|Region command blocks]]. | ||
Line 26: | Line 26: | ||
AngularMom0 (Lp0x),(Lp0y),(Lp0z) | AngularMom0 (Lp0x),(Lp0y),(Lp0z) | ||
<tt>(Lp0x)</tt>, <tt>(Lp0y)</tt>, and <tt>(Lp0z)</tt> are numerical values or [[User Defined Functions|user-defined functions]] of particle position (x, y, and z) that give the initial angular momentum per unit mass in [[Consistent Units| | <tt>(Lp0x)</tt>, <tt>(Lp0y)</tt>, and <tt>(Lp0z)</tt> are numerical values or [[User Defined Functions|user-defined functions]] of particle position (x, y, and z) that give the initial angular momentum per unit mass in [[Legacy and Consistent Units|length<sup>2</sup>/time units]]. The initial values apply to all particles in the current region, including particles created in shape commands before the <tt>AngularMom0</tt> command. | ||
In <tt>XML</tt> input files, the initial angular momenta are set by interspersing the following commands within the <tt><Body></tt> element: | |||
These commands set initial angular momentum of the particles in the current region. The value is interpreted as a user-defined function of particle position that evaluates to angular momentum per unit mass in | <Lp0X>(Lp0x)</Lp0X> | ||
<Lp0Y>(Lp0y)</Lp0Y> | |||
<Lp0Z>(Lp0z)</Lp0ZZ> | |||
These commands set initial angular momentum of the particles in the current region. The value is interpreted as a [[User Defined Functions|user-defined function]] of particle position (x, y, z) that evaluates to angular momentum per unit mass in [[Legacy and Consistent Units|length<sup>2</sup>/time units]]. If multiple commands are used in a single <tt><Body></tt>, the new function replaces the previous one for all subsequently created material points. A command with empty value reverts to zero angular momentum. This initial setting only has an effect for simulations that track particle spin. | |||
Note that <tt>XML</tt> input files, unlike scripted files, can apply different functions to different groups of particles within a single [[MPM Region and Hole Commands#Region Commands|<tt><Body></tt> command]]. To do the same in scripted input files, simple create multiple [[MPM Region and Hole Commands#Region Commands|Region command blocks]]. | Note that <tt>XML</tt> input files, unlike scripted files, can apply different functions to different groups of particles within a single [[MPM Region and Hole Commands#Region Commands|<tt><Body></tt> command]]. To do the same in scripted input files, simple create multiple [[MPM Region and Hole Commands#Region Commands|Region command blocks]]. | ||
=== Initial Angular Velocity === | |||
Note that the above commands are setting angular momentum and not angular velocity. The setting to get a particular angular velocity (ω radians per[[Legacy and Consistent Units|time units]]) depends are particle locations and dimensions. For particles at typical starting positions, the angular momentum for given ω would be: | |||
* 2D, 4 particles per cell: L<sub>p,z</sub> = (3/16)(dx<sup>2</sup> + dy<sup>2</sup>)ω | |||
* 2D, 1 particle per cell: L<sub>p,z</sub> = (1/4)(dx<sup>2</sup> + dy<sup>2</sup>)ω | |||
* 3D, 8 particles per cell: | |||
* 3D, 1 particle per cell: | |||
where dx, dy, and dz are cell dimensions for the grid cell containing the particle. Simulations with more particles per cell would need to set different angular momenta for different particle locations, which is currently not possible. One alternative is to use an average value noting that angular momentum will range from 1/8 to 1/4 (check this) depending on particle location. |
Revision as of 16:09, 23 July 2016
When material points are created than can be assigned and initial velocity or an initial angular momentum use the commands described below.
Setting Initial Velocity
In scripted input files, the initial velocities or set using parameters to the Region command. The velocities apply to all particles in the region.
In XML input files, the velocity attributes on the <Body> command can only be constants and they set a constant velocity to all particles in the region. To set velocities with a user defined function, intersperse the following commands within the <Body> element:
<vel0X>(function)</vel0X>, <vel0Y>(function)</vel0Y>, <vel0Z>(function)</vel0Z>
These commands set each component of initial velocity of the particles created in the current region after the command using the supplied user defined functions of particle position (x, y, and z). If used, they override the values used in vx, vy, and vz attributes of the <Body> command. The function value should be in velocity units. If multiple commands are used in a single region, the new function replaces the previous one for all subsequently created material points. A command with empty value reverts to zero initial velocity.
Note that XML input files, unlike scripted files, can apply different functions to different groups of particles within a single <Body> command. To do the same in scripted input files, simple create multiple Region command blocks.
Setting Initial Angular Momentum
In scripted input files, the AngularMom0 command sets the initial angular momentum for all particles in the current region. In 2D simulations, the command takes one argument:
AngularMom0 (Lp0z)
while for 3D simulations, it takes 3 arguments:
AngularMom0 (Lp0x),(Lp0y),(Lp0z)
(Lp0x), (Lp0y), and (Lp0z) are numerical values or user-defined functions of particle position (x, y, and z) that give the initial angular momentum per unit mass in length2/time units. The initial values apply to all particles in the current region, including particles created in shape commands before the AngularMom0 command.
In XML input files, the initial angular momenta are set by interspersing the following commands within the <Body> element:
<Lp0X>(Lp0x)</Lp0X> <Lp0Y>(Lp0y)</Lp0Y> <Lp0Z>(Lp0z)</Lp0ZZ>
These commands set initial angular momentum of the particles in the current region. The value is interpreted as a user-defined function of particle position (x, y, z) that evaluates to angular momentum per unit mass in length2/time units. If multiple commands are used in a single <Body>, the new function replaces the previous one for all subsequently created material points. A command with empty value reverts to zero angular momentum. This initial setting only has an effect for simulations that track particle spin.
Note that XML input files, unlike scripted files, can apply different functions to different groups of particles within a single <Body> command. To do the same in scripted input files, simple create multiple Region command blocks.
Initial Angular Velocity
Note that the above commands are setting angular momentum and not angular velocity. The setting to get a particular angular velocity (ω radians pertime units) depends are particle locations and dimensions. For particles at typical starting positions, the angular momentum for given ω would be:
- 2D, 4 particles per cell: Lp,z = (3/16)(dx2 + dy2)ω
- 2D, 1 particle per cell: Lp,z = (1/4)(dx2 + dy2)ω
- 3D, 8 particles per cell:
- 3D, 1 particle per cell:
where dx, dy, and dz are cell dimensions for the grid cell containing the particle. Simulations with more particles per cell would need to set different angular momenta for different particle locations, which is currently not possible. One alternative is to use an average value noting that angular momentum will range from 1/8 to 1/4 (check this) depending on particle location.