15.3. Grid Operations

15.3.1. Convertgrid

convertgrid is a tool that enables many editing operations on a FENSAP format grid.

15.3.1.1. Description

Operations:

  • File format conversion (ASCII, binary, C3D solid)

  • General grid statistics

  • Grid order optimization

  • Scaling, rotation, translation

  • Node periodicity correction

  • Boundary condition operations: renumbering, detection of missing facets

  • Volume operations: splitting

  • Cell operations

15.3.1.2. Command Line Reference


Note:  For a complete and fully up-to-date command reference, use convertgrid -h.


Table 15.4: Convertgrid

convertgrid [SOURCEGRID] [DESTINATIONGRID] [OPTIONS]

Format of the convertgrid command.


Table 15.5: Options

-d

Diagnostic mode - Does not write output file but lists the solution content (reference values, solution datafields, zones and boundary conditions).


Table 15.6: Output File Formats

-ascii

Writes text format grid (default=binary, for speed). File output format is binary, unless -ascii is specified.

-c3d

Writes a C3D format grid (solid domains).

-cart

Writes a grid in Cartesian coordinates.

-cyl

Writes a grid in cylindrical coordinates.

-solid

Writes a solid domain grid.


Table 15.7: Input File Format

-readc3d

Reads a C3D format grid.

-rotx

Specifies the X axis of rotation, if any. Required for some features.

-roty

Specifies the Y axis of rotation, if any. Required for some features.

-rotz

Specifies the Z axis of rotation, if any. Required for some features.


Table 15.8: Stats

-d

Printout grid stats and end (size, boundary conditions, cell types).

-dd

Outputs extra read info.


Table 15.9: Grid Scaling/Operations

-factor=VALUE

Scale the nodes coordinates by VALUE factor.

-factor=X,Y,Z

Scales the X,Y,Z coordinates by VALUE factor.

-translate=X,Y,Z

Scales the grid by the specified vector.

-translatePost

Translates after all other operations (on all materials).

-rotate[X,Y,Z]=angle

Rotates the grid along X,Y,Z axis, by the specified angle (degrees).


Table 15.10: Optimization

-optimize

Reorders the node numbering with the RCM algorithm.

-optimize2

Reorders the node numbering with the Octree algorithm.


Table 15.11: Boundary Condition Operations

-renameBC=OLD,NEW

Renumbers the specified boundary condition to NEW.

-renameBC=OLD,NEW,EQUATION

Same as -renameBC but only where EQUATION is true.

-detectBC=BC

Detects missing boundary facets on the grid and assigns them the identifier boundary condition.

-fixBC

Detects and remove duplicate facets.

-filterInternalBCs

Removes boundary condition surrounded by two volume elements, except actuator disks or heater pads.


Table 15.12: Volume Operations

-splitVolumes

Writes OUTPUT.X grids, one for each volume.

-splitMaterials

As -splitVolumes, but using material IDs as volumes.

-splitSoln=FILENAME

In -splitVolumes mode, can split a solution file.

-splitHFlux=FILENAME

In -splitVolumes mode, can split a hflux.dat file.

-splitShear=FILENAME

In -splitVolumes mode, can split a surface.dat file.

-splitJoin=V1,V2

Volume 2 will be merged to Volume 1.

-splitSkip=V

Discards the volume V when working on multiple domains.

-mergeBC=BC1,BC2

Merges nodes of node-matching surfaces.


Table 15.13: Material Operations

-renameMat=OLD,NEW

Renumbers the specified material ID to NEW.

-renameMat=OLD,NEW,EQUATION

Same as -renameMat but where EQUATION is true.


Table 15.14: Periodicity Operations

-periodic[=tolerance]

Sets periodic flags on 4100, 4200, 4300s boundary condition, must be node-matching; also permits to double-check the accuracy of a grid periodicity.

-notperiodic

Removes periodicity in the output grid.

-periodicZone=4***

For -periodic, specifies the symmetry boundary condition number that is periodic.

-periodicPlanes=tolerance

Optionally used with -periodic, to refine the tolerance of a point on a plane.

-periodicTranslation=X,Y,Z

Specifies the translation vector.

-periodicClipPlane=[X|Y|Z],low,hi

Clips the periodic nodes on the given planes. Used with -periodic.

-periodicRotational=X/Y/Z,ANGLE

Specifies the axis of rotation and angle in DEG.

-periodicFix

For already periodic grids, will increase the periodic plane accuracy (periodicTranslation/Rotational argument required).

-clearPeriod=BC,BC,...

Removes periodicity on specified boundary condition list.

-prBC=BC1,BC2

Used with -periodicRotational/Translation, specifies boundary condition pairs to match. Boundary conditions are erased.


15.3.1.3. Examples

Table 15.15: Example Commands

convertgrid grid_bin grid_asc -ascii

Convert a grid to ASCII Format.

convertgrid grid_asc grid_opt -optimize2

Convert a grid to binary format, and reorder the node numbering for better performance. Nodal solutions, heat fluxes and so on are not useable with the reordered file as the node and facet order of the output file is different.

convertgrid grid_in grid_m -factor=0.0254

Scale a grid from inches to meters.

convertgrid grid_in grid_out -renameBC=2002,2000 -renameBC=2003,2000

Renumber a boundary condition identifier. (All facets of boundary condition 2002 and 2003 renamed to 2000).

convertgrid grid_in grid_out -renameBC=2000,2001,"Y>0"

Renumber a boundary condition identifier from a geometrical condition. (All facets of boundary condition 2000 for which the centroid is over Y = 0 coordinate will be renumbered as 2001).

convertgrid grid_multi grid_part -splitVolumes

Split a multi-volume grid into separate grids, grid_part.1 and grid_part.2 would be written.

convertgrid grid_multi grid_part -splitVolumes -splitSoln=grid_multi.soln -splitHFlux=grid_multi.hflux -splitShear=grid_multi.surface

Split a multi-volume grid and solution files into separate grid/solution files. (In addition to grid_part.X, grid_part.X.soln/hflux/surface will be written).


Table 15.16: Example Commands Continued

To add rotational periodicity onto a grid lacking periodicity information:

  • Grid provided with a single BC=4000 for both rotational periodic sides, the boundary condition is first split in two boundary conditions, the renamed boundary condition is based on the rotational coordinate THETA (grid is specified as rotating along the X axis, with the -rotx argument).

convertgrid grid_orig grid_bcsplit -renameBC=4000,4001,"THETA>0" -rotx

The two boundary conditions are now useable for periodicity node detection, which is a known 45 degrees rotation along the X axis.

convertgrid grid_bcsplit grid_periodic -periodicRotational=X,45 -prBC=4000,4001

FENSAP requires a rotational periodic grid (or non-axis-aligned translational periodic grid) to have periodic nodes, but no boundary condition facets (or a boundary condition 5000).

convertgrid grid_orig grid_bcsplit -renameBC=4000,5000 -renameBC=4001,5001

Renames the two temporary symmetry plane boundary conditions 4000 and 4001 to their final identifier 5000 and 5001 (periodic boundary conditions).


15.3.2. fluent2fensap

The Ansys Fluent case and solution file (.cas(.h5) and .dat(.h5)) can easily be converted to a FENSAP grid and airflow solution format.

15.3.2.1. Description

This operation is usually done within FENSAP-ICE by selecting a .cas(.h5) file as the grid input file. The import panels will provide the means to fine-tune the boundary conditions, reference conditions and solution field association.

The fluent2fensap process is fully automated and normally does not require adjustments.

Reference values are extracted from the Fluent configuration and written in the solution file header. The values in the solution file header are required only for:

  • Viewmerical Postprocessing:

    The calculation of the pressure coefficient requires PINF, TINF, VELINF. The calculation of the airflow Mach number requires RGAS, GAMMA. The calculation of the relative velocity components require RPMX, RPMY, RPMZ.

  • CHT3D Anti-Icing:

    Requires RGAS, GAMMA, VELINF.


    Note:  If the reference velocity value selected by fluent2fensap is not correct, it must be reset with the proper value, otherwise CHT3D will not be able to compute the correct surface temperature and heat fluxes.


15.3.2.2. Command Line Reference

fluent2fensap INPUT.cas OUTPUT [parameters]

Reads from the Fluent case file INPUT.cas (and optionally INPUT.dat, if in the same location), and write to the OUPUT prefix (OUTPUT.grid, OUTPUT.soln, etc.).

Table 15.17: Options

-d

Diagnostic mode. Does not write the output file but list its content (reference values, solution datafields, zones and boundary conditions).


Table 15.18: Icing Options

-roughness=FILE

If Fluent was configured with a roughness profile, typically obtained from ICE3D beading model in a previous FENSAP-ICE computation, it is required to apply the same roughness value in the airflow solution file converted from Fluent format. This argument permits to specify a roughness.dat file, with the roughness distribution. The roughness values will be inserted in the output airflow solution file written by fluent2fensap. The roughness information will be used by ICE3D, if the beading model is enabled.

A roughness.dat file related to the node number and ordering in the grid. If the Fluent grid has been remeshed, or reordered, the roughness.dat of the previous shot cannot be used as-is, and will need to be re-interpolated on the new grid: Use then the rough2rough tool.


Table 15.19: Output Files

-nosoln

Will not read a .dat(.h5) file nor write a soln file.

-ascii

Output FENSAP grid written in ASCII (default is binary).

-solid

Write a solid grid (for use with C3D).

-imat

Write a multi-material grid (for use with FENSAP/DROP3D and multiple domains). This is automatic if the Fluent grids have more than one cell section.


Table 15.20: Multi-Zone Options

-materials=ZONE,ZONE,ZONE

Optional. Provide a specific order for the material IDs.


Table 15.21: Solution Options

-rotVX=RPM

Convert a relative-frame solution to absolute.

-rotVY=RPM

Convert a relative-frame solution to absolute.

-rotVZ=RPM

Convert a relative-frame solution to absolute.

-rotabs

Indicate the solution is absolute frame. Use –rotVX/-rotVY/-rotVZ to specify the rotation speed which will be stored in the solution header (used for post-processing).


Table 15.22: Boundary Conditions

wall-6:2001 wall-7:2002 "inlet with spaces":1001 non-useful-internal-wall:0

Fluent boundary conditions are matched to suitable FENSAP boundary condition types and identifiers. The automatic behavior can be overloaded by using the ZoneName:BC syntax. Use quotes for zone names with multiple words separated by spaces. If the boundary condition identifier 0 is chosen, the facet zone will not be written. Refer to Boundary Conditions for details on boundary condition identifiers.


15.3.2.3. Reference Values

The reference values automatically detected from Fluent configurations can be replaced on the command line by using the VAR=VALUE syntax.

Table 15.23: The Following Values are Important

VELINF

Reference velocity (m/s)

TINF

Reference static temperature (K)

PINF

Reference static pressure (Pa)


Table 15.24: The Following Values are Optional

LENINF

Reference length (m)

VELX, VELY, VELZ

Components of the reference velocity (m/s)

RPMX, RPMY, RPMZ

Rotation speed (rpm)


Table 15.25: Variables with a Default Value

RGAS 287.05 GAMMA 1.4

(kJ/kg K, gas constant for air)


Table 15.26: Variables Continued

MACHINF, HINF, XKEINF, RHOINF, P0INF, ZMUINF, REINF, PRINFND, ENTRINF

Variables computed automatically from the other variables above.


15.3.2.4. Examples

Table 15.27: fluent2fensap Commands

fluent2fensap cht_ext.cas cht_ext

Writes chg_ext.grid (and cht_ext.soln, cht_ext.hflux, cht_ext.surface, if there is a check_ext.dat in the same directory).

fluent2fensap cht_ext.cas cht_ext TINF=265.3

Same as above, however the reference temperature read from the file is adjusted to 265.3 K.

fluent2fensap cht_solid.cas cht_solid wall-6:6100 -solid

Writes the output file in a format compatible with C3D. The wall-6 surface is converted to a heater boundary condition (range 6000-6999).


15.3.3. fensap2fluent

This tool permits to convert a FENSAP grid into the Fluent grid format. The file will contain only the grid and boundary condition types, no solver settings are written.

15.3.3.1. Description


Important:  Some grids with periodicity will be converted to a Fluent file with invalid shadow zone surfaces, and Fluent might fail to read them. In such a case, the suggested approach is:


  • Convert the grid using the –noperiod option or prepare an input grid with convertgrid INPUT OUTPUT -notperiodic.

  • Rotational periodicity: Operations required in Fluent after the conversion.

    • For each cell zone: Set-up the rotation axis.

    • For each facet periodic zone: Set up the periodicity type as rotational.

  • Translational periodicity : No operation required.


    Note:  A Check Mesh operation in Fluent can confirm the grid periodicity is correctly set up.


15.3.3.2. Command Line Reference

Table 15.28: General Commands

fensap2fluent grid soln -out=OUT [options]

Read the FENSAP format grid and airflow solution soln, and writes to OUT.cas and OUT.dat.

fensap2fluent grid -nosoln -out=OUT [options]

Grid-only conversion. Reads the file grid, and writes to OUT.cas.


Table 15.29: Input File Options

-solid

Reads a C3D solid grid file format.

-read=FILE.cas

Reads a reference case file, some options (solver settings, zone numberings) will be copied in the new output .cas(.h5) file. This might result in an incomplete Fluent configuration.

-modifyNodes=FILE.cas

Reads a reference case file and writes it as output, with the only modification being the XYZ coordinates of the nodes, read from the input FENSAP grid. This is used to displace the nodes after ICE3D ALE grid displacement.

-h5Writes a .cas.h5 file.

Table 15.30: Output File Options

-ascii

Fluent file will be written in ASCII.

-noperiod

Disable periodicity writing.


15.3.4. cfx2fensap

cfx2fensap is a tool introduced in FENSAP-ICE 2015R1.0 to enable automatic conversion from CFX .res format to FENSAP grid and airflow solution formats. General usage is similar to fluent2fensap.

15.3.4.1. Description

This operation is usually done within FENSAP-ICE, by selecting the .res file as the grid input file for a run. The import panels will allow fine-tuning of the boundary conditions, reference conditions and solution field associations. In FENSAP-TURBO simulations, multi-row grids can be separated and automatically configured in FENSAP-ICE.


Note:  CFX must be installed on the machine where cfx2fensap is launched, and the cfx5cmds tool is accessible, either via a global execution path, or the command line below.

-cfxPath=/path/

Used to indicate the path of the bin/ subdirectory of the current installation of CFX.


Alternatively, if a CCL appears alongside the input .res file, CFX is not required to reside on the execution machine. (FILE.ccl alongside FILE.res) The CCL can be generated in the following way.

  • From CFX-Pre:

    FileExportCCL → select all objects.

  • cfx5cmds - read -definition INPUT.res -text INPUT.ccl

    Generates a CCL from a command line.

15.3.4.2. Command Line Reference

cfx2fensap INPUT.res OUTPUT [options]

Reads from the CFX solution file INPUT.res, and writes to the OUTPUT prefix (OUTPUT.grid, OUTPUT.soln, etc.).

Table 15.31: Output Options

-zone=N

Extract a subzone of the grid (1-N), only, for example, a turbofan stage, or a single material.

-split

Write all subzones of the grid to different OUTPUT.ZONENAME files. Used for turbo-fan grid, separated in multiple rows.

-hflux -shear

Write hflux and shear stress facet-based files.

-solid

Write a solid grid (for use with C3D).

-notperiodic

Write a grid without considering its periodicity (translational or rotational).

-roughness=FILE

Specify a roughness.dat file from a previous ICE3D execution on this grid. The roughness data will be appended to the converted airflow solution in FENSAP format. This is done automatically at each shot (except the first) of a Multishot-CFX simulation.


15.3.4.3. Boundary and Reference Conditions

Boundary Conditions:

CFX boundary conditions are matched to suitable FENSAP boundary condition type and identifiers. The automatic behavior can be overloaded by using the ZoneName:BC syntax. Use quotes for zone names with multiple words separated by spaces.

If the boundary condition identifier 0 is chosen, the facet zone will not be written. Refer to Boundary Conditions for details on FENSAP boundary condition identifiers.

Table 15.32: Boundary Condition Identifier

Wall1:2001 Wall2:2002 "inlet with spaces":1001 non-useful-internal-wall:0

Boundary Condition Identifier at 0.


Reference Conditions

The detection is done automatically from the CFX settings and flow solution, but should be reviewed in the output log.

  • The reference velocity and reference temperature are the average quantities of the airflow velocity and static temperature distributions at the inlet of your CFD solution. For multi-domain solution files:

    • in -zone-N mode, the reference values are computed at the inlets of the selected domain,

    • while in default or -split mode, the reference conditions are computed at the global inlets of the multi-domain.

  • The reference pressure is taken from the Reference Pressure field located in the Domain panel of CFX as long as its value is non-zero. If the Reference Pressure in CFX is set to zero, the reference pressure used during conversion is set to 101,325 Pa.

CHT3D/CFX requires proper reference condition values in the FENSAP solution file.

Refer to fluent2fensap.

15.3.5. Conversion from FENSAP to CFX

The automatic conversion of a FENSAP grid file to CFX format is not natively supported. Instead, the FENSAP file is to be converted to a Fluent file using fensap2fluent and then the new Fluent mesh is read by CFX-Pre.

An existing CFX-Pre configuration can be updated from a new, compatible, mesh if the original mesh is overwritten and the FileReload Mesh Files option is chosen.