15.4. Solution File Operations

The following sections of this chapter are:

15.4.1. solnEdit

solnEdit is a tool that enables operations on a solution file.

15.4.1.1. Description

Operations range from:

  • Imposition of a constant value on a datafield, or a part of a datafield.

  • Imposition of an analytic value on a datafield.

  • Modification of solution header information.

  • Conversion of solution files from non-SI unit systems.

  • Combination of datafields for postprocessing operations.


Note:  Advanced edition of an INPUT solution file is not a supported feature of FENSAP-ICE. A modified solution file might affect the solver convergence and the physical accuracy of your computations. This command should only be used for postprocessing or data analysis purposes.


15.4.1.2. Command Line Reference


Note:  

solnEdit -h

For a complete, and fully up-to-date command reference description, use the built-in command line help with the above script.


Table 15.33: solnEdit

solnEdit GRID INPUT OUTPUT [options]

The solution file INPUT and its related grid are read, and the file OUTPUT is written.

-l

Printout the content of the solution file, the OUTPUT argument can be omitted.

-c3d

Input grid is a C3D solid grid.


Table 15.34: Options

FIELDNAME=EXPRESSION

The content of the named field will be replaced by the expression value. Expressions are Maple-like. Use enclosing quotes around EXPRESSION if spaces are used in the expression.

For example "XVEL=Z^2"

Available variables are: the 4-letter solution field names, X, Y, Z, NN (node ID), MAT (material ID).

FIELDNAME:#=EXPRESSION

For unsteady fields, # permits to select the time level to change.

"PRES:2=sqrt(X*X+Y*Y)*1000 + 101325" FIELDNAME@BC=EXPRESSION

Specify a boundary condition where the values are applied. When no boundary condition is specified, the value is applied to the whole datafield, internally too. Multiple boundary conditions and a no-boundary condition expression can be specified simultaneously.

FIELDNAME=@FILENAME@FIELD

The entire content of FIELDNAME will be replaced by the content from the source solution file. The source solution must be from a grid with the same number of nodes, however the file format and available fields may differ.

-convertToMetricFrom=[ft/s,in/s,mph,m] [,[psi,psf,Pa,kPa,lbm/ins2], [R,F,C,K], [kg/m3,lb/in3,lb/ft3]]

This converts the solution for velocity, pressure, temperature, density using the specified units.


15.4.1.3. Examples

Example 15.3: Print the Content of a Solution File

solnEdit grid soln -l

Prints the content of a solution file. The output record below shows the list of available fields, as 4-letter groups.

...reading grid

...done

Grid BCs : 1000 2000 3400 4100

== File information:

nodes: 4854 fields: 6 lvltime: 1

Available fields : DENS ( Density (kg/m^3) )

Available fields : PRES ( Pressure (N/m^2) )

Available fields : XVEL ( V1-velocity (m/s); Velocity )

Available fields : YVEL ( V2-velocity (m/s) )

Available fields : ZVEL ( V3-velocity (m/s) )

Available fields : TEMP ( Static temperature (K) )

Header variable #1 : 287.054

Header variable #2 : 1.4

Header variable #3 : 288

...


Example 15.4: Modify the Content of a Datafield

solnEdit grid soln soln_out TEMP=288

Assigns a constant value.


Example 15.5: Modify the Content of a Datafield on a Specific Boundary Condition

solnEdit grid soln soln_out TEMP@2000=288

Assigns a constant value on wall 2000.


Example 15.6: Set up Material-Specific Values (Two Possible Syntaxes)

solnEdit grid soln soln_out "TEMP=ifValue(MAT==1,288,270)"

Syntax 1

solnEdit grid soln soln_out "TEMP=(MAT==1)*288+(MAT==0)*270"

Syntax 2


See Expression Syntax for more details regarding the available expression operators.

15.4.2. soln2soln

The soln2soln command interpolates a solution file from one grid to another. The grids can be node-matching or non-node-matching.

15.4.2.1. Description

If the grids are exactly node-matching, no interpolation will be required, the solution will simply be copied from one grid to the other. This is useful if a solution must be copied onto a grid that has been reordered. Use the -nodes option for this specific mode.

If the grids are not node-matching, each target node will be interpolated in 3D in the source grid cells. If the node lies outside of the original grid volume, the value at the closest surface projection is used. This feature must be used with caution.


Note:  Wall nodes have a special treatment. For some datafields (temperature, pressure, velocity, heat flux, forces, beta), their value will be projected to the closest wall of the target grid. Use the -raw option to disable this behavior.


If the source grid is curvilinear two-dimensional (such as ICE3D output grid files), it is suggested to use the -flat option.

15.4.2.2. Command Line Reference

soln2soln GRID1 SOLN1 GRID2 SOLN_OUT [options]

This command interpolates solution1 values from grid1 to grid 2 and writes SOLN_OUT.soln.


Note:  For FENSAP/DROP3D solution files, it interpolates wall-based hflux/shear/beta on surfaces only.


Table 15.35: Options

-raw

Disable any automatic behavior (wall only, slip/noslip).

-flat

Use with map.grid/ice.grid source (GRID1) files.

-nodes

Use with reordered grids or grids same nodes coordinates, no interpolation is done, interpolation is a closest-node search.

-walls

Interpolate all points from the nearest WALL boundary condition of the input grid.

-perbc

Values are computed on boundaries only and closest-surface/point search is done on the matching boundary condition in the other grid. The two grids must share same boundary condition identifiers.


Table 15.36: Optimizations

-outbc

Values computed on the target boundaries only (internal nodes = 0).

-threads=N

Execute the interpolation using multiple CPU cores.


15.4.2.3. Examples

Table 15.37: Interpolating Solutions

soln2soln grid_orig soln grid_reordered soln_ordered -nodes

Interpolate solution of a reordered grid (different node ordering).

soln2soln grid1 soln grid2 soln.2 -threads=4

Interpolate solution between two different grids of same general geometry (Interpolation using multi-cores is much faster).


Table 15.38: Interpolating swimsol Files and 3D Airflow Wall Values

soln2soln map.grid swimsol grid_3d swimsol.3d -flat

Interpolate a swimsol file onto the 3D airflow grid.

soln2soln grid_3d soln map.grid soln.map -walls

Interpolate 3D airflow wall values onto a 2D flat grid.