NairnFEAMPM Icon

User-Defined Functions

When a user-defined function option is allowed in any command, you can enter any valid function of the following variables when doing MPM simulations:

For FEA calculations, the following variables are allowed and may refer to position of element centroid or node depending on the command:

When a function is used, it will be calculated using these variables and should return a result in the units expected by the command. Note that commands that allow functions may only allow a subset of these variables (due to command context). You can refer to each command for the allowed variables. For example, some MPM options require the function to depend only on time. Particle-based MPM boundary conditions let the function depend on clockwise particle rotational angle q about the z axis (in radians), which allows rotation of the boundary conditions with the particle. Note that q is particle rotation since the start of the simulation and will differ from material angle if the particle started with a non-zero orientation angle (i.e., the current material angle is the sum of q and its initial angle).

When setting up MPM simulations or FEA calculations, a few more variables are sometimes allowed:

Here (R,Z) are axisymmetric coordinates and (D,T) are polar coordinates, where D is distance from the origin to the (x,y) (or (R,Z) if axisymmetric) point and T is counter-clockwise angle from the positive x (or R if axisymmetric) axis to the point. These extra variables are only allowed in:

Some details on entering functions are: