Cfd-View v2014.0 User Manual
Cfd-View v2014.0 User Manual
0
User Manual
©1997-2014 by ESI-Group
This ESI Group documentation is the confidential and proprietary product of ESI-Group, Inc. Any unauthorized use, reproduction, or transfer of
this manual is strictly prohibited. This documentation is subject to limited distribution and restricted disclosure.
CFD-ACE™, CFD-ACE+™, CFD-CADalyzer™, CFD-VIEW™, CFD-GEOM™, SimManager™, CFD-TOPO™, CFD-VisCART™, CFD-Micromesh™ and CFD-
FASTRAN™ are registered trademarks of ESI-Group.
Portions of this product are owned by third-party software vendors.
Revision Information
The information in this guide applies to all current ESI CFD products until superseded by a newer version of this guide.
v
CFD-VIEW V2014.0 User Manual
Chapter 4. Toolbar........................................................................................................................................ 67
Toolbar Introduction ...............................................................................................................................................67
New Model ..............................................................................................................................................................67
Open ........................................................................................................................................................................68
Import......................................................................................................................................................................69
Save .........................................................................................................................................................................69
Save As ....................................................................................................................................................................70
Show Lasso ..............................................................................................................................................................72
Snapshot ..................................................................................................................................................................72
Copy.........................................................................................................................................................................74
Delete ......................................................................................................................................................................74
Perspective and Parallel ..........................................................................................................................................75
vi
Table of Contents
vii
CFD-VIEW V2014.0 User Manual
viii
Table of Contents
ix
CFD-VIEW V2014.0 User Manual
x
Chapter 1. Introduction
1
CFD-VIEW V2014.0 User Manual
CFD-View Features
CFD-VIEW is part of a suite of ESI-Group computer programs that analyze computational fluid dynamics (CFD). One
of the challenges in computational modeling is that each simulation generates a large volume of data that must be
reduced to extract useful information that can be applied to practical science and engineering problems. To aid in
the data reduction process, CFD-VIEW is the 3D graphical post-processor. Its integration with the ESI CFD flow
solver codes enable it to compute large data sets and display CFD flow solver results.
A CFD data set is produced by solving discrete equations that represent fluid physics over a 2D or 3D grids, and by
resolving problems for cells with a variety of shapes.
The most popular 3D shapes are hexahedral, prismatic, or tetrahedral. The most popular 2D shapes are
quadrilateral or triangular. The computational domain is decomposed into a number of grid blocks, also known as
zones, that are composed of grid cells. CFD-VIEW is designed to handle multiple zones, all with the same cell type
or hybrid combinations of zones, each zone with a different cell type.
Feature Description
Easy to Learn CFD-VIEW uses surface-based visualization. You can display one or more computational
planes, cutting planes, walls, and shaded iso-value surfaces. Similar surface visualization
techniques make CFD-VIEW an easy-to-learn visualization package.
Geometric Display computational volume outlines, boundary conditions, and sprays (for random
Highlighting points).
Scalar Mapping Smoothly vary colors over a surface with the color map.
Draw surface contours.
Draw flooded contours where all values between two levels are mapped to the same
color. (This is very helpful in distinguishing data values shown.)
Color Mapping Change colors or the way scalar quantities are mapped to colors.
Cutting Planes X,Y,Z cutting planes, Arbitrary cutting planes, and Isosurfaces are available for volume
data types These take volumes as input, and produce surfaces as output objects.. For 2D
surfaces, the cutting operations produce curves as output.
Vector Arrow Display vector quantities by mapping small vector arrows on surfaces.
Mapping
Scale the vector arrows using the velocity magnitude.
Plot each vector arrow to the same size.
Use velocity magnitude to scale only the vector arrow stems, making the vector arrows all
uniform.
Define a subset of vector arrows by changing the upper and lower velocity limits of the
vector arrows you want to see.
Project vector arrows onto the surface to see flow component tangential to the surface.
Particle Tracing Trace a particle forward or backward and display the resulting trace in a number of
different ways. For example, you can display the points, show the trace as a line, a
twisting ribbon, or as a tube. You can plot arrows along the trace.
Scale particle arrows by the velocity magnitude and then color them by velocity
2
Introduction
Feature Description
magnitude or integration time.
Specify the accuracy of the integration process in several ways.
Line Probe Create an XY plot of values along an X, Y, or Z line, I, J, or K line, arbitrary straight line or
poly line.
Specify the visual attributes of a plot using such options as ticks, numbers, grid lines, and
colors.
Plot any variable against the node index; against an X, Y, or Z coordinate; against the arc-
length of the line; or against another variable.
Save the extracted data to a file for reading into another package.
Point Net The point net operation produces an evenly spaced cartesian points, where the individual
points are samples from the underlying volume or surface. This is very useful for
displaying a clearer picture of a flow field, for example, where the computational grid may
be irregular or cluttered.
Expression Calculator Use the programmable expression calculator, with built-in functions for scalar
manipulation, gradients, integration, and conditional expressions. Also has user-defined
formulas and automatic formula-execution during file load or animation.
Symmetry Conditions Draw models with combinations of axial and planar symmetries, or with translational
symmetries for viewing CFD simulations which have taken advantage of symmetries to
reduce the domain of a particular problem.
Presentation Objects Use presentation objects such as boxes, ovals, lines (with or without arrows), text labels,
axes, color map legends, and bounding boxes to assemble slide presentations. Each of
these objects has a number of modifiable options.
Screen Shots Create hard-copy outputs using the lasso to select an arbitrary area of the window and
save the area in a specific graphics format: Silicon Graphics RGB, Microsoft Word bitmap
(BMP), Portable Pixmap (PPM), Compuserve GIF, Joint Photographics Experts Group
(JPEG), Portable Network Graphics (PNG), or PostScript.
Use readily available tools such as Showcase or public domain software such as XV to
convert these images to any other type of image format.
Save anti-aliased images for presentation purposes.
Move, draw, or image PostScript output to printer.
Animation Define and animate objects such as surfaces, particle traces, and the viewing camera.
Animate the rotation around symmetry axis.
Create one video frame for each intermediate position using automatic play back,
3
CFD-VIEW V2014.0 User Manual
Feature Description
interactively or in batch-mode.
Create animated GIF for web pages presentation.
Movie Generation Record animated movies directly to MPEG digital video output, Animated GIF file, or
numbered image files for further manipulation with other software tools.
Use the external trigger input to read in, display, and record movie sequences from time-
dependent flow simulations running simultaneously.
Use automatic sequencing through numbered Plot3D or DTF data sets; automatic
sequencing through multiple DTF simulation numbers.
Clipboard Support Cut and paste from viewer and plotter windows into windows applications.
4
Introduction
TAB Curves x x x
* Unformatted (FORTRAN-output) data and binary data can be byte-swapped. This swapping capability allows you
to read in data from computers with different byte-ordering. Using the byte-swap option, you can read binary or
unformatted data from one architecture machine into another. For example, the DEC Alpha and Intel architectures
order bytes in a computer work backwards from the Silicon Graphics, SUN, IBM, or HP architectures.
Visualization Objects
CFD-VIEW contains a variety of tools to visualize and extract data from complex 3-D data sets called Visualization
Objects. Simple mouse operations select and control the visualization objects. A turbo option is provided to ensure
acceptable interactive response times for large applications (over 500,000 nodes) or for relatively slow computers.
Visualization Objects are groups into three categories: Surface Objects, Operators, and Annotation Objects.
Surface Objects - Surface objects, in the Control Panel, enable you to graphically display a surface from the
computational model. Surfaces include computational plane surfaces, cutting plane surfaces, iso-value surfaces,
and unstructured surfaces. On each surface, contour levels of any of the variables in the data set can be displayed
as value-colored lines, flooded contour levels, and continuously shaded value-colored surfaces. Vector fields can
also be displayed on these planes using arrows to indicate magnitude and direction.
Operators The Operator Palette contains objects known as Operators. Some of these include the following:
• A point probe that enables you to extract data from any point in the flow field
• A line probe that makes X-Y plots
• A streamline tracer to create particle traces using any vector field in the model
Annotation The Operator Palette also contains Annotation Objects that add legends, text, boxes, lines, arrows,
Objects and any other annotation needed to create presentation graphics.
5
CFD-VIEW V2014.0 User Manual
MODELFILE
This option is added in the CFD-VIEW command line to start CFD-VIEW with an existing model.
The format of this command is:
CFD-VIEW modelfile
[OPTIONS] DATAFILE
This option is added in the CFD-VIEW command line to start CFD-VIEW with an empty model and import a data file.
The format of this command is:
CFD-VIEW [options] datafile
-F DTFFILE
This option is added in the CFD-VIEW command line to start CFD-VIEW with an empty model and import a DTF file.
The format of this command is:
CFD-VIEW -f dtffile
6
Introduction
-NOGUI -S SCRIPT
This option is added in the CFD-VIEW command line to start CFD-VIEW in headless mode and execute a Python
script. CFD-VIEW can now be run in a "headless" mode, without a GUI displayed, where it is under script control.
With the new scripting system, batch mode processing is even simpler.
The format of this command is:
CFD-VIEW -nogui -s script
where you would substitute the actual name of your script. This is supported for the software only OpenGL
renderer, XCFD-VIEW, which is now available on Windows. Your results can be obtained programmatically through
your Python script for such things as the calculator output, or from the new image output script functions.
Note The plotter and its functionalities are not available in headless mode.
-NOACCEL
This option is added in the CFD-VIEW command line to start CFD-VIEW without hardware graphics acceleration
(Windows only).
The format of this command is:
CFD-VIEW -noaccel
All graphics cards should be used with the latest drivers.
-H (OR -HELP)
This option is added in the CFD-VIEW command line to start CFD-VIEW and provide help on command line
arguments.
The format of this command is:
CFD-VIEW -h
-V
This option is added in the CFD-VIEW command line to start CFD-VIEW and display version number.
The format of this command is:
CFD-VIEW -v
-L
This option is added in the CFD-VIEW command line to start CFD-VIEW and display license information.
The format of this command is:
CFD-VIEW -l
D[OPTIONS][=SIMNO]
This option is added in the CFD-VIEW command line to start CFD-VIEW and load a DTF format data file with a
variety of options.
The DTF options are: Z,V,S,R,F,U,B,K,E,N,D (Use Zone Base Reader, use VC Based Reader, use Simplifying Reader,
Read Spray Also, Formatted (if Spray), Unformatted (if Spray), Binary (if Spray), Blanking, Swap Bytes, No Force
Z=0, Unscaled). The simno variable is optional, but will output the simulation number.
7
CFD-VIEW V2014.0 User Manual
<TYPE><FORMAT><DATA>
This option is added in the CFD-VIEW command line to start CFD-VIEW and load data from file of <type> using
<format>, where:
<type> is one of: P,U,X,A (PLOT3D, UFAST, XFG, AFG), and
<format> is one of: F,U,B (Formatted, Unformatted, Binary) and
<data> is: G,S,V,F,B,M,D,W,R,2,E (Grid, Scalar, Vector, Function, Blanking, Multizone, Double, Walls, Spray,
2D, Swap Bytes).
Customer Support
ESI-CFD provides excellent customer support, with staff spread around the globe. Please call on us if you have any
questions about the use of your software or modeling applications.
8
Introduction
Go ToMeeting
http://www.gotomeeting.com / http://www.joingotomeeting.com
An e-mail invitation is usually issued, but you can look for the meeting
here.
Community Forum
http://www.esi-cfd.com/component/option,com_smf/Itemid,188/
Used for consulting types of questions (for example, How can I do this?,
Have you ever done this?, Does anybody have an example of that?, and so
forth).
Only registered members are allowed to access this section, so you will
need to log in or register for an account with Community Forums.
• Platform information
• Product/Application version number
• Modules/Features you were using
• Type of problem you were working on
• Any error messages that you may have received in the output/log files or on the screen.
• Applicable files (GGD, VGD, DTF, output files, etc. - put larger files on the ftp site)
• Precise description of how you observed the problem
• Instructions on how Support can reproduce the problem
9
CFD-VIEW V2014.0 User Manual
Use your favorite ftp client or web browser to upload files to our ftp site, ftp://ftp.esi-cfd.com. The login name and
password for the public account on the ftp site is listed in the Knowledge Base section of the CFD Portal.
Customers who prefer to use a web browser with drag-and-drop functionality should use the following syntax:
ftp://username:[email protected]/pub
After you have accessed ftp.esi-cfd.com, you can create a directory for your files under the pub subdirectory. In
your email to Support, inform Support where the uploaded files are located.
• You can choose to send output files, log files or scripts instead of GGD, VGD, DTF, etc. files. Also, in case of
DTF files, you can choose to send only the output of the view data command:
This prints only the simulation data contained in the DTF file. There is no geometry or boundary condition
information printed. Support can resolve many problems just by looking at the simulation data settings.
• It is ESI Group policy to handle all customer data as confidential, even if a Non-Disclosure Agreement has
not been executed.
• ESI Group will sign a Non-Disclosure Agreement upon request. Contact your sales agent or Distributor to
discuss this option.
• Customer Support can set up password-protected ftp accounts on the ftp site so that no other users can
see your directory or files on the ftp server. No one but you and Support will know you are putting files on
the ftp server. Ask Support if you wish to have a password-protected ftp account.
• Support may be able to help you using GoToMeeting. GoToMeeting enables an on-line meeting where ESI
CFD Support Engineers can see your desktop, including your DTF file, and see the problems you are having
without the need for you to transfer any files off of your computer. GoToMeeting can allow the remote
party (Support) to take control of the mouse and drive the session, but this does not happen by default
(you would have to give permission). Please request a GoToMeeting session with Support if you feel this is
the best way to resolve your problem.
• You can often create a simplified model that represents your real model, but has different boundary
condition values and a different geometry. Sometimes in the process of creating a simplified model to
send to Support, you may discover that the simplified model works fine, and this additional information is
often enough to identify the root cause of the problem.
10
Introduction
% python2.4_cfd
>>> import platform
>>> print platform.platform()
>>> print platform.architecture()
<Ctrl-Z> to end the session (Ctrl-D on Unix/Linux)
In addition, you should provide information about which software package you downloaded. If you are on a Unix
or Linux system, or you can run Cygwin under Windows, you can get the canonical platform name by running this
script:
% getCanonical.sh
If ESI_HOME is set correctly and $ESI_HOME/UTILS_2007/bin is first in your PATH, both these commands will be
found. Windows users without Cygwin can send the output from the Python commands; that is sufficient.
Windows users may first need to set PYTHONHOME so that the interpreter finds its required library files. Do this
either under Settings/Control Panel/System/Advanced/Environment Variables, or from a DOS shell:
% set PYTHONHOME="%ESI_HOME%\UTILS_2007\Python2.4_CFD"
-or-
2. On the command line, enter, for example, CFD-ACE-GUI -v and press Enter. This command is case
sensitive and includes a space before –v. A file (CFD-ACE-GUI.version in this case) is created, in the current
working directory, which contains the build date and version information.
11
Chapter 2. GUI
Start Screen
The CFD-VIEW opening window allows you to create a New File, open an existing file (Open File), or import a file
(Import File). You can quickly retrieve a Recent File by clicking the file name of the appropriate file. If too many
files are listed, click Clear Recent Files to re-set the list of files. From this window you can also access information
about the version of CFD-VisCART you are running (About), open the help file (Help), and go to the ESI Group web
site (ESI).
13
CFD-VIEW V2014.0 User Manual
Window Layout
The CFD-VIEW interface consists of the following elements:
Title Bar
Menu Bar
Toolbar
Display Settings
3D Viewer (Workspace)
Control Panel (Property Panels)
Operator Palette
Object Explorer
Selection / Grouping
Status Bar
14
GUI
Object Description
Title Bar
displays the name of the software (CFD-VIEW) and the file name of an active model, if
any model files are open. In addition, the title bar will contain the data file name, if one
has been loaded, and the model has not been given a name.
Note A CFD-VIEW model can contain multiple data files loaded from different sources.
In addition, the title bar contains a Window button that opens the Window menu.
The title bar also includes the standard Windows controls (minimize, maximize, and
close).
Toolbar contains buttons that are used as shortcuts to some of the same items that are
accessible from the Menu bar. The most frequently used functions are grouped
together as meaningful, related buttons.
Display settings changes surface values, assigns data values to variables, and changes the way in which
a plane is rendered. If there is more than one object selected in the 3D viewer, the
buttons appears in one of four states.
Control (Property) panel controls the model attributes. Each of the tabs on the Control panel provides options
for various settings.
Operator palette contains buttons for viewing data in the workspace in a number of different ways:
operators and annotations objects.
Operator controls contains control buttons and input fields for manipulating operators
Status Bar displays information about progress, images, features, and procedures.
15
Chapter 3. Menu Bar
File menu
Edit menu
View Menu
Units menu
Vector menu
Arrange menu
Tools menu
Window menu
Help menu
File Menu
New
Open
Open Data File / Import Additional Data File
Reload the Same Data File
Replace Data File
Select Files for Animation
Run Python Script
Select Trigger File
Enable Trigger
Save
Save As
Save Image
Save Object
Save All Data with Model
Close
Close All
Recent Model Files
Quit
17
CFD-VIEW V2014.0 User Manual
New
The New Model option creates a new 3D viewer in the workspace. When you launch CFD-VIEW, it automatically
opens one 3D viewer. The 3D viewer is initially empty and you must import a file or begin creating objects to begin
working. The New option is also available in Tool Bar-New Model.
Note If you close the 3D viewer, you must select New from the File menu or click the New Model button in the
Toolbar before you can import a file. The Import File option on the Toolbar and in the File menu are disabled until
you create a new 3D viewer.
Open
The Open option opens a CFD-VIEW model file (*.mdl) in the workspace. To open any other type of file supported
by CFD-VIEW, use the Import option. When you select the Open option, the Open Model File window displays and
prompts you to select the directory and file name. Each time you open a new model, a new 3D viewer is opened
and the file name is added to the recent file list. Therefore, if you find yourself often working on the same model
file, you can load it by clicking Recent Model Files at the lower part of the File menu.
18
Menu Bar
CFD-VIEW provides several tools that allow you to navigate to your model file.
• You can select a folder using the Directory Drop Down Box, the Up One Level Button, the Contents List
Box, the Working Directory button, the Bookmarks, or the Back to Home Directory button.
• The To Home Directory button changes the directory to your home directory.
• The Working Directory button changes the active directory to the current working directory, that is, the
directory where CFD-VIEW was started.
• The Create Bookmark button opens a menu that enables you to set bookmarks to directories you use
frequently. The bookmarks will remain available until you delete them using the Clear bookmarks option.
• You can also navigate through directories using the keyboard arrow keys or the backspace button, which
moves up one directory level.
CFD-VIEW contains hot keys that enable you to quickly perform operations in the File dialog box.
When you select the Import option, the Import Data File dialog box opens. Use the directory list and directory
button s to navigate through the file directory. The default file filter is *.DTF. However, the latest selected file
format is recorded in the registry and will be automatically set for the next time you use the Import File command.
19
CFD-VIEW V2014.0 User Manual
As you select the radio buttons, the file filter list is automatically updated. The file list can be set to display the files
as a list, icons, or with details. Use the buttons next to the Directory field to change the view.
For Ensight data files, volumes, surfaces, and points can now be read. The supported types include tetrahedral
volumes, triangular surface meshes, and point data. File animation of transient data in case files is also supported.
CFD-VIEW cycles over the files specified in the case file to create the animation.
Note Previously, if the 3D viewer had been closed, you would have selected New from the File menu or clicked the
New Model button in the Tool Bar before you could import a file. The Import File option on the toolbar and in the
File menu were disabled until you created a new 3D viewer. As a new feature in version 2007, the new model is
created automatically when attempting to read a data file. The menu item is shown as Open Data File until the first
data is being loaded into the same model.
The following image shows the Import Data File dialog box with DTF selected.
20
Menu Bar
DTF Data Transfer Facility file (native format of the ACE+ Suite).
ARF contains Graphic output (nodal data), written out by the CFD-ACE+ Solver
PAM-FLOW contains certain data types written out by the PAM-FLOW Solver.
Import a file
1. Select New from the File menu. This creates a new model and opens a new 3D Viewer. The model is
initially empty.
2. Select the Import option from the File menu. The Import Data File dialog box opens.
3. Select the File Type and specific options that are displayed on the right hand side of the dialog. You can
choose from the following file types
4. Double-click on a file name in the file list; or select a file from the file list and click OK. The new dataset is
loaded into the newly created model. You may also repeat steps 2-6 if you need to load several datasets
into a single model. Alternatively, you can repeat steps 1-6 to load datasets into a new model.
Note Descriptions of the options on Import Data File dialog box follow:
21
CFD-VIEW V2014.0 User Manual
VCBased When this option is chosen, CFD-VIEW will identify regions in each zone which have the
same Volume Condition and split the zone into multiple objects accordingly.
Simplifying In this mode, CFD-VIEW will identify regions of the same Volume Condition in each
zone, and merge identical-named regions from multiple zones into one single entity.
This mode will therefore build a grid which most closely matches the physics of the
simulation.
With Spray In addition to reading the zones and surfaces from the DTF file, CFD-VIEW will also
attempt to read the Spray file. The spray file can either be formatted (ascii input),
unformatted (FORTRAN input), or binary (raw data).
Blanking If checked, CFD-VIEW will allocate an extra column to contain a blanking array, typically
containing zeros and ones, which indicates if a certain grid node is blanked.
No Z-zero Ordinarily, two-dimensional data is projected onto the Z=0 plane. This option inhibits
the projection, allowing for non-planar two-dimensional grids
Cell Reads cell center data from the DTF file (if available). In addition, variable names will
either be prefixed with "Nodal_" or "Cell_", based on the data type.
Grouping
Animation For transient simulations, this will automatically select the files for animation.
All Data Partial reading of the DTF files. Partial reading prevents having to read an entire file
when only specific zones or attributes are needed. When selected, all zones and data
are read from the file. When unchecked, the Selective Reading dialog shown below will
appear. Normal list selection, such as click, ctrl-click, shift-click, can all be used to select
the interesting part.
22
Menu Bar
Generic
Particle
Swap Bytes
the function file can contain any number of variables, whereas the scalar and
Function
vector file always contain five variables
allocate one extra column to contain a blanking array, typically containing 0’s
Blanking
and 1’s, which indicates if a certain grid node is blanked
contains the names of the variables of the scalar and/or vector files. If not
specified, CFD-VIEW assumes names like Q1, Q2, and so on. The files can
Variables
either be formatted (ASCII input), unformatted (FORTRAN input), or binary
(raw data).
23
CFD-VIEW V2014.0 User Manual
Data Type
Description
Options
Formatted ASCII input.
reads in double-precision rather than single-precision data from the file. This
option only has effect when used together with the unformatted or binary
Double Precision
options. Double precision files should have a "D" appended after the standard
extension letters.
changes the interpretation of the wall file inputs. When selected, the last
number of the last row of each wall patch definition signifies the wall group
number. Wall group numbers are used to group all wall patches belonging to
Wall Groups
the same geometric entity together. For example, you can organize the
patches of an inlet together into a single inlet group. This allows you to
independently color each group of walls.
Option Description
Formatted ASCII input.
24
Menu Bar
The animation system prompts you to set the total animation frames to the number of files specified. This
is typically desired, but there are cases where the number of files will not match the total number of
animation frames. If there is not a match, the correct file is loaded based on an interpolation of the
number of files and animation steps. In this case, the same file may be used in multiple animation steps.
This enables you to animate multiple sets of files simultaneously, as in the case of DTF and Spray.
When each file is loaded during the animation playback sequence, the Data Flow Architecture makes sure
that changes to the data read from the file cascade through the entire model. For example, if a load
volume changes, the cutting planes, iso-surfaces, etc. will automatically update to reflect changes to the
file's data
25
CFD-VIEW V2014.0 User Manual
26
Menu Bar
executing a time-dependent simulation. Such a program first generates a data set file, then touches or activates
the trigger file to make CFD-VIEW aware of the new data. Each time the trigger file is modified, the solution from
the data files will be reread. In a trigger file, only the latest time step of the simulation can be viewed because the
data is periodically overwritten by the flow solver.
Note The normal animation controls should not be used at the same time that trigger files are used. Otherwise,
there may be some confusing results when recording.
Enable Trigger
The Enable Trigger option starts and stops the recording of trigger files.
Note The normal animation controls should not be used at the same time that trigger files are used. Otherwise,
there may be some confusing results when recording.
Save
The Save option saves all of the modified data within the same file. The selected file path is recorded in the registry
and is automatically set as the default directory for the next use. The Save option is also available in Tool Bar-Save.
Save a file
1. Select Save from the File menu. If this is the first time you are saving the file, the dialog box appears.
2. In the File Name field, enter the new file name.
27
CFD-VIEW V2014.0 User Manual
3. Click OK to save the file. The file is saved to the directory location you have selected. When saving the file
again, just click the Save button on the Tool Bar. No dialog box will appear.
Save As
The Save As option saves an active model as a new file. The selected file path is recorded in the registry and is
automatically set as the default directory for the next use. The Save As option is also available in toolbar.
28
Menu Bar
4. Click OK. If the filename is already in use, a message appears asking if you want to overwrite the existing
file.
5. Click Yes if you want to overwrite the file. The visualization objects, data, and calculator registers will be
saved to the file.
Save Image
The Save Image option saves an area of the 3D viewer window or the entire 3D viewer window as a new file. The
selected file path is recorded in the registry and is automatically set as the default directory for the next use.
29
CFD-VIEW V2014.0 User Manual
4. Enter or select a file name to save the image and click OK.
5. Use the Directory Drop Down Box to locate the folder in which you want to save the file. To create a new
folder for the file, click the new folder button.
6. In the File Name field, enter a file name.
7. In the File Filter field, select a graphics format for the file.
8. Click OK to save the file. CFD-VIEW saves the image.
Save Object
The Save Object option saves an object to a file. The selected file path is recorded in the registry and is
automatically set as the default directory for the next use.
Save an object
1. Select Save Object from the File menu. If this is the first time you are saving the file, the dialog box
appears.
2. In the File Name field, enter the new file name.
30
Menu Bar
3. Click OK to save the file. The file is saved to the location you have selected. When saving the file again,
just click the Save button on the Tool Bar. No dialog box will appear.
31
CFD-VIEW V2014.0 User Manual
Quit
The Quit option prompts a dialog box to appear that asks if you want to save the current model to a file before
closing the application.
Quit the CFD-VIEW application and save an active model as a new file
1. Click the Quit option on the File Menu. The Unsaved Model File dialog box appears.
2. Click No to quit the application or click Yes to save the current model. If you choose Yes, the Save Model
dialog box appears.
3. Use the Directory Drop Down Box to locate the folder in which you want to save the file. To create a new
folder for the file, click the new folder button.
4. In the File Name window, enter a file name.
5. In the File Filter window, select the .MDL file format.
6. Click OK to save the file. CFD-VIEW saves the data and the visualization objects.
Edit Menu
32
Menu Bar
Delete Object
Preferences
Undo/Redo/Clear Undo
The Undo system is new for 2004. Most major changes, such as delete, create, etc. are "undoable", as well as
many of the minor items. To undo one of these types of operations, the Undo menu item is selected, or simply
press CTRL-Z. To reinstate an operation that was undone, select the Redo menu item, or press CTRL-Y or CTRL-
SHIFT-Z. Finally, all of the undo records take up system memory, which in some cases can be significant. A finite
number of records is kept, after which, the oldest records are discarded. To discard the entire list to free
resources, select the Clear Undo menu item. To remedy excessive resource usage, CFD-VIEW allows limits on both
the number and total size of the records used. This is set in the Preferences Panel.
Copy Window
The Copy Window option copies the entire contents of the active 3D viewer window and retains the information
on the clipboard so that you can paste it into an external software application that is clipboard enabled such as
Microsoft Word, Excel, etc. This option is also available in Toolbar-Copy.
Copy Lasso
The Copy Lasso option enables you to copy a particular section of the active 3D viewer and retains the information
on the clipboard so that you can paste it into an external software application that is clipboard enabled such as
Microsoft Word, Excel, etc.
Selection Options
SELECT ALL
The Select All menu command selects all of the objects in an active 3D viewer and in the corresponding Object
Explorer.
33
CFD-VIEW V2014.0 User Manual
INVERT SELECTION
The Invert Selection menu command changes the selection of all objects in the model. Items that were selected
are removed from the selection list, and vice versa.
DESELECT ALL
Deselect All removes all objects from the selection list. This includes both the hidden and displayed objects.
Visibility Options
SHOW ALL
The Show All option displays all of the objects in an active 3D viewer and the corresponding Object Explorer.
However, the Displayed Types panel is still in effect.
HIDE SELECTED
The Hide Selected menu command hides all of the selected items.
HIDE NON-SELECTED
The Hide Non-Selected menu command hides all of the objects that are not selected.
TOGGLE VISIBILITY
The Toggle Visibility menu command changes the visibility of all of the objects in an active 3D viewer and the
corresponding Object Explorer. However, the Displayed Types panel is still in effect.
Delete Object
The Delete Object option deletes the selected object from the active 3D viewer and from the Object Explorer. The
Delete option is also available on the toolbar.
Preferences
The Preferences menu enables you to set personal preferences for the following:
Colors
Line
Undo / Redo
Display
Logo
Tools
Scripting
34
Menu Bar
Preferences Dialog
COLORS
The Color Preferences window enables you to change the colors for specific object attributes. These colors are the
default colors used the next time an object is created. The background attributes are also used the next time a 3D
Viewer is created. To change the background for a current 3D Viewer, the Background Panel is used. The meaning
of the colors is:
• Surface Color -- This is the color of a solid surface if the surface is not color by a variable.
• Vector Color -- This is the color of vectors drawn on surfaces or volumes if they are not colored by a
variable.
• Grid Color -- This is the color of the grid drawn on a surface if the surface is not colored by a variable.
35
CFD-VIEW V2014.0 User Manual
• Outline Color -- This is the color of the outline of a surface if it is not selected.
• Point Color -- This is the color of the points for a data object if they are not colored by a variable.
• Select Color -- This is the color of the handles, outlines, etc. if an object is selected.
• Tentative Pick -- When the cursor is hovered over data objects in the 3D Viewer, the object that would be
selected if the mouse button were pressed is drawn in a different color, (similar to selection). To see the
tentative selection, briefly pause the mouse over any object.
36
Menu Bar
4. Select a color by clicking on the color well at the bottom of the window. The color appears under the
eyedropper to indicate the color you have chosen.
5. Change the color as needed.
The first tab enables you to change the hue, saturation, and value of the color visually. Click anywhere on
the color wheel to change the color, then use the vertical bar to change the shade.
The second tab enables you to use a slider bar to change the red, green, and blue values for the selected
color.
The third tab enables you to use a slider bar to change the hue, saturation, and value for the selected
color.
The fourth tab enables you to use a slider bar to change the cyan, magenta, and yellow value for the
selected color.
The fifth tab changes the color by name. It allows for greater accuracy in consistently applying colors to a
surface and was designed for those who need to rely on color by name rather than visual acuity.
6. Click the Accept button to apply the color to the attribute in the Preferences window.
7. In the Color Preferences window, select a gradient if you want one.
8. Click the Close button.
37
CFD-VIEW V2014.0 User Manual
LINES
The Line Preferences window enables you to change the line width for specific object attributes.
38
Menu Bar
UNDO / REDO
The Undo / Redo Preferences window enables you to change the settings for the Undo System. When an
operation that cannot be undone is performed, a record of the changes is made so that the operation can be
undone. Some operations require a large amount of resources to maintain the undo record. Over a large number
of operations, memory usage can become excessive. To remedy this, CFD-VIEW allows limits on both the number
and total size of the records used.
39
CFD-VIEW V2014.0 User Manual
DISPLAY
The Display Preferences window enables you to designate hardware acceleration, buffer mode, and turbo mode.
40
Menu Bar
LOGO
The Logo Preferences window enables you to change the logo in the corner of the 3D Viewer. This image will
appear on all 3D Viewer, and is useful for displaying a corporate logo, confidentiality statement, etc. By default,
the logo displayed is the ESI Group logo.
41
CFD-VIEW V2014.0 User Manual
TOOLS
The Tools Preferences window enables you to change the executables used for the web browser and
documentation browser.
42
Menu Bar
SCRIPTING
The Scripting Preferences window enables you to override the default directory for scripting language files. The
macro directory specifies the search path for the macro script files used by CFD-VIEW. Any CFD-VIEW script placed
within this directory, will be available from the tool bar as a macro.
43
CFD-VIEW V2014.0 User Manual
View Menu
View Menu
View Orientation
View Orientation enables you to reset the viewing parameters (translation, rotation) to their initial values in one of
the six orthogonal views. You can select a front, back, left, right, top, or bottom view to display the objects or grid
in the graphics area. The View options are also available in Toolbar > View Orientation.
44
Menu Bar
Use Blanking
The Use Blanking option uses blanking information to prevent drawing blanked grid cells. If you would like to
display these blanked cells, you can ignore blanking information by toggling the Use Blanking command to off. For
example, in heat transfer applications, solids may be solved for temperature, but not for flow. Turning blanking off
allows you to see the temperature field inside of a solid.
Lasso Zoom
The Lasso Zoom option enables you to select an area in the 3D viewer and zoom in to magnify it.
Reset
The Reset option resizes a zoomed image to the initial default view.
45
CFD-VIEW V2014.0 User Manual
• The Perspective option changes the graphics in the window to perspective projection.
• The Parallel option changes the graphics in the window to a parallel projection.
The Perspective and Parallel options are also available on the toolbar.
Effects
The Effects section of the View Menu enables you to add the following special effects to the model.
Option Description
Turbo The Turbo option ensures acceptable interactive response times for large applications (over
500,000 nodes) or for relatively slow computers. The turbo option reduces the amount of
rendering performed while you are interacting with the model, such as when you change a
viewpoint or move a plane. When you are finished interacting with the model, the complete
model is re-rendered. This is much faster than continuously updating the full model during
manipulation.
Dither The Dither option improves the color resolution of the model. Dithering simulates a richer color
palette in a way similar to newspapers that print gray photographs using only black and white ink.
Since dithering increases rendering time, you may want to turn this feature off in certain
circumstances. On machines with an 8-bit per pixel resolution, the image tends to look jagged
without dithering. On machines with a 16-bit per pixel resolution, the image looks reasonable
without dithering,and it may be acceptable to turn it off in exchange for higher graphics rendering
speed.
Fog The Fog option gives the appearance of viewing the model through fog or mist. The technical
term is depth cueing. Images rendered with depth cueing appear more realistic because objects
further away from the observer appear dimmer.
Anti-Alias The Anti-Alias option smooths the jagged lines of an object. Rendering with this option takes
significantly more time, but the results are worthwhile if the models are to be placed into web
pages or other published material.
Gradient The Gradient option is especially useful when you are running a simulation and wish to periodical
read in the intermittent output. The data is fit to the current 3D viewer display mode and
parameter settings. Therefore, you do not need to manually reset the display with each
intermittent read of data.
46
Menu Bar
Viewpoint
The Copy/Paste Viewpoint options enable you to copy the camera settings from one 3D viewer onto another.
Units Menu
Units can be set to a preferred unit system that is applied at data file read time, or at any later time. The units that
are in the model are checked to determine their category, (e.g. Pressure, Temperature, etc.), and then converted
into the desired units for that category. For example, if the units "N/m^2" are detected, the category is
determined to be "Pressure", and the units would be converted to psi if English (inch) was the desired system.
When you click Units in the menu bar, the Units Menu appears. It includes the following options:
• None -- Do not perform any unit conversions in this model. Leave all units in their current form.
• English (inch) -- Convert all units to the traditional English system. (using inches instead of feet)
• English (foot) -- Convert all units to the traditional English system. (using feet instead of inches)
• Custom -- Select custom units for each of the major categories. The panel below may change as unit
categories are added or refined.
Units Menu
47
CFD-VIEW V2014.0 User Manual
Custom Units
To return the system to the original units that came from the data file, simply set the unit conversion to None, and
click "Reload All Data Files" in the File Menu.
48
Menu Bar
Vector Menu
Vector Menu
Add Vector
In CFD-VIEW, a list of known vectors is maintained. Recent DTF files contain a list of vectors known to the ACE
Solver for the simulation. CFD-VIEW reads the information from the file that was output from the solvers, and
adds it to its list of vector. Additional vectors can be added in CFD-VIEW to augment those from the data file(s),
and the vectors can be edited or removed as needed.
When you click Add Vector in the Vector Menu, the small dialog below appears. To add a new vector, a name and
the three components of the vector are specified. In the example below, a surface normal vector is added, with
the three components of the normals NX,NY,NZ. When Auto Fill Components is checked changing one component
will automatically change the other two components to the neighboring variables in the component list. For
example, if the variable list contains "U, V, W", selecting "U", will automatically set the other components to "V"
and "W".
49
CFD-VIEW V2014.0 User Manual
Edit Vector
In CFD-VIEW, a list of known vectors is maintained. Recent DTF files contain a list of vectors known to the ACE
Solver for the simulation. CFD-VIEW reads the information from the file that was output from the solvers, and
adds it to its list of vector. Additional vectors can be added in CFD-VIEW to augment those from the data file(s),
and the vectors can be edited or removed as needed.
When you click Edit Vector in the Vector Menu, the small dialog below appears. To Edit a vector, select the name
from the dropdown list, and then specify the three components of the vector. In the example below, a Velocity
vector is selected, with the three components of Velocity can be changed if desired. When Auto Fill Components is
checked changing one component will automatically change the other two components to the neighboring
variables in the component list. For example, if the variable list contains "U, V, W", selecting "U", will automatically
set the other components to "V" and "W".
Remove Vector
In CFD-VIEW, a list of known vectors is maintained. Recent DTF files contain a list of vectors known to the ACE
Solver for the simulation. CFD-VIEW reads the information from the file that was output from the solvers, and
adds it to its list of vector. Additional vectors can be added in CFD-VIEW to augment those from the data file(s),
and the vectors can be edited or removed as needed.
When you click Remove Vector in the Vector Menu, the small dialog below appears. To remove a vector, simply
select the name of the vector from the list. Any objects using the selected vector will have their vector set to Off.
In the sample below, Velocity is the vector name about to be removed.
50
Menu Bar
Arrange Menu
Group Objects
Ungroup Objects
Draw Later
Draw Earlier
Arrange Menu
Group Objects
The Group Objects button enables you to select multiple objects in the 3D viewer or Object Explorer and group
them together as one object. Any data objects can be grouped together, as well as groups of groups. Allowing
groups of different types of data objects is new for the 2006 version of CFD-VIEW. Grouping is also available in
Object Explorer Buttons.
Ungroup Objects
The Ungroup Objects button enables you to select a previously grouped object in the 3D viewer or Object Explorer
and ungroup it so that it becomes individual objects. The individual parts still have their individual names and
properties. It is also available in Object Explorer Buttons. Groups that were parts of the original group are not
ungrouped.
51
CFD-VIEW V2014.0 User Manual
Draw Later
The Draw Later option rearranges the drawing order of objects in the 3D viewer. For example, when working with
2D annotation objects or transparent 3D objects, you might want to re-arrange the drawing order of the objects to
get a particular effect. The Draw Later option places the selected object(s) on top of other objects. The drawing
order of the objects is changed in their respective groups. For example, root level objects in the Object Explorer
are placed at the top/bottom of the root level, and objects within a group are placed at the top/bottom of the
objects within only that group.
The drawing order of objects within a group can be changed without ungrouping them first. This is a new feature
of the 2007 version of CFD-VIEW. Also, if several objects are selected when performing this operation, the drawing
order within the selection is not changed, but the selected objects are all moved to the bottom of the drawing
order.
OpenGL uses a form of transparency that works properly if the transparent objects are drawn after the other
objects that the transparent object might partially obscure. By drawing an object later, its drawing is moved later
in the drawing order. This is also useful if there is a collection of annotation objects that tend to drawn near the
same level.
Draw Earlier
The Draw Earlier option rearranges the drawing order of objects in the 3D viewer. For example, when working with
2D annotation objects or transparent 3D objects, you might want to re-arrange the drawing order of the objects to
get a particular effect. The Draw Earlier option places the selected object(s) beneath other objects. The drawing
order of the objects is changed in their respective groups. For example, root level objects in the Object Explorer
are placed at the top/bottom of the root level, and objects within a group are placed at the top/bottom of the
objects within only that group.
The drawing order of objects within a group can be changed without ungrouping them first. This is a new feature
of the 2007 version of CFD-VIEW. Also, if several objects are selected when performing this operation, the drawing
order within the selection is not changed, but the selected objects are all moved to the top of the drawing order.
OpenGL uses a form of transparency that works properly if the transparent objects are drawn after the other
objects that the transparent object might partially obscure. By drawing an object earlier, its drawing is moved to
earlier in the drawing order. This is also useful if there is a collection of annotation objects that tend to be drawn
near the same level.
52
Menu Bar
Tools Menu
Recording Animation
Toggle Lasso
Check Grid Consistency
Model Statistics
Save Journal
Macros
Edit Python Script
Frontal Area Calculator
Tools Menu
Recording Animation
The recording animation options are the same from the Tools Menu as they are when using the 'Record' button on
the Animation panel (see Control Panel-Animation-Recording Animation). The Record Whole Window option
records and saves the entire contents of the 3D viewer, once the animation and playback setup are complete. If
you want to record only a portion of the 3D viewer, use the Record Lasso Area option.
53
CFD-VIEW V2014.0 User Manual
Toggle Lasso
The Toggle Lasso option allows the lasso rectangle to stay visible on the screen so you can see the area that is
being recorded for animation.
Model Statistics
The Statistics option enables you to inspect statistics about the datasets loaded into the model.
54
Menu Bar
2. Click on the top level item in the tree list to see the properties of the entire model in the right-hand side
of the window.
3. Click on the next level down from the top to see the properties of the selected data object in the right-
hand side of the window.
55
CFD-VIEW V2014.0 User Manual
4. Click another level down to see the information for each individual data array in the object:
56
Menu Bar
Save Journal
If journaling is activated (see Edit->Preferences->Scripting), CFD-VIEW journals (records) the Python scripting
functions that correspond to the actions performed from the user interface. To save the journaled commands to a
script file (.py), click on “Save Journal“.
Iso-surface/Iso-curve
I/J/K-Plane
X/Y/Z-Cut
Arbitrary Cut
I/J/K-Line
Trace
Line Probe
Point Probe
MinMax Probe
57
CFD-VIEW V2014.0 User Manual
Strip Chart
Point Net
Plot (only the functionalities within the Operator Controls panel are currently journaled)
Carpet Plot (creation only)
Border
Surface Merge
Surface Reduction
Clone Object
Replicator
Legend
Time
Origin
Axes
Bounds
ImageBox
Box
Oval
Line
Text
58
Menu Bar
Macros
The Macros option provides a convenient way for you to run commonly used scripts with a single button. Macros
are Python scripts, written by you, that use the Python scripting language interface to CFD-VIEW to automate the
behavior of CFD-VIEW.
Use macros
1. Select the Macros option from the Tools menu. The Macros dialog box opens. This window contains a
single button for each Python script found (i.e. files ending with a ".py” extension) in CFD-VIEW's current
working directory. If no Python scripts are found in the current working directory, this list will be empty.
2. Click one of the macro buttons to run the associated Python script for the currently active model. The
current working directory will be re-scanned for newly added Python scripts each time this window is
displayed.
3. Click the Rescan button to update the list of scripts while the window is open.
4. Click the Close button when you're done using the Macros feature.
59
CFD-VIEW V2014.0 User Manual
Reusable macros
For macro scripts to be reusable, keep them simple and avoid specific details about the model. The following
example is a script that creates an X-Cut through all the volumes in a model (at x = 0.0), and then colors that
surface with the temperature (T). Because this macro's purpose is very clear, you can assign it an easily
recognizable name like "x-cut-temperature.py”. As this script doesn't make any assumptions about the model
(other than that there is an attribute named "T”), you should be able to use it for any CFD-VIEW model.
import VModel
import VSurface
import VVisualization
xCut = VSurface.CreateXCut(VModel.GetAllVolumes())
VVisualization.SetValue(xCut, 0.0)
VVisualization.SetColorAttribute(xCut, "T")
VVisualization.SetSurfaceRendering(xCut,
VVisualization.SURFACE_RENDERING_SMOOTH)
It is also available in Toolbar-Edit Python Script. To view the detailed Python Script, see Toolbar-Edit Python Script-
Library Modules. For setting scripting preferences, see Edit Menu-Preferences-Scripting.
60
Menu Bar
There are two options for running scripts. The most common choice is to copy the script into your macros directory
(the current working directory) and then access the script from the Tools Menu - Macros option.
Run a script
1. Save a copy of the script to your macros scripts directory.
2. Start CFD-VIEW (if it’s not already running) and select the Macros option from the Tools menu.
3. Click the button labelled with the name of your script, and the script will be run in CFD-VIEW’s integrated
Python interpreter.
Another option enables you to run a script when CFD-VIEW first starts up. This is done by passing the name of a
Python script to CFD-VIEW on the command line. This is useful for applications that launch CFD-VIEW in batch
mode.
Example
The following is an example script that imports data from an STL file ("18x18x50_sys80.stl”) and then modifies the
visualization properties of certain named objects in the model:
import VEntity
import VImport
import VVisualization
surface_names = [
"OuterWrapper",
"InnerWrapper",
"TubeSupportPlates_FULL",
"TubeSupportPlates_HOT",
"TubeSupportPlates_COLD",
"TubeSupportPlates_PART",
"Tubesheet",
"DistPlate",
"StayCylinder",
"DividerPlate"
]
VImport.ImportSTL('18x18x50_sys80.stl')
for name in surface_names:
obj = VEntity.GetEntityByName(name)
VVisualization.SetOutline(obj, 0)
VVisualization.SetSurfaceRendering(obj,
VVisualization.SURFACE_RENDERING_SURFACE)
VVisualization.SetSurfaceShading(obj,
VVisualization.SURFACE_SHADING_SMOOTH)
outerWrapper = VEntity.GetEntityByName("OuterWrapper")
VVisualization.SetSurfaceRendering(outerWrapper,
VVisualization.SURFACE_RENDERING_SMOOTH)
VVisualization.SetColorAttribute(Remote Access
61
CFD-VIEW V2014.0 User Manual
62
Menu Bar
Window Menu
Window Menu
Viewers
The New Viewer option opens a new 3D viewer, and the Close Viewer option closes the active 3D viewer.
Window Appearance
The Window Appearance option provides you with three ways to view multiple windows in the workspace. Choose
from Cascade, Tile horizontally, or Tile vertically. These options only affect the non-minimized windows.
63
CFD-VIEW V2014.0 User Manual
Viewing Options
Use the Viewing Options to select which devices appear in the CFD-VIEW window. When a check mark appears
next to the option, it means that the item appears in the CFD-VIEW window. To hide the device, click the option
again on the Window Menu. The check mark disappears indicating that the device is no longer in view. The viewing
options include Tool bar, Attribute bar (Display Settings), Status bar, Settings (Control Panel), and Palette
(Operator Palette).
View Preferences
The View 1 and View 2 options enable you to use the menu to choose between various views.
64
Menu Bar
Help Menu
CFD-View Help
The Online Help file brings you problem-solving resources around the clock. We deliver our the Help file in an easy-
to-use interface, complete with a table of contents, index, glossary, and Natural Language Search functionality.
When searching for a topic, you will get the best results if you search by keyword as opposed to asking a question.
About CFD-VIEW
About CFD-VIEW displays a dialog box that provides the version number and other relevant information about the
software.
65
Chapter 4. Toolbar
Toolbar Introduction
The Toolbar contains buttons that are used as shortcuts to some of the same items that are accessible from the
Menu bar. The most frequently used functions are grouped together as meaningful, related buttons. The buttons
in the Toolbar include the following:
New Model
Open Model File
Import Data File
Save
Save Model As
Show Lasso
Snapshot
Copy
Delete
Perspective
Parallel
View Orientation - Back, Front, Left, Right, Bottom, Top
Colors
Edit Python Script (see also Edit Python Script Library Modules)
Macro
New Model
The New Model button creates a new 3D viewer in the workspace. When you launch CFD-VIEW, it
automatically opens one 3D viewer. The 3D viewer is initially empty and you must import a file or begin creating
objects to begin working. The New option is also available in File Menu-New.
Note If you close the 3D viewer, you must select New from the File menu or click the New Model button in the
Tool Bar before you can import a file. Notice that the Import File option on the Tool Bar and in the File Menu are
disabled until you create a new 3D viewer.
67
CFD-VIEW V2014.0 User Manual
Open
The Open button opens a CFD-VIEW model file (*.mdl). To open any other type of file supported by CFD-
VIEW, use the Import option. When you select the Open option, the Open Model File window appears and
prompts you to select the directory and file name. The Open option is also available in File Menu-Open.
CFD-VIEW provides several tools that allow you to navigate to your model file.
• You can select a folder using the Directory Drop Down Box, the Up One Level Button, the Contents List
Box, the Working Directory button, the Bookmarks, or the Back to Home Directory button.
• The To Home Directory button changes the directory to your home directory.
• The Working Directory button changes the active directory to the current working directory, that is, the
directory where CFD-VIEW was started.
• The Create Bookmark button opens a menu that enables you to set bookmarks to directories you use
frequently. The bookmarks will remain available until you delete them using the Clear bookmarks option.
68
Toolbar
• You can also navigate through directories using the keyboard arrow keys or the backspace button, which
moves up one directory level.
CFD-VIEW has hot keys that enable you to perform operations in the File Dialog Box.
Import
The Import button imports geometries from various file formats into CFD-VIEW so that you can begin
working on your project. The Import option is described fully in the File menu section.
Save
The Save button saves all of the modified parameters within the same file. The selected file path is recorded
in the registry and will automatically be set as the default directory for the next use. The Save option is also
available in File Menu-Save.
69
CFD-VIEW V2014.0 User Manual
Save a file
1. Click the Save button on the Tool Bar. If this is the first time you are saving the file, the dialog box
appears.
2. In the File Name window, enter the new file name.
3. Click OK to save the file. The file is saved to the location you have selected. When saving the file again,
just click the Save button on the Tool Bar. No dialog box opens.
Save As
The Save As button saves an active model as a new file. The selected file path is recorded in the registry and
will automatically be set as the default directory for the next use. The Save As option is also available in File Menu-
Save As.
70
Toolbar
71
CFD-VIEW V2014.0 User Manual
Show Lasso
The Show Lasso button enables you to select a particular area of an active 3D viewer, record the area as
animation, or save the area in one of the following formats: RGB, BMP, JPG, GIF, PNG, or PPM.
Snapshot
The Snapshot button takes a snapshot (or picture) of whatever is in the active 3D viewer and allows you to
adjust the image size before saving it. You can then choose to save the snapshot in a particular file format: RGB,
BMP, JPG, GIF, PNG, or PPM.
In V2007.2 and later, off-screen rendering is available if your graphics card supports this feature. This will prevent
any open windows that may be on top of the CFD-VIEW graphics area from being captured in the snapshot. If the
graphics card does not support this feature, CFD-VIEW will fall back to on-screen rendering.
72
Toolbar
73
CFD-VIEW V2014.0 User Manual
5. Enter or select a file name to save the image and click OK.
Copy
The Copy button copies the entire contents of the active 3D viewer window and retains the information on
the clipboard so that you can paste it into an external software application that is clipboard enabled such as
Microsoft Word, Excel, etc. This option is also available in Edit Menu-Copy Window.
Delete
The Delete button deletes the selected object from the active 3D viewer and from the Object Explorer. The
Delete option is also available in Edit Menu-Delete Object.
74
Toolbar
These two buttons set the perspective and parallel views. The Perspective option changes the graphics
in the window to perspective projection. The Parallel option changes the graphics in the window to a parallel
projection. The Perspective and Parallel buttons are also available in View Menu-Perspective and View Menu-
Parallel.
View Orientation
Use the View Orientation buttons to reset the viewing parameters (translation,
rotation) to their initial values in one of the six orthogonal views. You can select a front, back, left, right, top, or
bottom view to display the geometries or grid in the graphics area. The View options are also available in View
menu > View Orientation.
Colors
The Colors button enables you to change the color of an object in the workspace.
75
CFD-VIEW V2014.0 User Manual
Use the first tab to change the hue, saturation, and value of the color visually. Click anywhere on the color
wheel to change the color, then use the vertical bar to change the shade.
Use the second tab to use a slider bar to change the red, green, and blue values for the selected color.
Use the third tab to use a slider bar to change the hue, saturation, and value for the selected color.
Use the fourth tab to use a slider bar to change the cyan, magenta, and yellow value for the selected
color.
Use the fifth tab to change the color by name. It allows for greater accuracy in consistently applying colors
to a surface and was designed for those who need to rely on color by name rather than visual acuity.
4. Click the Accept button to apply the color to the object in the workspace.
The Python language scripting interface for CFD-VIEW includes an integrated Python interpreter, with built-in
modules for accessing most CFD-VIEW application functionality; a Python script editor that enables you to edit
76
Toolbar
existing scripts and write new scripts; and a macros window that provides one-click access to previously written
scripts.
Although you can select from three options to run scripts, the most common choice is to copy the script into your
macros directory (the current working directory) and then access the script from Macro option on the Tools menu.
The steps for this option follow this discussion.
The second option enables you to run a script when CFD-VIEW first starts up. This is done by passing the name of a
Python script to CFD-VIEW on the command line. This is useful for applications that launch CFD-VIEW in batch
mode. Type the following:
The third option invokes the script from the File > Run Python Script menu. This option is convenient if you have
already started CFD-VIEW and you need to execute a Python script that is not located in the current working
directory.
Run a script
1. Save a copy of the script to your macros scripts directory.
2. Start CFD-VIEW (if it’s not already running) and select the Macros option from the Tools menu.
3. Click the button labelled with the name of your script, and the script will be run in CFD-VIEW’s integrated
Python interpreter.
77
CFD-VIEW V2014.0 User Manual
VAnnotation Module
VCurve Module
VEntity Module
VImport Module
VMaterials Module
VModel Module
VPlot Module
VPoints Module
VProbe Module
VSurface Module
VViewer Module
VVisualization Module
VAnnotation Module
CreateAxes()
CreateBounds()
CreateBox()
CreateImageBox([filename])
Create an Image Box annotation object. If the optional filename argument is specified, the image in that
file will be used for the image box; otherwise, a default image is displayed.
CreateLabel([text])
Create a Label annotation object. If the optional text argument is specified, that string will be used for the
label text.
CreateLegend()
CreateLine()
78
Toolbar
CreateOrigin()
CreateOval()
CreateText([text])
Create a Text annotation object. If the optional text argument is specified, that string will be used for the
object text.
CreateTime()
GetPosition(object)
GetSize(object)
RotateImage(object, amount)
Rotate an Image Box object by some amount, where amount is one of IMAGE_ROTATE_0,
IMAGE_ROTATE_90, IMAGE_ROTATE_180 or IMAGE_ROTATE_270.
SetEdge(object, edgeOn)
Show or hide the edge for an annotation object, where edgeOn is either 0 or 1.
SetEdgeColor(object, edgeColor)
SetEdgeWidth(object, edgeWidth)
SetFontStyle(object, fontStyle)
Sets the font for an annotation object, where fontStyle is one of FONT_STYLE_TIMES,
FONT_STYLE_FUTURA, FONT_STYLE_GREEK, FONT_STYLE_MATH or FONT_STYLE_SCRIPT.
SetImageFile(object, filename)
79
CFD-VIEW V2014.0 User Manual
SetLabelColor(object, labelColor)
SetLabelFontOrientation(object, fontOrientation)
SetLabelFontSize(object, fontSize)
SetLabelFontWeight(object, fontWeight)
SetLineArrowBaseSize(object, arrowBaseSize)
SetLineArrowHeadSize(object, arrowHeadSize)
SetLineArrowStyle(object, arrowStyle)
Set the arrow style for a Line object to one of ARROW_STYLE_NONE, ARROW_STYLE_BEGIN,
ARROW_STYLE_END or ARROW_STYLE_BOTH.
SetLineColor(object, lineColor)
SetLineEndPoint(object, x, y)
SetLineStartPoint(object, x, y)
SetLineWidth(object, lineWidth)
Set the line width for a Line object, where lineWidth is given in pixels.
SetPosition(object, x, y)
Sets the position of an annotation object, where x and y are given in screen coordinates.
SetShadow(object, shadowOn)
Show or hide the shadow for an annotation object, where shadowOn is either 0 or 1.
80
Toolbar
SetShadowColor(object, shadowColor)
SetSize(object, w, h)
Sets the width and height of an annotation object, where w and h are given in screen coordinates.
SetText(object, text)
VCurve Module
CreateILine(inputs)
Create an I-Line object for the specified inputs, where inputs is a list of previously created volume objects.
CreateJLine(inputs)
Create a J-Line object for the specified inputs, where inputs is a list of previously created volume objects.
CreateKLine(inputs)
Create a K-Line object for the specified inputs, where inputs is a list of previously created volume objects.
CreateXSlice(inputs)
Create an X-Slice object for the specified inputs, where inputs is a list of previously created surface
objects.
CreateYSlice(inputs)
Create a Y-Slice object for the specified inputs, where inputs is a list of previously created surface objects.
CreateZSlice(inputs)
Create a Z-Slice object for the specified inputs, where inputs is a list of previously created surface objects.
CreateIsoCurve(inputs)
Create an Iso-valued Curve object for the specified inputs, where inputs is a list of previously created
surface objects.
CreateTrace(inputs)
Create a Trace object for the specified inputs, where inputs is a list of previously created volume objects.
81
CFD-VIEW V2014.0 User Manual
Create2DTrace(inputs)
Create a 2-D Trace object for the specified inputs, where inputs is a list of previously created surface
objects.
Create2DILine(inputs)
Create a 2-D I-Line object for the specified inputs, where inputs is a list of previously created surface
objects.
Create2DJLine(inputs)
Create a 2-D J-Line object for the specified inputs, where inputs is a list of previously created surface
objects.
VEntity Module
The VEntity module methods are useful for modifying general properties of CFD-VIEW entities or objects.
AssignName(object, newname)
GetEntityByName(name)
Returns a reference to the named object, or None if no object matching name is found.
VImport Module
The VImport module methods are useful for importing external data into the model.
Import the named DTF file into this model. The optional importMethod parameter is one of
DTF_ZONE_BASED, DTF_VC_BASED or DTF_SIMPLIFYING. If importMethod is not specified, it defaults to
DTF_ZONE_BASED; the optional simnumber parameter is the simulation number to be loaded from the
DTF file. If this parameter is not specified, simulation 1 is loaded..
ImportSTL(filename)
ImportSPY(filename)
82
Toolbar
VMaterials Module
The VMaterials module methods are useful for modifying the attribute settings (or material properties) for a
particular object. These methods roughly correspond to the controls found on CFD-VIEW’s “Attributes Settings”
panel.
SetSurfaceColor(object, color)
SetGridColor(object, color)
SetContourColor(object, color)
SetOutlineColor(object, color)
SetVectorColor(object, color)
SetPointsColor(object, color)
SetSpecularColor(object, color)
SetShininess(object, shininess)
Set the shininess for osbject. The shininess should be a number between zero and 128.
VModel Module
The VModel module methods are useful for creating and manipulating Model objects.
CreateModel()
OpenModelFile(filename)
83
CFD-VIEW V2014.0 User Manual
GetActiveModel()
GetAllLines()
Returns a list containing references to all of the lines in the active model.
GetAllPoints()
Returns a list containing references to all of the points in the active model.
GetAllSurfaces()
Returns a list containing references to all of the surfaces in the active model.
GetAllVolumes()
Returns a list containing references to all of the volumes in the active model.
DeleteAllObjects()
Deletes all objects in the active model (without destroying the model itself).
SaveModel(filename)
quit()
reflow()
VPlot Module
The VPlot module methods are useful for creating and manipulating different kinds of plots.
CreatePlot(inputs)
Create a Plot object for the specified inputs, where inputs is a list of previously created objects.
CreateStripChart(inputs)
Create a Strip Chart object for the specified inputs, where inputs is a list of previously created objects.
84
Toolbar
VPoints Module
The VPoints module methods are useful for modifying the properties for a particular Points object. These methods
roughly correspond to the controls found on CFD-VIEW’s “Point Magnitude Settings” panel.
SetPointSize(object, size)
SetPointShape(object, shape)
SetMinPointSize(object, size)
SetMaxPointSize(object, size)
VProbe Module
The VProbe module methods are useful for creating and manipulating different kinds of probes.
CreateLineProbe(inputs)
Create a Line Probe object for the specified inputs, where inputs is a list of previously created volume
objects.
CreateProbe(inputs)
Create a Probe object for the specified inputs, where inputs is a list of previously created volume objects.
Create2DLineProbe(inputs)
Create a 2-D Line Probe object for the specified inputs, where inputs is a list of previously created surface
objects.
VSurface Module
The VSurface module methods are useful for creating and manipulating different kinds of surfaces.
CreateIsoSurf(inputs)
Create an Iso-valued Surface object for the specified inputs, where inputs is a list of previously created
objects.
85
CFD-VIEW V2014.0 User Manual
CreateIPlane(inputs)
Create an I-Plane object for the specified inputs, where inputs is a list of previously created objects.
CreateJPlane(inputs)
Create a J-Plane object for the specified inputs, where inputs is a list of previously created objects.
CreateKPlane(inputs)
Create a K-Plane object for the specified inputs, where inputs is a list of previously created objects.
CreateXCut(inputs)
Create an X-Cut object for the specified inputs, where inputs is a list of previously created objects.
CreateYCut(inputs)
Create a Y-Cut object for the specified inputs, where inputs is a list of previously created objects.
CreateZCut(inputs)
Create a Z-Cut object for the specified inputs, where inputs is a list of previously created objects.
CreateArbitraryCut(inputs)
Create an Arbitrary Cut object for the specified inputs, where inputs is a list of previously created objects.
CreateBorder(inputs)
Create a Border object for the specified inputs, where inputs is a list of previously created volume objects.
CreateSurfaceMerge(inputs)
Create a surface merge object for the specified inputs, where inputs is a list of previously created surface
objects.
CreateSurfaceReduction(inputs)
Create a surface reduction object for the specified inputs, where inputs is a list of previously created
surface objects.
VViewer Module
The VViewer module methods are useful for modifying the properties of the active viewer window.
FitView()
86
Toolbar
GetActiveViewer()
GetViewerSize()
Returns the active viewer's width and height as a tuple (w, h).
ResetView()
Reset view.
Roll(amount)
SaveImageArea(filename, format, x, y, w, h)
Saves a snapshot of the specified rectangle in the active viewer window. The upper left-hand corner of
the window is at screen coordinates (x, y) and its width and height are measured in pixels. The format is
one of IMAGE_RGB, IMAGE_GIF, IMAGE_BMP_24, IMAGE_BMP_8, IMAGE_PPM, IMAGE_PPM_RAW,
IMAGE_PNG, IMAGE_JPEG, IMAGE_PS, IMAGE_MPEG, or IMAGE_GIFMERGE.
SaveImageWindow(filename, format)
Saves a snapshot of the entire window for the active viewer. See the description of SaveImageArea() for a
list of valid image file formats.
SetAntiAliasing(antialiasing)
SetDithering(dithering)
SetFieldOfView(fov)
SetFog(fog)
SetProjection(projection)
Set the projection type for this viewer, one of PROJECTION_ORTHOGONAL or PROJECTION_PERSPECTIVE.
SetSurfaceOffset(surfaceOffset)
87
CFD-VIEW V2014.0 User Manual
SetTurboMode(turbomode)
Enable or disable turbo mode for this viewer, where turbomode is either 0 or 1.
SetView(view)
Set the view to one of the six predefined views, one of VIEW_FRONT, VIEW_BACK, VIEW_LEFT,
VIEW_RIGHT, VIEW_TOP or VIEW_BOTTOM.
SetViewpoint(x, y, z)
Set the viewpoint to (x, y, z), where x, y and z are measured in world units.
TranslateView(dx, dy)
Translate the model by some amount (dx, dy), where dx and dy are measured in world units.
Yaw(amount)
ZoomIn()
ZoomOut()
SetZoom(level)
Change zoom level of the viewer. A zoom level of 1 brings back the default zoom level.
VVisualization Module
The VVisualization module methods are useful for settting the different visualization properties of a CFD-VIEW
object.
SetSurfaceShading(object, shading)
Set the surface shading for this object, where shading is one of SURFACE_SHADING_OFF,
SURFACE_SHADING_FLAT or SURFACE_SHADING_SMOOTH.
SetVisible(object, visible)
SetHandles(object, visible)
Enable or disable the display of handles for this object, where visible is either 0 or 1.
88
Toolbar
SetOutline(object, visible)
Enable or disable the outline display for this object, where visible is either 0 or 1.
SetPoints(object, visible)
Enable or disable the display of points for this object, where visible is either 0 or 1.
SetGrid(object, visible)
Enable or disable the display of grid lines for this object, where visible is either 0 or 1.
SetContours(object, visible)
Enable or disable the display of contours for this object, where visible is either 0 or 1.
SetSurfaceRendering(object, rendering)
Sets the surface rendering mode for this object, where rendering is one of SURFACE_RENDERING_OFF,
SURFACE_RENDERING_SURFACE, SURFACE_RENDERING_COLORED, SURFACE_RENDERING_SMOOTH or
SURFACE_RENDERING_FLOODED.
SetVectors(object, visible)
Enable or disable the display of vectors for this object, where visible is either 0 or 1.
SetHiddenLines(object, visible)
Enable or disable the display of hidden lines for this object, where visible is either 0 or 1.
SetColorAttribute(object, variable)
Set the variable that provides the color for this object (a.k.a. the primary variable), where variable is a
string like “P” or “T”.
SetValue(object, value)
Set the value for this object, where value is a floating point number (e.g. the value to be used for an iso-
valued surface).
89
CFD-VIEW V2014.0 User Manual
Macro
The Macros provide a convenient way to for you to run commonly used scripts. It provides the same functionality
as the [Tools Menu-Macros] but in a more convenient location.
Use a macro
1. Select a macro from the drop down list.
2. Press the Run Macro button on the right side of the drop down list.
90
Chapter 5. Display Settings
Display Settings
The Display Settings bar enables you to change surface values, assign data values to variables, and change the way
in which a plane is rendered.
If there is more than one object selected in the 3D viewer, the buttons will appear in one of four states:
Condition Description
When a button appears greyed out it is disabled and that function cannot be applied to an
Dimmed
object.
When a button displays its colored icon, it is enabled and that function can be applied to an
Normal
object.
When a button has a red check mark in front of it, it means that it is turned off. To turn it on,
Red Check Mark
click the button and the red check mark disappears.
When some of the selected objects in the 3D viewer have that function applied, and some do
Question Mark
not, a question mark appears in front of the button.
The Display Settings bar is shown here in two images due to space limitations of this document.
91
CFD-VIEW V2014.0 User Manual
Button Description
No shade no shading is applied to the surface, light sources are off, and surfaces are colored by the
colormap or basic surface color.
Smooth Shade smooth shading is applied, each vector is lit and shaded individually, resulting in a more
smooth-looking image. Because of computational expense and need for node connectivity,
smooth shading is not possible for all grid types.
Visibility control the visibility of a selected object. Hide or show by toggling the button off or on.
Handles control the drawing of handles on an object such as volumes and particle traces. Hide or
show by toggling the button off or on.
Surface Buttons change the way in which a plane is rendered. If a surface has been selected, then it can be
displayed as an outline, points, grid, contours, solid surface, colored surface, smooth
colored surface, flooded contours, vectors, hidden surface, or a combination of these.
The hidden surface button is useful when you do not want a specific surface color, but still
would like to convey spatial relationships between planes. A solid surface is colored by the
Color Variable if either the Surface, Smooth Surface or Flooded Contour button is selected.
Line Curves can be drawn as lines, tubes, or ribbons to convey additional information. Tubes
and ribbons are more useful for particle trace output. The particle trace determines an
Tube
angle which provides information about the swirl of a flow field for example. The twist of
Ribbon the ribbon can be tied to this variable, which is very useful in understanding the
simulation's output.
The curves can be colored by any variable, and the tubes and ribbons can also be shaded
as if they were a surface. Line drawing can also be combined with point and vector
drawing, and the points could be drawn as balls or cubes.
If the points on the curve are too dense for a clean display, they can be drawn in a strided
manner. By drawing every nth point and vector, the display can sometimes be made more
clear.
Color variable The Color Variable pulldown menu enables you to select which variable of the data set is
used to map a data value to a color. Together, the color variable and the color map
determine the color shown on a plane. If no Color Variable is selected, the color of the
plane reverts to the uniform default color, as chosen from the Material Attribute panel.
CFD-VIEW maps the full range of a variable in the entire problem zone to the full range of
the color map. This ensures that the same color represents the same value, regardless of
the position of the surface and regardless of the grid domain in which the surface lies. To
change the range of data mapped to the full color map on a variable by variable basis, use
the Color map Setting panel. Thus, all surfaces using a particular variable will have the
same data range. Pressing the small color map icon on the toolbar has the same effect as
the Maximize Selected button on the Color Mapping Panel.
Vector variable In previous version of CFD-VIEW, the vector was defined by selecting the first of the three
vector component from the list of variables in the selected object(s), and CFD-VIEW would
automatically select the next two variables in the list as the 2nd and 3rd vector
components. For v2007, the ACE and FASTRAN solvers place the known vectors in the DTF
file. CFD-VIEW reads this information and creates a list of known vectors from which to
92
Display Settings
Button Description
choose. Also, custom vectors can be managed from the Vector Menu, where new vectors
are added, removed, and edited. For older DTF files, or for non-DTF data files, custom
vectors should be used. (Some simple known vectors, such as Velocity, Position, etc. are
added automatically, as they appear in many files.) As a convenience, the Add New Vector
menu item is also available in the Vector list to quickly create a new vector if needed.
With the addition of custom vectors in the V2007 release, it will now possible to support
null-component vectors. For V2007.2, the user will be able to specify custom 2D vectors
without the need to add an extra zero data variable, and the automatic vectors specified
by the solvers will be seamlessly supported. 1D vectors, for such things as out-of-plane
vectors in a 2D simulation will also be supported.
Also, if you have loaded a PLOT3D vector file, the vector is, by default, automatically set to
the second, third, and fourth variables of the vector file. These are considered to be the
default vector variables.
CFD-VIEW determines the true range of the vector field mapping at the time you select the
vector. This mapping will remain in effect from then on, even after loading in another data
sets. You can restore the vector mapping by re-selecting the vector or by pressing the
Maximize buttons from the Vector Panel. Pressing the small vector map icon on the
toolbar has the same effect as the Maximize Selected button on the Vector Mapping Panel.
Extra variable The Extra Variable drop-down menu is used for a number of purposes, depending upon the
object type. For spray visualization, the Extra Variable is used to scale the droplet
magnitude. For ribbon drawing of a particle trace, the Extra Variable is used to specify the
twist. Pressing the small extra variable icon on the toolbar has the effect of scaling the
extra variable mapping the largest value for the selected object.
Related Topics
To do this... See this topic...
set lighting conditions for an object or change ambient lighting Control Panel > Lighting
make objects visible, invisible, and transparent Workspace > Query Menus
learn more about point drawing or strided drawing Control Panel > Points Settings
change the way in which a plane is rendered Display Settings > Surface Buttons
create lines as tubes, curves, or ribbons to convey additional Display Settings-Line Drawing Modes.
93
Chapter 6. Workspace
Workspace Introduction
The Workspace, located in the center of the Window, displays the models and animations. When you open,
import, or create a new file, CFD-VIEW displays the model in a 3D Viewer in the workspace. Objects and models
that appear in the workspace have ToolTips that provide additional information. Multiple selection, deselection,
blanking, and unblanking functions are available. Some entities also have query menu options for applying
particular functions. You can also click on an area of the window below to navigate to that section.
Window Operations
Mouse Operations
Data Object Query Menu
Annotation Query Menu
Window Operations
The Viewer Window is a Multiple Document Interface (MDI) window that enables the application to display more
than one simulation at a time. You use the three standard buttons on the graphics toolbar to minimize, maximize,
and close the windows.
When you click the close button, all windows are closed, all geometries, grids, and entities are deleted, and CFD-
View is ready to import or open another file.
95
CFD-VIEW V2014.0 User Manual
Tentative Picking Hover When you hover over an object in the 3D Viewer,
the object that would be selected if the mouse
button were pressed is drawn in a different color,
similar to selection. To see the tentative selection,
briefly pause the mouse over any object.
Re-picking Click left button and repeatedly Often, there are multiple objects under the mouse
press the R key until the object is cursor when picking occurs. The object that is
shown closest to the eye is the one that is ultimately
selected. When the outlines of two surfaces are
colinear, it can be difficult to select the desired
one. Repicking maintains a list of all of the objects
that were below the cursor when the button was
clicked.
To cycle through the list of objects, simply press
the "R" key repeatedly after the mouse button is
pressed and released until the desired object is
shown in the selected state. The list is flushed
after the mouse focus is moved away from the 3D
Viewer, or if the mouse is clicked somewhere else
in the 3D Viewer.
Add or remove CTRL + left button Works in a toggle mode. If an entity is in the
active entity from selected group, it will be removed, otherwise it
current set will be added.
For example, to assign surface source settings or
select multiple geometries, press and hold the
CTRL key and click the left mouse button. Continue
clicking the left mouse button until you have
selected all of the entities you want. The active
entity is defined as the entity that is under the
mouse cursor at the moment the mouse button is
pressed. The selected entities change to red (or
whatever has been set in the Preferences panel).
All of the items you have selected in the 3D viewer
also appear in the Object Explorer.
Lasso CTRL + left button + drag Press and hold the CTRL key, click the left mouse
(simultaneously button, and drag the mouse over the area that
select multiple contains the entities you want to select.
entities)
These actions create a lasso that selects all of the
items within it, and adds them to the list of
previously selected objects.
96
Workspace
Access the object Right button Click the right mouse button and its shortcut menu
menu opens. The menu contains items that are relevant
to the object type. Click the item of choice.
Rotation
To rotate an image, click and hold the left mouse button and drag the mouse. The cursor shape changes to reflect
the rotate mode of operation.
Translation
When you are translating a model, the model's movement is proportional to the movement of the cursor. Also, the
initial location of the cursor on the screen is unimportant. In addition, you can view a model from different angles
using the options in the View Menu. You can also display the required viewing angle using the buttons on the
Toolbar. While you are translating, the model origin is shown in the Status Line.
If you are in parallel mode, the model movement is exactly proportional to the movement of the cursor. If you are
in perspective mode, the origin moves proportionally to the cursor; that is, the front of the model (close to the
eye) may move faster, while the back of the model (away from the eye) may move slower.
97
CFD-VIEW V2014.0 User Manual
Translate a model
1. Click and hold the right mouse button and simultaneously drag the mouse vertically or horizontally.
OR
2. To quickly translate an area of interest to the center of the screen, move the cursor over the area of
interest and press the C key on the keyboard.
Zoom
To zoom (enlarge or reduce) a model, click and hold the middle mouse button (or wheel) and drag the mouse. To
enlarge the model, drag the mouse toward you. To reduce the model, drag the mouse away from you. The cursor
location on the screen where you first press the mouse button is not important for zooming.
Note If you have a two-button mouse, click and hold both buttons simultaneously and drag the mouse.
Another method of zooming uses the keyboard shortcuts lowercase z and uppercase Z. Each time the lowercase z
key is pressed, the image zooms out by a small increment. The uppercase Z key zooms in by a small increment.
In addition, the control or shift keys used with the middle mouse button (or wheel) moves the camera into or out
of the scene. It is difficult to see this effect unless you in are a perspective mode. In perspective mode, when you
control-drag with the middle mouse button (or wheel), it changes the field of view. Move the cursor downward,
and the field of view angle increase. Move the cursor up, and it decreases.
98
Workspace
99
CFD-VIEW V2014.0 User Manual
Select all Wall a command to select all walls. The surface in this example is a wall, so the command is to
select all of the objects in the model of this type (wall).
Select all in Zone#61 a command to select all of the objects in the same zone as the selected object. In the
sample, the zone is number 61.
Visible makes the object visible (in view) or invisible (hidden) in the 3D viewer. If you make an
object invisible, the check mark next to Visible in the Query menu is cleared; however, the
name remains in the Object Explorer so you will know that the object still exists. To turn
visibility back on from the Object Explorer, click the right mouse button on the object and
check Visible.
Rename renames the object. After clicking this item, a small dialog box opens providing a field for
renaming the object.
Rename Variable changes the name of one of the variables in the object. The change can be applied to all
objects or just the selected ones. Select the existing variable name from the list, and type in
the new name in the lower text field.
Rename Units changes and renames the units. Select the variable whose units are to be changed from the
list, and type in the new unit string.
Note This option does not perform a unit conversion, but simply renames the units to
something else. To perform a unit conversion, the unit conversion utilities should be used.
Rotate About allows the center of rotation of the 3D Viewer to be placed about the center of the
selected object. In this case, the object named wetted surface is the selected object.
Properties opens a dialog box with information about the object's properties. In some cases the
property may only be the object name, but in others there are several properties that can
be changed.
100
Workspace
Query Menu for Box Rename Dialog Box Query Menu-Properties Option
A query menu opens enabling you to change an object's properties. (See the previously shown menu
labeled Box.) The data objects tend to have slightly different menus.
Makes the object visible (in view) or invisible (hidden) in the 3D viewer. If you make an
object invisible, the check mark next to Visible in the Query Menu disappears. Its name will
Visible
still appear in the Object Explorer so you will know that the object still exists. You can
select it from the Object Explorer, click the right mouse button, and turn visibility back on.
When you select this option, the Rename Object dialog box appears and enables you to
Rename
rename the selected object. The new name also appears in the Object Explorer.
Edge Width Enables you to change the line width on the edge of an object.
When you select this option, the Color Dialog box appears and enables you to change the
Edge Color edge color of an object. If you choose an edge color that is the same color as the object,
you will not be able to see where the object ends and the edge begins.
When you select this option, the Color Dialog box appears and enables you to change the
Fill Color color of an object. If you choose a fill color that is the same color as the edge, you will not
be able to see where the object ends and the edge begins.
101
CFD-VIEW V2014.0 User Manual
Turns the fill color of an object off and on. A check mark next to Fill in the Query Menu
Fill indicates that the fill color is turned on. When it is turned off the fill color of the object
becomes transparent.
Places a dark shadow to the bottom-left of an object. If you use a thick edge width around
an object, you may not be able to see the shadow. To see the shadow, use a thinner edge
Shadow
width. To change the shadow color, select Properties from the Query menu, then click the
Shadow Color's color well.
Properties Enables you to view most of the properties of the query menu in one location.
102
Chapter 7. Control Panel
View Settings
Displayed Types
Scaling
Lighting
Attribute Settings
Lines and Curves Settings
Points Settings
Colormap Settings
Vector Settings
Symmetry Conditions
IJK Parameters
Animation
Background
Calculator
103
CFD-VIEW V2014.0 User Manual
View Settings
The View Settings panel rotates an image on the X, Y, or Z axis.
Options Description
Angles X, Y, Z Change the angle on the X, Y, or Z axis by choosing one of the following:
Place the cursor on the X, Y, or Z dial. Click and hold the left mouse button while dragging the dial
left and right to change the angle.
Manually enter the angle degrees in the X, Y, or Z text fields.
Zoom Factor Enables you to set the zoom on a model. The larger the number the closer the zoom factor.
Surface Offset Enables you to determine spacing between two entities in the window. For example, if contour
lines or mesh lines are drawn on top of a surface display, they are slightly offset for better visual
clarity. The default offset is usually fine for viewing, but you may want to adjust it to view very
large or small models.
Related topics
To do this... See this topic...
change the X, Y, or Z scales of a model Control Panel > Scaling
make X,Y, or Z cuts on volumes or surfaces Operator Palette-XYZ Cuts
give a visual indication of a model's orientation in the 3D viewer, Operator Palette-Axes Annotation
graphically reconstruct a full domain to reduce computational
Control Panel-Symmetry Conditions
problems
104
Control Panel
Displayed Types
The Displayed Types panel enables you to specify the types of items that you want to appear in the 3D viewer and
in the Object Explorer. This is helpful when there is a great deal of information displayed in the 3D viewer that may
obscure items of interest. For example, if a model contains many borders that are not of interest, they can be
hidden by deselecting the border box in the Displayed Types panel. The displayed types change based on the
model data in the 3D viewer. Only those items that are in the model will be displayed in the Displayed Types panel.
As new objects are created, such as cutting planes, they will be added to the list of available types if they are not
already in the list.
Note Interfaces may not be blanked/unblanked by subtype; that is, Fluid-Fluid or Fluid-Solid.
105
CFD-VIEW V2014.0 User Manual
Various Object Types Displayed in the Displayed Types Panel, 3D Viewer, and Object Explorer
Scaling
The Scaling panel changes the X, Y, and Z scales of a model. The Reset button adjusts all parameters to 1, that is
equal scaling.
Scaling Panel
106
Control Panel
Lighting
The Lighting panel changes the light sources and background color for a model in an active 3D viewer. The Lighting
panel consists of two sections: Spot Light Dimmers and Global Lighting.
Lighting Panel
Color Window
107
CFD-VIEW V2014.0 User Manual
The first tab enables you to change the hue, saturation, and value of the color visually. Click anywhere on
the color wheel to change the color, then use the vertical bar to change the shade.
The second tab enables you to use a slider bar to change the red, green, and blue values for the selected
color.
The third tab enables you to use a slider bar to change the hue, saturation, and value for the selected
color.
The fourth tab enables you to use a slider bar to change the cyan, magenta, and yellow value for the
selected color.
The fifth tab changes the color by name. It allows for greater accuracy in consistently applying colors to a
surface and was designed for those who need to rely on color by name rather than visual acuity.
5. Click the Accept button to apply the color to the dimmer or ambient light in the 3D viewer.
6. In the Lighting panel, click and hold the left mouse button and drag the slider bar up and down to adjust
the intensity of light on the model.
7. Make changes as needed, based on the following parameters:
Spot Light Dimmers - There are eight spot lights arranged around a model in the 3D viewer and are
controlled with intensity sliders and colors. All of the lights are aimed at the center of the model and
enable you to light an object at eye level, from the left, right, top, bottom, behind, back left, or back right.
You can select the color of the lights by double-clicking the color well at the bottom of each of the sliders
and selecting the color. The sliders control the intensity of the light and act as dimmer switches. The
default color of the spot lights is white.
Global Lighting - Global lighting (also known as ambient light) simulates the light that reaches the model
after reflecting off of numerous other surfaces and does not appear to come from any particular
direction. The ambient light is controlled in the same manner as the spot lights. However, adjusting the
intensity of ambient light with the slider bar has the effect of raising or lowering the brightness of the
entire scene. The default color of the ambient light is white.
108
Control Panel
Attribute Settings
The Attribute Settings panel controls the surface properties and colors of the currently active model. You can
select the color of the attribute by double-clicking the color well next to each one and selecting the color.
Option Description
Surface Controls the surface color of an active object when the color variable is set to off (i.e., no color
mapping)
Contour Controls the contour line color when the contour lines are not colored by the Color Variable. This
works the same way as for grid lines.
Vector Controls the vector arrow colors when the Color Variable is not used. This works the same way as
grid lines.
Shininess Controls the gloss of a surface. Moving the slider to the left gives the surface a dull, matte finish.
Moving the slider to the right gives the surface a polished, shiny finish. This is set individually for
each surface in the model.
Grid Controls the color of the grid lines drawn over an object. However, if a Color Variable has been
selected, and the surface button is not used, the grid color will be determined by the color variable
and the selected color map. Otherwise, the grid color will be used.
Outline Controls the outline color of an object. If the object is selected, the outline is the highlight color
(green).
Points Controls the point color when the Points object is used.
Vector There are now multiple quality levels for vector drawing, which allows a trade off of vector
Quality appearance and drawing performance. The lowest level is the same as previous versions of CFD-
VIEW, and the highest level shows capped cylinders for the arrow shaft and capped cones for the
arrow heads. Also, shading is an option for the new vector drawing.
Transparent Gives the surface a simple one button transparency. This is a "screen door" style of transparency
that is provided in addition to the alpha channel style using the color settings or color map
settings.
109
CFD-VIEW V2014.0 User Manual
Line Width - Line width contains three buttons: outline, grid, and contours. Click on a button and select its
line width.
Tubes and Ribbons - Enter the width of the tube or ribbon. Enter the starting angle.
110
Control Panel
Points Settings
The Points Setting panel controls how points are drawn when you use the Points object. It has three sections:
Drawing Mode, Point Drawing Parameters, and Strided Drawing Parameters.
Options Description
Drawing Mode contains three radio buttons: pixels, cubes, and balls.
Based on your selection, the drawing mode in the workspace will be one of the three. If
the "extra" variable is not selected, (set to "Off"), the size of the points/balls will be set to
some constant percentage of the model size. The point size parameter will scale all of
the points uniformly. If the extra variable is set to an attribute other than Off, the
points/balls size will also be scaled to according to that attribute. Finally, if the True Size
mode is turned on in conjunction with the extra variable, the balls are directly scaled to
the selected extra variable. The point size parameter is a straight multiplier of the extra
variable in that case.
Point Drawing contains three fields: point size, max extra, and min extra.
Parameters
With the Point Size field or slider set to zero, each point drawn is a single pixel. If the size
value is less than zero, some points might seem to disappear because they are smaller
than one pixel. However, if you zoom in far enough, these points become visible. The
Max Extra and Min Extra sliders control the largest and smallest point that will be drawn.
Points smaller than the Min value or larger than the Max value will not be drawn. If you
do not select a point drawing parameter, all points are drawn uniform in size.
Strided Drawing contains two fields: point/vector stride and starting point offset.
Parameters
Given a set of points on curves, not all points have to be drawn. You can specify the point
stride. The default value is 1 for all points. If a value greater than n=1 is specified, that
number of points (n-1) will be skipped. The starting point can be specified with the
Starting Point Offset slider bar.
111
CFD-VIEW V2014.0 User Manual
Colormap Settings
The Color Map Settings panel assigns colors to data values. Objects with the same color map display the same
color for the same data value. Data values below the lower limit are mapped to the lower color in the bar, and data
values above the upper limit are mapped to the upper color in the bar. All objects that have the same color
variable will want to have the same color mapping for that variable.
Options Description
Color Map the variable that is used for the active color mapping appears. In this example, pressure, P, is the
variable that is being mapped to color. This section changes the colors in the color tabs (the small
squares above the color bar). Between two color tabs, the color and transparency change
linearly. To move a color tab, place the cursor just below the color tab and drag it to the desired
position. To change a color tab, move the cursor over the tab and double-click it. Its value is
displayed in the Lo/Hi box below the color bar.
Contours the level of the contour. To change the number of contours, enter the number in the Contours
field or click the spin arrows to increase or decrease the number of contours. Initially, the
contour levels are uniformly spaced.
Lo/Hi the mapped range of the active variable. To change the mapped range, enter numbers in the Lo
or Hi fields. The center text field shows the value of the selected color tab, if any.
Samples a small set of samples, shown here. After the sample is selected, the color map converts to the
colors in the sample. From that point, the individual colors, contours, and so forth can be
adjusted.
Maximize Sel. Maximize Sel. sets the low and high color map values to the min and max values (respectively) of
and Maximize the selected object(s) of the tracked variable. Maximize All sets the low and high color map
All values to the min and max values (respectively) of the entire model of the tracked variable.
Invert inverts the color mapping. For example, considering the second color map sample, high values
would be displayed in blue and low values in red.
Logarithmic, changes the color mapping from Linear (default) to Logarithmic when the Logarithmic option is
selected. This means that the color mapping will be “denser” near the lower values of the color
112
Control Panel
Options Description
Scale map. The “intensity” of the logarithmic mapping can be adjusted with the Scale input: the lower
the value, the denser the mapping. The Scale input accepts only strictly positive real values
Static, useful options when multiple frames are used (as in a transient animation for example). When
Dynamic, the color map is Static, its low and high values remain what the user specified. When it is
Cumulative Dynamic, the low and high values will behave as with the Maximize All option, expect they will
update themselves to the current frame. When the Cumulative option is selected, the low and
high color map values will be set to the min and max variable values (respectively) of all the
frames it has gone through.
Vector Settings
The Vector Settings panel specifies how CFD-VIEW displays velocity vectors on an object. Vectors can be drawn on
any data object that supports point drawing modes, such as points, lines, surfaces, and volumes. The panel shown
below is used to control how those vectors are displayed. Vector mapping is similar in concept to color mapping in
that a non-length variable, such as velocity magnitude, is mapped to the length of an arrow on the screen. Since
there is no unique way to accomplish this, there are a number of settings that can be used to achieve the desired
effect. The actual length of the arrows on the screen is not as important as the relative length of the one vector vs.
another. The arrows are scaled to provide a good overview of the vector field, but they can be customized to
provide a more refined view.
Three data variable components are needed for vector mapping. In the case of velocity, U, V, and W are common
components. However, stress or displacement components could be used in the case of structural analysis. The
first of the three components is selected on the Display Settings-Vectors. The largest vector using the vector
variable is found for all of the objects in the model by default. The length of the arrows drawn on the screen are
then determined by what percentage each vector length is of that maximum vector length. There are other
adjustments described below.
113
CFD-VIEW V2014.0 User Manual
Options Description
Head Scale/Uniform If Uniform Heads are selected, all arrow heads representing the vectors are drawn the
Heads same length and are not scaled by the maximum vector. The number shown for head
scale is the relationship of the arrow lengths to the models dimensions. A scale of zero is
a 0 length head. A scale of 100 yields an arrow head that is 5% of the longest dimension
of the model.
Tail Scale/Uniform Tails If Uniform Tails are selected, all arrow tails representing the vectors are drawn the same
length, and are not scaled by the maximum vector. The number shown for tail scale is
the relationship of the arrow lengths to the models dimensions.
Show From/To With a large number of widely varying vector magnitudes, the vector display can become
cluttered. This vector culling feature makes it possible to clarify areas of interest by
hiding vectors that are either larger or smaller than the vectors of interest. By default, all
vectors are shown, ranging from zero length up to the magnitude of the largest vectors.
The range of displayed vectors can be set by changing the from and to fields. For
example, to amplify the display of a swirling region in a flow field, the range of displayed
vectors is set first, and the head and tails scales are then adjusted to give the desired
view of the vectors. This is the typical method for viewing small regions of interest that
would otherwise be obscured by regions of larger vectors.
Maximize Selected If uniform heads and tails is not enabled, the displayed arrows representing the
individual vectors are scaled by the largest vector for the selected vector variable. By
default the largest vector for all of the objects in the model is found, and is used for the
scaling. The Maximize Selected button sets the maximum vector to the maximum of
only the selected objects in the model.
Maximize All This is the converse of the Maximize Selected button. By pressing this button, the largest
vector for all of the objects in the model is found, and is used for the scaling.
Maximum This displays the maximum vector length used for scaling. Although not typically
necessary, this can be changed to create a different scaling effect. This effective
overrides the Maximize All and Selected.
Projected Enabling the projected vectors mode (either click on the word "Projected" or select the
check box) causes CFD-View to project the vectors onto the cutting plane surface. In the
projected vectors mode, the vector arrows are made to lie in the plane of the surface,
thus giving a better idea of the flow field direction tangential to the surface.
Thin This number controls the percentage of vectors that are thinned, (hidden), or the
selected objects. The spinner control adjusts from 0 to 99%, with 0% indicating no
vectors hidden, and 99% hiding 99 out of 100 vectors. The vectors are removed
randomly, and works the same for all surface and volume types, including structured.
For a thin, evenly spaced grid of vectors, the Point Net operator would be more
appropriate.
114
Control Panel
Additional Controls
The Uniform Heads and Uniform Tails options are useful if you are interested in vector direction, not magnitude.
The Uniform Tails toggle normalizes each vector by itself instead of by the maximum vector, making the size of
each vector glyph the same. You can also do this only for the head of the vector to create same-size vector arrows
with the Uniform Heads toggle.
For animation - when performing animation of a series of time dependent simulation output files, the maximum
variable values used in the vector mapping will remain constant throughout the animation. Otherwise, changes in
velocity magnitude, for instance, would be masked by an ever changing vector mapping. Consequently, the
maximize selected and maximize all work on only the current time step in the animation. Typically, the easiest way
to accomplish this is to set the maximums at the animation frame with the largest range.
Symmetry Conditions
The Symmetry panel graphically reconstructs the full domain to reduce computational problems by using the same
symmetry principles that were originally used to reduce the domain. The panel consists of mode, amount, show
from/to, and axes.
Symmetry Panel
Options Descriptions
Mode Provides a number of options for mirroring, rotating, and translating objects, as described here.
Mirror
The original data set was symmetric with a plane. CFD-VIEW support X, Y, and Z = 0
planes, as well as any user-defined plane through the origin. An arbitrary plane
through the origin is selected through the Custom-Axis option from the Axis drop-
down menu and entering the three numbers that specify the normal (a,b,c) of the
symmetry place ax+by+cz=0.
Rotate The original data had axial symmetry. Any principal axis X, Y, or Z can be chosen as
the symmetry axis. CFD-VIEW supports the capability for symmetry about a custom,
user-defined axis through the origin. You can specify either the amount of rotation in
degrees or the number of pie-sectors that make up the original data set. For example,
many turbo machinery applications simulate a single blade passage only, then these
results are applied using axial symmetry to the whole engine.
115
CFD-VIEW V2014.0 User Manual
Options Descriptions
Translate The data set had translational symmetry during the CFD computation. You can
replicate the drawing by any amount of translation, along either the X, Y, Z axes, or a
user-defined axis. The default translation along the three principle axes is the
dimension of the data set along that direction.
X Mirror- These modes combine a planar symmetry in one of the three principle planes with a
Rotate, rotation about an arbitrary axis. The "Mirror" coordinate indicates the normal
Y Mirror- direction to the plane of symmetry. For example, "X Mirror-Rotate" would perform a
Rotate, planar symmetry with respect to the YZ-plane, and then rotate.
Z Mirror-
Rotate
XY Mirror- These modes combine two planar symmetry conditions in two principle planes with a
Rotate, rotation about an arbitrary axis. The mirror coordinate indicates the normal direction
XZ Mirror- to the plane of symmetry. For example, "XY Mirror-Rotate" would perform a planar
Rotate, symmetry with respect to the YZ-plane, take the result of this first symmetry and do a
YZ Mirror- planar symmetry on it with respect to the XZ-plane, and finally rotate.
Rotate
XYZ Mirror-
Rotate This mode combines a symmetry in all three principle planes with a rotation about an
arbitrary axis.
Axis
Indicates the axis for the symmetry. If the mode is set to "Mirror", then the 'Axis' input is the normal
direction to the plane of symmetry. For example, if one wants to display the symmetry with respect to
the XY plane, then the 'Axis' input should be "Z-Axis".
Amount
The effect of this setting depends on the symmetry mode selected. The two main uses are for
translation and rotation. For example, in axial symmetry, the rotation amount is important, whereas
in a mirror, it is not. In axial symmetry that uses rotation, the amount can be set two different ways.
The first is to enter the rotation, in degrees, for each section. Alternatively, the number of sections,
(pie sectors), could be entered, and the rotation would be automatically determined. For translation,
the amount is translation distance between two instances in the replication.
Show/From
Show From and To enables you to make a cut-away view of the model by only drawing a few cases of
the symmetric original. The left-slider controls the lower range and the right-slider the upper range of
the replication process. For example, suppose you computed a seven-bladed fan and simulated only
one blade passage. You would enter 7 for pie-sectors. The sliders now have a range from 1 to 7, and
so you could show only passages 2 through 4, let’s say, by setting the lower sliders to 2 and the upper
to 4. Note that these are zero based indices, indicating that a translation or rotation of zero is the
original.
116
Control Panel
IJK Parameters
The IJK Parameters panel controls the I, J, and K range of the active surface object and works only for structured
grids. Each parameter has a restore button so that its original value can be returned to the original setting. The
Restore All button resets the value of all ranges to their original setting.
The I, J, K range is controlled separately for each surface object, i.e., changing the I, J, K range of one surface object
does not impact any other surface object. CFD-VIEW sets a special flag in each surface object if the range is the
maximum range. When loading another data set, CFD-VIEW re-evaluates each object. If the maximum range flag
has been set, it keeps the object’s range at the maximum, even if the new data set’s range is larger than the old
one.
Animation
The Animation panel animates models in real time in the workspace and records the animation frames to a file for
later playback. The buttons function in a manner similar to a video recorder. The animation system uses the Data
Flow Architecture to keep the model up to date for each step in the animation. For example, if a cut through a
volume produces a surface that is then cut again to create a curve, the data flow will keep the second cut up to
date if the first cut is changed by the animation system. There are three main methods for animating models:
parameter animation, file-based animation, and trigger file based-animation.
Parameter Animation - where objects and viewing parameters within the model can be animated
File-Based Animation - where time dependent data files are loaded one by one to show the temporal aspects of
the simulation
117
CFD-VIEW V2014.0 User Manual
Trigger File-Based Animation - where objects are animated based on tracking a trigger file
When the objects or files are loaded, they are ready to be recorded and saved into a particular file format.
In V2007.2 and later, off-screen rendering is available if your graphics card supports this feature. This will prevent
any open windows that may be on top of the CFD-VIEW graphics area from being captured in the movie. If the
graphics card does not support this feature, CFD-VIEW will fall back to on-screen rendering.
Animation Panel
Animation Panel
118
Control Panel
Option Description
Register Initial
Marks the starting point of the animation.
Configuration
Register Final
Marks the ending point of the animation.
Configuration
Disables the objects in the 3D viewer from becoming animated. The camera's,
(viewpoint), initial and final configuration are registered along with the rest of the
Disable Viewpoint model. This can be disabled by pressing the Disable Viewpoint Animation button. If it is
Animation disabled, the normal 3D viewer mouse operations, such as rotations and translations,
can be performed during the animation. Otherwise, the animation system will be in
charge of the 3D viewer.
Causes the playback process to cycle indefinitely. When the Loop Animation button is
Loop Animation not selected, the animation stops after the last data file in the sequence has played. It
changes from green to yellow if it is set.
Back and Forth Loops the animation in a back and forth manner. It changes from green to yellow if it is
Animation set.
Shows the current frame in the animation that is between 1 and the total number of
frames. This is a frame based animation, where the initial and final configurations of the
model are set along with a number of frames, and the animation system takes care of
Current Frame
the rest. The intermediate configurations are determined by linearly interpolating
between the initial and final. Setting the current frame allows hopping to a particular
frame.
Total Frames Shows the total number of frames within the animation.
Although not often used for parameter animation, the Frame Step allows skipping over
Frame Step frames. A frame step of 1 will step through every frame. A frame step of 2 will step
through every other frame, and so on.
119
CFD-VIEW V2014.0 User Manual
Animation Panel
120
Control Panel
121
CFD-VIEW V2014.0 User Manual
Note Use CTRL+Click to select individual files or Shift+Click to select consecutive files. CTRL+A selects all
files in the directory.
5. Press the Play button to play the animated files in the sequence you have set.
The animation system prompts you to set the total animation frames to the number of files specified. This is
typically desired, but there are cases where the number of files will not match the total number of animation
frames. If there is not a match, the correct file is loaded based on an interpolation of the number of files and
animation steps. In this case, the same file may be used in multiple animation steps. This enables you to animate
multiple sets of files simultaneously, as in the case of DTF and Spray.
When each file is loaded during the animation playback sequence, the Data Flow Architecture makes sure that
changes to the data read from the file cascade through the entire model. For example, if a load volume changes,
the cutting planes, iso-surfaces, etc. will automatically update to reflect changes to the file's data.
Recording the animation is handled the same way as regular animation recording, with one minor exception. The
normal animation controls should not be used at the same time that trigger files are used. Otherwise, there may
be some confusing results when recording.
122
Control Panel
Recording Animation
Once the animation set up and playback are complete, the animation can be saved to disk. The entire 3D viewer
output can be recorded using the 'Record' button on the animation panel, or the Tools Menu-Record Whole
Window option. If you want to record only a portion of the 3D viewer, use the Tools Menu-Record Lasso Area
option.
123
CFD-VIEW V2014.0 User Manual
Record animation
1. Ensure that you have set up your animation initial and final configurations.
2. Press the 'Record' button in the animation panel to record the whole screen. A dialog will appear to setup
the recording options. To record only part of the screen, use "Record Lasso Area..." from the Tools menu.
3. On the Output tab, set the desired output: Movie or Single Frames.
Movie generates a single file containing the animation. CFD-VIEW supports Windows Media, MPEG 1, 2
and 4, Shockwave Flash and Animated GIFs.
Single Frames generates a separate image file for every step in the animation. These can be used by
external video processing tools to combine them into a single movie. CFD-VIEW supports the usual image
formats: GIF, JPEG, BMP, PNG, PostScript, TGA and TIFF. PNG usually gives the best image quality while
keeping the file size small.
For the 'Single Frames' option files are numbered starting from 'File Start'. For the 'Movie' option you can
set the 'frames per second'. Animated GIFs have the additional option to set the number of iterations the
movie should loop. When you click the Infinite box, the recorded file will play infinitely.
Note Only when off-screen rendering is enabled, is the size tab is available.
8. Select either from the 'Template' list to select one of the predefined output sizes, or change the width and
height manually. If 'Lock Aspect' has been checked, the output size is automatically adjusted to keep the
current aspect ratio when either 'width' or 'height' is adjusted. The 'Portrait' check swaps the 'height' and
'width' inputs.
9. Click on 'Accept' to start recording. The animation and recording should start immediately. Recording will
stop automatically once the end of the animation is reached, or when the 'stop' button is pressed. The
animation record button will glow during recording.
124
Control Panel
Background
The Background panel enables you to change the background color in the active 3D viewer to a solid background
color or gradient background color.
125
CFD-VIEW V2014.0 User Manual
The first tab enables you to change the hue, saturation, and value of the color visually. Click anywhere on
the color wheel to change the color, then use the vertical bar to change the shade.
The second tab enables you to use a slider bar to change the red, green, and blue values for the selected
color.
The third tab enables you to use a slider bar to change the hue, saturation, and value for the selected
color.
The fourth tab enables you to use a slider bar to change the cyan, magenta, and yellow value for the
selected color.
The fifth tab changes the color by name. It allows for greater accuracy in consistently applying colors to a
surface and was designed for those who need to rely on color by name rather than visual acuity.
5. Click the Accept button to apply the color to the active 3D viewer background.
126
Control Panel
Calculator
This section covers the following topics:
Expression Menu
Entering Expressions
Evaluating Simple Expressions
Assignment Expressions
Functions
Expression Syntax
Overview
Each time CFD-VIEW produces a new data object, either by reading it from the DTF file or by computing it (such as
by cutting planes and iso-surfaces), you can evaluate an arbitrary expression on that data object with the
Calculator panel. Different data objects may have different expressions associated with them. For example, if you
have computed a Z-cut plane, you can evaluate the average nodal pressure P on that plane by evaluating the
expression sum(P)/len(P) on the Z-Cut plane.
127
CFD-VIEW V2014.0 User Manual
Disables printing the calculator results; this is useful when the expression is being
Check Button
evaluated repeatedly, for example during an animation.
Allows you to enter one or more expressions to be evaluated on the selected data
Expression Field
objects. The clear button on the left clears the expressions.
To the right of the expression field is the enter button. When pressed, the expressions
entered into the expression field will replace the existing expressions on the selected
Enter Button
objects, and the new expression is then evaluated automatically. Each time the data
object is recomputed, the expression is evaluated again.
Expression Field Supports brace matching to facilitate entry of complex mathematical expressions.
Clears the expression on each selected data object, so that if the data object is
Remove Button
recomputed in the future, no expression is subsequently applied to that data object.
Saves the expression currently visible in the expression field to disk. This allows you to
Save Expression load it back into another model in the future. The file has the extension ".vs", and is
simply an ASCII file. The file can be modified with a text editor.
Loads a new expression file from disk and automatically applies it to the selected
Load Expression objects. The expression is evaluated immediately on the selected data objects. Again,
this is simply a ASCII file.
Allows you to export the results of the given calculator expression to a text file. Note
Export
that only the last result will be output to the text file.
Note You can adjust the available space for Output and Expression by dragging the splitter up or down.
Expression Menu
The calculator expression menu provides options for variables and certain functions. As you hover over a function,
the status bar displays a description of the function and its expected arguments. If you select one of the functions,
the given function- or variable-name is entered into the expression field of the Calculator (expression evaluator) .
128
Control Panel
Entering Expressions
Prior to entering an expression, you must first select the dataset objects that the expression is to work on. When
an expression is set on an object, it will be reevaluated each time the object’s value is changed; for example, if an
expression has been set on an iso-surface, each time the iso-surface is moved the expression is recomputed.
Calculator expressions can be simply typed into the Expression field of the calculator panel. To introduce a new
variable for velocity magnitude, for example, you could enter the following expression: Vmag = sqrt(U*U + V*V +
W*W)
To enter variable names that contain spaces, parentheses, or symbols, you must include them in quotation marks,
as shown here: "Velocity Magnitude" = sqrt(U*U + V*V + W*W)
129
CFD-VIEW V2014.0 User Manual
In the following examples, we assume you have read a the tutorial file named tesla_valve.DTF. Select the first
volume grid, then place the cursor into the expression entry field and enter 1, then press Enter. The expression
evaluator will print the following value in the output field:
Expression Output
1 Result in Zone#1: 1
CFD-VIEW evaluates this expression only once for each dataset object (rather than for each grid node) and the
value of this single evaluation is 1. The following example shows the result of a slightly different example:
Expression Output
1+1 Result in Zone#1: 2
You can use any of the standard algebraic operators for your calculations: +, -, *, /, and % (modulus). CFD-VIEW
follows standard precedence rules, with multiplication and division taking precedence over addition and
subtraction. As you can see, the answer is 11 and not 15, thanks to the observance of proper precedent rules for
multiplication and addition.
Expression Output
1+2*5 Result in Zone#1: 11
You can use parentheses to force a particular evaluation order other than the one normally taken due to the
operator precedences.
Expression Output
(1+2)*5 Result in Zone#1: 15
Note As you enter the expression, the opening parenthesis briefly lights up in red as you enter the matching
closing parenthesis.
130
Control Panel
LOGICAL OPERATORS
CFD-VIEW also supports a full complement of logical operators. Generally, you would use these operators in
conditional expressions (see Combining Operators below), but you could use them by themselves. The logical
operators are:
Operator Function
and Logical and, true if both operands are non-zero
or Logical or, true if one of the operands is non-zero
xor Logical exclusive or, true if only one of the operands is non-zero
not Logical not, false if operand is non-zero
The following examples show the results of using the and operator.
Expression Output
0 and 0 0
0 and 1 0
1 and 0 0
1 and 1 1
Expression Output
0 or 0 0
0 or 1 1
1 or 0 1
1 or 1 1
Expression Output
0 xor 0 0
0 xor 1 1
1 xor 0 1
1 xor 1 0
131
CFD-VIEW V2014.0 User Manual
Expression Output
not 0 1
not 1 0
CFD-VIEW regards all values equal to 0 as FALSE, and all values not equal to 0 as TRUE, regardless whether the
number is a real or an integer. When logical values are created from internal operators or functions, a value of 1 is
always returned to represent TRUE, and is of the type integer.
COMPARISON OPERATORS
CFD-VIEW supports the following comparison operators:
Symbol Alternate Name Meaning
< lt less than
<= le less than or equals
> gt greater than
>= ge greater than or equals
== eq equals
!= ne not equals
The following examples use the comparison operators "<" and ">":
We used a new built-in function sum, which takes an array and adds all elements together to yield a single scalar.
The greater-than operator > yielded a 0 for every node where P>0 was false and a 1 for every node where P>0 was
true; thus, sum gave us the total number of nodes where P>0 was true.
COMBINING OPERATORS
The following examples combine logical and comparison operators:
Expression Output Comments
sum(-3000<P and 33 33 nodes had pressure P between -3000 and 3000
P<3000)
-3000 lt P and P lt 3000 (0,0,0, ...) Mostly zeros, with 33 ones.
In the last example, the expression evaluator has printed out the first couple of elements of the integer data array
(printing them all could get pretty big for large CFD simulations!). We used the alternate name lt instead of < here.
132
Control Panel
The logical operators also have well-defined precedence relations. The comparisons (<, <=, and so on) have the
strongest precedence, followed by logical not, and, xor, and or.
Assignment Expressions
Use the Assignment operator "=" to set a variable to a certain value. By assigning expression results to variables,
you can use the visualization capabilities of CFD-VIEW to display variable values in imaginative, graphical ways,
such as iso-surfaces, cutting planes, and so on.
If the variable on the left-hand side of the assignment operator does not exist, CFD-VIEW automatically creates it
for you and adds its name the variable name Combo boxes. If you’re using a non-existing variable on the right-
hand side of the assignment, then an error message results (even though a new variable is still created), because it
is an error to use a variable prior to some value being assigned to it.
CFD-VIEW silently replaces a variable on the right-hand side of the assignment operator with its value. In the
example below, for instance, CFD-VIEW sets A equal to K.
Expression Output
A=P (-30000,-30000,...)
You can also assign several variables at the same time in one simple assignment expression. In the example below,
for instance, CFD-VIEW sets A and B equal to P.
Expression Output
A=B=P (-30000,-30000,...)
CFD-VIEW automatically creates a new variable slot if you try to assign to a variable that does not exist. However, if
you try to use a nonexistent variable on the right-hand side of the assignment operator, CFD-VIEW prints out an
error message:
Expression Output
A=C Error in Zone#1: variable has no value
133
CFD-VIEW V2014.0 User Manual
Note Variable names are case-insensitive regardless of being contained within quotation marks..
Deleting Variables
Use the built-in function delete to remove a variable directly from the calculator:
Expression Output
delete(P) (No value)
Functions
The Expression Calculator comes with a large set of built-in functions including basic math functions such as sin and
cos. To use a function, type the name into the Expression Entry Field and place the arguments between the
parentheses. If the functions have no arguments, just enter the parentheses with nothing in between them.
Expression Output
volume() 7.706988673e-12
In the above example, the calculator computes the volume of the first zone, which is a single scalar number. The
Calculator also handles nested function calls:
Expression Output
A=sqrt(abs(P)) 173.2050781,173.2050781,173.2050781,...)
The Calculator comments with syntax errors if you make a mistake and supply the wrong number of arguments:
Expression Output
Certain built-in functions require you to pass in variables, instead of values. For example, the gradient calculation
routines complain as follows:
Expression Result
This error tells us that the grad3x function requires a grid-based variable instead of a simple scalar or array; only
for grid-based variables can we compute a partial derivative to x.
134
Control Panel
Conditional Expressions
The conditional expression allows you to compute a value in one of two ways, depending on the results of a test.
The conditional operator has the following form:
C or C++ users probably recognize the ?: form. When executed, CFD-VIEW first evaluates the <test-expression> for
a node; if the <test-expression> evaluates to non-zero, then it evaluates the <expression-if-true>. If the <test-
expression> evaluates to 0, then the result of <expression-if-false> is used. An example follows:
Q = U<0.0 ? 0.0 : U
The above expression sets Q to the U velocity component, except for those nodes where U is negative, in which
case Q is set to zero. The conditional operator can be nested arbitrarily, as shown below:
This limits the values in the range [-3, 3]. You can use an expression such as this to preprocess your data, for
example, to remove "outliers" due to noise.
Indexing Expressions
Many expressions yield arrays as return values. These arrays can be indexed to extract a single value from the
array for closer inspection; for example, P[9] yields the scalar value of the pressure attribute at node 9.
Indexes should be integers, not reals; so for example, P[3.14] will give an error message. Of course, indexes should
also be scalars.
Built-in Functions
CFD-VIEW supplies a large and growing list of built-in functions. Function names and detailed descriptions follow:
• sin(x), cos(x), tan(x), asin(x), acos(x), atan(x), sinh(x), cosh(x), tanh(x), asinh(x), acosh(x), atanh(x) -
Performs the standard transcendental functions sine, arc sine, cosine, arc cosine, and so on. The
arguments are expected in radians.
• atan2(y,x) - Calculates the arc-tangent of y/x, except that the values of y and x will be used to determine
the correct quadrant in the range [-Pi..Pi].
135
CFD-VIEW V2014.0 User Manual
• pow(x,y) - Calculates x raised to the power of y. If x is negative, y must be an integer or an error will result.
Furthermore, x may not be zero.
• curlx(u,v,w) - Returns the x-component of the curl of vector variable uvw. The parameters must be
variable registers as the function needs access to the geometry.
• nodal(array) - Returns an array of node-based values by interpolating from given array of per-element
values.
136
Control Panel
• elemental(array) - Returns an array of element-based values by interpolating from given array of per-node
values.
• delete(var) - Deletes the variable named var from all domains where it occurs.
• time() - Returns the current animation time, as defined by the Animation Panel.
• inum( ) - Returns an array containing the I-grid coordinate of each node in a structured grid.
• jnum() - Returns an array containing the J-grid coordinate of each node in a structured grid.
• knum() - Returns an array containing the K-grid coordinate of each node in a structured grid.
• frame()- Returns the current frame number in the animation. This allows you to write expressions which
produce different values in an animation sequence.
• average(x) - Nodal average of elements of array x. Can be used on any nodal based elements (line, curve,
surfaces or volume).
• vaverage(x) - Volume weighted average of elements of array x. Can be used on all volumes.
• aaverage(x) - Area weighted average of elements of array x. Can be used on all surfaces.
• flux(q,u,v,w) - Returns flux of quantity q through surface object, given velocity field u,v,w. The parameters
must be variable registers as the function needs access to the geometry.
• fluxes(q,u,v,w) - Returns array of fluxes for each face in the current surface data object.
• volumes() - Returns array of volumes of each cell in the current volume data object.
• areas() - Returns array of areas of each face in the current surface data object.
• linteg(x) - Line integral of x over line. Can only be used on nodal based lines or curves
137
CFD-VIEW V2014.0 User Manual
CFD-VIEW contains standard Windows "hot" keys that enable you to quickly perform operations when typing into
dialog boxes.
<CTRL> X Cut
<CTRL> V Paste
Expression Syntax
The expressions accepted by CFD-VIEW's calculator are simple expressions like 1+2, assignment expressions such
as A=B+C, and function invocations such as grad3x(Q). Expressions are evaluated when they are applied to the data
object, and whenever the data object’s data is recomputed by the data flow network.
The syntax taken in by CFD-VIEW's expression calculator is defined in terms of a standard Backus Naur Form (BNF)
for grammar description; the BNF description has a few special characters which are interpreted as follows:
• Strings demarcated by < and > are called non-terminal symbols. Non-terminals are never typed in; they
are replaced by strings of other non-terminals or terminals.
138
Control Panel
• Strings between quotation marks (") are terminals and need to be typed as shown.
• Strings between { and } are used to group symbols that are to be repeated zero or more times.
• Strings between [ and ] are optional groups of symbols, i.e., it is expanded 0 or 1 time.
• Strings separated by | are alternatives, i.e., only one of the options is to be expanded.
139
Chapter 8. Operator Palette
The data flow architecture is comprised of operators such as cutting, iso-surface, particle trace, and so forth and
objects such as volumes, surfaces, and so forth.
One of the main benefits of this type of architecture is the ability to rerun the network automatically when
something changes. For example, if the original volume is reread from a file, (as in the case of time dependent
simulations), the subsequent cuttings operations and plotting are done automatically. This greatly simplifies file
based animation, parameter studies, and so forth.
The Operator Palette contains buttons that enable you to see data in the workspace in a number of different ways.
The Operator Palette, located on the right side of the CFD-VIEW window, is divided into two categories: Operators
(surrounded in green) and Annotation Objects (surrounded in blue).
CFD-VIEW Window
Operators
The Operator Palette, located on the right side of the CFD-VIEW window, contains buttons that enable you to see
data in the workspace in a number of different ways. Operators are enabled based on the selected input type.
When the selected input types are inappropriate for an operator, that operator is disabled (grayed out). For
example, the I,J,K Planes operator is only available for structured 3D volumes, whereas the X, Y, Z cuts are available
for all volumes. Additionally, if a 3D volume is cut with an X Cut, a surface is produced. However, if a surface is
selected, the X Cut produces a curve. For this reason, all inputs to an operator need to be similar type. If the
selected inputs are not all of the same appropriate type, the operators will be disabled also. The Operator Palette
is comprised of two types of buttons: operators and annotation objects. The Operators include the following:
Iso-surface/Iso-curve
Clipping
I, J, K Planes
141
CFD-VIEW V2014.0 User Manual
X, Y, Z Cuts
Arbitrary Plane Cut
I, J, K Lines
Particle Trace
Line Probe
Point Probe
Min/Max Probe
Point History
Strip Chart
Point Net
Carpet Plot
Plotter
Border Object
Surface Merge
Surface Reduction
Clone
Replication
Operator Controls
Most of the operators have controls that change an object's variables and values. When an object is selected, its
Operator Control window appears just below the Operator Palette. For example, when you choose an X Cut
operator, it needs to know where to position the cut. The Operator Control enables you to apply additional
conditions to the selected object to make the X Cut. The controls typically include slider bars and text fields. Other
operations, such as a particle trace through a flow field, have several settings to provide total control over the
operation.
Use an operator
1. Select the object in the 3D viewer upon which the operation is to be performed.
2. Click on the desired operator, (for example, X-Cut). A new surface object is produced and the Operator
Control appears so that you can apply additional conditions. The surface is now treated the same as any
surface.
142
Operator Palette
The Iso-Surface and Iso-Curve operators take volumes as input and produce surfaces as the output. An iso-
surface is a surface representation of all points in space with a constant value of a selected variable. The output
surfaces, (new for the 2007 version of CFD-VEW), are polygonal surfaces, and participate in clipping. If all of the
inputs are surfaces, the operator yields an iso-curve instead.
There are two main settings in the iso-surface/iso-curve controls. The operator needs the variable whose constant
value will used to create the surface, and value of that variable that is to be the iso-value.
The surface can now be clipped by an arbitrary number of other variables. See Clipping for more information.
Clipping
The polygon based cutting operations, such as X, Y, & Z Cuts, Arbitrary Plane Cuts, and Iso-surfaces now support
clipping of the output surfaces by additional variables. Clipping is not a new operation per se, but rather adds
additional capability to the existing operations. The output surfaces can be limited by any variables, and not just
the geometric limits. For example, am X-Cut could be clipped to only show the portions whose pressure values lie
between a maximum and minimum pressure. The image below shows a horizontal cut which was clipped by a
maximum variable.
143
CFD-VIEW V2014.0 User Manual
The new clipped surface is complete and subsequent operations are possible on the reduced surface. Also, the
calculator can be used on the clipped surface. To find the area of a cutting plane whose pressure was between
certain limits, simply set the upper and lower clipping variables to the desired pressure limits, and enter the
expression "area()" in the calculator, (without the quotes). As the cutting plane is swept though the volumes, the
calculator output will refresh with the new areas as it sweeps.
In the example below, an X-Cut is created, and the resulting plane is clipped by a maximum P-tot and a minimum Z.
With each new clipping variable added, an additional blank field is append to the list for selection of more
variables. The small blue arrow indicates whether it is an upper or lower bound.
144
Operator Palette
I, J, K Planes
The I,J,K Plane operators draw a constant I,J,K computational plane, respectively. Beginning with
the 2003 release of CFD-VIEW, those planes can be located at fractional values. This greatly improves animation
playback smoothness. These operators are available for structured 3D volume inputs.
There is only one control for the IJK Planes which is the value of I, J, or K for the output surface. The range of the
slider is set to the limits of I, J, or K, for the input objects to the operator.
Create an I, J, or K plane
1. Select the object in the 3D viewer upon which the operation is to be performed.
2. Click the I, J, or K Plane operator, based on the plane you want to create. A new plane is produced and the
Operator Control appears so that you can apply additional conditions.
3. Enter the value of the output surface in the Value field. Use the range slider to set the limits of the I, J, or
K plane.
145
CFD-VIEW V2014.0 User Manual
X, Y, Z Cuts
The X,Y,Z Cuts operators can be performed on either volumes or surfaces. If volumes are cut, the
output is a planar surface. If surfaces are cut, the output is curves. The inputs must be all volumes or all surfaces.
The control appears identical to the I,J,K Plane control, but controls the value of X, Y, or Z for the cut. The range of
the slider is set to the limits of X, Y, or Z for all of the operator's inputs.
The surface can be clipped by an arbitrary number of other variables. See Clipping for more information.
X, Y, Z Operator Control
Create an X, Y, or Z cut
1. Select the object in the 3D viewer that you want to cut.
2. Click the X, Y, or Z Cut operator, based on the cut you want to create. A cut is produced and the Operator
Control appears so that you can apply additional conditions.
3. Enter the value of the output surface or curve in the Value field. Use the range slider to set the limits of
the X, Y, or Z cut.
4. Select clipping variables if needed.
Related Topics
See this topic... To do this...
Control Panel > View Settings rotate an image on the X, Y, or Z axis.
Operator Palette > Axes give a visual indication of a model's orientation in the 3D viewer.
Annotation
Control Panel > Symmetry graphically reconstruct a full domain to reduce computational problems.
Conditions
146
Operator Palette
The Arbitrary Plane Cut operator slices through both structured and unstructured volumes along user-
specified orientation. This orientation can be specified either by defining an arbitrary plane (using two angles and a
center of rotation) or by importing an STL surface.
When defining the arbitrary plane, the center of rotation is to be specified, which is also used as a point through
which the plane passes. Theta and Phi are the two sets of absolute angles that can be used to specify the rotation.
As demonstrated in the following figure, Theta (θ) is the azimuth angle in the xy-plane from the x-axis, and angle
Phi( ɸ) is the elevation angle to the plane's normal. The rotation order is always maintained with these angles.
147
CFD-VIEW V2014.0 User Manual
Rotate A and Rotate B are relative rotation angles with reference to current orientation. These relative rotation
angles allow the simple, intuitive rotation of the plane about two axes. In the control panel, there are two rotation
dials for the same.
The following figure shows the coordinate frame that describes the position and orientation of the arbitrary plane.
Rotation A in the control panel controls the rotation about axis A and the same concept is used for rotation about
axis B. The position of the center shown in the control panel sets the position of the coordinate frame. Again, the
plane always passes through the center point specified by this control. Since these two rotations are relative to
the current orientation, the order is important.
Although Theta and Phi are absolute and order-independent, a different orientation will be obtained if A and B are
set in a different order. Experimentation is easy, and these rotations can be quickly mastered.
Finally, the X, Y, and Z presets set the orientation to be normal to each of these axes.
The arbitrary plane cut can be clipped by an arbitrary number of other variables. See Clipping for more
information.
The other way of specifying the Arbitrary Plane Cut is to import an STL surface. The External Data (Ext. Data)
Import button can be used to import an arbitrary surface in STL format. During import, the STL surface is
intersected with the volume cells to get the Arbitrary Plane Cut (as shown in the following figure). Currently,
Translation/Rotation/Clipping is not supported for such STL-imported arbitrary plane cuts. The imported surface
can be removed/deleted by clicking Clear.
148
Operator Palette
2. Click Arbitrary Plane Cut, . A cut is produced and the Operator Control appears so that you can
apply additional conditions.
3. Enter the Center location of the plane using the three fields for X, Y, and Z. Use either the sliders or the
type-in fields.
4. Select a preset X-, Y-, Z-Cut that is closest to the desired orientation.
5. Specify the orientation by using one of the following methods:
• Enter the degrees of the Theta and Phi angles in the corresponding fields.
1. or
• Use the A and B dials to manually adjust the relative rotation angles about the A and B axes
shown in the 3D viewer.
6. Experiment with the presets and relative rotations to achieve the required orientation.
7. If needed, select Clipping variables.
8. If needed, select Import from External Data to import any arbitrary STL surface.
I, J, K Lines
The I, J, K Lines operators are curves that vary only in the I, J, or K computational coordinate
directions. I and J line operators can have structured 2D or 3D grids as inputs. The K line operator only allows 3D
structured grids as inputs, since K is equal to zero for 2D structured grids. The operator control window below
shows the controls for a J Line with I and K controls enabled. The J control is disabled in this case, since it is a J Line.
149
CFD-VIEW V2014.0 User Manual
Create an I, J, or K curve
1. Select the object in the 3D viewer that you want to cut.
2. Click the I, J, or K Lines operator. A curve is produced and the Operator Control appears so that you can
apply additional conditions.
3. Enter the value of the I, J, or K line in the corresponding field. Use the range slider to set the limits of the
lines.
Particle Trace
The Particle Trace operator traces through multiple grid blocks, structured or unstructured, 2D or 3D.
However, you cannot mix 2D and 3D data sets. A particle trace is the trajectory of a massless particle affected by
the instantaneous flow field in the data set. The output of the particle trace operator is a curve. The particle trace
operator places a trace glyph in the 3D Viewer and opens the trace control panel. The Particle Trace Operator
Controls enable you to position the parameters of the particle trace to be set. The Particle Trace operation uses
the fourth-order Runge-Kutta method.
150
Operator Palette
NX, NY, NZ Use the NX, NY, NZ fields to specify the desired number of trace glyphs in
the X, Y, Z directions. Enter the desired spacing between trace points in the
respective dX, dY, dZ fields. When the IJK position is selected as the
Positioning mode, you can specify the number of trace points and spacing in
the IJK direction.
Vector Vector controls the integration of particle traces using the vector U, V, W.
However, this can be set to anything with the Vector field. Use the drop
down box to select the vector. These are the same vectors used for
displaying vectors (arrows) at data object nodes.
Direction Direction controls the backward and forward movement of a particle leaving
the release point. Particle tracing can occur in both forward and backward
directions. Imagine that forward tracing tracks the movement of a particle
leaving the release point, while backward tracing shows from where the
particle came to arrive at the release point.
Initial Step Size Initial Step Size controls the initial integration step size as a fraction of the
model size. Since the integration algorithm is adaptive, you rarely change
the initial step size, unless the initial step will cause the next trace point to
fall outside of the model. Good values are 0.01 or smaller.
Integration Limit Integration Limit Steps controls the maximum number of integration steps
to be performed. The particle tracer can trace forward, backward, or both.
Steps
However, the total number of steps displayed will not exceed the number of
steps allocated through the trace control parameters.
Integration Limit Integration Limit Time controls the total duration of the trace. The tracing
algorithm stops tracing when either the maximum number of steps has been
151
CFD-VIEW V2014.0 User Manual
Field Description
Time exceeded or when the maximum integration time has been exceeded.
Draw Every Draw Every Other controls the output of tracer. Often, the integration in
tight areas requires very small steps, which yields a large number of points.
Other
This control allows fewer points to be output, by only storing every other n
points to the output curve. However, for integration purposes, the finer
steps are maintained.
Line Probe
The Line Probe operator creates a line through a number of zones, either 3D or 2D, and interpolates all of
the data at a number of points along the line. The line is positioned in X,Y,Z coordinates. The inputs can be all 2D or
all 3D, but not mixed. Once the line is created, it is treated as any other curve and supports the many different
display modes. Since the output it is a curve object, it can be used as input to the plotting operator, which is one of
its typical uses. The line probe end points can be positioned precisely with the X,Y,Z controls.
152
Operator Palette
Points Enter the number of points with which the line will be discretized. The Line Probe
automatically interpolates the input surface/volume data on this specific number of
points.
Note Grabbing the whole line in the 3D viewer moves both end points
simultaneously. To do this, grab the line somewhere in the middle, away from the
end-point glyphs.
EXTERNAL DATA
The import curve button will open a file dialog to select a file to be read in for the external curve data. The
imported curve is stored in the model file, and will be available until the line probe is deleted or the clear button is
pressed.
Supported files may be in comma (*.csv), tab (*.prn) or space (*.txt) delimited format. Most spreadsheet programs
will be able to export these.
CFD-VIEW supports both 2D and 3D curves and the file should contain either two or three columns representing x,
y and optional z.
X Y Z
1.0 0.1 5.0
2.0 0.1 0.4
3.0 0.1 0.6
4.0 0.1 0.7
To remove the curve input data, simply hit the Clear button to revert back to the line probe.
153
CFD-VIEW V2014.0 User Manual
Point Probe
The Point Probe operator extracts numeric data from any location in the data set. Point probes are available
for 2D or 3D zones, structured or unstructured, and can be used in XYZ or IJK mode. The controls for the point
probe operator provide a concise method for obtaining the desired data.
154
Operator Palette
Min/Max Probe
The Min/Max Probe places a point probe at the minimum or maximum value, depending on the users
preference, for the selected variable. This object may be created on a surface(s) or volume(s).
Point History
Previous and current versions of CFD-VIEW support strip charts, which are recorded point probes as a
function of time. With the addition of PAM-FLOW file support, a new Point History object was added in version
v2007.2. This object records the data in a similar fashion to the strip chart, with the exception that there is not an
automatic plot associated. Time histories can be output from PAM-FLOW, and they can be created in CFD-VIEW
also. This time history can be used as the input to a plot, similar to using 3D curves. When used in conjunction with
the plotter, the time history behaves similarly to a strip chart. The plotted variable can be changed without
rerunning the file animation. Also, the DSP functions are available for the Point History output.
155
CFD-VIEW V2014.0 User Manual
With the Point Probe selected, click on the Point History button to create a new Point History.
2. When the control panel appears for the new Point History operator, two controls will appear to allow the
history to be reset to empty. The other checkbox is to use the Time Data from the file, (if it is available),
which is useful for transient data files.
3. The history is now controlled and use in a similar manner to the Strip Chart.
4. The Time History object's data can be used as input to the Plotter. Since this data is time based, the DSP
operations are available. For example, a Fourier Transform can be applied to the output of the Point
History and the results plotter in the Plotter.
Strip Chart
The Strip Chart operator provides a plot of time, or position-dependent data. This operator combines the
point probe with a plotter and determines how data at a point varies with time. Strip charts are available for 2D or
3D zones, structured or unstructured, and can be used in XYZ or IJK mode. The probe portion of the strip chart is
positioned in the same manner as any other point probe. Therefore, the control panel is similar to that of the point
probe, with the addition of the plotting variables. In deciding which plotter option to use, consider the following
suggestions:
Choose Show External Plot if you want to set or change all of the plot parameters and save the plot for future use.
Changes to the plotter are made using the Show External Plot option, and the changes are then reflected in a 3D
viewer.
Choose Copy Plot Image into 3D Viewer if you only want to view a plot. The plotter mirrors the contents of the
external viewer.
156
Operator Palette
Determine how a point varies with time using the point chart
1. Click the Strip Chart operator. A new point is produced and the Operator Control appears so that you can
apply additional conditions.
2. Apply strip chart controls as needed, based on the following information
Condition Description
Mode You can specify the strip chart positioning mode as IJK or XYZ and select the domain
of the release point. You can also specify the X, Y, Z Cartesian position of the point.
Enter the explicit values in the type-in fields or use the Position sliders. Alternatively,
you can click and hold the left mouse button on the glyph, then move the glyph
around the 3-D Viewer.
When the Snap option is activated, the Strip Chart glyph will be snapped to the
closet grid node. When moving/dragging the Strip Chart glyph with the left mouse
button in the 3D Viewer, it will snap upon release of the button. Currently, snapping
is not compatible with IJK Mode.
Domain for If the strip chart probe is set to IJK mode, the next Domain for IJK mode enables you
IJK Mode to specify in which domain the probe should be operating.
X, Y, Z Depending on the mode, the X, Y, Z fields enable you to set the Cartesian XYZ
coordinates or the IJK position. The Strip Chart has the ability to position the IJK
I, J, K
coordinates at fractional positions as well as integer positions.
Variable Allows selection of the desired output variables. Multiple variables can be plotted at
the probe position for each strip chart.
Reset Chart The strip works by taking a data sample every time the animation system advances
one frame, and appending the sample to the plot's curve. The plotter plots the
sampled data versus. normalized time. Pressing the "Reset Chart” button clears the
157
CFD-VIEW V2014.0 User Manual
Condition Description
previously sampled data and begins again.
Show When checked, displays the plot its own 3D viewer.
External Plot
Copy Plot When checked, displays a snapshot of the plot in the 3D viewer. This is also known
Image Into as the Internal Plot.
3D Viewer
Use Time For transient simulations, the time at each time step is recorded in the DTF file.
Data from Check the box to use the time stored in the transient DTF files as the X-Axis of the
File strip chart plot. The time axis will be normalized time (0. -> 1.) if the box is not
checked.
Multiple If multiple data is plotted in the Strip Chart, this check box specifies whether the
Curves Share dependent axis is shared, or if separate axes should be used. If dissimilar data is
Y-Axis Scale plotted, such as pressure and temperature, separate scales should be used.
Point Net
The point net is new to the 2005 version, and is used primarily for creating an evenly spaced vector field, or
simply to create a nice set of points over existing 3D volumes, 2D surfaces, or XYZ cutting planes. ( 2D surfaces are
those in a 2D model, where the model has a constant Z=0 range.) The point net is a set of points that derives its
values by interpolation on the underlying mesh. All of the data from the underlying grid, such as pressure,
temperature, etc., is interpolated also.
Shown below are two sample images. The first is point net placed over a 2D surface. The points are displayed as
balls and vectors are shown indicating the direction of flow. Since the point net contains data interpolated from
the original surface, the colored based on an attribute. The second image shows the point net with vectors
colored by the velocity magnitude at each of the points in the field.
To create a point net, first select 3D volumes, 2D surfaces, or a single XYZ cutting plane, and then click on the Point
Net Operator, shown below. The point net will appear in the 3D viewer window and explorer, and its controls is
described in Point Net Controls.
158
Operator Palette
2D Point Net
159
CFD-VIEW V2014.0 User Manual
The point net is simply a data object in VIEW, and its properties are set the same way as any other objects. The
interesting settings are the point display options, vector display options, and coloring by attributes.
Carpet Plot
The carpet plot is new to the 2004 version, and is used for visualization of data on 2D surfaces. Carpet plots are 2D
surfaces that are displaced vertically based on one of the surfaces' properties. For example, given a Z-constant
surface with pressure and temperature data present, the surface's elevation can be set to the pressure and the
resulting surface can be colored by temperature. With this type of plot, the regions of high and low pressures are
readily visible, as well as the high gradient regions. High pressure gradients, for instance, would be the steep
regions of the surface in such a plot.
Shown below are three images. The first is the original surface color mapped with the pressure variable, and the
second image is the same surface color mapped with the velocity magnitude. The final image is the carpet plot
with the elevation set to the pressure variable and the color mapping set to velocity magnitude.
160
Operator Palette
2D Surface (Pressure)
2D Surface (Velocity)
161
CFD-VIEW V2014.0 User Manual
Carpet Plot
To create a carpet plot, first select a 2D surface with a constant Z Coordinate, and then click on the Carpet
Plot Operator. The carpet plot will appear in a separate window, and its control is described in Carpet Plot
Controls.
As with the other operators, the control panel will switch to the carpet plot controls, which is shown below. The
elevation and color mapping are the only items that need to be set to produce a carpet. To fine tune the display,
right click on the carpet plot surface, which will display the Carpet Plot popup menu. With this menu, the axes
labels can be changed, the surface properties of the carpet plot can be changed, and a snapshot of the carpet plot
can be saved.
162
Operator Palette
Border Object
The Border Object operator creates a surface that represents the border of a 3D zone. This enables you to
see the border of a 3D zone without selecting all of the surfaces that bound the zone. CFD-VIEW displays volumes
and surfaces differently than in previous versions. The surfaces and zones are separate entities and are drawn
separately. There are no controls for this operator.
163
CFD-VIEW V2014.0 User Manual
Surface Merge
The Surface Merge operator merges multiple surfaces into a single combined surface. There are no controls
for this operator.
Surface Reduction
The Surface Reduction operator takes an input surface, reduces the number of surface triangles, and outputs
the reduced surface. Non-triangular surfaces are first converted to triangles and then triangle reduction takes
place. The surface can be reduced by over fifty percent before dramatic changes in the non-gridded surfaces
appearance are seen.
The reduction factor is a single control for surface reduction and is the fraction of the original that is left. For
example, a reduction of .75 reduces the original by 25 percent. The slider goes from 0.1 to 1.0. However, reducing
a surface below .25 typically shows a radically altered surface. Experimentation shows some interesting results.
164
Operator Palette
Clone Operation
The Clone operator creates an exact copy of the input data object. This is useful for drawing objects in
different ways, and allows for rapid switching between them. Also, using the symmetry panel, the cloned object
can be drawn in different positions. After the initial copy is created, the drawing style is independent from the
original.
Clone an object
1. Select a single data object, (i.e. surface, volume), that you want to clone.
2. Click the Clone operator.
3. Modify the appearance as desired.
Symmetric Replication
The Replication operator is used to replicate the input object, (e.g. surface, volume), in a symmetric pattern.
Axisymmetric simulations are often created using only a portion of the larger domain, (e.g. a wedge of a cylinder).
Later, a picture of the complete domain can be achieved by replicating the portion in which the simulation is
performed. One technique is to redraw the sub-domain in the multiple positions needed to give the appearance of
the complete domain,(see symmetric drawing) . The replication described here is similar to symmetric drawing,
except that in replication, actual copies of the data are created. For example, the wedge described earlier would
be replicated to create the complete cylinder. With this, sliced through the complete cylinder can now be
achieved. Care should be taken when replicating large datasets, as the memory using will be multiplied with the
number of copies of the original.
Below is a figure of the controls used in the replication. Please refer to the documentation for symmetry for a
description of the controls.
165
CFD-VIEW V2014.0 User Manual
Operators
Plotter
The Plotter operator takes one or more input lines and curves and creates an X-Y plot of data along those
curves. Plotted data can be any one of an input's variables or the chord length along the input curve. The Plotter
controls enable you to set independent variables, dependent variables, and plot location. The Plotter generates
two types of plot views: Show External Plot and Copy Plot Image into 3D Viewer.
The Show External Plot option provides a view of the plot that enables you to set all plot parameters, view the plot
in its own window, and save the view as an external plot.
The Copy Plot Image into 3D Viewer option provides a snapshot (or copy) of the external plotter window that
appears in the 3D Viewer. This image can be positioned or scaled, but the contents still display the external view's
content. This is also known as an Internal Plot.
166
Operator Palette
Plotter Controls
The Plotter operator enables you to generate a plot, change the plot parameters, view it and save it for
future use. The Plotter operator takes one or more input lines and curves and creates an X-Y plot of data along
those curves. Plotted data can be any one of an input's variables or the chord length along the input curve. The
Plotter controls enable you to set independent variables, dependent variables, and plot location. In deciding which
plotter option to use, consider the following:
• Choose Show External Plot if you want to set or change all of the plot parameters and save the plot for
future use. Changes to the plotter are made using the Show External Plot option, and the changes are
then reflected in a 3D viewer.
• Choose Copy Plot Image into 3D Viewer if you only want to view a plot. The plotter mirrors the contents
of the external viewer.
167
CFD-VIEW V2014.0 User Manual
Plotter Controls
168
Operator Palette
169
CFD-VIEW V2014.0 User Manual
Field Description
Plot X Axis Select the X axis plot from the drop down menu.
Plot Y Axis Select the Y axis plot from the drop down menu.
The Plot Panel menus include the File menu, Edit menu, Scales menu, View menu, and Plot menu.
FILE MENU
The Plot Panel File menu provides the following options for saving a plot.
• Save Plot - To save a plot to use later in other plotting programs, select File/Save Plot from the Plot
window. It saves the plot data in a columnar format that can be read into another program.
• Save Image - The File/Save Image option saves a picture of the plot to the selected file format.
EDIT MENU
• Copy Data - Copies the plot to the clipboard and enables you to paste the data values as a comma-
separated list into another document or spreadsheet, such as MS-Excel.
• Copy Image - Copies a picture of the plot to the clipboard and enables you to paste it into another
document, for example MS Word.
SCALES MENU
The Plot Panel Scales menu provides options for displaying X and Y axis values: Custom Scales, Major Ticks X, Major
Ticks Y, Minor Ticks X and Minor Ticks Y. You can display the major and minor tick marks for the X and Y axis by
selecting the desired option from the Ticks menu.
170
Operator Palette
When the Custom Scales option is selected, the Custom Scales window appears.
The left portion of the window specifies for which scale, (curve), the settings apply. The top-right portion of the
panel shows the lower and upper limit values of the X-axis and the bottom-right portion shows the lower and
upper limit values of the Y-axis. CFD-VIEW automatically determines the range and domain limits of the graph from
the extracted data set when Auto Domain Limits or Auto Range Limits are selected. Otherwise, the typed-in values
for the Domain and Range lower and upper limits text fields set the minimum and maximum axis values. This
option is handy if you need to make plots with certain predetermined ranges on the axes.
When Auto Domain Limits or Auto Range Limits are selected, CFD-VIEW also automatically calculates ticks spacing
and numbers for your plot axes. Otherwise, tick spacing is set by the typed-in values for the Tickmark Spacing
Major and Minor fields.
VIEW MENU
The View Menu enables you to control the visual appearance of a plot. The options are:
• Fonts - Displays a cascaded font menu that controls the fond display of the title, legend, caption, and
number of a plot. To change the font of the title, caption, or numbers, select the appropriate font options.
Fonts Menu
171
CFD-VIEW V2014.0 User Manual
• Colors - Opens the Plot Colors Panel. Use this panel to change the color of plot attributes. To change the
color of an attribute, double-click on the box next the attribute. A color dialog box appears so that you
can select the desired color.
• Line Attributes - Opens the Line Attributes Panel that enables you to select the visual attributes of the
selected plot. First select the plot trace by picking one of the listed variables. Then adjust the line
thickness, color dash/stipple style of the line, as well as the plot markers to be shown at each sample
point
172
Operator Palette
PLOT MENU
The plot menu allows you to select the type of plot you want to see.
• XY - a cartesian xy plot. The following options are available when this plot is active:
• Log X / Log Y - Shows either axis in log scale.
• Histogram - Shows the data in histogram form.
• Average Line - Shows a line indicating the average value of all plots.
• Polar - a polar plot. The polar plot can be configured to accept three different kind of inputs. The following
inputs are supported:
• Polar XY - The input data is assumed to be regular cartesian xy coordinates. The coordinates are
automatically converted to polar coordinates.
• Polar Degree - The input data is assumed to be the radial and angular polar coordinates. The angular
coordinates are assumed to be in degrees.
• Polar Radion - The input data is assumed to be the radial and angular polar coordinates. The angular
coordinates are assumed to be in radians.
EXTERNAL DATA
The import button will open a file dialog to select a file to be read in for external data. The external is stored in the
model file, and will be available until the plot operator is deleted or the clear button is pressed. The clear button
will clear all external data for that particular plot object.
Supported files may be in comma (*.csv), tab (*.prn) or space (*.txt) delimited format. Most spreadsheet programs
will be able to export these.
The first column in the file will be the X-axis data and subsequent columns will be the Y-Axis data. The first row
may be the optional header.
Example:
X U V W
1 0.100 0.100 0.100
2 0.100 0.100 0.100
3 0.100 0.100 0.100
4 0.100 0.100 0.100
173
CFD-VIEW V2014.0 User Manual
The Plotter operator enables you to generate a plot and view it. The Plotter operator takes one or more
input lines and curves and creates an X-Y plot of data along those curves. Plotted data can be any one of an input's
variables or the chord length along the input curve. The Plotter controls enable you to set the independent
variables, dependent variables, and the location of the plot. In deciding which plotter option to use, consider the
following:
• Choose Show External Plot if you want to set or change all of the plot parameters and save the plot for
future use. Changes to the plotter are made using the Show External Plot option, and the changes are
then reflected in a 3D viewer.
• Choose Copy Plot Image into 3D Viewer if you only want to view a plot. The plotter mirrors the contents
of the external viewer.
Plotter Operator
Plotter Controls
174
Operator Palette
175
CFD-VIEW V2014.0 User Manual
PLOTTER OPERATIONS
The Plotter operator in CFD-VIEW now supports some simple signal processing for Time History data from either
PAM-FLOW output files, or created with the new Point History <insert link to Point History page here> object in
VIEW. The Time History is used to record several variables as a function of time at one or more points in space.
When the plot is created based on Time History data, (as opposed to line or curve data), additional capabilities are
displayed as shown below.
There is a list of applied DSP (Digital Signal Processor) type functions that are applied to the currently selected
variables used in the plot. If Time is selected as the independent axis, the new capabilities are exposed. To add a
new DSP operation, select the variable as the dependent variable, (such as pressure in the figure below). Next,
click the add button, ("+"), next to the list, which pops up a small dialog with the available operations. To remove
an operation, select the operation and click the remove button, ("-"), next to the list. To edit a DSP function,
simply double click the function in the list and enter the new values.
176
Operator Palette
When the Add Button is clicked, the dialog above is shown. The selection box at the top is used to choose which
option is to be added. The area below then changes to reflect the options for that operation. An example of this
for DTF is shown in this sample.
To add a DSP operation:
1. Select the input Time History object.
2. Click the Plotter operator. The Plotter Operator Control appears so that you can apply additional
conditions. For a correct Time History object, the DSP section is available
3. Click the Add Button "+"
4. Choose the DSP operation
5. Set the proper options for that DSP operation
6. Apply plotter controls as needed, based on the following information:
7. The plotter now plots the output of the DSP operation.
8. The input variable to the DSP operation can be changed, and the plot will automatically update to reflect
the changes.
CORRELATION
This operation performs an auto or inter-correlation, depending on whether one or two entities are currently
selected (no more than two entities are authorized). Use Correlation parameters dialog box to define two
parameters, both in number of sampling points.
177
CFD-VIEW V2014.0 User Manual
Note Intercorrelation assumes that both curves have the same number of points.
The result is a curve , where n_sample is the value of Samples number, and Ri is defined as:
(1)
where:
1. x & y are the point-wise values of the single curve (auto-correlation) or of each of the two curves (inter-
correlation)
2. N is the lag length
3. <x> M21, M2 is the average of x over the sampling points ranking from M1 to M2
(2)
178
Operator Palette
FOURRIER TRANSFORMATION
FFT Dialog
The algorithm used is the base 2 FFT which performs a temporal permutation at the start of the computation. The
input signal step must be quasi constant and increasing, otherwise the transformation cannot not be performed.
If the signal has not a number of points power of 2, it is re-sampled by linear interpolation. In any case (with or
without re-sampling) the FFT result is scaled by the signal time step Δt.
An option is available to convert the FFT magnitude in dB: is computed. The phase, the
imaginary, and the real part of the FFT is also provided.
179
CFD-VIEW V2014.0 User Manual
DFT Dialog
This option is applied on the selected data via the list Entities and computes the Discret Fourier Transform and
normalized it by /Fe (as with the FFT). The DFT has the same output options as the FFT (Magnitude,...) and
performs ( ) operations ( is the number of requencies and is the number of samples). Its algorithm is
not optimized as the FFT ( operations).
The user inputs are the minimum, maximum frequencies and the frequency step, so that the transform is
computed with a limited needed frequency bandwidth and a frequency resolution.
INTEGRAL
Select one graph in the list corresponding to {y 1i, i=1, n} . Choose the Integral item in the Operation menu. This
will create a new curve defined on the set of mid-points of the original set of abscissa, defined as follows:
DERIVATIVE
Select one graph in the list corresponding to . Choose the Derivative item in the Operation menu. This will create a new graph defined on the set of mid-
.
Note: The derived curve is defined on n-2 points only.
180
Operator Palette
PSD Dialog
The PSD is computed by the previously described FFT so that the signal step must be constant and increasing. If the
signal does not have a number of points power of 2, it is re-sampled by linear interpolation.
The PSD is the power density per bandwidth of frequency:
(1)
where is the number of signal points, is the signal time step, and is the total time of the signal.
This gives:
(1)
2
the result is then expressed in (Physical Unit) /Hz.
181
CFD-VIEW V2014.0 User Manual
SMOOTHING
Select a graph in the list corresponding to . Choose the Smooth item in the Operation menu - this
will create a new curve defined on the set of n-2 "interior" original X-points, defined as
.
Note: The smoothed curve is defined on n-2 points only.
FILTER
The Window frequency filter is used to block some frequency and pass others. For example, used as a low pass
filter, it can erase the numerical noise which can appear in numerical computed results.
182
Operator Palette
Enter the low and high frequency, and use the Apply button to validate the parameters. The filtered signal is
directly created in the graph list.
Time signal process:
The frequency product is performed: , where if , else and is the FFT
of the input signal.
The Inverse FFT is then directly applied on the frequency product to give the time filtered signal.
The IFFT is performed by the same algorithm as the FFT.
where the reference acoustic pressure is Pa, and is the power spectral density, is the
bandwidth frequencies expressed in octave, 1/3 octave, or user defined band in Hz.
The PSD is computed as described previously.
In each band , the integral is approximated by the trapezes method. The SPL is then computed by:
183
CFD-VIEW V2014.0 User Manual
(2)
The OSPL (Overall Sound Pressure Level) is also computed and displayed in the log window. SPL and OSPL are
expressed in dB.
The value OSPL is computed by:
(3)
hen selecting one of the SPL options, you have to choose the frequency bandwidth:
The Setting option Histogram allows the choice to display either a graph or a histogram of SPL values.
184
Operator Palette
185
CFD-VIEW V2014.0 User Manual
The correction values for SPL acoustic filters are the following:
186
Operator Palette
ZEROS PADDING
WINDOW
The windowing operation is defined by its type and its size. The size is specified by the user through the Lower
abscissa and the Upper abscissa input fields, whose default value are the min & max of the abscissa of each entity
separately. Windowing can be used, for instance, to truncate irrelevant parts of a signal before its Fourier analysis.
The size of the window identifies a list of N abscissa index k where the weight applied to the point-wise signal
value will be different from 0. This weighting function applied over the window size depends on the window
type, and is defined from the as follows from the literature:
1. Rectangular:
2. Hamming:
3. Hanning:
4. Blackman:
This windowing may involve a preliminary resampling of the data (default is No resampling), with two different
options:
1. 5. With resampling by number of points : the function is re-interpolated on the required number of points
(N) over the window size
2. 6. With resampling by minimum delta : the smallest sampling interval δ of the curve to truncate is
identified, then N is computed as 2k, with 2k-1 £ (window size/δ)+1 < 2k, and the function is re-sampled
accordingly over the window size.
Note: Resampling is performed through a linear interpolation between the closest points.
187
CFD-VIEW V2014.0 User Manual
SEGMENTATION
This operation is used to analyze data pieces by pieces (especially for spectral analysis of time series). When used
with the option FFT, or PSD, it creates plot results on each elapsed time. It can help in locating frequencies in the
time domain. It can also be used to plot the mean of partial FFT. The user input is the number of segments. An
interpolation is performed if the number of samples is not a multiple number of the length input signal. The
operation is not performed if the number of segments is greater than the number of samples.
Four window types are available: Rectangular, Hamming, Hanning and Blackman. An overlapping option is
available to overlap each window and thus perform a Welch method of PSD computation (this method averages
the spectrum).
188
Operator Palette
Annotation Objects
Introduction
The Operator Palette, located on the right side of the CFD-VIEW window, contains buttons that enable you to see
data in the workspace in a number of different ways. It is comprised of two types of buttons: operators and
annotation objects. Annotation objects add legends, text, boxes, lines, arrows, and any other annotation needed
to create presentation graphics. They are not true operators, in the sense that they have no inputs. They are stand
alone objects that have their own settings, properties, and so forth. The Annotation Objects include the following:
Legend Annotation
Time Annotation
Origin Annotation
Axes Annotation
Bounding Box Annotation
Image Box Annotation
Box and Oval Annotation
Line Annotation
Text Annotation
Label Annotation
Note For additional information about changing annotation text and other properties for an object, see
Workspace-Query Menus.
Legend Annotation
The Legend Annotation object enables you to assign a color to a range of values for a variable. For example,
high pressure might be assigned to a red color, while low pressure might be assigned to blue. The legend is used to
visually show the mapping of the range of values to the range of colors. When at least one object has been
assigned a variable color, the legend becomes available and the legend button is enabled. The legend can track the
189
CFD-VIEW V2014.0 User Manual
active color mapping, that is, the color map for the currently selected objects, or it can be locked to any one of the
variables, such as, pressure, temperature, and so forth.
To change the legend properties, you need to bring up the Legend Properties panel. To do so, either double-click
on the legend object from the object explorer list, or right-click on the legend (from the object explorer of from the
3D Viewer) and select Properties. The following properties may be set:
Track Active Color controls whether color mapping is locked to a specific color mapping or
Map switches to whatever the color mapping of a selected object. Many times,
there will only be one color mapping in the model, which is switched from
variable to variable. Selecting this feature is useful for this situation. If this
option is turned off, you may select the color variable for this legend.
Color Variable
Flooded sets color mapping to use bands of color with sharp transitions (flooded)
instead of a smooth gradient of color. The effect is the same as flooded
color mapping of surfaces. When the “Track Active Map” option is selected,
190
Operator Palette
Use color variable uses the color variable name for the legend title. If unchecked, the name of
as title the legend is used for the title.
Layout Vertical Title displays the title vertically on the side of the legend. This option is helpful
when the legend is vertically oriented. Alternatively, the title can be placed
on top of legend.
Mirror Legend
controls the side on which ticks and labels display.
Mirror Text
controls the direction of the vertically placed text, which can either be top-
to-bottom, or bottom-to-top.
191
CFD-VIEW V2014.0 User Manual
Min & Max shows the values of the extremes of the color mapping scale.
Precision sets the number of digits and the number mode for the displayed numbers
in the legend. The mode may be set to Fraction, Exponent, or Automatic.
192
Operator Palette
100ths shows ticks for an even finer division of scale. Typically not needed.
Automatic Tick uses automatically generated ticks mark spacing or provide your own
Spacing custom values.
Number of Ticks sets the number of major and minor ticks. The number of major ticks
includes the first and last ticks. For example, 10 ticks will correspond to 1
tick for the min value, 1 tick for the max value, and 8 intermediate ticks. The
number of minor ticks includes only ticks in between the major ticks, that is,
the major ticks are not counted towards the number of minor ticks.
Tick spacing specifies the spacing between two consecutive ticks. Ticks will be placed
based on factors of the spacing value. For example, consider a variable
ranging from 8 to 35. Specifying a spacing of 10 will put one tickmark at 10,
one at 20 and one at 30.
Time Annotation
The Time Annotation object enables you to display DTF files that have animation time stored. To use Time
Annotation, the operator needs to know from which DTF file the data came. New for 2004, the Time Annotation is
no longer attached to an object read from a file, but to the file reader itself. This avoids confusion when multiple
objects are selected or grouped.
193
CFD-VIEW V2014.0 User Manual
194
Operator Palette
Option Description
Precision This sets the number of digits that are used in the display of time. When clicked, the
Transient Time window appears to enter the number of digits. See window below.
Properties The Time Annotation Properties dialog changes all of the settings at once. The only
additional property that was not on the right click menu is the shadow color. It
should typically be set to a slightly darker shade of the background color.
Origin Annotation
The Origin Annotation object gives a visual indication of the position and orientation of the model's origin.
Depending on how the 3D Viewer is positioned, the origin may fall outside of the visible region.
195
CFD-VIEW V2014.0 User Manual
Axes Annotation
The Axes Annotation object gives a visual indication of the model's orientation in the 3D viewer. However, its
position is not at the origin, but at a fixed location on the screen. With this technique, the axes always remain in
view.
196
Operator Palette
Related Topics
See this topic... To do this...
Control Panel > Scaling change the X, Y, or Z scales of a model
Operator Palette > XYZ Cuts make X,Y, or Z cuts on volumes or surfaces
197
CFD-VIEW V2014.0 User Manual
198
Operator Palette
Option Description
Select all This menu item enables you to select all of the annotation objects in the model,
annotation including other types of annotation.
Visible This restores hidden objects in the 3D viewer. Once an object is hidden, it will
need to be selected from the Object Explorer to turn the visibility back on.
Rename All objects can be renamed. The name of the object is displayed in the Object
Explorer. When this menu item is chosen, a small dialog box appears that enables
you to change the name.
Delete This provides a convenient method for deleting a single object. It is the equivalent
of selecting a single object and pressing the Delete button on the Tool Bar.
Box line This controls the thickness of the box outline.
weight
Number font This selects the 3D vector graphics font for the legend and provides a set of
available fonts.
Major ticks This controls whether the major ticks along each axis are shown.
Minor ticks This controls whether the minor ticks along each axis are shown.
Numbers This controls whether the numerical values at each of the ticks are shown.
Typically, you will want to set this as on. See window below for an example.
199
CFD-VIEW V2014.0 User Manual
Option Description
Properties The Bounding Box Properties panel offers all of the settings described above,
along with some additional settings.
The Image Box Annotation object places an arbitrary image into the 3D Viewer window. When you click this
button, the Image Box Annotation Properties dialog box opens. Use this dialog box to place a company logo,
project icon, title information, and so forth. An image can be any of a number of different industry standard image
formats, including transparency images such as PNG.
The following diagram shows the ESI CFD logo used as an Image Box annotation. The outline (edge) is turned off
and the image was stored as a PNG image with transparency. The soft drop shadow is part of the image itself and
is partially transparent. There is a nice effect of the shadow overlaying the underlying data display. Since OpenGL is
used to draw the 3D viewer, transparent images need to be drawn last. This can be set by using Pull Up in the
Arrange menu on the main window.
200
Operator Palette
2. Click on the Image Box and small green handles appear on each of the four corners of the box. Click on a
green handle, hold the left mouse button and drag the handle to resize and reshape the box. Drag the
middle of the selected Image Box to move it within the window.
3. Right-click on the Image Box Annotation box in the 3D viewer. The Image Box Annotation menu appears.
Description
Option
Select all This menu item enables you to select all of the annotation objects in the model,
annotation including other types of annotation.
Visible This restores hidden objects in the 3D viewer. Once an object is hidden, it will need to
be selected from the Object Explorer to turn the visibility back on.
201
CFD-VIEW V2014.0 User Manual
Description
Option
Rename All objects can be renamed. The name of the object is displayed in the Object Explorer.
When this menu item is chosen, a small dialog box appears that enables you to change
the name.
Delete This provides a convenient method for deleting a single object. It is the equivalent of
selecting a single object and pressing the Delete button on the Tool Bar.
Edge width If an outline is drawn around the Image Box, this setting controls the line thickness of
the outline.
Edge color If an outline is drawn around the Box Annotation, a color dialog box appears that
enables you to set the outline color.
Edge This controls whether an outline is drawn around the Image Box.
Lock aspect The drag handles on the corners of the Image Box allow the object to be resized and
reshaped. Selecting the "Lock Aspect” option will lock the ratio of height to width to
that of the original image. With this option turned on, the image can be resized
without the distortion. This is typically desired, and thus is the default setting.
Rotate The Image Box can be easily rotated in multiples of 90 degrees. Selecting the rotate
pops a small submenu that presents a choice of rotations.
Shadow The Image Box itself can have a simple drop shadow if this option is selected. This
shadow is useful for opaque images only.
Load image Load Image opens a File Open dialog that allows the image within the box to be
replaced. There are several supported formats from which to choose.
Properties The Image Box Annotation Properties window offers many of the settings described
above, along with some additional settings. You can also make any necessary changes
in this window.
The Box and Oval Annotation objects draw an optionally filled box or oval on the screen. They provide
an opaque background for text annotation or draw attention to interesting parts of the model. The only difference
between the two is the shape. When the Box or Oval Annotation is selected, small green handles appear on each
of the four corners of the box. Drag the handles to resize and reshape the box. Drag the middle of the Box to move
the box within the window.
202
Operator Palette
Visible This restores hidden objects in the 3D viewer. Once an object is hidden, it will
need to be selected from the Object Explorer to turn the visibility back on.
203
CFD-VIEW V2014.0 User Manual
Option Description
Rename All objects can be renamed. The name of the object is displayed in the Object
Explorer. When this menu item is chosen, a small dialog box appears that enables
you to change the name.
Delete This provides a convenient method for deleting a single object. It is the equivalent
of selecting a single object and pressing the Delete button on the Tool Bar.
Edge width If an outline is drawn around the Box Annotation, this setting controls the line
thickness of the outline.
Edge color If an outline is drawn around the Box Annotation, a color dialog box appears that
enables you to set the outline color.
Fill color If the interior of the Box Annotation is filled, a color dialog box appears that
enables you to set the fill color.
Edge This controls whether an outline is drawn around the Image Box.
Fill This controls whether the interior of the Box Annotation is filled or not.
Shadow The Box/Oval itself can have a simple drop shadow if this option is selected. The
shadow is useful for opaque images only.
Properties The Box/Oval Properties panel offers many of the settings described above, along
with some additional settings.
Line Annotation
The Line Annotation object draws a line or arrow between two points on the screen. This is useful for
drawing attention to interesting features in the data's display. When Line Annotation is selected, small green
handles appear on each end of the line or arrow. Drag the handles to reposition the line. Drag the middle of the
line to move the line within the window.
204
Operator Palette
• Arrow Base - If Arrows are turned on, this setting controls the width of the base of the arrow head.
• Arrow Head - If Arrows are turned on, this setting controls the length of the arrow head.
• Shadow Color - This allows setting of the shadow color if shadows are enabled. It should typically be set
to a slightly darker shade of the background color.
205
CFD-VIEW V2014.0 User Manual
Option Description
arrow heads themselves. Selecting this pops another option menu that allows you
to choose the type of arrow head.
Line color Selecting this pops a color dialog that allows setting of the Line Annotation color for
both the line and arrow.
Shadow The Line/arrow can have a drop shadow if this option is selected.
Properties The Line Properties panel offers many of the settings described above, along with
some additional settings.
Text Annotation
The Text Annotation object provides a way to label certain features or provide general text capabilities in the
3D Viewer. Text Annotation uses bit-mapped fonts and label Annotation uses vector graphics fonts.
There are many settings for each of the fonts, but typically the default values provide a good starting place. Simple
experimentation usually yields some very good results quickly.
206
Operator Palette
207
CFD-VIEW V2014.0 User Manual
Option Description
Properties The Text Properties panel offers many of the settings described above, along with
some additional settings.
The only additional property that is not on the right click menu is the shadow color.
It should typically be set to a slightly darker shade of the background color.
Label Annotation
Note This annotation object is depreciated and no longer available through the user interface. It can still be
created through scripting. Older model files may still create these as well.
The Label Annotation object is very similar to the Text Annotation, with the exception of the type of fonts
that are used. Label Annotation uses vector graphics fonts and Text Annotation uses bit-mapped fonts.
208
Operator Palette
209
CFD-VIEW V2014.0 User Manual
Option Description
Shadow The Label Annotation can have a simple drop shadow if this option is selected.
Properties The Label Properties panel offers all of the settings described above, along with
some additional settings.
The only additional property that is not on the right click menu is the shadow color.
It should typically be set to a slightly darker shade of the background color.
210
Chapter 9. Object Explorer
The Explorer contains a list of objects and a set of buttons to assist in selecting and grouping objects. The list can
be sorted by clicking on the column headers, which then sorts by items in that column. If the items in the list have
been given a name in an earlier application, that name will appear in the list. Otherwise, the default name of
NoName appears.
The Object Explorer Buttons at the bottom of the panel enable you to perform various functions on objects in the
Object Explorer. One special set of operators, which is not shown in the Operator Palette, is the file reader (Menu
Bar-File Open). When you open a file, its computational domains, boundary condition patches, etc. are added to
the Object Explorer.
211
CFD-VIEW V2014.0 User Manual
Explorer Buttons
The Object Explorer buttons enable you to perform specific functions on objects in the Object Explorer or in the 3D
viewer. They are located below the Object Explorer on the bottom right side of the CFD-VIEW window. When you
click a button, it performs the related function.
Group Objects
The Group Objects button enables you to select multiple objects in the 3D viewer or Object Explorer and group
them together as one image. New for 2004, multiple objects can be grouped, whether they are the same type of
object or not.. If multiple objects are selected, then the group button is enabled. It is also available in Arrange
Menu > Group.
Ungroup Objects
The Ungroup Objects button enables you to select a previously grouped object in the 3D viewer or Object Explorer
and ungroup it so that it becomes individual objects. The individual parts still have their individual names and
properties. It is also available in Arrange Menu > Ungroup.
212
Object Explorer
213
Chapter 10. 3D Viewer
3D Viewer Introduction
When you open a file or create a new file, CFD-VIEW displays the model in a 3D Viewer in the workspace. You can
simultaneously load multiple models and arrange them in an overlay fashion or in the Multiple Document Interface
as shown below. This section covers the following:
215
CFD-VIEW V2014.0 User Manual
216
3D Viewer
217
CFD-VIEW V2014.0 User Manual
218
Appendix A Formulas
Formulas Introduction
CFD-VIEW’s calculator is based on a simple expression evaluator. However, the expressions being evaluated are
associated with the datasets. Each time a dataset is recomputed or reloaded from the data file, the associated
expressions are also reevaluated. Thus, many actions can be performed automatically.
Because the expressions are associated with certain dataset objects, it is necessary to select a dataset before
entering your expressions so that it is clear which data the expressions are to work on.
Different datasets may have different expressions associated with them. Thus, it is possible to calculate flow
quantities only on certain walls or volumes instead of all of them. For example, you can set the expression flux() on
a cutting plane, thereby continuously reevaluating the mass flow as you sweep the surface through the dataset.
Once you have performed your calculations, you can export the results to a text file using the Export option, as
shown in the figure below.
Basic Formulas
The expression calculator evaluates expressions either as scalars or as arrays. When you mix a scalar value and an
array value in operators, the scalar value is automatically extended to the same length as the array. For example:
Pressure+10*3
In the above, 10*3 is evaluated as a scalar, but when adding with Pressure the result is extended to an array of the
same length as the Pressure array in the variable registers.
You can extract single elements out of the array by indexing. The index of the first value of the array is zero (0):
Pressure[0]
Will print out the value of Pressure at the first node in the grid. The index must be an integer number, or a error
will result.
219
CFD-VIEW V2014.0 User Manual
Combining arrays of different sizes in one operator will also produce an error:
Pressure*areas()
The function areas() returns an array of length equal to the number of faces, whereas Pressure has a length equal
to the number of nodes. To accomplish the above, we need the function elemental() which interpolates node-
based data to the faces.
To obtain the length of an array, you can use the len() function:
len(Prcessure)
Will print out the length of the Pressure array, which is the number of nodes.
Thus, to determine the average nodal value of a variable in the entire grid, you can sum the elements of the array
and then divide by the number, as in:
sum(Pressure)/len(Pressure)
Less frequently useful is the function product() which takes the product of all the elements in an array:
product(Pressure)
Whenever you use the name of a non-existing variable, the calculator will create a new variable register. However,
it is an error to use a new variable’s value before it has been assigned:
Pressure=QQ
Because QQ does not exist, and is used as a right-hand value rather than as a left-hand value. To get rid of
variables which you may have accidentally created, simply enter:
delete(QQ)
Whenever you want to store elemental based results, variables need to be prefixed with "Cell_". For example to
store the elemental values of U velocity:
Cell_U=elemental(Nodal_U)
Conditional evaluation may be used to perform different calculations depending on the values involved, for
example:
220
Appendix Formulas
A simpler case would be to prevent some value from becoming zero, for instance, before taking its logarithm:
This would fix variable “H+” to be no less than 0.0001. Note that we used quotes to prevent the calculator from
interpreting the “+” as an operator. You may also need to use the quotes if your CFD problem uses variable names
which are reserved words in the calculator, such as “sqrt” and “pow.”
When working with variables that have parentheses in the name, such as deposition (e.g. Dep_Species(B)),
quotation marks will be required for this variable if it is used in an expression. For example, to change the sign on
the deposition of SiO2, the following would be valid:
MINUS_DEP = -"Dep_SIO2(B)"
EX=grad3x(Q)
EY=grad3y(Q)
EZ=grad3z(Q)
Alternatively, you may just want to perform an iso-surface of the electrostatic field magnitude:
EM=grad3m(Q)
DIVERGENCE=grad3x(U)+grad3y(V)+grad3z(W)
221
CFD-VIEW V2014.0 User Manual
For fluid flow analysis, finding vorticity is also interesting. CFD-VIEW’s calculator provides this using the curlx(),
curly(), and curlz() functions:
CX=curlx(U,V,W)
CY=curly(U,V,W)
CZ=curlz(U,V,W)
Notes You must pass a variable register to the curl functions. In 3d these functions has to be use for volumes first.
After gradients has been created, cutting planes can be use to visualize the values. In 2d models surfaces can be
use directly for showing the gradients.
volume()
This will print out the volume of the volume dataset. Note that blanked cells are included in the calculation. The
volume() function returns a single number representing the volume of the selected volume dataset.
volumes()
This returns an array quantity, the volume of each cell of the dataset; again, blanked cells are included. To obtain
the volume of a specific cell, you can index this array; for example, volume of the 5th cell:
volumes()[4]
Will print out a single number, the volume of the fifth cell. Note that the index starts from 0, not 1.
Equivalent functions exist for surfaces. Select a surface dataset from the model, and type in:
area()
This prints out the total area of the selected surface. To obtain an array of the areas of each face of the surface,
type in:
areas()
Just as above, you can index to obtain the area of a specific face.
A common problem in CFD is to determine fluxes through inlets or outlets. The function flux() makes this possible.
Since the angle of the velocity field and the surface normal makes a difference, the last three parameters of flux()
are the U, V, and W components of the vector field. The first parameter is the quantity of interest. For example, to
compute mass-flow, first select one of the surface objects in the dataset, then type in:
222
Appendix Formulas
flux(RHO,U,V,W)
This will print a single number, the total mass flow through the surface. Note that the four parameters must be
grid-based variable registers, as the evaluation of the flux() function needs to access the geometry of the surface.
CFD-VIEW stores node-based data. To perform expressions involving cell volumes or surface areas, it allows
interpolation of the node-data to element data using the elemental() function:
sum(areas()*elemental(P))/sum(areas())
Assuming a surface dataset was selected, this formula computes the average area-weighted pressure over a
surface.
You can also interpolate per-cell or per-face data back to the nodes using the nodal() function:
Q=nodal(areas())
This computes a new variable register Q, which is populated by the average face area near each node. Selecting Q
as the color-variable provides convenient visualization of face-sizes on a surface.
# You could use this prior to reflecting/rotating objects using the Symmetry panel if your
# original grids have not been defined with the origin at the symmetry plane/axis.
X=X+dx
Y=Y+dy
Z=Z+dz
CYL=sqrt(sqr(X-3)+sqr(Y-5))
Will create a new variable register called CYL which is filled by the distance of each node from a line parallel to the
Z-axis through x=3, y=5. When you subsequently create an iso-surface, you can select CYL and obtain a cylindrical
cut through the data volume; all scalar and vector quantities in the volume are mapped to the surface, and can be
used for coloring or vector drawing.
SPHERE=sqrt(sqr(X-5)+sqr(Y-6)+sqr(Z-7))
223
CFD-VIEW V2014.0 User Manual
In some cases, you may want to deform the geometry based on a deformation vector; again, CFD-VIEW’s calculator
can be helpful here:
X=X+0.1*DEFORMX
Y=Y+0.1*DEFORMY
Z=Z+0.1*DEFORMZ
This will deform the geometry of the selected dataset based on some deformation vector.
To test the particle tracer, you can create an artificial flow field and integrate traces in it:
U=-Y+3
V=X-7
W=0
When tracing this velocity field, perfectly circular traces around x=7, y=3 should result.
224
Appendix B User Customization
Fox Applications
All FOX-based applications, including CFD-VIEW can be customized using the standard FOX registry system. The
FOX registry system uses human-readable ASCII files on UNIX systems and uses the standard binary registry on
Microsoft Windows. Locate the registry under key:
HKEY_LOCAL_MACHINE/Software
HKEY_CURRENT_USER/Software
for user settings. You can edit the registry using any text editor on UNIX or Regedt32.exe under Microsoft
Windows.
[SETTINGS]
normalfont = "[helvetica] 90 70 1 1 0 0"
typingspeed = 600
clickspeed = 400
scrollspeed = 80
blinkspeed = 500
animspeed = 10
menupause = 400
tippause = 800
tiptime = 3000
dragdelta = 6
bordercolor = (default border color)
basecolor = (default gui background color)
hilitecolor = (default highlight color)
shadowcolor = (default shadow color)
backcolor = (default "white" color)
forecolor = (default foreground color)
selforecolor = (Default select foreground color)
selbackcolor = (default select background color)
maxcolors = 125
iconpath = "~/.foxicons:/usr/local/share/icons:/usr/share/icons”
225
CFD-VIEW V2014.0 User Manual
File Types
The following text determines the icons shown in the File dialog box. The file types section is defined system-wide
so that all applications agree on the file types.
Each file extension has an associated program, file type, big and small icon, and mime-type. Directories may be
bound, although typically the program field will be empty:
CFD-VIEW Settings
The following settings are specific to CFD-VIEW. Other settings are configured in Window Menu-View Preferences.
Plotter
Border color black
Number color green
Tick color blue
Title color red
Back color white
Legend color red
Options ex (options)
Grid color gray
Settings
Helpfile - "online.manuals.html" (where online help is located)
General
Prefer Hardware - 1
Acceleration - Disables Open GL hardware acceleration on machines where drivers are too buggy to work with.
Tools
Help browser - "netscape-remote 'openURL(%s)'"
226
Appendix User Customization
Environment Variables
CFD-VIEW offers environmental variables so you can customize characteristics of the graphics display. For example,
you can set environmental variables with setenv VAR value with csh or tcsh, and with export VAR = value with the
Bourne shell or Korn shell. On Windows, use the system icon in the Control Panel. You will not need to change
these settings unless there are problems in setting up CFD-VIEW in unusual environments.
DISPLAY This is the X display on which CFD-VIEW displays itself. If you are running and displaying on the same
machine, this should be set to “:0.0.”
FOXDIR This is the location where FOX registry can be found. If it is not set, the system-wide FOX registry is
searched in the following directories:
/etc/foxrc
/usr/lib/foxrc
/usr/local/lib/foxrc
Either way, the user-specific FOX registry is always found in
$HOME/.foxrc
LSCFDRC This is the location of the license server host.
227
Appendix C Scripting
• An integrated Python interpreter, with built-in modules for accessing most CFD-VIEW application
functionality.
• A Python script editor that enables you to edit existing scripts and write new scripts.
You can run scripts in three ways. The most common choice is to copy the script into your macros directory (the
current working directory) and then access the script from the Tools menu, Macro option.
Option one
1. Save a copy of the script to your macros scripts directory.
2. Start CFD-VIEW (if it’s not already running) and select the Macros option from the Tools menu.
3. Click the button labelled with the name of your script, and the script runs in CFD-VIEW’s integrated
Python interpreter.
229
CFD-VIEW V2014.0 User Manual
Option two
The second option enables you to run a script when CFD-VIEW first starts up. This is done by passing the name of a
Python script to CFD-VIEW on the command line. This is useful for applications that launch CFD-VIEW in batch
mode.
Option three
The third option invokes the script from the File/Run Python Script menu. This option is convenient if you need to
execute a Python Script that is not located in the current working directory and you have already started CFD-
VIEW.
Scripting in CFD-VIEW was rewritten in the 2004 version to improve the power and flexibility. To maintain
compatibility with previous user scripts, a set of modules was created that provide a familiar interface to the user.
This is referred to as Basic Scripting. These modules actually call the advanced scripting facilities "under the
hood." For the 2004.2 version, the advanced scripting functionality was greatly expanded and split off into a
separate section.
Basic Scripting
CFD-VIEW’s basic scripting language interface is organized as a set of twelve Python modules, loosely defined
around different areas of functionality.
VAnnotation
VCurve
VEntity
VImport
VMaterials
230
Appendix Scripting
VModel
VPlot
VPoints
VProbe
VSurface
VViewer
VVisualization
There is an additional module, cfdview_basic, that is simply a single module that imports all of the previously listed
modules. It uses slightly more resources, but is more convenient than importing multiple individual modules.
Python has two methods for importing modules. Take the VAnnotation module, for example:
import VAnnotation
from VAnnotation import *
When using the first import method, you would need to specify from which module the needed function is
imported. For example, you would use VAnnotation.CreateBox() to create a box. However, with the second import
method, the function does not need to be scoped to the source module. In this case, the box would be created
with a simple call to CreateBox(). For the CFD-VIEW modules, there are no duplicate function names in different
modules, so it is really a matter of programming taste whether you choose 1 or 2.
Examples
This section provides several examples of basic scripting, including the following:
Annotation
Snapshots
Cutting
Probes
Traces
IsoSurfaces
Purpose
The File I/O module is used by Python to incorporate the scripting for the file importing (reading) and exporting
(saving) features in CFD-VIEW. The File I/O module methods are useful for importing external data into the model.
Several examples of the use of file importing can be found in the examples section. Please see the section File
Menu > Import Additional Data File for information on file import.
Imported Functions
The following functions are imported into Python from the File I/O module.
231
CFD-VIEW V2014.0 User Manual
Import the DTF file filename into this model. A pointer to the file reader operator is returned. The options
are shown above in their expected order and with their default value (i.e. when the option is not
specified). The values for the options are (for options with 0 or 1 values, 0 means “deactivated” and 1
means “activated”):
• importMethod: DTF_ZONE_BASED, DTF_VC_BASED or DTF_SIMPLIFYING
• simnum: an integer referring to the simulation number to be loaded from the DTF file
• cell: 0 or 1
• spray: DTF_SPRAY_NONE (do not import SPY file), or (import SPY file) DTF_SPRAY_FORMATTED,
DTF_SPRAY_UNFORMATTED, DTF_SPRAY_BINARY, DTF_SPRAY_UNFORMATTED_SWAP_BYTES or
DTF_SPRAY_BINARY_SWAP_BYTES
• blanking: 0 or 1
• grouping: 0 or 1
• unscaled: 0 or 1
• nozero: 0 or 1
• animation: 0 or 1
Note In CFD-VIEW V2010.0 and earlier, only (importMethod and simnum) are available.
GetFileReader(filename, fullpath=False)
Returns a pointer to the file reader operator with the given filename. The fullpath argument is optional,
and instructs the function to use the full path of the file (including directory) if it is True, or to use the
short file name (without directory) if False. The default value is False, (indicating no directory info).
SetFilenames(reader, filenames)
This function sets the the list of file names to be used for a transient simulation. The inputs are the handle
to the file reader operator and a Python list containing the list of file names.
Reread()
This function is a convenience function for load PAM-FLOW data files. Most PAMFLOW filenames follow a
naming pattern that can be used to easily load the data. The following constants are used:
Options for importMethod
• PAM_IMPORT_AUTO
• PAM_IMPORT_DOMN
• PAM_IMPORT_SURF
• PAM_IMPORT_RIBBON
232
Appendix Scripting
• PAM_IMPORT_HISTORY
Options for formatted
• PAM_ASCII
• PAM_BINARY
The AUTO method will use the filename to choose the type of file import if the files follow the standard
conventions. The formatted input is used to override standard conventions. Domain (domn) files are
assumed to be binary, and all others are assumed to be ASCII. If the importMethod is overridden, the
formatting option should be as well.
Import the nmed STL file into this model. The optional "binary" parameter is True/False indicating a
binary/ASCII file. The optional "byteswap" parameter is True/False indicating byte order if the file is
binary. This option reads unformatted or binary files created in a machine with a different byte order. For
example, DEC and INTEL CPU-based machines have a different byte order than IBM, SGI, HP, SUN, and
Motorola CPU-based machines. You only need to specify this option if you have created your data set on a
machine that has different byte ordering than the one on which you are running CFD-VIEW.
Import the named spray (SPY) file into this model. The optional "binary" parameter is True/False
indicating a binary/ASCII file. The optional "unformatted" parameter is True/False indicating an input file
from FORTRAN. The optional "byteswap" parameter is True/False indicating byte order if the file is
binary. This option reads unformatted or binary files created in a machine with a different byte order. For
example, DEC and INTEL CPU-based machines have a different byte order than IBM, SGI, HP, SUN, and
Motorola CPU-based machines. You only need to specify this option if you have created your data set on a
machine that has different byte ordering than the one on which you are running CFD-VIEW.
SaveAsVOF(input, filename)
This saves a CFD-VIEW object in the VIEW Object Format (VOF). The inputs are the object and the name of
the file in which to save the results. File Formats-View Object Format
SaveAsSTL(object, filename)
This function saves a surface in the STL format (Stereo Lithography). The inputs to the function are the
surface to be saved and the name of the file in which to save the results. File Menu-Save Object
This saves an image of a portion of the 3D Viewer to a file. It has been updated for the v2008.2 release to
include the desired size of the resulting image. The inputs are the name of the output file, the image
format, the location of the lower-left corner of the subimage (x,y), the width and height (w,h), and the
desired size. If the desired size is (0,0), which is the default, the image size will be identical to the subarea
specified.
233
CFD-VIEW V2014.0 User Manual
This saves an image of the entire 3D Viewer to a file. It has been updated for v2008.2 to include the
desired size of the resulting image. The inputs are the name of the output file, the image format, and the
desired size. If the desired size is (0,0), which is the default, the image size will be identical to the size of
the 3D Viewer.
This function saves an image of the entire 3D Viewer to a file. The image format of the resulting file is
automatically determined from the file extension. The inputs are the name of the output image file and
the desired size of the image. If the desired size is (0,0), which is the default, the image size will be
identical to the subarea specified. For simplicity, the typical usage would be similar to
SaveImage("testimage.gif”).
SavePlotImage(plot, filename)
This function saves the plotter window to an image file. The inputs are a handle to the plot object and the
name of the output image file. The image format is automatically determined from the file extension.
Purpose
The Model/Scene Manipulation module is used by Python to incorporate the basic scripting for the model features
in CFD-VIEW. The Model/Scene Manipulation module methods are useful for creating and manipulating Model
objects. Examples of the use of some of these functions can be found in the Image SnapShot and Point Probe
sections.
Imported Functions
The following functions are imported from the Model/Scene Manipulation module.
CreateModel()
GetActiveModel()
SetActiveModel(model)
When there are multiple models present in CFD-VIEW, the active model can be selected by clicking on one
of the model's 3D viewers in the GUI. With scripting, this can be selected with this function,
SetActiveModel. The input is a handle previously returned with a function such as GetActiveModel(),
CreateModel(), or similar.
234
Appendix Scripting
OpenModelFile(filename)
OpenModel(filename)
SaveModel(filename, saveAllData=True)
Save the active model to the file name filename. If SaveAll is true, all data from the DTF file will be saved
with the model. SaveAll is an optional input, which defaults to True.
SaveModelWithoutData(filename)
This is a convenience function added to v2008.2 that allows for the simple saving of a model file that does
not include all of the data from the DTF file. This is similar to saving a model file in the GUI and un-
checking the Save All Data flag.
Quit()
CloseModel()
Deletes the contents of the model and closes the model, (without asking permission). Returns True on
success.
ClearUndo()
Clears the Undo/Redo list in the currently active model. This is useful for freeing the memory used by the
undo system, but operations to that point are no longer "undoable". Returns True on success.
Reflow()
ForceUpdate()
GetAllObjects()
This function returns a list of all of the objects in the active model. It is returned as a Python list.
GetAllDataObjects()
This function returns a list of all of the data objects, (volumes, surfaces, etc.) in the active model. It is
returned as a Python list.
235
CFD-VIEW V2014.0 User Manual
GetAllVolumes()
Returns a list containing references to all of the volumes in the active model.
GetAllSurfaces()
Returns a list containing references to all of the surfaces in the active model.
GetAllLines()
Returns a list containing references to all of the lines in the active model.
GetAllPoints()
Returns a list containing references to all of the points in the active model.
GetAllAnnotation()
This function returns a list of all of the annotation objects, (labels, axes, etc.) in the active model. It is
returned as a Python list.
DeleteAll()
This function deletes all objects in the active model, and is another form of the DeleteAllObjects()
function. The new function name has been added for naming consistency.
DeleteAllObjects()
Deletes all objects in the active model (without destroying the model itself).
Delete(objects)
This function deletes the object(s) in the input list. The input is a handle to an existing object in the active
model, or it is a list of objects.
Select(objects)
This function selects the object(s) in the input list. The input is a handle to an existing object in the active
model, or it is a list of objects.
Deselect(objects)
This function de-selects the object(s) in the input list. The input is a handle to an existing object in the
active model, or it is a list of objects.
GetSelection()
This function returns a list of all of the selected object(s) in the active model. The list is returned as a
Python list.
236
Appendix Scripting
Group(inputs)
Groups the input objects and returns a pointer to the new group object. Please see the section on
grouping for more information.
UnGroup(inputs)
Ungroups the input objects. Please see the section on grouping for more information.
SetAnimationInitialState()
When setting up an animation in the GUI, you place the model in the desired initial configuration (state),
and press the Register Initial Configuration button. This function serves the same role. This function
would be used after the scripting functions that put the model in the desired initial configuration.
SetAnimationFinalState()
When setting up an animation in the GUI, you place the model in the desired final configuration (state),
and press the Register Initial Configuration button. This function serves the same role. This function
would be used after the scripting functions that put the model in the desired final configuration.
SetNumAnimationFrames(nframes)
SetAnimationCurrentFrame(frame)
This function sets the current frame for an animation. This is typically not used, since the default is simply
the first frame.
Record a GIF animation with the specified parameters and save it to the given filename. The file extension
should be ".gif". Iterations specifies how many times the animation should repeat. Use ITERATIONS_LOOP
to repeat indefinitely.
Record a animation with the specified parameters and store it with MJPEG compression to filename. The
file extension should be ".avi". Valid quality values range from 1 to 31, with 1 being the best qualityThe
framespersecond is limited to 23.976, 24, 25, 29.97, 30, 50, 59.94, or 60.
Record a Windows Media 7 animation with the specified parameters and save it to filename. The file
extension should be ".wmv". Valid quality values range from 1 to 31, with 1 being the best quality; or use
one of the predefined settings: QUALITY_BEST, QUALITY_HIGH, QUALITY_MEDIUM, or QUALITY_LOW.
237
CFD-VIEW V2014.0 User Manual
Record a Windows Media 8 animation with the specified parameters and save it to filename. The file
extension should be ".wmv". Valid quality values range from 1 to 31, with 1 being the best quality. ; or use
one of the predefined settings: QUALITY_BEST, QUALITY_HIGH, QUALITY_MEDIUM, or QUALITY_LOW.
Record a FLASH animation with the specified parameters and save it to filename. The file extension should
be ".flv". Valid quality values range from 1 to 31, with 1 being the best quality; or use one of the
predefined settings: QUALITY_BEST, QUALITY_HIGH, QUALITY_MEDIUM, or QUALITY_LOW.
Record a MPEG4 animation with the specified parameters and save it to filename. The file extension
should be ".flv". Valid quality values range from 1 to 31, with 1 being the best quality; or use one of the
predefined settings: QUALITY_BEST, QUALITY_HIGH, QUALITY_MEDIUM, or QUALITY_LOW.
Record animation and save each frame of the animation to a separate image. The type of file written out
will be automatically detected based on the given extension.
Record a MPEG1 animation with the specified parameters and save it to filename. The file extension
should be ".flv". Valid quality values range from 1 to 31, with 1 being the best quality; or use one of the
predefined settings: QUALITY_BEST, QUALITY_HIGH, QUALITY_MEDIUM, or QUALITY_LOW.
The framespersecond is limited to 23.976, 24, 25, 29.97, 30, 50, 59.94, or 60.
Record a MPEG2 animation with the specified parameters and save it to filename. The file extension
should be ".flv". Valid quality values range from 1 to 31, with 1 being the best quality; or use one of the
predefined settings: QUALITY_BEST, QUALITY_HIGH, QUALITY_MEDIUM, or QUALITY_LOW.
The framespersecond is limited to 23.976, 24, 25, 29.97, 30, 50, 59.94, or 60.
GetEntityByName(name)
GetEntitiesByName(name)
238
Appendix Scripting
GetObjectsByName(name)
This function returns a list of all objects with the given name. The input is a string containing the object
name. This function is a replacement for the function GetEntitiesByName, and has been added for
consistency.
GetObjectsByType(type)
This function returns a list of all objects with the given type. The input is a string containing the object
type. To get a list of all of the interfaces, the input would be "Interface."
GetObjectsByKey(key)
This function returns a list of all objects with the given key. The input is a string containing the object key.
To get a list of all of the objects in zone 3 for example, the input would be "Zone#3”. The keys are shown
in the object explorer.
AssignName(obj, newname)
SetName(obj, newname)
This function renames the object with the input obj handle to the supplied name. It is a replacement for
the previous function AssignName. The function name was changed for consistency with other CFD-VIEW
scripting functions
Mask(maskString)
This function sets the Type Mask of the model to be hidden. The input is a string containing the Type
exactly, (with the Sub-Type concatenated where used), of the objects to be masked. The simplest method
to get the string is to match the string exactly the same as that shown in the Type Mask area of the GUI.
The subtype is used for different types of interfaces. (Older DTF files may not contain a SubType for the
interfaces.)
Unmask(maskString)
This function sets the Type Mask of the model to be shown. The input is a string containing the Type
exactly, (with the Sub-Type concatenated where used), of the objects to be masked. The simplest method
to get the string is to match the string exactly the same as that shown in the Type Mask area of the GUI.
The subtype is used for different types of interfaces. (Older DTF files may not contain a SubType for the
Object/Operator Creation
Purpose
The Object/Operator Creation module is used by Python to incorporate the basic scripting for the line and curve
features in CFD-VIEW. A simple particle trace example can be found in the Particle Trace example.
239
CFD-VIEW V2014.0 User Manual
Imported Functions
The following functions are imported from the Object/Operator Creation module.
CreateILine(inputs)
Create an I-Line object for the specified inputs, where inputs is a list of previously created volume objects.
CreateJLine(inputs)
Create a J-Line object for the specified inputs, where inputs is a list of previously created volume objects.
CreateKLine(inputs)
Create a K-Line object for the specified inputs, where inputs is a list of previously created volume objects.
CreateXSlice(inputs)
Create an X-Slice object for the specified inputs, where inputs is a list of previously created surface
objects.
CreateYSlice(inputs)
Create a Y-Slice object for the specified inputs, where inputs is a list of previously created surface objects.
CreateZSlice(inputs)
Create a Z-Slice object for the specified inputs, where inputs is a list of previously created surface objects.
CreateIsoCurve(inputs)
Create an Iso-valued Curve object for the specified inputs, where inputs is a list of previously created
surface objects.
CreateTrace(inputs)
Create a Particle Trace object for the specified inputs, where inputs is a list of previously created volume
objects.
Create2DTrace(inputs)
Create a 2-D Particle Trace object for the specified inputs, where inputs is a list of previously created
surface objects.
Create2DILine(inputs)
Create a 2-D I-Line object for the specified inputs, where inputs is a list of previously created surface
objects.
Create2DJLine(inputs)
Create a 2-D J-Line object for the specified inputs, where inputs is a list of previously created surface
objects.
240
Appendix Scripting
CreateClone(inputs)
CreateReplicator(inputs)
CreateStripChart(inputs)
Create a Strip Chart object for the specified inputs, where inputs is a list of previously created objects.
CreatePlot(inputs)
Create a Plot object for the specified inputs, where inputs is a list of previously created objects.
CreatePointNet(inputs)
Create a Point Net object for the specified inputs, where inputs is a list of previously created volumes.
Create2DPointNet(inputs)
Create a 2D Point Net object for the specified inputs, where inputs is a list of previously created surfaces.
This is only available for Z-constant 2D surfaces, or for X,Y,Z Cuts.
CreateLineProbe(inputs)
Create a Line Probe object for the specified inputs, where inputs is a list of previously created volume
objects.
CreateProbe(inputs)
Create a Probe object for the specified inputs, where inputs is a list of previously created volume objects.
CreateMinMaxProbe(inputs)
This function creates a MinMax probe which was introduced with the v2008.0 release. The input is a list of
objects in which we wish to find the minimum and maximum values of a given variable. Operator Palette-
Min/Max Probe
Create2DLineProbe(inputs)
Create a 2-D Line Probe object for the specified inputs, where inputs is a list of previously created surface
objects.
Create2DProbe(inputs)
CreateIsoSurf(inputs)
Create an Iso-valued Surface object for the specified inputs, where inputs is a list of previously created
objects.
241
CFD-VIEW V2014.0 User Manual
CreateIPlane(inputs)
Create an I-Plane object for the specified inputs, where inputs is a list of previously created objects.
CreateJPlane(inputs)
Create a J-Plane object for the specified inputs, where inputs is a list of previously created objects.
CreateKPlane(inputs)
Create a K-Plane object for the specified inputs, where inputs is a list of previously created objects.
CreateXCut(inputs)
Create an X-Cut object for the specified inputs, where inputs is a list of previously created objects.
CreateYCut(inputs)
Create a Y-Cut object for the specified inputs, where inputs is a list of previously created objects.
CreateZCut(inputs)
Create a Z-Cut object for the specified inputs, where inputs is a list of previously created objects.
CreateArbitraryCut(inputs)
Create an Arbitrary Cut object for the specified inputs, where inputs is a list of previously created objects.
CreateBorder(inputs)
Create a Border object for the specified inputs, where inputs is a list of previously created volume objects.
CreateSurfaceMerge(inputs)
Create a surface merge object for the specified inputs, where inputs is a list of previously created surface
objects.
CreateSurfaceReduction(inputs)
Create a surface reduction object for the specified inputs, where inputs is a list of previously created
surface objects.
CreateCarpetPlot(inputs)
Create a carpet plot object for the specified inputs, where inputs is a list of previously created surface
objects.
242
Appendix Scripting
Annotation
Purpose
The Annotation module is used by Python to incorporate the basic scripting for the annotation features in CFD-
VIEW. A simple example can be found here.
Imported Functions
CreateOrigin()
CreateLabel(text="")
Create a Label annotation object. If the optional text argument is specified, that string will be used for the
label text.
CreateAxes()
CreateLegend()
CreateLine()
CreateBox()
CreateImageBox(filename="")
Create an Image Box annotation object. If the optional filename argument is specified, the image in that
file will be used for the image box; otherwise, a default image is displayed.
CreateText(text="Text")
Create a Text annotation object. If the optional text argument is specified, that string will be used for the
object text.
CreateOval()
243
CFD-VIEW V2014.0 User Manual
CreateBounds()
CreateTime()
Colormap
Purpose
The Colormap module is used by Python to incorporate the basic scripting for the colormap features in CFD-VIEW.
Imported Functions
GetColormap(colormapname)
This is a new function that greatly simplifies the acquisition of a colormap for the given variable. The
input is a string containing the name of the variable for which the color is mapped. For instance, to get the
colormap for pressure, GetColormap("P”) would be used. If there is no variable by the given name, an
error message results.
This is a new function that greatly simplifies the setting of the range for a colormap. The input is a string
containing the name of the variable for which the color is mapped. For instance, to get the colormap for
pressure, GetColormap("P”) would be used. The other inputs are the minimum and maximum for the
color mapping for that variable.
SetColormapTransparency(colormapname, transparency)
This is a new function that greatly simplifies the setting of transparency for all of the color tabs in a
colormap. The inputs are a string with the name of the variable used for the color mapping, and a
number between 0. and 1.0 indicating the level of transparency. (0. being fully transparent and 1. being
completely opaque.) To make the pressure colormap half transparent, for example, you would use
SetColormapTransparency("P”,.5).
SetColormapRamp(colormapname, ramp)
There are several default colormap avaible for mapping color to a variable. This function is used to select
one of the defaults for the given colormap variable name.
SetLegendColorVariable(legend, variablename)
This is a new function that greatly simplifies the setting of the color variable for a legend.
244
Appendix Scripting
The inputs are a handle to the previously create legend (using CreateLegend()) and a string containing the
name of the variable for which the color is mapped. For instance, to set the legend to reflect the pressure
color mapping, SetLegendColorVariable(legend, "P”) would be used. (This assumes "legend” was the
handle returned from CreateLegend.) This function will create a colormap for that variable if it does not
already exist, and it turns off colormap tracking for that legend.
Vector
Purpose
The Vector module is used by Python to incorporate the basic scripting for the vector features in CFD-VIEW.
Imported Functions
This is used to add a new vector to the list of known vectors in the model. The inputs are the name of the
new vector, followed by the names of the components. For example, to add a new velocity vectors,
AppendKnownVector(“Velocity”, “U”,”V”,”W”) would be used.
This is the same function as AppendKnowVector above, and is used to add a new vector to the list of
known vectors in the model. The inputs are the name of the new vector, followed by the names of the
components. For example, to add a new velocity vectors, AddVector(“Velocity”, “U”,”V”,”W”) would be
used.
RemoveKnownVector(name)
This is the reverse of the previous function. To remove the velocity vector,
RemoveKnownVector(“Velocity”) would be used. This function is not typically needed, but is given here
for completeness.
RemoveVector(name)
This is the same function as RemoveKnowVector above, and is the reverse of the previous
AppendKnownVector function. To remove the velocity vector, RemoveVector(“Velocity”) would be used.
This function is not typically needed, but is given here for completeness.
SetVector(objects, name)
This function sets the vector to be used for the list of given objects. The inputs are the name of the known
vector to be used, (see above), and the list of objects for which the vector will be set.
245
CFD-VIEW V2014.0 User Manual
SetVectorHeadScale(name, scale)
This function sets the scale of the head of the vectors in the display area. The inputs are the name of the
known vector and the scale of the vector. The scale is a number between 0 and 100., which scales the
length of the vector to be between 0 and 10% of the model size. These are the same values used in the
GUI.
SetVectorTailScale(name, scale)
This function sets the scale of the tail of the vectors in the display area. The inputs are the name of the
known vector and the scale of the vector. The scale is a number between 0 and 100., which scales the
length of the vector to be between 0 and 10% of the model size. These are the same values used in the
GUI.
SetVectorMaxMagnitude(name, max)
This function sets the maximum magnitude value for scaling purposes. Vectors with a magnitude equal to
max will be displayed with the maximum defined length (from SetVectorHeadScale and
SetVectorTailScale). The inputs are the name of the known vector and the max value of the magnitude.
This is the same value used in the GUI for the “Maximum” control.
This function limits the display of vectors to those with a magnitude within the range [min,max]. The
inputs are the name of the known vector and the min and max values of the display range. Min and max
are positive numbers (zero included) with min<max. These are the same values used in the GUI for the
“Show From” control.
SetVectorMaxDisplay(name, max)
This function is identical to the SetVectorDisplayRange function, except that it sets the max display limit
only.
SetVectorMinDisplay(name, min)
This function is identical to the SetVectorDisplayRange function, except that it sets the min display limit
only.
Object Appearance
Purpose
The Object Appearance module is used by Python to incorporate the basic scripting for the appearance features in
CFD-VIEW. The Object Appearance module methods are useful for modifying the attribute settings (or material
properties) for a particular object. These methods roughly correspond to the controls found on CFD-VIEW’s
Attributes Settings panel.
246
Appendix Scripting
Imported Functions
The following functions are imported from the Object Appearance module.
SetSurfaceColor(obj, clr)
GetSurfaceColor(obj)
SetGridColor(obj, clr)
GetGridColor(obj)
Returns the color of the grid, if the grid is not colored by one of the simulation variables. The returned
value is a 4 tuple containing (R,G,B,A), where each value is in the range 0 to 255.
SetContourColor(obj, clr)
GetContourColor(obj)
SetOutlineColor(obj, clr)
GetOutlineColor(obj)
Returns the color of the surface outline. The returned value is a 4 tuple containing (R,G,B,A), where each
value is in the range 0 to 255.
SetVectorColor(obj, clr)
GetVectorColor(obj)
Returns the color of the vector display, if the vectors are not colored by value.
SetPointsColor(obj, clr)
GetPointsColor(obj)
Returns the color of the points display, if the points are not colored by value.
247
CFD-VIEW V2014.0 User Manual
SetSpecularColor(obj, clr)
GetSpecularColor(obj)
SetShininess(obj, shininess)
Set the shininess for object. The shininess should be a number between zero and 128.
GetShininess(obj)
Returns the shininess of this data object. The returned value is between 0 and 128. This typically only
applies to surfaces.
Probe
Purpose
The Probe module is used by Python to incorporate the basic scripting for the line and point probe features in CFD-
VIEW. The Probe module methods are useful for creating and manipulating different kinds of probes. An example
of the use of point probes can be found here.
Imported Functions
SetProbePosition(obj, pos)
Sets the position of the probe. The inputs are the pointer to the probe and the position. The position is a
3-tuple providing (x,y,z)
GetProbePosition(trace)
This function returns the position of the point probe. The input is a handle to the probe object.
This sets the position of the ends of a line probe. The inputs are the handle to the line probe, followed by
two 3-tuples containing the endpoints. SetLineProbePosition(probe,[0.,0.,0.],[1.,1.,.1]) is an example of
usage.
248
Appendix Scripting
SetLineProbeCurve(lineprobe, points)
This allows setting a curve for a line probe. The inputs are the handle to the line probe, followed by a list
of 3-tuples containing the points. SetLineProbeCurve(probe,[[0,0,0],[1,0,.0],[1,.5,0],[2,.5,0]]) is an example
of usage. Note that the points are contained in a Python list.
SetLineProbeNumPoints(obj, numpoints)
This function sets the discretization of the line probe, i.e. the number of discrete points along the line
probe. The inputs are a handle to the line probe object and the number of points. This is the same value
used in the GUI.
SetProbeVariable(obj, variable)
This function sets the variable that the point probe is probing. The inputs are a handle to the probe object
and the variable name (string).
GetProbeValue(obj)
This function returns the value of the point probe at the current location. The input is a handle to the
probe object.
SetMinMaxProbeDisplay(probe,mode)
This function sets the mode for the minmax probe. The input is a minmax probe and mode is either
PROBE_DISPLAY_MINIMUM or PROBE_DISPLAY_MAXIMUM.
SetStripChartVariables(probe, variables)
This function sets the variables that the strip chart is probing. The inputs are a handle to the strip chart
object and the list of variable names (strings).
SetPositionMode(obj, mode)
This function sets the position mode, XYZ or IJK, for the probe, trace or strip chart. The inputs are a handle
to the probe object and the position mode (strings “XYZ” or “IJK”).
SetDomain(obj, domain)
This function sets the domain in which the probe, trace or strip chart is located. The inputs are a handle to
the probe object and the domain number (integer). This function is valid only when the probe position
mode is set to IJK.
SetSnap(obj,True/False)
This function turns on or off the snap option for the probe, trace or strip chart. The inputs are a handle to
the probe object and the snap logical value: True turns the snap option on, False turns it off.
249
CFD-VIEW V2014.0 User Manual
SetTimeFromDTF(obj,True/False)
This function sets whether or not the simulation time should be taken from the time info stored in the
DTF file. The inputs are a handle to the probe object and the time logical value: True means time is taken
from the DTF file, False means it is determined by CFD-VIEW (first frame is t = 0s and last frame is t = 1s).
Particle Trace
Purpose
The Particle Trace module is used by Python to incorporate the basic scripting for the particle trace features in
CFD-VIEW.
Imported Functions
The following functions are imported from the Particle Trace module.
SetTracePosition(trace, position)
This function sets the position of the particle trace release point used for the particle tracing. The inputs
are a handle to the particle trace object and a 3-element vector specifying the XYZ position of the release
point.
GetTracePosition(trace)
This function returns the position of the particle trace release point used for the particle tracing. The input
is a handle to the particle trace object.
SetTraceVector(trace, vectorname)
This functions sets the vector used for the particle tracing. The inputs are a handle to the particle trace
object and the name of the vector to be used for tracing. The vector should have been created earlier
with the AddVector() function.
GetTraceVector(trace)
This function returns the name of the vector used for the particle tracing. The input is a handle to the
particle trace object.
This function sets the number of particle trace release points used for the particle tracing rake. The inputs
are a handle to the particle trace object and the number of points in each coordinate direction. The
number must be at least 1 in each direction.
250
Appendix Scripting
GetTraceNumRakePoints(trace)
This function returns the number of particle trace release points used for the particle tracing rake as a 3
element list. The input is a handle to the particle trace object.
This function sets the spacing of particle trace release points used for the particle tracing rake. The inputs
are a handle to the particle trace object and the spacing of points in each coordinate direction. The
number must be at least 1 in each direction.
GetTraceRakeSpacing(trace)
This function returns the spacing of particle trace release points used for the particle tracing rake as a 3
element list. The input is a handle to the particle trace object.
SetTraceDirectionForward(trace, True/False)
This function turns on/off the trace forward integration. The inputs are a handle to the trace object and
the forward logical value: True activates forward integration, False de-activates it.
SetTraceDirectionBackward(trace, True/False)
This function turns on/off the trace backward integration. The inputs are a handle to the trace object and
the backward logical value: True activates backward integration, False de-activates it.
SetTraceStepSize(trace, size)
This function sets the trace (initial) integration step size. The inputs are a handle to the trace object and
the step size.
SetTraceLimitStep(trace, numsteps)
This function sets the trace maximum number of integration steps. The inputs are a handle to the trace
object and the number of steps.
SetTraceLimitTime(trace, time)
This function sets the maximum integration time. The inputs are a handle to the trace object and the
time.
SetTraceEveryOther(trace, steps)
This function sets the trace drawing interval (draw every N steps). The inputs are a handle to the trace
object and the number of steps.
251
CFD-VIEW V2014.0 User Manual
Modify Annotation
Purpose
The Modify Annotation module is used by Python to incorporate the basic scripting for modifying the annotation
features in CFD-VIEW.
Imported Functions
The following functions are imported from the Modify Annotation module..
SetPosition(obj, x, y)
Sets the position of an annotation object, where x and y specify the upper left corner, and are given in
screen coordinates.
GetPosition(obj)
SetSize(object, w, h)
Sets the width and height of an annotation object, where w and h are given in screen coordinates.
GetSize(obj)
SetFontStyle(obj, fontStyle)
Sets the font for an annotation object, where fontStyle is one of FONT_STYLE_TIMES,
FONT_STYLE_FUTURA, FONT_STYLE_GREEK, FONT_STYLE_MATH or FONT_STYLE_SCRIPT.
SetFillColor(obj, clr)
GetFillColor(obj)
Returns the color of the filled interior of the box. The returned value is a 4 tuple containing (R,G,B,A),
where each value is in the range 0 to 255.
SetShadow(object, shadowOn)
Show or hide the shadow for an annotation object, where shadowOn is either 0 or 1.
SetShadowColor(obj, clr)
252
Appendix Scripting
SetEdge(obj, edge)
Show or hide the edge for an annotation object, where edgeOn is either 0 or 1.
SetEdgeColor(obj, edgeColor)
SetEdgeWidth(obj, edgeWidth)
SetLineStartPoint(obj, x, y)
GetLineStartPoint(obj)
SetLineEndPoint(obj, x, y)
GetLineEndPoint(obj)
SetLineWidth(object, lineWidth)
Set the line width for a Line object, where lineWidth is given in pixels.
GetLineWidth(obj)
Returns the width of the lines used. A width of 1 indicates a 1 pixel thick line.
SetLineArrowStyle(obj, arrowStyle)
Set the arrow style for a Line object to one of ARROW_STYLE_NONE, ARROW_STYLE_BEGIN,
ARROW_STYLE_END or ARROW_STYLE_BOTH.
GetLineArrowStyle(obj)
SetLineArrowBaseSize(obj, arrowBaseSize)
GetLineArrowBaseSize(obj)
253
CFD-VIEW V2014.0 User Manual
SetLineArrowHeadSize(obj, arrowHeadSize)
GetLineArrowHeadSize(obj)
SetLineColor(obj, clr)
GetLineColor(obj)
Returns the color of this curve. The return value is a 4-tuple representing (R,G,B,A), where each of the
components is in the range of 0 to 255.
SetText(obj, text)
SetLabelFontSize(obj, fontSize)
SetLabelFontWeight(obj, fontWeight)
SetLabelColor(obj, fontColor)
SetLabelFontOrientation(obj, fontOrientation)
SetImageFile(obj, filename)
RotateImage(obj, rotation)
Rotate an Image Box object by some amount, where amount is one of IMAGE_ROTATE_0,
IMAGE_ROTATE_90, IMAGE_ROTATE_180 or IMAGE_ROTATE_270.
254
Appendix Scripting
3D Viewer
3D Viewer Module
The 3D Viewer module is used by Python to incorporate the basic scripting for the 3D viewing features in CFD-
VIEW. The 3D Viewer module methods are useful for modifying the properties of the active viewer window.
Imported Functions
The following functions are imported from the 3D Viewer module..
GetActiveViewer()
CreateViewer()
This function creates a new 3D Viewer on the active model. The returned value is a handle to this new
currently active viewer. To create a new viewer on another model, that model should be made active first,
and then use this function.
SetActiveViewer(viewer)
In a model with multiple 3DViewers, the active viewer can be selected by clicking on the viewer in the
GUI. In scripting, the active viewer can be selected with this function, SetActiveViewer. The input is a
handle to a previous created viewer that was returned by a function such as GetActiveViewer,
CreateViewer, or similar.
SetView(presetView)
Set the view to one of the six predefined views, one of VIEW_FRONT, VIEW_BACK, VIEW_LEFT,
VIEW_RIGHT, VIEW_TOP or VIEW_BOTTOM.
FitView()
ResetView()
Reset view.
SetViewerSize(width, height)
This function un-maximizes the 3D Viewer window, and sets the size of the content to be the input width
and height. The size of the floating sub-window in the MDI area of VIEW will automatically be adjusted.
GetViewerSize()
This function returns the size of the active 3D Viewer. The return is a 2-tuple containing the width and
height.
255
CFD-VIEW V2014.0 User Manual
TileHorizontal()
This function tiles the 3D Viewers horizontally in the multi-document area. It is the scripting equivalent of
Window -> Tile Horizontally menu item in the GUI.
TileVertical()
This function tiles the 3D Viewers vertically in the multi-document area. It is the scripting equivalent of
Window -> Tile Vertically menu item in the GUI.
This function sets the nonuniform scaling used in the 3D Viewer window. A scale of 1 indicates not
stretching or shrinking. To double the scale in only the X-direction, you would pass in (2,1,1) for the
scaling values.
GetViewerScale()
This function returns the nonuniform scaling used in the 3D Viewer window. A scale of 1 indicates not
stretching or shrinking. The scales for the X, Y, and Z. are returned as a 3-tuple
SetProjection(projection)
Set the projection type for this viewer, one of PROJECTION_ORTHOGONAL or PROJECTION_PERSPECTIVE.
SetPerspective()
SetOrthogonal()
SetParallel()
This function sets the 3D Viewer to parallel (orthogonal) projection mode. It is simply an alternative form
of SetOrthogonal() shown above.
SetTurboMode(turbomode=True)
This function turns the turbo mode of the 3D Viewer on or off. The input is True to turn it on, and False to
turn it off. If neither input is given, calling the function will turn turbo mode on.
SetDithering(dithering=True)
This function turns the dithering mode of the 3D Viewer on or off. The input is True to turn it on, and False
to turn it off. If neither input is given, calling the function will turn dithering mode on. This is rarely used
for modern graphics cards.
SetFog(fog=True)
This function turns the fog setting of the 3D Viewer on or off. The input is True to turn it on, and False to
turn it off. If neither input is given, calling the function will turn fog on.
256
Appendix Scripting
SetAntiAliasing(antialiasing=True)
This function turns the antialias setting of the 3D Viewer on or off. The input is True to turn it on, and
False to turn it off. If neither input is given, calling the function will turn antialias on. For modern graphics
cards, this is often no longer needed.
This function allows setting the roll, pitch, and yaw in one function call. It is equivalent to calling
SetRoll(roll) then SetPitch(pitch) then SetYaw(yaw).
GetOrientation()
This function allows retrieving the roll, pitch, and yaw angles in one function call. It is equivalent to calling
GetRoll(), GetPitch(), and GetYaw() together.
Roll(degrees)
SetRoll(degrees)
Rotate the model about its X-axis by the given number of degrees. This function is equivalent to the Roll
function from previous versions of CFD-VIEW.
GetRoll()
This function returns the rotation about the X-axis in degrees. It is the companion function to SetRoll.
Pitch(degrees)
SetPitch(degrees)
Rotate the model about its Y-axis by the given number of degrees. This function is equivalent to the Pitch
function from previous versions of CFD-VIEW.
GetPitch()
This function returns the rotation about the Y-axis in degrees. It is the companion function to SetPitch.
Yaw(degrees)
SetYaw(degrees)
Rotate the model about its Z-axis by the given number of degrees. This function is equivalent to the Yaw
function from previous versions of CFD-VIEW.
257
CFD-VIEW V2014.0 User Manual
GetYaw()
This function returns the rotation about the Z-axis in degrees. It is the companion function to SetYaw.
TranslateView(dx, dy)
Translate the view by some amount (dx, dy), where dx and dy are measured in world units.
TranslateViewByPixels(dx,dy)
Translate the view by amount (dx, dy), where dx and dy are measured in pixels.
SetViewpoint(x, y, z)
Set the viewpoint to (x, y, z), where x, y and z are measured in world units.
GetViewpoint()
This function returns the location of the viewpoint of the active 3D viewer. It is the companion function to
SetViewpoint(x,y,z), and is the point at which the viewer is looking.
SetFieldOfView(fov)
GetFieldOfView()
This function returns the field of view of the active 3D viewer. It is the companion function to
SetFieldOfView(fov).
ZoomIn()
ZoomOut()
SetZoom(z)
Change zoom level of the viewer. A zoom level of 1 brings back the default zoom level.
SetBackgroundGradient(backgroundGradient)
Turn background gradient on or off. Inputs are the pointer to the viewer, (usually obtained from
getActiveViewer), and True or False for the gradient mode.
SetBackgroundGradientColors(,bottomLeft,bottomRight,topLeft,topRight)
Set colors for background gradient. Inputs are the pointer to the viewer, (usually obtained from
getActiveViewer), and colors at the four corners. Each of the colors is a 4-tuple consisting of red, green,
blue, and alpha. The color values range from 0 to 255.
258
Appendix Scripting
Purpose
The Data Object Display module is used by Python to incorporate the basic scripting for the object appearance
features in CFD-VIEW. The Data Object Display module methods are useful for setting the different visualization
properties of a CFD-VIEW object. Examples of the use of some of these functions can be found in the Cutting
example and the Iso Surface example.
Imported Functions
The following functions are imported from the Data Object Display module.
SetColorAttribute(obj, variableName)
Set the variable that provides the color for this object (a.k.a. the primary variable), where variable is a
string like "P” or "T”.
SetSurfaceRendering(obj, rendering)
Sets the surface rendering mode for this object, where rendering is one of SURFACE_RENDERING_OFF,
SURFACE_RENDERING_SURFACE, SURFACE_RENDERING_COLORED, SURFACE_RENDERING_SMOOTH or
SURFACE_RENDERING_FLOODED.
SetLineRendering(line, rendering)
Sets the line display mode for this line object, where displayMode is one of LINE_RENDERING_OFF,
LINE_RENDERING_LINES, LINE_RENDERING_STREAMTUBES or LINE_RENDERING_STREAMRIBBONS.
SetNoSurface(objects)
This function turns off all of the surface drawing attributes for the supplied list of surfaces.
SetSolidSurface(objects)
This function sets the surface drawing attributes for the supplied list of surfaces to solid.
SetColoredSurface(objects)
This function sets the surface drawing attributes for the supplied list of surfaces to colored.
SetColormapSurface(objects)
This function sets the surface drawing attributes for the supplied list of surfaces to color mapped
(textured).
259
CFD-VIEW V2014.0 User Manual
SetFloodedSurface(objects)
This function sets the surface drawing attributes for the supplied list of surfaces to flooded.
SetFlatShading(objects)
This function sets the shading attributes for the supplied list of objects to un-lit (There is no directional
lighting). See Surface Display Modes. It is similar to SetFlatSurface, but applies to all objects.
SetFacetedShading(objects)
This function sets the shading attributes for the supplied list of object to faceted (Each face of the surface
has a constant normal). See Surface Display Modes. It is similar to SetFacetedSurface, but applies to all
objects.
SetSmoothShading(objects)
This function sets the shading attributes for the supplied list of objects to smooth (The surface uses vertex
normals, which are interpolated across each face.). See Surface Display Modes. It is similar to
SetSmoothSurface, but applies to all objects.
SetSurfaceShading(obj, shading)
Set the surface shading for this object, where shading is one of SURFACE_SHADING_OFF,
SURFACE_SHADING_FLAT or SURFACE_SHADING_SMOOTH.
SetFlatSurface(obj)
This function sets the shading attributes for the supplied list of objects to un-lit (There is no directional
lighting). See Surface Display Modes. It is similar to SetFlatSurface, but applies to all objects.
SetFacetedSurface(obj)
This function sets the shading attributes for the supplied list of object to faceted (Each face of the surface
has a constant normal). See Surface Display Modes. It is similar to SetFacetedSurface, but applies to all
objects.
SetSmoothSurface(obj)
This function sets the shading attributes for the supplied list of objects to smooth (The surface uses vertex
normals, which are interpolated across each face.). See Surface Display Modes. It is similar to
SetSmoothSurface, but applies to all objects.
SetVisible(obj, visible)
SetVisibleOn(obj)
260
Appendix Scripting
SetVisibleOff(obj)
SetHandles(obj, showhandles)
Enable or disable the display of handles for this object, where visible is either 0 or 1.
SetHandleDisplayOn(obj)
Turns on the display of handles for all objects in the input list.
SetHandleDisplayOff(obj)
Turns off the display of handles for all objects in the input list.
SetOutline(obj, showoutline)
Enable or disable the outline display for this object, where visible is either 0 or 1.
SetOutlineDisplayOn(obj)
Turns on the display of outlines for all objects in the input list.
SetOutlineDisplayOff(obj)
Turns off the display of outlines for all objects in the input list.
SetPoints(obj, showpoints)
Enable or disable the display of points for this object, where visible is either 0 or 1.
SetPointDisplayOn(obj)
Turns on the display of nodes (points) for all objects in the input list.
SetPointDisplayOff(obj)
Turns off the display of nodes (points) for all objects in the input list.
SetGrid(obj, showgrid)
Enable or disable the display of grid lines for this object, where visible is either 0 or 1.
SetGridDisplayOn(obj)
Turns on the display of grids for all objects in the input list.
SetGridDisplayOff(obj)
Turns off the display of grids for all objects in the input list.
261
CFD-VIEW V2014.0 User Manual
SetContours(obj, showcontours)
Enable or disable the display of contours for this object, where visible is either 0 or 1.
SetContourDisplayOn(obj)
Turns on the display of contours for all objects in the input list.
SetContourDisplayOff(obj)
Turns off the display of contours for all objects in the input list.
SetVectors(obj, showvectors)
Enable or disable the display of vectors for this object, where visible is either 0 or 1.
SetVectorDisplayOn(obj)
Turns on the display of vectors for all objects in the input list.
SetVectorDisplayOff(obj)
Turns off the display of vectors for all objects in the input list.
SetVectorUniformHeadsOn(objects)
Turns on uniform vector heads setting for all objects in the input list.
SetVectorUniformHeadsOff(objects)
Turns off uniform vector heads setting for all objects in the input list.
SetVectorUniformTailsOn(objects)
Turns on uniform vector tails setting for all objects in the input list.
SetVectorUniformTailsOff(objects)
Turns off uniform vector tails setting for all objects in the input list.
SetVectorProjectionOn(objects)
SetVectorProjectionOff(objects)
Turns off projected vectors for all objects in the input list.
SetHiddenLines(obj, showhiddenlines)
Enable or disable the display of hidden lines for this object, where visible is either 0 or 1.
262
Appendix Scripting
SetHiddenLineDisplayOn(obj)
Sets the hidden line display mode of all objects in the input list to On.
SetHiddenLineDisplayOff(obj)
Sets the hidden line display mode of all objects in the input list to Off.
SetSimpleTransparency(obj, transparent)
Sets the simple transparency mode of the input list of objects (surfaces) to the given setting. If the input
transparency is set to True, the simple transparency is set to On.
SetSimpleTransparencyOn(obj)
SetSimpleTransparencyOff(obj)
SetPointSize(obj, pointSize)
GetPointSize(obj)
Returns the size of displayed points, if the points are not sized by an attribute, such as pressure.
SetPointShape(obj, shape)
GetPointShape(obj)
Return point shape for the given object. (one of POINT_SHAPE_POINTS, POINT_SHAPE_CUBES or
POINT_SHAPE_BALLS).
SetMinPointSize(obj, minPointSize)
GetMinPointSize(obj)
SetMaxPointSize(object, size)
263
CFD-VIEW V2014.0 User Manual
GetMaxPointSize(obj)
Calculator
Purpose
The Calculator module is used by Python to incorporate the basic scripting for the calculator features in CFD-VIEW.
Imported Functions
The following functions are imported from the Calculator module.
SetExpression(obj, expression)
Sets the calculator expression for the given list of objects. The input expression is a string.
GetExpression(obj)
GetExpressionResult(obj)
Get the result of the calculator evaluation for the given object. The result depends on the type of
expression. If the result is a single float, it will be returned as such. If the result is an array, it will be
returned as a Python list. The list is the size also of the operation. For nodal operations, the list will be the
same length as the number of nodes. For elemental calculations, the length will be the number of
elements (faces or cells).
Purpose
The Data Object Access module is used by Python to incorporate the basic scripting for the data object access
features in CFD-VIEW.
Imported Functions
The following functions are imported from the Data Object Access module.
264
Appendix Scripting
GetNodalData(obj, varname)
This function returns an array (Python List) of the nodal data corresponding to the variable name
argument. The inputs to the function are a handle to the data object (a single object) and a string
containing the variable name of the data of interest.
This function returns the nodal data at a single node corresponding to the variable name argument. The
inputs to the function are a handle to the data object (a single object), the variable name string of the
data of interest, and the index of the node from which the data is being return. (The node indices are 0-
based numbers.)
This function replaces the nodal data of all of the nodes for a given variable with the given array. The
arguments to the function are a handle to the data object, the new data array, and the string containing
the variable name. The length of the data array must match the number of nodes or an error occurs. Also,
the data named must already exists in the data object.
The function sets the value of a nodal data variable at a single node. The arguments to the function are a
handle to the data object, the new value, the variable name string, and the node at which the data is
being changed.
This function creates nodal data for a new variable. The arguments to the function are a handle to the
data object, the new data array (Python List), the variable name of the new data, and an optional units
string. The length of the data array must match the number of nodes in the data object. Also, new data is
created, so the variable name must not already exist in the object. Otherwise, the ReplaceNodalData
function should be used.
GetCellData(obj, varname)
This function returns an array (Python List) of the cell data corresponding to the variable name argument.
The inputs to the function are a handle to the data object (a single object) and a string containing the
variable name of the data of interest.
This function returns the cell data at a single cell corresponding to the variable name argument. The
inputs to the function are a handle to the data object (a single object), the variable name string of the
data of interest, and the index of the cell from which the data is being returned. (The cell indices start at
0, and do not necessarily correspond to the "Cell Index" variable in CFD-VIEW).
This function replaces the cell data of all of the cells for a given existing variable with the given array. The
arguments to the function are a handle to the data object (a single object), the new data array, and the
string containing the variable name. The length of the data array must match the number of cells or an
error occurs. Also, the variable name, varname, must already exist in the data object.
265
CFD-VIEW V2014.0 User Manual
This function sets the value of a cell data at a single cell for an existing variable. The arguments to the
function are a handle to the data object (a single object), the new value, the variable name string, and the
cell at which the data is being changed.
This function creates cell data for a new variable. The arguments to the function are a handle to the data
object (a single object), the new data array (Python List), the variable name of the new data, and an
optional units string. The length of the data array must match the number of cells in the data object. Also,
new data is created, so the variable name must not already exist in the object. Otherwise, the
ReplaceCellData function should be used.
Operator
Purpose
The Operator module is used by Python to incorporate the basic scripting for the operator features in CFD-VIEW.
Imported Functions
The following functions are imported from the Operator module.
GetOperator(obj)
In the Data Flow architecture, there are operators and objects. An operator takes a list of input objects,
performs some action, and returns an output object(s). For example, when creating an isosurface, a
volume is used as input to an isosurface operator, which creates a surface as output. This function returns
the operator that created the object given to the function.
GetInputs(operator)
In the Data Flow architecture, there are operators and objects. An operator takes a list of input objects,
performs some action, and returns an output object(s). For example, when creating an isosurface, a
volume is used as input to an isosurface operator, which creates a surface as output. This function returns
the list of input objects for the given operator.
SetValue(obj, objectValue)
Sets the value for this object, where value is a floating point number (e.g. the value to be used for an iso-
valued surface).
SetIJKValue(obj, pos)
Sets the IJK position for this I/J/K-Line object. The inputs are a handle to the I/J/K-line object and the
position provided as a tuple [I,J], [J,K] or [I,K].
266
Appendix Scripting
SetIsoVariable(obj, variable)
Sets the iso-variable for a surface. The inputs are the pointer to the surface and a string containing the
variable name.
This function appends a new clipping variable to polygon based cutting operations such as isosurfaces, X-
Cuts, etc. The input is a cutting plane, for example, followed by the clipping variable, the highlow clipping
setting, and the value of the clipping. The highlow setting is 1 for upper, and -1 for lower.
AppendClipping(surf,”X”,1,2.5), for example, would limit the upper value of "X” to 2.5 for the cutting
plane named "surf”.
This function appends a new upper clipping variable to polygon based cutting operations such as
isosurfaces, X-Cuts, etc. The input is a cutting plane, for example, followed by the clipping variable,and the
value of the clipping. AppendUpperClipping(surf,”X”,2.5), for example, would limit the upper value of "X”
to 2.5 for the cutting plane named "surf”.
This function appends a new lower clipping variable to polygon based cutting operations such as
isosurfaces, X-Cuts, etc. The input is a cutting plane, for example, followed by the clipping variable,and the
value of the clipping. AppendLowerClipping(surf,”X”,2.5), for example, would limit the lower value of "X”
to 2.5 for the cutting plane named "surf”.
Arb Cut
Purpose
The Arb Cut module is used by Python to incorporate the basic scripting for the arbitrary cutting plane features in
CFD-VIEW.
Imported Functions
The following functions are imported from the Arb Cut module.
SetRotationPoint(obj, point)
Sets the rotation point for an Arbitrary Cutting Plane. The inputs are the arbcut, followed by a 3-tuple
specifiying the rotation point.
SetSurfaceNormal(obj, normal)
Sets the surface normal (plane direction) for an Arbitrary Cutting Plane. The inputs are the arbcut,
followed by a 3-tuple specifiying the surface vector.
267
CFD-VIEW V2014.0 User Manual
RotateAlpha(obj, angle)
Sets the alpha rotation for an Arbitrary Cutting Plane. The inputs are the arbcut, followed by the angle in
degrees.
RotateBeta(obj, angle)
Sets the beta rotation for an Arbitrary Cutting Plane. The inputs are the arbcut, followed by the angle in
degrees.
SetTheta(obj, angle)
Sets the Theta rotation for an Arbitrary Cutting Plane. The inputs are the arbcut, followed by the angle in
degrees.
GetTheta(obj)
Gets the alpha rotation for an Arbitrary Cutting Plane. The input is the arbcut.
SetPhi(obj, angle)
Sets the Phi rotation for an Arbitrary Cutting Plane. The inputs are the arbcut, followed by the angle in
degrees.
GetPhi(obj)
Gets the Phi rotation for an Arbitrary Cutting Plane. The input is the arbcut.
Carpet Plot
Purpose
The Carpet Plot module is used by Python to incorporate the basic scripting for the carpet plot features in CFD-
VIEW.
Imported Functions
The following functions are imported from the Carpet Plot module.
SetCarpetZVariable(obj, zvar)
Set the variable used for the elevation variable for the carpet plot. The inputs are the carpet plot followed
by the variable to be used (string).
GetCarpetZVariable(obj)
Returns the variable used as the elevation variable. The input is the carpet plot.
268
Appendix Scripting
SetCarpetColorVariable(obj, cvar)
Set the variable used for the coloring the carpet plot. The inputs are the carpet plot followed by the
variable to be used (string).
GetCarpetColorVariable(obj)
Returns the variable used as the color variable. The input is the carpet plot.
Replicator
Purpose
The Replicator module is used by Python to incorporate the basic scripting for the replicator features in CFD-VIEW.
Imported Functions
The following functions are imported from the Replicator module.
SetReplicatorSymmetry(obj, mode)
Sets the symmetry mode for the replicator operation. The inputs are a handle to the replicator object,
followed by the symmetry mode. The possible symmetry settings are: SYM_NONE, SYM_PLANAR,
SYM_ROTATIONAL, SYM_TRANSLATE, SYM_XFLIPROT, SYM_YFLIPROT, SYM_ZFLIPROT, SYM_XYFLIPROT,
SYM_XZFLIPROT, SYM_YZFLIPROT, SYM_XYZFLIPROT, SYM_X_AXIS, SYM_Y_AXIS, SYM_Z_AXIS,
SYM_CUSTOM_AXIS.
GetReplicatorSymmetry(obj)
Gets the symmetry mode for the replicator operation. The input is the handle to the replicator object, and
the return value is the symmetry mode. The possible symmetry settings are: SYM_NONE, SYM_PLANAR,
SYM_ROTATIONAL, SYM_TRANSLATE, SYM_XFLIPROT, SYM_YFLIPROT, SYM_ZFLIPROT, SYM_XYFLIPROT,
SYM_XZFLIPROT, SYM_YZFLIPROT, SYM_XYZFLIPROT, SYM_X_AXIS, SYM_Y_AXIS, SYM_Z_AXIS,
SYM_CUSTOM_AXIS.
SetReplicatorAxis(obj, axis)
For the Custom axis mode, the axis needs to be set with this function. The inputs are a handle to the
replicator object, followed by the axis, which is specified by a Python 3-tuple or list.
GetReplicatorAxis(obj)
For the Custom axis mode, the axis can be obtained with this function. The input is a handle to the
replicatorr object. The return value is the axis, which is returned as a Python 3-tuple or list.
269
CFD-VIEW V2014.0 User Manual
SetReplicatorSymmetryLo(obj, lo)
For replicator symmetry, several instances of the original object are created depending on the mode. This
function specifies the starting value for the replication. The inputs are a handle to the replicator object,
followed by the replication starting value.
GetReplicatorSymmetryLo(obj)
For replicator symmetry, several instances of the original object are created depending on the mode. This
function returns the starting value for the replication. The input is a handle to the replicator object, and
the return value is the replication starting value.
SetReplicatorSymmetryHi(obj, hi)
For replicator symmetry, several instances of the original object are created depending on the mode. This
function specifies the ending value for the replication. The inputs are a handle to the replicator object,
followed by the replication ending value.
GetReplicatorSymmetryHi(obj)
For replicator symmetry, several instances of the original object are created depending on the mode. This
function returns the ending value for the replication. The input is a handle to the replicator object, and
the return value is the replication starting value.
SetReplicatorAngle(objects,angle)
Sets the angle between the copies for replicator operation. For example, if there are 4 quadrants in a
symmetry display, the angle would be 90 degrees. In the TRANSLATE mode, the angle is a distance
between copies instead. The inputs are a handle to the replicator objects followed by the desired angle
GetReplicatorAngle(object)
Returns the angle between the copies for the replicator operation. The input is a handle to the replicator
object.
SetReplicatorSectors(objects, sectors)
Sets the number of copies (named “sectors” in the GUI) for the replicator operation. For example, if you
input 4 in the case of a rotation along an axis, then 4 copies separated by an angle of 90 degrees will be
created. This function does not work in the MIRROR and TRANSLATE modes. The inputs are a handle to
the replicator objects followed by the desired number of sectors (copies). This is the same value used in
the GUI for the “pie sectors” input.
SetReplicatorTransform(object, True/False)
Tells the replicator operator if the vectors direction should follow the transformation or remain identical
to the direction on the original object. . The inputs are a handle to the replicator objects and the
transform logical value: True means the vectors will be transformed, False means the vectors will keep
their original direction.
270
Appendix Scripting
CreateReplicator(input,mode=SYM_NONE,axis=[1.0,0.0,0.0],lo=0,hi=0,amount=180.0,trans
form=True)
CreateReplicators(inputs,mode=SYM_NONE,axis=[1.0,0.0,0.0],lo=0,hi=0,amount=180.0,tra
nsform=True)
Creates a replicator for each of the given input(s). Returns a list of created replicators.
• mode is the desired symmetry mode. The following modes are available:
• SYM_NONE
• SYM_PLANAR
• SYM_ROTATIONAL
• SYM_TRANSLATE
• SYM_XFLIPROT
• SYM_YFLIPROT
• SYM_ZFLIPROT
• SYM_XYFLIPROT
• SYM_XZFLIPROT
• SYM_YZFLIPROT
• SYM_XYZFLIPROT
• axis is the Python 3-tuple or list specifying the desired axis.
• lo, hi - Several instances of the original object are created depending on the mode. lo and hi set the
starting and ending value of the replication
• amount - Sets the angle between the copies in the symmetry display for the given inputs. For example, if
there are 4 quadrants in a symmetry display, the angle would be 90 degrees. In the TRANSLATE mode, the
amount is a distance between copies instead.
Point Net
Purpose
The Point Net module is used by Python to incorporate the basic scripting for the point net features in CFD-VIEW.
Imported Functions
The following functions are imported from the Point Net module.
271
CFD-VIEW V2014.0 User Manual
Set the number of points in each of the coordinate directions for a Point Net object. This is valid for both
2D and 3D point nets. The nz argument is optional, and is assumed to be 1 if not supplied.
Plotter
Purpose
The Plotter module is used by Python to incorporate the basic scripting for the plotter features in CFD-VIEW.
Imported Functions
The following functions are imported from the Plotter module.
SetXAxis(obj, axis)
This function sets the variable to be used for the X axis of a plotter. The inputs are a handle to the plotter
object, followed by name of the X axis variable (a string).
SetYAxes(obj, axes)
This function sets the variables to be used for the Y axes of a plotter. The inputs are a handle to the
plotter object, followed by a list of names of the Y axes variables (strings). The plotter can have multiple
curves, and these are the variables to be used.
If multiple curves are specified for a plotter, the curves can share the same Y Scale, or can have a separate
scale for each curve. This function set whether to have a shared scale or multiple scales. The inputs are a
handle to the plotter object, followed by a True or False to indicate the use of a shared Y scale. There are
two convenience functions below, SetSameYScaleOn and SetSameYScaleOff, which are simpler versions of
this function.
SetSameYScaleOn(obj)
This is a convenience function to quickly set the use of a shared Y axis. If multiple curves are specified for
a plotter, the curves can share the same Y Scale, or can have a separate scale for each curve. This function
sets the plotter to use a shared scale. The input is a handle to the plot object.
SetSameYScaleOff(obj)
This is a convenience function to quickly set the use of multiple Y axes. If multiple curves are specified for
a plotter, the curves can share the same Y Scale, or can have a separate scale for each curve. This function
sets the plotter to use multiple scales. The input is a handle to the plot object.
272
Appendix Scripting
The plot can be contained in a separate window, or can be embedding in the 3D Viewer window. This
function sets the location to be used. The inputs are a handle to the plot object, followed by the location.
There are two convenience functions, SetPlotLocationInternal ad SetPlotLocationExternal, which are
simpler versions of this function.
SetPlotLocationInternal(obj, True/False)
This function sets on or off the display of the plotter inside the 3D Viewer window. The input is a handle
to the plot object and the display logical value: True means the plotter will be displayed inside the 3D
Viewer, False means it will not. The logical value is optional; if omitted, the True value is used.
SetPlotLocationExternal(obj, True/False)
This function sets on or off the display of the plotter in a separate window. The input is a handle to the
plot object and the display logical value: True means the plotter will be displayed in a separate window,
False means it will not. The logical value is optional; if omitted, the True value is used..
SetPlotLocationBoth(obj)
This function sets the locations of the plotter window to be both inside the 3D Viewer and in a separate,
external window. The input is a handle to the plot object.
This function sets the color of one of the individual graphs in a plot. The inputs are a handle to the plot
object, followed by the 0- based index of the graph, and the color. For convenience, there is a simplified
list of colors, (BLACK,WHITE,RED,GREEN,BLUE,CYAN,MAGENTA, and YELLOW). The color can also be
specified as a 4-tuple or list containing the color components ranging from 0 to 255, ([R,G,B,A])
This function sets the line style for the individual graphs in a plot. The inputs are a handle to the plot
object, followed by the 0-based index of the graph, and the style. For convenience, there is a simplified list
of styles, (SOLID, DOTTED, SHORTDASHED, LONGDASHED, and DOTDASHED).
Symmetry
Purpose
The Symmetry module is used by Python to incorporate the basic scripting for the symmetry features in CFD-VIEW.
Imported Functions
The following functions are imported from the Symmetry module.
273
CFD-VIEW V2014.0 User Manual
SetSymmetry(obj, mode)
Sets the symmetry mode for the input data object. The inputs are a handle to the data object, followed by
the symmetry mode. The possible symmetry settings are: SYM_NONE, SYM_PLANAR, SYM_ROTATIONAL,
SYM_TRANSLATE, SYM_XFLIPROT, SYM_YFLIPROT, SYM_ZFLIPROT, SYM_XYFLIPROT, SYM_XZFLIPROT,
SYM_YZFLIPROT, SYM_XYZFLIPROT.
GetSymmetry(obj)
Gets the symmetry mode for the data object. The input is the handle to the data object, and the return
value is the symmetry mode. The possible symmetry settings are: SYM_NONE, SYM_PLANAR,
SYM_ROTATIONAL, SYM_TRANSLATE, SYM_XFLIPROT, SYM_YFLIPROT, SYM_ZFLIPROT, SYM_XYFLIPROT,
SYM_XZFLIPROT, SYM_YZFLIPROT, SYM_XYZFLIPROT, SYM_X_AXIS, SYM_Y_AXIS, SYM_Z_AXIS,
SYM_CUSTOM_AXIS.
SetSymmetryAxisMode(obj, mode)
Sets the axis mode for the data object symmetry. The axis can be X,Y,Z, or custom. The inputs are a handle
to the data object, followed by the axis mode. The possible axis mode settings are: SYM_X_AXIS,
SYM_Y_AXIS, SYM_Z_AXIS, SYM_CUSTOM_AXIS.
GetSymmetryAxisMode(obj)
Gets the axis mode for the data object symmetry. The axis can be X,Y,Z, or custom. The input is the handle
to the data object, and the return value is the symmetry mode. The possible axis mode settings are:
SYM_X_AXIS, SYM_Y_AXIS, SYM_Z_AXIS, SYM_CUSTOM_AXIS.
SetSymmetryAxis(obj, axis)
For the Custom axis mode, the axis needs to be set with this function. The inputs are a handle to the data
object, followed by the axis, which is specified by a Python 3-tuple or list.
GetSymmetryAxis(obj)
For the Custom axis mode, the axis can be obtained with this function. The input is a handle to the data
object. The return value is the axis, which is returned as a Python 3-tuple or list.
SetSymmetryLo(obj, lo)
For data object symmetry, several instances of the original object are displayed depending on the mode.
This function specifies the starting value for the symmetry. The inputs are a handle to the data object,
followed by the symmetry starting value.
GetSymmetryLo(obj)
For data object symmetry, several instances of the original object are displayed depending on the mode.
This function returns the starting value for the symmetry. The input is a handle to the data object, and the
return value is the symmetry starting value.
274
Appendix Scripting
SetSymmetryHi(obj, hi)
For data object symmetry, several instances of the original object are displayed depending on the mode.
This function specifies the ending value for the symmetry. The inputs are a handle to the data object,
followed by the symmetry ending value.
GetSymmetryHi(obj)
For data object symmetry, several instances of the original object are displayed depending on the mode.
This function returns the ending value for the symmetry. The input is a handle to the data object, and the
return value is the symmetry ending value.
SetSymmetryAngle(objects,angle)
Sets the angle between the copies in the symmetry display for the given inputs. For example, if there are
4 quadrants in a symmetry display, the angle would be 90 degrees. In the TRANSLATE mode, the angle is a
distance between copies instead.
GetSymmetryAngle(object)
Returns the angle between the copies in the symmetry display for the given inputs.
Reduced Surface
Purpose
The Reduced Surface module is used by Python to incorporate the basic scripting for the surface reduction features
in CFD-VIEW.
Imported Functions
The following functions are imported from the Reduced Surface module.
SetReduction(obj, value)
Sets the reduction value for the input reduced surface. The inputs are a handle to the reduced surface
object, and the reduction value. This is the same value used in the GUI.
275
CFD-VIEW V2014.0 User Manual
Examples
VANNOTATION MODULE
Goal
The goal of this example is to illustrate some of the capabilities of the VAnnotation module that is used by
Python to incorporate the basic scripting for the annotation features in CFD-VIEW. A small red box will
be placed in the center of the 3D viewer. An additional arrow annotation is placed next.
Sample Code
box=CreateBox()
SetPosition(box,-50,50)
SetSize(box,100,100)
SetFillColor(box,[255,0,0,255])
line=CreateLine()
SetLineStartPoint(line,50,50)
SetLineEndPoint(line,150,100)
SetLineArrowStyle(line,ARROW_STYLE_END)
276
Appendix Scripting
Explanation
The first line imports the needed module. Next, the annotation box is created on the screen, and the handle to it is
returned. SetPosition places the upper left corner of the box 50 pixels left of the center of the 3D window and 50
pixels up. SetSize then makes the box 100x100 pixels. Finally, the fill color of the box is set to red.
The color is a python list object that has four components, red, green, blue, and alpha, all ranging in level from 0 to
255. The alpha component regulates transparency, with 0 representing totally transparent and 255 representing
totally opaque. The box annotation object does not support transparency, so the alpha component is ignored in
this case.
Arrows are a special case of the Line annotation object. To place an arrow, first create it, then position both end to
the desired location, and finally set the arrow style.
See Also
IMAGE SNAPSHOT
Goal
The goal of this example is to illustrate some of the surface access functions and how to take a snapshot
of scene. In this simple example, a set of volumes is read from a DTF file, and then a cutting plane is
passed through.
Sample Code
ImportDTF("water.DTF",DTF_SIMPLIFYING)
surfs=GetAllSurfaces()
SetColorAttribute(surf,"U")
SetSurfaceRendering(surf, SURFACE_RENDERING_FLOODED)
ForceUpdate()
SaveImageWindow("test.png", IMAGE_FORMAT_PNG)
277
CFD-VIEW V2014.0 User Manual
Explanation
The first line imports the needed module as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The next line is used to load the DTF file into the model. GetAllSurfaces() returns
a list of all of the surfaces in the model, which is used next to access each of them to change rendering attributes.
In the loop, the coloring attribute and rendering modes are set. The next line, ForceUpdate(), is used to make sure
the screen is fully repainted before snapping an image. Finally, the image is snapped and saved to file in the
desired format. (Note: The 3D Viewer of CFD-VIEW must not be covered by another window at the time the image
is snapped.
CUTTING PLANES
Goal
The goal of this example is to illustrate some of the cutting plane capabilities of the VSurface module that
is used by Python to incorporate the basic scripting for the surface features in CFD-VIEW. In this simple
example, a set of volumes is read from a DTF file, and then a cutting plane is passed through.
Sample Code
ImportDTF("mixed.DTF",DTF_SIMPLIFYING)
surf=CreateXCut(GetAllVolumes())
SetColorAttribute(surf,"VonMises")
SetSurfaceRendering(surf, SURFACE_RENDERING_FLOODED)
SetValue(surf,0.5)
Explanation
The first line imports the needed module as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The next line is used to load the DTF file into the model. The XCut is created by
passing the list of volumes to be cut to the CreateXCut function. In this case, all volumes are cut. The next two
lines specify with attribute is used for coloring the object and how the color should be displayed. Finally, the
placement of the XCut is specified.
278
Appendix Scripting
See Also
POINT PROBE
Goal
The goal of this example is to illustrate the creation and positioning of a point probe.. In this simple
example, a set of volumes is read from a DTF file, and then a point probe is set.
Sample Code
ImportDTF("mixed.DTF",DTF_SIMPLIFYING)
probe=CreateProbe(GetAllVolumes())
SetProbeVariable(probe,"VonMises")
SetProbePosition(probe,[0,0,0])
Explanation
The first line imports the needed module as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The next line is used to load the DTF file into the model.
CreateProbe creates a point probe and returns a pointer to it. The input is a list of volumes in which to probe. (In
this case, the list of all volumes is used, as returned by GetAllVolumes().) The last two lines set the variable to
probe and the position of the probe.
See Also
PARTICLE TRACE
Goal
The goal of this example is to illustrate the creation and positioning of a particle trace. In this simple
example, a set of 2D volumes is read from a DTF file, and then a point probe is set. (Recall that a 2D
volume is a surface.)
279
CFD-VIEW V2014.0 User Manual
Sample Code
ImportDTF("water.DTF",DTF_SIMPLIFYING)
probe=Create2DTrace(GetAllSurfaces())
SetProbePosition(probe,[0,.375,0])
Explanation
The first line imports the needed module as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The next line is used to load the DTF file into the model.
Create2DTrace creates a particle trace and returns a pointer to it. The input is a list of 2D volumes (surfaces) in
which to trace. (In this case, the list of all surfaces is used, as returned by GetAllSurfaces().) Finally, the release
point of the trace is placed with SetProbePosition.
See Also
ISOSURFACE
Goal
The goal of this example is to illustrate the creation and positioning of an iso-surface, and the creation
and positioning of a legend. In this simple example, a set of volumes is read from a DTF file, and then an
iso-surface is passed through.
Sample Code
ImportDTF("mixed.DTF",DTF_SIMPLIFYING)
surf=CreateIsoSurf(GetAllVolumes())
SetSurfaceRendering(surf, SURFACE_RENDERING_FLOODED)
SetSurfaceShading(surf,SURFACE_SHADING_SMOOTH )
280
Appendix Scripting
SetColorAttribute(surf,"X")
SetIsoVariable(surf,"VonMises")
SetValue(surf,5.e6)
legend=CreateLegend()
SetPosition(legend,300,100)
Explanation
The first line imports the needed module as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The next line is used to load the DTF file into the model. CreateIsoSurf() is the
function that creates the iso-surface. It takes a list of volumes as input and returns a pointer to the new surface.
That list of volumes used as input is obtained by GetAllVolumes() in this case. Next the variable used for coloring
the surface is set with SetColorAttribute().
SetIsoVariable() is the function used to select which variable will be iso-value for the surface. In this example, the
VonMises stress is selected, and the iso-value is set in the next function call.
Finally, the legend is created and positioned in the last two functions. At least one entity must be colored
by an attribute, (such as pressure, temperature, etc.), before the legend can be used.
See Also
Advanced Scripting
Introduction
To use the advanced Python programming in VIEW, you will need to have some overall understanding of how the
data flow network works. When a data file is read into VIEW, a number of "VUObjects" are created to contain the
various zones and surfaces read from the file. Once these are read, there are a number of other operations that
can take place, such as cutting planes, iso-surfaces, particle traces, etc. These "VUOperations", as they are known,
take VUObjects as input and create additional VUObjects as output. For example, a VUXCut operation might take a
tetrahedral volume, (VUTetVolume), as input and create a polygonal surface as output, (VUPolySurface). While it
may seem complicated at first, you will find that it is a very powerful way to manipulate simulation data.
The overall class hierarchy for the scriptable parts of CFD-VIEW, (a.k.a. VIEW), is shown below. The object type
shown in parenthesis is the VIEW class from which that class is derived. _object is the base object type class from
281
CFD-VIEW V2014.0 User Manual
which all others are derived. There are no CFD-VIEW specific capabilities for these objects, so nothing will be
documented here. There are two primary VIEW base classes, derived from _object, VUObject and VUOperation.
When using VIEW interactively from its GUI, much of this complexity is intentionally hidden to enhance its ease of
use. However, when scripting is used, it is necessary to be more specific about object and operation controls. The
basic scripting described before is there for relatively simple task, and the advanced scripting described here is for
those times when the basic scripting is not enough. The philosophy with CFD-VIEW scripting is that simple tasks
should be simple, and complicated tasks should be possible. Another nice aspect is that the basic and advanced
scripting functions can be used simultaneously in the same script.
This documentation is an introduction to specifics of scripting CFD-VIEW. There is extensive documentation and
tutorials on the web and in print about Python and object-oriented programming in general, and are beyond the
scope of this documentation.
VUObject
VUObject
Annotation
Box
ImageBox
Label
Legend
Oval
Text
Axes
Bounds
Line
Origin
VUData
VULine
VUPolyLine
VUPoint
VUSurface
VUIrrSurface
VUPolySurface
VUQuadSurface
VUTriSurface
VURegSurface
VUVolume
VUIrrVolume
VUHexVolume
VUMixVolume
VUTetVolume
VUPolyVolume
VURegVolume
VUGroup
VUScene
VUDocument
282
Appendix Scripting
VUPlot
VUOperation
VUOperation
VU2DLineProbe
VU2DNet
VUBorder
VUCarpetOp
VUFileReader
VULineOp
VUILine
VUJLine
VUKLine
VULineProbe
VUNet
VUPlotOp
VUSrfMerge
VUTriReduction
VUPlaneOp
VU2DILine
VU2DJLine
VUArbCut
VUIPlane
VUIsocv
VUIsosf
VUJPlane
VUKPlane
VUXCut
VUXSlice
VUYCut
VUYSlice
VUZCut
VUZSlice
VUProbeOp
VUProbe
VUStripChart
VUTrace
VU2DProbeOp
VU2DProbe
VU2DStripChart
VU2DTrace
283
CFD-VIEW V2014.0 User Manual
Other
Additionally, there are a few other VIEW classes that are needed that are derived from neither VUObjects or
VUOperations. These are for the plotting and color mapping aspects of VIEW and are discussed with the
VUObjects that need them. These are:
PlotPanel
FXPlotter
FXGraph
Colormap
COLORTAB
Examples
There are several examples of advanced scripting in CFD-VIEW:
Advanced-Basic Comparison
Annotation
Data Flow Network
Animation Setup
Fonts
Fonts (Part 2)
Carpet Plots
Line Probes
Line Plotting
Purpose
The colormap object is used to map a color ramp to a range of values of attributes, such as pressure or
temperature. Normally the operation of a color map is automatic with little user interaction required. However, if
the range of attributes needs to be changed, or the color distribution, this is the object that will be used. The
Colormap class is not a VUObject per se, but is used to control the color map of any VIEW data object. The
COLORTAB object is a simple struct that associates a color with a level of a variable. (For example, this would be
the object that might associate the color orange with 75 psi.)
Derived From
Nothing - (Base level object)
284
Appendix Scripting
MEMBER FUNCTIONS
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. In several of the functions, "Notify" is
an optional value that specifies whether to notify the model of a change. The default is false, but you generally
want this to be true.
Colormap
getScene()
getName()
Returns the name of the colormap. (Usually this is the same as the color variable)
getUnits()
setUnits(un)
Sets the units of the color variable in the colormap to the input string
invert([notify])
Inverts the color mapping so the previous high color is now the low, and vice versa.
reset([notify])
Resets the color map to its default appearance for its preset colormap listed below.
getNumTabs()
getTabColor(index)
Returns the color of the tab for the given tab index. The color is a 4 tuple containing (R,G,B,A), where
each value is in the range 0 to 255.
setTabColor(index, color)
Sets the tab color at the given tab index. The color is a 4 tuple containing (R,G,B,A), where each value is in
the range 0 to 255.
getTabLevel()
Returns the value of the color variable, (e.g. pressure), at the given tab index.
285
CFD-VIEW V2014.0 User Manual
setTabLevel(index, level)
Sets the tab level to a value of the color variable, (e.g. pressure), at the given tab index. The slides the tab
to correct position.
getNumContours()
setContours(nc[,notify])
getContourLevel(c)
Returns the value of the color variable, (e.g. pressure), at the given contour level.
setMapRange(lo,hi[,notify])
Sets the minimum and maximum values of the color variable, (e.g. pressure), for the colormap. This
defines the range.
getMapLo()
Returns the value of the color variable, (e.g. pressure), at the low end of the colormap range.
getMapHi()
Returns the value of the color variable, (e.g. pressure), at the high end of the colormap range.
color(value)
Returns the color that corresponds to the given value of the color variable, (e.g. pressure).
getRamp()
Returns the preset ramp listed below on which the colormap is based
setRamp(ramp[,notify])
COLORTAB - These are simple member variables that can be changed or viewed.
color - The color for the given tab
286
Appendix Scripting
Useful Constants
GRAYMAP
GREENMAP
PLOT3DMAP
REDMAP
DUTCHMAP
PLOTMAP
STRIPEMAP
Purpose
These three classes are used in displaying line plots in CFD-VIEW. They are not VIEW objects per se, but are
important parts of VUPlot, which is used to display VUPlotOp and VUStripChart outputs. The PlotPanel is simply
the dialog box class in which the plot is shown. The plot itself is an FXPlotter class, in which the individual curves
are FXGraph instances. Please see the documentation on Plotting and Strip Charts for more information.
In the API functions below, the word "range" represents the Y-Axis, and the word "domain" represents the X-Axis.
Derived From
Nothing (these are base classes)
Member Functions
class FXGraph
getNumPoints()
getName()
setName(name)
287
CFD-VIEW V2014.0 User Manual
getDomainData(i)
setDomainData(i,d)
getRangeData(i)
setRangeData(i,d)
updateData(dom,rng)
Changes the data in the curve to the X and Y values passed in. dom and rng are equal length python lists
containing the X and Y data respectively for the curve.
appendData(dom,rng)
Appends the data in the X and Y values passed in to the curve. dom and rng are equal length python lists
containing the X and Y data respectively for the curve.
getDomainLimits()
Returns a 2 tuple giving xmin and xmax of the data in the curve.
getRangeLimits()
Returns a 2 tuple giving ymin and ymax of the data in the curve.
setSymbolType(symbol)
Sets the data symbols for the curves to be one of the types listed below
getSymbolType()
Returns the symbol type for the curve. The value will be one of the ones listed below.
setSymbolColor(clr)
Sets the color of the symbols for this curve. clr is a 4-tuple representing (R,G,B,A), where each of the
components is in the range of 0 to 255.
getSymbolColor()
Returns the color of the symbols for this curve. The return value is a 4-tuple representing (R,G,B,A),
where each of the components is in the range of 0 to 255.
288
Appendix Scripting
setSymbolSize(size)
getSymbolSize()
setLineStyle(style)
Sets the line style for this curve to one of the values in the list below.
getLineStyle()
Returns the line style for this curve as one of the values in the list below.
setLineColor(clr)
Sets the color of this curve. clr is a 4-tuple representing (R,G,B,A), where each of the components is in the
range of 0 to 255.
getLineColor()
Returns the color of this curve. The return value is a 4-tuple representing (R,G,B,A), where each of the
components is in the range of 0 to 255.
setLineWeight(weight)
getLineWeight()
setVisible(v)
isVisible()
addGraph(graph)
Adds the graph pointed to by "graph" to the plotter. It is appended at the end of the list.
insertGraph(index,graph)
Inserts the graph pointed to by "graph" to the plotter. It is inserted at the given index in the list.
289
CFD-VIEW V2014.0 User Manual
removeGraph(index)
clearGraphs()
getGraph(index)
getNumGraphs()
setNumGraphs(ng)
Sets the number of graphs in the plot. New ones are created if given number is larger that existing.
sameYScale()
Do all of the graphs share the same Y axis? Return value is True/False.
sameYScale(ss)
Sets whether the graphs share the same Y axis. ss is True or False.
setLogErrorLabel(label)
Sets the X or Y axis label that is shown when a logarithmic scale is not appropriate, (e.g. if some of the Y
values are less than zero.)
getLogErrorLabel()
Returns the X or Y axis label that is shown when a logarithmic scale is not appropriate, (e.g. if some of the
Y values are less than zero.)
setTitle(text)
getTitle()
setDomainCaption(text)
getDomainCaption()
290
Appendix Scripting
setRangeCaption(text,index)
Sets the Y axis label for the given curve index. These are used if the curves do not share the same Y axis.
getRangeCaption(index)
Returns the Y axis label for the given curve index. These are used if the curves do not share the same Y
axis.
setDomainDisplay(lo,hi)
Sets the limits for the X axis. This is usually automatic, but can be explicitly set.
setRangeDisplay(lo,hi,index)
Sets the limits for the Y axis for the i'th curve. This is usually automatic, but can be explicitly set.
setLegendPos(x, y)
Set the upper left corner of the legend for the plot
getLegendPos()
Returns a 2-tuple that gives the upper left corner of the legend.
setCurrent(index)
Selects the "current" curve of the plots. This is used in some interactive things, but is generally not
needed.
getCurrent()
setDomainTickDeltas(maj,min)
Sets the major and minor tick spacing for the X axis
setRangeTickDeltas(maj,min,index)
Sets the major and minor tick spacing for the Y axis of the i'th curve
setTitleFontDesc(fd)
Sets the font of the plot title. The input is a font descriptor that is used to request a particular font.
getTitleFontDesc()
Returns the font descriptor of the font used for the title of the plot.
setLegendFontDesc(fd)
Sets the font of the plot legend. The input is a font descriptor that is used to request a particular font.
291
CFD-VIEW V2014.0 User Manual
getLegendFontDesc()
Returns the font descriptor of the font used for the legend of the plot.
setCaptionFontDesc(fd)
Sets the font of the X and Y axes captions of the plot. The input is a font descriptor that is used to request
a particular font.
getCaptionFontDesc()
Returns the font descriptor of the font used for the X and Y axes captions of the plot.
setNumberFontDesc(fd)
Sets the font of the scale numbers of the plot. The input is a font descriptor that is used to request a
particular font.
getNumberFontDesc()
Returns the font descriptor of the font used for the scale numbers of the plot.
savePlotData(filename)
Saves the X Y curve data for the plot to the given file name. The return value is True or False depending
on the success or failure of the operation. This is the same function used by selecting Save Plot from the
File Menu.
class PlotPanel
getPlotter()
Returns a pointer to the FXPlotter contained within the PlotPanel dialog box.
Useful Constants
The following constants are used for changing the characteristics of the FXPlotter plots and the FXGraph curves.
Symbol Style
SYMBOL_NONE
SYMBOL_CIRCLE
SYMBOL_SQUARE
SYMBOL_UTRIANGLE
SYMBOL_DTRIANGLE
SYMBOL_LTRIANGLE
SYMBOL_RTRIANGLE
SYMBOL_DIAMOND
SYMBOL_FILLED_CIRCLE
SYMBOL_FILLED_SQUARE
SYMBOL_FILLED_UTRIANGLE
SYMBOL_FILLED_DTRIANGLE
SYMBOL_FILLED_LTRIANGLE
SYMBOL_FILLED_RTRIANGLE
292
Appendix Scripting
SYMBOL_FILLED_DIAMOND
SYMBOL_DOT
Curve Line Style
GRAPH_NONE
GRAPH_SOLID
GRAPH_DOTTED
GRAPH_SHORTDASHED
GRAPH_LONGDASHED
GRAPH_DOTDASHED
Plotter Settings
PLOTTEREX_BORDER
PLOTTEREX_GRID_X
PLOTTEREX_GRID_Y
PLOTTEREX_NUMBERS_X
PLOTTEREX_NUMBERS_Y
PLOTTEREX_AXIS_LEFT
PLOTTEREX_AXIS_RIGHT
PLOTTEREX_AXIS_TOP
PLOTTEREX_AXIS_BOTTOM
PLOTTEREX_TITLE
PLOTTEREX_LABEL_X
PLOTTEREX_LABEL_Y
PLOTTEREX_MAJOR_TICKS_X
PLOTTEREX_MAJOR_TICKS_Y
PLOTTEREX_MINOR_TICKS_X
PLOTTEREX_MINOR_TICKS_Y
PLOTTEREX_TICK_LABELS_X
PLOTTEREX_TICK_LABELS_Y
PLOTTEREX_AUTOSCALE_X
PLOTTEREX_AUTOSCALE_Y
PLOTTEREX_LOG_X
PLOTTEREX_LOG_Y
PLOTTEREX_LEGEND
PLOTTEREX_MAX_SCALE
Fonts
Purpose
There are two type of fonts used in CFD-VIEW, depending on the object type. The label, legend, bounds, etc. use a
simple outline font. See the Label annotation object for a description of the functions available with these fonts.
293
CFD-VIEW V2014.0 User Manual
A much more complete selection of fonts is available with the Text object, Transient Time, Plotter, etc.. These use
the available system fonts that are installed. Dealing with them through scripting is a bit more complex than the
simple outline fonts, but the results are typically worth the extra effort.
FXFontDesc
The system fonts are accessed through font descriptors, which specify such things as the font family, size, etc.
Setting the font descriptor for an object is a request that the system may or may not be able to honor, based of
system font availability. However, the closest available font is provided, and is typically very close to the requested
font.
struct FXFontDesc {
};
To access the items from Python, a List is used. The structure of this list is very similar to C++ struct:
face A string which gives the name of the face (e.g. "Times", "Helvetica", etc.)
size An integer that specifies the weight in deci-points (720 to the inch)
weight One of the values from the FONTWEIGHT choices below
slant One of the values from the FONTSLANT choices below
setwidth
One of the values from the FONTSETWIDTH choices below
encoding
One of the values from the FONTENCODING choices below
294
Appendix Scripting
text=CreateText()
text=CreateText()
Useful Constants
Font Weight
Font Slant
FONTSLANT_ITALIC = 2 // Italics
295
CFD-VIEW V2014.0 User Manual
Font Setwidth
FONTSETWIDTH_CONDENSED = 30 // Condensed
FONTSETWIDTH_NARROW = 30 // Narrow
FONTSETWIDTH_COMPRESSED = 30 // Compressed
FONTSETWIDTH_SEMICONDENSED = 40 // Semi-condensed
FONTSETWIDTH_EXPANDED = 70 // Expanded
FONTSETWIDTH_WIDE = 80 // Wide
Font Encoding
FONTENCODING_ISO_8859_4 = 4
FONTENCODING_ISO_8859_6 = 6 // Arabic
FONTENCODING_ISO_8859_7 = 7 // Greek
296
Appendix Scripting
FONTENCODING_ISO_8859_8 = 8 // Hebrew
FONTENCODING_ISO_8859_10 = 10
FONTENCODING_ISO_8859_11 = 11 // Thai
FONTENCODING_ISO_8859_13 = 13 // Baltic
FONTENCODING_ISO_8859_14 = 14
FONTENCODING_ISO_8859_15 = 15
FONTENCODING_ISO_8859_16 = 16
FONTENCODING_KOI8 = 17
FONTENCODING_KOI8_R = 18 // Russian
FONTENCODING_KOI8_U = 19 // Ukrainian
FONTENCODING_KOI8_UNIFIED = 20
297
CFD-VIEW V2014.0 User Manual
298
Appendix Scripting
Miscellaneous Functions
Purpose
These functions are global scope functions that are needed from time to time. They are not part of any object, but
are needed mainly for model manipulation. Unless stated otherwise, these functions have no return value
Functions
getActiveScene()
getActiveViewer()
openModelFile(filename)
saveModel(filename, [SaveAll])
Saves model file with this name. If SaveAll is true, all data from the DTF file will be saved with the model.
SaveAll is an optional input, which defaults to True.
299
CFD-VIEW V2014.0 User Manual
createNewScene()
quit()
Quits CFD-VIEW
reflow()
forceUpdate()
saveImageArea(viewer,filename,imageformat,x,y,w,h)
Saves image contained within the specified rectangle. Returns error code listed below. Inputs are the
viewer containing the image, the file name, the image format (listed below), and the lasso rectangle.
saveImageWindow(viewer,filename,imageformat)
Saves image of the entire window. Returns error code listed below. Inputs are the viewer containing the
image, the file name, and the image format (listed below).
setColorAttribute(scene,objects,varName)
Sets color attribute for all objects matching the variable name. Inputs are the scene (model), the list of
objects, and the variable name string .
setSecondaryVariable(objects,varName)
Sets the iso-surface variable for all objects matching the variable name. Inputs are the list of objects and
the variable name string.
setView(viewer,view)
Sets the view to one of the six preset views listed below. Inputs are the pointer to the viewer, (usually
obtained from getActiveViewer), and the preset view code.
fitView(viewer)
Fits view to size of the model. Input is the pointer to the viewer, (usually obtained from getActiveViewer).
resetView(viewer)
Reset all viewing parameters for the specified view. Input is the pointer to the viewer, (usually obtained
from getActiveViewer).
300
Appendix Scripting
setProjection(viewer,projection)
Set projection to ortho or perspective. Inputs are the pointer to the viewer, (usually obtained from
getActiveViewer), and the preset projection code listed below.
setTurboMode(viewer,turbo)
Turn turbo mode on or off. Inputs are the pointer to the viewer, (usually obtained from getActiveViewer),
and True or False for the turbo.
setDithering(viewer,dithering)
Turn dithering on or off. Inputs are the pointer to the viewer, (usually obtained from getActiveViewer),
and True or False for the dithering.
setFog(viewer,fog)
Turn fog on or off. Inputs are the pointer to the viewer, (usually obtained from getActiveViewer), and
True or False for the fog.
setAntiAliasing(viewer,antialiasing)
Turn anti-aliasing on or off. Inputs are the pointer to the viewer, (usually obtained from getActiveViewer),
and True or False for the anti-aliasing.
zoomIn(viewer)
Zoom in one notch. Input is the pointer to the viewer, (usually obtained from getActiveViewer).
zoomOut(viewer)
Zoom out one notch. Input is the pointer to the viewer, (usually obtained from getActiveViewer).
setZoomLevel(viewer,zoom)
Set zoom level. Inputs are the pointer to the viewer, (usually obtained from getActiveViewer), and the
zoom level.
roll(viewer,degrees)
Roll the viewer. Inputs are the pointer to the viewer, (usually obtained from getActiveViewer), and the
roll amount.
pitch(viewer,degrees)
Pitch the viewer. Inputs are the pointer to the viewer, (usually obtained from getActiveViewer), and the
pitch amount.
yaw(viewer,degrees)
Roll the viewer. Inputs are the pointer to the viewer, (usually obtained from getActiveViewer), and the
yaw amount.
301
CFD-VIEW V2014.0 User Manual
translate( viewer,dx,dy)
Translate the scene by (dx, dy). Inputs are the pointer to the viewer, (usually obtained from
getActiveViewer), the shift in the screen X, and the shift in the screen Y.
translateByPixels( viewer,dx,dy)
Translate the scene by (dx, dy). Inputs are the pointer to the viewer, (usually obtained from
getActiveViewer), the shift in the screen X, and the shift in the screen Y, measured in pixels.
setViewerCenter(viewer,x,y,z)
Sets the center of view. Inputs are the pointer to the viewer, (usually obtained from getActiveViewer),
and the X,Y,Z coordinates of the new center.
setFieldOfView(viewer,FXdouble fov)
Sets the field of view angle. Inputs are the pointer to the viewer, (usually obtained from
getActiveViewer), and the FOV angle.
setZoomFactor(viewer,zoomFactor)
Sets the zoom factor. Inputs are the pointer to the viewer, (usually obtained from getActiveViewer), and
the zoom factor.
setBackgroundGradient(viewer,backgroundGradient)
Turn background gradient on or off. Inputs are the pointer to the viewer, (usually obtained from
getActiveViewer), and True or False for the gradient mode.
setBackgroundGradientColors(viewer,bottomLeft,bottomRight,topLeft,topRight)
Set colors for background gradient. Inputs are the pointer to the viewer, (usually obtained from
getActiveViewer), and colors at the four corners. Each of the colors is a 4-tuple consisting of red, green,
blue, and alpha. The color values range from 0 to 255.
getViewerSize(viewer)
Get viewer size. Input is the pointer to the viewer, (usually obtained from getActiveViewer). An 2-tuple is
returned contained the width and height of the viewer.
errorMessage(message)
Pops a small dialog box with error icon and the supplied message. The user is presented with only an OK
button, and there is no return value.
questionMessage(message)
Pops a small dialog box with question icon and the supplied message. The user is presented with a yes
and a no button. The return value is 1 for yes and 2 for no.
302
Appendix Scripting
informationMessage(message)
Pops a small dialog box with information icon and the supplied message. The user is presented with only
an OK button, and there is no return value.
warningMessage(message)
Pops a small dialog box with warning icon and the supplied message. The user is presented with only an
OK button, and there is no return value.
Useful Constants
Image Formats
IMAGE_FORMAT_RGB // Iris RGB
IMAGE_FORMAT_GIF // Compuserve GIF
IMAGE_FORMAT_BMP // MS-Windows bmp
IMAGE_FORMAT_PPM // PPM
IMAGE_FORMAT_PNG // PNG Portable Network Graphics
IMAGE_FORMAT_JPEG // JPEG
IMAGE_FORMAT_XPM // X Pixmap
IMAGE_FORMAT_XBM // X Bitmap
IMAGE_FORMAT_PCX // PCX format
IMAGE_FORMAT_TGA // Targa format
IMAGE_FORMAT_TIFF // TIFF format
IMAGE_FORMAT_PS // PostScript
Viewing Options
VIEW_FRONT
VIEW_BACK
VIEW_LEFT
VIEW_RIGHT
VIEW_TOP
VIEW_BOTTOM
PROJECTION_ORTHOGONAL
PROJECTION_PERSPECTIVE
Error Codes
VIEW_OK
VIEW_ERROR_OUT_OF_MEMORY
VIEW_ERROR_FILE_NOT_FOUND
VIEW_ERROR_COULD_NOT_OPEN_FILE
VIEW_ERROR_COULD_NOT_READ_MODEL
VIEW_ERROR_COULD_NOT_SAVE_MODEL
VIEW_ERROR_NO_ACTIVE_MODEL
VIEW_ERROR_COULD_NOT_SAVE_IMAGE
VIEW_ERROR_BAD_INPUTS
VIEW_ERROR_NO_ACTIVE_VIEWER
303
CFD-VIEW V2014.0 User Manual
View Objects
VUObject is a base class for CFD-VIEW scripting, and it is the class from which all other objects are
derived. The operations in CFD-VIEW are all derived from VUOperation, which is discussed in its own
section. VUObject is an abstract base class, which means that other objects are derived from it, but
there will be no instances of it in its base form.
Derived From
Member Functions
Several of the functions arguments contained "notify", which is an optional value that specifies whether to notify
the model of a change. The default is false, but you generally want this to be true.
getParent()
Returns a pointer to the group in which this object is a member. Unless the object has been
explicitly grouped, it is a top level object, which is a member of the scene object, (VUScene).
getScene()
Returns a pointer to the scene object, (VUScene), which contains this object.
getSource()
isSelected()
select([notify])
deselect([notify])
changed([notify])
Marks this object as having been changed, which will cause the parts of the data-flow network that
depend on this object to run. This is generally not needed from scripting.
304
Appendix Scripting
repaint([notify])
setName(name [, notify])
Changes the name of this object. The input is a string containing the name.
getName()
getType()
Returns a string containing the type of this object. The type of a triangular surface would be "Surface".
See getFormat below for the sprecific type of surface.
getFormat()
Returns a string containing the format of this object. For a triangular surface, this would return "Tris".
setKey(key)
Sets the "key" of this object to the input string value. The key typically reflects the zone from which the
object came.
getKey()
Returns a string containing the key for this object. The key typically reflects the zone from which the
object came.
setShown(shown [, notify])
Sets the visibility state of this object. The input is either True of False.
isShown()
setHandlesShown(handles [, notify])
Sets whether this object's handles should be shown. An example would be the crosses at the end of the
line probe. The input is either True or False.
areHandlesShown()
305
CFD-VIEW V2014.0 User Manual
ANNOTATION
Purpose
Annotation is a derived class for CFD-VIEW scripting, and it is the class from which most other annotation objects
are derived. Labels, Legends, and other such rectangular type annotation are all derived from this class. Please
see the documentation on Annotation objects for more information.
Derived From
Advanced Scripting - VUObject
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
setPosition(x,y)
Sets the pixel coordinates of the upper left corner of the annotation object to the x and y inputs. The
center of the viewer is (0,0)
getPosition()
Returns a 2-tuple containing the x,y coordinates of the upper left corner of the annotation object.
setSize(w,h)
getSize()
setShadow(shadow [, notify])
Sets whether to display a simple shadow under the annotation object to the True/False input value.
hasShadow()
toggleShadow([notify])
306
Appendix Scripting
setShadowColor(clr [, notify])
Specifies the color of the shadow, if one is shown. The input color is a 4-tuple containing (R,G,B,A),
where each value is in the range 0 to 255.
getShadowColor()
Returns the color of the shadow as a 4-tuple containing (R,G,B,A), where each value is in the range 0 to
255.
setFilled(filled [, notify])
Sets whether to display the annotation object as filled/unfilled to the True/False input value. The Box
object is an example of an object that uses this.
isFilled()
Returns a True/False value indicating the filled state of the annotation object.
toggleFilled([notify])
setEdge(edge [, notify])
Sets whether to display a line around the annotation object to the True/False input value. The Box object
is an example of an object that uses this.
hasEdge()
toggleEdge([notify])
See Also
Advanced Scripting - Box
Advanced Scripting - ImageBox
Advanced Scripting - Label
Advanced Scripting - Legend
Advanced Scripting - Oval
Advanced Scripting - Text
307
CFD-VIEW V2014.0 User Manual
BOX
Purpose
Box is a small rectangular object in the 2D plane of the screen. It is often used as a background for Text objects.
Please see the documentation on the Operator Palette Box annotation object for more information.
Derived From
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
setFillColor(clr [, notify])
Sets the color of the filled interior of the box. The input color is a 4 tuple containing (R,G,B,A), where
each value is in the range 0 to 255.
getFillColor()
Returns the color of the filled interior of the box. The returned value is a 4 tuple containing (R,G,B,A),
where each value is in the range 0 to 255.
setEdgeColor(clr [, notify])
Sets the edge color of the box The input color is a 4 tuple containing (R,G,B,A), where each value is in the
range 0 to 255.
getEdgeColor()
Returns the edge color of the box. The returned value is a 4 tuple containing (R,G,B,A), where each value
is in the range 0 to 255.
setEdgeWidth(w [, notify])
getEdgeWidth()
See Also
Advanced Scripting - Oval
Advanced Scripting - Line
Advanced Scripting - Text
Advanced Scripting - Label
308
Appendix Scripting
IMAGEBOX
PURPOSE
The ImageBox provides a way to place an image on the 2D plane of the screen. The image can be
anything from a company logo to a previously stored line plot. Please see the documentation on the
Image Box annotation object for more information.
DERIVED FROM
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
setEdgeColor(edgeColor [, notify])
Sets the edge color of the box. The input color is a 4 tuple containing (R,G,B,A), where each value is in
the range 0 to 255.
getEdgeColor()
Returns the edge color of the box. The returned value is a 4 tuple containing (R,G,B,A), where each value
is in the range 0 to 255.
setEdgeWidth(edgeWidth [, notify])
getEdgeWidth()
setAspectRatioLocked(locked [, notify])
Sets whether the aspect ratio of the image should be locked to the True/False input value.
isAspectRatioLocked()
Returns a True/False value indicating whether the aspect ratio of the image is locked.
toggleAspectRatioLocked([notify])
309
CFD-VIEW V2014.0 User Manual
setFilename(filename [, notify]
Sets the filename of the image to be read from file and displayed in the image box. A True/False return
value indicates success. The input is a string containing the file name.
getFilename()
Returns the filename of the image displayed in the image box as a string.
rotateBy(rotationAmount [, notify])
Rotates the image by a multiple of 90 degrees. The input value is one of the constants given below.
Useful Constants
IMAGE_ROTATE_0
IMAGE_ROTATE_90
IMAGE_ROTATE_180
IMAGE_ROTATE_270
See Also
Advanced Scripting - Box
LABEL
Purpose
The Label object provides a way to display simple text on the screen. It uses a simple outline font that is available
in a few styles, and is included for consistency with earlier versions of CFD-VIEW. The Text object has far more
options for fonts and other effects, and is considered an upgrade from this Label object. Please see the
documentation on the Label annotation object for more information.
Derived From
Advanced Scripting - Annotation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
setText(text [, notify])
310
Appendix Scripting
getText()
setFontStyle(fontStyle [, notify])
getFontStyle()
setFontSize(fontSize [, notify])
Sets the font size. The size is a floating point number with units in pixels.
getFontSize()
setFontWeight(fontWeight [, notify])
Sets the weight of the line used to stroke the font. A weight of 1 indicates a 1 pixel thick line.
getFontWeight()
Returns the weight of the line used to stroke the font. A weight of 1 indicates a 1 pixel thick line.
setColor(clr [, notify])
Sets the color of the label. The input color is a 4 tuple containing (R,G,B,A), where each value is in the
range 0 to 255.
getColor()
Returns the color of the label. The returned value is a 4 tuple containing (R,G,B,A), where each value is in
the range 0 to 255.
setOrientation(orientation [, notify])
Sets the orientation the label to one of the values shown below. This is simply a convenience function
around setTextAngle shown below for legacy reasons.
getOrientation()
Returns the orientation of the label as one of the values shown below. This is simply a convenience
function around getTextAngle shown below for legacy reasons.
setTextAngle(textAngle [, notify])
Sets the display angle of the label. The input is a float representing the rotation angle in degrees.
311
CFD-VIEW V2014.0 User Manual
getTextAngle()
Returns the display angle of the label. The return value is a float representing the rotation angle in
degrees.
Useful Constants
The following constants are used for setting the font style and orientation:
Font Style
FONT_STYLE_TIMES
FONT_STYLE_FUTURA
FONT_STYLE_GREEK
FONT_STYLE_MATH
FONT_STYLE_SCRIPT
Font Orientation
FONT_ORIENTATION_VERTICAL_UP
FONT_ORIENTATION_HORIZONTAL
FONT_ORIENTATION_VERTICAL_DOWN
See Also
Advanced Scripting - Text
TEXT
Purpose
The Text object provides a way to display text on the screen with numerous fonts and other effects. The Label
object has fewer options for fonts and such, and is available for legacy reasons. Please see the documentation on
the Text annotation object for more information.
Derived From
Advanced Scripting - Annotation
312
Appendix Scripting
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
setText(txt [, notify])
getText()
setTextColor(color [, notify])
Sets the color of the text. The input color is a 4 tuple containing (R,G,B,A), where each value is in the
range 0 to 255.
getTextColor()
Returns the color of the text. The returned value is a 4 tuple containing (R,G,B,A), where each value is in
the range 0 to 255.
getPosition()
Returns the position of the Text object. The position of the Text object is measured at the left of the
"baseline". Imagine a lower case g, j, q, etc. The lower part of the characters will be below the baseline,
refered to as the descent. The ascent is the part above the baseline.
getSize()
Returns the width of the string, and the combination of ascent and descent as the height. To get these
separately, two new functions have been added: getAscent() and getDescent().
getAscent()
Returns the ascent of the Font. This is the maximum height of the font above the baseline.
getDescent()
Returns the descent of the Font. Imagine a lower case g, j, q, etc. The lower part of the characters will be
below the baseline, refered to as the descent. This function returns the lowest descent of the font below
the baseline.
getFontDesc()
Returns the Font Descriptor of the text font. Please see the section on Fonts for a description.
setFontDesc(fontdesc [, notify])
Sets the Font Descriptor of the text. Please see the section on Fonts for a description.
313
CFD-VIEW V2014.0 User Manual
See Also
Advanced Scripting - Label,
Advanced Scripting - Fonts
Purpose
The Legend object shows the legend for a color map showing the correlation between the colors and the values of
the selected attribute. A legend can be created once at least one object is color by some attribute, such as
pressure. Please see the documentation on the Legend object for more information.
Derived From
Advanced Scripting - Annotation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
For functions that take a color as input, the input is a 4 tuple containing (R,G,B,A), where each value is in the range
0 to 255. For functions that return a color, the returned value is a 4 tuple containing (R,G,B,A), where each value
is in the range 0 to 255.
setTickColor(color [, notify])
getTickColor()
setTextColor(color [, notify])
getTextColor()
setBorderColor(color [, notify])
314
Appendix Scripting
getBorderColor()
getColormap()
setColormap(index [, notify])
Sets the index of the colormap on which the legend is based. Care must be taken to insure that this a
valid index.
setTextSize(textSize [, notify])
Sets the size of the font used in the legend. The input is a float whose units are pixels.
getTextSize()
Returns the size of the font used in the legend. The return value is a float whose units are pixels.
setTextWeight(textWeight [, notify])
Sets the weight of the line used to stroke the fonts in the legend. The input is a floating point number
where a weight of 1 is a 1 pixel thick line.
getTextWeight()
Returns the weight of the line used to stroke the fonts in the legend. The return value is a floating point
number where a weight of 1 is a 1 pixel thick line.
Specifies whether the legend should track the active colormap as the selection moves from object to
object. The input is True/False based on the desired behavior.
tracksColormap()
Returns a True/False value based on whether the active colormap is tracked as the selection moves from
object to object.
toggleTracksColormap([notify])
showTitle(truefalse [, notify])
Specifies whether the title of the legend should be displayed. The input is either True or False.
showTitle()
Returns a True/False value indicating whether the title of the legend is shown.
315
CFD-VIEW V2014.0 User Manual
toggleTitle([notify])
setColorAttTitle(truefalse [, notify])
Specifies whether to use the color mapping attribute as the title. The input is either True or False.
isColorAttTitle()
Returns a True/False value indicating whether the color mapping attribute is used as the title.
toggleColorAttTitle([notify])
showUnits(truefalse [, notify])
Specifies whether to show the color mapping units on the legend. The input is either True or False.
toggleUnits([notify])
showMajorTicks(truefalse [, notify])
toggleMajorTicks([notify])
toggleMinorTicks([notify])
Specifies whether to display the numbers on the legend. The input is either True or False.
toggleNumbers([notify])
showMinMax(minmax [, notify])
Specifies whether to show the min/max values on the legend. The input is either True or False.
316
Appendix Scripting
toggleMinMax([notify])
setFlooded(flooded [, notify])
Specifies whether to draw the color ramp in flooded mode versus gradient mode. The input is either True
or False.
isFlooded()
Returns a True/False value indicating whether the color ramp is drawn in flooded mode versus gradient
mode.
toggleFlooded([notify])
getTitleFontStyle()
Returns the font style used by the title of the legend. See the Label object for a discussion of outline
fonts. The style is one of the values listed below.
setTitleFontStyle(fontStyle [, notify])
Specifies the font style used by the title of the legend. See the Label object for a discussion of outline
fonts. The style is one of the values listed below.
getNumberFontStyle()
Returns the font style used by the numbers in the legend. See the Label object for a discussion of outline
fonts. The style is one of the values listed below.
setNumberFontStyle(fontStyle [, notify])
Specifies the font style used by the numbers in the legend. See the Label object for a discussion of outline
fonts. The style is one of the values listed below.
getPrecision()
setPrecision(prec [, notify])
getLegendFormat()
Returns the legend format. The return value is one of the ones listed below.
setLegendFormat(format [, notify])
Sets the legend format. The input value is one of the ones listed below.
317
CFD-VIEW V2014.0 User Manual
Useful Constants
Legend Format
LEGEND_FORMAT_FRACTIONAL
LEGEND_FORMAT_AUTOMATIC
LEGEND_FORMAT_EXPONENTIAL
Font Style
FONT_STYLE_TIMES
FONT_STYLE_FUTURA
FONT_STYLE_GREEK
FONT_STYLE_MATH
FONT_STYLE_SCRIPT
See Also
Advanced Scripting - Color Map
OVAL
Purpose
Oval is a small circular/oval object in the 2D plane of the screen. It is often used as a background for Text objects.
Please see the documentation on the Oval annotation object for more information.
Derived From
Advanced Scripting - Annotation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
setFillColor(clr [, notify])
Sets the color of the filled interior of the box. The input color is a 4 tuple containing (R,G,B,A), where
each value is in the range 0 to 255.
getFillColor()
Returns the color of the filled interior of the box. The returned value is a 4 tuple containing (R,G,B,A),
where each value is in the range 0 to 255.
318
Appendix Scripting
setEdgeColor(clr [, notify])
Sets the edge color of the box The input color is a 4 tuple containing (R,G,B,A), where each value is in the
range 0 to 255.
getEdgeColor()
Returns the edge color of the box. The returned value is a 4 tuple containing (R,G,B,A), where each value
is in the range 0 to 255.
setEdgeWidth(FXint w [, notify])
getEdgeWidth()
See Also
Advanced Scripting - Box
Advanced Scripting - Text
Advanced Scripting - Label
Advanced Scripting - Line
Purpose
The Transient Time (TransTime) Annotation object enables you to display DTF files that have animation time
stored. To use Time Annotation, the operator needs to know from which DTF file the data came. New for 2004,
the Time Annotation is no longer attached to an object read from a file, but to the file reader itself. This avoids
confusion when multiple objects are selected or grouped.
The transient time object uses the same text display as the Text annotation. Fonts, positioning, etc., are all set the
same way. Please see the documentation on the Text scripting and the Time Annotation object for more
information.
Derived From
Advanced Scripting - Annotation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. "Notify" is an optional value that
specifies whether to notify the model of a change. The default is false, but you generally want this to be true.
319
CFD-VIEW V2014.0 User Manual
setUnits(units [, notify])
Sets the units for the time display, (sec.,mins., etc.). The input is a string containing the units
getUnits()
Returns a string containing the units used in the display of the time value.
setTextColor(color [, notify])
Sets the text color for the Time object. The input color is a 4 tuple containing (R,G,B,A), where each value
is in the range 0 to 255.
getTextColor()
Returns the color of the display text as a 4 tuple containing (R,G,B,A), where each value is in the range 0
to 255.
getFontDesc()
Returns the font descriptor of the font used for the display of the time object.
setFontDesc(desc [, notify])
Sets the font for the display of the time object.. The input is a font descriptor that is used to request a
particular font.
isExponentialFormat()
Is used to determine if the numbers in the time display are in exponential form. The return values are
true or false.
setExponentialFormat(exp [, notify])
Specifies whether to display the numbers used in the time display in exponential form. The input value is
true or false.
toggleExponentialFormat([notify])
Toggles whether the display of the numbers used in the time display are in exponential form.
setPrecision(prec [, notify])
Sets the precision of the display of the numbers used in the time display. (i.e. number of digits to
display...)
getPrecision()
Returns the precision of the display of the numbers used in the time display. (i.e. number of digits to
display...)
320
Appendix Scripting
setSimTime(time [, notify])
Used to set the simulation time. This is typically not needed, as it set automatically by the file reader. The
input is a floating point number representing the time.
getSimTime()
Returns the value of the simulation time as a floating point number. The is the same number as the
displayed value.
See Also
Advanced Scripting - Time Annotation
Advanced Scripting - Text Annotation
Advanced Scripting - Text Scripting
AXES
Purpose
Axes is a set of XYZ coordinate axes that can be placed at any point on the screen to give a sense of orientation.
The Axes behave the same way as the Origin, except that the origin is fixed at location (0,0,0). Please see the
documentation on the Axes annotation object for more information.
Derived From
Advanced Scripting - VUObject
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
setPosition(x,y [, notify])
Sets the position of the axes in screen coordinates. The upper left corner is (0,0), with positive values of x
going right and positive y going down.
getPosition()
Returns a 2-tuple containing the x and y coordinates of the axes in screen coordinates.
321
CFD-VIEW V2014.0 User Manual
setAxisColor(clr [, notify])
Sets the color of axes lines. The input color is a 4 tuple containing (R,G,B,A), where each value is in the
range 0 to 255.
getAxisColor()
Returns the color of the axes lines. The returned value is a 4 tuple containing (R,G,B,A), where each value
is in the range 0 to 255.
setLabelColor(clr [, notify])
Sets the color of the X,Y, & Z labels. The input color is a 4 tuple containing (R,G,B,A), where each value is
in the range 0 to 255.
getLabelColor()
Returns the color of the X,Y, & Z labels. The returned value is a 4 tuple containing (R,G,B,A), where each
value is in the range 0 to 255.
setBillboard(FXbool bb [, notify])
Sets billboarding to True/False. Billboarding causes the XYZ labels to always face the screen.
getBillboard()
Returns a True/False value indicating whether bilboarding is used. Billboarding causes the XYZ labels to
always face the screen.
BOUNDS
Purpose
The Bounds Object is an annotation object which shows the size of the model. A scale is provided along all three
axes of the model. Please see the documentation on the Bounding Box annotation object for more information.
Derived From
Advanced Scripting - VUObject
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
322
Appendix Scripting
setBillboard(bb [, notify])
Sets billboarding to True/False. Billboarding causes the XYZ labels to always face the screen.
getBillboard()
Returns a True/False value indicating whether bilboarding is used. Billboarding causes the XYZ labels to
always face the screen.
setBoxColor(clr [, notify])
Sets the color of the bounding box. The input color is a 4 tuple containing (R,G,B,A), where each value is
in the range 0 to 255.
getBoxColor()
Returns the color of the bounding box. The returned value is a 4 tuple containing (R,G,B,A), where each
value is in the range 0 to 255.
setTickColor(clr [, notify])
Sets the color of the tick marks on the scale of the bounding box. The input color is a 4 tuple containing
(R,G,B,A), where each value is in the range 0 to 255.
getTickColor()
Returns the color of the tick marks on the scale of the bounding box. The returned value is a 4 tuple
containing (R,G,B,A), where each value is in the range 0 to 255.
setTextColor(clr [, notify])
Sets the color of the numbers on the scale of the bounding box. The input color is a 4 tuple containing
(R,G,B,A), where each value is in the range 0 to 255.
getTextColor()
Returns the color of the numbers on the scale of the bounding box. The returned value is a 4 tuple
containing (R,G,B,A), where each value is in the range 0 to 255.
setTextSize(size [, notify])
Sets the size of the numbers on the scale of the bounding box. The input size is a floating point value with
the units of pixels.
getTextSize()
Returns the size of the numbers on the scale of the bounding box. The returned size is a floating point
value with the units of pixels.
setTextWeight(wt [, notify])
Sets the weight of the line used to stroke the font. A weight of 1 indicates a 1 pixel thick line.
323
CFD-VIEW V2014.0 User Manual
getTextWeight()
Returns the weight of the line used to stroke the font. A weight of 1 indicates a 1 pixel thick line.
setLineWidth(lw [, notify])
Sets the width of the lines used. A width of 1 indicates a 1 pixel thick line.
getLineWidth()
Returns the width of the lines used. A width of 1 indicates a 1 pixel thick line.
setFont(fnt [, notify])
Specifies the font style used. See the Label object for a discussion of outline fonts
getFont()
Returns the font style used. See the Label object for a discussion of outline fonts
showMajorTicks(truefalse [, notify])
Specifies whether major ticks should be shown. The input is a True/False value.
toggleMajorTicks([notify])
showMinorTicks(truefalse [, notify])
Specifies whether minor ticks should be shown. The input is a True/False value.
toggleMajorTicks([notify])
toggleMinorTicks([notify])
showNumbers(truefalse [, notify])
Specifies whether a numerical scale should be shown. The input is a True/False value.
toggleNumbers([notify])
See Also
Advanced Scripting - Label
324
Appendix Scripting
LINE
PURPOSE
The Line is an annotation object that provides for lines and arrows in the 2D plane of the screen. The line can have
arrows at both ends, one end, or neither. This is useful for connecting labels with objects for annotation purposes.
Please see the documentation on the Line & Arrow annotation object for more information.
Derived From
Advanced Scripting - VUObject
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
setPosition(x,y [, notify])
Sets the starting position of the line. The end position is adjusted also to maintain the lines previous
orientation. The inputs are the x and y start position. The coordinates are in pixels measured from the
center of the window.
getPosition()
Returns the start position of the line as a 2-tuple. This is synonymous to getStartPoint(). The coordinates
are in pixels measured from the center of the window.
setShadow(truefalse [, notify])
hasShadow()
toggleShadow([notify])
setShadowColor(clr [, notify])
Sets the color of the simple shadow if one is displayed. The input color is a 4 tuple containing (R,G,B,A),
where each value is in the range 0 to 255.
getShadowColor()
Returns the color of the simple shadow. The returned value is a 4 tuple containing (R,G,B,A), where each
value is in the range 0 to 255.
325
CFD-VIEW V2014.0 User Manual
setStartPoint(x,y [, notify])
Sets the coordinated of the start point to the x and y input values. The coordinates are in pixels measured
from the center of the window.
getStartPoint()
Returns the start position of the line as a 2-tuple. The coordinates are in pixels measured from the center
of the window.
setEndPoint(x,y [, notify])
Sets the coordinated of the end point to the x and y input values. The coordinates are in pixels measured
from the center of the window.
getEndPoint()
Returns the end position of the line as a 2-tuple. The coordinates are in pixels measured from the center
of the window.
getColor()
Returns the color of the line. The returned value is a 4 tuple containing (R,G,B,A), where each value is in
the range 0 to 255.
setColor(clr [, notify])
Sets the color of the line. The input color is a 4 tuple containing (R,G,B,A), where each value is in the
range 0 to 255.
getLineWidth()
setLineWidth(w [, notify])
setArrowStyle(style [, notify])
getArrowStyle()
getArrowBase()
setArrowBase(arrowBase [, notify])
326
Appendix Scripting
getArrowLength()
setArrowLength(arrowLength [, notify])
Useful Constants
Arrow Styles
ARROW_STYLE_NONE
ARROW_STYLE_BEGIN
ARROW_STYLE_END
ARROW_STYLE_BOTH
See Also
Advanced Scripting - Box
Advanced Scripting - Oval
Advanced Scripting - Text
Advanced Scripting - Label
ORIGIN
Purpose
The Origin object display a set of XYZ axes located at the origin (0,0,0). The Axes object is the same, except that it
can be placed at any location. These are useful for showing the orientation of the model. Please see the
documentation on the Origin annotation object for more information.
Derived From
Advanced Scripting - VUObject
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
setAxisColor(clr [, notify])
Sets the color of axes lines. The input color is a 4 tuple containing (R,G,B,A), where each value is in the
range 0 to 255.
327
CFD-VIEW V2014.0 User Manual
getAxisColor()
Returns the color of the axes lines. The returned value is a 4 tuple containing (R,G,B,A), where each value
is in the range 0 to 255.
setLabelColor(clr [, notify])
Sets the color of the X,Y, & Z labels. The input color is a 4 tuple containing (R,G,B,A), where each value is
in the range 0 to 255.
getLabelColor()
Returns the color of the X,Y, & Z labels. The returned value is a 4 tuple containing (R,G,B,A), where each
value is in the range 0 to 255.
setBillboard(bb [, notify])
Sets billboarding to True/False. Billboarding causes the XYZ labels to always face the screen.
getBillboard()
Returns a True/False value indicating whether bilboarding is used. Billboarding causes the XYZ labels to
always face the screen.
Purpose
VUData is a base class for most CFD-VIEW data objects, such as volumes, surfaces, etc. VUData is an abstract base
class, which means that other objects are derived from it, but there will be no instances of it in its base form.
VUData provides access to some fundamental items, such as nodal data, calculator expressions, etc. Please see
the documentation on the various Display and Control Panel settings for more information on how to change what
is displayed.
Derived From
Advanced Scripting - VUObject
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
328
Appendix Scripting
setAttNames(names)
Sets the names of all of the attributes at one time. The names should be passed as a single string, with
the individual attribute names delimited by tabs.
setAttUnits(units)
Sets the units of all of the attributes at one time. The units should be passed as a single string, with the
individual attribute units delimited by tabs.
getAttNames()
Returns the names of all of the attributes at one time. The names are returned as a single string, with the
individual attribute names delimited by tabs.
getAttUnits()
Returns the units of all of the attributes at one time. The units are returned as a single string, with the
individual attribute units delimited by tabs.
getAttName(index)
setAttName(index, name)
Sets the name of the attribute at the given index to the input name.
getAttUnit(index)
setAttUnit(index,units)
Sets the name of the attribute at the given index to the input units.
numI()
numJ()
numK()
setExpression(expr)
Sets the calculator expression for this data object to the input string. The expression will be executed the
next time the data flow network runs.
329
CFD-VIEW V2014.0 User Manual
getExpression()
getAttributeIndex(attname)
Returns the index of the attribute that has the given name. The index is returned as -1 if the given
attribute name does not exist.
numAtts()
numElms()
Returns the number of elements in the data object. For example, a triangular surface in made of triangle
elements, so this function would return the number of triangles in that type of surface.
numVerts()
getNodalData(nodeindex, attname)
This gets the value of the nodal data named "attname" for the node at "nodeindex"
This sets the value of the nodal data named "attname" for the node at "nodeindex"
getCellData(cellindex, attname)
This gets the value of the cell data named "attname" for the cell at "cellindex".
This sets the value of the cell data named "attname" for the cell at "cellindex".
setColorAtt(attname [, notify])
Sets the attribute used to color this data object. The input is the name of the attribute.
getColorAtt()
Returns the index of the attribute used to color this data object.
getColorAttName()
Returns the name of the attribute used to color this data object.
330
Appendix Scripting
Sets the three attributes used for vectors. New for version v2007, the three components can be selected
arbitrarily. This function takes the names of the three components of the vector and a label for the vector.
For example, a velocity vector could be created by supplying "U","V","W", as the components and
"Velocity" as the label.
Sets the indices of the three attributes used for vectors. New for version v2007, the three components
can be selected arbitrarily. This function takes the three indices of the vector variables and a label for the
vector. This is similar to the function above except that it uses indices instead of names.
getVectorAtt(i)
Returns the index of the i'th attribute of the currently selected vector. The component i is either 0, 1, or 2.
getVectorAttName(i)
Returns the name of the i'th attribute of the currently selected vector. The component i is either 0, 1, or 2.
getVectorAttNames()
Returns the names of the attributes of the currently selected vector, and the vector label in a tab
separated string.
getVectorNLabel()
setExtraAtt(index [, notify])
Sets the index of the attribute used to determine such things as ball diameter sizing, ribbon twist angle,
etc.
getExtraAtt()
Returns the index of the attribute used to determine such things as ball diameter sizing, ribbon twist
angle, etc.
getExtraAttName()
Returns the index of the attribute used to determine such things as ball diameter sizing, ribbon twist
angle, etc.
getRange(index)
Returns a 2-tuple that contains the upper and lower bounds of the values of the attribute at the given
index.
minimum(index)
Returns the lower bound of the values of the attribute at the given index.
331
CFD-VIEW V2014.0 User Manual
maximum(index)
Returns the upper bound of the values of the attribute at the given index.
setPointColor(color [, notify])
Sets the color of the points display, if the points are not color by value.
getPointColor()
Returns the color of the points display, if the points are not colored by value.
setPointSize(size [, notify])
Sets the size of displayed points, if the points are not sized by an attribute, such as pressure.
getPointSize()
Returns the size of displayed points, if the points are not sized by an attribute, such as pressure.
setVectorColor(color [, notify])
Sets the color of the vector display, if the vectors are not colored by value.
getVectorColor()
Returns the color of the vector display, if the vectors are not colored by value.
getSurfColor()
Returns the color of the surface display, if the surface is not colored by value.
setSurfColor(color [, notify])
Sets the color of the surface display, if the surface is not colored by value.
getShininess()
Returns the shininess of this data object. The returned value is between 0 and 128. This typically only
applies to surfaces.
setShininess(shine [, notify])
Sets the shininess of this data object. The input value is between 0 and 128. This typically only applies to
surfaces.
setClipLo(clip [, notify])
Sets the value of the extra variable below which point display is suppressed.
setClipHi(clip [, notify])
Sets the value of the extra variable above which point display is suppressed.
332
Appendix Scripting
getClipLo()
Returns the value of the extra variable below which point display is suppressed.
getClipHi()
Returns the value of the extra variable above which point display is suppressed.
bounds()
getRenderMode()
Returns the rendering mode of the data object. The mode is a union of the active modes, (e.g. grid,
points, etc.). The base modes are shown below. To determine if a mode is active, a bitwise AND of the
returned value and the constant below is performed.
setRenderMode(mode [, notify])
Sets the rendering mode of the data object. The mode is the union of the desired modes, (e.g. grid,
points, etc.). The base modes are shown below.
setSymLo(lo [, notify])
Sets the index for the first copy of the symmetry display.
getSymLo()
Returns the index for the first copy of the symmetry display.
setSymHi(hi [, notify])
Sets the index for the last copy of the symmetry display.
getSymHi()
Returns the index for the last copy of the symmetry display.
getSymMin()
getSymMax()
setSymmetry(symmode [, notify])
Sets the symmetry mode. The available modes are shown below.
333
CFD-VIEW V2014.0 User Manual
getSymmetry()
Returns the current symmetry mode. The available modes are shown below.
setSymAxisMode(axismode)
Sets the axis used in the symmetry display. The return value is one of the values below.
getSymAxisMode()
Returns the axis used in the symmetry display. The return value is one of the values below.
setSymAxis(axis[, notify])
Sets the axis used with the custom axis mode. The input is a 3-tuple containing the elements of a unit
vector specifying the symmetry axis.
getSymAxis()
Returns the axis used with the custom axis mode. The returned value is a 3-tuple containing the elements
of a unit vector specifying the symmetry axis.
setAngle(angle [, notify])
Sets the angle between the copies in the symmetry display. For example, if there are 4 quadrants in a
symmetry display, the angle would be 90 degrees. In the TRANSLATE mode, the angle is a distance
between copies instead.
getAngle()
Sets the angle between the copies in the symmetry display. For example, if there are 4 quadrants in a
symmetry display, the angle would be 90 degrees. In the TRANSLATE mode, the angle is a distance
between copies instead.
setVectorThin(percent [, notify])
getVectorThin()
Useful Constants
Symmetry Modes
SYM_NONE
SYM_PLANAR
SYM_ROTATIONAL
SYM_TRANSLATE
SYM_XFLIPROT
SYM_YFLIPROT
SYM_ZFLIPROT
SYM_XYFLIPROT
334
Appendix Scripting
SYM_XZFLIPROT
SYM_YZFLIPROT
SYM_XYZFLIPROT
Axis Modes
SYM_X_AXIS
SYM_Y_AXIS
SYM_Z_AXIS
SYM_CUSTOM_AXIS
Rendering Modes
RENDER_NONE
RENDER_POINTS
RENDER_GRID
RENDER_VECTORS
RENDER_CONTOURS
RENDER_OUTLINE
RENDER_SURF_SOLID
RENDER_SURF_COLORED
RENDER_SURF_MAPPED
RENDER_SURF_FLOODED
RENDER_SURF_TEXTURED
RENDER_SURF_HIDDEN
RENDER_NORM_NONE
RENDER_NORM_FACET
RENDER_NORM_VERTEX
RENDER_LINE_HEAD
RENDER_LINE_TAIL
RENDER_LINE_SIMPLE
RENDER_LINE_TUBE
RENDER_LINE_RIBBON
RENDER_NODE_POINTS
RENDER_NODE_CUBE
RENDER_NODE_BALL
RENDER_HANDLES
RENDER_BLANK
RENDER_NODE_SIZE
RENDER_VECTORPROJ
RENDER_VECTORUNIHEAD
RENDER_VECTORUNITAIL
RENDER_VECTORMAXIMIZED
RENDER_NODE_TRUE
RENDER_NODE_SPLAT
See Also
Advanced Scripting - VULine
Advanced Scripting - VUPoint
Advanced Scripting - VUSurface
Advanced Scripting - VUVolume
335
CFD-VIEW V2014.0 User Manual
VUPOINT
Purpose
The VUPoint object is a very thin derivative of the VUData base class, and is used mostly for spray data. This object
contains nodal data with no connectivity. Please see the documentation on the various Display and Control Panel
settings for more information on how to change what is displayed.
Derived From
Advanced Scripting - VUData
Member Functions
There are no additional script callable functions beyond those of the VUData base class.
See Also
Advanced Scripting - VUData
VULine is a base class for line drawing, The polyline, VUPolyLine, is most used derived class, and is
used for such things as particle traces, line probes, etc. The lines and polylines can also be used as input
to the plotting operations. Please see the documentation on the various Display and Control Panel
settings for more information on how to change what is displayed.
Derived From
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality
inherited from the base class, click on the object in the Derived From section above. Several of the
functions' arguments contained "notify", which is an optional value that specifies whether to notify the
model of a change. The default is false, but you generally want this to be true.
• setTubeDiameter(diam [, notify])
Sets the tube diameter used when drawing tubes. This dimension is measured in model units.
• getTubeDiameter()
Returns the tube diameter used when drawing tubes. This dimension is measured in model units.
336
Appendix Scripting
• setRibbonAngle(angle [, notify])
Sets the starting twist angle when drawing ribbons. The twist angle is in degrees.
• getRibbonAngle()
Returns the starting twist angle when drawing ribbons. The twist angle is in degrees.
• setPointStride(stride [, notify])
The points on a line can be drawn strided, (i.e. every n'th point). The input is an integer specifying the
stride.
• getPointStride()
• setPointOffset(offset [, notify])
This specifies which point is the first point drawn when strided drawing is used.
• getPointOffset()
Returns which point is the first point drawn when strided drawing is used.
• setLineWidth(width [, notify])
• getLineWidth()
• setLineColor(color [, notify])
Sets the color of the line. The input color is a 4 tuple containing (R,G,B,A), where each value is in the
range 0 to 255.
• getLineColor()
Returns the color of the line. The returned value is a 4 tuple containing (R,G,B,A), where each value is in
the range 0 to 255.
• saveAsPLT(filename)
Saves the line in the PLT file format to the filename given. The return value is True/False based on the
success or failure of the operation.
• saveAsTAB(filename)
Saves the line in the TAB file format to the filename given. The return value is True/False based on the
success or failure of the operation.
337
CFD-VIEW V2014.0 User Manual
VUPOLYLINE
Purpose
VUPolyLine is a set of VULines, and is used to as output for such things as particle traces, line probes, slices of
surfaces, etc. The Polylines can also be used as input to the plotting operations. Please see the documentation on
the various Display and Control Panel settings for more information on how to change what is displayed.
Derived From
Advanced Scripting - VULine
Member Functions
There are no additional script callable functions beyond those of the base class. To see the functionality
inherited from the base class, click on the object in the Derived From section above.
See Also
Advanced Scripting - VULine
VUSURFACE
Purpose
VUSurface is a base class for the structured surface, VURegSurface, and the unstructured base class, VUIrrSurface.
It is an abstract base class, which means that there are no instances of VUSurface by itself. However, most of the
surface.properties are controlled using the member functions of this class. Please see the documentation on the
various Display and Control Panel settings for more information on how to change what is displayed.
Derived From
Advanced Scripting - VUData
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
338
Appendix Scripting
saveAsSTL(filename)
Saves the surface in the STL file format to the filename given. The return value is True/False based on the
success or failure of the operation.
saveAsVOF(filename)
Saves the line in the View Object File (VOF) file format to the filename given. The return value is
True/False based on the success or failure of the operation.
getGridColor()
Returns the color of the grid, if the grid is not colored by one of the simulation variables. The returned
value is a 4 tuple containing (R,G,B,A), where each value is in the range 0 to 255.
setGridColor(color [, notify])
Sets the color of the grid, if the grid is not colored by one of the simulation variables. The input color is a
4 tuple containing (R,G,B,A), where each value is in the range 0 to 255.
getOutlineColor()
Returns the color of the surface outline. The returned value is a 4 tuple containing (R,G,B,A), where each
value is in the range 0 to 255.
setOutlineColor(color [, notify])
Sets the color of the surface outline. The input color is a 4 tuple containing (R,G,B,A), where each value is
in the range 0 to 255.
getContourLineColor()
Returns the color of the contours, if the contour is not colored by one of the simulation variables. The
returned value is a 4 tuple containing (R,G,B,A), where each value is in the range 0 to 255.
setContourLineColor(color [, notify])
Sets the color of the contours, if the contour is not colored by one of the simulation variables. The input
color is a 4 tuple containing (R,G,B,A), where each value is in the range 0 to 255.
getOutlineWidth()
setOutlineWidth(width [, notify])
getGridWidth()
339
CFD-VIEW V2014.0 User Manual
setGridWidth(width [, notify])
getContourLineWidth()
setContourLineWidth(width [, notify])
VUIRRSURFACE
Purpose
VUIrrSurface is a base class for the unstructured surface classes in CFD-VIEW. It is an abstract base class, which
means there are no instances of VUIrrSurface itself. Please see the documentation on the various Display and
Control Panel settings for more information on how to change what is displayed.
Derived From
Advanced Scripting - VUSurface
Member Functions
There are no additional script callable functions beyond those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above.
See Also
Advanced Scripting - VURegSurface
Advanced Scripting - VUTriSurface
Advanced Scripting - VUQuadSurface
Advanced Scripting - VUPolySurface
VUTRISURFACE
Purpose
VUTriSurface is an unstructured surface made up of triangular faces. Please see the documentation on the various
Display and Control Panel settings for more information on how to change what is displayed.
340
Appendix Scripting
Derived From
VAdvanced Scripting - VUIrrSurface
Member Functions
There are no additional script callable functions beyond those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above.
See Also
Advanced Scripting - VUQuadSurface
Advanced Scripting - VUPolySurface
VUQUADSURFACE
Purpose
VUQuadSurface is an unstructured surface made up of quad faces. Please see the documentation on the various
Display and Control Panel settings for more information on how to change what is displayed.
Derived From
Advanced Scripting - VUIrrSurface
Member Functions
There are no additional script callable functions beyond those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above.
See Also
Advanced Scripting - VUTriSurface
Advanced Scripting - VUPolySurface
VUPOLYSURFACE
Purpose
The VUPolySurface object is set of polygonal faces stitched together to form a surface. The individual faces can
have any number of sides. Please see the documentation on the various Display and Control Panel settings for
more information on how to change what is displayed.
341
CFD-VIEW V2014.0 User Manual
Derived From
Advanced Scripting - VUIrrSurface
Member Functions
There are no additional script callable functions beyond those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above.
See Also
Advanced Scripting - VUTriSurface
Advanced Scripting - VUQuadSurface
VUREGSURFACE
Purpose
VURegSurface is a structured grid surface in which the nodal connectivity is implied. The nodes are arranged in an
I x J manner. Please see the documentation on the various Display and Control Panel settings for more information
on how to change what is displayed.
DERIVED FROM
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality
inherited from the base class, click on the object in the Derived From section above.
numI()
Returns the number of nodes in the I direction for this structured grid.
numJ()
Returns the number of nodes in the J direction for this structured grid.
See Also
Advanced Scripting - VUTriSurface
Advanced Scripting - VUQuadSurface
Advanced Scripting - VUPolySurface
342
Appendix Scripting
VUVOLUME
Purpose
VUVolume is the base class from which all volumes are ultimately derived. The direct derivations include the
structured VURegVolume, the unstructured VUIrrVolume, and the unstructured VUPolyVolume. Please see the
documentation on the various Display and Control Panel settings for more information on how to change what is
displayed.
Derived From
Advanced Scripting - VUData
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality
inherited from the base class, click on the object in the Derived From section above.
volume()
See Also
Advanced Scripting - VURegVolume
Advanced Scripting - VUTetVolume
Advanced Scripting - VUHexVolume
Advanced Scripting - VUMixVolume
Advanced Scripting - VUPolyVolume
VUIRRVOLUME
Purpose
VUIrrVolume is a base class for the unstructured tetrahedral, hexahedral, and mixed volumes in CFD-VIEW. It is an
abstract base class, which means there will be no instances of VUIrrVolume itself. Please see the documentation
on the various Display and Control Panel settings for more information on how to change what is displayed.
Derived From
Advanced Scripting - VUVolume
Member Functions
There are no additional script callable functions beyond those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above.
343
CFD-VIEW V2014.0 User Manual
See Also
Advanced Scripting - VURegVolume
Advanced Scripting - VUHexVolume
Advanced Scripting - VUMixVolume
Advanced Scripting - VUTetVolume
Advanced Scripting - VUPolyVolume
VUHEXVOLUME
Purpose
The VUHexVolume is an unstructured, 3D grid made of entirely hexahedral cells. Please see the documentation on
the various Display and Control Panel settings for more information on how to change what is displayed.
Derived From
Advanced Scripting - VUIrrVolume
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality
inherited from the base class, click on the object in the Derived From section above.
See Also
Advanced Scripting - VUTetVolume
Advanced Scripting - VUMixVolume
Advanced Scripting - VUPolyVolume
VUMIXVOLUME
Purpose
VUMixVolume is an unstructured, 3D grid that is made up of a mix of hexahedral, tetrahedral, and prismatic cells.
Please see the documentation on the various Display and Control Panel settings for more information on how to
change what is displayed.
Derived From
Advanced Scripting - VUIrrVolume
Member Functions
344
Appendix Scripting
There are no additional script callable functions beyond those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above.
See Also
Advanced Scripting - VUTetVolume
Advanced Scripting - VUHexVolume
Advanced Scripting - VUPolyVolume
VUTETVOLUME
Purpose
VUTetVolume is an unstructured, 3D grid made up of tetrahedral cells. Please see the documentation on the
various Display and Control Panel settings for more information on how to change what is displayed.
Derived From
Advanced Scripting - VUIrrVolume
Member Functions
There are no additional script callable functions beyond those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above.
See Also
Advanced Scripting - VUHexVolume
Advanced Scripting - VUMixVolume
Advanced Scripting - VUPolyVolume
VUPOLYVOLUME
Purpose
VUPolyVolume is an unstructured, 3D grid made up of polyhedral cells. The polyhedral cells are bound by
polygonal faces, and there is no limit on the number of faces. Please see the documentation on the various Display
and Control Panel settings for more information on how to change what is displayed.
Derived From
Advanced Scripting - VUVolume
345
CFD-VIEW V2014.0 User Manual
Member Functions
There are no additional script callable functions beyond those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above.
See Also
Advanced Scripting - VURegVolume
Advanced Scripting - VUHexVolume
Advanced Scripting - VUMixVolume
Advanced Scripting - VUTetVolume
VUREGVOLUME
Purpose
VURegVolume is a structured 3D grid, in which the nodal connectivity is implied. The grid is arranged in an
(I x J x K) manner. Please see the documentation on the various Display and Control Panel settings for more
information on how to change what is displayed.
Derived From
Advanced Scripting - VUVolume
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality
inherited from the base class, click on the object in the Derived From section above.
numI()
Returns the number of nodes in the I direction for this structured grid.
numJ()
Returns the number of nodes in the J direction for this structured grid.
numK()
Returns the number of nodes in the K direction for this structured grid.
See Also
Advanced Scripting - VUTetVolume
Advanced Scripting - VUMixVolume
Advanced Scripting - VUHexVolume
346
Appendix Scripting
VUGROUP
Purpose
VUGroup is used for organizing objects into a hierarchy of groups and groups of groups. It also serves as the base
class for the Scene and Document objects upon which the models are based. Please see the documentation on
Grouping for more information.
Derived From
Advanced Scripting - VUObject
MEMBER FUNCTIONS
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
select([notify])
Places the group, and all of its children, in the selected state.
deselect([notify])
Places the group, and all of its children, in the deselected state.
bounds()
Returns the cumulative geometry bounds of the group and its children as a 6-tuple. The output is of the
form (xmin,xmax,ymin,ymax,zmin,zmax)
no()
child(index)
Returns a pointer to the child object at the given index. The child object may also be a group.
getChildren()
Returns a list of the all of the children of the group. Some of the children in the list may also be groups.
347
CFD-VIEW V2014.0 User Manual
Insert a child object into the group at the given index. The inputs are the index, and a pointer to the new
child object. The object can be a child of only one group/scene. Care must be taken to remove it from
any group in which the child is already a member. The object should be added to the new group before
being removed from the old group.
prepend(obj [, notify])
Insert a child object in the group as the first object. The input is a pointer to the new child object. The
object can be a child of only one group/scene. Care must be taken to remove it from any group in which
the child is already a member. The object should be added to the new group before being removed from
the old group.
append(obj [, notify])
Insert a child object in the group as the last object. The input is a pointer to the new child object. The
object can be a child of only one group/scene. Care must be taken to remove it from any group in which
the child is already a member. The object should be added to the new group before being removed from
the old group.
remove(index [, notify])
Remove a child object from the group. The input is a pointer to the child object. The child object will be
lost if it is not inserted into another group, or the scene. The object should be added to the new group
before being removed from the old group.
clear([notify])
Remove all child objects from the group. The child objects will be lost if they are not inserted into
another group, or the scene. The objects should be added to the new group before being removed from
the old group.
See Also
Advanced Scripting - VUScene
Advanced Scripting - VUDocument
VUSCENE
Purpose
VUScene is a group object with some additional object and model management features. It serves as the base
class for VUDocument, which is what will be used in most cases to manipulate the model. Please see the
documentation on the File, Edit, and Tool menus for more information on model management.
348
Appendix Scripting
Derived From
Advanced Scripting - VUGroup
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
selectAllVolumes([notify])
Places all volume objects in the selected state, and everything else in the deselected state.
selectAllSurfaces([notify])
Places all surface objects in the selected state, and everything else in the deselected state.
selectAllLines([notify])
Places all line objects in the selected state, and everything else in the deselected state.
selectAllPoints([notify])
Places all point objects in the selected state, and everything else in the deselected state.
Places all objects that have the given key in the selected state, and everything else in the deselected state
depending on the appended flag. If the appended flag is True, the new selections are added to the
previous selections. The key is a string that all objects from the same zone share, and is the string shown
in the zone column in the object explorer.
Places all objects that have the given type in the selected state, and everything else in the deselected
state depending on the appended flag. If the appended flag is True, the new selections are added to the
previous selections. The type is a string that indicates whether an object is an inlet, outlet, wall, etc., and
is the string shown in the type column in the object explorer.
selectAllObjects([notify]
deselectAllObjects([notify])
349
CFD-VIEW V2014.0 User Manual
deleteObject(obj [, notify])
Instructs this scene object to delete the given object properly, and remove it from groups, inputs to other
operations, etc. This is proper way to remove objects. Recall that notify should be True.
deleteAllObjects([notify])
Instructs this scene object to delete all objects properly, and remove them from groups, inputs to other
operations, etc. This is proper way to remove objects. Recall that notify should be True.
createSimpleObject(type [, notify])
This is used to create one of the simple objects from the list below. These are objects that do not have
source operations, such as annotation objects. The input type is one of the constants in the list below.
The return value is True/False to indicate success or failure.
This is used to create one of the general objects from the list below. These are objects that are part of the
data flow network, and are created by operators. The inputobjects is a list of objects that will be the
inputs to the operator. The type is one of the constants in the list below. The return value is True/False
to indicate success or failure.
createTimeObject(reader [, notify])
This is used to create a transient time object. The input is a pointer to the file reader operation from
which the time will be read.
Instructs the scene to create a new file reader and read the data from the file. The inputs are the data
filename, the file reader switches, and the simulation number if it is a DTF file. Please see the
documentation on the VUFileReader operation for more information. The return from the function is an
error string. The default value for switches is FILEDTF, the default simulation number is 1, and the default
notify is False.
renameUnits(attname, unitname)
Renames the units for the attribute given. The inputs are strings for the attribute name and the new
units.
renameAtts(oldattname, &newattname)
Renames the attribute given to a new name. The inputs are strings for the old attribute name and the
new name.
getNumColormaps()
getColormap(index)
350
Appendix Scripting
getColormapName(index)
findColormap(name)
Given the name of a colormap, this function returns an index to the actual colormap that has that name.
doesAttributeExist(attname)
Returns a True/False value indicating whether the given attribute name exist anywhere in the scene.
appendKnownVector(attnames)
This adds a new vector to the list of known vectors. It takes the names of the three components of the
vector and a label for the vector combined into one string. For example, a velocity vector could be created
by supplying "U","V","W", as the components and "Velocity" as the label. Tab characters are used to
separate the components of the single string ("U\tV\tW\tVelocity")
Sets the vector attributes for a list of objects. The inputs are the object list and vector attribute names. It
takes the names of the three components of the vector and a label for the vector combined into one
string. For example, a velocity vector could be created by supplying "U","V","W", as the components and
"Velocity" as the label. Tab characters are used to separate the components of the single string
("U\tV\tW\tVelocity")
getVectorHeadScale(attnames)
Returns the vector head scale for the given vector attribute. It takes the names of the three components
of the vector and a label for the vector combined into one string. For example, a velocity vector could be
created by supplying "U","V","W", as the components and "Velocity" as the label. Tab characters are used
to separate the components of the single string ("U\tV\tW\tVelocity")
Sets the vector head scale for the given vector attribute to the given value. The return value is True/False
based on success or failure. It takes the names of the three components of the vector and a label for the
vector combined into one string. For example, a velocity vector could be created by supplying
"U","V","W", as the components and "Velocity" as the label. Tab characters are used to separate the
components of the single string ("U\tV\tW\tVelocity")
getVectorTailScale(attnames)
Returns the vector tail scale for the given vector attribute. It takes the names of the three components of
the vector and a label for the vector combined into one string. For example, a velocity vector could be
created by supplying "U","V","W", as the components and "Velocity" as the label. Tab characters are used
to separate the components of the single string ("U\tV\tW\tVelocity")
Sets the vector tail scale for the given vector attribute to the given value. The return value is True/False
based on success or failure. It takes the names of the three components of the vector and a label for the
351
CFD-VIEW V2014.0 User Manual
vector combined into one string. For example, a velocity vector could be created by supplying
"U","V","W", as the components and "Velocity" as the label. Tab characters are used to separate the
components of the single string ("U\tV\tW\tVelocity")
Sets the minimum vector magnitude that will be displayed. The return value is True/False based on
success or failure. It takes the names of the three components of the vector and a label for the vector
combined into one string. For example, a velocity vector could be created by supplying "U","V","W", as
the components and "Velocity" as the label. Tab characters are used to separate the components of the
single string ("U\tV\tW\tVelocity")
Sets the minimum vector magnitude that will be displayed. The return value is True/False based on
success or failure. It takes the names of the three components of the vector and a label for the vector
combined into one string. For example, a velocity vector could be created by supplying "U","V","W", as
the components and "Velocity" as the label. Tab characters are used to separate the components of the
single string ("U\tV\tW\tVelocity")
setVectorMaximum(attnames,maximum [, notify])
This is used for manual vector scaling, but it is typically easier to use the automatic
vectorMaximize/vectorMaximizeAll . Vectors are scaled from 0 to a maximum size that fits the model
display nicely. This sets the maximum vector magnitude that will be scaled to the maximum vector display
size. The inputs are the vector attribute name and the maximum vector magnitude. The return value is
True/False based on success or failure.
getVectorMaximum(attnames)
This is used for vector scaling. Vectors are scaled from 0 to a maximum size that fits the model display
nicely. This returns the maximum vector magnitude that will be scaled to the maximum vector display
size. It takes the names of the three components of the vector and a label for the vector combined into
one string. For example, a velocity vector could be created by supplying "U","V","W", as the components
and "Velocity" as the label. Tab characters are used to separate the components of the single string
("U\tV\tW\tVelocity")
vectorMaximize(objects [, notify])
Maximizes the vector display to the list of objects provided. The return value is True/False based on
success or failure.
vectorMaximizeAll(attnames [, notify])
Maximizes the vector display to the list of all objects in the model for the given vecto. The return value is
True/False based on success or failure. It takes the names of the three components of the vector and a
label for the vector combined into one string. For example, a velocity vector could be created by supplying
"U","V","W", as the components and "Velocity" as the label. Tab characters are used to separate the
components of the single string ("U\tV\tW\tVelocity")
group(objects [, notify])
352
Appendix Scripting
ungroup(objects [, notify])
reflow()
Forces a reflow of the data flow network. This is used when there have been changes to such things as
cutting plane locations, and an immediate reflow is required. Typically, it is okay to wait for the automatic
reflow that will occur after the script has completed.
getSelectionColor()
Returns the color used to display selected objects. The returned value is a 4 tuple containing (R,G,B,A),
where each value is in the range 0 to 255.
setSelectionColor(sc)
Sets the color used to display selected objects. The input color is a 4 tuple containing (R,G,B,A), where
each value is in the range 0 to 255.
getDefaultColor()
Returns the color used to display objects when not selected and the color has not be set for an individual
object. The returned value is a 4 tuple containing (R,G,B,A), where each value is in the range 0 to 255.
setDefaultColor(dc)
Sets the color used to display objects when not selected and the color has not be set for an individual
object. The input color is a 4 tuple containing (R,G,B,A), where each value is in the range 0 to 255.
reread([notify])
Forces a reread of all data files. This should be followed by a call to reflow() if an immediate reread is
required.
getReader(filename [, fullpath])
Returns a pointer to the file reader operator with the given filename. The fullpath argument is optional,
and instructs the function to use the full path of the file (including directory) if it is True, or to use the
short file name (without directory) if False. The default value is False, (indicating no directory info).
Useful Constants
Simple Objects
VUScene.ANN_ORIGIN
VUScene.ANN_LABEL
VUScene.ANN_AXES
VUScene.ANN_LINE
VUScene.ANN_BOX
VUScene.ANN_IMAGEBOX
353
CFD-VIEW V2014.0 User Manual
VUScene.ANN_TEXT
VUScene.ANN_OVAL
VUScene.ANN_BOUNDS
VUScene.ANN_LEGEND
General Objects
VUScene.ANN_PLOT
VUScene.ANN_CARPETPLOT
VUScene.VOL_IPLANE
VUScene.VOL_JPLANE
VUScene.VOL_KPLANE
VUScene.VOL_ILINE
VUScene.VOL_JLINE
VUScene.VOL_KLINE
VUScene.VOL_ARBCUT
VUScene.VOL_XCUT
VUScene.VOL_YCUT
VUScene.VOL_ZCUT
VUScene.VOL_TRACE
VUScene.VOL_BORDER
VUScene.VOL_PROBE
VUScene.VOL_NET
VUScene.VOL_STRIPCHART
VUScene.VOL_LINEPROBE
VUScene.VOL_ISOSURF
VUScene.SRF_ILINE
VUScene.SRF_JLINE
VUScene.SRF_PROBE
VUScene.SRF_NET
VUScene.SRF_STRIPCHART
VUScene.SRF_LINEPROBE
VUScene.SRF_TRACE
VUScene.SRF_ISOCURVE
VUScene.SRF_MERGE
VUScene.SRF_ARBCUT
VUScene.SRF_XCUT
VUScene.SRF_YCUT
VUScene.SRF_ZCUT
VUScene.SRF_REDUCE
See Also
Advanced Scripting - VUDocument
354
Appendix Scripting
VUDOCUMENT
Purpose
The models in CFD-VIEW are VUDocuments. The member functions of this class provide access to many parts of
the model, including object management and animation control. It is derived from VUScene, which is a bit lower
level than VUDocument, and VUScene is derived from VUGroup. It is this group behavior that is used to organize
the model. Please see the documentation on the File, Edit, and Tool menus for more information on model
management, and the Animation Control Panel for information on how to control the animation settings.
Derived From
Advanced Scripting - VUScene
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality
inherited from the base class, click on the object in the Derived From section above.
redraw()
close()
Deletes all of the objects in the model, and closes it, (without asking permission). Returns True on success.
clearUndo()
Clears the Undo/Redo list in the model. This is useful for freeing the memory used by the undo system,
but operations to that point are no longer "undoable". Returns True on success.
setAnimInitialState()
Records the settings of all objects in the model to be used as the initial conditions for animation.
setAnimFinalState()
Records the settings of all objects in the model to be used as the final conditions for animation.
setAnimCurrentFrame(frame)
Sets the current frame of the animation. The input 'frame' ranges from 1 to the total number of frames.
setNumAnimFrames(nf)
getNumAnimFrames()
355
CFD-VIEW V2014.0 User Manual
getAnimCurrentFrame()
See Also
Advanced Scripting - VUScene
VUPLOT
Purpose
VUPlot is the object that brings plotting to CFD-VIEW's data flow architecture. It is a collection of the plotter itself,
plus the dialog panel in which the external plotter resides. It is created by the plotting operator and the stripchart
operator. Please see the documentation on the Plotter object for more information. This class contains other
classes needed to create and display the plot. These are the PlotPanel, the FXPlotter, and the FXGraph.
Derived From
Advanced Scripting - VUObject
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contained "notify", which is an optional value that specifies whether to notify the model of a change. The default
is false, but you generally want this to be true.
setPosition(x,y)
Sets the position of the plot in the 3D Viewer if the internal mode is chosen. The inputs are the x and y
coordinates in pixels measured from the center of the display window.
getPosition()
Sets the position of the plot in the 3D Viewer if the internal mode is chosen. The return is a 2-tuple that
containes the x and y coordinates in pixels measured from the center of the display window.
setSize(w,h)
Sets the size of the plot in the 3D Viewer if the internal mode is chosen. The inputs are the width and
height measured in pixels.
getSize()
Returns the size of the plot in the 3D Viewer if the internal mode is chosen. The return values is a 2-tuple
that contains the width and height measured in pixels.
356
Appendix Scripting
setShown(truefalse [, notify])
plotLocation()
plotLocation(location [, notify])
getPlotter()
Returns a pointer to the plotter window (FXPlotter) where the graphs are displayed.
getPlotPanel()
Returns a pointer to the dialog panel (PlotPanel) that contains the plotter.
Useful Constants
Plot Location
VUPlot.PLOT_LOCATION_HIDDEN
VUPlot.PLOT_LOCATION_INTERNAL
VUPlot.PLOT_LOCATION_EXTERNAL
Purpose
These three classes are used in displaying line plots in CFD-VIEW. They are not VIEW objects per se, but are
important parts of VUPlot, which is used to display VUPlotOp and VUStripChart outputs. The PlotPanel is simply
the dialog box class in which the plot is shown. The plot itself is an FXPlotter class, in which the individual curves
are FXGraph instances. Please see the documentation on Plotting and Strip Charts for mor e information.
In the API functions below, the word "range" represents the Y-Axis, and the word "domain" represents the
X-Axis.
Derived From
Nothing (these are base classes)
357
CFD-VIEW V2014.0 User Manual
Member Functions
class FXGraph
getNumPoints()
getName()
setName(name)
getDomainData(i)
setDomainData(i,d)
getRangeData(i)
setRangeData(i,d)
updateData(dom,rng)
Changes the data in the curve to the X and Y values passed in. dom and rng are equal length python lists
containing the X and Y data respectively for the curve.
appendData(dom,rng)
Appends the data in the X and Y values passed in to the curve. dom and rng are equal length python lists
containing the X and Y data respectively for the curve.
getDomainLimits()
Returns a 2 tuple giving xmin and xmax of the data in the curve.
getRangeLimits()
Returns a 2 tuple giving ymin and ymax of the data in the curve.
setSymbolType(symbol)
Sets the data symbols for the curves to be one of the types listed below
358
Appendix Scripting
getSymbolType()
Returns the symbol type for the curve. The value will be one of the ones listed below.
setSymbolColor(clr)
Sets the color of the symbols for this curve. clr is a 4-tuple representing (R,G,B,A), where each of the
components is in the range of 0 to 255.
getSymbolColor()
Returns the color of the symbols for this curve. The return value is a 4-tuple representing (R,G,B,A),
where each of the components is in the range of 0 to 255.
setSymbolSize(size)
getSymbolSize()
setLineStyle(style)
Sets the line style for this curve to one of the values in the list below.
getLineStyle()
Returns the line style for this curve as one of the values in the list below.
setLineColor(clr)
Sets the color of this curve. clr is a 4-tuple representing (R,G,B,A), where each of the components is in the
range of 0 to 255.
getLineColor()
Returns the color of this curve. The return value is a 4-tuple representing (R,G,B,A), where each of the
components is in the range of 0 to 255.
setLineWeight(weight)
getLineWeight()
setVisible(v)
359
CFD-VIEW V2014.0 User Manual
isVisible()
class FXPlotter
addGraph(graph)
Adds the graph pointed to by "graph" to the plotter. It is appended at the end of the list.
insertGraph(index,graph)
Inserts the graph pointed to by "graph" to the plotter. It is inserted at the given index in the list.
removeGraph(index)
clearGraphs()
getGraph(index)
getNumGraphs()
setNumGraphs(ng)
Sets the number of graphs in the plot. New ones are created if given number is larger that existing.
sameYScale()
Do all of the graphs share the same Y axis? Return value is True/False.
sameYScale(ss)
Sets whether the graphs share the same Y axis. ss is True or False.
setLogErrorLabel(label)
Sets the X or Y axis label that is shown when a logarithmic scale is not appropriate, (e.g. if some of the Y
values are less than zero.)
getLogErrorLabel()
Returns the X or Y axis label that is shown when a logarithmic scale is not appropriate, (e.g. if some of the
Y values are less than zero.)
360
Appendix Scripting
setTitle(text)
getTitle()
setDomainCaption(text)
getDomainCaption()
setRangeCaption(text,index)
Sets the Y axis label for the given curve index. These are used if the curves do not share the same Y axis.
getRangeCaption(index)
Returns the Y axis label for the given curve index. These are used if the curves do not share the same Y
axis.
setDomainDisplay(lo,hi)
Sets the limits for the X axis. This is usually automatic, but can be explicitly set.
setRangeDisplay(lo,hi,index)
Sets the limits for the Y axis for the i'th curve. This is usually automatic, but can be explicitly set.
setLegendPos(x, y)
Set the upper left corner of the legend for the plot
getLegendPos()
Returns a 2-tuple that gives the upper left corner of the legend.
setCurrent(index)
Selects the "current" curve of the plots. This is used in some interactive things, but is generally not
needed.
getCurrent()
setDomainTickDeltas(maj,min)
Sets the major and minor tick spacing for the X axis
361
CFD-VIEW V2014.0 User Manual
setRangeTickDeltas(maj,min,index)
Sets the major and minor tick spacing for the Y axis of the i'th curve
setTitleFontDesc(fd)
Sets the font of the plot title. The input is a font descriptor that is used to request a particular font.
getTitleFontDesc()
Returns the font descriptor of the font used for the title of the plot.
setLegendFontDesc(fd)
Sets the font of the plot legend. The input is a font descriptor that is used to request a particular font.
getLegendFontDesc()
Returns the font descriptor of the font used for the legend of the plot.
setCaptionFontDesc(fd)
Sets the font of the X and Y axes captions of the plot. The input is a font descriptor that is used to request
a particular font.
getCaptionFontDesc()
Returns the font descriptor of the font used for the X and Y axes captions of the plot.
setNumberFontDesc(fd)
Sets the font of the scale numbers of the plot. The input is a font descriptor that is used to request a
particular font.
getNumberFontDesc()
Returns the font descriptor of the font used for the scale numbers of the plot.
savePlotData(filename)
Saves the X Y curve data for the plot to the given file name. The return value is True or False depending
on the success or failure of the operation. This is the same function used by selecting Save Plot from the
File Menu
class PlotPanel
getPlotter()
Returns a pointer to the FXPlotter contained within the PlotPanel dialog box.
362
Appendix Scripting
Useful Constants
The following constants are used for changing the characteristics of the FXPlotter plots and the FXGraph curves.
Symbol Style
SYMBOL_NONE
SYMBOL_CIRCLE
SYMBOL_SQUARE
SYMBOL_UTRIANGLE
SYMBOL_DTRIANGLE
SYMBOL_LTRIANGLE
SYMBOL_RTRIANGLE
SYMBOL_DIAMOND
SYMBOL_FILLED_CIRCLE
SYMBOL_FILLED_SQUARE
SYMBOL_FILLED_UTRIANGLE
SYMBOL_FILLED_DTRIANGLE
SYMBOL_FILLED_LTRIANGLE
SYMBOL_FILLED_RTRIANGLE
SYMBOL_FILLED_DIAMOND
SYMBOL_DOT
Plotter Settings
PLOTTEREX_BORDER
PLOTTEREX_GRID_X
PLOTTEREX_GRID_Y
PLOTTEREX_NUMBERS_X
PLOTTEREX_NUMBERS_Y
PLOTTEREX_AXIS_LEFT
PLOTTEREX_AXIS_RIGHT
PLOTTEREX_AXIS_TOP
PLOTTEREX_AXIS_BOTTOM
PLOTTEREX_TITLE
PLOTTEREX_LABEL_X
PLOTTEREX_LABEL_Y
PLOTTEREX_MAJOR_TICKS_X
PLOTTEREX_MAJOR_TICKS_Y
PLOTTEREX_MINOR_TICKS_X
363
CFD-VIEW V2014.0 User Manual
PLOTTEREX_MINOR_TICKS_Y
PLOTTEREX_TICK_LABELS_X
PLOTTEREX_TICK_LABELS_Y
PLOTTEREX_AUTOSCALE_X
PLOTTEREX_AUTOSCALE_Y
PLOTTEREX_LOG_X
PLOTTEREX_LOG_Y
PLOTTEREX_LEGEND
PLOTTEREX_MAX_SCALE
See Also
Advanced Scripting - VUPlot
Advanced Scripting - VUPlotOp
Advanced Scripting - VUStripChart
Advanced Scripting - Fonts
Purpose
The Colormap object is used to map a color ramp to a range of values of attributes, such as pressure or
temperature. Normally the operation of a color map is automatic with little user interaction required. However, if
the range of attributes needs to be changed, or the color distribution, this is the object that will be used. The
Colormap class is not a VUObject per se, but is used to control the color map of any VIEW data object. The
COLORTAB object is a simple struct that associates a color with a level of a variable. (For example, this would be
the object that might associate the color orange with 75 psi.)
Derived From
Nothing - (Base level object)
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. In several of the functions, "Notify" is
an optional value that specifies whether to notify the model of a change. The default is false, but you generally
want this to be true.
Colormap
getScene()
getName()
Returns the name of the colormap. (Usually this is the same as the color variable)
364
Appendix Scripting
getUnits()
setUnits(un)
Sets the units of the color variable in the colormap to the input string
invert([notify])
Inverts the color mapping so the previous high color is now the low, and vice versa.
reset([notify])
Resets the color map to its default appearance for its preset colormap listed below.
getNumTabs()
getTabColor(index)
Returns the color of the tab for the given tab index. The color is a 4 tuple containing (R,G,B,A), where
each value is in the range 0 to 255.
setTabColor(index, color)
Sets the tab color at the given tab index. The color is a 4 tuple containing (R,G,B,A), where each value is in
the range 0 to 255.
getTabLevel()
Returns the value of the color variable, (e.g. pressure), at the given tab index.
setTabLevel(index, level)
Sets the tab level to a value of the color variable, (e.g. pressure), at the given tab index. The slides the tab
to correct position.
getNumContours()
setContours(nc[,notify])
getContourLevel(c)
Returns the value of the color variable, (e.g. pressure), at the given contour level.
365
CFD-VIEW V2014.0 User Manual
setMapRange(lo,hi[,notify])
Sets the minimum and maximum values of the color variable, (e.g. pressure), for the colormap. This
defines the range.
getMapLo()
Returns the value of the color variable, (e.g. pressure), at the low end of the colormap range.
getMapHi()
Returns the value of the color variable, (e.g. pressure), at the high end of the colormap range.
color(value)
Returns the color that corresponds to the given value of the color variable, (e.g. pressure).
getRamp()
Returns the preset ramp listed below on which the colormap is based
setRamp(ramp[,notify])
COLORTAB - These are simple member variables that can be changed or viewed
color - The color for the given tab
level - The variable level for the given tab
Useful Constants
GRAYMAP
GREENMAP
PLOT3DMAP
REDMAP
DUTCHMAP
PLOTMAP
STRIPEMAP
See Also
Advanced Scripting - Legend
Control Panel - Colormap
366
Appendix Scripting
View Operations
VUOPERATION
Purpose
VUOperation is the ultimate base class for all operations, such as cutting planes, iso-surfaces, point probes, etc. In
the data-flow architecture, it is the operators that create new objects. For example, a volume object read from a
file can be used as input to an X cut operation to produce a surface as its output. After that, if there are changes to
the original volume, the data-flow system will automatically run the operator again to update the output surface.
The new surface can then be used as input to another operation, and so on.
Derived From
Nothing -- (it is a base class)
Member Functions
The following functions of this base class are common to all operation derived classes.
getScene()
getName()
getNumInputs()
getInput(index)
getNumOutputs()
getOutput(index)
getRange(attribute)
Returns the min/max of all of the inputs for the given attribute index, (pressure, temp, etc.) The index can
be obtained by using the getAttributeIndex() function. The range is returned as a 2-tuple.
367
CFD-VIEW V2014.0 User Manual
getRange()
Returns the geometric bounds of the total of all inputs as a 6-tuple, (xmin,xmax,ymin,ymax,zmin,zmax)
bounds()
Calculates and returns the geometric bounds of the total of all inputs as a 6-tuple,
(xmin,xmax,ymin,ymax,zmin,zmax). This is the expensive option, since it forces a recalculation. Typically,
the getRange() function above is the preferred method.
Note The following functions all relate to setting <clipping> variables for X, Y, Z, and Arbitrary cuts, and
Isosurfaces. These functions set up the <clipping> process, but do not actually perform the clip. The clipping itself
occurs everytime the Data Flow Network runs. For immediate clipping, be sure to call <reflow()> to force the
network changes to occur. There is a separate clipping list for every operation.
Adds another clipping variable to the operation. The inputs are the string name of the variable (P,T,X,etc.),
which side of the value is clipped (i.e. a lower or upper bound (-1 for lower, 1 for upper)), and the floating
point value of the clipping. The return value is the integer index of the new clipping in the list. -1 is
returned if the operation failed.
Replaces clipping variable at the given index. The other inputs are the new string name of the variable
(P,T,X,etc.), which side of the value is clipped (i.e. a lower or upper bound (-1 for lower, 1 for upper)), and
the floating point value of the clipping. The return value is the integer index of the new clipping in the list.
-1 is returned if the operation failed.
removeClipping(variable, side)
Removes the clipping specified by the string name of the variable (P,T,X,etc.), and which side of the value
is clipped (i.e. a lower or upper bound (-1 for lower, 1 for upper)). Returns True if it succeeded, or False
upon failure.
findClipping(variable, side)
Returns the index of the clipping variable in the list, or -1 if it is not found. The inputs are the string name
of the variable (P,T,X,etc.), and which side of the value is clipped (i.e. a lower or upper bound (-1 for
lower, 1 for upper))
getClippingVariable(index)
Returns the name of the clipping variable at the given index in the list. The return value is a string, and is
blank if there is no clipping at the given index.
getClippingSide(index)
Returns whether the clipping is an upper or lower bound at the given index in the list. (-1 for lower, 1 for
upper, and 0 if not found).
368
Appendix Scripting
getClippingValue(index)
Returns the floating point value of the clipping at the given index in the list.
getNumClipping()
See Also
Advanced Scripting - VUFileReader
Advanced Scripting - VUPlaneOp
Advanced Scripting - VUProbeOp
Advanced Scripting - VU2DProbeOp
Advanced Scripting - VULineOp
Advanced Scripting - VULineProbe
Advanced Scripting - VU2DLineProbe
Advanced Scripting - VU2DNet
Advanced Scripting - VUBorder
Advanced Scripting - VUCarpetOp
Advanced Scripting - VUNet
Advanced Scripting - VUPlotOp
Advanced Scripting - VUSrfMerge
Advanced Scripting - VUTriReduction
VUFILEREADER
Purpose
VUFileReader is the operation that reads the data from the file. It has not VUObjects as inputs, but there are
numerous VUObject derivatives as outputs. Please see the File Menu - Import for more information on importing,
(reading), data into CFD-VIEW.
Derived From
Advanced Scripting - VUOperation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Some of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
369
CFD-VIEW V2014.0 User Manual
This function switches the file that the reader will use on the next data flow network reflow. The inputs
are the filename, reader switches, and simulation number. The switches are listed below.
getFilename()
getNumFilenames()
Returns the number of files in the file name list of the reader. This is useful when there are multiple files
being read for a transient simulation animation.
getFilename(index)
Returns the file name at the given index in the list of file names of the reader. This is useful when there
are multiple files being read for a transient simulation animation.
This sets the list of file names when there are multiple files being read for a transient simulation
animation. The inputs are the list of file names, the file reader switches, and the simulation to be read.
The switches are listed below.
getSelectedAtts()
This returns a string which contains the tab delimited list of the attributes which are to be read when
performing a selective read.
setSelectedAtts(string)
This sets the list of the attributes which are to be read when performing a selective read. The input is a
string containing a tab delimited list of attributes.
getSwitches()
setSwitches(switches)
getSimulation()
setSimulation(simnum)
370
Appendix Scripting
getTransientTime()
Useful Constants
File Reader Switches (bit flags)
The switches below are individual bit flags which set file reading modes. To use them, the appropriate flags need
to be combined using a bitwise OR. To test to see if a flag is set, a bitwise AND would be used.
FILEDOUBLEPREC
FILEGRID
FILESCALAR
FILEVECTOR
FILEBLANK
FILEMULTIZONE
FILEWALLS
FILEWALLMODE
FILESPRAY
FILESTRUCTURED
FILEUNSTRUCTURED
FILEMIXED
FILEHYBRID
FILEASCII
FILEFORTRAN
FILEBINARY
FILEBYTESWAP
FILEFUNCTION
FILEPOLY
FILEVARIABLES
FILEDTF
FILERESERVED
FILE2D
FILESTL
FILETAB
FILEDTF2
FILEDTF3
FILEREREAD
FILEUNSCALED
FILENOZERO
FILESELECTIVE
371
CFD-VIEW V2014.0 User Manual
VUPLANEOP
PURPOSE
VUPlaneOp is the base class for several useful cutting operations, including plane cuts in 3D, line cuts in
2D, isosurfaces, etc. .
DERIVED FROM
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality
inherited from the base class, click on the object in the Derived From section above. Some of the
functions' arguments contain "notify," which is an optional value that specifies whether to notify the model
of a change. The default is false, but you generally want this to be true.
getValue()
Returns the current position for the plane type operation. For example, if the plane operation is a Y-Cut,
the value would be the Y position of the cutting plane. The returned value is a floating point number.
setValue(val [, notify])
Sets the current position for the plane type operation. For example, if the plane operation is a Y-Cut, the
value would be the Y position of the cutting plane. The input value is a floating point number.
getUpperValue()
getLowerValue()
See Also
Advanced Scripting - VU2DILine
Advanced Scripting - VU2DJLine
Advanced Scripting - VUArbCut
Advanced Scripting - VUIPlane
Advanced Scripting - VUIsocv
Advanced Scripting - VUIsosf
Advanced Scripting - VUJPlane
Advanced Scripting - VUKPlane
Advanced Scripting - VUXCut
Advanced Scripting - VUXSlice
Advanced Scripting - VUYCut
Advanced Scripting - VUYSlice
Advanced Scripting - VUZCut
Advanced Scripting - VUZSlice
372
Appendix Scripting
VUXCUT
Purpose
VUXCut is a 3D cutting operation that creates a plane that is normal to the X axis, (i.e. an X constant plane). All
volume types can be cut. Please see the documentation on XYZ Cutting Planes for more information.
Derived From
VAdvanced Scripting - VUPlaneOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
Advanced Scripting - VUYCut
Advanced Scripting - VUZCut
Advanced Scripting - VUArbCut
VUYCUT
Purpose
VUYCut is a 3D cutting operation that creates a plane that is normal to the Y axis, (i.e. a Y constant plane). All
volume types can be cut. Please see the documentation on XYZ Cutting Planes for more information.
Derived From
VAdvanced Scripting - VUPlaneOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
Advanced Scripting - VUXCut
Advanced Scripting - VUZCut
Advanced Scripting - VUArbCut
373
CFD-VIEW V2014.0 User Manual
VUZCUT
Purpose
VUZCut is a 3D cutting operation that creates a plane that is normal to the Z axis, (i.e. a Z constant plane). All
volume types can be cut. Please see the documentation on XYZ Cutting Planes for more information.
Derived From
Advanced Scripting - VUPlaneOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
Advanced Scripting - VUXCut
Advanced Scripting - VUYCut
Advanced Scripting - VUArbCut
VUARBCUT
Purpose
VUArbcut is a 3D cutting operation that creates a plane that is normal to an arbitrary axis. The orientation is set by
two rotation angles, and the position is set with the distance from the origin to the plane. Please see the
documentation on Arbitrary Cutting Planes for more information.
Derived From
Advanced Scripting - VUPlaneOp
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
374
Appendix Scripting
setTheta(theta [, notify])
Sets the theta angle used in the arbitrary cutting plane. See Arbitrary Cutting Planes for an explanation.
getTheta()
Returns the theta angle used in the arbitrary cutting plane. See Arbitrary Cutting Planes for an
explanation.
setPhi(phi[, notify])
Sets the phi angle used in the arbitrary cutting plane. See Arbitrary Cutting Planes for an explanation.
getPhi()
Returns the phi angle used in the arbitrary cutting plane. See Arbitrary Cutting Planes for an explanation.
setRotationPoint(centered [, notify])
Sets whether the arbitrary plane operation is centered about the model center or the origin. The input is
True/False indicating model centered.
getRotationPoint()
Returns whether the arbitrary plane operation is centered about the model center or the origin. The
returned value is True/False indicating model centered.
See Also
Advanced Scripting - VUXCut
Advanced Scripting - VUYCut
Advanced Scripting - VUZCut
VUIPLANE
Purpose
The VUIPlane is a 3D cutting operation that takes a structured zone as input, and creates an I-constant plane.
Fractional values for I are allowed. Please see the documentation on IJK Cutting Planes for more information.
Derived From
Advanced Scripting - VUPlaneOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
375
CFD-VIEW V2014.0 User Manual
See Also
Advanced Scripting - VUJPlane
Advanced Scripting - VUKPlane
VUJPLANE
Purpose
The VUJPlane is a 3D cutting operation that takes a structured zone as input, and creates a J-constant plane.
Fractional values for J are allowed. Please see the documentation on IJK Cutting Planes for more information.
Derived From
Advanced Scripting - VUPlaneOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
Advanced Scripting - VUIPlane
Advanced Scripting - VUKPlane
VUKPLANE
Purpose
The VUKPlane is a 3D cutting operation that takes a structured zone as input, and creates a K-constant plane.
Fractional values for K are allowed. Please see the documentation on IJK Cutting Planes for more information.
Derived From
Advanced Scripting - VUPlaneOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
Advanced Scripting - VUIPlane
Advanced Scripting - VUJPlane
376
Appendix Scripting
VUXSLICE
Purpose
VUXSlice is a cutting operation that is used to cut a surface to produce a curve, or a set of curves. Specifically, this
operation produces an X-constant curve. Please see the documentation on XYZ Surface Slices for more
information.
Derived From
Advanced Scripting - VUPlaneOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
Advanced Scripting - VUYSlice
Advanced Scripting - VUZSlice
VUYSLICE
Purpose
VUYSlice is a cutting operation that is used to cut a surface to produce a curve, or a set of curves. Specifically, this
operation produces a Y-constant curve. Please see the documentation on XYZ Surface Slices for more
information.
Derived From
Advanced Scripting - VUPlaneOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
Advanced Scripting - VUXSlice
Advanced Scripting - VUZSlice
377
CFD-VIEW V2014.0 User Manual
VUZSLICE
Purpose
VUZSlice is a cutting operation that is used to cut a surface to produce a curve, or a set of curves. Specifically, this
operation produces a Z-constant curve. Please see the documentation on XYZ Surface Slices for more
information.
Derived From
Advanced Scripting - VUPlaneOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
Advanced Scripting - VUXSlice
Advanced Scripting - VUYSlice
VUISOSF
Purpose
VUIsosf is an operation that creates a surface in which all points have a constant value of of one of the inputs'
variables. The inputs to this operation are a volume, or set of volumes, of any grid type. The Iso variable can be
any variable in the source volumes, or can be output from the calculator. Please see the documentation on Iso-
surfaces and Iso-curves for more information.
Derived From
Advanced Scripting - VUOperation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Some of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
378
Appendix Scripting
>setSecondaryVariable(varName [, notify])
Sets the attribute, (pressure, temp, etc.), to be used for the iso-valued surface. The input is the name of
the attribute from the input objects of this operation.
>getSecondaryVariable()
Returns the index of the iso-value attribute, (pressure, temp, etc.). This returns the index, and not the
name. To get the name, you need to use the getAttName() function for the data object.
See Also
Advanced Scripting - VUIsocv
VUISOCV
Purpose
VUIsocv is an operation that creates a curve in which all points have a constant value of one of the inputs' variable.
The inputs to this operation are a surface, or set of surfaces, of any grid type. The Iso variable can be any variable
in the source surfaces, or can be output from the calculator. Please see the documentation on Iso-surfaces and
Iso-curves for more information.
Derived From
Advanced Scripting - VUOperation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Some of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
>setSecondaryVariable(varName [, notify])
Sets the attribute, (pressure, temp, etc.), to be used for the iso-valued surface. The input is the name of
the attribute from the input objects of this operation.
>getSecondaryVariable()
Returns the index of the iso-value attribute, (pressure, temp, etc.). This returns the index, and not the
name. To get the name, you need to use the getAttName() function for the data object.
See Also
Advanced Scripting - VUIsosf
379
CFD-VIEW V2014.0 User Manual
Purpose
VULineOp is a base class for the VUIline, VUJLine, and VUKLine operations, and provides some common
functionality. It is an abstract base class, which means there can be no instance of VULineOp by itself. This base
class is similar in concept to the VUPlaneOp base class.
Derived From
Advanced Scripting - VUOperation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Some of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
These operations have two values needed to position the line. For example, an I-Line needs the J position and the
K position of the line. For this I-Line, index 0 would be the J value, and index 1 would be the K value.
>getValue(index)
Returns the value of the operation for the value indicated by the given index. For example, for an I-Line,
index 0 would be the J value, and index 1 would be the K value. getValue(0) would return the J value.
Sets the value of the operation for the value indicated by the given index. For example, for an I-Line,
index 0 would be the J value, and index 1 would be the K value. setValue(0, .01) would set the J value to
.01.
>getUpperValue(index)
Returns the maximum value of the operation for the value indicated by the given index.
>getLowerValue(index)
Returns the minimum value of the operation for the value indicated by the given index.
See Also
Advanced Scripting - VUIline
Advanced Scripting - VUJLine
Advanced Scripting - VUKLine
380
Appendix Scripting
VUILINE
Purpose
VUILine is an operator that takes structured volumes as input and creates a line in the I direction from Imin to
Imax. Please see the documentation on IJK Lines for more information.
Derived From
Advanced Scripting - VULineOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
Advanced Scripting - VUJLine
Advanced Scripting - VUKLine
Advanced Scripting - VULineOp
VUJLINE
Purpose
VUJLine is an operator that takes structured volumes as input and creates a line in the J direction from Jmin to
Jmax. Please see the documentation on IJK Lines for more information.
Derived From
Advanced Scripting - VULineOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
Advanced Scripting - VUILine
Advanced Scripting - VUKLine
Advanced Scripting - VULineOp
381
CFD-VIEW V2014.0 User Manual
VUKLINE
Purpose
VUKLine is an operator that takes structured volumes as input and creates a line in the K direction from Kmin to
Kmax. Please see the documentation on IJK Lines for more information.
Derived From
Advanced Scripting - VULineOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
Advanced Scripting - VUILine
Advanced Scripting - VUJLine
Advanced Scripting - VULineOp
VU2DILINE
Purpose
VU2DILine is an operator that creates a line of constant I value, similar in concept to an I-Plane. Inputs are 2D
surfaces, and the output is a polyline in one or more segments. Please see the documentation on IJK Lines for more
information.
Derived From
Advanced Scripting - VUPlaneOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
Advanced Scripting - VU2DJLine
382
Appendix Scripting
VU2DJLINE
Purpose
VU2DJLine is an operator that creates a line of constant J value, similar in concept to an J-Plane. Inputs are 2D
surfaces, and the output is a polyline in one or more segments. Please see the documentation on IJK Lines for
more information.
Derived From
VUPlaneOp
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
VU2DILine
VUPROBEOP
Purpose
VUProbeOp is a base class for three 3D point probe type operations, and provide some common functionality. It is
an abstract base class, which means that there will be no instances of VUProbeOp itself.
Derived From
VUOperation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
setPosition(position [, notify])
Sets the position of the probe. The input is a 3-tuple containing (x,y,z).
getPosition()
383
CFD-VIEW V2014.0 User Manual
setParametricPosition(ijk [, notify])
Sets the IJK position of the probe if the input is a structured grid. The input is a 3-tuple containing (I,J,K)
getParametricPosition()
Returns the IJK position of the probe if the input is a structured grid. The return value is a 3-tuple
containing (I,J,K)
setZone(zonenumber [, notify])
If the probe position is located in IJK coordinates, the probe must know in which zone to resolve the
coordinates. This function sets that zone number.
Note: This function works at the Python array level, meaning that you must decrease the zone number
input by 1. For example, if you want to set the probe to zone 6, you must use setZone(5).
getZone()
If the probe position is located in IJK coordinates, the probe must know in which zone to resolve the
coordinates. This function returns the zone number used.
Note: This function works at the Python array level, meaning that the zone number returned to you will
be decreased by 1 compared to the zone number in the CFD-VIEW GUI. For example, if the probe is set to
zone 6 in the CFD-VIEW GUI, getZone will return a zone number of 5.
setXYZMode(mode [, notify])
This function specifies whether to use IJK or XYZ mode for positioning the probe for structured grids. The
input value is either True or False. IJK mode is the only used for structured grids.
getXYZMode()
This function returns whether the probe is using IJK or XYZ mode for positioning the probe for structured
grids. The returned value is either True or False. IJK mode is the only used for structured grids.
See Also
VUProbe
VUStripChart
VUTrace
VUPROBE
Purpose
VUProbe is an operation that determines the value of a variable at a 3D point. The inputs are one or more 3D
volumes. Please see the documentation on Point Probes for more information.
384
Appendix Scripting
Derived From
VUProbeOp
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Some of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
setVariable(var [, notify])
Sepcifies which variable to probe, (i.e. pressure, temperature, etc.) The input value is index of the
variable. The getAttributeIndex() function can be used to get the index if it is not known.
getVariable()
getVariableName()
getValue()
See Also
VUStripChart
VUTrace
VUSTRIPCHART
Purpose
The VUStripChart operation is similar to the 3D point probe operator, except that the probe values at each
animation step are stored in the form of a graph. This is reminiscent of the old style mechanical strip charts. The
target variable value is recorded, along with the time value from the DTF file. If the DTF file format is not used, the
time values are a normalized time based on the animation level. The inputs are one or more 3D volumes. Please
see the documentation on Strip Charts for more information.
Derived From
VUProbeOp
Member Functions
385
CFD-VIEW V2014.0 User Manual
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Some of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
setVariable(var [, notify])
Sepcifies which variable to probe, (i.e. pressure, temperature, etc.) The input value is index of the variable. The
getAttributeIndex() function can be used to get the index if it is not known.
getVariable()
getVariableName()
getValue()
getUseTimeFromDTF()
The strip chart can use a normalized time, or can read the transient time from the DTF file. The function returns
True/False, indicating whether the DTF time is used.
setUseTimeFromDTF(dtftime [, notify])
The strip chart can use a normalized time, or can read the transient time from the DTF file. The function's input
value is True/False, indicating whether the DTF time is to be used.
See Also
VUProbe
VUTrace
VUTRACE
Purpose
The VUTrace operation is a particle trace that typically is used to trace the path of a zero-mass particle in a 3D flow
field. The output of the particle trace operation is a polyline in one or two segments. It also shares some
functionality with the point probe. The inputs are one or more 3D volumes. Please see the documentation on
Particle Traces for more information.
386
Appendix Scripting
Derived From
VUProbeOp
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality
inherited from the base class, click on the object in the Derived From section above. Several of the
functions' arguments contain "notify", which is an optional value that specifies whether to notify the model
of a change. The default is false, but you generally want this to be true.
setVariable(var [, notify])
Sets the first of three variables used for tracing. For example, most flow problems will trace on U,V,W. In
this case, the index of the U variable would be input.
setVariableByName(varname [, notify])
Sets the first of three variables used for tracing. For example, most flow problems will trace on U,V,W. In
this case, the string "U" would be input.
getVariable()
Returns the first of three variables used for tracing. For example, most flow problems will trace on U,V,W.
In this case, the index of the U variable would be returned.
getVariableName()
Returns the first of three variables used for tracing. For example, most flow problems will trace on U,V,W.
In this case, the string "U" would be return.
setStepSize(size [, notify])
Sets the integration stepsize for the particle tracing. The input value is a floating point number.
getStepSize()
Returns the integration stepsize for the particle tracing as a floating point number.
setNumSteps(numsteps [, notify])
getNumSteps()
setSkip(everyX[, notify])
The integration stepsize may be smaller that the desired number of stored points. This function allows
storing points in a strided fashion. The input value is an integer that specifies the storage of every __
points.
387
CFD-VIEW V2014.0 User Manual
getSkip()
Returns the stride for storing the points along the particle trace.
Specifies the number of release points in each of the three dimensions to facilitate a rake.
getNumReleasePoints()
Returns the number of release points in each of the three dimensions as a 3-tuple
getPointSpacing()
setTimeLimit(lmt [, notify])
getTimeLimit()
traceForward(forward [, notify])
Sets forward tracing option. The input is True/False indicating forward tracing.
traceForward()
traceBackward(backward [, notify])
Sets backward tracing option. The input is True/False indicating backward tracing.
traceBackward()
See Also
VUProbe
VUStripChart
388
Appendix Scripting
VU2DPROBEOP
Purpose
VU2DProbeOp is a base class for three 2D point probe type operations, and provide some common functionality.
It is an abstract base class, which means that there will be no instances of VU2DProbeOp itself. Please see the
documentation on Point Probes for more information.
Derived From
VUOperation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
setPosition(position [, notify])
Sets the position of the probe. The input is a 3-tuple containing (x,y,z).
getPosition()
setParametricPosition(ijk [, notify])
Sets the IJK position of the probe if the input is a structured grid. The input is a 3-tuple containing (I,J,K)
getParametricPosition()
Returns the IJK position of the probe if the input is a structured grid. The return value is a 3-tuple
containing (I,J,K)
setZone(zonenumber [, notify])
If the probe position is located in IJK coordinates, the probe must know in which zone to resolve the
coordinates. This function sets that zone number.
Note: This function works at the Python array level, meaning that you must decrease the zone number
input by 1. For example, if you want to set the probe to zone 6, you must use setZone(5).
getZone()
If the probe position is located in IJK coordinates, the probe must know in which zone to resolve the
coordinates. This function returns the zone number used.
Note: This function works at the Python array level, meaning that the zone number returned to you will
be decreased by 1 compared to the zone number in the CFD-VIEW GUI. For example, if the probe is set to
zone 6 in the CFD-VIEW GUI, getZone will return a zone number of 5.
389
CFD-VIEW V2014.0 User Manual
setXYZMode(mode [, notify])
This function specifies whether to use IJK or XYZ mode for positioning the probe for structured grids. The
input value is either True or False. IJK mode is the only used for structured grids.
getXYZMode()
This function returns whether the probe is using IJK or XYZ mode for positioning the probe for structured
grids. The returned value is either True or False. IJK mode is the only used for structured grids.
See Also
VU2DProbe
VU2DStripChart
VU2DTrace
VU2DPROBE
Purpose
VU2DProbe is an operation that determines the value of a variable at a 2D point. The inputs are 2D surfaces,
which have a constant Z=0.
Derived From
VU2DProbeOp
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
setVariable(var [, notify])
Sepcifies which variable to probe, (i.e. pressure, temperature, etc.) The input value is index of the
variable. The getAttributeIndex() function can be used to get the index if it is not known.
getVariable()
getVariableName()
390
Appendix Scripting
getValue()
See Also
VU2DStripChart
VU2DTrace
VU2DSTRIPCHART
Purpose
The VU2DStripChart operation is similar to the 2D point probe operator, except that the probe values at each
animation step are stored in the form of a graph. This is reminiscent of the old style mechanical strip charts. The
target variable value is recorded, along with the time value from the DTF file. If the DTF file format is not used, the
time values are a normalized time based on the animation level. The inputs are one or more 2D surfaces, which
have a constant Z=0. Please see the documentation on Strip Charts for more information.
Derived From
VU2DPro.beOp
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
setVariable(var [, notify])
Sepcifies which variable to probe, (i.e. pressure, temperature, etc.) The input value is index of the
variable. The getAttributeIndex() function can be used to get the index if it is not known.
getVariable()
getVariableName()
getValue()
391
CFD-VIEW V2014.0 User Manual
getUseTimeFromDTF()
The strip chart can use a normalized time, or can read the transient time from the DTF file. The function
returns True/False, indicating whether the DTF time is used.
setUseTimeFromDTF(dtftime [, notify])
The strip chart can use a normalized time, or can read the transient time from the DTF file. The function's
input value is True/False, indicating whether the DTF time is to be used.
See Also
VU2DProbe
VU2DTrace
VU2DTRACE
Purpose
The VU2DTrace operation is a particle trace that typically is used to trace the path of a zero-mass particle in a 2D
flow field. The output of the particle trace operation is a polyline in one or two segments. It also shares some
functionality with the point probe. The inputs are one or more 2D surfaces, which have a constant Z=0. Please
see the documentation on Particle Traces for more information.
Derived From
VU2DProbeOp
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
setVariable(var [, notify])
Sets the first of three variables used for tracing. For example, most flow problems will trace on U,V,W. In
this case, the index of the U variable would be input.
setVariableByName(varname [, notify])
Sets the first of three variables used for tracing. For example, most flow problems will trace on U,V,W. In
this case, the string "U" would be input.
392
Appendix Scripting
getVariable()
Returns the first of three variables used for tracing. For example, most flow problems will trace on U,V,W.
In this case, the index of the U variable would be returned.
getVariableName()
Returns the first of three variables used for tracing. For example, most flow problems will trace on U,V,W.
In this case, the string "U" would be return.
setStepSize(size [, notify])
Sets the integration stepsize for the particle tracing. The input value is a floating point number.
getStepSize()
Returns the integration stepsize for the particle tracing as a floating point number.
setNumSteps(numsteps [, notify])
getNumSteps()
setSkip(everyX[, notify])
The integration stepsize may be smaller that the desired number of stored points. This function allows
storing points in a strided fashion. The input value is an integer that specifies the storage of every __
points.
getSkip()
Returns the stride for storing the points along the particle trace.
setNumReleasePoints(nx, ny [, notify])
Specifies the number of release points in each of the three dimensions to facilitate a rake.
getNumReleasePoints()
Returns the number of release points in each of the three dimensions as a 2-tuple
setPointSpacing(dx, dy [, notify])
getPointSpacing()
393
CFD-VIEW V2014.0 User Manual
setTimeLimit(lmt [, notify])
getTimeLimit()
traceForward(forward [, notify])
Sets forward tracing option. The input is True/False indicating forward tracing.
traceForward()
traceBackward(backward [, notify])
Sets backward tracing option. The input is True/False indicating backward tracing.
traceBackward()
See Also
VU2DProbe
VU2DStripChart
VULINEPROBE
Purpose
VULineProbe is an operation that creates a line through 3D volumes and samples the underlying data at a number
of points along the line. The output of the line probe is often used as input to the plotting operation. Please see
the documentation on Line Probes for more information.
Derived From
VUOperation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
394
Appendix Scripting
setEndpoints(p1, p2 [, notify])
Sets the end points of the line, p1 and p2. The two inputs are 3-tuples with (x,y,z) for each point.
Sets the position for one of the end points. 0 indicates the first point, and 1 represents the second. The
position itself is a 3-tuple containing (x,y,z).
getPosition(index)
Returns the position for one of the end points. 0 indicates the first point, and 1 represents the second.
The position is returned as a 3-tuple containing (x,y,z).
setNumSteps(steps [, notify])
getNumSteps()
setCurve(points,[notify])
This allows setting a curve for a line probe. The inputs are the list of 3-tuples containing the points, and a
flag indicating that the main model should be notified of the change.
probe.setCurve([[0,0,0],[1,0,.0],[1,.5,0],[2,.5,0]],True) is an example of usage. Note that the points are
contained in a Python list.
See Also
VU2DLineProbe
VU2DLINEPROBE
Purpose
VU2DLineProbe is an operation that creates a line through 2D volumes and samples the underlying data at a
number of points along the line. The output of the line probe is often used as input to the plotting operation.
Please see the documentation on Line Probes for more information.
Derived From
VUOperation
Member Functions
395
CFD-VIEW V2014.0 User Manual
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
setEndpoints(p1, p2 [, notify])
Sets the end points of the line, p1 and p2. The two inputs are 3-tuples with (x,y,z) for each point.
Sets the position for one of the end points. 0 indicates the first point, and 1 represents the second. The
position itself is a 3-tuple containing (x,y,z).
getPosition(index)
Returns the position for one of the end points. 0 indicates the first point, and 1 represents the second.
The position is returned as a 3-tuple containing (x,y,z).
setNumSteps(steps [, notify])
getNumSteps()
See Also
VULineProbe
VUNET
Purpose
The VUNet operation creates an evenly-spaced set of points over a set of volumes. The inputs are volumes, or set
of volumes, and the output is a disconnected set of points, VUPoint. The values of all attributes of the underlying
volumes are interpolated at each of the point locations. This feature is often used to create an evenly spaced
vector field for a volume. Please see the documentation on Point Nets for more information.
Derived From
VUOperation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
396
Appendix Scripting
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
Sets the number of points for the net in each of the three dimensions
getNumPoints()
Returns the number of points for the net in each of the three dimensions as a 3-tuple (nx,ny,nz)
See Also
VU2DNet
VU2DNET
Purpose
The VU2DNet operation creates an evenly-spaced set of points over a surface. The inputs are surfaces, or set of
surfaces, and the output is a disconnected set of points, VUPoint. The values of all attributes of the underlying
surfaces are interpolated at each of the point locations. This feature is often used to create an evenly spaced
vector field for a volume. Please see the documentation on Point Nets for more information.
Derived From
VUOperation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
Sets the number of points for the net in each of the three dimensions
getNumPoints()
Returns the number of points for the net in each of the three dimensions as a 3-tuple (nx,ny,nz)
See Also
VUNet
397
CFD-VIEW V2014.0 User Manual
VUBORDER
Purpose
VUBorder is an operator that takes a volume, or set of volumes, as input and creates a surface that represents the
outer boundary of the volume. Please see the documentation on the Border Operator for more information.
Derived From
VUOperation
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
Bounds
VUCARPETOP
Purpose
The VUCarpetOp operator that creates the carpet plot object. The carpet plot provides another very useful way to
visualize data on a 2D surface. Please see the documentation on Carpet Plots for more information.
Derived From
VUOperation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
setZVar(varName [, notify])
Sets the variable name of the attribute used as elevation for the carpet plot. (e.g. Pressure)
getZVar()
Sets the variable name of the attribute used as elevation for the carpet plot.
398
Appendix Scripting
setCVar(varName [, notify])
Sets the variable name of the attribute used for coloring the carpet plot. (e.g. Temperature)
getCVar()
Returns the variable name of the attribute used for coloring the carpet plot.
See Also
VUPlotOp
VUPLOTOP
Purpose
VUPlotOp is the operator that takes line data inputs and creates a plot as output. The VUPlot object itself controls
the appearance of the plot, while this VUPlotOp here determines the curve data for the plot. Please see the
documentation on Plotting operations for more information.
Derived From
VUOperation
Member Functions
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
getXAxis()
setXAxis(varName [, notify])
getNumYAxes()
getYAxis(index)
Returns the name of the variable used as the Y-Axis for the curve at the given index.
399
CFD-VIEW V2014.0 User Manual
setYAxes(varNames [, notify])
Sets the names of the variables to be used as the Y-Axes for the curves. The input is a list of strings
containing the variable names (e.g. ["Pressure","Temperature"] )
See Also
VUPlot
VUSRFMERGE
Purpose
VUSrfMerge is an operator the takes a set of surfaces and stitches them together to form a single surface as
output. The original surfaces are not modified. Please see the documentation on Surface Merging for more
information.
Derived From
VUOperatinon
Member Functions
There are no additional functions beyond the base class. To see the functionality inherited from the base class,
click on the object in the Derived From section above.
See Also
VUBorder
VUTRIREDUCTION
Purpose
VUTriReduction is an operator that takes a triangle based surface as input, and reduces the mesh complexity to
minimize the number of nodes and triangle. The general shape of the original surface is preserved. Please see the
documentation on Surface Reduction for more information.
Derived From
VUOperation
Member Functions
400
Appendix Scripting
The following functions offer additional capabilities over those of the base class. To see the functionality inherited
from the base class, click on the object in the Derived From section above. Several of the functions' arguments
contain "notify", which is an optional value that specifies whether to notify the model of a change. The default is
false, but you generally want this to be true.
setReduction(percentage [, notify])
Sets the percentage reduction in the number of triangles in the surface. The range of correct input values
is .1 to 1.0.
getReduction()
Returns the percentage reduction in the number of triangles in the surfacein the range of .1 to 1.0.
Examples
ADVANCED-BASIC COMPARISON
Goal
The goal of this example is to illustrate some of the differences and similarities of the advanced and basic scripting
capabilities available to Python through the CFD-VIEW module. A simple example of cutting planes is used. The
Advanced scripting capabilities of CFD-VIEW expose more of the application's functionality to scripting. The
increased functionality can be more complex than the Basic Scripting. However, the two programming modes can
be mixed, and provides for increased capability where needed, while maintaining the ease of programming for
simple tasks. The sample below illustrates some of the benefits of the mixed mode programming. Clicking on the
functions in the sample code will take you to the appropriate documentation.
ImportDTF("mixed.DTF",DTF_ZONE_BASED)
vols=GetAllVolumes()
level=-.5
for vol in vols:
surf=CreateYCut([vol])
SetColorAttribute(surf,"VonMises")
SetSurfaceRendering(surf, SURFACE_RENDERING_FLOODED)
SetValue(surf,level)
level=level+.5
SetProjection(PROJECTION_PERSPECTIVE)
Roll(36)
Pitch(40)
Yaw(24)
SetZoom(1)
401
CFD-VIEW V2014.0 User Manual
ImportDTF("mixed.DTF",DTF_ZONE_BASED)
vols=GetAllVolumes()
level=-.5
for vol in vols:
surf=CreateYCut([vol])
surf.setColorAtt("VonMises")
surf.setRenderMode(RENDER_SURF_FLOODED|RENDER_OUTLINE)
surf.getSource().setValue(level)
level=level+.5
setProjection(getActiveViewer(),PROJECTION_PERSPECTIVE)
roll(getActiveViewer(),36)
pitch(getActiveViewer(),40)
yaw(getActiveViewer(),24)
setZoomLevel(getActiveViewer(),1)
Explanation
The two samples look similar, but only superficially. For this simple example, the basic scripting version would be
the preferred method. However, the advanced scripting exposes much more capability, and these two samples
are only shown to illustrate the differences.
The first line(s) imports the needed module(s) as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The cfdview module contains the features of the advanced scripting, and is
actually the basis for the basic scripting. The next line is used to load the DTF file into the model. Since the basic
and advanced modules can peacefully coexist, it is typically better to use whichever functions are simpler to use.
In this case, the ImportDTF (a basic function) works well for both. The next line retrieves the list of volumes in the
model, which is used below.
The two scripts begin to diverge at this point. Both create a Y cut through the individual volumes, but those output
surfaces are manipulated differently. Setting a color attribute is a function of the surface itself. The old style used
a global function that took a pointer to the surface and the attribute. The new style exposes the underlying object
oriented nature of CFD-VIEW. In this case, the setColorAtt is a member function of a surface, and it is called as
such. While it is simply a matter of style for this one function, the advanced scripting capabilities all use this object
oriented style of programming. This example is used to show how it should be used.
The last part illustrates how to manipulate the 3D viewer. Multiple viewers are allowed in CFD-VIEW, and the
advanced scripting allows them to modified independently. In the basic scripting, it is always assumed that active
viewer is being manipulated. If there is only one viewer in the model, the basic scripting is simpler.
402
Appendix Scripting
ANNOTATION
Goal
The goal of this example is to illustrate some of the annotation scripting capabilities available to Python through
the cfdview module. The Advanced scripting capabilities of CFD-VIEW expose more of the application's
functionality to scripting. The increased functionality can be more complex than the Basic Scripting. However, the
two programming modes can be mixed, and provides for increased capability where needed, while maintaining the
ease of programming for simple tasks. The sample below illustrates some of the benefits of the mixed mode
programming. Clicking on the functions in the sample code will take you to the appropriate documentation.
Sample Code
from cfdview import *
from cfdview_basic import *
forceUpdate()
(w,h)=getViewerSize(getActiveViewer())
print (w,h)
line = CreateLine()
line.setStartPoint(-100,-100)
line.setEndPoint(100,100)
line.setArrowStyle(ARROW_STYLE_END)
line.select(True)
print line.getStartPoint()
print line.getEndPoint()
box=CreateBox()
box.setPosition(.25*w,-.25*h)
box.setSize(.2*w,.2*h)
print box.getSize()
box.select(True)
Explanation
The first line(s) imports the needed module(s) as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The cfdview module contains the features of the advanced scripting, and is
actually the basis for the basic scripting.
forceUpdate() is used to force all of the internal data structures to be updated immediately, followed by an
updating of all of the 3D Viewers. This is needed before the next call to getViewerSize, so that everything is the
correct size. The print statement shows a method for displaying the output of the function as a 2-tuple. These
dimension will be used below.
A line annotation object is created with the basic scripting CreateLine. Next, the advanced scripting calls are used
to set the line's dimensions, attributes, etc. Click on the functions in the sample code for a description. The start
and end points are returned as 2-tuples and printed. The call to select performs the same function as selecting the
item using the GUI of VIEW. The "True" argument instructs VIEW to make the appropriate GUI updates.
403
CFD-VIEW V2014.0 User Manual
Finally, the dimensions from above are used to position and size the box annotation. You can also click on the
functions in the sample code to see the appropriate documentation.
Goal
The goal of this example is to illustrate some of the data flow network scripting capabilities available to Python
through the cfdview module. The Advanced scripting capabilities of CFD-VIEW expose more of the application's
functionality to scripting. The increased functionality can be more complex than the Basic Scripting. However, the
two programming modes can be mixed, and provides for increased capability where needed, while maintaining the
ease of programming for simple tasks. The sample below illustrates some of the benefits of the mixed mode
programming for accessing the data flow network. Clicking on the functions in the sample code will take you to
the appropriate documentation.
Sample Code
from cfdview import *
from cfdview_basic import *
ImportDTF("mixed.DTF",DTF_SIMPLIFYING)
surf=CreateXCut(GetAllVolumes())
surf.setColorAtt("VonMises",True)
SetSurfaceRendering(surf, SURFACE_RENDERING_FLOODED)
xcutter=surf.getSource()
xcutter.setValue(2.0,True);
vol=xcutter.getInput(0)
vol.setHandlesShown(False,True)
print vol.volume()
Explanation
The first line(s) imports the needed module(s) as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The cfdview module contains the features of the advanced scripting, and is
actually the basis for the basic scripting. The next line is used to load the DTF file into the model. Since the basic
and advanced modules can peacefully coexist, it is typically better to use whichever functions are simpler to use.
In this case, the ImportDTF (a basic function) works well for both.
Next, an X-Cut is created which passes through all of the volumes in the model, and the pointer the output surface
is returned. The next two lines set the surface appearance of that surface.
The cutting surface object that is seen on the screen is the output of the cutting operation. It is that operation that
is modified to reposition the cutting plane. To obtain the operation, a call to the function getSource() is issued on
the output object. xcutter is the pointer to the cutting operation itself, and not the output surface. Functions
called on xcutter are used to change or get information about the operation.
404
Appendix Scripting
setValue is used to position the cutting plane, which in this example, it is placed at 2.0. The basic scripting
function, SetValue, hides some of this complexity by making some of the calls behind the scenes. However, the
purpose of this sample is to illustrate some of the data flow concepts for use in other, not-so-simple tasks. The
"True" argument is the notify, which tells VIEW to include this operation change in the Undo/Redo records, and
other updates.
The next part of the sample code shows how to obtain the inputs to operations. In this sample, the input to the
cutting operation was the list of all volumes, with each volume added as an input. The getInput(0) call gets a
pointer to the first volume in the list. That pointer to the volume is then used to turn off the display of volume
handles with the call to setHandlesShown. Finally, the volume of that object is displayed.
See Also
Cutting operations
Surface display
ANIMATION SETUP
Goal
The goal of this example is to illustrate some of the animation setup scripting capabilities available to Python
through the cfdview module. The Advanced scripting capabilities of CFD-VIEW expose more of the application's
functionality to scripting. The increased functionality can be more complex than the Basic Scripting. However, the
two programming modes can be mixed, and provides for increased capability where needed, while maintaining the
ease of programming for simple tasks. The sample below illustrates some of the benefits of the mixed mode
programming for animation setup. Clicking on the functions in the sample code will take you to the appropriate
documentation.
Sample Code
from cfdview import *
from cfdview_basic import *
ImportDTF("mixed.DTF",DTF_SIMPLIFYING)
model=GetActiveModel()
surf=CreateYCut(GetAllVolumes())
surf.setColorAtt("VonMises",True)
SetSurfaceRendering(surf, SURFACE_RENDERING_FLOODED)
ycutter=surf.getSource()
ycutter.setValue(ycutter.getLowerValue(),True);
model.setAnimInitialState()
ycutter.setValue(ycutter.getUpperValue(),True);
model.setAnimFinalState()
model.setNumAnimFrames(10)
model.setAnimCurrentFrame(5)
405
CFD-VIEW V2014.0 User Manual
Explanation
The first line(s) imports the needed module(s) as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The cfdview module contains the features of the advanced scripting, and is
actually the basis for the basic scripting. The next line is used to load the DTF file into the model. Since the basic
and advanced modules can peacefully coexist, it is typically better to use whichever functions are simpler to use.
In this case, the ImportDTF (a basic function) works well for both.
In VIEW, the animation is initiated and controlled at the model level. GetActiveModel is one of the basic functions
for obtaining a pointer to the model, which is then used here to control the animation.
Next, a Y-Cut is created which passes through all of the volumes in the model, and the pointer the output surface is
returned. The next two lines set the surface appearance of that surface.
The cutting surface object that is seen on the screen is the output of the cutting operation. It is that operation that
is modified to reposition the cutting plane. To obtain the operation, a call to the function getSource() is issued on
the output object. ycutter is the pointer to the cutting operation itself, and not the output surface. Functions
called on ycutter are used to change or get information about the operation.
setValue is used to position the cutting plane. In this example, it is placed at the lowest point, which is obtained
with the call to getLowerValue(). The basic scripting function, SetValue, hides some of this complexity by making
some of the calls behind the scenes. However, the purpose of this sample is to illustrate some of the data flow
concepts for use in other, not-so-simple tasks. The initial state of the animation is set for the model, which
registers the state of all objects in the model, including this plane.
Using the same techniques, the cutting plane is placed at the top of the model, and the animation's final state is
recorded. Finally, the number of frames in the animation and current frame are set. At this point, the animation
can be played by clicking the play button on the animation panel.
See Also
Basic surface operations
FONTS
Goal
The goal of this example is to illustrate some of the Font scripting capabilities available to Python through the
cfdview module. The Advanced scripting capabilities of CFD-VIEW expose more of the application's functionality
to scripting. The increased functionality can be more complex than the Basic Scripting. However, the two
programming modes can be mixed, and provides for increased capability where needed, while maintaining the
ease of programming for simple tasks. The sample below illustrates some of the benefits of the mixed mode
programming. Clicking on the functions in the sample code will take you to the appropriate documentation.
Sample Code
from cfdview import *
from cfdview_basic import *
406
Appendix Scripting
text=CreateText()
desc=text.getFontDesc()
print desc
desc[0]="Helvetica"
desc[1]=480
text.setFontDesc(desc)
axes=CreateAxes()
print axes.getPosition()
axes.setPosition(600,200)
Explanation
The first line(s) imports the needed module(s) as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The cfdview module contains the features of the advanced scripting, and is
actually the basis for the basic scripting. Since the basic and advanced modules can peacefully coexist, it is
typically better to use whichever functions are simpler to use.
The first thing created here is a Text object. To change the font of the Text object, we need to modify it's Font
Descriptor, which is used to describe the font. Only the two fields in the descriptor that need to be changed for
this example are the size and family. To do this, the current font descriptor is read, the two salient fields are
changed, and the updated descriptor is set for the Text object. The Fonts page describes these fields.
As an additional example, a set of Axes is placed on the screen in a desired position. In this example, the axes are
create, the position is printed, and then the new position is set. The coordinates are in screen coordinates
measured from the upper left of the 3D Viewer.
See Also
Font Example 2
Text Object
Fonts
Axes
FONTS (PART 2)
Goal
This is another example of the font capabilities. (Please see the previous example.) The goal of this example is to
illustrate some of the Font scripting capabilities available to Python through the cfdview module. The Advanced
scripting capabilities of CFD-VIEW expose more of the application's functionality to scripting. The increased
functionality can be more complex than the Basic Scripting. However, the two programming modes can be mixed,
and provides for increased capability where needed, while maintaining the ease of programming for simple tasks.
The sample below illustrates some of the benefits of the mixed mode programming. Clicking on the functions in
the sample code will take you to the appropriate documentation.
407
CFD-VIEW V2014.0 User Manual
Sample Code
from cfdview import *
from cfdview_basic import *
text=CreateText()
desc=text.getFontDesc()
print desc
desc[0]="Times"
desc[1]=320
desc[2]=FONTWEIGHT_NORMAL
desc[3]=FONTSLANT_ITALIC
desc[4]=FONTSETWIDTH_DONTCARE
desc[5]=FONTENCODING_DEFAULT
desc[6]=0
text.setFontDesc(desc)
text.setText("Hello")
text=CreateText()
text.setFontDesc(["Times",320, FONTWEIGHT_NORMAL, FONTSLANT_ITALIC,
FONTSETWIDTH_DONTCARE, FONTENCODING_DEFAULT, 0])
text.setText("CFD-VIEW")
text.setPosition(0,-48)
line=CreateLine()
line.setStartPoint(0,-10)
line.setEndPoint(250,-10)
line.setLineWidth(3)
line.setColor([128,0,128,255])
Explanation
The first line(s) imports the needed module(s) as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The cfdview module contains the features of the advanced scripting, and is
actually the basis for the basic scripting. Since the basic and advanced modules can peacefully coexist, it is
typically better to use whichever functions are simpler to use.
The first thing created here is a Text object. To change the font of the Text object, we need to modify it's Font
Descriptor, which is used to describe the font. In this sample, all of the fields are changed for illustration purposes.
To do this, the current font descriptor is read, the salient fields are changed, and the updated descriptor is set for
the Text object. The Fonts page describes these fields. Finally the text of the object is changed.
Another text object is created, but this time the font descriptor is set without first reading the old one. Since the
font descriptor is simply a Python list, it can be entered directly. The text and position are also changed.
Finally, a line is drawn between the two Text objects as an accent. The coordinates of the Line Annotation are
measured in pixels from the center of the 3D Viewer. The color is set to a dark magenta by assigning 128 to red, 0
to green, 128 to blue, and 255 to alpha. The color components are 8 bit numbers which range in value from 0 to
255.
See Also
Font Example 1
Text Object
Fonts
408
Appendix Scripting
Axes
CARPET PLOT
Goal
The goal of this example is to illustrate some of the Carpet Plot's scripting capabilities available to Python through
the CFD-VIEW module. The Advanced scripting capabilities of CFD-VIEW expose more of the application's
functionality to scripting. The increased functionality can be more complex than the Basic Scripting. However, the
two programming modes can be mixed, and provides for increased capability where needed, while maintaining the
ease of programming for simple tasks. The sample below illustrates some of the benefits of the mixed mode
programming. Clicking on the functions in the sample code will take you to the appropriate documentation.
Sample Code
from cfdview import *
from cfdview_basic import *
ImportDTF("water.DTF",DTF_SIMPLIFYING)
surf=GetAllSurfaces()[0]
surf.setColorAtt("U",True)
SetSurfaceRendering(surf, SURFACE_RENDERING_FLOODED)
setProjection(getActiveViewer(),PROJECTION_PERSPECTIVE)
roll(getActiveViewer(),36)
pitch(getActiveViewer(),40)
yaw(getActiveViewer(),24)
setZoomLevel(getActiveViewer(),1)
carpet=CreateCarpetPlot(GetAllSurfaces())
carpet.getSource().setZVar("P",True)
carpet.getSource().setCVar("U",True)
Explanation
The first line(s) imports the needed module(s) as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The cfdview module contains the features of the advanced scripting, and is
actually the basis for the basic scripting. The next line is used to load the DTF file into the model. Since the basic
and advanced modules can peacefully coexist, it is typically better to use whichever functions are simpler to use.
In this case, the ImportDTF (a basic function) works well for both.
GetAllSurfaces() is a basic scripting function that returns a list of all of the surfaces in the model. By using the
index at the end, GetAllSurfaces()[0], this takes the first item in the list. Next, the attribute that is used to color the
model is selected, followed by the surface rendering style.
409
CFD-VIEW V2014.0 User Manual
The next section rotates the view of the model, and changes the 3D projection to perspective mode.
(Orthographic projection is the default.) Again, you can click on the function links in the sample code for an
explanation.
The last section requires a bit more explanation. CreateCarpetPlot is used to create a carpet plot based on a 2D
surface. Inputs to a creation function is typically a list of input objects. However, in this case, a carpet plot is
based on a single surface. To maintain consistency with the other creation functions, the inputs are still in a list. It
is simply a list of only one object. To modify the carpet plot, the operator that created the plot needs to be
changed. As in the other examples, the operator that creates an object is found with the getSource() function. At
this point, the elevation and color variables are set for the carpet plot, which will then automatically update.
See Also
Data Flow Example
Carpet Plot Controls
3D Viewer
LINE PROBE
Goal
The goal of this example is to illustrate some of the Line Probe's scripting capabilities available to Python through
the cfdview module. The Advanced scripting capabilities of CFD-VIEW expose more of the application's
functionality to scripting. The increased functionality can be more complex than the Basic Scripting. However, the
two programming modes can be mixed, and provides for increased capability where needed, while maintaining the
ease of programming for simple tasks. The sample below illustrates some of the benefits of the mixed mode
programming. Clicking on the functions in the sample code will take you to the appropriate documentation.
Sample Code
from cfdview import *
from cfdview_basic import *
ImportDTF("mixed.DTF",DTF_SIMPLIFYING)
line=CreateLineProbe(GetAllVolumes())
line.getSource().setEndpoints((0,0,0),(1.5,.5,1))
Explanation
The first line(s) imports the needed module(s) as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The cfdview module contains the features of the advanced scripting, and is
actually the basis for the basic scripting. The next line is used to load the DTF file into the model. Since the basic
and advanced modules can peacefully coexist, it is typically better to use whichever functions are simpler to use.
In this case, the ImportDTF (a basic function) works well for both.
410
Appendix Scripting
The line probe is created next. This is a 3D line probe that passes through a list of volumes, which in this case, is
the list of all volumes in the model, (obtained with the GetAllVolumes() basic scripting function). To modify the
line probe, the operator that created the line needs to be changed. As in the other examples, the operator that
creates an object is found with the getSource() function. Finally, the endpoints of the line probe are set by passing
in a set of Python 3-tuples.
See Also
Line Probe
Line Probe Scripting
LINE PLOTTING
Goal
The goal of this example is to illustrate some of the Line Plotter's scripting capabilities available to Python through
the cfdview module. The Advanced scripting capabilities of CFD-VIEW expose more of the application's
functionality to scripting. The increased functionality can be more complex than the Basic Scripting. However, the
two programming modes can be mixed, and provides for increased capability where needed, while maintaining the
ease of programming for simple tasks. The sample below illustrates some of the benefits of the mixed mode
programming. Clicking on the functions in the sample code will take you to the appropriate documentation.
Sample Code
from cfdview import *
from cfdview_basic import *
ImportDTF("water.DTF",DTF_SIMPLIFYING)
surf=GetAllSurfaces()[0]
surf.setColorAtt("U",True)
SetSurfaceRendering(surf, SURFACE_RENDERING_FLOODED)
cut=CreateYSlice(surf)
SetValue(cut,.35)
cut.setName("cutter")
forceUpdate()
plot=CreatePlot(GetEntitiesByName("cutter"))
plot.getSource().setXAxis("X",True)
plot.getSource().setYAxes(["U","V"],True)
Reflow()
plot.getPlotter().getGraph(0).setLineColor([255,0,0,255])
plot.getPlotter().getGraph(0).setLineStyle(GRAPH_LONGDASHED)
plot.getPlotter().sameYScale(False)
#optional - Use this if you want the plot to appear in the 3D Viewer
plot.plotLocation(VUPlot.PLOT_LOCATION_INTERNAL)
411
CFD-VIEW V2014.0 User Manual
Explanation
The first line(s) imports the needed module(s) as part of a set of modules. The cfdview_basic module is actually a
collection of modules such as VSurface, VModel, etc. It is included as a convenience so that multiple modules do
not need to be explicitly loaded. The cfdview module contains the features of the advanced scripting, and is
actually the basis for the basic scripting. The next line is used to load the DTF file into the model. Since the basic
and advanced modules can peacefully coexist, it is typically better to use whichever functions are simpler to use.
In this case, the ImportDTF (a basic function) works well for both.
As in the previous example, the color and rendering of a surface is shown. Next, a Y-Slice is passes through the
surface, and the vertical position is set. As an illustration of addressing objects by name, this new line is given a
new name.
There is a forceUpdate issued next. This forces an immediate reflow of the data flow network, followed by a
screen update. It is only needed in this sample if it is being run while creating a new model. The plotter uses the
size of the 3D Viewer to choose a nice size and location for the internal plot. The window needs to be already
created and updated by the time the plot is created.
Next, the plot is created with a list of curves as input. In this sample, the name "cutter" was given to the Y-Slice
earlier, and is used here as input. The GetEntitiesByName function returns a list of objects with that name, of
which there is only one in this case.
The desired plot variables are then set on the operator that produces the plot. See the dataflow example for
information on operator settings. If the input to the setYAxes function is a single variable name, a single plot curve
is created. If it is a list of variable names, a set of curves with those names is created. In this case, there are two
variables plotted, U and V. The curves are not actually created until the next reflow of the data flow network.
Therefore, we need to force one here, so that there are actual curves available for the next step.
The plotter contains a set of curves, that can be accessed by index. The plot object is a CFD-VIEW object that
contains a generic plot widget (FXPlotter). The getPlotter function returns a pointer to that widget, which is then
used to get access to the curves. In the sample code, the line color and line styles are set for the first curve, and
the second curve is left at it's default value. Next, the multiple Y scales option is set.
Finally, the plot can be displayed in its own window, which is the default setting, or it can be displayed in the 3D
Viewer. The plotLocation function sets the desired location. This line can be removed to create the external
version.
See Also
Plotting
CALCULATE VELOCITY
Goal
The goal of this sample is to illustrate how the scripting can interact with the calculator. The key points are how to
set a calculator expression and how to get the results from the calculator back into Python. This sample uses the
results the calculator coupled with scripting to get an average velocity. It is a somewhat contrived example, but it
412
Appendix Scripting
illustrates the technique well. Clicking on the functions in the sample code will take you to the appropriate
documentation.
Sample Code
# Import some interesting 2D data
ImportDTF("../DATA/water.DTF",DTF_SIMPLIFYING)
avg = sum/len(results)
print "The average velocity magnitude of the ",len(results)," nodes is ", avg
Explanation
The first command is used to import a DTF file into the model. It uses the simplifying option of the DTF file reader.
Next, the GetAllSurfaces() command returns a Python list with all of the surfaces in the model. The subscript [0]
returns the first element in the list. SetExpression then sets the calculator expression for that surface and runs the
calculator in one step.
To make use of those results, we first retrieve them from the calculator with the GetExpressionResult() command.
The information returned depends on the type of expression. In this sample, the expression adds a new variable
to the nodal data, so the result will be a Python list (array) equal in length to the number of nodes. If the
expression had been evaluated on the elements (surface faces), the length of the array would have been the
number of elements. Finally, some expressions give a single scalar result, in which case the result will be a single
floating point number.
The remaining part of the script is purely Python scripting. There is a loop that loops over all of the nodal values,
totals them, and then divides by the number of nodes to get the average.
See Also
Calculate Volume
413
CFD-VIEW V2014.0 User Manual
CALCULATE VOLUME
Goal
The goal of this sample is to illustrate how the scripting can interact with the calculator. The key points are how to
set a calculator expression and how to get the results from the calculator back into Python. This sample uses the
results the calculator coupled with scripting to get a total volume. It is a somewhat contrived example, but it
illustrates the technique well. Clicking on the functions in the sample code will take you to the appropriate
documentation.
Sample Code
# Import some interesting 3D data
ImportDTF("../DATA/mixed.DTF",DTF_ZONE_BASED)
# For each volume, set the calculator expression to return a list of cell volumes
for obj in vol_objects:
SetExpression(obj, "volumes()")
# Now, we'll total the individual cell volumes for each volume object
sum=0.0
# Loop over the volume objects
for obj in vol_objects:
# Get the calculator results from each volume object
results=GetExpressionResult()
# Now, loop over the cells and total the cell volumes to get the overall volume
for cell_volume in results:
sum = sum + cell_volume
Explanation
The first command is used to import a DTF file into the model. Next, the GetAllVolumes() command returns a
Python list with all of the volumes in the model. We then loop over those volumes and use SetExpression to set
the calculator expression for each volume and runs the calculator.
To make use of those results, we first retrieve them from the calculator with the GetExpressionResult() command.
The information returned depends on the type of expression. In this sample, the calculator expression will
calculate a scalar for each cell in the volume. If the expression had added a new variable to the nodal data, the
result would be a Python list (array) equal in length to the number of nodes. This expression was evaluated on the
elements (volume cells), so the length of the array is equal to the number of elements. Finally, some expressions
give a single scalar result, in which case the result will be a single floating point number.
To calculate the total volume in the model, we first loop over each of the volume objects. For each of those, we
use GetExpressionResult, which returns a Python list containing the volumes for each of the cells. We loop over
those in the nested loop and total the cell volumes.
414
Appendix Scripting
See Also
Calculate Velocity
415
417
419