Difference between revisions of "AdjustTimeStep Custom Task"
(27 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
== Introduction == | == Introduction == | ||
For convergence of explicit, dynamic calculations, like [[NairnMPM]], the time step must be less then the time it takes a stress wave to pass across the smallest element size. For safety, the time step is usually calculated to be some fraction of this time as specified by the input [[MPM Methods and Simulation Timing#Theory: MPM Time Step|factor C]]. But, for some [[Material Models|material types]], the wave speed might change during the calculations thereby necessitating an adjustment in the time step to retain convergence. This tasks allows you to periodically adjust the time step. | For convergence of explicit, dynamic calculations, like [[NairnMPM]], the time step must be less then the time it takes a stress wave or a particle at its current velocity to pass across the smallest element size. For safety, the time step is usually calculated to be some fraction of this time as specified by the input [[MPM Methods and Simulation Timing#Theory: MPM Time Step|Courant–Friedrichs–Lewy factor (C)]]. But, for some [[Material Models|material types]], the wave speed might change during the calculations thereby necessitating an adjustment in the time step to retain convergence. This tasks allows you to periodically adjust the time step. | ||
When activated, this task looks at each particle and finds the current wave speed, c<sub>s</sub>, and particle speed | |||
| |||
<math>c_p = \sqrt{v_x^2+v_y^2+v_z^2}</math> | |||
The time step is then set to minimum time (over all particles, p) for the particle to cross minimum cell size (Δx) at the two speeds (c<sub>s</sub> and c<sub>p</sub>): | |||
| |||
<math>\Delta t = \min_p \left({C \Delta x\over c_s}, {C_{vel} \Delta x\over c_p}\right)</math> | |||
where <math>C_{vel}</math> is an optional different time factor for particle velocities. The time step may go up or down, depending on the states of the particles. | |||
== Task Scheduling == | == Task Scheduling == | ||
Line 12: | Line 24: | ||
Parameter adjustTime,(time) | Parameter adjustTime,(time) | ||
Parameter verbose,(verbose) | Parameter verbose,(verbose) | ||
Parameter velocityCFL,(Cvel) | |||
Parameter maxIncrease,(maxInc) | |||
In <tt>XML</tt> files, this task is scheduled using a <tt><Schedule></tt> element, which must be within the single <tt><CustomTasks></tt> block: | In <tt>XML</tt> files, this task is scheduled using a <tt><Schedule></tt> element, which must be within the single <tt><CustomTasks></tt> block: | ||
Line 18: | Line 32: | ||
<Parameter name='adjustTime'>(time)</Parameter> | <Parameter name='adjustTime'>(time)</Parameter> | ||
<Parameter name='verbose'>(verbose)</Parameter> | <Parameter name='verbose'>(verbose)</Parameter> | ||
<Parameter name='velocityCFL'>(Cvel)</Parameter> | |||
<Parameter name='maxIncrease'>(maxInc)</Parameter> | |||
</Schedule> | </Schedule> | ||
where the two parameters are: | where the two parameters are: | ||
* <tt>(time)</tt> - Enter the time interval for checking the time step and adjusting it if needed (in | * <tt>(time)</tt> - Enter the time interval for checking the time step and adjusting it if needed (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]). This parameter is optional; if it is omitted, the time step adjustment is done each time particle data are archived. To check on every time step enter zero (or any number less than the shortest possible time step). | ||
* <tt>(verbose)</tt> - If | * <tt>(verbose)</tt> - If value is greater than 0.99, it will print the new time step whenever it changes by a factor equal to value of <tt>(verbose)</tt>. For backward compatibility, if entered value is 1, the report factor will set to 2 fold change in time step. If value is less than 0.99, the new time step is silently changed. The default it 0. | ||
* <tt>(Cvel)</tt> - Enter a different Courant–Friedrichs–Lewy factor to use for particle velocities. This parameter is optional. The default is for <tt>(Cvel)</tt> to be the same as the input [[MPM Methods and Simulation Timing#Theory: MPM Time Step|Courant–Friedrichs–Lewy (C)]]. | |||
* <tt>(maxInc)</tt> - This option limits any increases in time step to be <tt>(1+(maxInc))*</tt>Δ''t'' where Δ''t'' is the current time step. It is most-commonly needed when using the [[MPM Methods and Simulation Timing#Restarting Time Steps|time-step restarting option]] because otherwise this task would immediately return the time step to its previous value. If not entered, no limits are placed on time step increases. | |||
== Material Support == | == Material Support == | ||
This custom task only | This custom task can be used with any material and respond to material point velocities. But, it should also look at current wave speed in materials, especially when compressed. This task only accounts for pressure dependent properties if some particles are using [[Material Models|material classes]] for which the wave speed changes with particle state and for which the material class coding responds to <tt>CurrentWaveSpeed()</tt> to provide that state-dependent wave speed. The [[Material Models|material classes]] that current provide this support are: | ||
* [[Clamped Neo-Hookean Material|ClampedNeohookean]] | |||
* [[Isotropic, Hyperelastic-Plastic Material|HEIsotropic]] | |||
* [[Isotropic, Hyperelastic-Plastic Mie-Grüneisen Material|HEMGEOSMaterial]] | * [[Isotropic, Hyperelastic-Plastic Mie-Grüneisen Material|HEMGEOSMaterial]] | ||
* [[Ideal Gas Material|IdealGas]] | * [[Ideal Gas Material|IdealGas]] | ||
* [[Mooney Material|Mooney]] | |||
* [[Mooney Membrane Material|MooneyMembrane]] | |||
* [[Neo-Hookean Material|Neohookean]] | |||
* [[First Order Phase Transition Material|PhaseTransition]] | |||
* [[ReactionPhase]] | |||
* [[Tait Liquid Material|TaitLiquid]] | * [[Tait Liquid Material|TaitLiquid]] | ||
* [[Viscoelastic Material|Viscoelastic]] | * [[Viscoelastic Material|Viscoelastic]] | ||
All other materials have wave speed that is independent of particle state | All other materials have wave speed that is independent of particle state (or no calculations are implement to evaluate particle-state effects). These materials will still adjust time step, however, if particles approach the wave speed of the material. These adjustments can help highly-dynamic simulations. |
Latest revision as of 15:41, 3 September 2024
A custom task to dynamically adjust the MPM time step.
Introduction
For convergence of explicit, dynamic calculations, like NairnMPM, the time step must be less then the time it takes a stress wave or a particle at its current velocity to pass across the smallest element size. For safety, the time step is usually calculated to be some fraction of this time as specified by the input Courant–Friedrichs–Lewy factor (C). But, for some material types, the wave speed might change during the calculations thereby necessitating an adjustment in the time step to retain convergence. This tasks allows you to periodically adjust the time step.
When activated, this task looks at each particle and finds the current wave speed, cs, and particle speed
[math]\displaystyle{ c_p = \sqrt{v_x^2+v_y^2+v_z^2} }[/math]
The time step is then set to minimum time (over all particles, p) for the particle to cross minimum cell size (Δx) at the two speeds (cs and cp):
[math]\displaystyle{ \Delta t = \min_p \left({C \Delta x\over c_s}, {C_{vel} \Delta x\over c_p}\right) }[/math]
where [math]\displaystyle{ C_{vel} }[/math] is an optional different time factor for particle velocities. The time step may go up or down, depending on the states of the particles.
Task Scheduling
In scripted files, a AdjustTimeStep custom task is scheduled using
CustomTask AdjustTimeStep Parameter adjustTime,(time) Parameter verbose,(verbose) Parameter velocityCFL,(Cvel) Parameter maxIncrease,(maxInc)
In XML files, this task is scheduled using a <Schedule> element, which must be within the single <CustomTasks> block:
<Schedule name='AdjustTimeStep'> <Parameter name='adjustTime'>(time)</Parameter> <Parameter name='verbose'>(verbose)</Parameter> <Parameter name='velocityCFL'>(Cvel)</Parameter> <Parameter name='maxIncrease'>(maxInc)</Parameter> </Schedule>
where the two parameters are:
- (time) - Enter the time interval for checking the time step and adjusting it if needed (in alt time units). This parameter is optional; if it is omitted, the time step adjustment is done each time particle data are archived. To check on every time step enter zero (or any number less than the shortest possible time step).
- (verbose) - If value is greater than 0.99, it will print the new time step whenever it changes by a factor equal to value of (verbose). For backward compatibility, if entered value is 1, the report factor will set to 2 fold change in time step. If value is less than 0.99, the new time step is silently changed. The default it 0.
- (Cvel) - Enter a different Courant–Friedrichs–Lewy factor to use for particle velocities. This parameter is optional. The default is for (Cvel) to be the same as the input Courant–Friedrichs–Lewy (C).
- (maxInc) - This option limits any increases in time step to be (1+(maxInc))*Δt where Δt is the current time step. It is most-commonly needed when using the time-step restarting option because otherwise this task would immediately return the time step to its previous value. If not entered, no limits are placed on time step increases.
Material Support
This custom task can be used with any material and respond to material point velocities. But, it should also look at current wave speed in materials, especially when compressed. This task only accounts for pressure dependent properties if some particles are using material classes for which the wave speed changes with particle state and for which the material class coding responds to CurrentWaveSpeed() to provide that state-dependent wave speed. The material classes that current provide this support are:
- ClampedNeohookean
- HEIsotropic
- HEMGEOSMaterial
- IdealGas
- Mooney
- MooneyMembrane
- Neohookean
- PhaseTransition
- ReactionPhase
- TaitLiquid
- Viscoelastic
All other materials have wave speed that is independent of particle state (or no calculations are implement to evaluate particle-state effects). These materials will still adjust time step, however, if particles approach the wave speed of the material. These adjustments can help highly-dynamic simulations.