1 / 18

Short Topics

Module 15. Short Topics. Short Topics. In this chapter, we will present some general tips and “tricks” on how to use ANSYS more efficiently: A. Toolbar & Abbreviations B. Start File C. Input Files D. Batch Mode E. Workshop. Short Topics A. Toolbar & Abbreviations.

Télécharger la présentation

Short Topics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Module 15 Short Topics

  2. Short Topics • In this chapter, we will present some general tips and “tricks” on how to use ANSYS more efficiently: A. Toolbar & Abbreviations B. Start File C. Input Files D. Batch Mode E. Workshop January 30, 2001 Inventory #001441 15-2

  3. Short TopicsA. Toolbar & Abbreviations • An abbreviation is a short-cut to commonly used functions. It is a character string that represents one or more ANSYS commands. • Whenever you define an abbreviation, it appears as a button in the ANSYS Toolbar, giving you one-button access to the desired function. • There are five predefined abbreviations when you first start ANSYS, but you can modify them or add your own — up to 100 total abbreviations. January 30, 2001 Inventory #001441 15-3

  4. Short Topics...Toolbar & Abbreviations • As an example, to display line numbers on a line plot, you would need to do the following: • Utility Menu > PlotCtrls > Numbering… > Line numbers On > OK • Utility Menu > Plot > Lines Later, to turn off line numbers, you would have to use the same menus again. • Instead, you could define two abbreviations: • LINE_ON for the command string ‘/pnum,line,on $lplot’ • LINE_OFF for ‘/pnum,line,off $lplot’ and simply press the appropriate button in the toolbar to turn line numbering on or off. January 30, 2001 Inventory #001441 15-4

  5. The following information is needed for an abbreviation: The short-cut name The command string it represents. To find out the command for a particular function, first execute the function using the GUI, then list the log file (Utility Menu > List > Files > Log File). Use the *ABBR command to define abbreviations: *ABBR, name, command_string If command_string consists of more than one command (separated by a $ sign), it must be enclosed in single quotes. A convenient dialog box is available for this: Utility Menu > MenuCtrls > Edit Toolbar… or Utility Menu > Macro > Edit Abbreviations… Short Topics...Toolbar & Abbreviations January 30, 2001 Inventory #001441 15-5

  6. Short Topics...Toolbar & Abbreviations • Abbreviations are stored in the standard ANSYS database, so they get saved to the .db file when you save the database. • You can also write abbreviations to an ASCII file, jobname.abbr: • Utility Menu > MenuCtrls > Save Toolbar… • or Utility Menu > Macro > Save Abbr… • or ABBSAV command • To restore abbreviations from a file, use: • Utility Menu > MenuCtrls > Restore Toolbar… • or Utility Menu > Macro > Restore Abbr… • or ABBRES command January 30, 2001 Inventory #001441 15-6

  7. Short Topics...Toolbar & Abbreviations • By creating a series of .abbr files and with a clever use of ABBSAV and ABBRES functions, you can create “nested” toolbars — buttons that bring up an entirely new set of buttons — and put together a menu of your own! • Once you master the ANSYS command language, there is virtually no limit to the power and usefulness of abbreviations! January 30, 2001 Inventory #001441 15-7

  8. Short Topics...Toolbar & Abbreviations • Demo: • Resume rib.db • Create abbreviations EPLOT, APLOT, LPLOT, KPLOT • Delete KPLOT abbreviation • Save abbreviations to file.abbr, then list the file • Now list the log file and show the ABBSAVE command. (This is how you can find out the commands for a given function.) • Resume rib.db again • Restore abbreviations from file.abbr and use the buttons January 30, 2001 Inventory #001441 15-8

  9. Short TopicsB. Start File • Whenever you start ANSYS, it reads a start file called start57.ans (or start56.ans, start58.ans, etc. depending on ANSYS revision). • You can include any commands in the start file. The most common ones are abbreviation definitions. • ANSYS checks for the start file first in the working directory and then in your home directory. If no file is found, it will read the “default” start file in the ANSYS documentation directory (/ansys57/docu). • The “default” start file contains several suggested abbreviations, all of them commented out. You can make a copy of it and “uncomment” the ones you want to use. January 30, 2001 Inventory #001441 15-9

  10. Short TopicsC. Input Files • ANSYS is a command-driven program and can accept commands from several sources: • from GUI dialog boxes (which simply “send” commands to ANSYS when you press OK or Apply) • from the keyboard • from input files • An efficient way to run ANSYS, especially when you are rerunning a previous analysis, is to use input files containing the desired command sequence: • Utility Menu > File > Read Input from… • or the /INPUT command (The start file is just an input file that is automatically read at start-up by a built-in /input command.) January 30, 2001 Inventory #001441 15-10

  11. Short Topics...Input Files • For example, you can create a file called rectangle.inp containing the following lines: /prep7 ! Enter preprocessor rect,0,3,0,1 ! Create a 3x1 rectangle aplot and then read it into ANSYS: /input,rectangle,inp ! or File > Read Input from… • The ! character above indicates a comment and can be used to: • annotate the input file with explanations. • “comment out” an entire command. January 30, 2001 Inventory #001441 15-11

  12. Short Topics...Input Files • You can use the log file jobname.log as an input file. Keep in mind the following points when you do this: • The log file records all commands executed during an ANSYS session. • Always use a copy of the log file, don’t just rename it. • It may be helpful to edit the copy first and: • add descriptive comments • “clean it up” by removing erroneous commands and graphics commands (/view, /focus, /dist, etc.) • add prompting commands (*ASK) January 30, 2001 Inventory #001441 15-12

  13. Short Topics...Input Files • Session Editor • Powerful ANSYS “Undo” • ANSYS keeps a running copy of your log file from your last save command. • By modifying the values in the Session Editor window and clicking OK, the modified commands are read back into ANSYS. • Main Menu > Session Editor … January 30, 2001 Inventory #001441 15-13

  14. Short Topics...Input Files The *ASK Command • *ASK prompts the user for input and assigns the response to a parameter. For example, you can modify rectangle.inp as follows: /prep7 ! Enter preprocessor *ask,w,WIDTH OF RECTANGLE,3 rect,0,w,0,1 ! Create a wx1 rectangle aplot When you input this file into ANSYS, you will see the prompt shown below. Your response, say 5.2, is assigned to the parameter w, which is used in the subsequent RECT command. January 30, 2001 Inventory #001441 15-14

  15. Short Topics...Input Files • *ASK, Par, Query, DVAL • Par is the parameter name to which the response value is assigned. • Query is the prompt string, up to 32 characters. The word ENTER automatically appears as the first word of the prompt. • DVAL is the default value assigned to Par if the response is blank. January 30, 2001 Inventory #001441 15-15

  16. Short TopicsD. Batch Mode • In batch mode, ANSYS reads commands from an input file you supply, and writes responses to an output file. The process runs in the background, freeing up your computer for other work. • Of the three main phases of an analysis — preprocessing, solution, postprocessing — the solution phase is best suited for batch mode. Thus a batch input file could be as simple as: resume,... ! Resume database from preprocessing session /solu solve finish January 30, 2001 Inventory #001441 15-16

  17. Short Topics...Batch Mode • To start a batch run, use the Batch button on the launcher, or use the -b option if using the command line to start ANSYS: • For example, ansys57 -b -m 128 -db 16 < file.inp > file.out & January 30, 2001 Inventory #001441 15-17

  18. Short TopicsE. Workshop • This workshop consists solves the classic plate-with-a-hole problem using three methods: W13A. Batch Mode W13B. *ASK W13C. Abbreviations Refer to your Workshop Supplement for instructions. January 30, 2001 Inventory #001441 15-18

More Related