Geometry Distribution
Geometric distributions are useful for understanding a geometry when it has been updated through any analysis or optimization. For example, extracting the twist, chord, and thickness distributions along a wing can show how an optimization updated a geometry. Computing these distributions is done through ParaView by importing the geometry, slicing it along a specific axis and plane, and computing sectional properties.
This utility is geared specifically towards wing geometries. The twist is computed by identifying the trailing edge of an airfoil section and computing the point on the leading edge furthest from the trailing edge point. Because the computational grid is discrete, this point does not necessarily represent the exact leading edge. Instead, a circle is inscribed through the identified leading edge point as well as its two neighbors. The point on this circle furthest from the trailing edge is then used as the true leading edge coordinate, as suggested by Vassberg and Jameson [VJ16]. In addition to using the leading edge point for the twist distribution, it is then to compute the chord and thickness distributions, too. The chord distribution is computed by simply taking the distance between the leading edge point and trailing edge point, for each section along the span. The thickness is instead computed as the distance between the upper and lower surface, perpendicular to the chord line (this approach sometimes refered to as the “British convention”).
The geometry distribution 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 including the geometric coordinate, twist, chord, and thickness of each slice along the geometry.
Command Line
To call the utility from the command line, simply call the utility using the following command with the desired options:
usage: geometry_distribution [-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 ...]]
[-xs X_START [X_START ...]]
[-xe X_END [X_END ...]] [-ns N_SPAN]
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 geometry_distribution.
Default:
'geometry_distribution'- -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+']- -xs, --x_start
Coordinate to start slices from. Default is [0, 0, 0].
Default:
[0, 0, 0]- -xe, --x_end
Coordinate to end slices a. Default is [0, 0, 1].
Default:
[0, 0, 1]- -ns, --n_span
Number of spanwise samples. Default is 100.
Default:
100
Python API
To call the utility from Python, import the necessary modules and call the function with necessary imputs:
- postprocessing.paraview.distributions.geometry_distribution(input_file=None, output_directory='./', name='geometry_distribution', patches='group/wall', span_direction='Z+', lift_direction='Y+', drag_direction='X+', x_start=[0, 0, 0], x_end=[0, 0, 1], n_span=100)
Function to compute a force distribution using Paraview.
- Parameters:
- input_filestr
Path to file to load with Paraview.
- output_directorystr
Path to directory where the distribution files will be written. Default is “./”.
- namestr
Name pattern to write out files in the output directory. Default is “geometry_distribution”.
- patchesstr or list
Patch name(s) over which to compute the force distribution. 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+”.
- x_startlist
Coordinates to start slices from. Default is [0, 0, 0].
- x_endlist
Coordinates to end slices at. Default is [0, 0, 1].
- n_spanint
Number of spanwise samples. Default is 100.
J C Vassberg and A Jameson. Influence of shape parameterization on a benchmark aerodynamic shape optimization. In von Karman Institute for Fluid Dynamics - Lecture Series. Brussels, Belguim, 2016.