9.3.1. Using the Command Line to Interpolate Results

In some instances, the cfx5interp script can be used from the command line to initiate an interpolation. This section presents a brief introduction to this script. For more information about this script, type <CFXROOT>/cfx5interp -help at the command prompt.

To use the cfx5interp script, enter a command line of the form:

cfx5interp -res <results file> -mesh <CFX-Solver input file> [<arguments>]

where:

  • <results file> is the name of a results file that contains a solution.

  • <CFX-Solver input file> is the name of a CFX-Solver input file that contains a mesh onto which the solution should be interpolated.

  • [<arguments>] is an optional list of additional arguments.

cfx5interp rewrites the CFX-Solver input file with the interpolated form of the solution that was read from the results file. A command of this form would produce the same results as running invoking interpolation using Tools > Interpolate Results within the CFX-Solver Manager.

You can use the -difference argument to cause the interpolator to produce difference datasets for differences in results between two results files. The form of such a statement is:

cfx5interp -difference -from <res file 1> -dest <res file 2> [<arguments>]

where:

  • <res file 1> is the name of a results file that contains the original (older) set of fields

  • <res file 2> is the name of a results file that contains the newer set of fields

  • [<arguments>] is an optional list of additional arguments

cfx5interp calculates the differences between an original set of fields and the newer set, and rewrites <res file 2> with the differencing information included.

The cfx5interp script can run two versions of the interpolator. The newer version (a solver-based interpolator) runs by default, and the older one (that was released with Ansys CFX 10.0) can be invoked by using the -interp-old argument.

When the older interpolator is used, the cfx5interp script is capable of producing a text file of results for specific locations within the fluid domain. This is particularly useful if there is experimental data to validate.

To produce a results text file, first create a text file containing the particular vertex coordinates of interest, in the following format:

x(1) y(1) z(1)
x(2) y(2) z(2)
. . . .
x(n) y(n) z(n)

Once the vertex file is created, run the old interpolator using a command line of the form:

cfx5interp -vtx <vertex file> -res <results file> -interpolate-old

The old interpolator creates a file with a name of the form: <vertex file>.inn, where nn is chosen to make a unique filename. This is a text file that contains the coordinates that are specified in the vertex file, plus the results from the results file interpolated to the vertex locations.

If, in the vertex file, there are coordinates that lie outside of the solution grid, values of 0.0E0 will be assigned for all variables at those coordinates; that is, results are not extrapolated to a vertex file.


Note:  Some of the values obtained using the cfx5interp script may differ slightly from the values obtained using Data Export in CFD-Post. These minor discrepancies result from different methods of calculation. Discrepancies are more likely to occur at points that lie very close to the edge of the mesh elements or in regions of prism and hexahedral elements. Inconsistencies are likely to be more significant where gradients are large, particularly in the boundary layer.