Difference between revisions of "PropertyRamp Custom Task"

From OSUPDOCS
Jump to navigation Jump to search
 
(120 intermediate revisions by the same user not shown)
Line 3: Line 3:
== Introduction ==
== Introduction ==


Various particle properties, such as temperature or concentration, can induce residual stresses. One way to model residual stresses (such a residual thermal stresses) is set particle temperatureat the start of the calculations to a temperature that differs from the [[#Stress Free Temperature|stress free temperature]]. Such an instantaneous temperature change is analogous to impact loading and may cause stress and strain oscillations. To avoid these dynamic effects, it is better to ramp up particle temperature difference by using a thermal ramp by using this custom task.
In brief, this task allows you to apply certain particle properties slowly to reduce or eliminate dynamic effects that would be caused by more sudden changes. This tasks used to called <tt>ThermalRamp</tt>, because it was originally written only for ramping particle temperature, but now has been generalized to ramp or just set more properties (the old name is still accepted in input command files). The ramp can change all particles the same amount, change them according to a function of position, change them according to pixels in an image, or change them according to text values in a tab-delimited data file. Multiple ramps can be combined to ramp different properties or to ramp the same property at different times.


This task allows you to apply certain particle properties slower to model residual stresses without causes to many dynamic effects. The tasks is called <code>ThermalRamp</code>, because it was originally written only for ramping particle temperature. It has now been extended to also ramp particle concentration (when doing [[Diffusion Calculations|diffusion calculations]], pore pressure (when doing [[Poroelasticity Calculations|poroelasticity calculations]], out-of-plane stress (when doing [[Analysis Command|plane stress]] analysis) or out-of-plane strain (when doing [[Analysis Command|plane strain]] analysis. The ramp can change all particles the same amount, change them according to a function of position, or change them according to pixels in an image.
For example, consider the problem of finding residual thermal stresses in a composite material. One way solve this problem is set particle temperature at the start of the calculations to a temperature that differs from the [[#Stress Free Temperature|stress free temperature]]. Different materials in the composite would develop different residual stress according to their therrmomechanical properties. But application of the entire temperature change on the first time step is analogous to impact loading and would like cause stress and strain oscillations making analysis of residual stresses difficult. To avoid these dynamic effects, it is better to use this custom task ramp up particle temperatures slowly enough to avoid all dynamic artifacts.


A thermal ramp can be used without doing conduction calculations or it can be used in combination with conduction calculations and other [[#Thermal Boundary Conditions|thermal boundary conditions]]. Other ramps can also be used with corresponding [[MPM_Input_Files#Boundary_Conditions|boundary conditions]]. Multiple ramps can be combined to ramp different quantities or to ramp particle values at different times.
== Task Scheduling and Ramp Settings ==


== Task Scheduling ==
In scripted files, a <tt>PropertyRamp</tt> custom task is scheduled by starting with


In scripted files, a <tt>ThermalRamp</tt> custom task is scheduled by starting with
  CustomTask PropertyRamp
 
  CustomTask ThermalRamp
  Parameter property,(rampProp)
  Parameter property,(rampProp)
  Parameter time,(time)
  Parameter time,(time)
  Parameter start,(start)
  Parameter start,(start)
  Parameter sigmoidal,(style)
  Parameter sigmoidal,(style)
Parameter exponential,(lifetimes)
Parameter stretch,(stretch)


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


  <Schedule name='ThermalRamp'>
  <Schedule name='PropertyRamp'>
     <Parameter name='property'>(rampProp)</Parameter>
     <Parameter name='property'>(rampProp)</Parameter>
     <Parameter name='time'>(time)</Parameter>
     <Parameter name='time'>(time)</Parameter>
Line 30: Line 30:
where the parameters are:
where the parameters are:


* <tt>(rampProp)</tt> - This parameter determines which particle property is ramped. The options are:
<ul>
<li><tt>(rampProp)</tt> - This parameter determines which particle property is ramped. The options are:
<ol start="0">
<ol start="0">
<li>Ramp temperature</li>
<li>Ramp temperature (default setting). A temperature ramp can be used without doing conduction calculations, such as to calculate residual thermal stress in composite materials.</li>
<li>Ramp out-of-plane stress(zz) for [[Analysis Command|plane stress analysis]] or strain(zz) for [[Analysis Command|plane strain analysis]]. A task with this option is not allowed for unless running 2D plane stress or plane strain analyses. This option is used to implement [[Generalized Plane Stress and Strain]].</li>
<li>Ramp out-of-plane stress(zz) for [[Analysis Command|plane stress analysis]] or strain(zz) for [[Analysis Command|plane strain analysis]]. A task with this option is not allowed for unless running 2D plane stress or plane strain analyses. This option is used to implement [[Generalized Plane Stress and Strain]].</li>
<li>Ramp particle fluid concentration. For [[Diffusion Calculations|diffusion calculations]], this option will ramp particle concentration. For [[Poroelasticity Calculations|poroelasticity calculations]], this option will ramp particle pore pressure. A task with this option is not allowed for unless running either diffusion or poroelasticity calculations.</li>
<li>Ramp particle fluid concentration. For [[Diffusion Calculations|diffusion calculations]], this option will ramp particle concentration potential. For [[Poroelasticity Calculations|poroelasticity calculations]], this option will ramp particle pore pressure. A task with this option is not allowed unless the simulation is running either diffusion or poroelasticity calculations.</li>
<li>Set relative initiation stress for [[Material Models#Softening Materials|damage mechanics materials]]. Note that strength is set at the end of the first time step (rather than ramped) and any entered ramp settings are ignored.</li>
<li>Set relative toughness for [[Material Models#Softening Materials|damage mechanics materials]]. Note that toughness is set at the end of the first time step (rather than ramped) and any entered ramp settings are ignored.</li>
</ol>
</ol>
* <tt>(time)</tt> - Enter the time interval for applying ramp the particle property (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]). This parameter is optional; if omitted, enter ramp value is applied in one time step.
Options 3 and 4 are most commonly used with a BMP image of a Gaussian random field that models variations in strength or toughness.</li>
* <tt>(start)</tt> - Enter the start time for the ramp (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]). This parameter is optional; if omitted, the ramp starts at time zero. The ramp ends at time <tt>(start)</tt>+<tt>(time)</tt>.
<li><tt>(time)</tt> - Enter the time interval for applying ramp the particle property (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]). This parameter is optional; if omitted, enter ramp value is applied in one time step.</li>
* <tt>(style)</tt> - Enter 0 or 1 for a linear or sigmoidal ramp. A sigmoidal ramp may reduce dynamic effects at the start and end of the ramp. This parameter is optional; if omitted, the ramp is linear.
<li><tt>(start)</tt> - Enter the start time for the ramp (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]). This parameter is optional; if omitted, the ramp starts at time zero. The ramp ends at time <tt>(start)</tt>+<tt>(time)</tt>.</li>
<li><tt>(style)</tt>, <tt>(lifetimes)</tt>, and <tt>(stretch)</tt> - Determines the type of ramp as explained in the following.</li>
</ul>
 
[[File:RampStyle.png|right]]
 
The plot on the right shows four types of ramps. If <tt>(lifetimes)</tt> is not set (or is set less than or equal to zero), the ramp is determined by <tt>(style)</tt> &mdash; <tt>(style)=0</tt> gives a linear ramp, <tt>(style)&gt;0</tt> gives a sigmoidal ramp, and <tt>(style)&lt;0</tt> means a user-defined function provides the change rate (if no <tt>(style)</tt> is provided, the default is 0 or linear). The resulting ramps for <tt>(style)&ge;0</tt> as fraction of the maximum value are:
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<math>f = \frac{t}{t_{ramp}} \quad({\rm linear})
  \qquad  f = \frac{1+\exp(-k/2)}{1-\exp(-k)}\frac{1-\exp(-kt/t_{ramp})}{1+\exp\left(-k\left(\frac{t}{t_{ramp}}-\frac{1}{2}\right)\right)} \quad({\rm sigmoidal})</math>
 
where k defaults to 12 (but can be changed by providing <tt>(stretch)</tt>). A sigmoidal ramp may reduce dynamic effects at the start and end of the ramp.
 
If <tt>(lifetimes)</tt> is provided, the ramp changes to an exponential function (and the <tt>(style)=0</tt> setting is ignored):
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<math>f = \frac{1 - \exp\left[\left(-\frac{t}{\tau}\right)^\beta\right]}{1-\exp\left(-({\rm lifetimes})^\beta\right)}
\quad\mathrm{where} \quad \tau = \frac{t_{ramp}}{\rm \texttt{(lifetimes)}}</math>
 
and &beta; is value entered for the <tt>(stretch)</tt> parameter (it is set to 1 if not entered). Note that <tt>(lifetimes)</tt> is number of exponential lifetimes within <math>t_{ramp}</math>.


The above parameters create a ramp. The next sections explain four different ways to calculate the change in particle property applied during the tamp.
Note that in above equations, <i>t</i> is time since <tt>(start)</tt> (or actual <tt>t-(start)</tt>) and <math>t_{ramp}</math>
is <tt>(time)</tt>. All ramps go from zero for time <tt>(start)</tt> to one for time <tt>(start)+(time)</tt>.


===  Constant Property Change ===
== Calculate Property Change During the Ramp ==


To ramp all particles to the same change in selected particle property, use the <tt>Delta</tt> parameter:
The previous section defines the type of ramp. This next section explains different ways to calculate the change in particle property applied during the ramp.
 
=== Specified Property Change ===
 
To ramp all particles to the same property change or a position-dependent change, add the following two commands in scripted files:


  Parameter Delta,(delta)
  Parameter Delta,(delta)
Parameter scale,(function)


or in <tt>XML</tt> files, use:
or in <tt>XML</tt> files, add:


     <Parameter name='Delta'>(delta)</Parameter>
     <Parameter name='Delta'>(delta)</Parameter>
    <Parameter name='scale'>(function)</Parameter>


where
where


* <tt>(delta)</tt> - Enter the final property change to apply to all particles (or the magnitude of the change after the ramp is done). The ramp will apply this change incrementally in either at either a linear or a sigmoidal rate (depending on the <tt>style</tt> parameter setting) during the duration of the ramp. Once the ramp is done, no more changes will be made.
* <tt>(delta)</tt> - the final property change to apply to all particles (or the magnitude of the change after the ramp is done). The ramp will [[#Incremental Changes on Particles|apply this change incrementally]] by the chosen ramp style during the duration of the ramp. Once the ramp is done, no more changes will be made.
* <tt>(function)</tt> - [[User Defined Functions|user-defined function]] of time (in [[ConsistentUnits Command#Legacy and Consistent Units|alt time units]]) and particle position (in [[ConsistentUnits Command#Legacy and Consistent Units|length units]]). When <tt>(scale)&ge;0</tt>, the increment in value on any particle will be the calculated increment times the value of <tt>(function)</tt>. When <tt>(scale)&lt;0</tt>, the function is required and gives property change rate [[ConsistentUnits Command#Legacy and Consistent Units|per alt time units]] (see [[#Incremental Changes on Particles|below]] for more details). Because this function is evaluated for every particle on every time step, complicated functions will slow down simulations during the ramp period.


The units for <tt>(deltat)</tt> depend on property being ramped:
The units for <tt>(delta)</tt> depend on property being ramped:


* Temperature - in degrees
* Temperature - in degrees
* Stress(zz) - in [[ConsistentUnits Command#Legacy and Consistent Units|pressure units]]
* Stress(zz) - in [[ConsistentUnits Command#Legacy and Consistent Units|pressure units]]
* Strain(zz) - in percent strain
* Strain(zz) - in percent strain
* Concentration - in [[Diffusion Calculations#Diffusion Material Properties|dimensionless concentration potential]] (and all changes will be constrain particle value to the range 0 to 1)
* Concentration - in [[Diffusion Calculations#Diffusion Material Properties|dimensionless concentration potential]]
* Pore Pressure - in [[ConsistentUnits Command#Legacy and Consistent Units|pressure units]]
* Pore Pressure - in [[ConsistentUnits Command#Legacy and Consistent Units|pressure units]]
* Relative Initiation Stress - dimensionless
* Relative Toughness - dimensionless
=== Incremental Changes on Particles ===


=== Position Dependent Thermal Field ===
When <tt>(style)&ge;0</tt>, the first step is to calculate the current ramp value <math>f(t)</math>, that increases from 0 to 1 over the property ramp <tt>(time)</tt>. Then, for the current time step, the increment in property, <math>\Delta P</math>, is given by:


To apply a position-dependent thermal field to all particles, add the following two commands in scripted files:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<math>\Delta P = u(\vec x_p,t)(f(t+\Delta t)-f(t)){\tt (delta)}</math>


Parameter Delta,(deltaT)
where <math>u(\vec x_p,t)</math> is the optional user-defined function of particle position and time (the function is not used when setting properties from image or text data). The Relative Initiation Stress and Toughness are not applied incrementally (which does not make sense). Instead, they are set to value:
Parameter scale,(function)
 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<math>R = u(\vec x_p,t)f(t){\tt (delta)}</math>
 
These relative values are typically applied in a single time step where <math>f(t)=1</math> and <math>u(\vec x_p,t)</math> can define position-dependent relative values (the function is not used when setting properties from image or text data). By this approach, they are all set on the first time step.
 
When <tt>(style)&lt;0</tt>, the required user-defined function directly sets the property change rate resulting in


or in <tt>XML</tt> files, add:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<math>\Delta P = u(\vec x_p,t)\Delta t</math>


    <Parameter name='Delta'>(deltaT)</Parameter>
Note that input <tt>(delta)</tt> is ignored. Because Relative Initiation Stress and Toughness are not applied incrementally, that are just set using the function or:
    <Parameter name='scale'>(function)</Parameter>


where <tt>(deltaT)</tt> is the same as [[#Constant Temperature Change|above]], but the final temperature on each particle can be scaled using
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<math>R = u(\vec x_p,t)</math>


* <tt>(function)</tt> - when this optional parameter is used, the applied <tt>(deltaT)</tt> ramp is scaled by any [[User Defined Functions|user-defined function]] of time and particle position. The final temperature on any particle will be <tt>(deltaT)</tt> times the value of <tt>(function)</tt> evaluated at the particle location.
Typically this is done on one time step and the function only depends on position to allow some position-dependent failure properties. More commonly, Relative Initiation Stress and Toughness are set with image or text data.


=== Thermal Field from Image Data ===
=== Property Change from Image Data ===


An alternative method for ramping up temperature is to ramp to any distribution of temperatures as represented within a bit mapped file. In scripted files, a <tt>ThermalRamp</tt> custom task for file input adds the following parameters
An alternative method for ramping up property change is to ramp to any distribution of particle values as represented within a bit mapped file. In scripted files, a <tt>PropertyRamp</tt> custom task for file input adds the following parameters


  Parameter file,(bmpFileName)
  Parameter file,(bmpFileName)
Line 91: Line 134:
  Parameter zlevel,(zO)
  Parameter zlevel,(zO)
  Parameter flipped,(flipped)
  Parameter flipped,(flipped)
  Parameter DeltaMin,(deltaTmin)
  Parameter DeltaMin,(deltaMin)
  Parameter DeltaMax,(deltaTmax)
  Parameter DeltaMax,(deltaMax)


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 103: Line 146:
     <Parameter name='zlevel'>(zO)</Parameter>
     <Parameter name='zlevel'>(zO)</Parameter>
     <Parameter name='flipped'>(flipped)</Parameter>
     <Parameter name='flipped'>(flipped)</Parameter>
     <Parameter name='DeltaMin'>(deltaTmin)</Parameter>
     <Parameter name='DeltaMin'>(deltaMin)</Parameter>
     <Parameter name='DeltaMax'>(deltaTmax)</Parameter>
     <Parameter name='DeltaMax'>(deltaMax)</Parameter>


where
where


* <tt>(bmpFile)</tt> is the full or relative path name to a BMP file. The file must be an uncompressed, gray-scale, BMP file with 8 or less bits per pixel. The most useful is an 8-bit file with 256 levels of gray.
* <tt>(bmpFileName)</tt> is the full or relative path name to a BMP file. Most BMP formats are accepted and data are converted to 256 levels of gray (or intensity for RGB files).
* <tt>(width)</tt> and <tt>(height)</tt> specify the width and height for the image, but there are [[BMPRegion Command#Image Width and Height|several ways to specify them]].
* <tt>(width)</tt> and <tt>(height)</tt> specify the width and height for the image, but there are [[BMPRegion Command#Image Width and Height|several ways to specify them]].
*<tt>(xO)</tt>, <tt>(yO)</tt>, and <tt>(zO)</tt> give the (x,y,z) coordinate for the origin of the image when mapped to the grid or mesh in [[ConsistentUnits Command#Legacy and Consistent Units|length units]]. The <tt>(zO)</tt> coordinate is only needed for 3D calculations and gives z value for each 2D slice of the x-y plane of the data.
*<tt>(xO)</tt>, <tt>(yO)</tt>, and <tt>(zO)</tt> give the (x,y,z) coordinate for the origin of the image when mapped to the grid or mesh in [[ConsistentUnits Command#Legacy and Consistent Units|length units]]. The <tt>(zO)</tt> coordinate is only needed for 3D calculations and gives z value for each 2D slice of the x-y plane of the data.
* <tt>(flipped)</tt> is 0 (default) or 1; if it is 1, the origin will move to the upper-left corner of the image with y increasing in the downward direction and x increasing to the right. This change will flip the image in the y direction in the analysis compared to the image graphics.
* <tt>(flipped)</tt> is 0 (default) or 1; if it is 1, the origin will move to the upper-left corner of the image with y increasing in the downward direction and x increasing to the right. This change will flip the image in the y direction in the analysis compared to the image graphics.
* <tt>(deltaTmin)</tt> and <tt>(deltaTmax)</tt> map gray values 0 and 255 to a temperature difference. All other gray values are linearly interpolated between these value.
* <tt>(deltaMin)</tt> and <tt>(deltaMax)</tt> map gray values 0 and 255 to a property change. All other gray values are linearly interpolated between these values.


In other words, the temperature applied to particles under an image is:
In other words, the property change applied to particles replaces the <tt>(delta)</tt> parameter [[#Constant Property Change|above]] with


&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<math>\Delta T = (deltaTmin) + {\bigl((deltaTmax)-(deltaTmin)\bigr) g\over 255} </math>
<tt>(delta)</tt> <math>= (deltaMin) + {\bigl((deltaMax)-(deltaMin)\bigr) g\over 255} </math>
 
where <i>g</i> is the average gray value over the domain of the particle. This [[#Incremental Changes on Particles|change is applied incrementally]] by the chosen ramp style over the duration of the ramp.
 
=== Property Change from Text Data File ===
 
An alternative method for ramping up property change is to ramp to any distribution of particle values as represented in a tab-delimited  or command-separated-values spread sheet of text data. In scripted files, a <tt>PropertyRamp</tt> custom task for text-file input adds the following parameters
 
Parameter file,(txtFileName)
Parameter width,(width)
Parameter height,(height)
Parameter xorigin,(xO)
Parameter yorigin,(yO)
Parameter zlevel,(zO)
Parameter DeltaMin,(deltaMin)
Parameter DeltaMax,(deltaMax)
 
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:
 
    <Parameter name='file'>(txtFileName)</Parameter>
    <Parameter name='width'>(width)</Parameter>
    <Parameter name='height'>(height)</Parameter>
    <Parameter name='xorigin'>(xO)</Parameter>
    <Parameter name='yorigin'>(yO)</Parameter>
    <Parameter name='zlevel'>(zO)</Parameter>
    <Parameter name='DeltaMin'>(deltaMin)</Parameter>
    <Parameter name='DeltaMax'>(deltaMax)</Parameter>
 
where
 
* <tt>(txtFileName)</tt> is the full or relative path name to a tab-delimited or comma-separated-values plain-text file.
* <tt>(deltaMin)</tt> and <tt>(deltaMax)</tt> map numerical values in the table to <tt>(delta)=(deltaMin)+(deltaMax)*x</tt> where x if data value in the table. This [[#Incremental Changes on Particles|change is applied incrementally]] by the chosen ramp style over the duration of the ramp.


where <tt>g</tt> is the average gray value over the domain of the particle.
All other properties are the same as described for [[#Property Change from Image Data|input using image data]] except that reference to pixels in BMP files means data cells in text files.


=== Thermal Field from Image Blocks ===
=== Property Change from Level Sets ===


Alternatively, the particle temperature can be determined for ranges of intensity by the same method that bit mapped files can be used to [[BMPRegion Command|assign particle material type]]. This method is done by replacing <tt>(deltaTmin)</tt> and <tt>(deltaTmax)</tt> with one or more <tt>map</tt> commands. In scripted files, the new commands are:
Alternatively, the particle property can be determined from ranges of gray scale intensity (from BMP or a text file) by the same method that bit mapped files can be used to [[BMPRegion Command|assign particle material type]]. This method is done by replacing <tt>(deltaMin)</tt> and <tt>(deltaMax)</tt> with one or more <tt>map</tt> commands. In scripted files, the new commands are:


  Parameter "map #1 #2",(deltaT)
  Parameter "map #1 #2",(delta)
  Parameter "map #1 #2",(deltaT)
  Parameter "map #1 #2",(delta)


or in <tt>XML</tt> files, they are:
or in <tt>XML</tt> files, they are:


     <Parameter name='map #1 #2'>(deltaT)</Parameter>
     <Parameter name='map #1 #2'>(delta)</Parameter>
     <Parameter name='map #1 #2'>(deltaT)</Parameter>
     <Parameter name='map #1 #2'>(delta)</Parameter>


where
where


* <tt>#1</tt> and <tt>#2</tt> are a range of gray scale values (from 0 to 255 with #2 &ge; #1). These values must be embedded in the text of the parameter name, which must begin in "map" (''e.g''., "map 20 75").
* <tt>#1</tt> and <tt>#2</tt> are a range of gray scale values (from 0 to 255 with #2 &ge; #1 and text files must use this same range of values). These values must be embedded in the text of the parameter name, which must begin in "map" (''e.g''., "map 20 75").
* <tt>(deltaT)</tt> is temperature difference to apply to particles under regions within the gray scale range specified by <tt>#1</tt> and <tt>#2</tt>.
* <tt>(delta)</tt> is property difference to apply to all particles under regions within the gray scale range specified by <tt>#1</tt> and <tt>#2</tt>.


Unlike the [[#Thermal Field from Image Data|previous section]], this method selects <tt>(deltaT)</tt> by the most prominent matched range under the particle domain and not by the average gray value. This method is actually identical to method used to assign material types in a [[BMPRegion Command]]. Because the methods are the same, one could use the same image to assign material types and thermal ramps and this method would let you pick a different temperature difference for each material type.
Unlike the [[#Property Change from Image Data|previous section]], this method selects <tt>(delta)</tt> by the most prominent matched range under the particle domain and not by the average gray value. This method is actually identical to method used to assign material types in a [[BMPRegion Command]]. Because the methods are the same, one could use the same image to assign material types and then use this type of property ramp to pick different property values for each material type.


== Multiple Thermal Ramps ==
== Multiple Property Ramps ==


A single calculation may use multiple thermal ramps and the resulting temperature changes will be sum of all ramp values. This feature can be used to increase and then decrease temperature or even to have overlapping ramps.
A single calculation may use multiple property ramps and the resulting property setting will be sum of all ramp values. This feature can be used to increase and then decrease a property or even to have overlapping ramps. Because relative initiation stress and relative toughness are set, instead of ramped, multiple ramps for those properties do not make sense (if used, the values will be set to the last defined task values).

Latest revision as of 15:47, 2 May 2024

A custom task to apply temperature difference to all particles.

Introduction

In brief, this task allows you to apply certain particle properties slowly to reduce or eliminate dynamic effects that would be caused by more sudden changes. This tasks used to called ThermalRamp, because it was originally written only for ramping particle temperature, but now has been generalized to ramp or just set more properties (the old name is still accepted in input command files). The ramp can change all particles the same amount, change them according to a function of position, change them according to pixels in an image, or change them according to text values in a tab-delimited data file. Multiple ramps can be combined to ramp different properties or to ramp the same property at different times.

For example, consider the problem of finding residual thermal stresses in a composite material. One way solve this problem is set particle temperature at the start of the calculations to a temperature that differs from the stress free temperature. Different materials in the composite would develop different residual stress according to their therrmomechanical properties. But application of the entire temperature change on the first time step is analogous to impact loading and would like cause stress and strain oscillations making analysis of residual stresses difficult. To avoid these dynamic effects, it is better to use this custom task ramp up particle temperatures slowly enough to avoid all dynamic artifacts.

Task Scheduling and Ramp Settings

In scripted files, a PropertyRamp custom task is scheduled by starting with

CustomTask PropertyRamp
Parameter property,(rampProp)
Parameter time,(time)
Parameter start,(start)
Parameter sigmoidal,(style)
Parameter exponential,(lifetimes)
Parameter stretch,(stretch)

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

<Schedule name='PropertyRamp'>
   <Parameter name='property'>(rampProp)</Parameter>
   <Parameter name='time'>(time)</Parameter>
   <Parameter name='start'>(start)</Parameter>
   <Parameter name='sigmoidal'>(style)</Parameter>
</Schedule>

where the parameters are:

  • (rampProp) - This parameter determines which particle property is ramped. The options are:
    1. Ramp temperature (default setting). A temperature ramp can be used without doing conduction calculations, such as to calculate residual thermal stress in composite materials.
    2. Ramp out-of-plane stress(zz) for plane stress analysis or strain(zz) for plane strain analysis. A task with this option is not allowed for unless running 2D plane stress or plane strain analyses. This option is used to implement Generalized Plane Stress and Strain.
    3. Ramp particle fluid concentration. For diffusion calculations, this option will ramp particle concentration potential. For poroelasticity calculations, this option will ramp particle pore pressure. A task with this option is not allowed unless the simulation is running either diffusion or poroelasticity calculations.
    4. Set relative initiation stress for damage mechanics materials. Note that strength is set at the end of the first time step (rather than ramped) and any entered ramp settings are ignored.
    5. Set relative toughness for damage mechanics materials. Note that toughness is set at the end of the first time step (rather than ramped) and any entered ramp settings are ignored.
    Options 3 and 4 are most commonly used with a BMP image of a Gaussian random field that models variations in strength or toughness.
  • (time) - Enter the time interval for applying ramp the particle property (in alt time units). This parameter is optional; if omitted, enter ramp value is applied in one time step.
  • (start) - Enter the start time for the ramp (in alt time units). This parameter is optional; if omitted, the ramp starts at time zero. The ramp ends at time (start)+(time).
  • (style), (lifetimes), and (stretch) - Determines the type of ramp as explained in the following.
RampStyle.png

The plot on the right shows four types of ramps. If (lifetimes) is not set (or is set less than or equal to zero), the ramp is determined by (style)(style)=0 gives a linear ramp, (style)>0 gives a sigmoidal ramp, and (style)<0 means a user-defined function provides the change rate (if no (style) is provided, the default is 0 or linear). The resulting ramps for (style)≥0 as fraction of the maximum value are:

      [math]\displaystyle{ f = \frac{t}{t_{ramp}} \quad({\rm linear}) \qquad f = \frac{1+\exp(-k/2)}{1-\exp(-k)}\frac{1-\exp(-kt/t_{ramp})}{1+\exp\left(-k\left(\frac{t}{t_{ramp}}-\frac{1}{2}\right)\right)} \quad({\rm sigmoidal}) }[/math]

where k defaults to 12 (but can be changed by providing (stretch)). A sigmoidal ramp may reduce dynamic effects at the start and end of the ramp.

If (lifetimes) is provided, the ramp changes to an exponential function (and the (style)=0 setting is ignored):

      [math]\displaystyle{ f = \frac{1 - \exp\left[\left(-\frac{t}{\tau}\right)^\beta\right]}{1-\exp\left(-({\rm lifetimes})^\beta\right)} \quad\mathrm{where} \quad \tau = \frac{t_{ramp}}{\rm \texttt{(lifetimes)}} }[/math]

and β is value entered for the (stretch) parameter (it is set to 1 if not entered). Note that (lifetimes) is number of exponential lifetimes within [math]\displaystyle{ t_{ramp} }[/math].

Note that in above equations, t is time since (start) (or actual t-(start)) and [math]\displaystyle{ t_{ramp} }[/math] is (time). All ramps go from zero for time (start) to one for time (start)+(time).

Calculate Property Change During the Ramp

The previous section defines the type of ramp. This next section explains different ways to calculate the change in particle property applied during the ramp.

Specified Property Change

To ramp all particles to the same property change or a position-dependent change, add the following two commands in scripted files:

Parameter Delta,(delta)
Parameter scale,(function)

or in XML files, add:

   <Parameter name='Delta'>(delta)</Parameter>
   <Parameter name='scale'>(function)</Parameter>

where

  • (delta) - the final property change to apply to all particles (or the magnitude of the change after the ramp is done). The ramp will apply this change incrementally by the chosen ramp style during the duration of the ramp. Once the ramp is done, no more changes will be made.
  • (function) - user-defined function of time (in alt time units) and particle position (in length units). When (scale)≥0, the increment in value on any particle will be the calculated increment times the value of (function). When (scale)<0, the function is required and gives property change rate per alt time units (see below for more details). Because this function is evaluated for every particle on every time step, complicated functions will slow down simulations during the ramp period.

The units for (delta) depend on property being ramped:

Incremental Changes on Particles

When (style)≥0, the first step is to calculate the current ramp value [math]\displaystyle{ f(t) }[/math], that increases from 0 to 1 over the property ramp (time). Then, for the current time step, the increment in property, [math]\displaystyle{ \Delta P }[/math], is given by:

      [math]\displaystyle{ \Delta P = u(\vec x_p,t)(f(t+\Delta t)-f(t)){\tt (delta)} }[/math]

where [math]\displaystyle{ u(\vec x_p,t) }[/math] is the optional user-defined function of particle position and time (the function is not used when setting properties from image or text data). The Relative Initiation Stress and Toughness are not applied incrementally (which does not make sense). Instead, they are set to value:

      [math]\displaystyle{ R = u(\vec x_p,t)f(t){\tt (delta)} }[/math]

These relative values are typically applied in a single time step where [math]\displaystyle{ f(t)=1 }[/math] and [math]\displaystyle{ u(\vec x_p,t) }[/math] can define position-dependent relative values (the function is not used when setting properties from image or text data). By this approach, they are all set on the first time step.

When (style)<0, the required user-defined function directly sets the property change rate resulting in

      [math]\displaystyle{ \Delta P = u(\vec x_p,t)\Delta t }[/math]

Note that input (delta) is ignored. Because Relative Initiation Stress and Toughness are not applied incrementally, that are just set using the function or:

      [math]\displaystyle{ R = u(\vec x_p,t) }[/math]

Typically this is done on one time step and the function only depends on position to allow some position-dependent failure properties. More commonly, Relative Initiation Stress and Toughness are set with image or text data.

Property Change from Image Data

An alternative method for ramping up property change is to ramp to any distribution of particle values as represented within a bit mapped file. In scripted files, a PropertyRamp custom task for file input adds the following parameters

Parameter file,(bmpFileName)
Parameter width,(width)
Parameter height,(height)
Parameter xorigin,(xO)
Parameter yorigin,(yO)
Parameter zlevel,(zO)
Parameter flipped,(flipped)
Parameter DeltaMin,(deltaMin)
Parameter DeltaMax,(deltaMax)

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

   <Parameter name='file'>(bmpFileName)</Parameter>
   <Parameter name='width'>(width)</Parameter>
   <Parameter name='height'>(height)</Parameter>
   <Parameter name='xorigin'>(xO)</Parameter>
   <Parameter name='yorigin'>(yO)</Parameter>
   <Parameter name='zlevel'>(zO)</Parameter>
   <Parameter name='flipped'>(flipped)</Parameter>
   <Parameter name='DeltaMin'>(deltaMin)</Parameter>
   <Parameter name='DeltaMax'>(deltaMax)</Parameter>

where

  • (bmpFileName) is the full or relative path name to a BMP file. Most BMP formats are accepted and data are converted to 256 levels of gray (or intensity for RGB files).
  • (width) and (height) specify the width and height for the image, but there are several ways to specify them.
  • (xO), (yO), and (zO) give the (x,y,z) coordinate for the origin of the image when mapped to the grid or mesh in length units. The (zO) coordinate is only needed for 3D calculations and gives z value for each 2D slice of the x-y plane of the data.
  • (flipped) is 0 (default) or 1; if it is 1, the origin will move to the upper-left corner of the image with y increasing in the downward direction and x increasing to the right. This change will flip the image in the y direction in the analysis compared to the image graphics.
  • (deltaMin) and (deltaMax) map gray values 0 and 255 to a property change. All other gray values are linearly interpolated between these values.

In other words, the property change applied to particles replaces the (delta) parameter above with

      (delta) [math]\displaystyle{ = (deltaMin) + {\bigl((deltaMax)-(deltaMin)\bigr) g\over 255} }[/math]

where g is the average gray value over the domain of the particle. This change is applied incrementally by the chosen ramp style over the duration of the ramp.

Property Change from Text Data File

An alternative method for ramping up property change is to ramp to any distribution of particle values as represented in a tab-delimited or command-separated-values spread sheet of text data. In scripted files, a PropertyRamp custom task for text-file input adds the following parameters

Parameter file,(txtFileName)
Parameter width,(width)
Parameter height,(height)
Parameter xorigin,(xO)
Parameter yorigin,(yO)
Parameter zlevel,(zO)
Parameter DeltaMin,(deltaMin)
Parameter DeltaMax,(deltaMax)

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

   <Parameter name='file'>(txtFileName)</Parameter>
   <Parameter name='width'>(width)</Parameter>
   <Parameter name='height'>(height)</Parameter>
   <Parameter name='xorigin'>(xO)</Parameter>
   <Parameter name='yorigin'>(yO)</Parameter>
   <Parameter name='zlevel'>(zO)</Parameter>
   <Parameter name='DeltaMin'>(deltaMin)</Parameter>
   <Parameter name='DeltaMax'>(deltaMax)</Parameter>

where

  • (txtFileName) is the full or relative path name to a tab-delimited or comma-separated-values plain-text file.
  • (deltaMin) and (deltaMax) map numerical values in the table to (delta)=(deltaMin)+(deltaMax)*x where x if data value in the table. This change is applied incrementally by the chosen ramp style over the duration of the ramp.

All other properties are the same as described for input using image data except that reference to pixels in BMP files means data cells in text files.

Property Change from Level Sets

Alternatively, the particle property can be determined from ranges of gray scale intensity (from BMP or a text file) by the same method that bit mapped files can be used to assign particle material type. This method is done by replacing (deltaMin) and (deltaMax) with one or more map commands. In scripted files, the new commands are:

Parameter "map #1 #2",(delta)
Parameter "map #1 #2",(delta)

or in XML files, they are:

   <Parameter name='map #1 #2'>(delta)</Parameter>
   <Parameter name='map #1 #2'>(delta)</Parameter>

where

  • #1 and #2 are a range of gray scale values (from 0 to 255 with #2 ≥ #1 and text files must use this same range of values). These values must be embedded in the text of the parameter name, which must begin in "map" (e.g., "map 20 75").
  • (delta) is property difference to apply to all particles under regions within the gray scale range specified by #1 and #2.

Unlike the previous section, this method selects (delta) by the most prominent matched range under the particle domain and not by the average gray value. This method is actually identical to method used to assign material types in a BMPRegion Command. Because the methods are the same, one could use the same image to assign material types and then use this type of property ramp to pick different property values for each material type.

Multiple Property Ramps

A single calculation may use multiple property ramps and the resulting property setting will be sum of all ramp values. This feature can be used to increase and then decrease a property or even to have overlapping ramps. Because relative initiation stress and relative toughness are set, instead of ramped, multiple ramps for those properties do not make sense (if used, the values will be set to the last defined task values).