D3PLOT 22.1

"Simple Formula"

"Simple Formula"

This method calculates results from a "simple" mathematical formula using built-in data components and standard maths operations.

All calculations are performed using floating point arithmetic and produce a single result, thus:

  • Scalar components are evaluated from a single formula
  • Vector components use three (independent) formulae: one for each of [x,y,z]
  • Tensor components use six formulae, one for each of[xx,yy,zz,xy,yz,zx]

Syntax rules for Simple Formulae

Formulae follow typical "computer programming" syntax, using commonly understood operators.

Operators supported:
*, /, +, - Multiply, divide, plus and minus * and / take precedence over + and -
** and ^ To the power of. Thus "x**2" is "x squared" Note that "^" is Fortran syntax, not the C "exclusive OR" operator.
% Modulus operator (x % y is remainder of x / y) There is also a "mod" maths function.
( ... ) Brackets may be nested to any (reasonable) level (...) take precedence over all other operators
Note: all arithmetic is floating point, thus both "5.0 / 2.0" and "5 / 2" will both deliver the answer 2.5

A formula must be a single line, up to 256 characters long.

Standard D3PLOT "built in" data components supported

Category Acronym Description Acronym Description
Nodal data

bx
by
bz

cx
cy
cz

dx
dy
dz
dm

vx
vy
vz
vm

ax
ay
az
am

Basic X coordinate
Basic Y coordinate
Basic Z coordinate

Current X coordinate
Current Y coordinate
Current Z coordinate

X displacement
Y displacement
Z displacement
Displacement magnitude

X velocity
Y velocity
Z velocity
Velocity magnitude

X acceleration
Y acceleration
Z acceleration
Acceleration magnitude

rdx
rdy
rdz
rdm

rvx
rvy
rvz
rvm

rax
ray
raz
ram

temp
tbot
tmid
ttop

tfx
tfy
tfz
tfm

dtdt

X rotation displacement
Y rotation displacement
Z rotation displacement
Rotation displacement magnitude

X rotation velocity
Y rotation velocity
Z rotation velocity
Rotation velocity magnitude

X rotation acceleration
Y rotation acceleration
Z rotation acceleration
Rotation acceleration magnitude

Temperature
Nodal (shell) bottom surface temperature
Nodal (shell) middle surface temperature
Nodal (shell) top surface temperature

X temperature flux
Y temperature flux
Z temperature flux
Temperature magnitude

dTemp / dTime

Solid and
shell data
Stress and strain tensor-derived data is extracted in the global frame of reference unless the " l " (for "local") suffix is added to the component acronym, in which case it is extracted in the element local system. See below for how the Frame of Reference transformation applies to Simple Formula components.
Global tensor components sxx
syy
szz

sxy or syx
syz or szy
szx or sxz
XX stress
YY stress
ZZ stress
XY stress ( symmetric )
YZ stress ( ditto )
ZX stress ( ditto)
exx
eyy
ezz

exy or eyx
eyz or ezy
ezx or exz
XX strain
YY strain
ZZ strain
XY strain ( symmetric )
YZ strain ( ditto )
ZX strain ( ditto )
Element Local tensor components sxxl
syyl
szzl

sxyl or syxl
syzl or szyl
szxl or sxzl
XX stress
YY stress
ZZ stress
XY stress ( symmetric )
YZ stress ( ditto )
ZX stress ( ditto)
exxl
eyyl
ezzl

exyl or eyxl
eyzl or ezyl
ezxl or exzl
XX strain
YY strain
ZZ strain
XY strain ( symmetric )
YZ strain ( ditto )
ZX strain ( ditto )
Non-directional components derived from tensor data

svon
smax
smid
smin
sav
sms

evon
emax
emid
emin
eav
ems

von Mises stress
Max principal stress
Mid principal stress
Min principal stress
Average stress (pressure)
Max shear stress

von Mises strain
Max principal strain
Mid principal strain
Min principal strain
Average strain (pressure)
Max shear strain

epl

erate
pemag

engmaj
engmin
engthk

Effective plastic strain

Strain rate
Plastic strain magnitude

Engineering Major strain
Engineering Minor strain
Engineering Thickness strain
Non-directional components from Nastran OP2 file

sen
senp
send

ken
kenp
kend

Strain energy
Strain energy percentage
Strain energy density

Kinetic energy
Kinetic energy percentage
Kinetic energy density

enl
enlp
enld

Energy loss
Energy loss percentage
Energy loss density

Shell only data rfx
rfy
rfxy
rqx
rqy
rmx
rmy
rmxy

s2max
s2min

e2max
e2min
eratio

Fx resultant force
Fy resultant force
Fxy resultant force
Qx resultant force
Qy resultant force
Mx resultant moment
My resultant moment
Mxy resultant moment

2D (in plane) max princ stress
2D (in plane) min princ stress

2D (in plane) max princ strain
2D (in plane) min princ strain
2D (in plane) princ strain ratio

thk
area

eden
hgen
tstp
mass
madd

Shell Thickness
Shell Area

Internal energy density
Hourglass energy
Timestep
Mass
Added mass

Solid only data erate Strain rate vol
rvol
Element Volume
Element Relative volume
Beam only data

bfx
bfy
bfz
bfr

bmxx
bmyy
bmzz
brm

bsxx
bsyx
or bsxy
bszx
or bszx
bep
beax

bsax
bpe1
bpe2
bry1
bry2
brz1
brz2
bmy1
bmy2
bmz1
bmz2
baen
bie
brxx

Axial force
YY shear force
ZZ shear force
Resultant force

XX torsional moment
YY bending moment
ZZ bending moment
Resultant moment

XX axial stress
YX shear stress ( symmetric )
ZX shear stress ( ditto )
Plastic strain
Axial strain

Total axial strain
Plastic energy at end 1
Plastic energy at end 2
Y rotation end 1
Y rotation end 2
Z rotation end 1
Z rotation end 2
Y moment end 1
Y moment end 2
Z moment end 1
Z moment end 2
Axial energy
Internal energy
Torsional rotation

bbed
baed
bied

bsen
bsenp
bsend

bken
bkenp
bkend

benl
benlp
benld

Bending energy density
Axial energy density
Internal energy density

Strain energy
Strain energy percentage
Strain energy density

Kinetic energy
Kinetic energy percentage
Kinetic energy density

Energy loss
Energy loss percentage
Energy loss density

"Extra" and
ALE data
sox n
shx n
Solid Extra component #n
Shell Extra component #n

ammg n
amss n

adens
adomf

Ale Multi-Matl group #n
Mass of MM group #n

Ale density
Ale dominant fraction

Contact data
csn
cst
csx
csy
carea

Contact Normal Stress
Contact Tangential stress
Contact local X stress
Contact local Y stress
Contact segment area

These are contact segment
data averaged at nodes

cfgx
cfgy
cfgz
cflx
cfly
cflz
cfm

Contact global X force
Contact global Y force
Contact global Z force
Contact local X force
Contact local Y force
Contact local Z force
Contact force magnitude

LSDA (binout) data

(Only available if both
a ZTF file and a binout
file have been read.)

sw_f
sw_s
sw_trsn
sw_fail
sw_time

sp_f
sp_e
sp_m
sp_r

xsec_f_x
xsec_f_y
xsec_f_z
xsec_m_x
xsec_m_y
xsec_m_z
xsec_a

Spotweld axial force
Spotweld shear force
Spotweld torsion moment
Spotweld failure
Spotweld failure time

Spring axial force
Spring elongation
Spring torsional moment
Spring rotation

Database X-sect X force
ditto Y force
ditto Z force
ditto X moment
ditto Y moment
ditto Z moment
Database X-sect area

sb_f
sb_l

sr_p

rt_f
rt_p

spc_f_x
spc_f_y
spc_f_z
spc_m_x
spc_m_y
spc_m_z

Seatbelt axial force
Seatbelt length

Slipring pull-through

Retractor force
Retractor pull-out

SPC X force (at node)
SPC Y ditto
SPC Z ditto
SPC X moment (at node)
SPC Y ditto
SPC Z ditto

User-defined
components
unos n
usss n
ubms n
Nodal scalar component #n
So/Sh scalar component #n
Beam scalar component #n
Simple formulae may reference other user-defined components as well as the standard components above.

Material properties

valid for Parts and
part-based elements

dens
ymod
prat
ystrs
fstrn

Material density
Young's modulus
Poisson's ratio
Yield stress
Failure strain

These are calculated by PRIMER and written to the .ZTF file, so they will only be available if a ZTF file has been read. (A binout file is not required.)

Not all properties are calculable for all material types, and -1.0 will be returned where values cannot be computed.

Applicability of the "Standard" data components in the table above

The data components above are all implicitly available for nodes.

  • Where the data is nodally-derived (eg current X coordinate cx ) then the value is used directly.

  • Where the data is element-derived (for example beam axial force bfx , or contact stress csn ) then the nodal value will be the average of all elements of the relevant type meeting at that node.

Elements may only use components of their "native" type, or nodally-derived data.

  • Where an element data component matches the element type (eg X stress sxx for shells, or YY bending moment bmyy for beams) then it is used directly.

  • Where an element references a nodally-derived data component (eg X displacement dx ) the value used will be the average of all nodes on that element.

  • Where an element references an element-derived data component of a different type (eg a shell element refers to beam axial force bfx ) then the result will be zero.

Applicability of programme settings: Integration point, frame of reference, etc.

  • Data is extracted "per integration point" for user-defined components, and it is not currently possible to specify data from some explicit integration point within a Simple Formula, meaning that you cannot use this method to assemble data from multiple integration points in an element.

  • The current global / local / cylindrical "frame of reference" (see REF_FRAME... Choosing the frame of reference ) does not apply when a Simple Formula value is calculated from raw tensor components (eg Sxx) for solids and shells. The unqualified acronym (Sxx, Syz, ...) always extracts global data, and the acronym with an "l" suffix (eg Sxxl, Sxzl) always extracts element local data.

    However if you build a tensor Simple Formula (6 formulae) for solids or shells then the current "Frame of reference" is applied when it is used . In other words tensor Simple Formulae are created as "raw data", exactly like analysis data read from disk, and are subject to the same transformations when used. It is necessary to work this way in order to prevent "double transformations". (Scalar and vector user-defined components are not transformed.)

Maths functions supported

General functions sqrt(x)
log(x) (natural log)
log10(x) (log base 10)
exp(x) (e to the x)
mod(x,y) (modulo x / y)
max(x1,x2)
min(x1,x2)
sign(x,y)
(sign of y transferred to |x|)
abs(x)
int(x) (truncate to integer)
nint(x) (nearest integer)
ceil(x)
floor(x)
Trigonometric functions
(use radians, not degrees)

sin(x)
cos(x)
tan(x)

sec(x)
csc(x)
cot(x)

asin(x)
acos(x)
atan(x)
atan2(x,y)

Hyperbolic functions

sinh(x)
cosh(x)
tanh(x)
asinh(x)
acosh(x)
atanh(x)

Arithmetic types used

ALL calculations in simple formulae are processed using double precision floating point arithmetic. This includes constants, and means that the "integer arithmetic" conventions of languages such as Fortran or C, and their associated truncation, do not apply.

For example the expression 5 / 2 is converted to 5.0 / 2.0 , and so returns the result 2.5

Also the "integer" functions above ( int, nint, ceil , floor ) return integer values, but expressed as floating results.

For example nint(3.141592) evaluates to 3.0

Examples of simple formulae

temp - 273.15 Convert temperatures from Kelvin to Celsius
(sxx + syy + szz) / -3.0 Standard calculation for average stress
1 / sqrt(2) * sqrt((sxx-syy)**2 + (syy-szz)**2 + (szz-sxx)**2 + 6*(sxy**2 + syz**2 + szx**2)) Standard calculation for von Mises stress
sxx*exx + syy*eyy + szz*szz + 2.0*sxy*exy + 2.0*syz*eyz + 2.0*szx*ezx An estimate of strain energy density in a fully plastic section

Note that the "built in" data components described above can be referred to as simple acronyms, whereas maths functions require their arguments to be placed inside brackets.

Defining a scalar formula

In the case of a scalar component only a single formula is used.

In the example here the user is calculating pressure at nodes from stress components.

Defining a vector formula

In the case of a vector component three formulae are used, one for each of the [x,y,z] components. These are three wholly separate formulae which are evaluated independently.

In the example here the user is applying factors to displacements at nodes.

Note that each row must have a formula defined for the component to be valid.

Defining a tensor formula

In the case of a tensor component six formulae are used, one for each of the [xx,yy,zz,xy,yz,zx] components. These are six wholly separate formulae which are evaluated independently.

In the example here the user is extracting only the in-plane (2D) components of strain for an element.

As with vectors each row must have a formula defined for the component to be valid even if, as here, some row values are set explicitly to zero.

Further notes on Simple Formulae

Handling errors and missing data

If the expression being evaluated is grammatically legal, but not valid in a given context, then zero is returned. Typical examples are:

  • If a formula references a built-in data component that is not present in the model database.
  • If a mathematically illegal operation is attempted, such as divide by zero or the square root of a negative number.

Evaluation of element quantities at nodes

If an expression refers to an element data component, for example sxx , but is being evaluated for a node, then the relevant value is averaged from all legal elements at that node subject to the current averaging rules in force.

This can result in elements of more than one type being used: in this example component sxx , X stress, can be present in solids, shells and thick shells, so if multiple element types use the node then the value will contain contributions from all of them.

In general you should avoid contouring element quanties evaluated at nodes, since the effect is to smear out results and hence miss peak values at element centres. The result is identical to "low resolution" contouring of element data for scalar components.

Evaluation of nodal quantities at elements

If an expression refers to a nodal quantity, for example cx current X coordinate, but is being evaluated for an element, then the average value from all the nodes on that element is used.

Limitations of simple formulae

Simple formulae are powerful and very easy to use, but they do have limitations:

  • They only operate on the current node or element, at the current surface or layer if relevant.
  • They do not permit conditional expressions: you cannot use "if(...)" expression syntax