Slices CP

Coefficient of pressure slices along an aerodynamic body are useful for understanding how pressure changes over a surface. For example, seeing how the coefficient of pressure on a wing section behaves is useful for understanding wing efficiency. Computing these slices is done through ParaView by importing the case, slicing at user-defined points, and computing sectional properties.

Note

This utility expects a variable called p that is the pressure on each surface cell face. For the utility to work, this p variable must exist for the surfaces included in the coefficient of pressure computation.

The pressure on a particular slice is computed and converted to a distribution on a section.

The coefficient of pressure post-processing routine is available through both a command line executable and through the Python API. Using either method, the utility will write one file per timestep per slice, including the airfoil coordinates and pressure at each point.

Command Line

To call the utility from the command line, simply call the utility using the following command with the desired options:

usage: slices_cp [-h] [-i INPUT_FILE] [-o OUTPUT_DIRECTORY] [-n NAME]
                 [-p PATCHES [PATCHES ...]]
                 [-s SPAN_DIRECTION [SPAN_DIRECTION ...]]
                 [-l LIFT_DIRECTION [LIFT_DIRECTION ...]]
                 [-d DRAG_DIRECTION [DRAG_DIRECTION ...]] [-x X [X ...]]
                 [-r0 RHO0] [-u0 U0] [-p0 P0]

Named Arguments

-i, --input_file

Relative path to input file.

Default: ''

-o, --output_directory

Relative path to output directory. Default is ./

Default: './'

-n, --name

Name pattern to write out files in the output directory. Default is slice.

Default: 'slice'

-p, --patches

Patches to include in the calculation. Default is group/wall.

Default: 'group/wall'

-s, --span_direction

Span direction. String in (X+, X-, Y+, Y-, Z+, Z-) or list of floats specifying vector. Default is Z+.

Default: ['Z+']

-l, --lift_direction

Lift direction. String in (X+, X-, Y+, Y-, Z+, Z-) or list of floats specifying vector. Default is Y+.

Default: ['Y+']

-d, --drag_direction

Drag direction. String in (X+, X-, Y+, Y-, Z+, Z-) or list of floats specifying vector. Default is X+.

Default: ['X+']

-x, --x

Coordinates to sample. Default is [[0, 0, 0]].

-r0, --rho0

Freestream density.

-u0, --u0

Freestream velocity magnitude.

-p0, --p0

Freestream pressure.

Python API

To call the utility from Python, import the necessary modules and call the function with the necessary inputs:

postprocessing.paraview.slices.slices_cp(input_file=None, output_directory='./', name='slice', patches='group/wall', span_direction='Z+', lift_direction='Y+', drag_direction='X+', x=None, rho0=None, u0=None, p0=None)

Function to compute slices using Paraview.

Parameters:
input_filestr

Path to file to load with Paraview.

output_directorystr

Path to directory where the slice files will be written. Default is “./”.

namestr

Name pattern to write out files in the output directory. Default is “slice”.

patchesstr or list

Patch name(s) over which to compute the slice(s). Default is “group/wall”.

span_directionstr or list

Vector direction for span direction either as a string (eg. X) or list (eg. [0 0 1]). Should be of magnitude 1. Default is “Z+”.

lift_directionstr or list

Vector direction for lift direction either as a string (eg. X+) or list (eg. [0 1 0]). Should be of magnitude 1. Default is “Y+”.

drag_directionstr or list

Vector direction for drag direction either as a string (eg. X+) or list (eg. [1 0 0]). Should be of magnitude 1. Default is “X+”.

xlist

Coordinates to sample.

rho0float

Freestream density.

u0float

Freestream velocity magnitude.

p0float

Freestream pressure.