0% found this document useful (0 votes)
279 views

Cfd-View v2014.0 User Manual

view

Uploaded by

Yousaf Saidalavi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
279 views

Cfd-View v2014.0 User Manual

view

Uploaded by

Yousaf Saidalavi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 429

CFD-VIEW V2014.

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.

Published July 2014


UA/CFD_/14/15/00/A
Disclaimers
The documents and related know-how herein provided by ESI Group subject to contractual conditions are to remain confidential. The CLIENT
shall not disclose the documentation and/or related know-how in whole or in part to any third party without the prior written permission of ESI
Group.
About ESI GROUP
ESI provides a world leading software editor for the numerical simulation of prototype and manufacturing process engineering in applied
mechanics. The key to ESI's success is the use of realistic material physics, providing "as good as real" virtual solutions, in order to replace the
lengthy trial and error processes on real prototypes.
ESI has developed an extensive suite of coherent, industry-oriented applications to realistically simulate a product’s behavior during testing and
real life use; to refine manufacturing processes for desired product performance, and to evaluate the effect of the environment in which the
product is deployed.
ESI’s products represent a unique collaborative and open environment for End-to-End Virtual Prototyping, thus eliminating the need for
physical prototypes during product development. This solution allows a productivity gain, innovation acceleration and significantly reduced
costs.
For more information about ESI Group, visit www.esi-group.com.
About ESI CFD
ESI CFD is a technology leader in the field of advanced computational fluid dynamics simulation software backed by more than 20 years of
research-based knowledge throughout a wide range of industries. ESI CFD’s broad range of products and services provide all of the necessary
tools for advanced multiphysics analysis in a virtual prototype environment, significantly reducing time and expense through comprehensive
up-front modeling and simulation. Key focus areas include aerospace, automotive, biomedical, fuel cells, MEMS, microfluidics, plasma, and
semiconductor.
Contact Information for ESI CFD
ESI CFD, Inc.
6767 Old Madison Pike, Ste. 600
Huntsville, AL 35806
Phone: (256) 713-4700 Fax: (256) 713-4799
Software Support: [email protected]
Software Sales: [email protected]
Table of Contents
Chapter 1. Introduction .................................................................................................................................. 1
ESI Group Around the World .....................................................................................................................................1
CFD-View Features ....................................................................................................................................................2
Supported Data Formats ...........................................................................................................................................4
Visualization Objects .................................................................................................................................................5
Data Transfer Facility (DTF) .......................................................................................................................................6
Running CFD-VIEW from the Command Line ............................................................................................................6
Customer Support .....................................................................................................................................................8
Getting support from the Help menu ...................................................................................................................9
How to report problems .......................................................................................................................................9
Transferring files via ftp ......................................................................................................................................10
Security concerns when using ftp .......................................................................................................................10
How to determine your platform .......................................................................................................................11
How to determine the product/application version number .............................................................................11

Chapter 2. GUI .............................................................................................................................................. 13


Start Screen .............................................................................................................................................................13
Window Layout .......................................................................................................................................................14

Chapter 3. Menu Bar .................................................................................................................................... 17


Menu Bar Introduction ............................................................................................................................................17
File Menu.................................................................................................................................................................17
File Menu Introduction .......................................................................................................................................17
New .....................................................................................................................................................................18
Open ...................................................................................................................................................................18
Open Data File / Import Additional Data File .....................................................................................................19
Reload the Same Data File ..................................................................................................................................25
Replace Data File ................................................................................................................................................25
Select Files for Animation ...................................................................................................................................25
Run Python Script ...............................................................................................................................................26
Select Trigger File ................................................................................................................................................26
Enable Trigger .....................................................................................................................................................27
Save .....................................................................................................................................................................27
Save As ................................................................................................................................................................28
Save Image ..........................................................................................................................................................29
Save Object .........................................................................................................................................................30
Save All Data with Model ....................................................................................................................................31
Close and Close All ..............................................................................................................................................31
Recent Model Files .............................................................................................................................................31
Quit .....................................................................................................................................................................32
Edit Menu ................................................................................................................................................................32
Edit Menu Introduction ......................................................................................................................................32
Undo/Redo/Clear Undo ......................................................................................................................................33
Copy Window......................................................................................................................................................33
Copy Lasso ..........................................................................................................................................................33
Selection Options ................................................................................................................................................33
Visibility Options .................................................................................................................................................34
Delete Object ......................................................................................................................................................34
Preferences .........................................................................................................................................................34
View Menu ..............................................................................................................................................................44

v
CFD-VIEW V2014.0 User Manual

View Menu Introduction .....................................................................................................................................44


View Orientation.................................................................................................................................................44
Use Blanking .......................................................................................................................................................45
Lasso Zoom .........................................................................................................................................................45
Reset ...................................................................................................................................................................45
Perspective and Parallel......................................................................................................................................46
Effects .................................................................................................................................................................46
Viewpoint ............................................................................................................................................................47
Units Menu ..............................................................................................................................................................47
Vector Menu............................................................................................................................................................49
Vector Menu Introduction ..................................................................................................................................49
Add Vector ..........................................................................................................................................................49
Edit Vector ..........................................................................................................................................................50
Remove Vector ...................................................................................................................................................50
Arrange Menu .........................................................................................................................................................51
Arrange Menu Introduction ................................................................................................................................51
Group Objects .....................................................................................................................................................51
Ungroup Objects .................................................................................................................................................51
Draw Later ..........................................................................................................................................................52
Draw Earlier ........................................................................................................................................................52
Tools Menu ..............................................................................................................................................................53
Tools Menu Introduction ....................................................................................................................................53
Recording Animation ..........................................................................................................................................53
Toggle Lasso ........................................................................................................................................................54
Check Grid Consistency .......................................................................................................................................54
Model Statistics ..................................................................................................................................................54
Save Journal ........................................................................................................................................................57
Macros ................................................................................................................................................................59
Edit Python Script ...............................................................................................................................................60
Frontal Area Calculator .......................................................................................................................................62
Window Menu .........................................................................................................................................................63
Window Menu Introduction ...............................................................................................................................63
Viewers ...............................................................................................................................................................63
Window Appearance ..........................................................................................................................................63
Viewing Options ..................................................................................................................................................64
View Preferences ................................................................................................................................................64
Help Menu ...............................................................................................................................................................65
CFD-View Help ....................................................................................................................................................65
ESI Group On The Web .......................................................................................................................................65
About CFD-VIEW .................................................................................................................................................65

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

View Orientation .....................................................................................................................................................75


Colors.......................................................................................................................................................................75
Edit Python Script ....................................................................................................................................................76
Edit Python Script-Library Modules .........................................................................................................................78
Macro ......................................................................................................................................................................90

Chapter 5. Display Settings ........................................................................................................................... 91


Display Settings .......................................................................................................................................................91

Chapter 6. Workspace .................................................................................................................................. 95


Workspace Introduction ..........................................................................................................................................95
Window Operations ................................................................................................................................................95
Arrange multiple open viewer windows .............................................................................................................95
Select a viewer window ......................................................................................................................................95
Using the Mouse Buttons ........................................................................................................................................95
Rotation ..............................................................................................................................................................97
Translation ..........................................................................................................................................................97
Query Shortcut Menu - Data Objects ......................................................................................................................98
Query Shortcut Menu - Annotation ......................................................................................................................100

Chapter 7. Control Panel ............................................................................................................................ 103


Control Panel Introduction ....................................................................................................................................103
View Settings .........................................................................................................................................................104
Displayed Types .....................................................................................................................................................105
Scaling ...................................................................................................................................................................106
Lighting ..................................................................................................................................................................107
Attribute Settings ..................................................................................................................................................109
Lines and Curves Settings ......................................................................................................................................110
Points Settings .......................................................................................................................................................111
Colormap Settings .................................................................................................................................................112
Vector Settings ......................................................................................................................................................113
Additional Controls ...........................................................................................................................................115
Symmetry Conditions ............................................................................................................................................115
IJK Parameters .......................................................................................................................................................117
Animation ..............................................................................................................................................................117
Parameter Based Animation .............................................................................................................................118
File Based Animation ........................................................................................................................................120
Trigger File-Based Animation ............................................................................................................................122
Recording Animation ........................................................................................................................................123
Background............................................................................................................................................................125
Calculator ..............................................................................................................................................................127
Overview ...........................................................................................................................................................127
The Calculator Panel .........................................................................................................................................127
Expression Menu ..............................................................................................................................................128
Entering Expressions .........................................................................................................................................129
Evaluating Simple Expressions ..........................................................................................................................130
Assignment Expressions....................................................................................................................................133
Entering “Funny” Variable Names ....................................................................................................................133
Deleting Variables .............................................................................................................................................134
Functions ..........................................................................................................................................................134
Conditional Expressions ....................................................................................................................................135
Indexing Expressions .........................................................................................................................................135
Built-in Functions ..............................................................................................................................................135

vii
CFD-VIEW V2014.0 User Manual

Expression Syntax .............................................................................................................................................138

Chapter 8. Operator Palette ....................................................................................................................... 141


Operator Palette Introduction ..............................................................................................................................141
Operators ..............................................................................................................................................................141
Operator Controls .................................................................................................................................................142
Iso-Surface and Iso-Curve .................................................................................................................................143
Clipping .............................................................................................................................................................143
I, J, K Planes .......................................................................................................................................................145
X, Y, Z Cuts ........................................................................................................................................................146
Arbitrary Plane Cut ...........................................................................................................................................147
I, J, K Lines .........................................................................................................................................................149
Particle Trace ....................................................................................................................................................150
Line Probe .........................................................................................................................................................152
Point Probe .......................................................................................................................................................154
Min/Max Probe .................................................................................................................................................155
Point History .....................................................................................................................................................155
Strip Chart .........................................................................................................................................................156
Point Net ...........................................................................................................................................................158
Carpet Plot ........................................................................................................................................................160
Border Object ...................................................................................................................................................163
Surface Merge...................................................................................................................................................164
Surface Reduction .............................................................................................................................................164
Clone Operation ................................................................................................................................................165
Symmetric Replication ......................................................................................................................................165
Operators ..............................................................................................................................................................166
Plotter ...............................................................................................................................................................166
Show External Plot ............................................................................................................................................167
Annotation Objects ...............................................................................................................................................189
Introduction ......................................................................................................................................................189
Legend Annotation ...........................................................................................................................................189
Time Annotation ...............................................................................................................................................193
Origin Annotation .............................................................................................................................................195
Axes Annotation ...............................................................................................................................................196
Bounding Box Annotation .................................................................................................................................198
Image Box Annotation ......................................................................................................................................200
Box and Oval Annotation ..................................................................................................................................202
Line Annotation ................................................................................................................................................204
Text Annotation ................................................................................................................................................206
Label Annotation ..............................................................................................................................................208

Chapter 9. Object Explorer ......................................................................................................................... 211


Object Explorer Introduction.................................................................................................................................211
Explorer Buttons ....................................................................................................................................................212
Group Objects ...................................................................................................................................................212
Ungroup Objects ...............................................................................................................................................212

Chapter 10. 3D Viewer ................................................................................................................................. 215


3D Viewer Introduction .........................................................................................................................................215
Opening Multiple Windows ..............................................................................................................................216
Arranging Multiple Open Windows ..................................................................................................................217
Selecting a Viewer Window ..............................................................................................................................217
Positioning a Viewer Window ...........................................................................................................................217

viii
Table of Contents

Shuffle Viewer Windows...................................................................................................................................218


Reading the Title Bar .............................................................................................................................................218

Appendix A Formulas ................................................................................................................................... 219


Formulas Introduction ...........................................................................................................................................219
Basic Formulas .......................................................................................................................................................219
Formulas For Common Problems ..........................................................................................................................221
Formulas For Differentiation .................................................................................................................................221
Formulas For Integration .......................................................................................................................................222
Formulas To Translate Grids ..................................................................................................................................223
Formulas For Creative Visualization ......................................................................................................................223

Appendix B User Customization ................................................................................................................... 225


User Customization Introduction ..........................................................................................................................225
Fox Applications ................................................................................................................................................225
File Types ..........................................................................................................................................................226
CFD-VIEW Settings ............................................................................................................................................226
Plotter ...............................................................................................................................................................226
Settings .............................................................................................................................................................226
General .............................................................................................................................................................226
Tools..................................................................................................................................................................226
Environment Variables .....................................................................................................................................227

Appendix C Scripting .................................................................................................................................... 229


Introduction to Python Scripting ...........................................................................................................................229
Basic and Advanced Scripting ................................................................................................................................230
Basic Scripting .......................................................................................................................................................230
Basic Python Scripting.......................................................................................................................................230
Examples ...........................................................................................................................................................231
File I/O Module .................................................................................................................................................231
Imported Functions ..........................................................................................................................................231
Basic Scripting - Model/Scene Manipulation ....................................................................................................234
Object/Operator Creation ................................................................................................................................239
Annotation ........................................................................................................................................................243
Colormap ..........................................................................................................................................................244
Vector ...............................................................................................................................................................245
Object Appearance ...........................................................................................................................................246
Probe.................................................................................................................................................................248
Particle Trace ....................................................................................................................................................250
Modify Annotation............................................................................................................................................252
3D Viewer .........................................................................................................................................................255
Data Object Display ..........................................................................................................................................259
Calculator ..........................................................................................................................................................264
Data Object Access ...........................................................................................................................................264
Operator ...........................................................................................................................................................266
Arb Cut ..............................................................................................................................................................267
Carpet Plot ........................................................................................................................................................268
Replicator ..........................................................................................................................................................269
Point Net ...........................................................................................................................................................271
Plotter ...............................................................................................................................................................272
Symmetry ..........................................................................................................................................................273
Reduced Surface ...............................................................................................................................................275
Examples ...........................................................................................................................................................276

ix
CFD-VIEW V2014.0 User Manual

Advanced Scripting ................................................................................................................................................281


Introduction ......................................................................................................................................................281
VUObject ...........................................................................................................................................................282
VUOperation .....................................................................................................................................................283
Other .................................................................................................................................................................284
Examples ...........................................................................................................................................................284
Colormap and COLORTAB .................................................................................................................................284
FXGraph, FXPlotter and PlotPanel ....................................................................................................................287
Fonts .................................................................................................................................................................293
Miscellaneous Functions...................................................................................................................................299
View Objects .....................................................................................................................................................304
View Operations ...............................................................................................................................................367
Examples ...........................................................................................................................................................401

x
Chapter 1. Introduction

ESI Group Around the World


ESI Group employs many high-level specialists worldwide. Headquartered in Paris, France, the company and its
global network of agents provide sales and technical support to customers in more than 30 countries. The
following figure shows some of our locations. Please visit www.esi-group.net for more locations and information.

ESI Group Locations Around the World

ESI Group Headquarters ESI Group Rungis


100-102 Avenue de Suffren Parc d'Affaires SILIC
75015 Paris 99 rue des Solets
FRANCE BP 80112
94513 Rungis cedex
Phone: +33 (0)1 53 65 14 14 FRANCE
Fax: +33 (0)1 53 65 14 12
Phone: +33 (0)1 41 73 58 00
Fax: +33 (0)1 46 87 72 02

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.

Point Probe Extract precise values from a data set.


Numerically display all data values at a certain location in the data set.
Position the point probe on exact I, J, and K node coordinates when operating in IJK mode.
Position the point probe anywhere when operating in XYZ mode, either by means of the X,
Y, and Z sliders or by direct manipulation.

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.

Supported Data Formats


CFD-VIEW supports the following data formats:

Data Format Data Type Formatted *Unformatted *Binary Data


(Text) Data (FORTRAN Representation
Representation output)
Data
Representation
DTF ESI Group’s DTF file format x x x

ARF ESI Group's ARF File Format x x x

PAM-FLOW ESI Group's PAM-FLOW file x x x


format

Plot3D Structured data x x x

FAST Unstructured tetrahedral x x x


data

Plot3D and Hybrid data sets x x x


FAST

XFG Mixed element, x x x


unstructured data

AFG Arbitrary meshes of x x x

4
Introduction

Data Format Data Type Formatted *Unformatted *Binary Data


(Text) Data (FORTRAN Representation
Representation output)
Data
Representation
polyhedral cells

SPY Spray Format (Point Data) x x x

TAB Curves x x x

STL Triangular Data x x x

Ensight Ensight file format (Partial x x x


reading)

* 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

Data Transfer Facility (DTF)


The Data Transfer Facility (DTF) is a database mechanism that merges all of the codes in the CFD-ACE+
environment, including CFD-VIEW, allowing simulation and problem data to be placed in a single file. The
application codes of the software access the DTF file through an application interface. Simulation data and
graphical output are accessed by name rather than by position in a file so that each application code can share
data without having to know the structure of the entire data set.

Running CFD-VIEW from the Command Line


CFD-VIEW can be launched from a command line prompt using the following CFD-VIEW command line options:

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

MODELFILE [OPTIONS] DATAFILE


This option is added in the CFD-VIEW command line to start CFD-VIEW with an existing model and open a new data
file.
The format of this command is:
CFD-VIEW modelfile [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

-S SCRIPT (OR -SCRIPT SCRIPT)


This option is added in the CFD-VIEW command line to start CFD-VIEW and execute a Python script.
The format of this command is:
CFD-VIEW -s script

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.

Web site http://www.esi-cfd.com (CFD Portal)


http://www.esi-group.com (Corporate)

Software support [email protected]


File attachments up to 10 MB allowed.

ftp site ftp.esi-cfd.com


Use to upload files larger than 10 MB.

Contacts USA – Huntsville +1 (256) 713-4750

USA – San Jose +1 (408) 824-1212

USA – Detroit +1 (248) 381-8040

United Kingdom +44 (0) 1543 397 900

France +33 (0)1 41 73 59 42

Germany +49 201 125 072 14

Italy +39 05163335577

Israel +972 77 500 5864

India – Pune +91 20 2689 8172

India – Bangalore +91 80 4017 4709

China +86 (10) 65544907/8/9/10

Japan +81 045 682 7070


+81 03 6381 8496

Korea +82 02 3660 4500/4516


+82 31 737 2987

Australia +61 2 8571 0800

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.

Getting support from the Help menu


From the menu bar, click Help. You can then opt to open the help file, go to the ESI software home page, or view
information about the application you are running. The About submenu opens a splash screen that shows version
numbers for the application itself, libraries, and build platform as well as the build date and copyright information.

How to report problems


If the Help submenus do not answer your questions or address your concerns, you may contact ESI Support at
[email protected]. File attachments are limited to 10 MB via email. For larger files, use our ftp site
(ftp.esi-cfd.com).

When you report a problem please include the following information:

• 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

Transferring files via ftp


ESI’s ftp site can handle large files, so do not be concerned about the size of DTF files that you upload.

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.

Security concerns when using ftp


If you are concerned about protecting proprietary data, please be aware of the following:

• 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:

• % DTF -vd model.DTF

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

How to determine your platform


If you have properly installed the ESI CFD software and configured your environment, you should be able to open a
command-line shell. At the prompt, type the following text. (The subsequent output should be sufficient for
Support to know what platform you are actually running.)

% 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"

How to determine the product/application version number


1. Launch the product/application (CFD-GEOM, CFD-ACE-GUI, etc.)

2. Click the Help menu.

3. Click About <application name> (for example, About CFD-ACE-GUI).

4. Make a note of the version number.

-or-

1. Open a command prompt.

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

CFD-VIEW Window Layout

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).

Menu bar contains the CFD-VIEW menus.

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.

3D Viewer workspace displays models and animations in 3D.

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

Object explorer provides table-driven details about an object in the Workspace.

Selection / Grouping select and group objects by types

Status Bar displays information about progress, images, features, and procedures.

15
Chapter 3. Menu Bar

Menu Bar Introduction


The menu bar is anchored to the top of the window directly under the title bar. Each menu has a number
of commands and, possibly, command options. The menus include the following:

File menu
Edit menu
View Menu
Units menu
Vector menu
Arrange menu
Tools menu
Window menu
Help menu

File Menu

File Menu Introduction


The File menu includes the following options:

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.

Create a new model


1. Select the New option from the File menu. A new 3D viewer is opened.
2. Select Import Additional Data File from the File menu or Tool Bar-Import button. The Import Data File
dialog box appears.
3. Select the file you want to import and click OK. The new data set is loaded into the 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.

Open Model File

18
Menu Bar

Open a model file


1. Click Open from the File menu.
2. In the Open Model File dialog, select the file type from the File Filter list.
3. Select the file. Its name appears in the File Name field. You can also select a file by typing the first few
letters of the file name to select it and then press Enter.
4. Click OK or double-click the file.

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.

Hot Key Description


Backspace Up One Directory
Delete Delete File
Ctrl+h Home Directory
Ctrl+w Working directory
Ctrl+n New Directory
Ctrl+b Display big icon
Ctrl+s Display small icons
Ctrl+l Show listing
Type first few Selects the file
letters of file

Open Data File / Import Additional Data File


The Import option imports geometries from various file formats into CFD-VIEW so that you can begin working on
your project. The Import option is also available in the toolbar.

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.

Import Data Dialog Box

20
Menu Bar

CFD-VIEW supports the following file formats:

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.

Plot3D unstructured grids comprising tetrahedral, prismatic, pyramidal, or hexahedral cells.


Spray Only contains the positions of random points, such as droplets, with associated data. CFD-VIEW
stores this data internally into a point data set. The spray file can either be formatted (ascii
input), unformatted (fortran input), or binary (raw data).
Fast-U unstructured grids comprising tetrahedral, prismatic, pyramidal, or hexahedral cells.
STL reads the STL (STereo Lithography) format enabling you to merge some CAD data into the
CFD visualization. CFD-VIEW supports and automatically detects binary and ACSII STL files
which may contain one or more surfaces.
Mixed-U unstructured grids comprising tetrahedral, prismatic, pyramidal, or hexahedral cells.
TAB reads line-segments. Binary or ASCII files are supported.
Polyhedral unstructured grids comprising tetrahedral, prismatic, pyramidal, or hexahedral cells.
Ensight (Partial) swap bytes: reads unformatted or binary files created in a machine with a different byte
order.
Monitor Point

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

Import DTF Processing Options


Option Description
Zone Based When this option is selected, no processing is performed, and all zones and surfaces in
the DTF file are each placed in its own corresponding entity in CFD-VIEW.

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.

Unscaled does not apply a scale factor

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.

Note ARF processing options are similar to that of DTF.

22
Menu Bar

Import PAM-FLOW Processing Options


File reader that supports the following data types:

Data Type Description


Options
Domain domn files, typically binary

Generic

Time History thp, typically ASCII

Ribbon ribb, typically ASCII

Particle

Surface Files surf, plan embd files, typically ASCII

Data Format Description


Options
Formatted

Swap Bytes

Import Plot3D, Fast-U, Mixed-U, and Polyhedral Processing Options


Data Type
Description
Options
Unstructured grids comprising tetrahedral, prismatic, pyramidal, or hexahedral cells.

Grid the grid itself

Scalar reads the scalar file

Vector reads the vector file

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

Multi-Domain CFD-VIEW expects the data files to be in multi-zone format

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).

Data Format Description


Options

23
CFD-VIEW V2014.0 User Manual

Data Type
Description
Options
Formatted ASCII input.

Unformatted FORTRAN input.

Binary Raw data

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
Swap Bytes 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.

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.

2D applicable when you need to read in two-dimensional Plot3D files.

2D (plot3d only) reads in two-dimensional Plot3D files.

Import Spray Only Processing Options


Spray files contain the positions of random points, such as droplets, with associated data. CFD-
VIEW stores this data internally into a point data set. The spray file can either be formatted (ascii
input), unformatted (fortran input), or binary (raw data).

Option Description
Formatted ASCII input.

Unformatted FORTRAN input.

Binary Raw data

Swap Bytes Available only if...

24
Menu Bar

Reload the Same Data File


The Reload the Same Data File option re-reads the loaded data set. This is useful if you run a simulation that
periodically generates solutions and want to display intermediate results. When the data set is reloaded, the
defined model is re-rendered and the 3D viewer is updated to reflect any changes in the data set.

Replace Data File


The Replace Data File replaces the loaded data set in the active 3D viewer with the original data from whatever file
you selected. When the data set is replaced, the 3D viewer is updated to reflect the original data set.

Select Files for Animation


The Select Files for Animation option enables you to select files to be included for animation.

Select files for animation


1. Select the Select Files for Animation option from the File Menu. The Select Files for Animation window
appears.
2. Load the first file in the sequence of files that are to be animated. Once the file is loaded, any drawing
settings, cutting planes, or other operations are performed on that data in the 3D viewer.
3. Select the additional files in the order that they will be used in the animation by right-clicking on the file in
the Current File section of the Animation Control Panel or selecting File Menu-Select Files for Animation.
The files can be selected individually or as a group using CTRL+Click or Shift+Click. CTRL+A selects all files
in the directory.
4. 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

25
CFD-VIEW V2014.0 User Manual

File Menu - Select Files for Animation

Run Python Script


The Run Python Script option displays a File Open Dialog that enables you to select a Python Script file. When you
select a script file and press OK, CFD-VIEW executes the selected script immediately. Any that occur in the script
are shown in the Script Error dialog. It displays the Python-generated error messages.

Select Trigger File


The Select Trigger File option enables you to select a trigger file to track a running CFD simulation by means of
touching (UNIX command) a trigger file. The source of the trigger event is an external program like a flow-solver,

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 Dialog Box

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.

Save As Dialog Box

Save an active model as a new file


1. Click the Save As option on the File Menu. The dialog box appears.
2. 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.
3. In the File Name field, enter a file name.
4. In the File Filter field, select the .MDL file format.
5. Click OK to save the file. The file is saved to the directory location you have selected. CFD-VIEW saves the
data and the visualization objects.

Overwrite an existing file


1. Click the Save As option on the File Menu. The dialog box appears.
2. 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.
3. In the File Name field, select the file you want to overwrite.

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.

Save Image Option

Save an image as a new file


1. Click the Save Image option on the File Menu. The flyout menu appears so you can select to save just an
area or the entire 3D viewer window.
2. Select area or window based on the type of data you want to save. If you save an area, the cursor in the
3D viewer changes to a corner shaped lasso. Press and hold the left mouse button and drag the mouse to
select the area you want to save. If you save a window, the entire content of the 3D viewer is selected.
When you release the mouse button, the Image Output window appears.
3. Enter the size of the image. If off-screen rendering is available, the image will be scaled to the specified
size. Once accepted, the Save Image box appears.

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.

Save All Data with Model


The Save All Data with Model option saves all parts of the model, including the data that was read from the DTF or
other data files. By checking this box, the model file is very portable, but can be large. By unchecking the box, the
original data is not copied with the model, only a link to the original data file. The resulting model file is smaller,
but is not useful without the original data file.

Close and Close All


The Close option prompts a dialog box to appear that asks if you want to save the current model to a file before
closing the application.

Close Dialog Box

Close the window and save an active model as a new file


1. Click the Close option on the File Menu. The Unsaved Model File dialog box appears.
2. Click No to close the window or 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.

Recent Model Files


The Recent Model Files option list files that have recently been opened by CFD-VIEW. Each time you open a new
model window, 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 selecting the Recent Model Files option from the
File menu.

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.

Close Dialog Box

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

Edit Menu Introduction


When you click Edit in the menu bar, the Edit menu opens. It includes the following options:
Undo
Redo
Clear undo
Copy Window
Copy Lasso
Select All
Select All Visible
Deselect All
Invert Selection
Show All
Hide Selected
Hide Non-Selected
Toggle Visibility

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.

Copy an area of the 3D viewer


1. Click the Copy Lasso option on the Edit Menu. The cursor in the 3D viewer changes to a corner shaped
lasso.
2. Press and hold the left mouse button and drag the mouse to lasso the area you want to copy. When you
release the mouse button the area is retained on a clipboard and can be pasted onto another 3D viewer.

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.

SELECT ALL VISIBLE


The Select All Visible menu command selects all of the objects in an active 3D viewer and in the corresponding
Object Explorer whose visibility is set to ON. Objects that are not visible are not selected.

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.

• Contour Color -- This is the color of contour lines drawn on a surface.

• 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.

Color Preferences Panel

36
Menu Bar

Set color preferences


1. Select Preferences from the Edit Menu.
2. Click the Colors tab on the Preferences window. The Color Preferences panel appears.
3. Double-click on the color well of the attribute you want to change. The Color Dialog box appears.

Color Dialog Box

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.

Line Preferences Panel

Set line preferences


1. Select Preferences from the Edit Menu.
2. Click the Line tab on the Preferences window. The Line Preferences panel appears.
3. Click on the line for each of attributes (outline, contour, and grid) and select the line size. The line width is
changed based on your selection.
4. Click the Close button.

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.

Undo/Redo Preference Panel

Set undo/redo preferences


1. Select Preferences from the Edit Menu.
2. Click the Undo/Redo tab on the Preferences window. The Undo/Redo Preferences panel appears.
3. Set your preferences by specifying the maximum number of operations to be reversible, and also by
specifying the maximum amount of memory dedicated to the Undo system.

39
CFD-VIEW V2014.0 User Manual

DISPLAY
The Display Preferences window enables you to designate hardware acceleration, buffer mode, and turbo mode.

Display Preferences Panel

Set display preferences


1. Select Preferences from the Edit Menu.
2. Click the Display tab on the Preferences window. The Display Preferences panel appears.
3. Set your preferences by following the directions on the window for each section.

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.

Logo Preference Panel

Set logo preferences


1. Select Preferences from the Edit Menu.
2. Click the Logo tab on the Preferences window. The Logo Preferences panel appears.
3. Set your preferences by specifying whether to use a logo, and if so, in which of the four corners of the
display should it be displayed.
4. Next, choose whether to use the ESI Group logo or a custom selected logo. If custom is chosen, the
browse button will pop a file dialog which allows choosing the image to be used for the logo.
5. Finally, specify whether to display the splash screen on application startup or not.

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.

Tools Preference Panel

Set tools preferences


1. Select Preferences from the Edit Menu.
2. Click the Tools tab on the Preferences window. The Tools Preferences panel appears.
3. Set your preferences by specifying the full path for the Web 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.

Scripting Preferences Panel

Set scripting preferences


1. Select Preferences from the Edit Menu.
2. Click the Scripting tab on the Preferences window. The Scripting Preferences panel appears.
3. Set your preferences by following the directions on the window.

43
CFD-VIEW V2014.0 User Manual

View Menu

View Menu Introduction


When you click View in the menu bar, the View menu opens. It includes the following options:

View Orientation - Front, Back, Left, Right, Top, Bottom


Use Blanking
Lasso Zoom
Reset
Parallel
Perspective
Effects - Turbo, Dither, Fog, Anti-Alias, Gradient
Viewpoint - Copy Viewpoint, Paste Viewpoint

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

View Menu-View Orientation

View Orientation Descriptions


Option Description
Front View objects from the front.

Back View objects from behind.

Left View objects from the left.

Right View objects from the right.

Top View objects from the top.

Bottom View objects from the bottom.

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.

Use lasso zoom


1. Select Lasso Zoom from the View menu. The cursor changes into a corner shaped lasso.
2. Press and hold the left mouse button at one corner of the area on which you want to zoom, drag the
mouse to a diagonal corner of the zoom area, and release the mouse button. The view will then be
zoomed based on the lasso area.

Reset
The Reset option resizes a zoomed image to the initial default view.

45
CFD-VIEW V2014.0 User Manual

Perspective and Parallel


The following two options on the View Menu 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 options are also available on the toolbar.

Perspective and Parallel Options

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

COPY AND PASTE VIEWPOINT

The Copy/Paste Viewpoint options enable you to copy the camera settings from one 3D viewer onto another.

Copy and paste camera settings


1. Select the first window and select Copy Viewpoint.
2. Click on the second 3D viewer to make it the active viewer and select Paste Viewpoint. The second
window should then reflect the viewing angle and settings of the first.

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.

• SI -- Convert all units to SI

• CGS -- Convert all units to CGS

• 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 Introduction


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 Vector in the menu bar, the Vector menu
opens. It includes the following options:

Add Vector -- Adds a vector to the list of known vectors


Edit Vector -- Edits the components of a known vector
Remove Vector -- Removes a vector from the list of known vectors

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".

Add Vector Dialog

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".

Edit Vector Dialog

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.

Remove Vector Dialog

50
Menu Bar

Arrange Menu

Arrange Menu Introduction


Once you have created several objects, the Arrange menu provides a way for you to re-organize and navigate
through the list of objects that appears in the Object Explorer. When you click Arrange in the menu bar, the
Arrange Menu appears. It includes the following options:

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.

Group multiple objects together as a single object


1. Select the objects you want to group from the 3D viewer or the Object Explorer.
2. Select the Groups Object button. The objects are grouped together and behave as a single object. The
Object Explorer is updated to indicate that an object has been grouped.

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.

Ungroup a previously grouped object


1. Select the object from the 3D viewer or the Object Explorer.
2. Select the Ungroup Object button. The object is ungrouped and each of the objects behave
independently. The Object Explorer is updated to indicate that an object has been 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

Tools Menu Introduction


When you click Tools on the menu bar, the Tools menu opens. It includes the following options:

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.

Record an entire 3D viewer


1. Ensure that you have set up animation initial and final configurations.
2. Select Record Whole Window from the Tools Menu and follow the same instructions for using the
'Record' button on the Animation panel (see Control Panel-Animation-Recording Animation).

53
CFD-VIEW V2014.0 User Manual

Record an area of the 3D viewer


1. Ensure that you have set up animation initial and final configurations.
2. Select Record Lasso Area from the Tools Menu and follow the same instructions for using the 'Record'
button on the Animation panel (see Control Panel-Animation-Recording Animation).

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.

Use the toggle lasso


1. Select the Toggle Lasso option from the Tools Menu.
2. In the 3D viewer, click the left mouse button. The cursor changes to a corner shape.
3. Click and hold the left mouse button, drag the mouse to a diagonal corner of the lasso rectangle, and
release the mouse button. The Record window appears. The lasso will stay visible on the 3D viewer.

Check Grid Consistency


CFD-VIEW can check the grid consistency of the objects in a model. It checks for such things as closed cells, ("water
tight"). correct connectivity, etc. The check is performed on each object in the model, and errors are reported for
each. The test can be optionally stopped after each reported error.

Grid Consistency Check dialog box

Model Statistics
The Statistics option enables you to inspect statistics about the datasets loaded into the model.

54
Menu Bar

View a model's statistics


1. Select the Statistics option from the Tools menu. The Statistics dialog box appears and contains a tree list
of the datasets loaded into the current model.

Model Statistics - Statistics Model Window

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

Model Statistics - Statistics Data Objects Window

4. Click another level down to see the information for each individual data array in the object:

56
Menu Bar

Model Statistics - Statistics Variable Window

5. Click the Close button to close the statistics window.

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“.

As of V2013.0, the following operators/annotations/tools are journaled:

Operators (creation and manipulation, unless otherwise noted)

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

Annotations (creation only)

Legend
Time
Origin
Axes
Bounds
ImageBox
Box
Oval
Line
Text

Tools (activation only)

Shading (No / Flat / Smooth)


Hide/Show
Handles on/off
Outlines on/off
Point on/off
Grid on/off
Contours
Surface rendering (Off / Surface / Colored surface / Smooth surface / Flooded surface)
Vectors on/off
Hidden lines on/off
Line rendering (Off / Lines / Stream tubes / Stream ribbons)
Color by variable
Maximize colormap to selected object
Vector selection
Add new vector
Maximize vectors to selected object

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.

Tools Menu-Macros Dialog Box

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)

Edit Python Script


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, useful for editing existing
scripts and writing new scripts; and a macros window, which provides one-click access to previously written
scripts.

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.

Python Script Editor Window

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.

CFD-VIEW -script myscript.py

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

Frontal Area Calculator


The Frontal Area Calculator allows the calculation of the frontal area of a specified set of surfaces onto a plane. The
frontal area is the total sum of all the sub-areas of the surface elements as projected onto an arbitrary plane. The
accuracy of the computation is dependent on a single integer value which specifies the number of increments to
refine a background mesh; for example, the default value of 500 will generate a 500x500 background mesh. Larger
integer values should yield a more accurate calculation however, CFD-VIEW sets the allowable limits between 10
and 1500.

Frontal Area Calculator Dialog

Calculate the frontal area


1. Select the desired surface(s) that you wish to calculate the frontal area for.
2. Select the Frontal Area Calculator from the Tools menu.
3. Set the background refinement or leave as default.
4. Select the desired plane, either constant X,Y, Z or an arbitrary plane.
5. Press the "Calculator" button.
6. The projected area will be displayed in the Frontal Area field.

62
Menu Bar

Window Menu

Window Menu Introduction


The Window menu includes the following options:

Viewers - New Viewer, Close Viewer


Window Appearance - Tile Horizontally, Tile Vertically, Cascade
Viewing Options - Tool Bar, Attribute Bar, Status Bar, Settings, Palette
View Preferences - View 1, View 2

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

CFD-View Window with Cascaded 3D Viewers

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.

ESI Group On The Web


ESI Group on the Web provides a direct link to the ESI Group web site for additional information about our
products and services. If you are connected to the internet, you can automatically connect to the ESI Group which
has additional information about ESI Group's products and software updates for licensed users.

About CFD-VIEW
About CFD-VIEW displays a dialog box that provides the version number and other relevant information about the
software.

Use online help


1. From the Help Menu, select CFD-View Help. The Help menu appears.
2. Select CFD-View Help. The Help file opens for you to search by subject, topic, or keyword.

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.

Create a new model


1. Select New Model from the Tool Bar. A new 3D viewer is opened.
2. Select Import Additional Data File from the File menu or Toolbar-Import button. The Import Data File
dialog box appears.
3. Select the file you want to import and click OK. The new data set is loaded into the 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.

Open Model File

Open a model file


1. Select the Open button from the Tool Bar. The Open Model File dialog box appears.
2. Select the file type from the File Filter Drop Down Box.
3. Select the file. Its name appears in the File Name field. You can also select a file by typing the first few
letters of the file name to select it and then press Enter.
4. Click OK or double-click the file. CFD-VIEW opens the file into the workspace. Each time you open a new
model window, it is added to the recent file list. Therefore, if you find yourself often working on the same
model file, you can load it with a simple click.

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.

Hot Key Description


Backspace Up One Directory
Delete Delete File
Ctrl+h Home Directory
Ctrl+w Working directory
Ctrl+n New Directory
Ctrl+b Display big icon
Ctrl+s Display small icons
Ctrl+l Show listing
Type first Selects the file
few letters
of file

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 Dialog Box

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

Save As Dialog Box

Save an active model as a new file


1. Click the Save As button on the Tool Bar. The dialog box appears.
2. Use the Directory Drop Down Box to locate the folder in which you want to save the file.
3. In the File Name field, enter a file name.
4. In the File Filter field, select the .MDL file format.
5. Click OK to save the file. CFD-VIEW saves the data and the visualization objects.

Overwrite an existing file


1. Click the Save As button on the Tool Bar. The dialog box appears.
2. 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.
3. In the File Name field, select the file you want to overwrite.
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. The visualization objects, data, and calculator registers will be saved to the file.

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.

Lasso objects in the active 3D Viewer


1. Click the Show Lasso button on the Tool Bar. The cursor changes to a corner shaped lasso and a red
rectangle (lasso) appears in the active 3D viewer.
2. In any of the lasso corners, click and hold the left mouse button, and drag the lasso to resize it to the area
you want to save.
3. Release the mouse button.
After the lassoed area has been designated, you can go to the Tools Menu-Record Lasso Area to record the lassoed
area as animation or save it as a file in one of the formats listed above. The Size tab on the Record window shows
the exact dimensions of the lassoed area. For information about making objects visible, invisible, and transparent,
see Workspace > Query Menus.

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

Off-screen rendering is support

Take a snapshot of the active 3D Viewer


1. Click the Snapshot button on the Tool Bar. The cursor in the 3D viewer changes to a corner shaped lasso.
2. Click and hold the left mouse button and drag the mouse across the area for which you want a snapshot.
3. Release the mouse button. The snap shot area is highlighted and the Image Output window appears.
4. Enter the size of the image. If off-screen rendering is available, the image will be scaled to the specified
size. Once accepted, the Save Image box opens.

73
CFD-VIEW V2014.0 User Manual

Image Output Window

5. Enter or select a file name to save the image and click OK.

Save Image Window

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

Perspective and Parallel

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.

View Orientation Descriptions


Option Description
Front View objects from the front.

Back View objects from behind.

Left View objects from the left.

Right View objects from the right.

Top View objects from the top.

Bottom View objects from the bottom.

Colors

The Colors button enables you to change the color of an object in the workspace.

75
CFD-VIEW V2014.0 User Manual

Color Dialog Window

Change the color of an object in the workspace


1. Click the Color button on the Tool Bar. The Color Dialog box appears. To access the Color Dialog box, you
can also select an object in the workspace and click the right mouse button to access the query menu.
2. Select a color by clicking on the color bar at the bottom of the window. The color appears under the
eyedropper to indicate the color you have chosen.
3. Change the color as needed.

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.

Edit Python Script


For a complete description of CFD-VIEW Scripting using Python, please refer to the scripting ocumentation. CFD-
VIEW uses different styles of programming , and the scripting documentation is more thorough. This topic only
describes the programming window and macros.

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.

Python Script Editor Window

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:

CFD-VIEW -script myscript.py

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

Edit Python Script-Library Modules


CFD-VIEW’s scripting language interface is organized as a set of twelve Python modules, loosely defined around
different areas of functionality. The modules include the following:

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()

Create an Axes annotation object.

CreateBounds()

Create a Bounds annotatison object.

CreateBox()

Create a Box annotation object.

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()

Create a Legend annotation object .

CreateLine()

Create a Line annotation object.

78
Toolbar

CreateOrigin()

Create an Origin annotation object.

CreateOval()

Create an Oval annotation object.

CreateText([text])

Create a Text annotation object. If the optional text argument is specified, that string will be used for the
object text.

CreateTime()

Create a Time annotation object.

GetPosition(object)

Returns the position of object as a tuple (x, y) in screen coordinates.

GetSize(object)

Returns the size (dimensions) of object as a tuple (w, h) in screen coordinates.

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)

Sets the edge color for an annotation object.

SetEdgeWidth(object, edgeWidth)

Sets the edge width (in pixels) for an annotation object.

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)

Set the file name for an Image Box object.

79
CFD-VIEW V2014.0 User Manual

SetLabelColor(object, labelColor)

Set the color for a Label object.

SetLabelFontOrientation(object, fontOrientation)

Set the font orientation for a Label object to one of FONT_ORIENTATION_VERTICAL_UP,


FONT_ORIENTATION_VERTICAL_DOWN or FONT_ORIENTATION_HORIZONTAL.

SetLabelFontSize(object, fontSize)

Set the font size for a Label object.

SetLabelFontWeight(object, fontWeight)

Set the font weight for a Label object.

SetLineArrowBaseSize(object, arrowBaseSize)

Set the base size for a Line object's arrow(s).

SetLineArrowHeadSize(object, arrowHeadSize)

Set the head size for a Line object's arrow(s).

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)

Set the color for a Line object.

SetLineEndPoint(object, x, y)

Set the end point for a Line object to (x, y).

SetLineStartPoint(object, x, y)

Set the starting point for a Line object to (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)

Sets the shadow color for an annotation object.

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)

Set the text string for a Label or Text object.

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)

Assigns the name newname to object.

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.

ImportDTF(filename[, importMethod [, simnumber]])

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..

ImportP3D(filename, scalars, vectors, variables, multizone, unformatted,


doubleprecision)

Import the named Plot3D file into this model.

ImportSTL(filename)

Import the named STL file into this model.

ImportSPY(filename)

Import the named SPY file into this model.

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)

Set the material surface color for object to color.

SetGridColor(object, color)

Set the grid color for object to color.

SetContourColor(object, color)

Set the contour color for object to color.

SetOutlineColor(object, color)

Set the outline color for object to color.

SetVectorColor(object, color)

Set the vector color for object to color.

SetPointsColor(object, color)

Set the points color for object to color.

SetSpecularColor(object, color)

Set the specular (shininess) color for object to 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()

Create a new Model.

OpenModelFile(filename)

Open an existing Model from given filename.

83
CFD-VIEW V2014.0 User Manual

GetActiveModel()

Returns a reference to the active model, or None if there is no 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.

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)

Save the active model to the file name filename.

quit()

Terminate the CFD-VIEW application.

reflow()

Reruns the dataflow network.

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)

Set the point size for object.

SetPointShape(object, shape)

Set the shape (one of POINT_SHAPE_POINTS, POINT_SHAPE_CUBES or POINT_SHAPE_BALLS) of the points


for object.

SetMinPointSize(object, size)

Set the minimum point size to be shown for object.

SetMaxPointSize(object, size)

Set the maximum point size to be shown for object.

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()

Fit view to window.

86
Toolbar

GetActiveViewer()

Returns a reference to the active viewer, or None if there is no active viewer.

GetViewerSize()

Returns the active viewer's width and height as a tuple (w, h).

ResetView()

Reset view.

Roll(amount)

Rotate the model about its x-axis by some number of degrees.

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)

Enable or disable anti-aliasing for this viewer, where antialiasing is either 0 or 1.

SetDithering(dithering)

Enable or disable dithering for this viewer, where dithering is either 0 or 1.

SetFieldOfView(fov)

Set the field of view for the active viewer.

SetFog(fog)

Enable or disable fog for this viewer, where fog is either 0 or 1.

SetProjection(projection)

Set the projection type for this viewer, one of PROJECTION_ORTHOGONAL or PROJECTION_PERSPECTIVE.

SetSurfaceOffset(surfaceOffset)

Set the surface offset for the active viewer.

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)

Rotate the model about its z-axis by some number of degrees.

ZoomIn()

Zoom in on the model by a small amount.

ZoomOut()

Zoom out from the model by a small amount.

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)

Enable or disable the display of this object, where visible is either 0 or 1.

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.

Macro Array & Run Macro Button

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.

Display Settings Bar

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.

Flat Shade flat shading is applied and each facet is shaded.

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.

This sections covers the following topics:

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.

Arrange multiple open viewer windows


The Windows Menu provides you with three ways to view multiple 3D viewer windows: cascade, tile horizontally,
and tile vertically. These options only affect the non-minimized windows. To view multiple 3D viewers, see
Window Menu-Window Appearance.

Select a viewer window


Only one window can be active at a time. You can select any window by clicking anywhere on it. Its title bar is
highlighted when it is active. When you select a window, it appears on top of any other windows and becomes the
active window. The active window receives all picking commands.

Using the Mouse Buttons


In CFD-View, you use the mouse to select entities and manipulate their geometries. You can select geometries in
several ways, as described in the following chart. Basic manipulations include rotation, translation, and zooming.
Also, you can hover the mouse over objects without clicking and a ToolTip displays. If you are hovering over point
data, extensive information about that nodal point is also in the ToolTip.

95
CFD-VIEW V2014.0 User Manual

To do this... ..click this button or perform this Comments


action
Selecting (picking) Left To select an active entity, click the left mouse
button. To de-select all entities, click the left
mouse button while the cursor is not hovering
over any entity.

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

To do this... ..click this button or perform this Comments


action
When you have lassoed the area you want, release
f the CTRL key and mouse. All of the objects in the
lasso are ready to be deleted, grouped, moved,
and so forth.
All of the items you have selected in the 3D viewer
also appear in the Object Explorer.

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.

Rotate the model on the X-axis


1. Place the cursor in the center of the screen.
2. Click and hold the left mouse button and drag the mouse toward or away from you.

Rotate the model on the Y-axis


1. Place the cursor in the center of the screen.
2. Click and hold the left mouse button and drag the mouse left or right.

Rotate the model on the Z-axis


1. Place the cursor near the edge of the screen.
2. Click and hold the left mouse button and drag the mouse at the edge of the window (perpendicular to the
screen).

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.

Query Shortcut Menu - Data Objects


To access the Object shortcut Query menu, click the right mouse button while the cursor is over any entity. This
action works while the cursor is in the 3D viewer or in the Object Explorer. These menu items are relevant to the
object type. Following is an example of an Object shortcut menu (for Data Object in this case) and some dialog
boxes that open when you click a menu item.

98
Workspace

Sample Shortcut Menu Rename Object Dialog Box

Rename Variable Dialog Box Rename Units Dialog Box

Box Annotation Properties Dialog Box

99
CFD-VIEW V2014.0 User Manual

Menu Option Description


Name shown on the top line, it is the name of the object. In the sample, the name of the surface
is wetted surface. This is read only information, and is useful when trying to distinguish
between several items in a crowded scene.

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.

Delete deletes the object from the model.

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.

Query Shortcut Menu - Annotation


Properties for objects in the workspace can be changed using the object's query menu. Depending on your
selection, you will see various menus and dialog boxes similar to the ones shown here.

100
Workspace

Query Menu for Box Rename Dialog Box Query Menu-Properties Option

Use the query menu to adjust the properties of most objects


1. Select the object.
2. Click the right mouse button on the object in the 3D viewer or in the Object Explorer.

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.

3. Make changes as needed.

Menu Option Description


Select all Annotation Selects the object's related annotation.

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.

Delete Deletes an object. No warning message will appear.

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

Menu Option Description


Turns the edge of an object off and on. A check mark next to Edge in the Query Menu
Edge
indicates that the edge is turned on.

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

Control Panel Introduction


The Control Panel, (also known as the Property Panels) enables you to control the model's attributes. To activate
the Control Panel, click on one of its tabs. The Control Panel tabs are:

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

Control Panel Tabs with View Settings Panel Displayed

103
CFD-VIEW V2014.0 User Manual

View Settings
The View Settings panel rotates an image on the X, Y, or Z axis.

View Settings Tab

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.

Field of View Changes as the X, Y, and Z angles are changed.

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.

Rotate a model on the X, Y, or Z axis


1. Click the View Settings tab on the Control Panel.
2. In the View Settings panel make changes as needed.

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.

Displayed Types Panel

Determine which objects you want to display


1. Click the Displayed Types tab on the Control Panel. The Displayed Types panel appears and contains the
types of objects that are currently displayed in the active 3D viewer. They correspond to the list that also
appears in the Object Explorer. If there are no objects in the 3D viewer or Object Explorer, the Displayed
Types panel will be blank.
2. Select the items that you want to display in the 3D viewer by checking the box. Boxes that are not
checked will not display those object types in the 3D viewer. Following is an example of objects in the 3D
viewer and their corresponding types as they appear in the Displayed Types panel and in the Object
Explorer.

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

Adjust the scale of a model


1. Click the Scaling tab on the Control Panel. The Scaling panel appears.
2. Change the angle on the X, Y, or Z axis by choosing one of the following:
3. Place the cursor on the X, Y, or Z dial. Click and hold the left mouse button while dragging the dial left or
right to change the angle.
4. Manually enter the angle degrees in the X, Y, or Z text fields.
5. After viewing the adjusted scale, click the Reset button to return the model to its original scale.

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

Change the lighting on a model


1. Click the Lighting tab on the Control Panel. The Lighting panel appears.
2. Double-click the color well for a spot light or ambient light.
3. Select a color by clicking on the color bar at the bottom of the window. The color appears under the
eyedropper to indicate the color you have chosen.
4. Change the color as needed. Reading from the left, the color tabs are as follows:

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.

Attribute Settings Panel

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

Change the attribute settings


1. Select the Attribute Settings tab from the Control Panel.
2. On the Attribute Settings window, double-click the color well to change the color, if needed.
3. Select other attributes as required.

Lines and Curves Settings


The Lines and Curves Settings panel controls the line thickness of an object in the 3D viewer. The controls are used
in conjunction with the corresponding surface buttons: Outline, Grid, and Contour. A polyline object is drawn with
a line thickness as specified under Outline. Optionally, a polyline (in particular when this polyline is derived from
the particle tracer) can be displayed as a tube or a ribbon. The width of the ribbon (or diameter of tube) can be
specified, as well as the starting angle of the ribbon.

Lines and Curves Settings Panel

Change the line settings


1. Select the Lines and Curves Settings tab from the Control Panel.
2. In the Lines and Curves Settings window, make changes as needed, based on the following parameters:

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.

Points Setting Tab

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.

Change the point settings


1. Select the Points Settings tab from the Control Panel. The Points Settings panel appears.
2. Make changes as needed.

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.

Color Map Settings Panel

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.

Change the color map settings


1. Select the Color Map Settings tab from the Control Panel.
2. In the Color Map Settings window, make changes as needed.

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.

Vector Settings Tab

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.

Change vector mapping


1. Click the Vector Setting tab on the Control Panel.
2. In the Vector Settings panel, make changes as needed.

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.

None Default. All symmetry operations are turn off.

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

Change symmetry conditions


1. Select all of the object for which symmetry is to be applied.
2. Select the Symmetry Conditions tab from the Control Panel.
3. In the Symmetry Panel, make changes as needed.

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.

IJK Parameters Panel

Change the I, J, or K range


1. Select the IJK Parameters tab from the Control Panel. The IJK Parameters panel appears.
2. Enter a From and To range for each of the IJK parameters, as needed, or use the slider bars to change the
range.

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

Parameter Based Animation


Parameter-based animation creates a movie based on the parameters in an active 3D viewer. 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.

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.

Move Playback to First


Moves the animation back to the frame set as the initial configuration.
Frame

Stop Stops the animation.

Play Plays the animation.

Move Playback to Last


Moves the animation forward to the frame set as the final configuration.
Frame

Frame Slider Moves the animation frame by frame.

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.

Current File Shows which files are used in the animation.

119
CFD-VIEW V2014.0 User Manual

Create a parameter-based animation


1. Select the Animation tab from the Control Panel. The Animation panel appears.
2. In the 3D viewer, put the model in the desired starting configuration and press the Register Initial
Configuration button.
3. Put the model in the desired ending configuration and press the Register Final Configuration button.
4. Press the Play button to play the animated file.
5. Make changes as needed.

File Based Animation


File-based animation creates a movie based on the files that you import and list in the Current File field of the
Animation panel.

Animation Panel

120
Control Panel

File Menu - Select Files for Animation

Create file-based animation


1. Select the Animation tab from the Control Panel. The Animation panel appears.
2. Load the first file in the sequence of files that are to be animated. Once the file is loaded, any drawing
settings, cutting planes, or other operations are performed on that data.
3. Select the additional files in the order that they will be used in the animation by right-clicking on the file in
the Current File area or selecting File Menu-Select Files for Animation.
4. Select the files either individually or as a group from the Select Files for Animation dialog box.

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.

Trigger File-Based Animation


Trigger File-Based animation tracks a running CFD simulation by means of touching (UNIX command) a trigger file.
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. The source of the trigger event is an external program like a flow-solver, 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 changed, the solution from the data files
will be reread.

Create a trigger file-based animation


1. Select the Import Additional Data Files option from the File menu to select load the data files.
2. Configure the model as desired (set color, create cutting planes, etc.).
3. Select the Select Trigger File option from the File Menu. The trigger event will have the same effect as File
Menu-Reload the Same Data File.
4. Select the Enable Trigger option from the file Menu to turn on trigger file monitoring. From this point
forward, each time the trigger file is touched by the external application, CFD-VIEW will reread all of its
data files.

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.

Record Animation Setup Window - Output Tab

Record Animation Setup Window - Size Tab

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.

4. Set the desired format.


5. Set the desired filename.

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.

6. Use the quality slider to set the desired output quality.


7. On the Size Tab - set the desired output size. By default the size will be the same as the size of current
viewer (or the size of the selected lasso area).

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.

Background Panel with Gradient Settings

125
CFD-VIEW V2014.0 User Manual

Color Dialog Box with Color by Name Tab Displayed

Change the background color in the 3D window to a solid color


1. Select the Background tab from the Control Panel. The Background panel appears.
2. In the Solid Background section, double-click on the color well next to Background Color to set the
background color. The Color Dialog box appears.
3. Select a color by clicking on the color bar at the bottom of the window. The color appears under the
eyedropper on the left to indicate the color you have chosen.
4. Click on the tabs at the top of the dialog box to 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.

5. Click the Accept button to apply the color to the active 3D viewer background.

126
Control Panel

Change the background color in the 3D window to gradient colors


1. Select the Background tab from the Control Panel. The Background panel appears.
2. In the Gradient Background section, click the Use Gradient Box.
3. Double-click on the top left, top right, bottom left, and bottom right color wells, as described above, to
choose the gradient background colors.
4. Click OK after each selection. The gradient background appears in the active 3D viewer.

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.

The Calculator Panel


You open the Calculator panel by clicking the Calculator tab on the Control Panel. You can then use the Calculator
to enter, change, or remove expressions from data objects and view the outputs when the expressions are
evaluated. You can also use the Expression menu functions to quickly insert an expression. The Calculator, also
called the expression evaluator, works with scalar and array values.

127
CFD-VIEW V2014.0 User Manual

Button and Field


Description
Descriptions
Displays error messages and other information. The output field is not editable. The
Output Field clear button on the left clears the data when the amount of information visible becomes
too much.

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

Calculator Expression Menu

Menu option Description


displays a list of the variables of the selected
Variables
dataset objects

Trig displays a list of the trigonometric functions

Math shows various common math functions

Logicals displays logical operators

Integration shows integration functions

Miscellaneous contains various other functions

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

Evaluating Simple Expressions


The expression evaluator manages both scalar and array data, and handles integer and real number types. When
combining integer and real numbers in an operation, the integer numbers are automatically extended to real
numbers. Likewise, when combining array and scalar values, the scalar value is conceptually extended to an array
value by replicating the scalar as many times as necessary to match the length of the array operand. Thus,
manipulating the data arrays becomes simple, and working with scalars does not incur undue overhead. The entire
list of expressions can be evaluated in one single pass.

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

Likewise, for the or operator:

Expression Output
0 or 0 0
0 or 1 1
1 or 0 1
1 or 1 1

And the xor operator:

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

And the not operator:

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 ">":

Expression Output Comments


2<3 Result in True of course!
Zone#1: 1
sum(P > 0) Result in A total of 9 nodes have P greater than 0
Zone#1: 9

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.

Expression Output Comments


A=1 (1,1,1,...) Sets variable A to 1 everywhere, and yield the array of 1’s.

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

Entering “Funny” Variable Names


Sometimes, variable names may have “funny characters” in them, that if entered into the expression field might be
interpreted as operators. CFD-VIEW allows you to use such variable names in the expression evaluator by quoting
them. For example, pH=-log(H+) will give a syntax error, because the sub-expression H+ looks like an addition with
a missing right-hand operand. Instead, enter this expression: pH=-log(“H+”) The quotation marks cause CFD-
VIEW’s expression evaluator to ignore the funny characters inside, so that you can now use any kind of character in
a variable name.

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

A=atan2(P) missing ',’

Certain built-in functions require you to pass in variables, instead of values. For example, the gradient calculation
routines complain as follows:

Expression Result

A=grad3x(2) grad3x: argument must be grid-based

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:

<test-expression> ? <expression-if-true> : <expression-if-false>

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:

Q = U < -3.0 ? -3.0 : U > 3.0 ? 3.0 : U

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:

TRIGONOMETRIC MENU FUNCTIONS

• 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].

MATH MENU FUNCTIONS

• sqrt (x) - Square root of argument x.

• sqr(x) - Square of argument x, or x2.

• abs(x) - Takes the absolute value of x.

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.

• exp(x) - Returns the base e [natural log base] power of x.

• log(x) - Returns the base e logarithm of x.

• log10(x) - Returns the base 10 logarithm of x.

• max(x) - Returns maximum value of array x.

• min(x) - Returns minimum value of array x.

MISCELLANEOUS MENU FUNCTIONS

• random() - Returns a random number in the range [0..1].

• ceil(x) - Returns the smallest integer not less than x, or [x].

• floor(x) - Returns the largest integer not greater than x, or [x].

• len(x) - Returns the number of elements in array variable x.

• 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.

• curly(u,v,w) - Returns the y-component of the curl of vector variable uvw.

• curlz(u,v,w) - Returns the z-component of the curl of vector variable uvw.

• grad2x(f) - Returns x component of the 2D gradient of grid-based variable f, i.e. f/x.

• grad2y(f) - Returns y component of the 2D gradient of grid-based variable f, i.e. f/y.

• grad2m(f) - Returns the 2D gradient magnitude of grid-based variable f.

• grad3x(f) - Returns x component of the 3D gradient of grid-based variable f, i.e. f/x.

• grad3y(f) - Returns y component of the 3D gradient of grid-based variable f, i.e. f/y.

• grad3z(f) - Returns z component of the 3D gradient of grid-based variable f, i.e. f/z.

• grad3m(f) - Returns the 3D gradient magnitude of grid-based variable f.

• sum(array) - Returns sum of all elements in array.

• product(array) - Returns product of all elements in array.

• 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.

• frames()- Returns the total number of frames being animated.

• 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.

INTEGRATION MENU FUNCTIONS:

• 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.

• volume() - Returns volume of current volume data object.

• volumes() - Returns array of volumes of each cell in the current volume data object.

• area() - Returns area of current surface data object.

• areas() - Returns array of areas of each face in the current surface data object.

• chordlen() - Returns chord length of line.

• 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

KEYBOARD SHORTCUTS FOR DIALOG BOXES

CFD-VIEW contains standard Windows "hot" keys that enable you to quickly perform operations when typing into
dialog boxes.

Hot Key Description


Up Arrow Moves cursor up a line

Down Arrow Moves cursor down a line

Left Arrow Moves cursor to the left

Right Arrow Moves cursor to the right

Home Moves cursor to beginning of line

End Moves cursor to end of line

<CTRL> A Select all

<CTRL> C Copy to clipboard

<CTRL> X Cut

<CTRL> V Paste

<SHIFT> Select and move


Arrow

<CTRL> Next word/previous word


Arrow

Backspace Delete previous nharacter before the


cursor

Del Delete next nharacter after the cursor

Ins Toggle overstrike mode

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.

The syntax is shown below.


<script> > := { [ <expression> ] <eol> }
<expression> := <alternative> [ '=’ <expression> ]
<alternative> := <logor> [ '?’ <expression > ':’ <expression> ]
<logor> := <logxor> { 'or’ <logxor> }
<logxor> := <logand> { 'xor’ <logand> }
<logand> := <lognot> { 'and’ <lognot> }
<lognot> := [ 'not’ ] <compare>
<compare> := <add> [ <compop> <add> ]
<add> := <multiply> { <addop> <multiply> }
<multiply> := <power> { <multop> <power> }
<power> := <unary> { '**’ <unary> }
<unary> := [ <unop> ] <subscript>
<subscript> := <element. [ '[' <expression> ']’ ]
<element> := '(' <expression> ')’ |
<realnumber> |
<intnumber> |
<identifier> |
<quotedidentifier> |
<funccall>
<compon> := 'lt’ | 'le’ | 'eq’ | 'gt’ | 'ge’ | 'ne’ | '<’ |
'<=’ | '==’ | '>’ | '>=’ | '!=’
<addop> := '+’ | '-'
<multop> := '*’ | '/’ | '%’
<unop> := '+’ | '-'
<realnumber> := <digit> {<digit>} '.’ {<digit>} [<exponent>] |
{<digit>} '.’ <digit> {<digit>} [<exponent>] |
<digit> {<digit>} <exponent>
<intnumber> := <digit> {<digit>}
<digit> := '0’ ... '9’
<exponent> := ( 'E’ | 'e’ ) ['+’ | '-’ ] <digit> { <digit> }
<quotedidentifier> := '”' {<anycharactes>} '”’
<identifier> := <letter> { <letter> | <digit> }
<letter> := 'a’ ... 'z’ | 'A’ ... ’'Z’ | '_’
<anycharacter> := ' ' ... '~’'

139
Chapter 8. Operator Palette

Operator Palette Introduction


CFD-VIEW is built upon a data flow architecture where the output from one operation can be used as the input to
another. For example, a volume might be cut by an X-Cut which yields a surface. This surface may then be used as
input to another cutting operation, which yields a curve. This curve could then be input to a plotting operation, and
so on.

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.

X-Cut Operator Control

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

Iso-Surface and Iso-Curve

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.

Iso-Surface and Iso-Curve Operator Control

Create an iso-surface or iso-curve


1. Select the object in the 3D viewer upon which the operation is to be performed.
2. Click the Iso-Surface operator. A new surface object is produced and the Operator Control appears so that
you can apply additional conditions.
3. Enter the value for the iso-value in the Value field.
4. Select the Iso value from the Iso menu.
5. Select clipping variables if needed.

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

Clipped Cutting Plane

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.

X-Cut Operator Control with Clipping

144
Operator Palette

Create a clipped X, Y, Z, Arb cut, or iso-surface


1. Click the X / Y / Z / Arb Cut, or Iso-Surface operator. A new surface object is produced and the Operator
Control appears so that you can apply additional conditions.
2. Enter the value for the operation in the Value field.
3. Select the first Clipping variable
4. Toggle the small blue arrow up or down to indicate an upper or lower clipping bound
5. Select the value for the clipping variable
6. After selecting a clipping variable, an additional blank pulldown list is added to allow additional clipping
variables if needed.

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.

I,J,K Plane Operator Control

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.

Control Panel > Scaling change the X, Y, or Z scales of a model.

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

Arbitrary Plane Cut

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.

Arbitrary Plane Cut Operator Control

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.

Arbitrary Plane Cut Example

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.

Relative Rotation Axes

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

Imported STL Surface

Arbitrary Plane Cut Example


1. Select the object in the 3D viewer that you want to cut.

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

I, J, K Lines Operator Control

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.

Particle Trace Operator Control

150
Operator Palette

Create a curve using a particle trace


1. Select the object in the 3D viewer upon which the operation is to be performed.
2. Click the Particle Trace operator. A new trace glyph is produced and the Operator Control appears so that
you can apply additional conditions.
3. Apply particle trace controls as needed, based on the information in the following table:
Field Description
Mode You can specify the 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
trace release 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. If the particle
trace is set to IJK mode, the next Domain for IJK mode enables you to specify
in which domain the particle trace should be operating.
When the Snap option is activated, the Trace will be snapped to the closet
grid node. When moving/dragging the Trace with the left mouse button in
the 3D Viewer, the Trace will snap upon release of the button. Currently,
snapping is not compatible with IJK Mode.
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 Trace has the ability to position the
I, J, K IJK coordinates at fractional positions as well as integer positions.

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.

Line Probe Operator Control

152
Operator Palette

Use the line probe


1. Click the Line Probe operator. A new line is produced and the Operator Control appears so that you can
apply additional conditions.
2. Apply Line Probe controls as needed, based on the following information:
Operator Description
Point You can specify which part of the Line Probe you want to move: the Head end-point,
the Tail end-point, or Both end-points. When selecting Both, the whole line will be
translated.
When the Snap option is activated, the head and tail of the Line Probe will be
snapped to the closet grid node. When moving/dragging the Line Probe with the left
mouse button in the 3D Viewer, it will snap upon release of the button. When the
“Head” option is selected, only the Head end of the line will snap. The behavior is
similar when the “Tail” and “Both” options are selected.
X, Y, Z The X, Y, Z fields enable you to set the Cartesian XYZ coordinates.

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.

The first row may be the optional header. For example:

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.

Point Probe Operator Control

Extract data from a particular location


1. Click the Point Probe operator. A new point is produced and the Operator Control appears so that you can
apply additional conditions.
2. Apply point probe controls as needed, based on the following information:
Condition Description
Mode You can specify the 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 text 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 Point Probe will be snapped to
the closet grid node. When moving/dragging the probe with the left
mouse button in the 3D Viewer, the probe will snap upon release of the
button. Currently, snapping is not compatible with IJK Mode.
Domain for IJK If the probe is set to IJK mode, the next Domain for IJK mode enables
Mode you 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. A new feature for the 2003 release is
I, J, K
the ability to position the IJK coordinates at fractional positions as well
as integer. The Point Probe has the ability to position the IJK coordinates
at fractional positions as well as integer positions.
Variable Enables you to select the desired output variable, whose value is then
displayed in the Value field.
Value Displays the output variable value and is automatically calculated based
on the chosen variable.

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 Probe Operator Control

Extract data from a particular location


1. Click the Min/Max Probe operator. A new point is at the minimum or maximum value. The maximum
value is the default value.
2. Once Min/Max probe has been created, the variable of interest may be specified from the drop down list.

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.

Point History Control Panel

155
CFD-VIEW V2014.0 User Manual

Create a Point History


1. Create or select a Point Probe and place it at the desired location.

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

Strip Chart Operator Control

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

2D Point Net (Colored by Velocity)

159
CFD-VIEW V2014.0 User Manual

Point Net Controls


As with the other operators, the control panel will switch to the point net controls when the point net object is
selected. As shown below, the only settings for the point net operator are the number of points in the X, Y, & Z
directions. Care should be taken when selecting the number of points for the net, as it does not take many in each
direction to create a large number of points. For example, a 100x100x100 grid creates a million points with all of
the data derived from the underlying grid. In this sample, the memory requirements would become 4 megabytes
on most systems for each attribute, (pressure, temperature, etc.). A very nice looking image can usually be
achieved with less than a few dozen points in each direction.

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.

Point Net Controls

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.

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

Carpet Plot Controls

Carpet Plot Menu

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

Use the border object operator


1. Select the input 3D zone.
2. Click the Border Object operator. The output border object is added to the object explorer. It is then
treated like any other surface, including display, cutting, and so forth.

Surface Merge

The Surface Merge operator merges multiple surfaces into a single combined surface. There are no controls
for this operator.

Merge multiple surfaces into a single surface


1. Select the input surfaces that you want to merge together.
2. Click the Surface Merge operator. The multiple surfaces are merged into one and added to the object
explorer.

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.

Surface Reduction Operator Control

Reduce a surface size


1. Select the surface that you want to reduce.
2. Click the Surface Reduction operator. The Operator Control appears so that you can apply additional
conditions.
3. Enter the reduction that you want to occur, ranging from .1 to 1.0.

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.

Replicator Operator Control

165
CFD-VIEW V2014.0 User Manual

Replicate a data object


1. Select a single data object, (i.e. surface, volume), to replicate.
2. Click the Replicator operator. The Operator Control appears so that you can apply additional conditions.
3. Adjust mode, (e.g. rotate, mirror, and so forth.).
4. Select the axis, (X,Y,Z, or Custom).
5. Adjust the number of replications, including starting / stopping angles (distances).
6. Finally, select whether to perform the coordinate transformation on the known vectors in tshe model. For
example, velocity vectors might be pointing in different directions after replication using a rotation about
an axis.

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

Show External Plot

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

Show External Plot Panel

Create an X,Y plot


1. Select the input object (line, curve, etc.).
2. Click the Plotter operator. The Plotter Operator Control appears so that you can apply additional
conditions.
3. Apply plotter controls as needed, based on the following information:
Field Description
Show External Check this box. When checked, the plot displays in its own window and enables
Plot you to change and save additional plot parameters.
Copy Plot Do not check this box. When checked, the plot displays in the 3D viewer window.
Image into 3D
Viewer

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.

PLOT PANEL MENUS

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

The Plot Panel Edit menu provides the following options:

• 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.

Plotter Scales Menu

170
Operator Palette

When the Custom Scales option is selected, the Custom Scales window appears.

Custom Scales Window

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

• Titles - Enables you to assign a title to the plot

• 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.

Plot Colors Panel

• 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

Line Attributes Panel

172
Operator Palette

PLOT MENU
The plot menu allows you to select the type of plot you want to see.

CFD-VIEW supports the following plot types:

• 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

COPY PLOT IMAGE INTO 3D VIEWER

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

Copy Plot Image Viewed in the 3D Viewer

Create an X,Y plot


1. Select the input object (line, curve, etc.).
2. Click the Plotter operator. The Plotter Operator Control appears so that you can apply additional
conditions.
3. Apply plotter controls as needed, based on the following information:
Field Description
Copy Plot Check this box. When checked, a copy of the external plot displays in the 3D viewer
Image into 3D window.
Viewer
Show External Do not check this box. When checked, the plot displays in its own window.
Plot
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.

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.

Plotter Controls with DSP

176
Operator Palette

Add DSP Operation Dialog

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

Correlation parameters dialog box

Define lag length and samples number


1. Lag length: the length over which the correlation has to be estimated (by default, half the number of
curve points)
2. Samples number: allows truncating the curves to the user given number of abscissa points. The default
value is the number of points in the curve.

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

FAST FOURRIER TRANSFORM (FFT)

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

DISCRETE FOURRIER TRANSFORM (DFT)

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 AND DERIVATIVE

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:

Note: The integral curve is defined on n-1 points only.

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-

points of the original set of abscissa, defined as follows:

.
Note: The derived curve is defined on n-2 points only.

180
Operator Palette

POWER SPECTRAL DENSITY (PSD)

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.

The value of PSD magnitude in dB is given by . is equal to


Pa.

181
CFD-VIEW V2014.0 User Manual

SMOOTH AND FILTER

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.

Example of filtered signal

Two user defined frequencies gives the window parameters.


By default, the band pass is - these parameters give back the original signal.

182
Operator Palette

Band Pass Filter Parameters Dialog Box

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.

SOUND PRESSURE LEVEL (SPL)


Acoustic filters can be applied to the dataset in order to obtain SPL A, B, or C. The Sound Pressure Level is
computed by the formula:
(1)

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)

where is the total number of bandwidths.

hen selecting one of the SPL options, you have to choose the frequency bandwidth:

PL Parameters Dialog Box

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 AND WINDOW

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.

Window parameters dialog

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).

Segmentation parameters window

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

Operators in green, Annotation Objects in blue

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.

Legend Properties Panel

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:

Legend Properties dialog box


Area of dialog Options Description
box
Legend Name displays the name of the legend object.

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

Area of dialog Options Description


box
the “Flooded” option is unavailable. In this case, the legend display type
(smooth or flooded) will be the same as the object it is tracking. When the
“Track Active Map” option is not selected, then the “Flooded” option
becomes available, and the legend can be displayed as smooth or flooded,
independently from the display type of the active object.

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

Area of dialog Options Description


box

Examples of Various Layout Options

Labels Title shows the title.

Units appends the unit of the color variable to the title.

Ticks shows tick numbers.

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.

Test Color sets the text color

Title Font sets the font to be used for the title.

192
Operator Palette

Area of dialog Options Description


box
Number Font sets the font to be used for the numbers.

Tickmarks Major shows major tickmarks.

Minor shows minor tickmarks

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.

Tick Color sets the tick color.

Border Color sets the border color.

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

Time Annotation Menu

Display the animation time of an object


1. Load any DTF data file. Which will activate the button.
2. Click the Time Annotation button. A small menu will appear with a list of file readers identified by their file
names. Select the appropriate reader.
3. Right-click on the Time Annotation button. The Time Annotation menu appears.
4. Make changes, as needed, based on the following information.
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.
Units This sets the units shown in the display of time. The default units are seconds.
Fonts The Time Annotation object is very similar to the Text Annotation object in its
display settings. Both use a bit-mapped font instead of the vector graphics fonts
used for the Legend and Label objects, which provides a much broader selection of
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. See window below.
Font Color This sets the color of the text for the Time Annotation object.
Shadow This provides a drop shadow for the text of the Time Annotation object.
Exponential This changes the display of time for this object from a decimal representation to
exponential, which is similar to that of the Legend.

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.

Origin Annotation Menu

Time Annotation Font Window

195
CFD-VIEW V2014.0 User Manual

Transient Time Properties Window

See the position and orientation of a model's origin


1. Select the object.
2. Click the Origin Annotation button.
3. Right-click on the Origin Annotation button. The Origin Annotation menu appears.
4. Make changes, as needed, based on the following information.
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.
Properties The Origin Annotation Properties panel offers all of the settings described above.

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

Axes Annotation Menu

Position the axes


1. Click the Axes Annotation button.
2. Select the object.
3. Drag the object to the desired location.
4. Right-click on the Axes Annotation button. The Axes Annotation menu appears.
5. Make changes, as needed, based on the following information.
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..
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.
Properties The Axes Annotation Properties panel offers all of the settings described above.

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

Control Panel > View Settings rotate an image on the X, Y, or Z axis

Control Panel-Symmetry Conditions graphically reconstruct a full domain to reduce computational


problems

197
CFD-VIEW V2014.0 User Manual

Bounding Box Annotation


The Bounding Box object is a rectangular box that is aligned with the axes drawn around the smallest volume
that entirely contains the entire model. Numerical scales are shown on the edges of the bounding box and can be
customized.

Bounding Box Annotation Menu

Bounding Box Properties Window

198
Operator Palette

Bounding Box Annotation Example

Create bounding box annotation


1. Select the object.
2. Click the Bounding Box Annotation button.
3. Right-click on the Bounding Box Annotation button. The Bounding Box Annotation menu appears.
4. Make changes, as needed, based on the following information.

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.

Image Box Annotation

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.

Image Annotation Properties Window

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.

Image Box Annotation Example

200
Operator Palette

Create an image box annotation


1. Click the Image Box Annotation button. The Replace With Your Image annotation box appears in the 3D
viewer.

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.

Image Box Annotation Menu

4. Make changes, as needed, based on the following information.

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.

Box and Oval Annotation

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

Box Annotation Properties (Same as Oval)

Box Annotation Properties

Create box or oval annotation objects


1. Click the Box or Oval Annotation button. A box or oval with small green handles appears in the 3D viewer.
2. To resize or reshape the box, click on a green handle, hold the left mouse button, and drag the handle to
resize the object as needed.
3. To move the box, select it, click and hold the left mouse button, and drag the object to the desired
location.
4. Right-click on the Box or Oval Annotation button. The Box or Oval Annotation menu appears.
5. Make changes, as needed, based on the following information.
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.

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.

Line Annotation Menu

204
Operator Palette

Line Annotation Properties Window

• 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.

Create box or oval annotation object


1. Click the Line Annotation button. A line appears in the 3D viewer with small green handles.
2. To resize or reshape the line, click on a green handle, hold the left mouse button and drag the handle to
resize the object as needed.
3. To move the line, select it, click and hold the left mouse button, and drag the object to the desired
location.
4. Right-click on the Line Annotation button. The Line Annotation menu appears.
5. Make changes, as needed, based on the following information.
Option Description
Select all This menu item allows a convenient method for selecting all of the annotation
annotation objects in the model, including other types of annotation as well.
Visible This annotation object can be easily hidden from the 3D Viewer display. Once it is
hidden, the object will need to be selected from the Object Explorer, and the
visibility turned back on.
Rename All objects can be renamed. This is the name of the object that is displayed in the
Object Explorer. When this menu item is displayed, a small dialog appears that
allows the name to be changed.
Delete This provides a convenient method for deleting a single object. It is the equivalent of
selecting a single object, and pressing the red deletion X at the top of the GUI.
Line width Selecting this pops another option menu that allows easy selection of the line
thickness.
Arrows The only difference between a line and arrow in the Line Annotation object is the

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.

Text Annotation Menu

Text Annotation Properties

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

Text Font Window

Create text annotation object


1. Click the Text Annotation button. A text box appears in the 3D viewer.
2. Right-click on the Text Annotation button. The Text Annotation menu appears.
3. Make changes, as needed, based on the following information.
Option Description
Select all This menu item allows a convenient method for selecting all of the annotation
annotation objects in the model, including other types of annotation as well.
Visible This annotation object can be easily hidden from the 3D viewer display. Once it is
hidden, the object will need to be selected from the Object Explorer, and the
visibility turned back on.
Rename All objects can be renamed. This is the name of the object that is displayed in the
Object Explorer. When this menu item is displayed, a small dialog appears that
allows the name to be changed.
Delete This provides a convenient method for deleting a single object. It is the equivalent of
selecting a single object, and pressing the red deletion X at the top of the GUI.
Text This pops a small dialog that allows the displayed text to be set. This is not the
name that appears in the Object Explorer for the text object, but the text displayed
in the 3D viewer.
Font The Text Annotation object is very similar to the Time Annotation object in its
display settings. Both use a bit-mapped font instead of the vector graphics fonts
used for the Legend and Label objects, which provides a much broader selection of
fonts.
Font color With this, the color of the text for the Text Annotation object can be set.
Shadow A drop shadow for the text of the Text Annotation object is provided.

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.

Label Annotation Menu

208
Operator Palette

Label Annotation Properties

Create label annotation object


1. Click the Label Annotation button. A label box appears in the 3D viewer.
2. Right-click on the Label Annotation button. The Label Annotation menu appears.
3. Make changes, as needed, based on the following information.
Option Description
Select all This menu item allows a convenient method for selecting all of the annotation
annotation objects in the model, including other types of annotation as well.
Visible This annotation object can be easily hidden from the 3D viewer display. Once it is
hidden, the object will need to be selected from the Object Explorer, and the
visibility turned back on.
Rename All objects can be renamed. This is the name of the object that is displayed in the
Object Explorer. When this menu item is displayed, a small dialog appears that
allows the name to be changed.
Delete This provides a convenient method for deleting a single object. It is the equivalent of
selecting a single object, and pressing the red deletion X at the top of the GUI.
Label text This pops a small dialog that allows the displayed text to be set. This is not the
name that appears in the Object Explorer for the Label object, but the text displayed
in the 3D Viewer.
Font style The Label Annotation uses a 3D vector graphics font for the legend, and provides a
set of available fonts. These are selected with this option menu.
Font size This allows setting of the vector graphics font size of each of the digits/characters in
the display.
Font weight With vector graphics fonts, the outline of the characters is a set of lines, (curves).
The weight parameter is the thickness of that line.
Font color This menu item pops a color dialog that allows setting of Label's color.
Orientation The label can be oriented vertically or horizontally using this option menu.

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

Object Explorer Introduction


The Object Explorer provides table-driven details about an object in the Workspace. The Object Explorer is located
under Operator Controls. An object appears in the Object Explorer when you click one of the buttons in the
Operator Palette, add an object to the workspace, or import files. Any time an object is selected in the workspace,
it becomes highlighted in the 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.

Object Explorer List and Object Explorer Buttons

Select objects in the Object Explorer


1. Click the left mouse button on the object in the Object Explorer, or
2. Click the left mouse button on the object in the 3D viewer. When right clicking on an object, a query menu
appears to enable you to change an object's properties.

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.

Object Explorer Buttons

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.

Goup multiple objects together as a single object


1. Select the objects you want to group from the 3D viewer or the Object Explorer.
2. Select the Groups Object button. The objects are grouped together and behave as a single object. The
Object Explorer is updated to indicate that an object has been grouped.
3. To see the elements of the group, double-click the group in the explorer, and the first grouping level is
exposed. If there are subgroups, double clicking on them will expand to the next level, and so on.

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.

Ungroup a previously grouped object


1. Select the object from the 3D viewer or the Object Explorer.
2. Select the Ungroup Object button. The object is ungrouped and each of the objects behave
independently. The Object Explorer is updated to indicate that an object has been ungrouped.

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:

Opening Multiple Windows


Arranging Multiple Windows
Selecting and Positioning a Window
Reading the Title Bar

215
CFD-VIEW V2014.0 User Manual

CFD-VIEW with Two 3D Viewers in the Workspace

Opening Multiple Windows


You can simultaneously load multiple models and arrange them in an overlay fashion or in the Multiple Document
Interface. The models in the 3D Viewer may be independently rotated, zoomed, and manipulated so that you can
view the model from different angles. The active 3D Viewer is distinguished by a highlighted title bar. CFD-VIEW
initially starts with one maximized 3D Viewer. However, you can open more than one viewer at a time by opening
several different files. To view an open file in several windows, select New Viewer from the Windows menu.

216
3D Viewer

Arranging Multiple Open Windows


You can arrange the open windows in three ways: Cascade, Tile Horizontally, and Tile Vertically.

Arrange multiple open windows


1. Click on the Window Menu. The Window menu opens.
2. Select one of the window arrangement options: cascade, tile horizontally, or tile vertically. The multiple
windows are automatically arranged in the workspace based on which option you choose. These
commands only affect the non-minimized windows.

Selecting a Viewer Window


In CFD-VIEW, though many 3D viewer windows may be open, only one 3D viewer can be active at a time. The
active 3D viewer receives all editing commands. When you click on a 3D viewer window, you make it active, it
appears on top of all other open 3D viewers, the title bar is highlighted, and the file name appears in the main
window’s Title Bar. A maximized 3D viewer occupies the entire workspace. When a 3D viewer is maximized, its
Window Menu icon and Restore Button appear at opposite ends of the Menu bar.

Positioning a Viewer Window


At the right end of the 3D viewer title bar are minimize, maximize, restore and close buttons. The Restore button
appears when the image window is maximized.

Minimize Reduces the viewer window to an icon


Maximize Enlarges the viewer window to fill the screen
Restore Returns the viewer window to its last non-minimized, non-
maximized position

Move a viewer window to a different location


1. Point the cursor at the text portion of the title bar.
2. Press and hold the left mouse button.
3. Drag the window to the desired location by moving the mouse.
4. Release the mouse button.

Resize a viewer window


1. Point a side or corner of the window. The cursor will change to a double-headed arrow. Grabbing a corner
moves two sides at once.
2. Press and hold the left mouse button.
3. Drag the window to the desired size by moving the mouse.
4. Release the mouse button.

217
CFD-VIEW V2014.0 User Manual

Shuffle Viewer Windows


• To send a 3D viewer to the back, right-click its title bar.
• To maximize a 3D viewer that is displayed normally, double-click its title bar.
• To restore a minimized 3D viewer to normal size, double-click its title bar.

Reading the Title Bar


You'll be able to tell which 3D Viewer is active because it has a highlighted title bar. If a model file has already been
created, the title bar displays the model’s file name and indicates if the image has been edited since it was last
saved. If a single file has been loaded into the model, that file name appears in the title bar. If more than one file
has been imported, "Multiple Files” appears in the title bar. If a model file has been created, an asterisk (*) after
the file name in a viewer's title bar indicates that the image has been edited since it was last saved.

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.

Export calculator results to a text file

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)

This will print out the result of Pressure[0]*Pressure[1]...*Pressure[N-1].

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:

V= RHO==0 ? 0.0 : VM/RHO

Just in case there is a RHO==0 out there somewhere in the grid.

220
Appendix Formulas

Formulas For Common Problems


Very often, variable registers read in from CFD solvers may contain some values that are out of range. Often, this
may be due to unconverged solutions and so on. Fortunately, CFD-VIEW calculator can be used to fix outliers by
“clamping” them to a desired range:

FRACTION=FRACTION<0 ? 0 : FRACTION>1 ? 1 : FRACTION

A simpler case would be to prevent some value from becoming zero, for instance, before taking its logarithm:

“H+”=”H+” < 0 ? 0.0001 : “H+”


pH=-log10(“H+”)

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.”

Of course you can limit on the upper side also:

PRESSURE= PRESSURE > 1E5 ? 1E5 : PRESSURE

This would limit PRESSURE to be at most 1E5.

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)"

Formulas For Differentiation


CFD-VIEW provides a number of functions to compute partial derivatives of some variable register. There are both
2D and 3D flavors of these functions. For example, you may wish to use the particle tracer to visualize electric field
lines. Suppose you have a variable Q, the electrostatic potential. Taking three consecutive derivatives of Q will
populate the volume dataset with the electric field, which is a vector quantity:

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)

Having the gradient functions, calculating divergence is also easy:

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.

Formulas For Integration


CFD-VIEW can perform various calculations on cell volumes or face areas. Select a volume dataset in the model,
then type into the expression field:

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.

We can also obtain the volume of each cell:

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.

Formulas To Translate Grids


This section provides you with CFD translate grids for working with CFD-VIEW. The pound sign (#) indicates that the
information following it is a comment and not part of a formula.

# 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

Formulas For Creative Visualization


CFD-VIEW provides iso surfacing, X, Y, and Z cutting planes, and I, J, and K planes as well as arbitrary cut planes. Yet
some times you may find that you need to carve a cylindrical or spherical surface out of the volume. This can be
done by creating a new variable register and populating it using a special formula. For example:

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.

Likewise, the formula below creates a spherical iso-surface centered at x=5,y=6,z=7.

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

User Customization Introduction

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

for system wide settings and

HKEY_CURRENT_USER/Software
for user settings. You can edit the registry using any text editor on UNIX or Regedt32.exe under Microsoft
Windows.

The following settings are common to all FOX programs:

[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.

ext = “program %s &;File Type;bigicon:bigiconopen;smallicon:smalliconopen;mimetype”

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:

/mnt/cdrom = “;CDROM Drive; cdrom.xpm; mini/cdrom.xpm;application/x-folder”

The icons are located by means of the iconpath variable.

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)

Temp dir - "/tmp" (when temp files are stored)

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

Introduction to Python Scripting


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 existing scripts and write new scripts.

• A macros window that provides one-click access to previously written scripts.

Python Script Editor Window

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.

CFD-VIEW -script myscript.py

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.

Basic and Advanced Scripting


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 is provided for relatively simple tasks, and the Advanced Scripting is available 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.

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

Basic Python Scripting


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. Although
this is referred to as the Basic Scripting, these modules actually call the advanced scripting facilities "under the
hood."

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

File I/O Module

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

ImportDTF filename, importMethod=DTF_ZONE_BASED, simnum=1, cell=0,


spray=DTF_SPRAY_NONE, blanking=0, grouping=0, unscaled=0, nozero=0, animation=0)

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()

Force a reread of all file readers in the model.

ImportPAM(filename, importMethod=PAM_IMPORT_AUTO, formatted=PAM_BINARY)

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.

ImportP3D(filename, scalars, vectors, variables, multizone, unformatted,


doubleprecision)

Import the named Plot3D file into this model.

ImportSTL(filename, binary=False, byteswap=False)

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.

ImportSPY(filename, binary=False, unformatted=False, byteswap=False)

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

SaveImageArea(filename, imageformat, x, y, w, h, imageWidth=0, imageHeight=0)

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

SaveImageWindow(filename, imageFormat, imageWidth=0, imageHeight=0)

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.

SaveImage(filename, imageWidth=0, imageHeight=0)

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.

Basic Scripting - Model/Scene Manipulation

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()

Create a new Model.

GetActiveModel()

Returns a reference to the active model, or None if there is no active model.

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)

Open an existing Model from given filename.

OpenModel(filename)

This function loads an existing model into CFD-VIEW. It is an identical function to


OpenModelFile(filename), with the new name added for consistency with SaveModel(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()

Terminate the CFD-VIEW application.

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()

Reruns the dataflow network.

ForceUpdate()

Force the data flow network to run, followed by a screen update.

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)

This function sets the desired number of frames for an animation.

SetAnimationCurrentFrame(frame)

This function sets the current frame for an animation. This is typically not used, since the default is simply
the first frame.

RecordGIFAnimation(filename, width, height, framespersecond, iterations)

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.

RecordMJPEGAnimation(filename, width, height, framespersecond,


quality=QUALITY_BEST)

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.

RecordWM7Animation(filename, width, height, framespersecond,


quality=QUALITY_BEST)

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

RecordWM8Animation(filename, width, height, framespersecond,


quality=QUALITY_BEST)

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.

RecordFLASHAnimation(filename, width, height, framespersecond,


quality=QUALITY_BEST)

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.

RecordMPEG4Animation(filename, width, height, framespersecond,


quality=QUALITY_BEST)

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.

RecordFramesAnimation(filename, width, height)

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.

RecordMPEG1Animation(filename, width, height, framespersecond,


quality=QUALITY_BEST)

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.

RecordMPEG2Animation(filename, width, height, framespersecond,


quality=QUALITY_BEST)

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)

DEPRECATED (Replaced by GetObjectsByName)

GetEntitiesByName(name)

DEPRECATED (Replaced by GetObjectsByName)

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)

DEPRECATED (Replaced by SetName)

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)

Creates a clone of an object. Operator Palette-Clone

CreateReplicator(inputs)

Creates a replicator of an object. Operator Palette-Replication

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)

Creates a 2D Point Probe. Operator Palette-Line Probe

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

The following functions are imported from the Annotation module.

CreateOrigin()

Create an Origin annotation object.

CreateLabel(text="")

Create a Label annotation object. If the optional text argument is specified, that string will be used for the
label text.

CreateAxes()

Create an Axes annotation object.

CreateLegend()

Create a Legend annotation object .

CreateLine()

Create a Line annotation object.

CreateBox()

Create a Box annotation object.

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()

Create an Oval annotation object.

243
CFD-VIEW V2014.0 User Manual

CreateBounds()

Create a Bounds annotation object.

CreateTime()

Create a Time annotation object.

Colormap

Purpose
The Colormap module is used by Python to incorporate the basic scripting for the colormap features in CFD-VIEW.

Imported Functions

The following functions are imported from the Colormap module.

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.

SetColormapRange(colormapname, min, max)

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

The following functions are imported from the Vector module.

AppendKnownVector(name, xcomp, ycomp, zcomp)

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.

AddVector(name, xcomp, ycomp, zcomp)

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.

SetVectorDisplayRange(name, min, max)

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)

Set the material surface color for object to color.

GetSurfaceColor(obj)

Returns the Surface Color of the given object.

SetGridColor(obj, clr)

Set the grid color for object to color.

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)

Set the contour color for object to color.

GetContourColor(obj)

Returns the Contour Line Color of the given object.

SetOutlineColor(obj, clr)

Set the outline color for object to color.

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)

Set the vector color for object to color.

GetVectorColor(obj)

Returns the color of the vector display, if the vectors are not colored by value.

SetPointsColor(obj, clr)

Set the points color for object to color.

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)

Set the specular (shininess) color for object to color.

GetSpecularColor(obj)

Returns the Specular Color of the given object.

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

The following functions are imported from the Probe module.

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.

SetLineProbePosition(lineprobe, start, finish)

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.

SetEndPoints(obj, start, finish)

This is an alternative form of SetLineProbePosition shown above.

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.

SetTraceNumRakePoints(trace, nX, nY, nZ)

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.

SetTraceRakeSpacing(trace, dX, dY, dZ)

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)

Returns the position of object as a tuple (x, y) in screen coordinates.

SetSize(object, w, h)

Sets the width and height of an annotation object, where w and h are given in screen coordinates.

GetSize(obj)

Returns the size (dimensions) of object as a tuple (w, h) in screen coordinates.

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)

Sets the fill color for a box or oval annotation object.

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)

Sets the shadow color for an annotation object.

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)

Sets the edge color for an annotation object.

SetEdgeWidth(obj, edgeWidth)

Sets the edge width (in pixels) for an annotation object.

SetLineStartPoint(obj, x, y)

Set the starting point for a Line object to (x, y).

GetLineStartPoint(obj)

Return the line start point as a tuple (x, y).

SetLineEndPoint(obj, x, y)

Set the end point for a Line object to (x, y).

GetLineEndPoint(obj)

Return the line end point as a tuple (x, y).

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)

Return the line arrow style, one of ARROW_STYLE_NONE, ARROW_STYLE_BEGIN, ARROW_STYLE_END or


ARROW_STYLE_BOTH.

SetLineArrowBaseSize(obj, arrowBaseSize)

Set the base size for a Line object's arrow(s).

GetLineArrowBaseSize(obj)

Return the arrow base size.

253
CFD-VIEW V2014.0 User Manual

SetLineArrowHeadSize(obj, arrowHeadSize)

Set the head size for a Line object's arrow(s).

GetLineArrowHeadSize(obj)

Return the arrow head size.

SetLineColor(obj, clr)

Set the color for a Line object.

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)

Set the text string for a Label or Text object.

SetLabelFontSize(obj, fontSize)

Set the font size for a Label object.

SetLabelFontWeight(obj, fontWeight)

Set the font weight for a Label object.

SetLabelColor(obj, fontColor)

Set the color for a Label object.

SetLabelFontOrientation(obj, fontOrientation)

Set the font orientation for a Label object to one of FONT_ORIENTATION_VERTICAL_UP,


FONT_ORIENTATION_VERTICAL_DOWN or FONT_ORIENTATION_HORIZONTAL.

SetImageFile(obj, filename)

Set the file name for an Image Box object.

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()

Returns a reference to the active viewer, or None if there is no active viewer.

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()

Fit view to window.

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.

SetViewerScale(xscale, yscale, zscale)

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()

This function sets the 3D Viewer to perspective projection mode.

SetOrthogonal()

This function sets the 3D Viewer to parallel (orthogonal) projection mode.

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.

SetOrientation(roll, pitch, yaw)

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)

Rotate the model about its x-axis by some number of 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)

Rotate the model about its y-axis by some number of 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)

Rotate the model about its z-axis by some number of 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)

Set the field of view for the active viewer.

GetFieldOfView()

This function returns the field of view of the active 3D viewer. It is the companion function to
SetFieldOfView(fov).

ZoomIn()

Zoom in on the model by a small amount.

ZoomOut()

Zoom out from the model by a small amount.

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

Data Object Display

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)

Enable or disable the display of this object, where visible is either 0 or 1.

SetVisibleOn(obj)

Sets the visibility of all objects in the input list to On.

260
Appendix Scripting

SetVisibleOff(obj)

Sets the visibility of all objects in the input list to Off.

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)

Turns on projected vectors for all objects in the input list.

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)

Turn the simple transparency of the input list of surfaces to On.

SetSimpleTransparencyOff(obj)

Turn the simple transparency of the input list of surfaces to Off.

SetPointSize(obj, pointSize)

Set the point size for object.

GetPointSize(obj)

Returns the size of displayed points, if the points are not sized by an attribute, such as pressure.

SetPointShape(obj, shape)

Set the shape (one of POINT_SHAPE_POINTS, POINT_SHAPE_CUBES or POINT_SHAPE_BALLS) of the points


for object.

GetPointShape(obj)

Return point shape for the given object. (one of POINT_SHAPE_POINTS, POINT_SHAPE_CUBES or
POINT_SHAPE_BALLS).

SetMinPointSize(obj, minPointSize)

Set the minimum point size to be shown for object.

GetMinPointSize(obj)

Return lower clip limit.

SetMaxPointSize(object, size)

Set the maximum point size to be shown for object.

263
CFD-VIEW V2014.0 User Manual

GetMaxPointSize(obj)

Return upper clip limit.

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)

Get the expression string for the given object.

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).

Data Object Access

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.

GetSingleNodeData(obj, varname, node)

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.)

ReplaceNodalData(obj, data, varname)

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.

SetSingleNodeData(obj, value, varname, node)

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.

AppendNodalData(obj, data, varname, varunits="")

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.

GetSingleCellData(obj, varname, cell)

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).

ReplaceCellData(obj, data, varname)

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

SetSingleCellData(obj, value, varname, cell)

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.

AppendCellData(obj, data, varname, varunits="")

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.

AppendClipping(obj, variable, highlow, value)

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”.

AppendUpperClipping(obj, variable, value)

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”.

AppendLowerClipping(obj, variable, value)

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)

Creates a replicator of an object.

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.

Arguments for both CreateReplicator and CreateReplicators:

• 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.

• transform - Whether to transform vectors during replication

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

SetNumPoints(obj, numx, numy, numz=1)

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.

SetSameYScale(obj, same, callingfunction="SetSameYScale")

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

SetPlotLocation(obj, location, callingfunction="SetPlotLocation")

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.

SetGraphColor(obj, graphindex, color)

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])

SetGraphStyle(obj, graphindex, style)

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

BASIC PYTHON SCRIPTING 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.

Image of Annotation Example

Sample Code

from VAnnotation import *

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

Advanced Scripting - Box

Advanced Scripting - Line

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

from cfdview_basic import *

ImportDTF("water.DTF",DTF_SIMPLIFYING)

surfs=GetAllSurfaces()

for surf in surfs :

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

from cfdview_basic import *

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

Advanced Scripting - XCut

Advanced Scripting - YCut

Advanced Scripting - ZCut

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

from cfdview_basic import *

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

Advanced Scripting - Point Probe

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

from cfdview_basic import *

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

Advanced Scripting - Particle Trace

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

from cfdview_basic import *

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 - IsoSurface

Advanced Scripting - Legend

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

Colormap and COLORTAB

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()

Returns a pointer the global model (scene)

getName()

Returns the name of the colormap. (Usually this is the same as the color variable)

getUnits()

Returns a string with the units of the color variable

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()

Returns the number of color tabs in the colormap

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()

Returns the number of contours in the colormap.

setContours(nc[,notify])

Sets the number of contours in the colormap.

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])

Sets the ramp to one of the preset styles listed below

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

286
Appendix Scripting

Useful Constants
GRAYMAP

GREENMAP

PLOT3DMAP

REDMAP

DUTCHMAP

PLOTMAP

STRIPEMAP

FXGraph, FXPlotter and PlotPanel

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()

Returns the number of points in the curve

getName()

Returns the name of the curve

setName(name)

Sets the name of the curve

287
CFD-VIEW V2014.0 User Manual

getDomainData(i)

Returns the X coordinate of the i'th node on the curve

setDomainData(i,d)

Sets the the X coordinate of the i'th node on the curve

getRangeData(i)

Gets the Y coordinate of the i'th node on the curve

setRangeData(i,d)

Sets the the Y coordinate of the i'th node on the curve

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)

Sets the size of the symbols for this curve in pixels

getSymbolSize()

Returns the size of the symbols for this curve in pixels

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)

Sets the thickness of this curve in pixels

getLineWeight()

Returns the thickness of this curve in pixels

setVisible(v)

Sets whether this curve is visible

isVisible()

Returns whether this curve is visible


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.

289
CFD-VIEW V2014.0 User Manual

removeGraph(index)

Deletes the graph at the given index.

clearGraphs()

Deletes all of the graphs

getGraph(index)

Gets a pointer to the graph at the given index

getNumGraphs()

Returns how many graphs are in the plot.

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)

Sets the title of the plot

getTitle()

Returns the title of the plot

setDomainCaption(text)

Sets the X axis label

getDomainCaption()

Returns the X axis label

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()

Returns the index of the "current" curve.

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.

The C++ structure that is used internally is:

struct FXFontDesc {

FXchar face[104]; // Face name

FXuint size; // Size in deci-points

FXuint weight; // Weight [light, normal, bold, ...]

FXuint slant; // Slant [normal, italic, oblique, ...]

FXuint setwidth; // Set width [normal, condensed, expanded, ...]

FXuint encoding; // Encoding of character set

FXuint flags; // Flags

};

To access the items from Python, a List is used. The structure of this list is very similar to C++ struct:

[face, size, weight, slant, setwidth, encoding, flags]

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

flags Some font specific flags, (typically set to 0)

294
Appendix Scripting

An example would be something like:

text=CreateText()

text.setFontDesc(["helvetica", 360, FONTWEIGHT_BOLD, FONTSLANT_DONTCARE,


FONTSETWIDTH_DONTCARE, FONTENCODING_DEFAULT, 0])

which could also be written:

text=CreateText()

text.setFontDesc(["helvetica", 360, 700, 0, 0, 0, 0])

Useful Constants

Font Weight

FONTWEIGHT_DONTCARE = 0 // Don't care about weight

FONTWEIGHT_THIN = 100 // Thin

FONTWEIGHT_EXTRALIGHT = 200 // Extra light

FONTWEIGHT_LIGHT = 300 // Light

FONTWEIGHT_NORMAL = 400 // Normal or regular weight

FONTWEIGHT_REGULAR = 400 // Normal or regular weight

FONTWEIGHT_MEDIUM = 500 // Medium bold face

FONTWEIGHT_DEMIBOLD = 600 // Demi bold face

FONTWEIGHT_BOLD = 700 // Bold face

FONTWEIGHT_EXTRABOLD = 800 // Extra

FONTWEIGHT_HEAVY = 900 // Heavy

FONTWEIGHT_BLACK = 900 // Black

Font Slant

FONTSLANT_DONTCARE = 0 // Don't care about slant

FONTSLANT_REGULAR = 1 // Regular straight up

FONTSLANT_ITALIC = 2 // Italics

FONTSLANT_OBLIQUE = 3 // Oblique slant

FONTSLANT_REVERSE_ITALIC = 4 // Reversed italic

295
CFD-VIEW V2014.0 User Manual

FONTSLANT_REVERSE_OBLIQUE = 5 // Reversed oblique

Font Setwidth

FONTSETWIDTH_DONTCARE = 0 // Don't care about set width

FONTSETWIDTH_ULTRACONDENSED = 10 // Ultra condensed printing

FONTSETWIDTH_EXTRACONDENSED = 20 // Extra condensed

FONTSETWIDTH_CONDENSED = 30 // Condensed

FONTSETWIDTH_NARROW = 30 // Narrow

FONTSETWIDTH_COMPRESSED = 30 // Compressed

FONTSETWIDTH_SEMICONDENSED = 40 // Semi-condensed

FONTSETWIDTH_MEDIUM = 50 // Medium printing

FONTSETWIDTH_NORMAL = 50 // Normal printing

FONTSETWIDTH_REGULAR = 50 // Regulat printing

FONTSETWIDTH_SEMIEXPANDED = 60 // Semi expanded

FONTSETWIDTH_EXPANDED = 70 // Expanded

FONTSETWIDTH_WIDE = 80 // Wide

FONTSETWIDTH_EXTRAEXPANDED = 80 // Extra expanded

FONTSETWIDTH_ULTRAEXPANDED = 90 // Ultra expanded

Font Encoding

FONTENCODING_DEFAULT = 0 // Don't care character encoding

FONTENCODING_ISO_8859_1 = 1 // West European (Latin1)

FONTENCODING_ISO_8859_2 = 2 // Central and East European (Latin2)

FONTENCODING_ISO_8859_3 = 3 // Esperanto (Latin3)

FONTENCODING_ISO_8859_4 = 4

FONTENCODING_ISO_8859_5 = 5 // Cyrillic (almost obsolete)

FONTENCODING_ISO_8859_6 = 6 // Arabic

FONTENCODING_ISO_8859_7 = 7 // Greek

296
Appendix Scripting

FONTENCODING_ISO_8859_8 = 8 // Hebrew

FONTENCODING_ISO_8859_9 = 9 // Turkish (Latin5)

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

FONTENCODING_CP437 = 437 // IBM-PC code page

FONTENCODING_CP850 = 850 // IBMPC Multilingual

FONTENCODING_CP851 = 851 // IBM-PC Greek

FONTENCODING_CP852 = 852 // IBM-PC Latin2

FONTENCODING_CP855 = 855 // IBM-PC Cyrillic

FONTENCODING_CP856 = 856 // IBM-PC Hebrew

FONTENCODING_CP857 = 857 // IBM-PC Turkish

FONTENCODING_CP860 = 860 // IBM-PC Portugese

FONTENCODING_CP861 = 861 // IBM-PC Iceland

FONTENCODING_CP862 = 862 // IBM-PC Israel

FONTENCODING_CP863 = 863 // IBM-PC Canadian/French

FONTENCODING_CP864 = 864 // IBM-PC Arabic

FONTENCODING_CP865 = 865 // IBM-PC Nordic

FONTENCODING_CP866 = 866 // IBM-PC Cyrillic #2

FONTENCODING_CP869 = 869 // IBM-PC Greek #2

FONTENCODING_CP870 = 870 // Latin-2 Multilingual

297
CFD-VIEW V2014.0 User Manual

FONTENCODING_CP1250 = 1250 // Windows Central European

FONTENCODING_CP1251 = 1251 // Windows Russian

FONTENCODING_CP1252 = 1252 // Windows Latin1

FONTENCODING_CP1253 = 1253 // Windows Greek

FONTENCODING_CP1254 = 1254 // Windows Turkish

FONTENCODING_CP1255 = 1255 // Windows Hebrew

FONTENCODING_CP1256 = 1256 // Windows Arabic

FONTENCODING_CP1257 = 1257 // Windows Baltic

FONTENCODING_CP1258 = 1258 // Windows Vietnam

FONTENCODING_CP874 = 874 // Windows Thai

FONTENCODING_LATIN1 = FONTENCODING_ISO_8859_1 // Latin 1 (West


European)

FONTENCODING_LATIN2 = FONTENCODING_ISO_8859_2 // Latin 2 (East


European)

FONTENCODING_LATIN3 = FONTENCODING_ISO_8859_3 // Latin 3 (South


European)

FONTENCODING_LATIN4 = FONTENCODING_ISO_8859_4 // Latin 4 (North


European)

FONTENCODING_LATIN5 = FONTENCODING_ISO_8859_9 // Latin 5 (Turkish)

FONTENCODING_LATIN6 = FONTENCODING_ISO_8859_10 // Latin 6 (Nordic)

FONTENCODING_LATIN7 = FONTENCODING_ISO_8859_13 // Latin 7 (Baltic Rim)

FONTENCODING_LATIN8 = FONTENCODING_ISO_8859_14 // Latin 8 (Celtic)

FONTENCODING_LATIN9 = FONTENCODING_ISO_8859_15 // Latin 9 AKA Latin 0

FONTENCODING_LATIN10 = FONTENCODING_ISO_8859_16 // Latin 10

FONTENCODING_USASCII = FONTENCODING_ISO_8859_1 // Latin 1

FONTENCODING_WESTEUROPE = FONTENCODING_ISO_8859_1 // Latin 1 (West


European)

FONTENCODING_EASTEUROPE = FONTENCODING_ISO_8859_2 // Latin 2 (East


European)

FONTENCODING_SOUTHEUROPE = FONTENCODING_ISO_8859_3 // Latin 3 (South


European)

298
Appendix Scripting

FONTENCODING_NORTHEUROPE = FONTENCODING_ISO_8859_4 // Latin 4 (North


European)

FONTENCODING_CYRILLIC = FONTENCODING_ISO_8859_5 // Cyrillic

FONTENCODING_RUSSIAN = FONTENCODING_KOI8 // Cyrillic

FONTENCODING_ARABIC = FONTENCODING_ISO_8859_6 // Arabic

FONTENCODING_GREEK = FONTENCODING_ISO_8859_7 // Greek

FONTENCODING_HEBREW = FONTENCODING_ISO_8859_8 // Hebrew

FONTENCODING_TURKISH = FONTENCODING_ISO_8859_9 // Latin 5 (Turkish)

FONTENCODING_NORDIC = FONTENCODING_ISO_8859_10 // Latin 6 (Nordic)

FONTENCODING_THAI = FONTENCODING_ISO_8859_11 // Thai

FONTENCODING_BALTIC = FONTENCODING_ISO_8859_13 // Latin 7 (Baltic Rim)

FONTENCODING_CELTIC = FONTENCODING_ISO_8859_14 // Latin 8 (Celtic)

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()

Returns a pointer to the active scene (if any)

getActiveViewer()

Returns a pointer to the active viewer (if any)

openModelFile(filename)

Opens named model file. Returns error code listed below

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()

Creates a new empty scene (model) and returns a pointer to it

quit()

Quits CFD-VIEW

reflow()

Forces an immediate network reflow. (default behavior is a delayed reflow)

forceUpdate()

Forces a reflow of the data flow network, followed by graphics update

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

These constants are needed setting viewing parameters

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

DTF Reading options


DTF_ZONE_BASED
DTF_VC_BASED
DTF_SIMPLIFYING

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

ADVANCED SCRIPTING - VUOBJECT


Purpose

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

Nothing - (it is a base class)

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()

Returns a pointer to the operation, (VUOperation), that created this object.

isSelected()

Returns True/False to indicate whether this object is selected.

select([notify])

Changes this object to the "selected" state.

deselect([notify])

Changes this object to the "selected" state.

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])

Indicates to the model that this object needs to repaint itself.

setName(name [, notify])

Changes the name of this object. The input is a string containing the name.

getName()

Returns a string containing the name of this object.

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()

Returns True/False to indicate this object's visibility

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()

Returns True/False to indicate if this object's handles are shown.

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)

Sets the size of the annotation object in pixels to w by h.

getSize()

Returns a 2-tuple containing the size of the annotation object in pixels.

setShadow(shadow [, notify])

Sets whether to display a simple shadow under the annotation object to the True/False input value.

hasShadow()

Returns a True/False value indicating whether the shadow is shown.

toggleShadow([notify])

Toggles whether to display the shadow.

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])

Toggles the filled state of the object.

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()

Returns a True/False value indicating whether the edge is shown.

toggleEdge([notify])

Toggles whether to display the edge of the annotation object.

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

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.

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])

Sets the width of the edge around the box in pixels

getEdgeWidth()

Returns the width of the line around the box in pixels.

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

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.

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])

Sets the width of the edge around the box in pixels

getEdgeWidth()

Returns the width of the line around the box in pixels.

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])

Toggles the locked aspect ratio setting of the image.

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])

Sets the text to be displayed. The input is a string.

310
Appendix Scripting

getText()

Returns a string containing the displayed text

setFontStyle(fontStyle [, notify])

Sets the label font to one of the values shown below.

getFontStyle()

Returns the label font as one of the values shown below.

setFontSize(fontSize [, notify])

Sets the font size. The size is a floating point number with units in pixels.

getFontSize()

Returns the font size a floating point with units in pixels

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])

Sets the displayed text. The input is a string.

getText()

Returns the displayed text string.

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

ADVANCED SCRIPTING - LEGEND

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])

Sets the color of the tick marks.

getTickColor()

Returns the color of the tick marks.

setTextColor(color [, notify])

Sets the color of the text used in the legend.

getTextColor()

Returns the color of the text used in the legend.

setBorderColor(color [, notify])

Sets the color of the border around the legend.

314
Appendix Scripting

getBorderColor()

Returns the color of the border around the legend.

getColormap()

Returns the index of the colormap on which the legend is based.

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.

tracksColormap(FXbool tracks [, notify])

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])

Toggles the tracking of the active colormap.

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])

Toggles the display of the title.

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])

Toggles whether to use the color mapping attribute as the title.

showUnits(truefalse [, notify])

Specifies whether to show the color mapping units on the legend. The input is either True or False.

toggleUnits([notify])

Toggles the display of units on the legend.

showMajorTicks(truefalse [, notify])

Sets the display of major ticks to the True/False input value.

toggleMajorTicks([notify])

Toggles the display of major ticks.

showMinorTicks(FXbool minorTicks [, notify])

Sets the display of minor ticks to the True/False input value.

toggleMinorTicks([notify])

Toggles the display of minor ticks.

showNumbers(FXbool numbers [, notify])

Specifies whether to display the numbers on the legend. The input is either True or False.

toggleNumbers([notify])

Toggles whether to display the numbers on the legend.

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])

Toggles the min/max value display on the legend.

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])

Toggles whether to draw the color ramp in flooded mode.

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()

Returns the precision of the numbers used in the legend.

setPrecision(prec [, notify])

Sets the precision of the numbers used in the legend.

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])

Sets the width of the edge around the box in pixels

getEdgeWidth()

Returns the width of the line around the box in pixels.

See Also
Advanced Scripting - Box
Advanced Scripting - Text
Advanced Scripting - Label
Advanced Scripting - Line

TRANSIENT TIME ANNOTATION

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])

Toggles whether major ticks should be shown.

showMinorTicks(truefalse [, notify])

Specifies whether minor ticks should be shown. The input is a True/False value.

toggleMajorTicks([notify])

Toggles whether major ticks should be shown.

toggleMinorTicks([notify])

Toggles whether minor ticks should be shown.

showNumbers(truefalse [, notify])

Specifies whether a numerical scale should be shown. The input is a True/False value.

toggleNumbers([notify])

Toggles whether a numerical scale should be shown.

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])

Sets the display of a simple shadow to the True/False input value.

hasShadow()

Returns a True/False value indication whether the simple shadow is displayed

toggleShadow([notify])

Toggles the display of the simple shadow.

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()

Returns the width of the line, measured in pixels

setLineWidth(w [, notify])

Sets the width of the line in pixels.

setArrowStyle(style [, notify])

Sets the arrow style to one of the values shown below.

getArrowStyle()

Returns the arrow style as one of the values shown below.

getArrowBase()

Returns the width of the arrow heads in pixels.

setArrowBase(arrowBase [, notify])

Sets the width of the arrow heads in pixels.

326
Appendix Scripting

getArrowLength()

Returns the length of the arrow heads in pixels

setArrowLength(arrowLength [, notify])

Sets the length of the arrow heads in pixels

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.

ADVANCED SCRIPTING - VUDATA

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)

Returns the name of the attribute at the given index.

setAttName(index, name)

Sets the name of the attribute at the given index to the input name.

getAttUnit(index)

Returns the units of the attribute at the given index.

setAttUnit(index,units)

Sets the name of the attribute at the given index to the input units.

numI()

Returns the number of nodes in the I direction for structured grids

numJ()

Returns the number of nodes in the J direction for structured grids

numK()

Returns the number of nodes in the K direction for structured grids

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()

Returns the calculator expression for this data object as a string.

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()

Returns the number of attributes in this data object.

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()

Returns the number of vertices, (nodes), in this data object.

getNodalData(nodeindex, attname)

This gets the value of the nodal data named "attname" for the node at "nodeindex"

setNodalData(nodeindex, attname, value)

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".

setCellData(cellindex, attname, value)

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

setVectorAtts(att1, att2, att3, label [, notify])

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.

setVectorAtts(index1, index2, index3, label [, notify])

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()

Returns the name (label) of the currently selected vector.

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()

Returns the geometric bounds of this object as a 6-tuple containing (xmin,xmax,ymin,ymax,zmin,zmax)

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()

Returns the minimum index for the symmetry display.

getSymMax()

Returns the minimum index for the symmetry display.

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])

Sets the percentage of vector thinning. The input is an integer.

getVectorThin()

Returns the percentage of vector thinning.

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

ADVANCED SCRIPTING - VULINE


Purpose

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

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.

• 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()

Returns the point stride.

• 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])

Sets the with of the line in pixels.

• getLineWidth()

Returns the with of the line in pixels.

• 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()

Returns the width of the outline in pixels.

setOutlineWidth(width [, notify])

Sets the width of the outline in pixels.

getGridWidth()

Returns the width of the grid lines in pixels.

339
CFD-VIEW V2014.0 User Manual

setGridWidth(width [, notify])

Sets the width of the grid lines in pixels.

getContourLineWidth()

Returns the width of the contour lines in pixels.

setContourLineWidth(width [, notify])

Sets the width of the contour lines in pixels.

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

Advanced Scripting - VUSurface

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()

Returns the volume of this object as a floating point number.

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

Advanced Scripting - VUPolyVolume

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()

Returns the number of children in the group.

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(index, object [, notify])

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.

selectByKey(key, appended, [notify])

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.

selectByType(type, appended, [notify])

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]

Places all objects in the selected state.

deselectAllObjects([notify])

Places all objects in the deselected state.

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.

createObject(inputobjects, type [, notify])

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.

importObjects(datafile [,switches[,simulation [, notify]]] )

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()

Returns the number of colormaps.

getColormap(index)

Returns a pointer to the colormap stored at the given index.

350
Appendix Scripting

getColormapName(index)

Returns the name of the colormap stored at the given 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")

setVectorAtts(objects, attnames [, notify]) -

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")

setVectorHeadScale(attnames, value [, notify])

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")

setVectorTailScale(attnames, value [, notify])

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")

setVectorCullLo(attnames, value [, notify])

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")

setVectorCullHi(attnames, value [, notify])

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])

Groups the input list of objects.

352
Appendix Scripting

ungroup(objects [, notify])

Ungroups the input list of objects.

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()

Forces a redraw of all windows.

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)

Sets the total number of frames for the animation.

getNumAnimFrames()

Returns the total number of frames in the animation.

355
CFD-VIEW V2014.0 User Manual

getAnimCurrentFrame()

Returns the current frame in the animation.

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])

Sets whether the plot object is displayed.

plotLocation()

Returns the plot location as one of the values shown below.

plotLocation(location [, notify])

Sets the plot location to one of the values shown below.

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

FXPLOTTER, FXGRAPH, AND PLOTPANEL

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()

Returns the number of points in the curve

getName()

Returns the name of the curve

setName(name)

Sets the name of the curve

getDomainData(i)

Returns the X coordinate of the i'th node on the curve

setDomainData(i,d)

Sets the the X coordinate of the i'th node on the curve

getRangeData(i)

Gets the Y coordinate of the i'th node on the curve

setRangeData(i,d)

Sets the the Y coordinate of the i'th node on the curve

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)

Sets the size of the symbols for this curve in pixels

getSymbolSize()

Returns the size of the symbols for this curve in pixels

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)

Sets the thickness of this curve in pixels.

getLineWeight()

Returns the thickness of this curve in pixels

setVisible(v)

Sets whether this curve is visible

359
CFD-VIEW V2014.0 User Manual

isVisible()

Returns whether this curve is visible

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)

Deletes the graph at the given index.

clearGraphs()

Deletes all of the graphs

getGraph(index)

Gets a pointer to the graph at the given index

getNumGraphs()

Returns how many graphs are in the plot.

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)

Sets the title of the plot

getTitle()

Returns the title of the plot

setDomainCaption(text)

Sets the X axis label

getDomainCaption()

Returns the X axis label

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()

Returns the index of the "current" curve.

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

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

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

COLORMAP AND COLORTAB

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()

Returns a pointer the global model (scene)

getName()

Returns the name of the colormap. (Usually this is the same as the color variable)

364
Appendix Scripting

getUnits()

Returns a string with the units of the color variable

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()

Returns the number of color tabs in the colormap

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()

Returns the number of contours in the colormap.

setContours(nc[,notify])

Sets the number of contours in the colormap.

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])

Sets the ramp to one of the preset styles listed below

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()

Returns a pointer to the scene (model) object.

getName()

Returns a string that contains the name of the operation.

getNumInputs()

Returns the number of the inputs to the operation.

getInput(index)

Returns a pointer the input object at the given index.

getNumOutputs()

Returns the number of outputs from the operation.

getOutput(index)

Returns a pointer to the output object at the given 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.

appendClipping(variable, side, value)

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.

replaceClipping(index, variable, side, value)

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()

Returns the number of clippings present for this operation.

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

switchFile(filename, switches, simnum [, notify])

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()

Returns the file name of the reader.

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.

setFilenames(filenamelist, switches, simnum, notify)

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()

Returns the file reading switches listed below.

setSwitches(switches)

Sets the file reading switches listed below.

getSimulation()

Returns the current simulation number for DTF file reading.

setSimulation(simnum)

Sets the simulation number for DTF file reading.

370
Appendix Scripting

getTransientTime()

Returns the transient time stored in the current DTF file.

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

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.

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()

Returns the maximum value for the plane operation.

getLowerValue()

Returns the minimum value for the plane operation

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

ADVANCED SCRIPTING - VULINEOP

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.

>setValue(index, value [, notify])

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()

Returns the position of the probe as a 3-tuple containing (x,y,z).

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()

Returns the index of the probe variable.

getVariableName()

Returns the name of the probe variable.

getValue()

Returns the current probe value.

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()

Returns the index of the probe variable.

getVariableName()

Returns the name of the probe variable.

getValue()

Returns the current probe value.

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])

Sets the maximum number of integration steps.

getNumSteps()

Returns the maximum number of steps.

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.

setNumReleasePoints(nx, ny, nz [, 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 3-tuple

setPointSpacing(dx, dy, dz [, notify])

Sets the spacing of the rake points.

getPointSpacing()

Returns the spacing of the rake points as a 3-tuple

setTimeLimit(lmt [, notify])

Sets the integration time limit.

getTimeLimit()

Returns the integration time limit.

traceForward(forward [, notify])

Sets forward tracing option. The input is True/False indicating forward tracing.

traceForward()

Returns the forward tracing setting as a True/False value.

traceBackward(backward [, notify])

Sets backward tracing option. The input is True/False indicating backward tracing.

traceBackward()

Returns the backward tracing setting as a True/False value.

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()

Returns the position of the probe as a 3-tuple containing (x,y,z).

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()

Returns the index of the probe variable.

getVariableName()

Returns the name of the probe variable.

390
Appendix Scripting

getValue()

Returns the current probe value.

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()

Returns the index of the probe variable.

getVariableName()

Returns the name of the probe variable.

getValue()

Returns the current probe value.

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])

Sets the maximum number of integration steps.

getNumSteps()

Returns the maximum number of steps.

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])

Sets the spacing of the rake points.

getPointSpacing()

Returns the spacing of the rake points as a 2-tuple

393
CFD-VIEW V2014.0 User Manual

setTimeLimit(lmt [, notify])

Sets the integration time limit.

getTimeLimit()

Returns the integration time limit.

traceForward(forward [, notify])

Sets forward tracing option. The input is True/False indicating forward tracing.

traceForward()

Returns the forward tracing setting as a True/False value.

traceBackward(backward [, notify])

Sets backward tracing option. The input is True/False indicating backward tracing.

traceBackward()

Returns the backward tracing setting as a True/False value.

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.

setPosition(index, pos [, notify])

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])

Sets the number of interpolation points along the line.

getNumSteps()

Returns the number of interpolation points along the line.

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.

setPosition(index, pos [, notify])

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])

Sets the number of interpolation points along the line.

getNumSteps()

Returns the number of interpolation points along the line.

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.

setNumPoints(nx, ny, nz [, notify])

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.

setNumPoints(nx, ny, nz [, notify])

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()

Returns the name of the variable used as the plot's X-Axis

setXAxis(varName [, notify])

Sets the name of the variable used as the plot's X-Axis

getNumYAxes()

Returns the number of Y variables plotted on the plot

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.

Sample Code - Basic Scripting Version


from cfdview_basic import *

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

Sample Code - Advanced Scripting Version


from cfdview_basic import *
from cfdview import *

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.

DATA FLOW NETWORK CONCEPTS

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)

# Get the first surface, (there is only one in this case)


surf=GetAllSurfaces()[0]

# Add a calculator expression to determine the velocity magnitude


SetExpression(surf, "Vmag=sqrt(U*U+V*V+W*W)")

# Get the results, which are the velocities at the nodes


results=GetExpressionResult(surf)

# Let's average the velocity magnitudes


sum = 0.0
for vel in results:
sum = sum + vel

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)

# Get a list of the volume objects in the model


vol_objects=GetAllVolumes()

# 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

print "Total volume = ",sum

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

You might also like