SetSet

From OpenFOAMWiki

1 Name

setSet - Manipulate a cell/face/point/ set or zone interactively.

Valid versions: OF Version 21.png

2 Synopsis

setSet [OPTIONS]

3 Description

setSet is a command-line utility that collects points, faces and cells in sets, based on different criteria, for later usage with different other utilities like subsetMesh. The defined sets are written in VTK format in the case folder (except if the option -noVTK is specified).

The syntax used by setSet is described below.

-batch FILE

Process in batch mode, using input from specified file

-loop

Execute batch commands for all timesteps

-noSync

No synchronised selection across coupled patches

-noVTK

Skip writing the VTK files

-noZero

Exclude the 0 directory from the times list

-time RANGES

Select time steps. RANGES follows the time selection rules

-latestTime

Apply only on the latest time available

-constant

Include the constant directory in the times list

-parallel

Run the utility in parallel

-roots "(DIR1 [...DIRN])"

Directories through which the data are distributed

-region NAME

Specify a mesh region by its NAME

-case DIR

Execute the command on the case directory DIR. If not provided, use the current directory

-noFunctionObjects

Skip the execution of the functionObjects

-help

Display the help and exit

This utility is used in the following tutorial:

  • lagrangian/reactingParcelFilmFoam/cylinder

4 Command line usage

In command-line, setSet understands 5 commands:

  • help: Print out a help describing the structure of a set-command
  • list: Show all currently defined sets and zones based on cells, faces and points.
  • time double: Switch to the provided time step
  • quit: Exit setSet
  • a set-command: create/modify/remove a cell/face/point set or cell/face/point zone

The structure of a set-command is

typeSet|typeZoneSet setName action
  • type is the type of entity you want to select:cell, face or point
  • setName name of the set you want to create/modify/remove
  • action can be
    • list: Print the coordinates contained in the set
    • clear: Clear the set (clear its content)
    • invert: Invert the set (select all entities of the mesh that where not in the set)
    • remove: Remove the set
    • new source: Set the set using the prescribed source
    • add source: Add the entities select by the source to the set
    • delete source: Delete the entities select by the source from the set
    • subset source: Combines the current set with the entities selected by the source

The sources available depend on the type of entities. An exhaust list of the sources is available within the documentation of topoSet.

Here are some examples provided in the official help:

  • Pick up all faces of patch:
faceSet f0 new patchToFace movingWall
  • Add faces 0,1,2:
faceSet f0 add labelToFace (0 1 2)
  • Pick up all points used by faces in faceSet f0:
pointSet p0 new faceToPoint f0 all
  • Pick up cell which has any face in f0:
cellSet c0 new faceToCell f0 any
  • Add cells which have any point in p0:
cellSet c0 add pointToCell p0 any
  • List set:
cellSet c0 list
  • Zones can be set using zoneSets from corresponding sets:
cellZoneSet c0Zone new setToCellZone c0
faceZoneSet f0Zone new setToFaceZone f0

5 Usage example

Valid versions: OF version 15.png

Following is an example of the usage to fix an imported mesh that has small faults.

Figure 1. Domain overview

Running checkMesh on this geometry:

foamJob -s checkMesh -allTopology -allGeometry

generates some warnings and errors, but most important, several sets: cellZone_1, cellZone_2, concaveFaces, edgeFaces, nearPoints, nonOrthoFaces, skewFaces, undedeterminedCells, warpedFaces, wrongOrientedFaces. The next step is to collect all the cells that contain any of the concave faces, incorrect edge faces, warped faces, wrong oriented faces, or cells with a very small determinant:

foamJob -s setSet -constant
Command>list
Command>cellSet bubu new cellToCell underdeterminedCells any
Command>list
Command>cellSet bubu add faceToCell concaveFaces any
Command>cellSet bubu add faceToCell edgeFaces any
Command>cellSet bubu add faceToCell warpedFaces any
Command>cellSet bubu add faceToCell wrongOrientedFaces any
Command>cellSet bubu invert
Command>cellSet bubu subset
Command>quit

Last step is to remove the collected cells:

foamJob -s subsetMesh bubu