-
-
October 4, 2021 at 11:45 pmsafianaSubscriber
Hi everyone,
I am having a 3D model in Ansys APDL solved by transient analysis. I would like to store the summation of nodal forces for a group of nodes for each load step.
Let's say I already have assigned the name "gp" to that group of nodes. Also, I have solved the model with 400 load steps. How can I export nodal forces in Z direction only into an excel file? Can anyone give me a sample code for obtaining Fz for a group of nodes and exporting into an excel file where the first column is the load step (time) and the second column is Fz?
Thank you,
Ali
October 5, 2021 at 12:07 pmGovindan NagappanAnsys EmployeeCreate an array to store the results using *DIM command
Then use a *DO loop to loop through each step and save the result to the array
Example:
cmsel,s,gp *do,j,1,400
set,j !select result set
fsum
*get,my_fsum,fsum,,ite,fz !get fz and store it to variable my_fsum
!save my_fsum to the array
!save j(load step number) to the array
*enddo
Use *cfopen to opena text file. Then use *vwrite to write the array to a text file. Use *cfclose to close the text file
October 5, 2021 at 1:35 pmErik KostsonAnsys EmployeeHi as said that is the basic flow - I had something lying around and took very little change , so wanted to share in case anyone else would need this (have in mind there should not be any empty rows especially between *vwrite and (F20.10,F20.10)). Also the text file is placed in the solver files directory is.
! Allocate arrays
cmsel,s,gp,NODE
*GET,my_NNUM,NODE,,COUNT !GET NUMBER OF SELECTED NODES IN MODEL
*GET,my_numtimes, ACTIVE, 0,SOLU,NCMLS
*dim,fsP,array,my_numtimes,2
! Extract force sum
*do,ii,1,my_numtimes,1
set,ii,last
*get,my_time,time
fsum
*get,my_fsum,fsum,,item,fz
fsP(ii,1) = my_time
fsP(ii,2) = my_fsum
*enddo
*CFOPEN,timefsumz,txt
*VWRITE,fsP(1,1),fsP(1,2)
(F20.10,F20.10)
*CFCLOS
October 5, 2021 at 1:53 pmViewing 3 reply threads- The topic ‘How to store “Fsum” command for each load step into an excel file?’ is closed to new replies.
Ansys Innovation SpaceTrending discussions- Problem with access to session files
- Ayuda con Error: “Unable to access the source: EngineeringData”
- At least one body has been found to have only 1 element in at least 2 directions
- Error when opening saved Workbench project
- Geometric stiffness matrix for solid elements
- How to apply Compression-only Support?
- How to select the interface delamination surface of a laminate?
- Timestep range set for animation export
- Image to file in Mechanical is bugged and does not show text
- SMART crack under fatigue conditions, different crack sizes can’t growth
Top Contributors-
1241
-
543
-
523
-
225
-
209
Top Rated Tags© 2024 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-