×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

*TREAD command problem

*TREAD command problem

*TREAD command problem

(OP)
Hi,

I tried to run transient analysis using table with *tread command. However i received error;



solution script

CODE -->

/solu
antype,4
trnopt,full
nlgeom,1
outres,all,all

to_skip=0
*dim,mytable,table,1289,2,
*tread,mytable,disptime,csv,,to_skip

tmstart=0.1
tmend=10
tminc=1

da,1,all

allsel

asel,s,area,,122
nsla,s,1
sf,all,pres,0.1

allsel
*do,tm,tmstart,tmend,tminc
time,tm
da,122,ux,%disptime%
solve
*enddo

allsel
finish 

the table has 2 column and 1289 rows. first column is displacement and second column is time.

how to solve this?


Thanks

RE: *TREAD command problem

There is a nice example from Simutech group: Link

The following is from there, and reads an Amp.csv file (first column time and second amplitude) that exists in the working directory of Ansys APDL, into a table called mytable.

to_skip=0
/INQUIRE,numlines,LINES,Amp,csv
to_read=numlines-to_skip

*DEL,mytable,,NOPR
*DIM,mytable,TABLE,to_read
*TREAD,mytable,Amp,csv,,to_skip

Then to apply this table to a time varying force (load) one gives for instance the table name:
F,P51X,FX, %MYTABLE%

RE: *TREAD command problem

(OP)
Thanks Erik for replying,

I do refer the article from simultech group, however, i do not quite understand the purpose of some part of the proposed script;

CODE -->

/INQUIRE,numlines,LINES,Amp,csv
to_read=numlines-to_skip

*DEL,mytable,,NOPR 

i do not understand this part.....thats why skipped it in my own script. I fixed the error in first post by using the filename with .txt extension.

One more question, I have data for displacement vs time, is it possible to use it instead load vs time?

Thanks
AM

RE: *TREAD command problem

I am not really good with APDL, but as far as my understanding goes without looking into it too much, the /INQUIRE finds out how many lines the csv file has, and that is then input when creating the table, which will have the same lines as the csv file (if to_skip = 0). As for *DEL, I suppose it deletes any previous tables created, before a new one is defined.

Yes, that works for enforced displacements which would be for say node 2 with the MYTABLE defining the UX amplitude as a function of time table (2 columns, TIME and amplitude) :

D,2, , %MYTABLE% , , , ,UX, , , , ,
or
D,2,UX , %MYTABLE%

RE: *TREAD command problem

(OP)
i try to follow exactly what has been proposed by simultech group, the error i got in my first post is because of this part;

CODE -->

/INQUIRE,numlines,LINES,disptime,csv 

in ansys manual;

CODE -->

/INQUIRE,Parameter,FUNC,Fname, Ext, --. 

my script;

CODE -->

to_skip=1								!number of line to skip
/INQUIRE,numlines,LINES,disptime,csv
to_read=numlines-to_skip
!
*DEL,mytable,,NOPR

*dim,mytable,TABLE,to_read
*tread,mytable,disptime,csv,,to_skip 

but i still got error if using /inquire to capture the lines in the csv file.
it seems something not right in /inquire command..where it was unable identify the data in the file.

the one proposed by simultech group.

CODE -->

to_skip=0       ! enter number of lines to skip--NONE in this example
/INQUIRE,numlines,LINES,data_example,csv
to_read=numlines-to_skip
!
*DEL,mytable,,NOPR
*DIM,mytable,TABLE,to_read                 ! table array to hold data
*TREAD,mytable,data_example,csv,,to_skip 

the advantages of the proposed code is where user does not need to check for number of lines in external csv files....

otherwise need to enter manually in *dim command


RE: *TREAD command problem

(OP)
just to update,

actually the script is working, just my mistake, i need to place .csv files in the working directory.

RE: *TREAD command problem

Great, what did I say:)

Quoting myself from above:):"The following is from there, and reads an Amp.csv file (first column time and second amplitude) that exists in the working directory of Ansys APDL, into a table called mytable."

RE: *TREAD command problem

(OP)
Continue above discussion,

the script below is for only displacement at line 3 in x direction.

CODE -->

to_skip=1								!number of line to skip
/INQUIRE,numlines,LINES,disptime,csv
to_read=numlines-to_skip
!
*DEL,mytable,,NOPR

*dim,mytable,TABLE,to_read
*tread,mytable,disptime,csv,,to_skip 

in my case , i have few other nodes which need to be assigned with reaction force in opposite direction;

my first draft;

CODE -->

! creating node and respective element

n,1e3,30,0,0				!node1
e,1e3
cm,node1,node

n,2e3,-30,50,0				!node2
e,2e3
cm,node2,node

n,3e3,-30,-50,0				!node3
e,3e3
cm,node3,node


to_skip=1											!number of line to skip-identical for all cases

/INQUIRE,numlines2,LINES,node1,csv					!return system info to parameter at node1
/INQUIRE,numlines3,LINES,node2,csv					!return system info to parameter at node2
/INQUIRE,numlines4,LINES,node3,csv					!return system info to parameter at node3


			
to_read1=numlines2-to_skip	
to_read2=numlines3-to_skip	
to_read3=numlines4-to_skip	
											
*DIM,tbnode1,TABLE,to_read2							!define array parameter and its dimension at node1
*DIM,tbnode2,TABLE,to_read3							!define array parameter and its dimension at node2
*DIM,tbnode3,TABLE,to_read4							!define array parameter and its dimension at node3


					
*TREAD,tbnode1,node1,csv,,to_skip  					!read table for node1
*TREAD,tbnode2,node2,csv,,to_skip  					!read table for node2
*TREAD,tbnode3,node3,csv,,to_skip  					!read table for node3


lsel,s,line,,3
nsll,s,1
d,3,ux,%mytable%							!apply displacement on line 3

allsel

f,node1,fx,%tbnode1%								!ext force at node1
f,node2,fx,%tbnode2%								!ext force at node2
f,node3,fx,%tbnode3%								!ext force at node3 

as each node also read csv file with time,reaction force. All tables in csv file have similar time.


not sure if running multiple *tread command is ok or not...also really appreciate for advice if there any better solution.

attached the graphical image..


RE: *TREAD command problem

That looks OK I think.

Of course the way to check is to check the reactions and see that they are equal to the applied loads.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close