当前位置:网站首页>Secondary development of ANSYS APDL: post processing uses command flow to analyze the result file
Secondary development of ANSYS APDL: post processing uses command flow to analyze the result file
2022-07-02 21:45:00 【Xiaomu who loves reading】
List of articles
Preface
ANYS There are two ways to work ,GUI Graphical user interface (GraphicalUser Interface Also called graphical user interface ) Operation and command flow .
ANYS Command flow mode , The fusion GUI The way 、APDL、UPFs、UIDL、MAC, even to the extent that TCL/TK In a text file , It can be done by /input command ( or UtilityMenu>File>Read Input From) Read in and execute , You can also copy the contents of this file and paste it into the command line to execute . Generally, the circulation of orders is often by ANSYS Command and APDL Functional statements consist of .
APDL The full name is ANSYS Parametric Design Language, It's also called ANSYS Parametric design language .APDL It is used to automatically complete some functions or modeling, similar to FORTRAN The explanatory language of , Provide the functions of general programming language . It contains three aspects : Toolbars 、 Parameters and macro commands .
APDL The application of is mainly reflected in that users can use programming language to ANSYS Orders are organized , Write a parameterized user program , So as to realize the whole process of finite element analysis , That is to establish parameterized CAD Model 、 Parameterized mesh generation and control 、 Parametric material definition 、 Parameterized load and boundary condition definitions 、 Parametric analysis, control and solution as well as parametric post-processing .
The steps of reading results in post-processing are generally :
- General Postproc -> Data and File Options, take RST Read the result file .
- Use Read Results, You can look at last step, If there are many steps in it , Press first step,next step Look at the results .
- List the results using List Results.
1、 Load the result file
- APDL The interface operation is as follows :
- APDL The command code is as follows :
finish
/post1
/cwd, d:/test
file, demo.rst
set, first
allsel
nsel, stat
eplot ! or gplot、nplot、 kplot
/view, 1, 1,1,1
/replot
2、 Check the overall situation of the result data
APDL The related operations of the interface are as follows :
Read the first load step :
Read a load step :APDL The relevant code of the command is as follows :
(1) Pop-up window , And list the basic information , At the same time, list the title of each load step .
set, list
(2) Read the solution result of a load step or a sub step
set,list,0 perhaps set,list,1 Read the result file , And list the basic information of each load step
set,list,2 Read the result file , And list the basic information , At the same time, list the title of each load step
set,first Read the first load step from the result file
set,last Read the last load step from the result file
set, next Read the next load step from the result file
set, previous Read the previous load step from the result file
set,near,,,time Read the load step closest to this time from the result file
set, next, 3 Read the third sub step of the next load step from the result file `
3、 Draw the result graph
- APDL The related interface operations are as follows :
application PLDISP command (Main Menu>General Postproc> Plot Results> Deformed Shape) To display the deformation diagram .PLDISP Ordered KUND Parameter allows the user to superimpose the deformation graph on the original graph .
Draw the default deformation diagram :
PLDISP, 0
Draw the displacement contour map of the node :
Draw the displacement contour map of the element :
Draw a vector diagram of displacement :
Only draw the unit diagram :
Only draw node graph :
- APDL The relevant code of the command is as follows :
eplot ! or gplot、nplot、 kplot
/view, 1, 1,1,1
/replot
explain :
gplot: Comprehensive display of all elements
kplot: Show selected keys
lplot: Display the selected line
aplot: Display the selected face
vplot: Display the selected body
nplot: Display the selected node
eplot: Display the selected cell
plnsol,u,x
plnsol,u,y
plnsol,u,z
plnsol,u,sum
plesol,u,x
plesol,u,y
plesol,u,z
plesol,u,sum
plvect,u $ plvect,s
/contour,,18,-16,,500
4、 Output animation
APDL The related interface operations are as follows :
APDL The relevant code of the command is as follows :
set,first
pldisp,0
anmode,10,0.5e-1
5、 Get the data of all nodes
- command :NLIST
- command :PRNSOL, U, SUM
APDL The relevant code of the command is as follows :
- Method 1:
/UIS, MSGPOP, 3
allsel
*cfopen, get_nodedata, txt
!****************************************
! (1) Get the number of nodes
*get, node_max, NODE, 0, NUM, MAX
*get, node_min, NODE, 0, NUM, MIN
*get, node_count, NODE, 0, COUNT
*vwrite, node_min
("Node 's Min Index: ", 3X, f10.0)
*vwrite, node_max
("Node 's Min Index: ", 3X, f10.0)
*vwrite, node_count
("Node 's Count: ", 3X, f10.0)
*vwrite
('title = id, X, Y, Z')
!****************************************
! (2) Traversing and writing files
*do, i, node_min, node_max
xx=NX(i)
yy=NY(i)
zz=NZ(i)
*vwrite,'NODE', i,xx,yy,zz
(1X, a, 3X, 1f8.0, 3f16.8)
*enddo
!****************************************
*cfclose
- Method 2:
!****************************************
! (2) Traversing and writing files
*del,nodepos
*dim,nodepos,ARRAY,node_max,3
*do,i, node_min, node_max
*get,nodepos(i,1),NODE,i,LOC,X
*get,nodepos(i,2),NODE,i,LOC,Y
*get,nodepos(i,3),NODE,i,LOC,Z
*enddo
*vwrite,sequ,nodepos(1,1),nodepos(1,2),nodepos(1,3)
(f8.0, 3f16.8)
!****************************************
- Method 3:
!****************************************
! (2) Traversing and writing files
*do, i, node_min, node_max
*get,xx,NODE,i,LOC,X
*get,yy,NODE,i,LOC,Y
*get,zz,NODE,i,LOC,Z
*get,axy,NODE,i,ANG,XY
*get,ayz,NODE,i,ANG,YZ
*get,azx,NODE,i,ANG,ZX
*vwrite,'NODE', i,xx,yy,zz
(1X, a, 3X, 1f8.0, 3f16.8)
*enddo
- Method 4:
!****************************************
! (2) Traversing and writing files
*do, i, node_min, node_max
*get,uxx,NODE,i,U,X
*get,uyy,NODE,i,U,Y
*get,uzz,NODE,i,U,Z
*get,usum,NODE,i,U,SUM
*get,rxx,NODE,i,ROT,X
*get,ryy,NODE,i,ROT,Y
*get,rzz,NODE,i,ROT,Z
*get,rsum,NODE,i,ROT,SUM
*vwrite,'NODE', i,uxx,uyy,uzz,usum,rxx,ryy,rzz,rsum
(1X, a, 3X, 1f8.0, 8f16.8)
*enddo
!****************************************
6、 Get the data of all units
- command :ELIST
- command :PRESOL, M
- command :PRESOL, CENT
APDL The relevant code of the command is as follows :
/UIS, MSGPOP, 3
allsel
*cfopen, get_elemdata, txt
!****************************************
! (1) Get the number of units
*get, elem_max, ELEM, 0, NUM, MAX
*get, elem_min, ELEM, 0, NUM, MIN
*get, elem_count, ELEM, 0, COUNT
*vwrite, elem_min
("Elem 's Min Index: ", 3X, f10.0)
*vwrite, elem_max
("Elem 's Min Index: ", 3X, f10.0)
*vwrite, elem_count
("Elem 's Count: ", 3X, f10.0)
*vwrite
('title = id, X, Y, Z, AREA')
!****************************************
! (2) Traversing and writing files
*do, i, elem_min, 100
*get, ex, ELEM, i, CENT, X
*get, ey, ELEM, i, CENT, Y
*get, ez, ELEM, i, CENT, Z
*get, earea, ELEM, i, AREA
*vwrite,'ELEM', i,ex,ey,ez,earea
(1X, a, 3X, 1f8.0, 4f16.8)
*enddo
!****************************************
*cfclose
7、 Get the data of all nodes and cells
*get,nodenum,node,,num,max
*dim,nodepos,array,nodenum,3
*do,i,1,nodenum,1
*get,nodepos(i,1),node,i,loc,x
*get,nodepos(i,2),node,i,loc,y
*get,nodepos(i,3),node,i,loc,z
*enddo
*get,elemnum,elem,,num,max
*dim,elemlist,array,elemnum,6
*do,i,1,elemnum,1
*do,ii,1,6,1
*get,elemlist(i,ii),elem,i,node,ii
*enddo
*enddo
*cfopen,geomfile,txt
*vwrite,0
(F8.0,'node data:')
*vwrite,sequ,nodepos(1,1),nodepos(1,2),nodepos(1,3)
(F8.0,3f16.8)
*vwrite,0
(F8.0,'element data:')
*vwrite,sequ,elemlist(1,1),elemlist(1,2),elemlist(1,3),elemlist(1,4),elemlist(1,5),elemlist(1,6)
(F8.0,6f8.0)
*vwrite,0
(F8.0)
*cfclos
8、 Obtain node and cell data at all frequency time points
!ernorm, off
!/rmdir, 'results'
!/mkdir, 'results'
outname = 'results/dlist'
/output,%outname%,txt,
dlist
outname = 'results/elist'
/output,%outname%,txt,
elist
outname = 'results/nlist'
/output,%outname%,txt,
nlist
outname = 'results/ecent'
/output,%outname%,txt,
/format,,f,15,8
presol,cent
!*do,i,1,60,1
!set,,,,,,,i
*do,i,1,30,1
set,i,last
/format,,f,15,10
/output
outname = 'results/prnsol/t'
outname = strcat(outname, chrval(i))
/output,%outname%,txt,
prnsol,u,sum
outname = 'results/presol_m/t'
outname = strcat(outname, chrval(i))
/output,%outname%,txt,
presol,m
*enddo
/output
Postscript
If you think the method or code is a little useful , You can praise the author ;╮( ̄▽ ̄)╭
If you don't feel good about the method or code //(ㄒoㄒ)//, Just leave a message in the comments , The author continues to improve .o_O???
Thank you, children's shoes ( ´ ▽´ )ノ ( ´ ▽´)っ!!!
边栏推荐
- MySQL learning record (2)
- Analysis of neural network
- B.Odd Swap Sort(Codeforces Round #771 (Div. 2))
- [shutter] statefulwidget component (floatingactionbutton component | refreshindicator component)
- Analysis of enterprise financial statements [3]
- How to prevent your jar from being decompiled?
- [shutter] statefulwidget component (image component | textfield component)
- MySQL learning record (9)
- Error in PIP installation WHL file: error: is not a supported wheel on this platform
- Analysis of enterprise financial statements [2]
猜你喜欢
Spend more time with your computer on this special holiday, HHH
It is said that this year gold three silver four has become gold one silver two..
GEE:(二)对影像进行重采样
The web version of xshell supports FTP connection and SFTP connection [detailed tutorial] continued from the previous article
Report on investment development and strategic recommendations of China's vibration isolator market, 2022-2027
Basic knowledge of tree and binary tree (detailed illustration)
[zero foundation I] Navicat download link
如何防止你的 jar 被反编译?
Cardinality sorting (detailed illustration)
发现你看不到的物体!南开&武大&ETH提出用于伪装目标检测SINet,代码已开源!...
随机推荐
pip安装whl文件报错:ERROR: ... is not a supported wheel on this platform
[shutter] shutter page Jump (route | navigator | page close)
[shutter] shutter gesture interaction (click event handling | click OnTap | double click | long press | click Cancel | press ontapdown | lift ontapup)
[shutter] statefulwidget component (create statefulwidget component | materialapp component | scaffold component)
2019 Nanchang (relive the classic)
Analysis of enterprise financial statements [4]
Accounting regulations and professional ethics [18]
Spend more time with your computer on this special holiday, HHH
MySQL learning record (2)
*C语言期末课程设计*——通讯录管理系统(完整项目+源代码+详细注释)
Micro SD Card Industry Research Report - market status analysis and development prospect forecast
记录一下微信、QQ、微博分享web网页功能
Five message formats of OSPF
Research Report on market supply and demand and strategy of Chinese garden equipment industry
Gbase 8s database basic syntax
Golang string segmentation
Error in PIP installation WHL file: error: is not a supported wheel on this platform
tinymce可视化编辑器增加百度地图插件
Golang embeds variables in strings
[C language] [sword finger offer article] - replace spaces