当前位置:网站首页>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 ( ´ ▽´ )ノ ( ´ ▽´)っ!!!
边栏推荐
- Download vagrant box file locally from Atlas and configuring it
- Research Report on ranking analysis and investment strategic planning of RFID market competitiveness of China's industrial manufacturing 2022-2028 Edition
- China plastic bottle market trend report, technological innovation and market forecast
- Construction and maintenance of business websites [9]
- Basic IO interface technology - microcomputer Chapter 7 Notes
- The web version of xshell supports FTP connection and SFTP connection
- pyqt图片解码 编码后加载图片
- Capacity expansion mechanism of ArrayList
- MySQL inserts Chinese data and reports an error. Set the default collation
- It is said that this year gold three silver four has become gold one silver two..
猜你喜欢
[shutter] statefulwidget component (floatingactionbutton component | refreshindicator component)
Technical solution of vision and manipulator calibration system
[shutter] shutter layout component (physicalmodel component)
基本IO接口技术——微机第七章笔记
How does esrally perform simple custom performance tests?
CVPR论文解读 | 弱监督的高保真服饰模特生成
One week dynamics of dragon lizard community | 2.07-2.13
如何防止你的 jar 被反编译?
[zero foundation I] Navicat download link
Off chip ADC commissioning record
随机推荐
China's Micro SD market trend report, technology dynamic innovation and market forecast
China's log saw blade market trend report, technological innovation and market forecast
Analysis of enterprise financial statements [4]
Report on investment development and strategic recommendations of China's vibration isolator market, 2022-2027
地理探测器原理介绍
Construction and maintenance of business website [2]
Golang embeds variables in strings
[shutter] shutter layout component (opacity component | clipprect component | padding component)
Construction and maintenance of business websites [8]
China plastic box market trend report, technological innovation and market forecast
Plastic granule Industry Research Report - market status analysis and development prospect forecast
Investment strategy analysis of China's electronic information manufacturing industry and forecast report on the demand outlook of the 14th five year plan 2022-2028 Edition
如何防止你的 jar 被反编译?
Three chess games
Read a doctor, the kind that studies cows! Dr. enrollment of livestock technology group of Leuven University, milk quality monitoring
China plastic bottle and container market trend report, technological innovation and market forecast
pyqt圖片解碼 編碼後加載圖片
Research Report on micro vacuum pump industry - market status analysis and development prospect prediction
Research Report on plastic antioxidant industry - market status analysis and development prospect forecast
~91 rotation