Force Distribution

Force distributions are useful for understanding loads on an aerodynamic body. For example, understanding how distributions of lift and drag on a wing change throughout an optimization. Computing these distributions is done through ParaView by importing the case, slicing it along a specific axis and plane, and computing sectional properties.

Note

This utility expects a variable called forcePerS that is the force divided by area on each surface cell face. For the utility to work, this forcePerS variable must exist for the surfaces included in the force computation.

The force of a particular slice is computed by projecting the force on each cell face in the direction specified by the user. The forces are then integrated over the slice to compute the total force. This calculated force is a force per unit length, useful for understanding distributions.

The force 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 and force 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: force_distribution [-h] [-i INPUT_FILE] [-o OUTPUT_DIRECTORY] [-n NAME]
                          [-p PATCHES [PATCHES ...]]
                          [-s SPAN_DIRECTION [SPAN_DIRECTION ...]]
                          [-f FORCE_DIRECTION [FORCE_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 force_distribution.

Default: 'force_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+']

-f, --force_direction

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

Default: ['Y+']

-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 the necessary inputs:

postprocessing.paraview.distributions.force_distribution(input_file=None, output_directory='./', name='force_distribution', patches='group/wall', span_direction='Z+', force_direction='Y+', 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 “force_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+”.

force_directionstr or list

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

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.