Tuesday, 18 September 2012

Printing and Plotting ANSYS Results to a File


Printing Text Results to a File

ANSYS produces lists and tables of many types of results that are normally displayed on the screen. However, it is often desired to save the results to a file to be later analyzed or included in a report.
  1. Stresses: instead of using 'Plot Results' to plot the stresses, choose 'List Results'. Select 'Elem Table Data', and choose what you want to list from the menu. You can pick multiple items. When the list appears on the screen in its own window, Select 'File'/'Save As...' and give a file name to store the results.
  2. Any other solutions can be done in the same way. For example select 'Nodal Solution' from the 'List Results' menu, to get displacements.
  3. Preprocessing and Solution data can be listed and saved from the 'List' menu in the 'Utility Menu bar'. Save the resulting list in the same way described above.

Plotting of Figures

There are two major routes to get hardcopies from ANSYS. The first is a quick a raster-based screen dump, while the second is a scalable vector plot.

1.0 Quick Image Save

When you want to quickly save an image of the entire screen or the current 'Graphics window', select:
  • 'Utility menu bar'/'PlotCtrls'/'Hard Copy ...'.
  • In the window that appears, you will normally want to select 'Graphics window', 'Monochrome', 'Reverse Video', 'Landscape' and 'Save to:'.
  • Then enter the file name of your choice.
  • Press 'OK'
This raster image file may now be printed on a PostScript printer or included in a document.

2.0 Better Quality Plots

The second method of saving a plot is much more flexible, but takes a lot more work to set up as you'll see...

Redirection

Normally all ANSYS plots are directed to the plot window on the screen. To save some plots to a file, to be later printed or included in a document or what have you, you must first 'redirect' the plots to a file by issuing:
  'Utility menu bar'/'PlotCtrls'/'Redirect Plots'/'To File...'.
Type in a filename (e.g.: frame.pic) in the 'Selection' Window.
Now issue whatever plot commands you want within ANSYS, remembering that the plots will not be displayed to the screen, but rather they will be written to the selected file. You can put as many plots as you want into the plot file. When you are finished plotting what you want to the file, redirect plots back to the screen using:
  'Utility menu bar'/'PlotCtrls'/'Redirect Plots'/'To Screen'.

Display and Conversion

The plot file that has been saved is stored in a proprietary file format that must be converted into a more common graphic file format like PostScript, or HPGL for example. This is performed by running a separate program called display. To do this, you have a couple of options:
  1. select display from the ANSYS launcher menu (if you started ANSYS that way)
  2. shut down ANSYS or open up a new terminal window and then type display at the Unix prompt.
Either way, a large graphics window will appear. Decrease the size of this window, because it most likely covers the window in which you will enter the display plotting commands. Load your plot file with the following command:
  file,frame,pic
if your plot file is 'plots.pic'. Note that although the file is 'plots.pic' (with a period), Display wants 'plots,pic'(with a comma). You can display your plots to the graphics window by issuing the command like
  plot,n
where n is plot number. If you plotted 5 images to this file in ANSYS, then n could be any number from 1 to 5.
Now that the plots have been read in, they may be saved to printer files of various formats:
  1. Colour PostScript: To save the images to a colour postscript file, enter the following commands in display:
      pscr,color,2
    /show,pscr
    plot,n
    where n is the plot number, as above. You can plot as many images as you want to postscript files in this manner. For subsequent plots, you only require the plot,n command as the other options have now been set. Each image is plotted to a postscript file such as pscrxx.grph, where xx is a number, starting at 00.Note: when you import a postscript file into a word processor, the postscript image will appear as blank box. The printer information is still present, but it can only be viewed when it's printed out to a postscript printer.
    Printing it out: Now that you've got your color postscript file, what are you going to do with it? Take a look here for instructions on colour postscript printing at a couple of sites on campus where you can have your beautiful stress plot plotted to paper, overheads or even posters!
  2. Black & White PostScript: The above mentioned colour postscript files can get very large in size and may not even print out on the postscript printer in the lab because it takes so long to transfer the files to the printer and process them. A way around this is to print them out in a black and white postscript format instead of colour; besides the colour specifications don't do any good for the black and white lab printer anyways. To do this, you set the postscript color option to '3', i.e. and then issue the other commands as before
      pscr,color,3
    /show,pscr
    plot,n
    Note: when you import a postscript file into a word processor, the postscript image will appear as blank box. The printer information is still present, but it can only be viewed when it's printed out to a postscript printer.
  3. HPGL: The third commonly used printer format is HPGL, which stands for Hewlett Packard Graphics Language. This is a compact vector format that has the advantage that when you import a file of this type into a word processor, you can actually see the image in the word processor! To use the HPGL format, issue the following commands:
      /show,hpgl
    plot,n

    Final Steps

    It is wise to rename these plot files as soon as you leave display, for display will overwrite the files the next time it is run. You may want to rename the postscript files with an '.eps' extension to indicate that they are encapsulated postscript images. In a similar way, the HPGL printer files could be given an '.hpgl' extension. This renaming is done at the Unix commmand line (the 'mv' command).A list of all available display commands and their options may be obtained by typing:
      help
    When complete, exit display by entering
      finish

No comments:

Post a Comment