카테고리 없음

ARRAYS AND TABLES IN APDL

오늘보다 나은 내일 2017. 5. 31. 10:43

http://www.ozeninc.com/apdl-arrays-tables-quickreference/



ARRAYS


array-cheatsheet_fig1



Arrays are a good way to hold vector or matrix data. As shown above, you can define arrays with the *DIM command. This defines the overall dimensions of the array (you can actually have up to 5 dimensions using special forms of the *DIM command, refer to the documentation for more). You can fill arrays yourself as below but I typically have ANSYS fill in arrays for me for postprocessing purposes, using commands like *VGET (to fill arrays prior to writing a file with *VWRITE) and VGET (sends time/frequency history curves from POST26 to arrays).

Below are examples of a vector and a matrix complete definition in APDL:

*dim,ntemp,array,3
ntemp(1) = -5.2, 25, 86.5
*dim,compstrs,array,4,2
compstrs(1,1) = 814, 1057, 1033, 786
compstrs(1,2) = -386, -704, -713, -348

TABLES

Did you know you can apply a curve or contour instead of a constant in many places in ANSYS? These can vary based on position, time, temperature and more. Tables are how this is accomplished. Tables are like arrays but with labels on the rows and columns that are not just the row/column number.

array-cheatsheet_fig2

As you can see, you can get some nice interpolation functionality very quickly. Just like arrays you can do this in up to 5 dimensions! Many times you will use a *DO loop to define arrays in terms of an expression as well.

The row/col/plane_var fields are for labeling your axis. If you intend to send a varying load or property later, this is where you tell it what it varies by. Check the *DIM command documentation for a list of what you can vary it by. For load or property commands like D and RMODIF, the documentation will need to say that you can pass a table and you do so by passing the table name enclosed in %’s as below. If you are using spatially varying loads, you probably will want to specify a custom coordinate system using the coord_sys_id field.

*dim,tab1d,table,5,,,time
tab1d(1) = 0,3,3.5,3.75,3.875
tab1d(1,0) = 0,0.25,0.5,0.75,1

! Apply time varying x displacement
d,component1,ux,%tab1d%
*dim,tab2d,table,5,3,,y,x,,13
tab2d(1,1) = 0,0.125,0.25,0.375,0.5
tab2d(1,2) = 0.05,0.175,0.3,0.425,0.55
tab2d(1,3) = 0.1,0.225,0.35,0.475,0.6
*taxis,tab2d(1,1),1,0,0.25,0.5,0.75,1
*taxis,tab2d(1,1),2,0,0.5,1

!Apply spatially varying temperature
!Aligned with coordinate system 13
d,component2,temp,%tab2d%

If you are like me, you may be slightly perturbed by the lack of units in the above plots. This is intentional. These commands are unitless, just like APDL. It is highly recommended that you set Analysis Settings -> Analysis Data Management -> Solver Units from Active System to the correct unit system for your APDL. Doing this will make sure that your unit system is consistent and will prevent several types of errors.

The list of available variables for tables is below:

PRIMARY VARIABLELABEL FOR VAR1, VAR2, VAR3
TimeTIME
FrequencyFREQ
X-coordinate locationX
Y-coordinate locationY
Z-coordinate locationZ
TemperatureTEMP
VelocityVELOCITY
PressurePRESSURE
Geometric gap/penetrationGAP
Cyclic sector numberSECTOR
Amplitude of the rotational velocity vectorOMEGS
EccentricityECCENT
Phase shiftTHETA