Difference between revisions of "PeriodicXPIC Custom Task"

From OSUPDOCS
Jump to navigation Jump to search
 
(66 intermediate revisions by 2 users not shown)
Line 1: Line 1:
A [[MPM Input Files#Custom Tasks|custom task]] to use [[Damping Options#XPIC Damping|XPIC(m) method]] on selected time steps
A [[MPM Input Files#Custom Tasks|custom task]] to use [[XPIC Features|XPIC(k) and FMPM(k) methods]] on all or selected time steps
__TOC__
__TOC__
== Introduction ==
== Introduction ==


The [[Damping Options#XPIC Damping|XPIC(m) method]] is an advanced damping method that filters out unwanted noise (in the null space) without damping out useful information. Its drawback is that it adds calculation time as m in XPIC(m) increases. In some simulations, it may not be necessary to use XPIC(m) update methods on every time step. This custom tasks lets you convert such simulations to use XPIC(m) periodically instead of on every time step. Note that both the [[Damping Options#XPIC Damping|XPIC(m) method]] and this custom tasks are only available in [[OSParticulas]].
The [[XPIC Features|XPIC(k)<ref name="XPIC"/> and FMPM(k)<ref name="FMPM"/> methods]] are advanced methods that filter out unwanted noise (in the null space) without damping out useful information. Their drawback is that they add calculation time as order <tt>k</tt> increases. Many simulations (especially those with stability issues) will run better by using XPIC(k) or FMPM(k). The XPIC(k) and FMPM(k) methods can be done every time step or only on periodic time steps. This custom tasks adds XPIC(k) or FMPM(k) to any simulation and lets you select the frequency of those calculations.


== Task Scheduling ==
== Using FMPM(k) or XPIC(k) For Mechanics ==


The first step is to select default update method. Normally, the default method would be a standard FLIP method select using [[Damping Options#Damping Commands|Damping commands]] be setting <tt>(fractionPIC)</tt> to 1. Next, you select an XPIC order (the m in XPIC(m)) and frequency to run the XPIC(m) calculations. In scripted files, a <tt>PeriodicXPIC</tt> custom task is scheduled with
MPM simulations will use standard FLIP method be default. To switch to FMPM(k) or XPIC(k) for all time steps (or just for some), schedule this task and specify all needed parameters. In scripted files, a <tt>PeriodicXPIC</tt> custom task is scheduled with


  CustomTask PeriodicXPIC
  CustomTask PeriodicXPIC
Parameter FMPMOrder,(order)
(... or Parameter XPICOrder,(order))
  Parameter periodicSteps,(stepInterval)
  Parameter periodicSteps,(stepInterval)
  Parameter periodicTime,(timeInterval)
  Parameter periodicTime,(timeInterval)
  Parameter XPICOrder,(order)
  Parameter periodicCFL,(CFLfactor)
Parameter fractionPIC,(fractionPIC)
  Parameter verbose,{verbose}
  Parameter verbose,{verbose}
Parameter GridBCOption,(BCoption)


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:


  <Schedule name='PeriodicXPIC'>
  <Schedule name='PeriodicXPIC'>
    <Parameter name='FMPMOrder'>(order)</Parameter>
    &lt;!-- or <Parameter name='XPICOrder'>(order)</Parameter>--&gt;
     <Parameter name='periodicSteps'>(stepInterval)</Parameter>
     <Parameter name='periodicSteps'>(stepInterval)</Parameter>
     <Parameter name='periodicTime'>(timeInterval)</Parameter>
     <Parameter name='periodicTime'>(timeInterval)</Parameter>
     <Parameter name='XPICOrder'>(order)</Parameter>
     <Parameter name='periodicCFL'>(CFLfactor)</Parameter>
    <Parameter name='fractionPIC'>(fractionPIC)</Parameter>
     <Parameter name='verbose'>(verbose)</Parameter>
     <Parameter name='verbose'>(verbose)</Parameter>
    <Parameter name='GridBCOption'>(BCoption)</Parameter>
  </Schedule>
  </Schedule>


where the parameters are:
where the parameters are:


* <tt>(stepInterval)</tt> and <tt>(timeInterval)</tt> - sets the frequency for running periodic XPIC(m) calculations. The <tt>(stepInterval)</tt> option sets number of time steps between each XPIC(m) calculation while <tt>(timeInterval)</tt> sets frequency in  [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]. If both are entered, the <tt>(stepInterval)</tt> is used. Default is every time step.
* <tt>(order)</tt> - Enter FMPM or XPIC order (the <tt>k</tt>) to use when doing periodic FMPM(k) or XPIC(k) calculations. Select <tt>(order></tt> using an <tt>FMPMOrder</tt> command to run using FMPM(k) or an <tt>XPICOrder</tt> command to run using XPIC(k). FMPM(k) is usually preferred; XPIC(k) is available mostly for comparisons to older methods.
* <tt>(XPICOrder)</tt> and <tt>(fractionPIC)</tt> - Enter XPIC order (the m in XPIC(m)) and fraction XPIC(m) (0 to 1) to use when doing periodic XPIC(m) calculations. See [[Damping Options]] for details on these settings.
* <tt>(stepInterval)</tt>, <tt>(timeInterval)</tt>, and <tt>(CFLfactor)</tt> - sets the frequency for running periodic FMPM(k) or XPIC(k) time steps for mechanics. The <tt>(stepInterval)</tt> option sets number of time steps between each FMPM(k) or XPIC(k) time step, <tt>(timeInterval)</tt> sets frequency in  [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]], and <tt>(CFLfactor)</tt> sets frequency relative to the basic time step for the momentum equation. If <tt>(stepInterval)</tt> is provided, it is used and the other two are ignored. If <tt>(stepInterval)</tt> is not provided, the time step is found from the <tt>(CFLfactor)</tt> (if provided) or from <tt>(timeInterval)</tt>. One of these three parameters is required to enable periodic FMPM(k) or XPIC(k) calculations.
* <tt>(verbose)</tt> - If a non-zero integer, a line is printed in output files every time XPIC(m) calculations are done. The default it 0.
* <tt>(verbose)</tt> - If a non-zero integer, a comment line is printed in the output file every time FMPM(k) or XPIC(k) time steps are done. The default is 0.
* <tt>(BCOption)</tt> - Use "lumped" to use lumped mass matrix methods for boundary conditions, "velocity" to only impose grid velocity conditions in the velocity field, or "combined" to do both. The default is "combined" for FMPM(k) and lumped for XPIC(k). Note that XPIC(k) cannot use "velocity" option (that setting will be changed to "lumped" if used). This option only affects calculations when <tt>(order)</tt> is greater than 1. The defaults are usually the best choice. Details on these options are in Ref. <ref name="FMPM"/>.
 
== Using FMPM(k) For Transport Properties ==
 
You can also use FMPM(k) for temperature (when doing [[Thermal Calculations|conduction calculations]]), for concentration (when doing [[Diffusion Calculations|diffusion calculations]]), for pore pressure (when doing [[Poroelasticity Calculations|poroelasticity calculations]]) or for [[Additional Transport Calculations|other transports calculations]]. FMPM(k) seems to provide significant improvement of transport modeling and can eliminate oscillations sometimes seen for transport value for particles within one cell. Note the transport modeling must use the same FMPM order as selected for mechanics. Furthermore, it will always uses FMPM(k) even if mechanics is using XPIC(k).
 
To use FMPM(k) for transport equations, select order [[#Using FMPM(k) or XPIC(k) For Mechanics|previous section]] and then select periodicity of FMPM(k) for conduction and/or diffusion with following task parameters:
 
Parameter periodicStepsConduction,(stepInterval)
Parameter periodicTimeConduction,(timeInterval)
Parameter periodicCFLConduction,(CFLfactor)
Parameter periodicStepsDiffusion#,(stepInterval)
Parameter periodicTimeDiffusion#,(timeInterval)
Parameter periodicCFLDiffusion#,(CFLfactor)
 
In <tt>XML</tt> files, this new parameter options within the <tt><CustomTasks></tt> block are
 
<Parameter name='periodicStepsConduction'>(stepInterval)</Parameter>
<Parameter name='periodicTimeConduction'>(timeInterval)</Parameter>
<Parameter name='periodicCFLConduction'>(CFLfactor)</Parameter>
<Parameter name='periodicStepsDiffusion#'>(stepInterval)</Parameter>
<Parameter name='periodicTimeDiffusion#'>(timeInterval)</Parameter>
  <Parameter name='periodicCFLDiffusion#'>(CFLfactor)</Parameter>
 
Here "#" in the diffusion commands should be "0" (or omitted) to set values for [[Diffusion Calculations|diffusion]] or [[Poroelasticity Calculations|poroelasticity]] calculations or can refer to [[Additional Transport Calculations|other transport]] calculations by number in the order they were created in the input command file by extra <tt>Diffusion</tt> commands (starting with 1 and not counting commands for [[Diffusion Calculations|diffusion]] or [[Poroelasticity Calculations|poroelasticity]] where ever they occurred).
 
If <tt>(stepInterval)&ge;1</tt>, its meaning is the same as in the [[#Using FMPM(k) or XPIC(k) For Mechanics|previous section]]. But if <tt>0&lt;(stepInterval)&lt;1</tt>, it invokes a new feature not available for mechanics modeling. In this range the simulation will blend FMPM(k) and FLIP methods using a fraction <tt>(stepInterval)</tt> of FMPM(k) and fraction <tt>1-(stepInterval)</tt> of FLIP. Because the full extra cost of FMPM(k) occurs on every time step, even if only used at a small fraction, this approach is less efficient than doing FMPM(k) periodically. In some simulations, however, it might give smoother results while a periodic method could have transients around each time step that uses FMPM(k).
 
The meanings of values <tt>(timeInterval)</tt> and <tt>(CFLfactor)</tt> are given in the [[#Using FMPM(k) or XPIC(k) For Mechanics|previous section]] except that CFL factor is applied to [[MPM_Methods_and_Simulation_Timing#Theory:_MPM_Time_Step|transport time step]] and not the simulation time step.
 
When using FMPM(k) for transport equations, you should never pick <tt>k=1</tt> because it causes too much numerical diffusion. Any higher order works, unless the FMPM(k) time steps are done too frequently. Because transport time step is usually much longer then mechanics time step, it is usually best to pick transport FMPM(k) frequency using the CFL parameter options and the chosen CFL factor should be 2 or higher for FMPM(2) and 0.5 or higher for FMPM(k&gt;2) to avoid numerical diffusion.<ref name="transFMPM"/> Alternatively, one could pick blended method (with <tt>0&lt;(stepInterval)&lt;1</tt>) and use a small enough fraction of FMPM(k) to avoid numerical diffusion.
 
== References ==
 
<references>
 
<ref name="XPIC">C. C. Hammerquist and J. A. Nairn, "A new method for material point method particle updates that reduces noise and enhances stability," <i>Computer Methods in Applied Mechanics and Engineering</i>, <b>318</b>, 724–738 (2017). ([http://www.cof.orst.edu/cof/wse/faculty/Nairn/papers/XPICPaper.pdf See PDF])</ref>
 
<ref name="FMPM">J. A. Nairn and C. C. Hammerquist, "Material point method simulations using an approximate full mass matrix inverse," <i>Computer Methods in Applied Mechanics and Engineering</i>, <b>377</b>, 113667 (2021). (2021). ([http://www.cof.orst.edu/cof/wse/faculty/Nairn/papers/FMPMPaper.pdf See PDF])</ref>
 
<ref name="transFMPM">J. A. Nairn, "Coupling transport properties to mechanics in the material point method using an approximate full capacity matrix inverse," <i>Computer Methods in Applied Mechanics and Engineering</i>, submitted (2023).</ref>
 
</references>

Latest revision as of 14:54, 15 November 2023

A custom task to use XPIC(k) and FMPM(k) methods on all or selected time steps

Introduction

The XPIC(k)[1] and FMPM(k)[2] methods are advanced methods that filter out unwanted noise (in the null space) without damping out useful information. Their drawback is that they add calculation time as order k increases. Many simulations (especially those with stability issues) will run better by using XPIC(k) or FMPM(k). The XPIC(k) and FMPM(k) methods can be done every time step or only on periodic time steps. This custom tasks adds XPIC(k) or FMPM(k) to any simulation and lets you select the frequency of those calculations.

Using FMPM(k) or XPIC(k) For Mechanics

MPM simulations will use standard FLIP method be default. To switch to FMPM(k) or XPIC(k) for all time steps (or just for some), schedule this task and specify all needed parameters. In scripted files, a PeriodicXPIC custom task is scheduled with

CustomTask PeriodicXPIC
Parameter FMPMOrder,(order)
(... or Parameter XPICOrder,(order))
Parameter periodicSteps,(stepInterval)
Parameter periodicTime,(timeInterval)
Parameter periodicCFL,(CFLfactor)
Parameter verbose,{verbose}
Parameter GridBCOption,(BCoption)

In XML files, this task is scheduled using a <Schedule> element, which must be within the single <CustomTasks> block:

<Schedule name='PeriodicXPIC'>
   <Parameter name='FMPMOrder'>(order)</Parameter>
   <!-- or <Parameter name='XPICOrder'>(order)</Parameter>-->
   <Parameter name='periodicSteps'>(stepInterval)</Parameter>
   <Parameter name='periodicTime'>(timeInterval)</Parameter>
   <Parameter name='periodicCFL'>(CFLfactor)</Parameter>
   <Parameter name='verbose'>(verbose)</Parameter>
   <Parameter name='GridBCOption'>(BCoption)</Parameter>
</Schedule>

where the parameters are:

  • (order) - Enter FMPM or XPIC order (the k) to use when doing periodic FMPM(k) or XPIC(k) calculations. Select (order> using an FMPMOrder command to run using FMPM(k) or an XPICOrder command to run using XPIC(k). FMPM(k) is usually preferred; XPIC(k) is available mostly for comparisons to older methods.
  • (stepInterval), (timeInterval), and (CFLfactor) - sets the frequency for running periodic FMPM(k) or XPIC(k) time steps for mechanics. The (stepInterval) option sets number of time steps between each FMPM(k) or XPIC(k) time step, (timeInterval) sets frequency in alt time units, and (CFLfactor) sets frequency relative to the basic time step for the momentum equation. If (stepInterval) is provided, it is used and the other two are ignored. If (stepInterval) is not provided, the time step is found from the (CFLfactor) (if provided) or from (timeInterval). One of these three parameters is required to enable periodic FMPM(k) or XPIC(k) calculations.
  • (verbose) - If a non-zero integer, a comment line is printed in the output file every time FMPM(k) or XPIC(k) time steps are done. The default is 0.
  • (BCOption) - Use "lumped" to use lumped mass matrix methods for boundary conditions, "velocity" to only impose grid velocity conditions in the velocity field, or "combined" to do both. The default is "combined" for FMPM(k) and lumped for XPIC(k). Note that XPIC(k) cannot use "velocity" option (that setting will be changed to "lumped" if used). This option only affects calculations when (order) is greater than 1. The defaults are usually the best choice. Details on these options are in Ref. [2].

Using FMPM(k) For Transport Properties

You can also use FMPM(k) for temperature (when doing conduction calculations), for concentration (when doing diffusion calculations), for pore pressure (when doing poroelasticity calculations) or for other transports calculations. FMPM(k) seems to provide significant improvement of transport modeling and can eliminate oscillations sometimes seen for transport value for particles within one cell. Note the transport modeling must use the same FMPM order as selected for mechanics. Furthermore, it will always uses FMPM(k) even if mechanics is using XPIC(k).

To use FMPM(k) for transport equations, select order previous section and then select periodicity of FMPM(k) for conduction and/or diffusion with following task parameters:

Parameter periodicStepsConduction,(stepInterval)
Parameter periodicTimeConduction,(timeInterval)
Parameter periodicCFLConduction,(CFLfactor)
Parameter periodicStepsDiffusion#,(stepInterval)
Parameter periodicTimeDiffusion#,(timeInterval)
Parameter periodicCFLDiffusion#,(CFLfactor)

In XML files, this new parameter options within the <CustomTasks> block are

<Parameter name='periodicStepsConduction'>(stepInterval)</Parameter>
<Parameter name='periodicTimeConduction'>(timeInterval)</Parameter>
<Parameter name='periodicCFLConduction'>(CFLfactor)</Parameter>
<Parameter name='periodicStepsDiffusion#'>(stepInterval)</Parameter>
<Parameter name='periodicTimeDiffusion#'>(timeInterval)</Parameter>
<Parameter name='periodicCFLDiffusion#'>(CFLfactor)</Parameter>

Here "#" in the diffusion commands should be "0" (or omitted) to set values for diffusion or poroelasticity calculations or can refer to other transport calculations by number in the order they were created in the input command file by extra Diffusion commands (starting with 1 and not counting commands for diffusion or poroelasticity where ever they occurred).

If (stepInterval)≥1, its meaning is the same as in the previous section. But if 0<(stepInterval)<1, it invokes a new feature not available for mechanics modeling. In this range the simulation will blend FMPM(k) and FLIP methods using a fraction (stepInterval) of FMPM(k) and fraction 1-(stepInterval) of FLIP. Because the full extra cost of FMPM(k) occurs on every time step, even if only used at a small fraction, this approach is less efficient than doing FMPM(k) periodically. In some simulations, however, it might give smoother results while a periodic method could have transients around each time step that uses FMPM(k).

The meanings of values (timeInterval) and (CFLfactor) are given in the previous section except that CFL factor is applied to transport time step and not the simulation time step.

When using FMPM(k) for transport equations, you should never pick k=1 because it causes too much numerical diffusion. Any higher order works, unless the FMPM(k) time steps are done too frequently. Because transport time step is usually much longer then mechanics time step, it is usually best to pick transport FMPM(k) frequency using the CFL parameter options and the chosen CFL factor should be 2 or higher for FMPM(2) and 0.5 or higher for FMPM(k>2) to avoid numerical diffusion.[3] Alternatively, one could pick blended method (with 0<(stepInterval)<1) and use a small enough fraction of FMPM(k) to avoid numerical diffusion.

References

  1. C. C. Hammerquist and J. A. Nairn, "A new method for material point method particle updates that reduces noise and enhances stability," Computer Methods in Applied Mechanics and Engineering, 318, 724–738 (2017). (See PDF)
  2. 2.0 2.1 J. A. Nairn and C. C. Hammerquist, "Material point method simulations using an approximate full mass matrix inverse," Computer Methods in Applied Mechanics and Engineering, 377, 113667 (2021). (2021). (See PDF)
  3. J. A. Nairn, "Coupling transport properties to mechanics in the material point method using an approximate full capacity matrix inverse," Computer Methods in Applied Mechanics and Engineering, submitted (2023).