A Post Processor for Structured CFD
Steven J. Massey
Analytical Services & Materials Inc.
(changes from 2.0.0 are highlighted in blue)
POST (Program with Overly Simple Title) is designed to provide specialized post processing support for the PAB3D solver versions from 1997-2000 (v1.3 - 1.6.0 alpha) as well as any solver capable of outputting PLOT3D multiblock format data. POST currently contains most of the scalar field functions found in FAST and PLOT3D, with additional support for spatially varying real gas constant R and ratio of specific heats g due to the presence of multiple species. The interface is text based, with extensive defaults and many shortcuts.
Batch processing is available via automatically generated script files. Results can be written to PLOT3D format or binaryTecplot files. Functions that are only defined on a subset of the domain, such as boundary layer parameters or forces, are also supported.
POST has been tested on Intel/Windows/Linux, DEC, Sun, SGI, HP and Cray computers. POST is written entirely in FORTRAN 77 and uses the widely available Cray pointer extensions for dynamic memory allocation.
Currently POST supports most of the scalar field functions found in PLOT3D and FAST as well as several that are not. These functions are defined throughout the computational domain and are output for the user specified block and grid point ranges.
Another class of special functions that are not defined throughout the domain can be activated from the Code field at the end of the output range input line. These functions will be discussed in detail in the following section.
The available scalar field functions are listed in Table 1;
Subdomain functions are activated from the Code field at the end of the output range input line. Note that a range input line that contains a subdomain code only applies to that function, unlike the field functions that are calculated on all ranges given. Currently POST is capable of calculating law-of-the-wall coordinate (y+) on no-slip surfaces, area and mass averaged r, u, v, w, M, p, p0 , T, T0 , R, gon any computational plane, thrust and mass flow values and coefficients across any computational plane, pressure and viscous forces, and moments and coefficients on no-slip surfaces. For the calculation of force and moment coefficients, quantities are summed across all specified ranges and are referenced to the values in the POST control file, post.cont. The activation codes and definitions for the subdomain functions currently available are shown in Table 2.
- Use POST to plot the default normal vectors and if after swaping the sign as directed from the force.info output they do not match the direction of the POST sign convention, prefix the force code with a negative sign, (eg. use -k1f instead of k1f). For example, if originally you use k1f and plot the normals using nk_y and nk_z and observe that the normals are point out from the surface, and the normal sign is negitive in force.info--everything is ok, keep k1f. If however, the normal sign was positive with the normals pointing outward, you would override the normal sign with -k1f. For thrust calculations, do the same but only refer to the graph since there are no automatically assigned normals for thrust.
- For force calculations, set the pressure datum (PO) to 0 in post.cont to calculate absolute pressure forces and check if the integrated pressure forces for each surface are in the expected direction. If they are not, reverse the normal.
- For thrust calculations, check that the direction of the mass flow is in agreement with the flow direction, ie. if the main flow is in the positive X direction the X component of mass flow should also be positive. If it is not reverse the normal (eg. use -jt instead of jt)
POST Control File
For force and nozzle performance calculations an additional input or control file is needed to specify the many parameters associated with these calculations. If the file does not exist for a calculation that needs it, POST will skip calculations that it can not perform and then generate the file and fill it with default values. The user then has to edit the file and rerun POST. The following is an example of an automatically generated sample.post.cont file, note that comment lines are denoted with the # character in the first column.
New additions to the POST control file include optional parameters to completely define the dimensional reference condition for PLOT3D input. Parameters for a mixedness function are also included, but the function itself is not fully implemented yet.
# POST Control File v1.4 (used by Force, Thrust and Mix )
# Comment lines start with a # sign.
# All quantities are in SI units
# Parameters for force and moment coefficent calculations
# alpha = angle-of-attack (deg)
# beta = side slip angle (deg)
# sref = reference plan area
# cref = reference chord length
# bref = reference span length
# xmc = x cordinate of moment center
# ymc = y cordinate of moment center
# zmc = z cordinate of moment center
# Note: For 2D solutions, force and moment coefficients are
# non-dimensionalized by cref and cref**2 respectively.
# If 3D, then sref and sref*cref are used.
# alpha beta
# sref cref bref xmc ymc zmc
1.000 1.0000 1.0000 0.00000 0.00000 0.00000
# Parameters for engine performance calculations.
# Units are in SI and capitalized variable names refer to
# NASA TM-107646.
# AT = Full throat area, or throat height for 2D grids.
# For example, if only half of nozzle is modeled, use
# double the modeled area or length.
# AREF = Reference area (length for 2D) used in Thrust Coef.
# MACH = Freestream Mach number for computation of freestream
# dynamic pressure (QO) for Thrust Coef.
# symf = Symmetry factor; = 2 for half of nozzle, 3 for one
# third etc. If full nozzle symf = 1.
# PO = Freestream static pressure, also used as a datum for
# the force and stream thrust calculations.
# PTENG = Average primary jet total pressure
# TTENG = Average primary jet total temperature
# GAMJ = Exhaust flow ratio of specific heats
# RJ = Primary flow gas constant
# AT AREF MACH symf
1.0 1.0 0.01 1.0
# PO PTENG TTENG GAMJ RJ
101490.69 0.0 273.0 1.40 287.0530
# Parameters mixedness (K) calculations, for special function
# code "mix".
# Ttp = Total temperature of primary flow
# Tts = Total temperature of secondary flow
# Wp = Mass flow of primary (use thrust special function,
# it, jt or kt first to calculate)
# Ws = Mass flow of secondary
# Ttp Tts Wp Ws
273.0 273.0 1.0 1.0
# Plot3D input parameters. Used by force and thrust routines
# to completely define the dimensional reference conditions.
# L = Scale factor to multiply grid by convert to meters.
# Example: L = 0.0254 if grid is in inches.
# rho0 = Freestream density (strict plot3d = 1.)
# a0 = Freestream speed of sound (strict plot3d = 1.)
# gam_inf = Ratio of specific heats (strict plot3d = 1.4)
# r_inf = Real gas constant (strict plot3d = 1.)
# L rho0 a0 gam_inf r_inf
0.0254 1.0101203 375.0512085 1.4000 287.0530
POST is driven by an interactive text based dialog or an ASCII script file that is automatically generated after a successful run. The interface is fairly intelligent and contains many shortcuts and defaults. All prompts will show default values in brackets, and any available choices in parenthesis. For example:
Output format? (P)lot3D, (T)ecPlot, (B)oth [Tecplot]:
Here the choices are P, T or B and the default is Tecplot. Note, that the interface will except the full word or just the first letter in either lower or uppercase, eg. t, T, tecplot, Tecplot, TanyThing. To activate default choices simply press enter. All input is parsed, so even if a read statement expects ten integers, a blank return will trigger the defaults for the all of them at once.
Another feature of the interface is that subsequent input prompts are based on previous responses. For example, if you specified PLOT3D format output in the previous example, the program will not prompt you for the Tecplot file names. And if you do not enter a file name for function output, you will not be prompted for the names of the functions you wish to calculate.
Note on Subdomain Input
For y+ , Start, End, Inc ranges for the normal direction specified are set by the program to coincide with the specified boundary, therefore 1,1,1 or any other 3 numbers could be entered. For example if y+ on the kdim boundary of block 4 is desired, one would enter the following line;
4 1 0 1 1 0 1 0 0 1 kd+
If one also wants to know another of the scalar functions at this same location an additional input line is required since subdomain function input lines are for that particular function only. The additional input line would simply be
4 1 0 1 1 0 1 0 0 1
and whatever function(s) were selection under the function menu will be output to the named function file for that range. y+ output is written to yplus.* files based on the chosen output format. A text yplus.info containing the min/max and all y+ data points is also written.
Whenever a POST session is run all user input with descriptive headers is saved in an ASCII script file named, post.script. This script may be used as is, or modified with a text editor to produce the desired output. To run POST using a script, pass the name of the script file as an argument. Additional comment lines may be added by placing a # character in the first column of any line after the first line. The first line of the script must start with the identification string, #!POST XXX. In general, the easiest way to write a script file is to let POST do it for you, then modify it as your needs change.
Currently POST is capable of writing binary Tecplot files and PLOT3D grid, solution and function files. The Tecplot files are in C-binary format and are portable across all platforms. The PLOT3D files are written in unformatted FORTRAN binary format.
The PLOT3D formats are written to conform to the specifications found in the FAST and PLOT3D manuals. However, there are a few things to watch out for. Single block PLOT3D files are written in PLOT3D multiblock format, the difference being that in the normal single block format there is no input line for the number of blocks in the file.
The PLOT3D function file specification allows for an arbitrary number of functions, however, FAST expects either one or three functions for either a scalar or vector variable. Also, note that a function file of the five conserved variables is not equivalent to a solution file for PLOT3D since the solution file contains the extra information of Mach, a, Re, and time. These files are equivalent for Tecplot output.
Source Code Change Comments Since Post 1.7
c 2.1.1 02-03-00 - 1) rev1:ideal thrust from TM-86319 Rev 1 coded for check.
c 02-09-00 2) thrustnode: JRC's fideal routine called with
c abs(mass) for check.
c 3) thrustnode, wfideal, rev1: compiler options
c for ALTKJ1(for REV1) and KJ4REV2
c 4) default options is REV2 with KJ4 from REV1, matches
c rev1 resaults exactly and is 0.5% diff in ideal thrust
c from JRC's fideal routine.
c 5) thrustnode: fixed missing symf factor in Mass Flow
c Rate output for single range case.
c 6) thrustnode: removed incorrect summation
c of ideal mass flow for cases with multiple
c thrust cuts, ie. a case where the
c exit plane is made up of more than 1 face or cut. Since
c ideal mass flow is based on reference area (which is
c already a integrated quantity), summing this term is
c redundant and produces results of (ncuts)*mass_ideal
c 7) thrustnode: fixed face interpolation limiter
c for q which was inaccurate if user is subdividing
c 8) update date set to 7-1-00, contact changed to SJM
c 9) thrustnode: inceased output precision to f15.7 for
c thrust.dat files.
c 2.1.0 01-18-00 - 1) post: nm was not initialized. Had no effect since
c 02-03-00 mixing function was not active yet.
c 2) post.f: remove extra sgas variables. No effect.
c 3) special.f/force: fixed range bug in which shows up from
c July 2,99 force fix. Error shows up only for special
c functions -if2,-jf2,-kf2. Problem is nodal point is
c passed to volume instead of cell center, gives garbage.
c for volume, hence contaminates viscous forces. Effect
c was very minimal on test cases.
c 4) added autoselection of normal direction for surface
c force integrations. Now, meaning of -?f? changed from
c opposite of default normal to opposite of automatic
c normal, default normal is still plotted. Sign of normal
c used is written to force.info. User is warned if
c -?f? is used.
c 5) fixed tteng internal conversion to deg F in wfideal.
c Previously tteng was converted to R. This resulted
c in Discharge coeff > 1. Add DEFINE to display JRC's
c thrust output.
c 2.0.1 01-11-00 1) Fixed pab97 nondim divide by zero bug. pab97_qinfo
c routine was missing the common block /qhead_dim/
c This errror was introduced with version 2.0.0
c 2) change LINUXINTEL to INTELLINUX in special.f/rcont
c 2.0.0 12/07/99 1) ui: add suport for pab99 (1.5.0) archive files input
c -01/03/00 2) new p99_qinfo,p99_rq, p99_rgrid,
c 3) remove old slow "mod" function from pab97_rgrid
c 4) fix old pab97 read bug for laminar multispecies
c 5) detect tardir name, create and remove tempdir for p99
c 6) "Block" label for force.info fixed.
c 7) fixed (worked around) pgf77 bug that showed up in
c special function routines using the volume function
c which uses voltet. The fix was to create a shell
c routine called fakeout
c 8) modified checktar to handle /bin/sh stderr correctly
c and to not depend on tar -C support
c 9) add support for second gamma1 function cp/cv
c as oppossed to h/ei
c 10) fix logic altsym function
c 11) Fixed length option for ntname with no leading zeros.
c This caused zones to be named "Block" instead of
c "Block 1"...
c 12) changed special function output to post.script to be
c written as :lccode instead of :6 to remove extra spaces
c 13) fixed error message for avg function for volume input,
c since avg requires only a plane
c 1.9 11/01-16/99 1) ui: Add support for plot3d input.
c 2) ui: Change script version to 1.9.
c 3) rotateq_y: remove unused nsq from dim list
c 4) inbl: read grid instead of q
c 5) p3d_getsize: create mod of getsize for plot3d
c 6) added p3d_rq, p3d_rgrid, p3d_qinfo
c 7) completed stream thrust averageing for j and k planes
c in avg:
c 8) added node2cell
c 9) removed all reference to imom?d functions
c 10) tested plot3d on forcensv,yplusp,avg,thrustnode
c 11) add big_endian logic to post.f:inbl()
c 12) port to alphalinux, declare types for Tec* c functions
c 1.83 08/03/99 Fixed navg accumulation, rewrote call rcont logic
c (only imix is written now)
c 1.83 07/26-29/99 1) added momentum thrust output
c 2) added stream thrust averaged quantities
c 3) modified mass averaging to use V . n not ||V||,
c made extremely small difference (5th digit)
c 4) added mixedness special function "mix"
c and modified read/write to post.cont (now v1.4)
c 1.82 07/22/99 fixed missed renamed tmassf to tmf and tmass_t to mass_t
c 1.82 07/16/99 Fixed stream thrust formula. Used to use component massflows
c instead of total massflow. (Still needs testing)
c 1.81 07/12/99 Fixed misallocation of memory due to usage of old
c iskip, jskip, kskip values in GETSIZE. This error only shows
c up when the last block has a different sequence vlaue from the
c largest block.
c 1.8 07/08/99 Force bug fix for i and j surfaces. qi0 was
c being referenced as qi0(i,j.. instead of qi0(j,k... for
c pw calculations only. Similarly for qj0.
c This bug was introduced after 11/98 for versions
c >1.7 and <=(1.8 7/7/99) First version found was 1.7 from Feb99
c Also, discovered inconsistant s/width use in force.
c 1.8 07/07/99 Added general routine to check for zerodivisors,but
c commented its usage out in force (left j)
c 1.8 07/02/99 Rewrote memory allocation to use max(i*j*k) instead of
c max(i) * max(j) * max(k). The former uses the exact
c amount needed, while the latter can be very wasteful for
c "L" shaped domains.
c Fixed iibl <-> ib mixup bug in vortic, was iibl now ib.
c Changed iunitf=67 to 66 to fix plot3d fun output bug when alos
c writing tecplot fun.
c Fixed k <-> ko mixup for r,gamma1,volume in i2f,j2f,k2f blocks
c of forcensv. This caused point references to cell valued
c 1.77 05/14/99 mod rcont and wcont to prevent tteng = 0.
c added ib to rcont call to fix improper call of block2d with
c ith = 1. Causes error if first call to rcont isn't with block1.
c 1.76 04/29/99 fixed over read of xmach and reue quantites in 'tine rq
c 1.75 04/28/99 linux-intel workaround for block2d + small changes in
c 1.75 04/16/99 add R8 string to version routine
c 1.75 03/03/99 fix areaij2 i1 to i2 typo
c 1.75 03/02/99 rewrote block2d, modified wcont, rcont
c (and changed location of call from qinfo to post).
c 1.74 03/01/99 added ||V|| to mass average in p0_vag and avg routines
On the short list of improvements to be made are:
- Support CGNS output
- Option to write single precision PLOT3D output for double precision input
- Calculate Y+ off surface in normal coordinates
- Link to PAB3D for easier runtime monitoring of the post processed solution
- Fully support all functions found in FAST and PLOT3D
- Calculate fluxes across arbitrary surfaces
- Shortcut functions like ``boundary'' that will automatically set the block ranges to all the boundary surfaces.
 Walatka, P. P., Clucas, J., McCabe, R. K., Plessel, T., and Potter, R., FAST User Guide v1.1 , RND Branch, NASA-Ames Research Center, June 1993.
 Walatka, P. P., Buning, P. G., Pierce, L., and Elson, P. A., PLOT3D User's Manual, NASA TM 100455, NASA-Amers Research Center, July 1992.
 Amtec Engineering, Inc., Bellevue, Washington, Tecplot Version 7 User's Manual, August 1996.