/FUNCT_PYTHON
Block Format Keyword Defines a function defined with Python script.
Format
(1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | (10) |
---|---|---|---|---|---|---|---|---|---|
/FUNCT_PYTHON/fct_ID | |||||||||
def function_name(argument) | |||||||||
…Python code… | |||||||||
return variable |
Blank line after the “return” is mandatory
(1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | (10) |
---|---|---|---|---|---|---|---|---|---|
Blank line |
Definition
Field | Contents | SI Unit Example |
---|---|---|
fct_ID | Function identifier. | |
function_name | Function name. Must be unique in
the model. (Text) |
|
argument | (Mandatory) Argument of the
function. (Text) |
|
variable | (Mandatory) Output
variable. (Text) |
Radioss Variables
The Python script can use global, nodal or elementary data from Radioss.
key | Definition |
---|---|
TIME |
Current simulation time. |
DT |
Current time step. |
key | Definition |
---|---|
Ci(node_ID) |
Coordinate i∈{X,Y,Z} of node_ID in the global coordinate system. |
Di(node_ID) |
Displacement i∈{X,Y,Z} of node_ID in the global coordinate system. |
Vi(node_ID) |
Translational velocity i∈{X,Y,Z} of node_ID in the global coordinate system. |
Ai(node_ID) |
Translational acceleration i∈{X,Y,Z} of node_ID in the global coordinate system. |
VRi(node_ID) |
Rotational velocity i∈{X,Y,Z} of node_ID in the global coordinate system. |
ARi(node_ID) |
Rotational acceleration i∈{X,Y,Z} of node_ID in the global coordinate system. |
DRi(node_ID) |
Rotation i∈{X,Y,Z} of node_ID in the global coordinate system. |
key | Definition |
---|---|
ALPHA(ELEM_ID) |
Shear angle alpha of material /MAT/LAW58 in degrees for the element ELEM_ID. |
AMS(ELEM_ID) |
Elements using AMS timestep due to /DT/CST_AMS for the element ELEM_ID. |
BFRAC(ELEM_ID) |
Burn fraction of the element ELEM_ID. |
BULK(ELEM_ID) |
Artificial viscosity of the element ELEM_ID. |
COLOR(ELEM_ID) |
Volume fraction color of the element ELEM_ID. |
DAMi(ELEM_ID) |
Principal damage values in local cracking skew direction i∈{1,2,3} for the element ELEM_ID. |
DAMA(ELEM_ID) |
Maximum damage over time of all /FAIL criteria for the element ELEM_ID. |
DAMG(ELEM_ID) |
Mean damage over thickness integration points (only for coupled damage models) for the element ELEM_ID. |
DAMINI(ELEM_ID) |
Maximum damage initiation variable among all failure criteria using initiation variable before computing stress softening (/FAIL/INIEVO) for the element ELEM_ID. |
DENS(ELEM_ID) |
Density for the element ELEM_ID. |
DOMAIN(ELEM_ID) |
SPMD domain number of an element for the element ELEM_ID. |
DT(ELEM_ID) |
Element timestep for the element ELEM_ID. |
EINT(ELEM_ID) |
Element internal energy per unit volume for the element ELEM_ID. |
EINTM(ELEM_ID) |
Specific internal energy for the element ELEM_ID. |
EINTV(ELEM_ID) |
Internal energy density for the element ELEM_ID. |
ENER(ELEM_ID) |
Specific energy density (internal energy divided by the element mass) for the element ELEM_ID. |
ENTH(ELEM_ID) |
Enthalpy for the element ELEM_ID. |
ENTHM(ELEM_ID) |
Massic enthalpy for the element ELEM_ID. |
ENTHV(ELEM_ID) |
Enthalpy density for the element ELEM_ID. |
EPSD(ELEM_ID) |
Equivalent strain rate for the element ELEM_ID. |
EPSP(ELEM_ID) |
Plastic strain for the element ELEM_ID. |
FAIL(ELEM_ID) |
Number of failed layers for the element ELEM_ID. |
FAILURE(ELEM_ID) |
Damage of a specific failure criterion references by its optional identifier fail_ID for the element ELEM_ID. |
FILL(ELEM_ID) |
Filling percentage for the element ELEM_ID. |
FLDF(ELEM_ID) |
FLD damage factor indicator for the FLD failure model of the element ELEM_ID. |
FLDZ(ELEM_ID) |
FLD failure zone factor for the FLD failure model of the element ELEM_ID. |
GROUP(ELEM_ID) |
Internal group identifier of the element ELEM_ID. |
HC_DSSE_F(ELEM_ID) |
HC_DSSE damage factor indicator of the element ELEM_ID. |
HC_DSSE_Z(ELEM_ID) |
HC_DSSE failure zone factor for the HC_DSSE failure model of the element ELEM_ID. |
HOURGLASS(ELEM_ID) |
Hourglass energy per mass unit of the element ELEM_ID. |
K(ELEM_ID) |
Specific for turbulent energy in CFD of the element ELEM_ID. |
MACH(ELEM_ID) |
Mach number of the element ELEM_ID. |
MASS(ELEM_ID) |
Element mass of the element ELEM_ID |
MOMi(ELEM_ID) |
Cell momentum Density in direction i∈{X,Y,Z,XY,YZ,ZX} for FVM with Interface TYPE22 of the element ELEM_ID. |
NL_EPSD(ELEM_ID) |
Non-local plastic strain rate of the element ELEM_ID. |
NL_EPSP(ELEM_ID) |
Non-local plastic strain of the element ELEM_ID. |
NXTF(ELEM_ID) |
Instability factor of /FAIL/NXT failure model of the element ELEM_ID. |
OFF(ELEM_ID) |
Status of the element ELEM_ID. |
P(ELEM_ID) |
Pressure of the element ELEM_ID. |
PHI(ELEM_ID) |
Angle between the element system and direction 1 orthotropy of the element ELEM_ID. |
SCHLIEREN(ELEM_ID) |
Schlieren image of the element ELEM_ID. |
SIGEQ(ELEM_ID) |
Equivalent stress based on a material’s yield criteria of the element ELEM_ID. |
SIGi(ELEM_ID) |
Stress i∈{X,Y,Z,XY,YZ,ZX} in specified direction of the element ELEM_ID. |
SSP(ELEM_ID) |
Sound speed of the element ELEM_ID. |
TDEL(ELEM_ID) |
Time at which element ELEM_ID is deleted. |
TDET(ELEM_ID) |
Detonation time of the element ELEM_ID. |
TEMP(ELEM_ID) |
Temperature of the element ELEM_ID. |
THICK(ELEM_ID) |
Thickness of the element ELEM_ID. |
THIN(ELEM_ID) |
% thinning for shell of the element ELEM_ID. |
TILLOTSON(ELEM_ID) |
Region identifier for Tillotson Equation of State of the element ELEM_ID. |
TSAIWU(ELEM_ID) |
Tsai-Wu criterion for material of the element ELEM_ID. |
TVIS(ELEM_ID) |
Specific for turbulent viscosity in CFD of the element ELEM_ID. |
VDAMi(ELEM_ID) |
Value of damage i∈{1,2,3} for /FAIL/SNCONNECT of the element ELEM_ID. |
VELi(ELEM_ID) |
Cell velocity i∈{X,Y,Z,XY,YZ,ZX} for FVM with Interface TYPE22 of the element ELEM_ID. |
VFRAC1(ELEM_ID) |
Volumetric fraction i∈{1,2,3,4} of the element ELEM_ID. |
VOLU(ELEM_ID) |
Volume of the element ELEM_ID. |
VONM(ELEM_ID) |
von Mises stress of the element ELEM_ID. |
VORT(ELEM_ID) |
Vorticity resultant for ALE material of the element ELEM_ID. |
VORTi(ELEM_ID) |
Vorticity in direction i∈{X,Y,Z} for ALE material of the element ELEM_ID. |
▸Example (Using TIME
)
▸Example (/FUNCT_SMOOTH)
▸Example (Nodal)
Comments
- The empty line after the “return” is mandatory.
- A function and a table cannot share the same identifier.
- This function can be used with these options: /IMPDISP, /IMPVEL, /IMPACC, /IMPDISP/FGEO, /IMPVEL/FGEO, /IMPVEL/LAGMUL, /IMPTEMP, /CLOAD, /PLOAD, /GRAV, and /IMPFLUX.
- The number of lines in a function is limited to 1000. But it is possible to break a function into multiple functions, since it is possible to call a Python function from another Python function.
- Radioss variables are in “read only” mode from python.
- Python values will always be in double precision.
- The returned value will be 0.0 if the result is there with no data for the requested Radioss variable and element ELEM_ID.
- Radioss uses the Python library
available in the HyperWorks installation. It is
possible to use a different Python distribution by setting the environment
variable
RAD_PYTHON_PATH
. - The option “
-python
” must be added to the Starter command line to confirm that you want to explicitly use a python script with Radioss.