Radial_Interp Description:
This program performs specialized interpolations for hypersonic grids
and/or flow fields. The radial grid lines of volume grids are assumed
to extend from the body to the outer boundary for all blocks, and there
should be only one layer of blocks. This assumption allows rapid
generation of volume grids from a given volume grid and a new surface
grid. The interpolation coefficients readily determined for the new
surface grid points are reused to grow the corresponding volume
quantities out from the surface parallel to the original radial lines.
All files are PLOT3D grid and function files, formatted or unformatted.
Normally, an output volume grid has the k dimension of the input volume
grid, but this version has an option to redistribute the points in the
k direction, including changing their number. The optional last line
of the control file contains three controls for doing this. See the
History below.
Options:
(1) Interpolate a new volume grid from a given volume grid and a new
surface grid. A flow field may optionally accompany the given grid
and be interpolated to the new volume grid. The given grid and
optional flow solution may each be either vertex-centered or cell-
centered. Three of the implied permutations are relevant:
(a) Vertex-centered grid + vertex-centered solution:
flow interpolations are vertex-centered
(b) Vertex-centered grid + cell -centered solution:
input flow is moved to vertices; cell-centered flow is output
(c) Cell -centered grid + cell -centered solution:
treated as for (a) but output flow is really cell-centered
The new surface grid must be input as vertex-centered. For case (c),
its cell-centered form is derived here. The output blocks contain
the same number of radial points as the initial grid. The degenerate
case (nk = 1) is meaningful if a flow solution is present.
(2) Interpolate a flow solution from one grid to another ([largely]
consistent) grid. The grids and flow solutions may contain either
volume data or surface data (only). The case of surfaces is the
same as for option (1) with a flow solution present. In fact,
option (2) is distinguished from option (1) by nk > 1 in the new
target grid. In the case of volume grids, the old and new numbers
of radial points may differ.
Two sub-options are provided:
(i) is suited to fully consistent radial lines;
(ii) is more general and is quite efficient if the radial lines
are reasonably consistent.
Option (2) is intended for situations such as where the new mesh has
had its outer boundary moved closer to the body. Again, the new
target grid must be input as vertex-centered. If necessary, its
cell-centered form is derived here.
Assumptions:
> At solid wall boundaries (k = 1), all values are surface-cell-
centered (no below-the-wall values).
> The same underlying geometry is represented by both surface grids.
Any local discrepancies are small and corrected for.
> The new surface may be a reduced region (as for rapid interpolation
of damage/repair volume grids and/or solutions).
Usage for Surface Damage/Repair Applications:
Two runs of Radial_Interp are required if a new surface grid in the
damage region is the starting point:
(1) Generate a new volume grid from the old volume grid and new surface
(vertex-centered; no flow interpolation), followed by
(2) Interpolate a new solution from the cell-centered initial flow and
grid, using the same new vertex-centered input surface.
Treating the cell-centered flow separately (with the cell-centered form
of the grid) is preferable to combining runs (1) and (2) because the
runs are almost identical on different data. A second reason is that
the ADT search package cannot handle more than one surface to be
searched simultaneously.
Apart from avoiding unnecessary smearing of a finite volume flow
solution during interpolation, the intended inclusion of "halo" cells
in the cell-centered grids and solutions enables proper handling of
boundary conditions, both at the solid wall and at the other outer
boundaries of what could well be a reduced set of new grid blocks
modeling localized surface damage or repair. These halo cells can
define the (frozen) boundary conditions needed for updating the flow
in the damage region more efficiently than treating the entire config-
uration, without significant loss of accuracy.
Algorithm:
The assumptions allow use of surface searches (and possibly radial line
searches) in place of volume searches, although the more general option
(ii) for flow field interpolation still uses 3-D searches along the new
radial lines.
> Read the full original volume (or surface) grid and associated flow
solution if present.
> If an output grid is implied, read the full new surface grid
(vertex-centered) and establish common edge info.
> If the solution is cell-centered but the grid is not, interpolate it
to the grid vertices via averaging of neighbors.
> If the grid and solution are both cell-centered, convert the target
grid to cell-centered form.
> Generate the ADT search tree from all patches of the new structured
surface.
> For each block of the new grid:
> Read the new grid block (or copy it to the k = 1 plane if it is a
surface already fully-read).
> For each point (i,j) in the new k = 1 surface face:
> Find the nearest original surface grid cell (ADT search).
> Any target point further than the distance tolerance from the
original surface grid may constitute erroneous usage, but may
also be the result of minor damage/repair; proceed anyway with
the best surface cell found.
> Interpolate the original grid and/or flow solution to the
current new surface point (bilinear within a single cell).
> If a volume grid is being generated,
> Apply the same interpolation coefficients to the successive
k planes to produce the new radial grid line and corre-
sponding flow if present.
Otherwise, if a flow field is being interpolated (not just a
surface flow),
> If the radial lines are consistent,
> Build a new radial line using the old grid as a template.
Otherwise (a little more generally),
> For each k > 1, use the old grid cell indices found for
the previous k as good starting guesses for a RIPPLE3D
search for the current k.
> Simple use of TRILINT-type volume interpolation will not
suffice in the boundary layer. Consider the case of a
new grid simply twice as dense as the old grid: a new
in-between point at the surface could be significantly
far away from the foot of the projection to the nearest
surface cell in the old grid. This offset must be taken
into account as we move off the new surface. Thus, if
x0 is the foot of the projected normal for the k = 1
point x1, then for k > 1 we really search for the
adjusted point xk where xk = x(k) - (x1 - x0), not for
x(k).
> If the optional input flow was cell-centered and the grid was
not, convert the interpolated flow to be cell-centered for the
new volume block.
> Output the interpolated grid block and/or flow solution block.
Control file format ('radial_interp.inp')
RADIAL_INTERP controls for case xxx
------------ INPUT VOLUME (or SURFACE) GRID --------------
baseline.g Initial grid
T Formatted? [T|F]
F Cell-centered? [T|F]
----------- INPUT FLOW SOLUTION (IF PRESENT) -------------
baseline.f Associated flow solution, or none.
T Formatted? [T|F]
F Cell-centered? [T|F]
------------ TARGET SURFACE or VOLUME GRID ---------------
denser.g Input new volume grid
T Formatted? [T|F]
-------------- INTERPOLATED SURFACE GRID -----------------
interpolated.surf.g Output surface grid (to check surface searches)
T Formatted? [T|F]
-------------- INTERPOLATED VOLUME GRID ------------------
interpolated.vol.g Output volume grid, or none.
T Formatted? [T|F]
------------- INTERPOLATED FLOW SOLUTION -----------------
denser.f Output flow field, or none.
T Formatted? [T|F]
--------------- MISCELLANEOUS CONTROLS -------------------
1 1 assumes consistent radial lines; 2 relaxes this
T T = allow extrapolation; F = all (p,q)s in [0, 1]
0.0001 E.g., dtol = 0.0001 m = distance tolerance for
surface cell searches (same units as the grid)
newnk ds1 ds2fraction Optional inputs to redistribute each radial line
a la OUTBOUND. GRID ONLY. See NOTES below.
NOTES: (1) dtol < 0 means decay surface mismatches to zero at the outer
boundary, else apply the same dx/dy/dz at each k;
note that the same differences is probably the right choice if
the new surface adds curvature, esp. at k = 2.
(2) DO NOT ATTEMPT TO REDISTRIBUTE THE RADIAL LINES IF A FLOW FILE IS PRESENT.
(One reason: Half-cell spacing at the wall.)
(3) If the optional last line is not present, the output radial
distribution matches that of the input grid; alternatively,
enter newnk = 0 and ds1 = -99. to suppress redistribution.
These optional controls allow changing the output nk (or not)
and/or the output radial distribution:
newnk = input nk is allowed (probably to impose a ds1 > 0.);
newnk = 2 means the most likely case: double the point count
in the k direction; e.g., 65 --> 129;
newnk = 0 means the output nk is the same as the input nk;
newnk = some sensible positive integer means change nk to that newnk;
ds1 = -1. is probably the right choice;
ds1 < -1. suppresses any redistribution;
ds1 = -1. means preserve the input relative spacing (probably
for a different nk);
ds2 = 0. means preserve the input wall spacing;
ds2 > 0. means a fixed wall spacing everywhere;
ds2fraction is not used if ds1 = -1.;
otherwise, ds2fraction is applied to the interim 1-sided
stretching's outer spacing for 2-sided stretching
Sponsor:
TSA Reacting Flow Environments Branch, NASA Ames Research Center
(now Aerothermodynamics Branch)
History:
04/13/04 DAS Initial RADIAL_INTERP design: James suggested adapting
GRID_INTERP (also James's idea) as a specialized
alternative to the fully general FLOW_INTERP. It takes
advantage of single-layer-of-blocks topologies.
04/14/04 " Added output of interpolated surface grid as a check on
the surface searching behavior.
04/16/04 DS/JR RIPPLE_SURF has been refined to balance the (p,q) and
distance tolerances.
04/19/04 " Count (p,q) deviations from the unit square and projected
distances above tolerance separately; make the distance
tolerance an input instead of some hard-coded fraction of
the data range.
04/20/04 DAS Merged the GRID_INTERP function into RADIAL_INTERP, which
now produces grids and/or flow fields.
05/03/04 " Added blanking capability: points near the open shuttle
trailing edge were being mapped to the wrong surface.
05/20/04 " Made extensions to ensure exact matches in common block
faces of interpolated grids. Very grubby!
05/25/04 " Surface patch x/y/z extrema aren't always at an edge!
(Consider a wing tip cap.)
05/28/04 " Replaced RIPPLE_SURF approach with ADT search scheme
from Stanford. (But RIPPLE3D is still used elsewhere.)
06/07/04 " The ADT scheme now works directly with the structured
grid (no need to repack the coordinates).
10/20/04 " Any left-handed output blocks are now made right-handed
by reversing the j indices.
11/24/04 " Two new "cell-centered" inputs allow application to
cell-centered flow interpolation (in a separate run from
the grid interpolation) without too many complications.
01/19/05 " Interpolating a flow solution with halo cells failed at
the start of block 2. The common edge point data apply
to the new surface BEFORE recentering. Not matching
common points exactly for flow interpolation is OK.
03/24/05 " Preserve outer boundaries precisely by decaying the
adjustment of each new radial line at the surface.
05/02/05 " Decaying can hurt at the outer boundary when higher
resolution is specified at the surface. Carrying any
nonlinear effect of curvature at the surface all the
way out can actually be preferable for smooth surfaces.
Quick fix for now; do it more carefully at the outer
boundary some day.
06/21/06 " dtol = -0.0001 (say - i.e., negative) can now be used
to decay surface adjustments to zero at the outer
boundary as is prefereable for shallow cavities treated
as part of the main volume blocks.
01/28/11 " Chun Tang wondered if an option could be provided to
specify the spacing off the wall in the output grid.
He had thin inner blocks whose outer spacing needed
to be matched, but more conventional use on a single
layer of blocks may benefit from such an option.
Therefore, look for ds1 and ds2fraction on an optional
last line of the control file. Optional blanking
inputs expected there at one time have been removed.
Initially, redistribute a vertex-centered grid only.
If the need arises for treating a flow solution
similarly, it appears that (for each radial line) the
cell-centered grid and flow would need to be converted
to vertices, redistributed, then converted back. Do that
if it's ever called for.
08/07/13 " All ADT variants are now in a single module with generic
build_adt and search_adt interfaces.
03/19/18 " Jeff Hill asked for an option to change the number of grid
points in the radial direction, as convenient for the case
of grid alignment within DPLR on a coarsened (say 222) then
wanting to impose the next finer surface. This calls for a
111 volume output, not 112. The optional last line of the
control file now has three inputs, not two. Only the grid
is treated; expected usage allows FCONVERT to upsequence the
flow solution.
03/22/18 " The cases of an old (or no) optional last line in the control
file did not turn off redistribution. To suppress
redistribution, omit the last line or enter (say) newnk = 0
and ds1 = -99. with any ds2fraction.
03/23/18 " The special case of newnk = 2 now means double the current k
resolution, as in 65 --> 129.
04/27/18 " The option to change nk, intended for vertex-centered grids only,
led to unassigned flow interpolations. Changing nk was supposed
to be disallowed for flow solutions all along.
10/21/20 " Variable newnk was not being defined as [old] nk when a function
file is present (redistribution disallowed).
Author:
David Saunders, ELORET Corporation/NASA Ames Research Center, Moffett Field, CA
(then ERC, Inc./ARC; now AMA, Inc./ARC)