Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

extracting results from transient structural analysis ansys workbench

Status
Not open for further replies.

mayakuntla92

Civil/Environmental
Jun 6, 2019
3
i want to extract nodal velocities at some nodes at all time steps (transient) to csv or dat format directly. i have written this code
SET,LIST
*DIM,VELY,ARRAY,3125,800 !!!!! FOR 800 NODES AT 3125 TIME STEPS
NODENUMBER=141475 ! INITIAL NODE NUMBER
*CFOPEN,VEL,CSV
*DO,KK,1,800,1
*GET,VELY(1,KK),NODE,NODENUMBER,V,Y
*VWRITE,VELY(1)
(E15.8)
NODENUMBER=NODENUMBER+1
*ENDDO
*CFCLOSE

still i am unable to extract results?? any help
 
Replies continue below

Recommended for you

Hello,
have you tried something like this (only for the last time step)

Code:
*GET,NCOUNT,NODE,,COUNT              ! Get total number of selected nodes
*DIM,VELY,ARRAY,NCOUNT,1             ! Create NCOUNT x 1 array 
/POST1
SET,LAST
*CFOPEN,VEL,CSV                      ! Create file called vel.csv
*VGET,VELY(1,1),NODE,1,V,Y           ! Fill first column with vy
*VWRITE,VELY(1,1)                    ! Write one column to file
(E13.5)                              ! Format with scientific
*CFCLOSE
 
Think it is not easy this - how you going to distinguish when one node history stops and the next starts.

The normal thing is ti generate a time history file for every node. Thus if we have 200 nodes, we generate 200 files.
That can be read in automatically in in a small script. One can also append it to the same file using the append option in cfopen.

I have not managed to do this 100%, but have a go and see if you can get it to work:
Code:
/PREP7  
!*  
ET,1,BEAM188
!*  
!*  
MPTEMP,,,,,,,,  
MPTEMP,1,0  
MPDATA,DENS,1,,7800 
MPTEMP,,,,,,,,  
MPTEMP,1,0  
MPDATA,EX,1,,200E9  
MPDATA,PRXY,1,,0.3  
SECTYPE,   1, BEAM, RECT, , 0   
SECOFFSET, CENT 
SECDATA,0.1,0.1,0,0,0,0,0,0,0,0,0,0 
K,1,0,0,0   
K,2,2,0,0   
L,1,2   
LESIZE,ALL,0.1  
LMESH,ALL
FINISH  
/SOL
D,1, ,0, , , ,ALL, , , , , 
F,2,FY,-1000 
!*  
ANTYPE,4
!*  
TRNOPT,FULL 
LUMPM,0 
!*  
DELTIM,0.1,0.1,0.1  
OUTRES,ERASE
OUTRES,ALL,ALL  
AUTOTS,1
ALPHAD,0.11 
BETAD,0.00025   
KBC,1.0 
TIME,2  
TIMINT,1
SOLVE
/POST26
/NERR,2000
*get,ncount2,node,,count
*do,i,1,ncount2,1
NSOL,5,i,V,Y,
STORE,MERGE
*GET,size,VARI,,NSETS
*DIM,VEL,ARRAY,size 
VGET,VEL(1),5
a='filev'
b=CHRVAL(i)
c=STRCAT(a,b)
*CFOPEN,c,dat         ! If appending, just use one file name, say a and use append so: *CFOPEN,a,dat,,append 
*VWRITE,VEL(1)        ! Write array in given format to 
%14.5G 
*CFCLOSE
*DEL,ALL
*enddo
 
Thanks for the reply guys.


Dear jkupka84,

just now I executed your code for postprocessing. there were no errors. thanks for your code. your code is writing velocity in y-direction for node number 1 at last time step successfully.

how to write at all time steps???
set,last --- gives only at last time step
 

Hello,
from the scratch try something like this

Code:
/POST1
SET,LAST                             ! Read the last data set

*GET,NCOUNT,NODE,,COUNT              ! Get total number of selected nodes
*GET,NTIME,ACTIVE,0,SET,LSTP         ! Get last data set number
*DIM,VELY,ARRAY,NCOUNT,NTIME         ! Create NCOUNT x NTIME array

*DO,i,1,NTIME                        ! Do-loop over NTIME
 SET,i                               ! Read the i data set
 *VGET,VELY(1,i),NODE,1,V,Y          ! Fill first column with vy
*ENDDO
*MWRITE,VELY,VEL,CSV,,JIK            ! Writes a matrix to a csv file in formatted sequence as NCOUNT rows and NTIME columns
(xxE13.5)                            ! Format with scientific where xx is NTIME scalar parameter which you have to change manually

I don't know if is possible to do it without hard coding of xx. Maybe do-loop of each matrix element separately.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor