5Meshing and Geometry
Table of Contents
5.1Constructing Geometry
5.1.1Geometry Methods in FLOW-3D
Generate Primitives Using the FLOW-3D Solids Modeler
Importing I-DEAS Universal Files
Importing STL Files
Importing ANSYS Tetrahedral or Surface Triangle Files
Importing Topographical Data Files
Operations on Geometry (Limiters and Transformations)
Limitations Associated with Geometry Generation
5.1.2Constructing Geometry Using the GUI
Creating Geometry
Transformation Options
Modifying Geometry in the Tree Structure
Creating and Modifying Baffles
Deleting Geometry
5.1.3Constructing Geometry Using the Text Editor
Applying Limiters
Applying Transformations
Copying Components
Virtual Components
Zero Blockage Obstacles
Component Properties
5.2Mesh Building
5.2.1Meshing Basics
Definitions
5.2.2Mesh Building Mechanics
General
Mesh Building in the Workspace
Mesh Building in the Tree Structure
Mesh Building in the Text Editor
Mesh Tips and Rules of Thumb for Mesh Generation
5.3Reviewing the FAVORized Geometry and Mesh
FLOW-3DFlow Modeling Software
5.1Constructing Geometry
Geometry is constructed in FLOW-3D by assembling solid geometric "objects" or components which, when combined, define the flow region for a simulation. The flow geometry is then embedded in the computational grid by the preprocessor which computes the fractional areas of the grid cell faces open to flow and the corresponding fractional volumes of the cells that are open. This technique, referred to as FAVOR™, short for Fractional Area/Volume ObstacleRepresentation, offers a simple, accurate way to avoid "stair-step" boundaries and gives a good geometric description even in relatively coarse grids.
The FAVOR™ method allows complex geometries to be embedded in the computational mesh by computing the area fractions (AFT, AFR, AFB) on the cell faces along with the volume fraction (VF) open to flow.
Definitions
There are two key definitions for geometry construction: Components (known in earlier versions of FLOW-3D as Obstacles) and Subcomponents (formerly known as Regions).
Components—represent the portions of a given simulation that will share common properties and initial conditions. Components have specific properties (e.g., thermal conductivity, porosity and roughness) that distinguish them from each other. A component may not necessarily be a continuous entity. For example, two unconnected spheres can be defined as one component consisting of two spherical subcomponents.
Subcomponents—represent solid objects, holes and complements within a given component, and are made up of imported STL or other files, or FLOW-3D primitives.
A simulation can have multiple components, and each component may consist of multiple subcomponents. Components can be constructed by defining a single subcomponent or, for more complex flow regions, by adding and subtracting a series of subcomponents. A single component is shown below. The component is comprised of one solid spherical subcomponent and one cylindrical subcomponent created as a hole. The left image shows the geometry in Boolean view (View / Boolean) and the right image is shown after application of the Favorizer tool.
Boolean ViewFAVORized view
5.1.1Geometry Methods in FLOW-3D
Specification of flow region geometry can be accomplished using two methods. One approach is to construct the geometry graphically in the Workspace using the GUI. The other approach is to enter the proper information in namelist OBS in the input file using the Text Editor (Utilities > Text Editor in the GUI’s main menu).
There are five basic methods for defining subcomponents in a FLOW-3D computational grid: primitives generated by the FLOW-3D solids modeler, I-DEAS universal files, Ansys tetrahedral files, stereolithography (STL) files, and topographical data files. In the input file (prepin.*), the selection is governed by the variable IGEN(L). Combinations of the five methods can be used to define a component. The following discussion describes these five methods in more detail.
Note:In FLOW-3D, geometry is always interpreted in Cartesian coordinates even if the grid has been defined in cylindrical coordinates.
Geometry files with spaces in the file name (such as “part one.stl”) cannot be used by the FLOW-3D solver. Change the file name before importing the file, to eliminate the space.
Generate Primitives Using theFLOW-3D Solids Modeler
The FLOW-3D solid modeler is based the definition of regions in terms of quadratic functions. It can be used to quickly and easily construct geometry. Since quadratic functions include such primitive shapes as spheres, cylinders, cones, ellipsoids and toroids, this modeler can be described as one based on primitive shapes; but quadratic functions actually have more generality. The essential idea is to define a subcomponent by specifying the coefficients of the general quadratic function:
F(x,y,z) = CX2•x² + CY2•y² + CZ2•z² + CXY•x•y + CXZ•x•z + CYZ•y•z + CX•x
+ CY•y + CZ•z + CRXY• + CC
where x, y and z are Cartesian coordinates with the same origin and units used to define the grid.
By convention, the subcomponent consists of the region where the function F(x,y,z) evaluates to a negative value. Changing the sign of all coefficients will, therefore, define the complementary subcomponent.
Subcomponents are defined where the function F(x,y,z) is less than zero.
Additionally, by setting IOH (L)=0, the subcomponent becomes a hole where F < 0.
The default value for all coefficients is zero, except for the constant term CC, which defaults to a very small negative number. This setting allows one to simply use the coordinate limiters to define simple shapes (e.g., blocks, cylinders and spheres) without having to set any function coefficients. When combined with scaling, translations and rotations, this feature becomes quite powerful.
Importing I-DEAS Universal Files
FLOW-3D users can import CAD data generated in the form of tetrahedral elements. The only data needed by FLOW-3D are the node coordinates and the connectivity (see the figure below). This data is assumed to be in SDRC's Universal File format from its I-DEAS program, but other formats could also be accommodated. The pre-processor reads the file specified by FIDEAS(L)='filename'. The default filename is "cadfnn.inp" where nn is a two-digit representation of the subcomponent number L.
All defined subcomponents can have coordinate limiters as well as translations and rotations applied to them.
Typical Tetrahedral Element
Importing STL Files
Most CAD vendors have developed interfaces to convert solid models into a format used for stereolithography. This format is known as the stereolithography, or STL, format. Files written in this format usually have extension <file>.STL.
In the STL format, the solid object surface is approximated by triangles. Vertex coordinates and the facet normal for each triangle are stored in the STL file. The normal is used to distinguish the interior from the exterior of the object. Specifically, the unit normal always points away from the object. All coordinates are defined in a Cartesian coordinate system.
The object to be approximated must be represented by closed surfaces, each unambiguously defining an enclosed volume. That is, the model data must specify the inside, outside and boundary of the object.
An STL file can be either ACSII or binary. The ASCII format file is usually substantially larger than the binary file but it allows the user to see the data and modify it if need be. The general outline of the ASCII format is shown below:
solid <object name>
facet normal -1.0 0.0 0.0
outer loop
vertex 1.0 1.0 1.0
vertex 1.0 1.0 2.0
vertex 1.0 2.0 1.0
endloop
endfacet
facet normal 0.0 -1.0 0.0
outer loop
vertex
endloop
endfacet
endsolid <object name>
Each file section starting with facet normal ... and ending with endfacet describe one triangle. The first and last lines of the file contain an optional title for the object. The order in which the triangles are listed is unimportant.
Triangle is defined by vertex coordinates and the normal n.
FLOW-3D can import both the ASCII and binary STL format. The format type is detected by the pre-processor automatically. STL input data is requested in PREPIN.INP file in namelist OBS in a similar way as it is done for the I-DEAS CAD data. Namely, if subcomponent number L is to be defined by STL data, then the following input has to be specified
IGEN(L)=3
The corresponding input file is specified using FSTL(L)='filename'. The default filename is "stlfnn.inp", where nn corresponds to the subcomponent number, e.g., for L=1 nn=01 and for L=12 nn=12.
The main requirement for the surface defined in each file is that it be closed. Each file can contain more than one closed surface. The total number of triangles in each STL file is unlimited.
Once the STL input has been defined, the specified surface can be manipulated in the same way as any other region, that is:
- Spatial limits can be imposed;
- The surface can be scaled, rotated and translated; scaling is useful for unit conversion;
- The surface can be combined with other geometrical input to create a complete component, e.g., holes can be created in the object defined by the surface or the object itself can define a hole in a previously defined object;
- Physical properties can be assigned to each component (in general consisting of several subcomponents) individually.
Each triangle is processed only once in the order they appear in the STL file, so the CPU time is linearly proportional to the number of triangles. The processing time is also linearly proportional to the number of cells in the grid. Calculations for each triangle only involve those mesh cells that lie in the vicinity of the triangle. Because of the linear dependencies on the number of triangles and the number of grid cells this interface routine is especially efficient.
The final shape of the obstacle depends on the mesh specified by the user. If the object surface has sharp edges, concave or convex, then a multiple intersection is likely to occur, that is, when a mesh line segment between two neighboring nodes intersects more than one triangle. In that case the corresponding cell edge is assumed to be either fully inside the object, as shown above (top) or fully outside it, as shown above (bottom).
FLOW-3D’s interpretation of multiple intersections:
Original shape is shown on the left and the resulting shape on the right.
Importing ANSYS Tetrahedral or Surface Triangle Files
Ansys tetrahedral or surface triangle data may also be imported. The data needed by FLOW-3D are the node coordinates and the connectivity. When using Ansys input, the pre-processor reads two files: one specified by FANSEL(L)='filename' (element connectivity data) and one specified by FANSND(L)='filename' (nodal coordinates data). The default filenames are "cadenn.inp" and "cadnnn.inp" where nn is a two-digit representation of the subcomponent number L.
Importing Topographical Data Files
Imported topographic data files must be in ASCII format. The FLOW-3Dtopographic reader automatically converts the topographic data to STL data, and then processes this data to create geometry in the FLOW-3D mesh. The STL data is stored in file stlfnn.inp, where "nn" is the subcomponent number for the topographic data. If this geometry is to be used for additional runs, the STL data in file stlfnn.inp may be read in directly to save time during pre-processing.
The actual format of the file is set in subroutine RDTOPO. This subroutine may be modified by the user to accommodate a wide variety of topographic file formats. The standard format expects two title lines at the top of the topographic file, followed by the actual topographic data (one location per line) written as:
x-coordinate y-coordinate z-coordinate
in free format. The x and y coordinates may be random, and do not need to be in a regular grid. These coordinate locations are assumed to represent a top surface (in the z-direction), and therefore, only one z coordinate is allowed for any given x and y location.
When importing topographical data, the pre-processor reads the file specified by FTOPO(L)='filename'. The default filename is "topofnn.inp" where nn is a two-digit representation of the subcomponent number L.
Operations on Geometry (Limiters and Transformations)
The user has more control over components and subcomponents than the simple choice of addition or subtraction. Limiters are powerful in that they allow users to modify basic objects such as blocks, cylinders, and spheres to create more complex objects. Once defined, these objects can be scaled, translated and rotated to a desired location and size.
Limitations Associated with Geometry Generation
The FAVOR™ method is very powerful, but it is important to recognize that it is limited by the resolution of the computational grid. For example, the pre-processor generates area fractions for each cell face in a grid by first determining which corners of the face are inside and which are outside of a defined subcomponent. If all four corners of a cell face are inside the subcomponent, then the entire face is defined to be within the subcomponent. Similarly, if all corners lie outside, then the entire face is assumed to be outside the subcomponent.
The implication of this construction is that any piece of a subcomponent extending across a cell face, but not including a corner of that face, is not recognized by the area fraction generator. For instance, a small spherical subcomponent (say smaller than a mesh cell) will not be recorded unless it covers at least one grid vertex (see figure below).
When some face corners are inside a subcomponent and some are outside, the area fraction generator computes the intersection of the subcomponent with the face edges. Area fractions are then computed from these intersection points assuming straight-line connections between intersection points within the face. This assumption may introduce a small error in the fractional area when the subcomponent boundary is curved within the face. The approximation improves as the grid resolution is refined.
Exact areas are usually essential only when trying to model precise inflow and outflow areas at the boundaries of the grid. To help the user in this regard, the pre-processor summary file (PRPOUT) and the report file contain summaries of the computed open areas at each boundary of the grid.
Additionally, the pre-processor generates plots along each coordinate axis, where the open area in the plane perpendicular to the axis is plotted versus the axis coordinate.
5.1.2Constructing Geometry Using the GUI
The FLOW-3DGUI enables users to create or import geometry, as well as modify it, interactively, in the Meshing & Geometry panel of the Model Setup tab.
Creating Geometry
In the GUI, users can create geometry using FLOW-3D’s solids modeler or by importing geometry files, as discussed above. Components and subcomponents are created by starting from the Subcomponent Menu. In addition, FLOW-3D primitives can be created by clicking on the appropriate icon in the toolbar.
Subcomponent Menu / Subcomponent ToolbarWhen a new component is created, the user is required to specify its Type (Standard, Porous or Lost Foam):
The dialog box shown above appears after the initial selections for the first subcomponent are made (as described in the table below). Each time a new subcomponent is created, the user may choose to assign it to an existing component or to create a new component:
Each time a new component is created, the Type and Potential for that component must be assigned.
The following is a description of the operations possible through the Subcomponent menu:
Sphere/ To create a sphere subcomponent, select Sphere in the Subcomponent Menu (or click on the sphere icon in the toolbar). The following dialog appears:
In the Radius box, specify the radius that the sphere is to have.
By default, FLOW-3D creates subcomponents as Solid objects. To change the type to Hole or Complement, click on the Transform button at the lower left corner of the dialog box. Other transformations (translation, rotation and magnification) can also be performed there, as described below in Transformation Options.Click OK to create the sphere. Cancel will stop the creation process and close the dialog.
Cylinder
/ To create a cylindrical subcomponent, select Cylinder in the Subcomponent Menu, or click on the cylinder icon in the toolbar. The following dialog box appears:
In the Radius box, specify the radius that the cylinder is to have. The height of the cylinder must also be defined by specifying Z Low and Z High in the appropriate boxes (Note that although the cylinder is oriented on the Z axis here, it can be rotated any direction via the Transform option).
By default, FLOW-3D creates subcomponents as Solid objects. To change the type to Hole or Complement, click on the Transform button at the lower left corner of the dialog box. Other transformations (translation, rotation and magnification) can also be performed there, as described below in Transformation Options.
Click OK to create the cylinder. Cancel will stop the creation process and close the dialog.
Cone
/ To create a conical subcomponent, select Cone in the Subcomponent Menu or click on the cone icon in the toolbar. The following dialog box appears:
In the Angle box, set the angle that the cone is to have. Set its height in the Height box. The assigned height will be recorded as Z low (the point of the cone will be at 0 and the base at the Z low number assigned as the height).
By default, FLOW-3D creates subcomponents as Solid objects. To change the type to Hole or Complement, click on the Transform button at the lower left corner of the dialog box. Other transformations (translation, rotation and magnification) can also be performed there, as described below in Transformation Options.