Você está na página 1de 4

3/17/13

UofA ANSYS Tutorial Creating Files Features Basic Tutorials Intermediate Tutorials Advanced Tutorials PostProc Tutorials Radiation ANSYS UTILITIES

ANSYS Command File Creation and Execution


BASIC TUTORIALS INTERMEDIATE TUTORIALS ADVANCED TUTORIALS POSTPROC. TUTORIALS COMMAND LINE FILES PRINTABLE VERSION

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 F i l e>L i s t>L o gF i l e . 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 F i l e>S a v eD BL o gF i l eThis 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.

Index

Contributions Comments MecE 563 Mechanical Engineering University of Alberta

Running the Command File


To run the ANSYS command file, save the ASCII text commands in a text file; e.g. f r a m e . c m d start up either the GUI or text mode of ANSYS

ANSYS Inc.

Copyright 2001 University of Alberta

GUI Command File Loading


To run this command file from the GUI, you would do the following: From the F i l emenu, select R e a dI n p u tf r o m . . . . Change to the appropriate directory where the file (f r a m e . c m d ) is stored and select it. Now ANSYS will execute the commands from that file. The output window shows the progress 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 P l o t>E l e m e n t sor P l o t>L i n e sor what have you. Assuming that the analysis worked 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 F i l e> C l e a r&S t a r tN e w . Then read in the file as before F i l e>R e a dI n p u tf r o m . . .

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...
/ a n s y s 5 2 / b i n / a n s y s u 5 2

and then entered


/ s h o w , x 1 1 c
www.mece.ualberta.ca/tutorials/ansys/CL/create.html 1/4

3/17/13

ANSYS Command File Creation and Execution

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 / m e n u , o n , 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
/ i n p u t , f r a m e , c m d

and yes that is a comma (, ) between f r a m eand c m d . If ANSYS can not find the file in the current directory, you may need to point it to the proper directory. If the file was in the directory, / m y f i l e s / a n s y s / f r a m efor example, you would use the following syntax
/ i n p u t , f r a m e , c m d , / m y f i l e s / a n s y s / f r a m e

If you want to rerun a new or modified file, it is necessary to clear the current model in memory with the command
/ c l e a r , s t a r t

This full procedure of loading in command files and clearing jobs and starting over again can be completed 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 some of the more common commands used for structural analysis. Category Basic Geometry Command k l larc circle spline a al v va vext vdrag Solid Modeling (Primitives) Description keypoint definition straight line creation circular arc line (from keypoints) circular line creation (creates keypoints) spline line through keypoints area definition from keypoints area definition from lines volume definition from keypoints volume definition from areas create volume from area extrusion create volume by dragging area along path rectangle creation block volume creation cylindrical volume creation spherical volume creation Syntax k,kp#,xcoord,ycoord,zcoord l,kp1,kp2 larc,kp1,kp2,kp3,rad (kp3 defines plane) see online help spline,kp1,kp2, ... kp6 a,kp1,kp2, ... kp18 a,l1,l2, ... l10 v,kp1,kp2, ... kp8 va,a1,a2, ... a10 see online help see online help

rectng block cylind sphere

rectng,x1,x2,y1,y2 block,x1,x2,y1,y2,z1,z2 cylind,rad1,rad2,z1,z2,theta1,theta2 sphere,rad1,rad2,theta1,theta2


2/4

www.mece.ualberta.ca/tutorials/ansys/CL/create.html

3/17/13

ANSYS Command File Creation and Execution

prism cone torus Boolean Operations aadd aglue asba aina vadd vlgue vsbv vinv Elements & Meshing et type r

various volume creation commands see online help adds separate areas to create single area creates new areas by glueing (properties remain separate) creat new area by area substraction create new area by area intersection

aadd,a1,a2, ... a9 aglue,a1,a2, ... a9 asba,a1,a2 aina,a1,a2, ... a9

volume boolean operations

see online help

defines element type set current element type pointer define real constants for elements

et,number,type may define as many as required; current type is set by t y p e type,number r,number,r1,r2, ... r6 may define as many as required; current type is set by r e a l real,number mp,label,number,c0,c1, ... c4 may define as many as required; current type is set by m a t mat,number esize,size,ndivs use either size or ndivs see online help lmesh,line1,line2,inc or lmesh,all amesh,area1,area2,inc or amesh,all vmesh,vol1,vol2,inc or vmesh,all see online help see online help see online help see online help

real mp

sets current real constant pointer sets material properties for elements sets current material property pointer sets size or number of divisions on lines controls element shape mesh line(s) mesh area(s) mesh volume(s) select a subset of keypoints select a subset of nodes select a subjset of lines select a subset of areas

mat esize eshape lmesh amesh vmesh Sets & Selection ksel nsel lsel asel nsla allsel
www.mece.ualberta.ca/tutorials/ansys/CL/create.html

select nodes within selected area(s) see online help select everything i.e. reset selection allsel
3/4

3/17/13

ANSYS Command File Creation and Execution

i.e. reset selection

Constraints

dk

defines a DOF constraint on a keypoint defines a DOF constraint on a node defines (anti)symmetry DOF constraints on a line

dk,kp#,label,value labels: UX,UY,UZ,ROTX,ROTY,ROTZ,ALL d,node#,label,value labels: UX,UY,UZ,ROTX,ROTY,ROTZ,ALL dl,line#,area#,label labels: SYMM (symmetry); ASYM (antisymmetry) fk,kp#,label,value labels: FX,FY,FZ,MX,MY,MZ f,node#,label,value labels: FX,FY,FZ,MX,MY,MZ

dl

Loads

fk

defines a

defines a force at a node

www.mece.ualberta.ca/tutorials/ansys/CL/create.html

4/4

Você também pode gostar