## 2. CFD XY-Plot Suite

### 2.1. Introduction

#### 2.1.1. Capabilities

The CFD XY-Plot suite of tools is an extension to baspl++ offering typical CFD typical synthesis data extraction and visualization, such as

• section plots including 'Cp profile' plots,

• one-dimensional probes along lines,

• computation of aerodynamic coefficients by integrating pressure and traction fields along a line.

The CFD XY-Plot suite of tools can display several data curves. For each data curve, a different database and/or different plotting parameters can be specified. Structured multi-block finite volume grids and unstructured single- and multi-block finite volume and finite element grids are supported. The CFD XY-Plot suite of tools can be operated interactively or with scripts that can be generated automatically from interactive sessions. It works seamlessly with all other baspl++ viewing functions.

#### 2.1.3. Invoking the CFD XY-Plot tools

The CFD XY-Plot tools are invoked by selecting CFD XY Plot... from the Tools menu located in the baspl++ top menu bar:

The window of the CFD XY-Plot tools appears, and an empty Graph is being displayed in the Scene in the main window.

#### 2.1.4. Selecting the type of XY plot

The next step is to select the type of plot, using the drop-down box which is labeled Type of XY Plot and which is located near the top of the CFD XY-Plot window. The type of plot can be altered any time, and any data curve will be re-evaluated automatically.

#### 2.1.5. Adding a data curve

Each data curve has its own NPart. For section plots and for plots of surface integrals, a surface needs to be worked with, typically, this would be the 'wetted surface' of an aircraft, or part of it. How this surface is extracted, is steered via the associated NPart. This way, extraction can be altered by the user. For instance, the NPart allows to restrict extraction to a rectangular box. Data curve extraction would then be restricted to that box, too.

There are two ways to add a new data curve:

1. Create a new NPart and use it directly for data curve extraction. This is done as follows:

In the CFD XY-Plot's menu, select File->Open Model and append NPart.... A dialogue opens where the directory and the database can be selected. Once the button is pressed, a new Model is created, and from this, a new NPart is created.

Section plots and surface integral plots require the NPart to contain an extracted surface. For NSMB models, the wetted surface (boundary condition codes 300-399) is extracted automatically, using the NPart's sfvbc extraction method. These settings may afterwards be altered by the user. For models originating from other CFD codes, no surface is extracted automatically (the NPart is empty), and the user has to make the necessary adjustments to the NPart.

When created this way, the NPart itself is not visible (i.e. the extracted surface is not being displayed). The NPart can be made visible by clicking on the eye icon next to the NPart in the main window's object tree.

2. Use an already created NPart for data curve extraction. This is done as follows:

In the white area on the left column of the CFD XY-Plot tools, all NPart objects are listed. A coloured check box indicates if an NPart is being used for data curve extraction. If yes, the colour of the checkbox is identical to the colour of the data curve, otherwise it is white. By clicking on the check box, data curve extraction is activated (or de-activated) for the corresponding NPart.

For section plots and surface integral plots, the NPart should contain a surface. When used in this way, no automatic surface extraction is performed; instead, the user has to select the appropriate extraction parameters in the NPart.

#### 2.1.6. Overview of extraction parameters

Depending on the type of plot, some extraction parameters of the NPart are blocked and cannot be altered on the NPart itself (but they can be altered in the CFD XY-Plot tool). For section plots, these are the cutting plane's position vector and the cutting plane's normal vector. For line plots, these are the start point and the end point of the NPart's line extraction method. Surface integral plots do not block any of the NPart's extraction parameters. Any change to one of the the NPart's extraction parameters will automatically cause the re-evaluation of the corresponding data curve.

All other parameters are controlled from within the CFD XY-Plot tools. They can be displayed and altered by selecting the corresponding NPart in the left column of the CFD XY-Plot tools. Any change to a parameter automatically causes the re-evaluation of the corresponding data curve.

Among these parameters, there are the parameters that pertain the the currently selected type of plot and the so-called generic parameters, which define the orientation of the model, the freestream parameters, the reference area, and the reference point. Which of the generic parameters are used depends on the selected type of plot. Section plots use the flow direction and the lateral direction. Surface integral plots additionally use the pitch and yaw angles, the reference surface, and the reference point. All types of plots use the freestream parameters.

### 2.2. Section Plots

Section plots make a cut (or section) of the extracted surface, with the cutting plane's normal vector aligned with the lateral direction, and at the specified position. The extracted x-values are w.r.t. the flow direction, and the extracted y-values correspond to the field values. The extracted x-y pairs are arranged such that a set of curves with consecutive straight line segments is obtained. On a wing, a section plot typically produces a single closed curve. On a high-lift configuration with a wing and a slat, two closed curves are generated. For structured block meshes (e.g. NSMB models with the "displace_sfv" option enabled), the resulting curve(s) may be open. This can be fixed by disabling the "displace_sfv" option.

Section plots can be obtained as follows:

1. Set the type of xy plot to section.

2. Add one or several data curves.

3. For each NPart, ensure that the wetted surface (or a part of the wetted surface) is extracted.

4. For each NPart, set the generic parameters if necessary. The generic parameters that are used by the section plot are the flow direction, the lateral direction, and the freestream conditions.

5. For each NPart, set the section plot specific parameters. Most important are the position of the cutting plane and the field. When the type of plot is set to cp (pressure coefficient plot), all parameters except the cutting plane position are initialized automatically.

In the following example, a pressure coefficient plot is made. First, the type of XY plot is set to section.

Next, the section plot type is set to cp.

The CFD XY-Plot tool then automatically extracts the relevant fields (here: PRES), computes Cp, and plots the result in a graph. By default the profile is extracted at the lateral position of 0:

By default the surface on which the section plot is calculated is not displayed (like in the figure above). To visualize the surface, click on the 'eye' icon of the relevant NPart entry in the object tree of the main window.

### 2.3. Line Plots

Line plots interpolate field values along a straight line ('probe') and plot them against the line. The x-values are the distances from the start point of the line, and the y-values are the field values.

Line plots can be obtained as follows:

1. Set the type of xy plot to line.

2. Add one or several data curves.

3. For each NPart, set the generic parameters if necessary. The generic parameters that are used by the line plot are the freestream conditions.

4. For each NPart, set the line plot specific parameters. Most important are the start point and the end point, and the field to be extracted. When the type of plot is set to cp (pressure coefficient plot), all parameters except the start position and the end position are initialized automatically.

In the following example, a line plot of the pressure field along the flow direction (x), with y=1 and z=0, is made. First, the type of XY plot is set to line. Then, the NPart is added, and the start position and the end position are entered. The following figure shows the wetted surface and the extracted line for reference. Depending on how the NPart was added, the NPart may not be displayed by default. To display the NPart, click on the "eye" icon for the relevant NPart in the object tree of the main window.

Next, select a field from the Fields menu. This will automatically intersect the computational domain along a line from the Start to the End point of the line and display the data curve:

### 2.4. Integral Plots

Integral plots calculate surface integrals of a pressure and/or a surface traction field. The surface over which the field(s) shall be integrated is defined via the associated NPart. The integration is performed along a line which is defined by a start point and an end point, and which is divided in segments of equal size. The x-values are the mid-segment distances to the start point, and the y-values are the surface integral values for each segment. The per-segment integral values can be forward- or backward-accumulated, or normalized by the segment length. Only those parts of the surface that intersect with one of the line segments will be integrated. The quantities to be integrated can be the surface area, the lift, drag, lateral force, the respective moments, and the corresponding coefficients.

Integral plots can be obtained as follows:

1. Set the type of xy plot to integral.

2. Add one or several data curves.

3. For each NPart, ensure that the wetted surface (or a part of the wetted surface) is extracted.

4. For each NPart, set the generic parameters if necessary. The generic parameters that are used by the integral plot are the flow direction, the lateral direction, the pitch angle, the yaw angle, the freestream conditions, the reference surface, and the reference point.

5. For each NPart, set the integral plot specific parameters. The pressure and traction fields are loaded automatically if necessary. Scaling and the conversion from pressure values to pressure coefficient values is done automatically, using the freestream conditions and the reference surface, but can be overridden by the user.

In the following example, integration of the lift force over the wetted surface is performed along the flow direction. First, the type of XY plot is set to integral.

Then, the NPart is added, and the start position and the end position are entered. In this example, the lift force Fz is selected (left), integrating forward over the whole airplane along the x-axis. The generic parameters are found in the Generic tab (right).

Selecting the component to extracted and integrated triggers the integration and displays the data curve:

### 2.5. Detailed Description of the Plotting Parameters

#### 2.5.1. Section Plot Parameters

• Position specifies the position of the cutting plane in the direction of the cutting plane's normal vector.

• Type of plot specifies if a Cp plot is to be generated or if a field without modification is to be viewed (generic plot). If Cp is selected the tool will automatically extract all relevant fields and parameters to establish Cp. In the case of a Cp field, the offset and scale attributes are set such that the pressure coefficients are obtained. Following the conventions for pressure coefficient plots, the graph's Y-axis is inverted.

• X values specifies how the x-axis values are displayed: When set to dimensional (default for generic section plots), the x-axis values as projected on the plane are selected. When set to nondimensional (default for Cp section plots), the x-axis values are transformed to non-dimensional units (i.e. the minimum x-value is 0 and the maximum x-value is 1). This option is set automatically when the plot type is set to cp.

• Field specifies the field to be viewed, such as PRES, CF, etc.

• Compname specifies the component of the field to be viewed. Default value is 1.

• Scale specifies the value by which the field, i.e. the y-axis values, is scaled. It is generated automatically and displayed in case Cp is selected. Default is 1.

• Offset specifies the offset by which the field is shifted. It is generated automatically and displayed in case Cp is selected. Default is 0.

#### 2.5.2. Line Plot Parameters

• Start defines the start point of the line cutting the domain. The start point can be placed outside or inside the domain. If placed inside the domain, the interpolation will start there. If placed outside the domain the interpolation will start where the line enters the domain.

• End defines the end point of the line cutting the domain. The end point can be placed outside or inside the domain. If placed inside the domain, the interpolation will end there. If placed outside the domain the interpolation will end where the line leaves the domain.

• Type of plot specifies if a Cp plot is to be generated or if a field without modification is to be viewed (generic plot). If Cp is selected the tool will automatically extract all relevant fields and parameters to establish Cp. In the case of a Cp field, the offset and scale attributes are set such that the pressure coefficients are obtained. Following the conventions for pressure coefficient plots, the graph's Y-axis is inverted.

• Field specifies the field to be viewed, such as PRES, CF, etc.

• Compname specifies the component of the field to be viewed. Default value is 1.

• Scale specifies the value by which the field, i.e. the y-axis values, is scaled. It is generated automatically and displayed in case Cp is selected. Default is 1.

• Offset specifies the offset by which the field is shifted. It is generated automatically and displayed in case Cp is selected. Default is 0.

#### 2.5.3. Integral Plot Parameters

• Start defines the start point of the line along which integration is performed on the wetted surface. The start point can be plated outside or inside the wetted surface. If placed inside the wetted surface, the integration will start there. If placed outside the domain the integration will start where the line enters the wetted surface.

• End defines the end point of the line integration the domain. The end point can be placed outside or inside the domain. If placed inside the domain, the integration will end there. If placed outside the domain the integration will end where the line leaves the domain.

• Extract specifies the integrand. Valid are CFi (), CMi (), Fi (component i of the resultant force), MPi (component i of the resultant moment with respect to the reference point), MAi (component i of the resultant moment with respect to the axis), A (area), with i=x,y,z.

• Reference frame specifies the reference frame with respect to which the integration is performed. Valid are local or global. The local reference frame is defined by the pitch angle and the yaw angle, i.e. it is the reference frame of the aircraft.

• Num. segments specifies the the number of integration segments. Default value is 1000.

• Integral type defines the type of integration to be performed within a segment. Valid are segment, forward (default), or backward. segment divides the integrated value for each segment by the segment length. This kind of plot is similar to a series of section curve integrals along the axis. forward accumulates the integrated values of the segments from start to end. The last y-value is the integral over the whole axis. backward accumulates the integrated values of the segments from end to start. The first y-value is the integral over the whole axis.

• Scale specifies the value by which the field (y-axis values) is scaled. Default is 1.

#### 2.5.4. Generic Parameters

For NSMB models, the generic parameters are automatically initialized according to the NSMB conventions and according to the contents of the CDES dataset; however, they can be overridden by the user. For models originating from other CFD codes, the user has to set the generic parameters. The default parameters correspond to dimensionless units with the flow direction along the x-axis and the lateral direction along the y-axis.

• The model orientation is given by the flow direction and the lateral direction, the pitch angle, and the yaw angle. The flow direction and the lateral direction must be aligned with one of the x-, y-, or z-axes. The vertical direction is automatically derived from the flow direction and the lateral direction. The pitch angle rotates the model around the lateral axis, and the yaw angle rotates the model around the vertical axis. Transforms operate first over the pitch angle α and then over the yaw angle β. The following figure illustrates this:

• Flow direction specifies the flow direction of the free stream. Valid are x, y, or z. For NSMB databases, this value is automatically detected. Otherwise, default is x.

• Lateral direction specifies the lateral (Wing) direction perpendicular to the flow direction. Valid are x, y, or z. For NSMB databases, this value is automatically detected. Otherwise, default is y.

• Pitch angle specifies the pitch angle α (see Figure 5) in degrees about the lateral direction. This parameter is used for the calculation of airframe-local quantities such as the lift force. For NSMB databases, the value is extracted from the first CDES dataset. Otherwise, default is 0.

• Yaw angle specifies the yaw angle β (see Figure 5) in degrees about the vertical axis. This parameter is used for the calculation of airframe-local quantities such as the lift force. For NSMB databases, the value is extracted from the first CDES dataset. Otherwise, default is 0.

• All types of plots use the freestream parameters to convert, if necessary, the pressure values to pressure coefficient values (Cp), by means of the formula

C p = p - p 0.5 ρ v 2

where p is the pressure (such as the PRES field), p the freestream pressure, ρ the freestream density, and v 2 the freestream velocity of the fluid. If, on the other hand, pressure coefficient fields are defined on the database, these will be used instead.

• Pressure specifies the free stream or far-field pressure. This parameter is used e.g. to calculate the pressure coefficient from a pressure field. For NSMB databases, this value is automatically extracted from the first CDES dataset. Otherwise, default is 1.

• Density specifies the free stream or far-field density. This parameter is used e.g. to calculate the pressure coefficient from a pressure field. For NSMB databases, this value is automatically extracted from the first CDES dataset. Otherwise, default is 1.

• Velocity specifies the free stream or far-field velocity amplitude. For NSMB databases, this value is automatically extracted from the first CDES dataset. Otherwise, default is 1.

• Reference specifies the reference values for non-dimensional computations.

• Surface specifies the reference surface. This parameter is used for e.g. the calculation of the lift and drag coefficients. Default is 1. For NSMB databases, this value is automatically detected.

• Length specifies the reference length. This parameter is not used in the current implementation. Default is 1. For NSMB databases, this value is automatically detected.

• Point specifies the coordinates of the reference point. This parameter is used for the calculation of the moments. Default is (0,0,0).