SRAP (Spline, Re-distribute And Project) Version 2.1c

Authors: William M. Chan

Date: July, 1997.

This program splines, redistributes and projects points from grids supplied in a PLOT3D single/multiple grid file. The grids are assumed to be dimensioned (jmax,1,1) or (jmax,kmax,1), i.e. they are curve grids or surface grids. Spline knots are supplied by the original grid. An option allows the redistributed points to be projected back on to the piece-wise linear representation of the curve/surface defined by the original points.

For surface grids, redistribution is performed in the J direction along K=constant curves, and/or in the K direction along J=constant curves. Redistribution of each J or K constant curve is performed independent of each other.

Each curve in J or K can be divided into one or more segments on which redistribution is performed. Each segment is defined by its start and end indices IS,IE. The new number of points NP and grid spacings at the end points of the segment DELS,DELE can be specified. Grid points not on any defined segments are untouched.

For surface grids, a more complex situation may arise as follows. Suppose redistribution is to be performed in the J direction. Typically, the same end point spacings DELS and DELE are applied for all K=constant curves. In this case, the parameter NNODE (number of nodes) should be set to 1. If different end point spacings are desired at different K stations, NNODE > 1 should be used. At each node index (NODEI), a different set of DELS and DELE can be specified. Linear interpolation is used for values of DELS and DELE between nodes. For curve grids, NNODE should always be set to 1.

This program is modified from the spline.f program obtained from Bob Meakin and can be used as

  1. A grid point redistributor for the initial curves that are used as input for the overset surface grid generator SURGRD.
  2. A grid point redistributor in the J and/or K directions for a surface grid.

Input Files

Two input files are required:
  1. PLOT3D grid file containing grids to be redistributed - should be 3-D format but can single or multiple grids, unformatted or formatted.
  2. Input parameters file - described below.

Output Files

  1. Output message file
  2. Output grid file containing redistributed grids - same format as input grid file.
  3. srap.com - a PLOT3D command file for viewing the redistributed grids.

Execution

srap < [input parameters filename] > [output messages filename]

Sample Input Parameters File and Explanation of Parameters

input_grid_filename
output_grid_filename
1              NBI

1, 3           IG, IROPT

1, 1           IDIR, IMODE, [ISPEC]
2, 2, 1        NSEG, NNODE
1, 10, 20      IS, IE, PAR (segment 1)
  1, 0.1, 0.1    NODEI, DELS, DELE (node 1)
 -1, 0.2, 0.2                      (node 2)
29, -1, 17     IS, IE, PAR (segment 2)
  1, 0.0, 0.0    NODEI, DELS, DELE (node 1)
 -1, 0.0, 0.0                      (node 2)

2, 1, 2        IDIR, IMODE, [ISPEC]
2, 1           NSEG, NNODE
 1, 20, 1.2     IS, IE, PAR (segment 1)
  1, 0.1, 0.1    NODEI, DELS, DELE (node 1)
20, -1, 1.2     IS, IE, PAR (segment 3)
  1, 0.1, 0.0    NODEI, DELS, DELE (node 1)


NBI         =  number of blocks of input ( <= number of grids + 1 ).
               Each block of input contains SRAP parameters for one
               grid (IG > 0) or for all grids (IG = 0) - see IG input
               below. Parameters specified under IG > 0 overrides
               parameters specified under IG = 0. Redistribution is
               not performed on grids in the grid file that are not
               specified in the input parameters file.

For N=1,NBI, enter the following block

{

IG          >0  grid number of grid on which this block of parameters
                is applied
            =0  apply this set of parameters to all grids other than
                the ones specified by IG>0. Parameters for IG=0 must
                appear in the first block of input.

IROPT       =   redistribution direction
                (0 = no redistribution,
                 1 = redistribute in J along K=constant lines,
                 2 = redistribute in K along J=constant lines,
                 3 = 1 followed by 2,
                 4 = 2 followed by 1,
                  1/2/3/4    => projection is performed afterwards
                 -1/-2/-3/-4 => no projection is performed)

Enter the following sub-block once  for IROPT = 1 or 2.
Enter the following sub-block twice for IROPT = 3 or 4.
Do not enter the following sub-block if IROPT = 0.

[

IDIR        =  redistribution direction for this sub-block of parameters
               (1 = J direction parameters, 2 = K direction parameters)

IMODE       =  input grid spacing option
               (1 = absolute,
                2 = relative to arc length of segment)

ISPEC       =  input specification option (if ISPEC is omitted in input
               line, ISPEC=1 is assumed)
               (1 = specify number of points NP and end spacings for each segment;
                    NP specified in PAR must be in range NP > 0 - see below,
                2 = specify max stretching ratio RMAX and end spacings for each
                    segment, number of points is automatically determined;
                    RMAX specified in PAR must be in range RMAX > 1 - see below,
                3 = specify uniform grid spacing in DELS, number of points
                    is automatically determined, DELS must be > 0.

NSEG        =  number of segments.
               Each grid line in J or K can be divided into one or more
               segments on which redistribution is performed. Each segment
               is defined by its start and end indices IS,IE. The new number
               of points NP and grid spacings at the end points of the
               segment DELS,DELE can be specified. Grid points not on any
               defined segments are untouched.

NNODE       =  number of nodes. 
               This is used to indicate variations in grid spacings in the
               cross direction for surface grids. For curve grids, NNODE
               should always be 1. For surface grids, suppose redistribution
               is in J. One node in K would imply that the current sub-block
               of parameters is used for all K. Multiple nodes in K would
               allow a different DELS and DELE at different K stations K=NODEI.
               Linear interpolation is used for values of DELS, DELE between
               nodes.

IS, IE      =  start and end segment indices

PAR         =  new number of points for segment with end spacings given by
               DELS and DELE (ISPEC = 1) - must be > 0, or
            =  max stretching ratio for segment with end spacings given by
               DELS and DELE (ISPEC = 2) - must be > 1

Repeat the following line for each node.
(
NODEI       =  grid point index of node
DELS       >0  prescribed grid spacing at start of segment
           =0  float grid spacing at start of segment
DELE       >0  prescribed grid spacing at end of segment
           =0  float grid spacing at end of segment
               (setting both DELS and DELE to zero with PAR>0 will given
                uniform spacing for segment)
)

]

}

Limitations

  1. For ISPEC=2 and 3, multiple nodes are disregarded, i.e. the code currently assumes there is only one node for each segment.
  2. If redistribution is required in both J and K (IROPT=3 or 4), the code currently performs two projections. The first projection is performed after the first redistribution onto the piece-wise linear segments of the first family of curves. The second projection is performed after the second redistribution onto the piece-wise linear segments of the second family of curves. Unfortunately this does NOT guarantee that the final points are on the bilinear surface defined by the original grid (the user can use another tool PROGRD to guarantee this if needed).


| CGT Manual | CFD Programs | Website Menu | Search |


NASA Ames Research Center, Moffett Field CA 94035-1000, (650) 604-5000
URL: http://rotorcraft.arc.nasa.gov/
This Website Maintained By: Randall L. Peterson.
Responsible NASA Official: Dr. William Warmbrodt (Chief)

Privacy Statement
Ames Research Center Homepage
NASA Homepage

Last Modified: Monday, 07-Jan-2008 11:59:11 PST