111ANSYS Command File Creation and Execution

3
5/9/2016 ANSYS Command Fi l e Creati on and Executi on http://www.mece.ualberta.ca/tutori al s/ansys/CL/Create.html 1/3  UofA ANSYS Tutorial  ANSYS UTILITIES  BASIC TUTORIALS  INTERMEDIATE TUTORIALS  ADVANCED TUTORIALS  POSTPROC. TUTORIALS  COMMAND LINE FILES  PRINTABLE VERSION  Creating Files Features Basic Tutorials Intermediate Tutorials Advanced Tutorials PostProc Tutorials Radiation  Index  Contributions Comments MecE 563 Mechanical Engineering University of Alberta  ANSYS Inc. Copyright © 2001 Universi ty o f Alberta  ANSYS Command File Creation and Execution Generating the Command File There are two choices to generate the command file: 1. Directly type in the commands into a text file from scratch. This assumes a good knowledge of the ANSYS command language and the associated options. If you know what some of the commands and are unsure of others, execute the desired operation from the GUI and then go to File > List > Log File. This will then open up a new window showing the command line equivialent of all commands entered to this point. You may directly cut and paste from here to a text editor, or if you'd like to save the whole file, see the next item in this list. 2. Setup and solve the problem as you normally would using the ANSYS graphic user interface (GUI). Then before you are finished, enter the command File > Save DB Log File This saves the equivalent ANSYS commands that you entered in the GUI mode, to a text file. You can now edit this file with a text editor to clean it up, delete errors from your GUI use and make changes as desired. Running the Command File To run the ANSYS command file, save the ASCII text commands in a text file; e.g. frame.cmd start up either the GUI or text mode of ANSYS GUI Command File Loading To run this command file from the GUI, you would do the following: From the File menu, select Read Input from.... Change to the appropriate directory where the file (frame.cmd) is stored and select it.  Now ANSYS will execute the commands from that file. The output window shows the p rogress of this procedure. Any errors and warnings will be listed in this window. When it is complete, you may not have a full view of your structure in the graphic window. You may need to select Plot > Elements or Plot > Lines or what have you. Assuming that the analysis worke d properly, you can now use the post-processor to view element deflections, stress, etc. If you want to fix some errors or make some changes to the command file, make those changes in a separate window in a text editor. Save those changes to disk. To rerun the command file, you should first of all clear the current model from ANSYS. Select File > Clear & Start New. Then read in the file as before File > Read Input from... Command Line File Loading Alternatively, you can also read in the command file right from the ANSYS command line. Assuming that you started ANSYS using the commands...  /ansys52/bin/ansysu52 and then entered  /show,x11c This has now started ANSYS in the text mode and has told it what graphic device to use (in this case an X Windows, X11c, mode). At this point you could type in /menu,on, but you might not want to turn on the full graphic mode if working on a slow machine or if you are executing the program remotely. Let's assume that we don't turn the menu mode on... If the command file is in the current directory for ANSYS, then from the ANSYS input window, type  /input,frame,cmd

Transcript of 111ANSYS Command File Creation and Execution

8/17/2019 111ANSYS Command File Creation and Execution

http://slidepdf.com/reader/full/111ansys-command-file-creation-and-execution 1/3

5/9/2016 ANSYS Command File Creation and Execution

http://www.mece.ualberta.ca/tutorials/ansys/CL/Create.html 1/3

UofA ANSYS Tutorial ANSYSUTILITIES

BASICTUTORIALS

INTERMEDIATETUTORIALS

ADVANCEDTUTORIALS

POSTPROC.TUTORIALS

COMMANDLINE FILES

PRINTABLEVERSION

Creating Files

Features

Basic Tutorials

Intermediate Tutorials

Advanced Tutorials

PostProc Tutorials

Radiation

Index

Contributions

Comments

MecE 563

Mechanical Engineering

University of Alberta

ANSYS Inc.

Copyright © 2001University of Alberta

ANSYS Command File Creation and Execution

Generating the Command File

There are two choices to generate the command file:

1. Directly type in the commands into a text file from scratch. This assumes a good knowledge of the ANSYS command language and the associated options.

If you know what some of the commands and are unsure of others, execute the desired operationfrom the GUI and then go to File ‐> List ‐> Log File. This will then open up a new windowshowing the command line equivialent of all commands entered to this point. You may directlycut and paste from here to a text editor, or if you'd like to save the whole file, see the next item inthis list.

2. Setup and solve the problem as you normally would using the ANSYS graphic user interface(GUI). Then before you are finished, enter the command File ‐> Save DB Log File This savesthe equivalent ANSYS commands that you entered in the GUI mode, to a text file. You can nowedit this file with a text editor to clean it up, delete errors from your GUI use and make changes

as desired.

Running the Command File

To run the ANSYS command file,

save the ASCII text commands in a text file; e.g. frame.cmd

start up either the GUI or text mode of ANSYS

GUI Command File Loading

To run this command file from the GUI, you would do the following:

From the File menu, select Read Input from.... Change to the appropriate directory where thefile (frame.cmd) is stored and select it.

Now ANSYS will execute the commands from that file. The output window shows the progressof this procedure. Any errors and warnings will be listed in this window.When it is complete, you may not have a full view of your structure in the graphic window. Youmay need to select Plot ‐> Elements or Plot ‐> Lines or what have you.Assuming that the analysis worked properly, you can now use the post-processor to view elementdeflections, stress, etc.If you want to fix some errors or make some changes to the command file, make those changes ina separate window in a text editor. Save those changes to disk.To rerun the command file, you should first of all clear the current model from ANSYS. SelectFile ‐> Clear & Start New.

Then read in the file as before File ‐> Read Input from...

Command Line File Loading

Alternatively, you can also read in the command file right from the ANSYS command line. Assumingthat you started ANSYS using the commands...

/ansys52/bin/ansysu52

and then entered

/show,x11c

This has now started ANSYS in the text mode and has told it what graphic device to use (in this case an

X Windows, X11c, mode). At this point you could type in/menu,on

, but you might not want to turn onthe full graphic mode if working on a slow machine or if you are executing the program remotely. Let'sassume that we don't turn the menu mode on...

If the command file is in the current directory for ANSYS, then from the ANSYS input window, type

/input,frame,cmd

8/17/2019 111ANSYS Command File Creation and Execution

http://slidepdf.com/reader/full/111ansys-command-file-creation-and-execution 2/3

5/9/2016 ANSYS Command File Creation and Execution

http://www.mece.ualberta.ca/tutorials/ansys/CL/Create.html 2/3

and yes that is a comma (,) between frame and cmd. If ANSYS can not find the file in the currentdirectory, you may need to point it to the proper directory. If the file was in the directory,/myfiles/ansys/frame for example, you would use the following syntax

/input,frame,cmd,/myfiles/ansys/frame

If you want to rerun a new or modified file, it is necessary to clear the current model in memory withthe command

/clear,start

This full procedure of loading in command files and clearing jobs and starting over again can becompleted as many times as desired.

ANSYS Command Groupings

ANSYS contains hundreds of commands for generating geometry, applying loads and constraints,setting up different analysis types and post-processing. The following is only a brief summary of someof the more common commands used for structural analysis.

Category Command Description Syntax

BasicGeometry

k keypoint definition k,kp#,xcoord,ycoord,zcoord

l straight line creation l,kp1,kp2

larc circular arc line

(from keypoints)larc,kp1,kp2,kp3,rad(kp3 defines plane)

circle circular line creation

(creates keypoints) see online help

spline spline line through keypoints spline,kp1,kp2, ... kp6

a area definition from keypoints a,kp1,kp2, ... kp18

al area definition from lines a,l1,l2, ... l10

v volume definition from

keypoints

v,kp1,kp2, ... kp8

va volume definition from areas va,a1,a2, ... a10

vext create volume from area

extrusion see online help

vdrag create volume by dragging area

along path see online help

SolidModeling(Primitives)

rectng rectangle creation rectng,x1,x2,y1,y2

block block volume creation block,x1,x2,y1,y2,z1,z2

cylind cylindrical volume creation cylind,rad1,rad2,z1,z2,theta1,theta2

sphere spherical volume creation sphere,rad1,rad2,theta1,theta2

prismconetorus

various volume creationcommands

see online help

BooleanOperations

aadd adds separate areas to create

single area aadd,a1,a2, ... a9

aglue creates new areas by glueing

(properties remain separate) aglue,a1,a2, ... a9

asba creat new area by area

substraction asba,a1,a2

aina create new area by area

intersection aina,a1,a2, ... a9

vaddvlguevsbv

volume boolean operations see online help

8/17/2019 111ANSYS Command File Creation and Execution

http://slidepdf.com/reader/full/111ansys-command-file-creation-and-execution 3/3

5/9/2016 ANSYS Command File Creation and Execution

http://www.mece.ualberta.ca/tutorials/ansys/CL/Create.html 3/3

vinv

Elements &Meshing

et defines element typeet,number,typemay define as many as required;current type is set by type

type set current element type pointer type,number

r define real constants for

elements

r,number,r1,r2, ... r6may define as many as required;current type is set by real

real sets current real constant pointer real,number

mp sets material properties for

elements

mp,label,number,c0,c1, ... c4may define as many as required;current type is set by mat

mat sets current material property

pointer mat,number

esize sets size or number of divisions

on linesesize,size,ndivsuse either size or ndivs

eshape controls element shape see online help

lmesh mesh line(s) lmesh,line1,line2,inc

or lmesh,all

amesh mesh area(s) amesh,area1,area2,inc

or amesh,all

vmesh mesh volume(s) vmesh,vol1,vol2,inc

or vmesh,all

Sets &Selection

ksel select a subset of keypoints see online help

nsel select a subset of nodes see online help

lsel select a subjset of lines see online help

asel select a subset of areas see online help

nsla select nodes within selected

area(s) see online help

allsel select everything

i.e. reset selection allsel

Constraints dk defines a DOF constraint on a

keypoint

dk,kp#,label,valuelabels:UX,UY,UZ,ROTX,ROTY,ROTZ,ALL

d defines a DOF constraint on a

node

d,node#,label,valuelabels:UX,UY,UZ,ROTX,ROTY,ROTZ,ALL

dl defines (anti)symmetry DOFconstraints on a line

dl,line#,area#,labellabels: SYMM (symmetry); ASYM(antisymmetry)

Loads fk defines a fk,kp#,label,value

labels: FX,FY,FZ,MX,MY,MZ

f defines a force at a node f,node#,label,value

labels: FX,FY,FZ,MX,MY,MZ