introduction to tecplot 10-1

19
Introduction to Tecplot 10

Upload: snehil2789

Post on 08-Apr-2015

819 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Introduction to Tecplot 10-1

Introduction to Tecplot 10

Page 2: Introduction to Tecplot 10-1

1

Table of Contents

Table of Contents………………..…………………….1

A. Preface……………………….……………………..2

B. Data Hierarchy in Tecplot……...…………………..2

C. Input File Format………………...…………………3

1. Plotting Unformatted Data………………………….5

2. Plotting I-Ordered Data……………………………..9

3. Plotting IJ-Ordered Data: Contour Plots……………9

4. Plotting IJ-Ordered Data: 2D Vector Fields………15

Page 3: Introduction to Tecplot 10-1

2

A. Preface This is a brief introduction to the fundamentals of Tecplot 10. It is intended to give

students the basic skills necessary to plot two dimensional functions, contour fields,

variable distributions, and vector fields. For further information regarding the

implementation of Tecplot 10, please refer to the software manual.

B. Data Hierarchy in Tecplot

In order to plot a two dimensional curve and/or define a field or mesh two types of data

will be used: I-ordered data and IJ-ordered data. Note that for both ordered types, the data

packing parameter must be in the form of POINT or BLOCK.

• I-Ordered Data: data used to plot a curve on a 2D plane. It employs I as a single

location identifier. The value of I must be equal to the total amount of points to

be plotted.

• IJ-Ordered Data: data used to define a two-dimensional field to which values can

be assigned. IJ-ordered data is best suited for plotting variable distributions and

vector fields by using a location identifier given by the I-J coordinates. In short,

this type of data allows the user to specify a number of variables and vector

components at a given x (I) and y (J) coordinates in some two dimensional field.

The spatial distribution of the points in the field is the following:

Figure 1

Note that the position of the field points in space is relative to the x and y

Cartesian coordinates. The value of the I and J identifiers will be equal to the

number of points in the x and y direction respectively. The total amount of points

in the field will be the product of I and J. For instance, in the field shown in

Figure 2, the total amount of points is the product of the I and J identifiers.

Figure 2

Total # of points in field:

I · J = 90

Page 4: Introduction to Tecplot 10-1

3

C. Input File Format In most formatted input files, the first two lines correspond to the variable declaration and

zone header. It is important to keep in mind that this is the minimum input file header

format allowed by Tecplot. Other lines such as file title or comment lines (text

annotations preceded by #) may be added to the input file header; however, it is common

to economize in the formatting and just use these two lines. The format for the variable

declaration line is the following:

VARIABLES = “var_1”, “var_2”, “var_3”

where var_1, var_2, and var_3 are the names assigned to the first, second, and third

data columns in the input file. The user may define as many variables as he or she wishes.

An example of this is given below:

Figure 3

In Figure 3, six variables are declared (Lon_F, Lat_F, mag_F, Lon_Z, Lat_Z,

mag_Z) corresponding to the first to sixth data columns in the file.

The zone header provides the formatting structure and is specific to the type of data being

used. As was mentioned before, for I-ordered data only the I location identifier, which is

equal to the number of points to be plotted, is used. A typical zone header for I-ordered

data is shown in Figure 3. In the case of IJ-ordered data, the following is the usual

formatting:

ZONE I= 81 J= 221 DATAPACKING=POINT

The field is defined by both I and J location identifiers. In this particular instance, the

field being plotted has 221 rows of points, 81 columns of points and a total of 17901

points. Figure 4 displays part of this input file. The first two data columns correspond to

variables Lon and Lat as well as to the position identifiers. Thus, when Figure 4 is

plotted the vector components “Theta_F,” “Phi_F,” “Theta_Z,” and “Phi_Z”

may be plotted against Lon and Lat. In this case, Lon and Lat represent the longitude

and latitude on the Earth’s surface while Theta_F and Phi_F and Theta_Z and Phi_Z

are θ- and Φ-components of the gradient of the geomagnetic field magnitude and vertical

Lon_F Lat_F mag_F Lon_Z Lat_Z mag_Z

Page 5: Introduction to Tecplot 10-1

4

component respectively. Figure 5 shows the resulting vector field (the reader is warned

that only a fraction of total vectors in the input file are shown for ease of visualization).

Figure 4

Figure 5

As is shown in Figure 5, the first point in the vector field is defined by the Lon-Lat / I-J

values specified in the input file (Figure 4). That is, this point is located exactly at 72º

West longitude, 22.0º North latitude. Similarly, each point in the vector field will be

described by its longitude/latitude coordinates. This arrangement of data points, which

was schematically shown in Figure 1, is valid for all IJ-ordered data sets regardless of the

type of plot being used.

Location of the first point in the vector field

(-72, 22.0)

Page 6: Introduction to Tecplot 10-1

5

A final note concerning the DATAPACKING parameter should be made. All example files

presented in this introductory manual have POINT type DATAPACKING. This implies that

each line in the data set represents a single point. For instance, in Figure 4 the first two

numbers in each line correspond to the geodetic coordinates for a single point in the

vector field, while the other four numbers are two sets of components for the 2D vector

that corresponds to that particular point. However, the user has the option of employing

an additional DATAPACKING arrangement: BLOCK type. For this case, the values for

each variable are given continuously regardless of the line. Thus, all of the values for the

first variable are given in a block, then all of the values for the second variable, then all of

the values for the third variable, and so on. The reader is strongly discouraged from using

BLOCK DATAPACKING since it tends to be far more cumbersome than POINT type.

1. Plotting Unformatted Data The fastest and easiest way to obtain a graph in Tecplot is by loading a list of contiguous

variables written in a notepad file such as the one shown in Figure 6. Each column in the

input file represents a variable in the graph generated by Tecplot and is assigned a default

name: V1 (for the first column), V2 (for the second column), V3 (for the third column),

etc.

Figure 6

The file shown above can be loaded to Tecplot by following the standard procedure for

loading external input data (steps 1-3 are the primary means of loading data to Tecplot

and will be referred to throughout this introduction):

1. After opening Tecplot, click on File and select Load Data File(s)…

V1 V2 V3 V4

Page 7: Introduction to Tecplot 10-1

6

Figure 7

2. Search for the particular file you wish to load to Tecplot.

Figure 8

Page 8: Introduction to Tecplot 10-1

7

3. After selecting the desired file and loading it, the software will request the plot

type to be selected. Since the objective here is to obtain a quick 2D Cartesian plot

choose the XY Line option.

Figure 9

4. The resulting plot is shown below. By default, Tecplot will plot the first data

column in the x-axis (V1) and the second in the y-axis (V2).

Figure 10

Page 9: Introduction to Tecplot 10-1

8

5. In order to reassign the variables in the input file (Figure 6) to the x- or and y-

axis, the user must click on Mapping Style… in the tool bar on the left-hand side

of the screen.

Figure 11

6. The Mapping Style window, shown below, will appear.

Figure 12

7. In order to display the remaining data columns in Figure 1 on the y-axis, select the

desired variable and click on Map Show. The drop down menu shown in Figure

13 will appear. Select Activate. The selected variable will appear in the graph as a

different color line. This same procedure can be used to hide variables from the

graph by selecting Deactivate on the Map Show drop down menu.

Page 10: Introduction to Tecplot 10-1

9

Figure 13

8. If it is desired to reassign variables to the axes, click on X-Axis Variable or Y-

Axis Variable. The Select Variable window will appear where one can choose

which variable is to be assigned to the axis. Keep in mind that the variable must

be activated to be displayed on the graph.

Figure 14

2. Plotting I-Ordered Data In order to plot I-ordered data fallow the same procedures outlined in the previous

section. The sole difference between unformatted data and I-ordered data will be that the

variables of the I-ordered data file will have the name specified by the user. Everything

else, however, will remain exactly the same.

3. Plotting IJ-Ordered Data: Contour Plots Contour plots use a color coded scheme to plot variable distributions of IJ-ordered data

sets. These types of plots are a useful way of representing the spatial variation of certain

variable or parameter and are one of the most practical applications in Tecplot. The

following procedure outlines the most relevant features of contour plots in Tecplot.

Page 11: Introduction to Tecplot 10-1

10

1. In order to load the data file fallow the steps 1-3 outlined in the previous section

(Section 1) but use 2D Cartesian rather than XY Line for the Input Plot Type

drop down menu. By default, Tecplot has the Mesh and Boundary layers

activated. Therefore upon loading the data file, only the field boundary and mesh,

if there is one defined for the data set, will be displayed. In order to visualize the

contour plot, the user must activate the Contour layer on the toolbar. Similarly,

the mesh and boundary could be hidden by unselecting the respective boxes in the

Zone Layer on the toolbar.

2. Once the Contour layer has been activated, the Contour Details window will

appear. This window allows the user to set the variable being plotted.

Figure 15

3. In order to be able to interpret the plot shown in Figure 15, the legend must be

displayed. Click on More >> to expand the Contour Details window. Click on

the Legend tab and check the Show Contour Legend box. Other legend options,

such as the orientation, position, and formatting of the legend are accessible

through this tab.

Page 12: Introduction to Tecplot 10-1

11

Figure 16

4. In some cases, the user will wish to compare two contour plots. In order to do this

effectively, the legend must be equal for both plots. In order to modify the legend,

click on the Levels tab. Select all current levels and click on the Remove

Selected Levels button. Next, click on the Add Levels… button.

Page 13: Introduction to Tecplot 10-1

12

Figure 17

5. The Enter Contour Level Range window (Figure 18) will appear. Select the

Min, Max, and Delta option and enter the desired values in the appropriate

fields. The legend, and the color coding in the plot will change accordingly.

Page 14: Introduction to Tecplot 10-1

13

Figure 18

6. The user may also choose the color coding in the plot. Tecplot allows two

options: banded (the default option) and continuous. In order to set the color

display in the contour, click on the Coloring tab and select the appropriate option.

Page 15: Introduction to Tecplot 10-1

14

Figure 19

7. Tecplot has a tool that allows the user to obtain the value of the variable being

plotted in the contour plot at a particular point. This feature is known as the Data

Probe tool (Figure 20). There are two ways to conduct the probe. After clicking

on the Data Probe button, the user could click directly on the contour plot

wherever he or she wishes to obtain a value or the user could click on the Tool

Details… button and enter the XY / IJ coordinates of the location at which he or

she desires to obtain a value in the Prove At window (Figure 21).

Page 16: Introduction to Tecplot 10-1

15

Figure 20 Figure 21

To finalize this section, it should be noted that the Contour Details window can always

be accessed through the toolbar on the left-hand side of the screen by clicking on …

button next to the Contour layer selection box (see Figure 20).

4. Plotting IJ-Ordered Data: 2D Vector Fields In order to load the data file fallow steps 1-3 in Section 1 and again choose 2D

Cartesian.

1. After having loaded the data file, only the boundary and mesh will be visible. In

order to visualize the vector field, select the Vector layer in the Zone Layer area.

2. The Select Variable window (Figure 22) will appear. Choose the variables that

correspond to the x- (U) and y-component (V) of the vector.

Data Probe

Streamtrace Tool

Page 17: Introduction to Tecplot 10-1

16

Figure 22

3. Press OK and the vector field will be plotted. An example of a vector field can be

seen in Figure 24.

4. The color, size, and type of vector arrow may be modified by accessing the Zone

Style window (Figure 25). Click on the Zone Style… button on the toolbar shown

in Figure 20 to open this window.

5. It is also possible to reassign the vector components to other variables in the input

file. Recall the input file shown in Figure 4. In that file there are two sets of

components for the vectors. That is, there are two distinct vector fields. In order to

change from one field to the other click on Plot, go to the Vector dialog, and

click on Variables….

Figure 23

Page 18: Introduction to Tecplot 10-1

17

6. The Select Variable window (Figure 22) will appear again allowing the user to

reset the variables to be used as components in the vector field.

7. The user may also wish to plot the streamlines of the obtained vector field. In

order to do so, click on the Streamtrace tool (Figure 20) and, holding the left

mouse button, drag the mouse over a desired region on the plot itself. Streamlines

will be plotted equidistantly from each other over the entire length traveled by the

mouse pointer. An example of streamlines for a given vector field is shown in

Figure 26.

X

Y

-1 0 1 2

-1

0

1

Frame 001 25 Dec 2009

Figure 24

Page 19: Introduction to Tecplot 10-1

18

Figure 25

X

Y

-1 0 1 2 3 4

-2.5

-2

-1.5

-1

-0.5

0

0.5

1

1.5

2Frame 001 26 Dec 2009

Figure 26