TAGGED: mechanical-apdl, post-processing, workbench
-
-
November 11, 2020 at 8:42 pm
mehrdadsaeedi
SubscriberHello friends,nI am trying to run a simulation in which I have to apply approximately 700 load steps on several nodes and export the corresponding x,y,z displacements for each node and for each set.nfor example I have a node that there will be loads applied on. for this node I have considered 720 load steps which each gives specific displacements. the question here is how can I export the corresponding directional displacements for all those 720 sets at one time? I thought that this could be done by using a for loop or something similar.nThe problem is I have little knowledge of APDL commands.nI appreciate any help.n -
November 11, 2020 at 10:22 pm
Wenlong
Ansys EmployeeThis is a rushed answer and others please feel free to add comments.nHi mehrdadsaeedi,nYes a do loop can help. In Mechanical, right click on solutions and choose commands to insert a command snippet. Say you want to plot displacements at all these steps, you can add:n*do, i, 1, 720n/show, PNG, REV,,8, ux_at_step_%i% !output a PNG imagen/post1nset, i, lastnallsel, allnplnsol, u, x !plot x displacementn/show, close n*enddonnIf you want to print out the solution, you can use command like prnsol. I am sure there are better options to directly write to a file. Others feel free to contribute. nRegards,nWenlongnReference: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v193/ans_cmd/Hlp_C_DO.html?q=\*donhttps://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v202/en/ans_cmd/Hlp_C_PRNSOL.html?q=prnsoln -
November 13, 2020 at 4:57 pm
HarsihilZLHZ
Subscriber/POST1nset,lastn*get, numnode, node, 0, countn*DIM,DN,array,numnode,3n*do, j, 1, numnoden *get,dispX,node,j,u,xn *get,dispY,node,j,u,yn DN(j,1) = j t t n DN(j,2) = dispXtn DN(j,3) = dispYn*enddonn*CFOPEN,file_Name,txt,Z:\Ansys(here comes directory)n*vwrite, DN(1,1),DN(1,2),DN(1,3)n(4x,' ', F6.0,4x,' ',G15.8,4x,' ',G15.n*CFCLOSEnnif it doesn't worked, then share your file if possible.n -
November 13, 2020 at 10:26 pm
mehrdadsaeedi
SubscriberThank you HarsihilZLHZ for your reply. the file is not something special. it is just a simply cube with hexahedral elements and 1 node receives a nodal force with tabular data for a certain load step. I tried your code but it only produced a blank text file. Here is my file attached.nn
-
November 15, 2020 at 2:05 pm
HarsihilZLHZ
Subscriberfor the time being consider below code...n!!! I HAVE TESTED AND IT WORKSnn*DO, i, 4, 5 ! here I have used last two subset (edit here!!) (!!!! ATTENTION here i have used 4 and 5 SUBSET)nSET, i,LASTnnn*GET, my_numnode, node, 0, countn*DIM,DN,ARRAY,my_numnode,4nn*DO, j,1,my_numnoden *GET,my_dispX,NODE,j,U,Xn *GET,my_dispY,NODE,j,U,Yn *GET,my_dispZ,NODE,j,U,Zn DN(j,1) = j n DN(j,2) = my_dispXn DN(j,3) = my_dispYn DN(j,4) = my_dispZn*ENDDOnn*IF,i,EQ,4,THEN !!!! ATTENTION here i have used 4 and 5 SUBSETn*CFOPEN,fileName1,txt,\ !!!!(writes the file for 1 subset)n*vwrite,DN(1,1),DN(1,2),DN(1,3),DN(1,4)n(4x, ', F6.0,4x, ',G15.8,4x, ',G15.8,4x, ',G15.n*CFCLOSn*ELSE !!! ( if you have more than two subset then write *ELSEIF,VAL1,Oper,VAL2 )n*CFOPEN,fileName2,txt,\ !!!!(writes the file for 2 subset and so on.....)n*vwrite,DN(1,1),DN(1,2),DN(1,3),DN(1,4)n(4x, ', F6.0,4x, ',G15.8,4x, ',G15.8,4x, ',G15.
n*CFCLOSn*ENDIF nn*ENDDOnn
-
- The topic ‘Run a simulation for a large number of load steps and export all sets displacements at once’ is closed to new replies.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- How to do the frequency response of the nonlinear vibration of a flexible PCB?
- Importing Line and Solid Bodies from SpaceClaim to Mechanical
- how to open SendCommand in Ansys
- problems facing during solution
- Still facing the same issue
- Failed to move file from solver directory to scratch directory: file.rst
- Adaptive Sizing
- Stiffness factor
- Import DAT file
- Import pressure data (coordinates and value) to ansys workbench through excel
-
8808
-
4658
-
3155
-
1688
-
1480
© 2023 Copyright ANSYS, Inc. All rights reserved.