Gridgen经典培训教程PPT课件

上传人:s9****2 文档编号:567688603 上传时间:2024-07-22 格式:PPT 页数:273 大小:12.73MB
返回 下载 相关 举报
Gridgen经典培训教程PPT课件_第1页
第1页 / 共273页
Gridgen经典培训教程PPT课件_第2页
第2页 / 共273页
Gridgen经典培训教程PPT课件_第3页
第3页 / 共273页
Gridgen经典培训教程PPT课件_第4页
第4页 / 共273页
Gridgen经典培训教程PPT课件_第5页
第5页 / 共273页
点击查看更多>>
资源描述

《Gridgen经典培训教程PPT课件》由会员分享,可在线阅读,更多相关《Gridgen经典培训教程PPT课件(273页珍藏版)》请在金锄头文库上搜索。

1、mIn this session:mGridgen Terminology.mGUI Components.mGridgen Help.mBuilding 2D Structured Grids.mBuilding 2D Unstructured Grids.mTutorial: “2D Bump: Basic Skills.”GridgenTrainingOverview1Whats an Entity?An entity is any individual element that makes up part of a grid or geometry. Gridgen Terminolo

2、gyDomainsBlocksConnectorsExamples of Gridgen entities2ConnectorsGridgen TerminologyConnectors are the curve entities that define all grid edges.Connectors contain one or more segments.Nodes mark connector endpoints.Control Points let user define segment shape.Connectors are dimensioned by number of

3、grid points with a distribution describing how they are placed.3DomainsGridgen TerminologyA Domain is a surface grid entity bounded by edges.Structured Domains consist solely of quadrilateral elements.Unstructured Domains consist solely of triangular elements.Structured Domains have exactly four edg

4、es.Unstructured Domains generally have one edge (more if they the encompass holes).Each edge contains one or more connector(s).4BlocksGridgen TerminologyA Block is a volume grid entity bounded by faces.Structured Blocks consist solely of hexahedral elements.Unstructured Blocks can consist of tetrahe

5、dral, pyramidal, and/or prismatic elements.Structured Blocks are bounded by exactly six faces.Unstructured Blocks generally have one face (more if they encompass holes).Each face contains one or more domain(s).5GridsA Grid is composed of volume and/or surface grid blocks.Structured Grids contain onl

6、y quadrilateral and hexahedral elements.Unstructured Grids contain only triangular and tetrahedral elements.Hybrid Grids (such as that shown here) contain both structured and unstructured grid elements (quads, triangles, hexes, and tets) and can also have prismatic and pyramidal elements.Gridgen Ter

7、minology6DatabasesmIn Gridgen, databases refer to collections of geometry information that can be used to define the shape to which the grid is to be built and typically come from computer aided design (CAD) software:mAnalytic curve and surface information from a CAD file.mShell discrete unstructure

8、d database surface entity, generally imported from stereolithography (STL) formatted files.mNetwork bilinear (non-slope continuous) database surface entity, generally imported from Plot3D formatted files.mOf course, databases are not necessary to build grids with Gridgen, but are often needed for im

9、porting complex geometries. Gridgen Terminology7The Gridgen ScreenGUI ComponentsVersionLists Gridgen version numberStatusTallies number of grid entitiesMessageProvides instructions and prompts for text inputText InputEchoes data entered via keyboardBlackboardDisplays context-sensitive graphical and

10、tabular data(aka Diagnostic or Browser window)Command MenuLists Gridgen Commands(aka Button Menu)DisplayShows graphical image of grid and database8The Mouse: Pan, Zoom, and PickLeft Mouse Button: PanPress and hold the left mouse button to pan the model image in the display window. While panning, the

11、 mouse cursor changes to:Center Mouse Button: ZoomPress and hold the center mouse button to change the model images size, pushing the mouse away from you zooms out while pulling it towards you zooms in. For mice with a center wheel, the wheel can be rolled or held down to control zoom. On two button

12、 mice, zooming is accomplished by holding both buttons down. While zooming, the mouse cursor changes to:Right Mouse Button: PickPress and release the right mouse button to select commands from the command menu or pick entities in the display window or browser list. While picking, the mouse cursor ch

13、anges to:GUI Components9Some Mouse OptionsGUI ComponentsThe functions of the left and right mouse buttons can be reversed, so that left is for picking and right is for panning. This can be done by selecting LeftPk.When dealing with smaller geometric entities, it may also be desirable to reduce the m

14、ouse sensitivity in panning, zooming, and rotating the screen image. This can be done by clicking on the button (more clicks, less sensitivity). You may wish to change some of the default mouse settings. These can be accessed by selecting the Display or Disp submenu from Gridgens MAIN MENU. 10Model

15、RotationsYXZScreenCoordinatesBodyCoordinatesGUI ComponentsmGridgen has two distinct coordinate systems: screen coordinates and body coordinates.mIn addition to panning, zooming, and picking, the mouse buttons can also be used to rotate the model screen image. This is done by combining the left and c

16、enter mouse buttons with the Ctrl key:mCtrl + left mouse button: screen x and y rotations.mCtrl + center mouse button: screen z rotations.11Model Rotations (Continued)mFor more precise rotation control, the following numpad keys can be used:m7 rotates about the x screen axis.m8 rotates about the y s

17、creen axis.m9 rotates about the z screen axis.mNum Lock rotates about the x body axis.m/ rotates about the y body axis.m* rotates about the z body axis.mAdditional rotation features can be accessed with the following “hot keys”:mPage Down used with any of the x-y-z body/screen keys results in a 90 d

18、eg. rotation about the corresponding coordinate direction.mPage Up used with any model manipulation, whether by mouse or keyboard, provides 3x acceleration of the operation.m+ and numpad keys reverse the direction of a keyboard model rotation.mAlt used with a numpad model rotation gives a single inc

19、rement (3 deg.) rotation.GUI Components12Commonly Used Hot KeysGUI ComponentsNote: Hot keys for Gridgen commands are shown as pink characters on the corresponding GUI buttons.13File BrowsingSelecting Input/Output from the MAIN MENU opens the INPUT/OUTPUT COMMANDS submenu from which (in this example)

20、 the INPUT Gridgen FILE submenu has been selected.The Browser Window shows the appropriate contents of the current working directory. The mouse can be used to scroll through and select from list.Selecting Type in Name allows you to type in a filename for import or export, while Type in Dir lets a ne

21、w working directory to be set.Selecting Go to Dir (/ in Unix) will provide list of available drives to change to as current working directory, while Go to Dir Orig changes the working directory back to the original directory where Gridgen was opened.GUI ComponentsOnce file has been selected, Open is

22、 clicked.14File Browsing (Continued)mUpon entering the Type in Name mode, the text input window will echo the filename entered via the keyboard. Once the name is entered, the Enter key on the keyboard or Open button in the GUI must be clicked. mThe esc key can be used to exit from text input.mNo oth

23、er commands or manipulations are available while in this mode.mGlyph expressions are valid. GUI Components15Gridgen File NamesmGridgen Restart Files (.gg) contain entire grid models from control point definitions through boundary condition settings. They only reference database information.mComposit

24、e Database Files (.dba) store, in Gridgens native database model format, data from all database sources, as well as database entity display attributes and layer information.GUI Components16Gridgen HelpGridgen HelpmGridgens html-based help can be accessed from virtually any menu within the program by

25、 either mouse clicking on the Help button or entering ? From the keyboard.mThis help documentation is equivalent to the User Manual and automatically opens to the pertinent section relating to the operation or mode currently in use within Gridgen. For example, the window at the left opens when help

26、is called upon from the opening I/O menu.17Building 2D Structured GridsBuilding 2D Structured GridsBeginning with the airfoil database geometry below, the hybrid grid shown at the right will be constructed using Gridgen, starting with the 2D structured block at the top. 18The “Bottom-Up”Gridgen Proc

27、essBuilding 2D Structured GridsSelect Analysis Software and Mesh DimensionalityImport and Manipulate Database GeometryCreate Segments and ConnectorsDimension Connectors and Distribute Grid PointsAssemble DomainsAssemble BlocksSetup CFD Analysis BoundariesExport and Save Files19Select Analysis Softwa

28、reThe first step in any Gridgen project is the selection of the CFD analysis software and the dimensionality (2D vs. 3D) of the mesh being constructed. In the MAIN MENU, Analysis S/W is chosen to bring up the corresponding commands menu. Select Analysis S/W is then clicked, which brings up the fairl

29、y lengthy list of supported CFD packages.For this example, 2D and the default generic solver will be selected via mouse clicks. Once these selections are made, the Next Page button is clicked to bring up the second half of the supported software list so the Done button at the end of the list can be

30、selected to confirm the choices.Building 2D Structured Grids20Set DefaultsBuilding 2D Structured GridsAlthough not essential, setting default values for some items, such as connector dimension, can save time during the mesh construction process. In the MAIN MENU, Defaults is chosen to bring up the d

31、efaults menu. Note: Another way to bring up the defaults menu is to select the Dflt quick key.The blackboard window shows the current default settings, e.g., the default connector dimension (Conn Dimens) is 0. This can be changed by selecting the appropriate button below.This activates the text inpu

32、t window. For the present example, type in 36 and then hit Enter to store it. The blackboard window will show the new value. Click Done to finish setting defaults.21Import Database GeometryBuilding 2D Structured GridsNext, the database file containing the airfoil geometry will be imported.In the MAI

33、N MENU, Database is chosen to bring up the corresponding commands menu. Note: As an alternative, the f hot key on the keyboard could be used.Import is then selected to bring up the INPUT DATABASE FILE submenu.The browser window shows the available database (.dba) files in the current working directo

34、ry. The desired file can then be picked with the mouse (changing the name from pink to black in color). Click on Open to read the file into Gridgen and then Done in the DATABASE COMMANDS menu to return to the MAIN MENU.22Create ConnectorsBuilding 2D Structured GridsIts now possible to start building

35、 the connectors that will make up the edges of the grid. The first connector will match the upper contour of the airfoil.In the MAIN MENU, Connectors is chosen to bring up the corresponding commands menu. Since there are no connectors yet, only the Create command is available in the CONNECTOR COMMAN

36、DS menu. Select this to open the Create Connector submenu There are three ways to build a connector: individual curve segments can be created and linked together, two endpoints can be chosen to form a connector between them, or a connector can be laid down upon a database entity. This last option wi

37、ll be picked here.23Create Connectors (Continued)The blackboard window shows the available database entities. The mouse can be used to pick entities from this list or directly from the display window. Once selected, the table entry and the connector in the display change from pink to black in color.

38、 Clicking on Done completes the process. Because the default dimension has been set, the new connector appears in pale green (if undimensioned, it would have been bright green).Building 2D Structured Grids24Create Connectors (Continued)The remaining connectors needed to form the edges of the mesh wi

39、ll be created with the 2 Point Connectors option. Each CP can be selected from the display via the mouse or entered via the keyboard. For each new connector, Gridgen initially positions the display cursor at the last endpoint of the previously defined connector. Here, all but the last connector have

40、 been defined, and the display cursor is positioned at that connectors trailing endpoint. The trailing endpoint for this last connector is also the leading edge endpoint for the connector applied to the airfoils upper surface. It can be selected by repositioning the display cursor and using by Picki

41、ng or by entering its coordinates via Keyboard. Again, clicking Done finishes the job.As this is the desired starting point of the last connector, it will be selected via by Picking.Building 2D Structured Grids2,0,02,1,0-1,1,0-1,0,025Create Connectors (Continued)With the last connector completed, cl

42、ick on Done Creating Conns in the CREATE CONNECTOR menu (or just hit the corresponding hot key, esc). Next, to see the grid point distribution, toggle Con GPs in the display menu (or hit the hot key combination a c). As shown, its clear that there are far more grid points along the bottom edge than

43、the top (since there are three connectors below to the one above, but each with the same default dimension). This has to be corrected before the domain can be built.Building 2D Structured Grids26(Re)Dimension ConnectorsBuilding 2D Structured GridsIn the CONNECTOR COMMANDS menu, select Redimension Gr

44、ids. This will allow the top connector to be picked in the dis- play window via the mouse, and its new dimension to be entered via the key- board. In this case, 106 is that new dimension (while each of the three bottom connectors has 36 grid points, the center one shares one of its endpoints with ea

45、ch of its neighbors reducing the total for the edge by 2). Once Enter has been picked, Done-Apply New Dims is clicked to finish.27(Re)Distribute ConnectorsIts also possible to alter the distribution of grid points along connectors. This will be discussed in more detail later.Under CONNECTOR COMMANDS

46、, pick Set s Vals. Select subconnector(s) for which the distribution is to be reset. Then, Select Done. The new s value can then be entered and applied. s = 0 s = 0.01Building 2D Structured GridsIn the present example, the grid points will remain evenly distributed.28Assemble DomainsBuilding 2D Stru

47、ctured GridsAll is now ready to assemble the connectors into the four edges that will bound the domain of the mesh. In the MAIN MENU, pick Domains to switch to that menu. Next, select the Create command to begin building the new domain.Be sure that structured cell type is chosen, then pick Assemble

48、Edges.A domain schematic will appear, as will several choices. Ensure that Auto Next Edge is off, and Auto Complete is on.29Assemble Domains (Continued)Building 2D Structured GridsThe first edge will consist of the three bottom connectors. The mouse is used to select these in turn from left to right

49、 the picture here shows the scene after the first two have been picked with the mouse cursor poised to select the third. Once this connector has been added, Next Edge is selected to tell Gridgen the edge is complete. The mouse is then used to select the connector on the right side of the domain to b

50、e. When Next Edge is again selected after that, the domain will auto complete itself. 30Assemble Domains (Continued)Building 2D Structured GridsThis is the domain that results. Note that the mesh in the vicinity of the leading edge of the airfoil is a bit rough looking. This can be corrected with a

51、little smoothing done with Gridgens structured solver.To get back to the DOMAIN COMMANDS menu to do this, select Done.31The Structured SolverBuilding 2D Structured GridsTo run the solver, first choose Run Solver Structured from the DOMAIN COMMANDS menu. The domain is next picked in this case by high

52、lighting the entry in the browser window. Once Done is selected, the parameters for the elliptic solver can be selected. In this instance, the Run N Iterations button is selected, and 10 is entered via the keyboard. Clicking Enter will then start the solver.32The Structured Solver (Continued)Buildin

53、g 2D Structured GridsThe mesh lines will shift as the solver runs, ending with the smoothed mesh as shown here.Done Save is selected to save the changes.33Assemble BlocksBuilding 2D Structured GridsFrom the MAIN MENU, Blocks is selected. The grid block is next assembled from the domain, in much the

54、same way as a domain is assembled from its connector edges.Create is then selected from the BLOCK COMMANDS menu.This opens the CREATE BLOCK submenu. Ensure the structured cell type is toggled before clicking on Assemble Faces.The next step is to pick Add 1st Face to begin forming the block.34Assembl

55、e Blocks (Continued)Building 2D Structured GridsThe face is selected by mouse clicking on its image in the display window. Since this is a 2D block, once the Save the Face button is pressed, the block is complete. Press Done Save Blocks to finish this step.35Set Analysis BoundariesBuilding 2D Struct

56、ured GridsThe final step in generating the mesh is setting up the boundaries for the CFD software.From the MAIN MENU, the Analysis S/W submenu is selected.Set BCs is then picked.36Set Analysis Boundaries (Continued)Building 2D Structured GridsThe individual connectors that will make up each boundary

57、 can then be highlighted by mouse in the display window. Once all of the desired connectors that will make a boundary are selected, Done is picked to bring up a second menu to specify the boundary type to be assigned to that collection. In this case, the inlet to the flowfield is being selected. The

58、 other boundaries are specified in the same manner.37Export and Save FilesBuilding 2D Structured GridsThe mesh and boundary conditions are now ready to be exported for use with the CFD software.From the MAIN MENU, Input/Output is selected.From here, the individual files can be exported. The window f

59、or writing the files is basically identical to that used to input the database files at the beginning of the grid generation process.38Building 2D Unstructured GridsBuilding 2D Unstructured GridsIts now time to build the unstructured block around the lower half of the airfoil. The first few steps (s

60、electing the analysis software, setting defaults in this case the connector dimension, and importing the database geometry) are the same as before. To save some time, it will be assumed that these have already been performed. 39The “Bottom-Up”Gridgen ProcessSelect Analysis Software and Mesh Dimensio

61、nalityImport and Manipulate Database GeometryCreate Segments and ConnectorsDimension Connectors and Distribute Grid PointsAssemble DomainsAssemble BlocksSetup CFD Analysis BoundariesExport and Save FilesBuilding 2D Unstructured Grids40Create ConnectorsEverything is thus set to start building the con

62、nectors that will make up the grids edges.In the MAIN MENU, Connectors is chosen to bring up the corresponding commands menu. Select Create to open the Create Connector submenu As the first connector will be laid down on the airfoil database geometry, pick On DB Entities.Building 2D Unstructured Gri

63、ds41Create Connectors (Continued)As seen previously, the airfoil is composed of two database entities, one for the upper surface and one for the lower. The mouse can be used to pick the curve for the lower surface from the list in the blackboard window or directly from the display window. Note that

64、placing the mouse cursor over either the entry in the table or the entity in the display highlights both to aid the selection process. Clicking on Done completes the process. Building 2D Unstructured Grids42Create Connectors (Continued)As before, the 2 Point Connectors option is used to create the r

65、emaining connectors. Since Gridgen initially positions the display cursor at the last endpoint of the previously defined connector, its possible to quickly box in the airfoil from below. Here, the cursor is positioned back at the leading edge of the airfoil, ready to pick the final endpoint of the l

66、ast connector needed to complete the circuit.With the cursor in position, the last connector can be completed by Picking.Building 2D Unstructured Grids2,-1,0-1,-1,02,0,0-1,0,043Create Connectors (Continued)With the last connector completed, click on Done Creating Conns in the CREATE CONNECTOR menu (

67、or just hit the hot key, esc). Unlike a structured domain, the unstructured one being built inside these connectors will not require balanced numbers of grid points on opposite edges (indeed there will be only one edge that surrounds the entire domain). However, to promote a uniform cell density, it

68、 will still be desirable to redimension that long connector at the bottom to have roughly as many grid points as the three connectors on the other side have combined. Since the steps to do this are the same as previously shown, just the final result is displayed here.Building 2D Unstructured Grids44

69、Assemble DomainsEverything is now ready to assemble the connectors that will bound the mesh domain.In the MAIN MENU, pick Domains to switch to that menu. Next, select the Create command to begin building the new domain.Be sure that unstructured cell type is chosen, then pick Assemble Edges.As an uns

70、tructured domain can have any number of edges, the blackboard window now just shows which edge is currently being formed. Make sure Auto Complete and Auto Save are turned on. As each connector is added, the latter will check whether the loop has been closed and will automatically save and initialize

71、 the domain when it is. Building 2D Unstructured Grids45Assemble Domains (Continued)The next step is to select the first connector (the bottom one is being picked here) to be added to the edge. Since there is only one possible loop, Auto Complete steps in to close it, where upon Auto Save saves and

72、initializes it. This is the domain that results. To get back to the DOMAIN COMMANDS menu, select Done. From there, Done can be selected again to return to the MAIN MENU.Building 2D Unstructured Grids46Assemble BlocksFrom the MAIN MENU, Blocks is selected. The grid block is next assembled from the do

73、main, following the same basic procedure as for structured blocks.Create is then selected from the BLOCK COMMANDS menu.This opens the CREATE BLOCK submenu. Ensure the unstructured cell type is toggled before clicking on Assemble Faces.The next step is to pick Add 1st Face to begin forming the block.

74、Building 2D Unstructured Grids47Assemble Blocks (Continued)The face is selected by mouse clicking on its image in the display window. Since this is a 2D block, once the Save the Face button is pressed, the block is complete. Press Done Save Blocks to finish this step.From here, setting the boundary

75、conditions and exporting the files for the CFD solver follow the same path as shown for the 2D structured grid, so will not be repeated.Building 2D Unstructured Grids48Set Analysis BoundariesSetting boundary conditions for an unstructured mesh is the same as doing so for a structured one, but there

76、are some differences in how the boundary faces are displayed in the browser. Block NumberCoordinate Direction (Structured)Face Number (Unstructured)Connector NumberBoundary Condition(Type 1. are block interface connections)Building 2D Unstructured Grids49GridgenTrainingmIn this session:mGridgen Term

77、inology.mGUI Components.mGridgen Help.mBuilding 2D Structured Grids.mBuilding 2D Unstructured Grids.mTutorial: “2D Bump: Basic Skills.”Review50GridgenTrainingmIn this session:mBuilding 3D Structured Grids.m(Re)Dimensioning and (Re)Distributing Structured Grids.mTutorial: “Swept Ramp: Basic Multi Blo

78、ck Structured Grid.” Overview51Beginning with the 2D airfoil mesh below, the 3D hybrid grid shown at the right will be constructed, starting with the 3D structured block at the top. Building 3D Structured GridsBuilding 3D Structured Grids52The “Bottom-Up”Gridgen ProcessBuilding 3D Structured GridsSe

79、lect Analysis Software and Mesh DimensionalityImport and Manipulate Database GeometryCreate Segments and ConnectorsDimension Connectors and Distribute Grid PointsAssemble DomainsAssemble BlocksSetup CFD Analysis BoundariesExport and Save Files53Analysis S/W and Default SettingsBefore proceeding, tog

80、gle the 3D and generic solver buttons in SELECT ANALYSIS S/W.and be sure that the default connector dimension (Conn Dimens) is set to 36 in SET DEFAULT VALUES.Building 3D Structured Grids54Copying DomainsBefore the block can be formed, the remaining domains that make up its faces must be created. Fi

81、rst, the existing domains will be copied. Copy is picked in the DOMAIN COMMANDS menu.Pick All is then selected in the Copying DOMAINS sub-menu and then Done.Building 3D Structured Grids Next, the handle point is selected by mouse clicking on the upper left corner of the structured domain.55After the

82、 handle point is set, Enter Transl. Offset is picked to define where the copy of the domains will be placed.Copying Domains (Continued)In the present example, the offset will be one unit in the z direction, so 0 0 1 is typed. Enter is then picked.Done Translate is next selected and then Save Domains

83、.Building 3D Structured Grids56Copying Domains (Continued)Building 3D Structured GridsThe result will be the two identical, but offset domains, seen here. To return to the MAIN MENU, Done is selected.57Building 3D Structured GridsThe next step is to create a series (8 total) of two point connectors

84、between matching nodes on the edges of the domains to save time later, the connectors for the unstructured block are also defined now. As this process has already been demonstrated, it will not shown in detail again, but here are a couple caveats:Be sure that the default connector dimension is still

85、 set to 36.Switching off the rendering of the domains will aid in locating all of the nodes to be connected.Create Connectors58Assemble DomainsOnce all of the connectors are defined, the remaining six domains needed for the faces of the structured block can be assembled: left, right, bottom (three t

86、otal), and top - the latter is just being formed in the picture to the right. As an additional time saving measure, another structured domain is defined for the lower surface of the airfoil for later use. Since this process has already been demonstrated, it will not be shown in detail again. Just re

87、member using Auto Next Edge and Auto Complete will save time.Building 3D Structured Grids59Assemble BlocksFinally, its time to assemble the block. In the MAIN MENU, Blocks is selected.This opens the BLOCK COMMANDS submenu. Here Create is selected.This opens the CREATE BLOCK submenu. Be sure that Cel

88、l Type is set to structuredThen select Assemble Faces. Next, select Add 1st Face.Building 3D Structured Grids60Assemble Blocks (Continued)Building 3D Structured GridsNote that only the domains needed to define the structured block are currently shown in the display window.The ASSEMBLE 1st FACE menu

89、will open and the mouse can be used to pick the first domain to be added. In this case, the domain that makes up the back of the block has been selected.As this is the only domain for this face, Save the Face is clicked to complete it.Note the color coordinated face diagram in the blackboard window.

90、 The number in the center identifies the highlighted domain. The numbers along the periphery show the dimensions of its connectors.61The ASSEMBLE 2nd FACE menu will next open and the mouse can be used to pick the domains to be added. In this case, the three domains that makes up the bottom of the bl

91、ock have been selected.Note the face diagram in the blackboard window shows the particulars for all three selected domains.If the wrong domain is picked, EraseDom Pikd (to mouse click on the culprit) or Last (last one added) can be used.Save the Face is clicked to move on to the next face.Assemble B

92、locks (Continued)Building 3D Structured GridsNote that once a domain has been added to a face, only adjacent domains can be subsequently selected.62Building 3D Structured GridsAssemble Blocks (Continued)The remaining single domain faces are added in a similar fashion to the first. Here, the domain f

93、or sixth and last face (the top of the block) is about to be selected. AutoSave Face can speed creation of single domain faces, but make sure its off when building multi-domain ones.Once the domain is selected, Save the Face can be clicked to finish assembling the faces. Note that once a domain has

94、been added to a face, it becomes edged in blue.63Assemble Blocks (Continued)Building 3D Structured GridsAfter the six faces are defined, the structured block can be completed. The blackboard window provides a color coordinated list of the computational coordinates and the corresponding grid dimensio

95、ns of proposed block. If necessary, the computational coordinates can be changed by selecting ReSpecify , , . If desired, ReName can be used to give the block a name. Finally, Done Save Blocks will finish the blocks creation. 64(Re)Dimension Grids(Re)Dimensioning and (Re)Distributing Structured Grid

96、sDimensioning and redimensioning connectors has already been touched upon briefly. In addition, a previously defined connector can be redimensioned with the Redimension Grids command found in the CONNECTOR, DOMAIN, and BLOCK COMMANDS menus. In the SET DEFAULT VALUES menu, Con Dim dimen can be used t

97、o establish a default dimension for all subsequently created connectors. 65(Re)Dimension Grids (Continued)As structured grids require computationally rectangular domains, the Redimension Grids command automatically propagates new dimensions to all affected domains and blocks.When one connector in a

98、block or domain is highlighted for redimensioning, all other connectors that will have to be redimensioned by Gridgen to maintain balance also are highlighted.(Re)Dimensioning and (Re)Distributing Structured Grids66(Re)Dimension Grids (Continued)If a redimensioning leads to an inconsistency in the d

99、imensions of the system of connectors, Gridgen will highlight the problem and require its resolution before continuing. In this case, the dimensions of the two connectors highlighted in pink were changed, leading to an imbalance with the corresponding edges, each made up of three connectors, below.

100、Either the old dimensions can be restored or one (or more) of the connectors below will also have to be redimensioned.If one of these connectors is selected with the mouse, Gridgen will prompt for a new dimension to be entered via the keyboard in hopes that it will balance this edge with the edge ab

101、ove. Alternatively, Gridgen can be asked to Reset to Balanced Sys.(Re)Dimensioning and (Re)Distributing Structured Grids67(Re)Dimension Grids (Continued)Its also possible to redimension a connector via the Modify command in the CONNECTOR COMMANDS menu. This option is not available for connectors tha

102、t are already part of a structured domain.Modify is selected in the the CONNECTOR COMMANDS menu.This opens the MODIFYING CONNECTORS menu. The connector(s) to be redimensioned can be selected via the menu options or mouse picked. Once selection is completed select Done.Once selected, ReDimension can

103、be picked in the MODIFY CONNECTOR menu.(Re)Dimensioning and (Re)Distributing Structured Grids68(Re)Dimension Grids (Continued)After ReDimension is selected, the chosen connector(s) become highlighted in black with orange and blue triangles at the beginning and end, respectively. The connector(s) can

104、 then be redimensioned by selecting keybrd and typing in a dimension when prompted.Alternatively, subcon can be selected. This allows the dimension to be copied from other connector(s) chosen via the mouse.(Re)Dimensioning and (Re)Distributing Structured Grids69(Re)Dimension Grids (Continued)Here, s

105、ubcon has been chosen and the three connectors highlighted in pink have been selected as the source of the dimension for the top connector. Note that the dimension and distribution (evenly spaced in this case) of the source connectors are shown and that their ends are marked with the same orange and

106、 blue triangles as the target. The latter mark the direction the copy will be made from the source to the target. Done Redimension is picked to proceed with the redimensioning.(Re)Dimensioning and (Re)Distributing Structured Grids70(Re)Dimension Grids (Continued)Next, the question of whether the dis

107、tribution of the grid point spacing of the source connector(s) is also to be copied onto the target(s) must be answered. Once that decision is made, the MODIFY CONNECTOR menu reappears, and the modified connector(s) can be saved by clicking Done Replace Connectors. (Re)Dimensioning and (Re)Distribut

108、ing Structured Grids71Distributing and redistributing grid points has also already been touched upon briefly. (Re)Distribute GridsIn the SET DEFAULT VALUES menu, Con Dist can be used to establish a default distributions at the beginning (Bgn s) and end (End s) of all subsequently created connectors.

109、 In addition, grid points along a previously defined connector can be redistributed with the Set s Vals command found in the CONNECTOR COMMANDS menu. (Re)Dimensioning and (Re)Distributing Structured Grids72(Re)Distribute Grids (Continued)There are several options for setting the distribution default

110、s in the SET DEFAULT VALUES menu:Con Dist Bgn sspacing constraint, i.e., distance between first two grid points, at beginning of connector: -1 ensures spacing continuity with adjacent (sub)connector (this cannot be set as a default); 0 removes constraint if both ends unconstrained, points will be ev

111、enly spaced; 0 constrains spacing to entered value must be less than 40% of connector length. End s spacing constraint at end of connector. TanhGridgens default distribution function is the hyperbolic tangent. It can be applied if both ends of the connector are constrained or if only one end is. MRQ

112、SThe Monotonic Rational Quadratic Spline function can be applied to several subconnectors simultaneously. It forces a grid point to be fixed to a break point and automatically provides spacing continuity and variation continuity across the breakpoint. Gridgen will link two MRQS subconnectors if thei

113、r spline variables and types are the same and if the spacing constraints across their common break point are equal.(Re)Dimensioning and (Re)Distributing Structured Grids73(Re)Distribute Grids (Continued)Its also possible to redistribute grid points via the Modify command in the CONNECTOR COMMANDS me

114、nu. Modify is selected in the the CONNECTOR COMMANDS menu.This opens the MODIFYING CONNECTORS menu. The connector(s) to be redistributed can be selected via the menu options or mouse picked. Once selection is completed click Done.Once selected, ReDistribute can be picked in the MODIFY CONNECTOR menu

115、.(Re)Dimensioning and (Re)Distributing Structured Grids74(Re)Distribute Grids (Continued)After ReDistribute is selected, the chosen connector(s) become highlighted with orange and blue triangles at their beginnings and ends, respectively. A cursor circle also appears along the connector(s). A number

116、 of operations are now possible based on the commands in the GRID POINT DISTRIBUTION menu.(Re)Dimensioning and (Re)Distributing Structured Grids75(Re)Distribute Grids (Continued)The Focus commands choose which connector is to be modified or if all are.The cursor circle can be moved via the mouse, by

117、 entering coordinates, or by toggling from grid point to grid point.Add at divides the connector at the control point at (the cursor position) or at All control points along the connector.Remove similarly reassembles the connector.Add CP at adds a control point at the cursor position.The division of

118、 grid points between subconnectors can be changed by typing (top) or pushing/pulling from one to another, but the connectors total is fixed.to Next and to Prev shifts break point one control point either towards end or beginning of connector.Begin. and Ending set the s values at the ends of the subc

119、onnector.(Re)Dimensioning and (Re)Distributing Structured Grids76(Re)Distribute Grids (Continued)The DISTRIBUTION FUNCTION determines how points are distributed under the input spacing constraints:Equal Spacing means just that. TANH (hyperbolic tangent) is the Gridgens default. Copy From Network req

120、uires a database entity to distribute to (with various criteria). MRQS, as noted before, works across multiple subconnectors. Geometric Progression gives a one-sided distribution where ratio between adjacent points is constant. Copy from SubConnects copies distribution from picked subconnector(s). M

121、ax Dev + Max Ang limits discrete connector deviations from segment shape and turning angle between grid points. The distribution function and spacing constraints establish grid coordinates in terms of the splining variable. The SPLINE TYPE function converts these to Cartesian coordinates Linear Fit

122、is Gridgens Default. Similarly, the SPLINE VARIABLE can also be chosen Arclength is the default.(Re)Dimensioning and (Re)Distributing Structured Grids77(Re)Distribute Grids (Continued)Enter s at Picked applies specified spacing constraint on both sides of break point where cursor is currently locate

123、d.Wrapping up the GRID POINT DISTRIBUTION menu.These toggles set different options for rendering grid points (as shown) or turning off their display.Control points can be rendered as shown or not rendered at all.These control mouse sensitivity with respect to cursor circle movement.(Re)Dimensioning

124、and (Re)Distributing Structured Grids78Use of the structured solver has also been touched upon briefly in the previous session. For domains, its mainly used to change the interior distribution of points to smooth mesh or improve orthogonality. To run the solver, first choose Run Solver Structured fr

125、om the DOMAIN COMMANDS menu. The domain is next picked in this case by highlighting the entry in the browser window. Alternatively the mouse can be used for selecting the domain. Once Done is selected, the RUN STRUCTURED SOLVER menu appears. (Re)Dimensioning and (Re)Distributing Structured GridsThe

126、Structured Solver79When to Run the Structured SolvermWhen strict orthogonality is needed adjacent to a wall type boundary. mWhen cell quality needs improvement.mWhen cell problems adjacent to the boundary of a domain or block are generally due to connector or domain problems, respectively, and when

127、those problems cannot be fixed directly.(Re)Dimensioning and (Re)Distributing Structured GridsThe Structured Solver (Continued)80The Structured Solver (Continued)As an example, the airfoil mesh has been modified with various spacing constraints (see the inset diagram) to increase the mesh resolution

128、 near the leading edge and in the boundary layer region. Unfortunately, an undesirable consequence is the crowding of the cells near the leading edge. The structured solver could be utilized to correct this. 0.010.010.010.030.01(Re)Dimensioning and (Re)Distributing Structured Grids81Heres a look at

129、the options in the RUN STRUCTURED SOLVER menu:Initialize via TFI (transfinite interpolation) “resets” the domain or block grid in question with the last TFI method used. TFI is an algebraic approach to establish the interior grid point locations. Its what Gridgen uses when a domain or block is first

130、 created. There are several mathematical methods available as will be discussed later.Elliptic Solver runs the elliptic PDE solver to smooth grid either indefinitely (Run) until paused, one iteration (Run 1 Iter), or N iterations (Run N Iters). Project Grid to DB projects grids with database constra

131、ined shapes to their database.Set Solver Attribs opens a menu for setting solver attributes.Examine opens a menu of grid quality inspection tools, while Show Examine Data will display grid quality information when solver is paused.(Re)Dimensioning and (Re)Distributing Structured GridsThe Structured

132、Solver (Continued)82(Re)Dimensioning and (Re)Distributing Structured GridsColor coded domain edges match foreground control and boundary condition lists in blackboard window.Selecting Set Solver Attribs in the RUN STRUCTURED SOLVER opens this menu. Each button here opens yet another menu to control

133、various TFI and elliptic solver attributes.The Structured Solver (Continued)83The Structured Solver (Continued)(Re)Dimensioning and (Re)Distributing Structured GridsTFI Attributes Methods specifies the mathematical method used to initialize the grid point distribution.Elliptic Attributes Surface Sha

134、pe Params define how the shape of the selected surface grids is computed. Background Cont Funcs influences the distribution of grid points in the grids interior. Foreground Cont Funcs influences the distribution of grid points near the grids boundaries. Solver Bound. Conds. controls grid point movem

135、ent on grid boundaries during elliptic refinement. Algorithm Attributes controls the methodology and convergence rate of the iterative PDE solution.84Selecting TFI Attributes Methods brings up the SELECT ALGEBRAIC METHOD menu with the following choices:Standard TFI (third choice for domain initializ

136、ation) arc-length based interpolants provide optimum algebraic domain initialization.Linear TFI original transfinite interpolation method developed for Gridgen, generally inferior to standard TFI.Polar TFI initialization performed in polar coordinate system according to a user defined axis.Ortho TFI

137、 provides minimal additional orthogonality at domain edges.Parametric TFI (first choice for domain initialization) a standard transfinite interpolation is calculated in the parametric coordinates of an underlying database surface when all bounding connectors are associated to that surface. Method en

138、sures domain has database surface shape.Param-Fit TFI (second choice for domain initialization) extension of above to include special cases where some bounding connectors, while physically in the same space as the underlying database surface, are actually associated to different database entities.(R

139、e)Dimensioning and (Re)Distributing Structured GridsThe Structured Solver (Continued)85Selecting Elliptic Attributes Surface Shape Params brings up the SELECT SHAPE TYPE METHOD menu with the following choices:Free (default for standard TFI domains) solver runs with no constraint on domain shape.Fixe

140、d original domain shape is temporarily parameterized so original shape can be maintained.DB (default for Parametric/Param-Fit TFI domains) shape is constrained to underlying database surface(s). Picking this option reveals: Proj Typ Lin-Def an average of the domain normals at the four corners is use

141、d for the projection vector for the linear projection method. Lin-Cur the current view orientation is set and saved as the projection vector for the linear projection method. ClosePt the closest point projection method is used. Proj DBs Default a default set of database surfaces is chosen based on d

142、omain/connector associativities. Picked user is allowed to interactively choose the database surfaces via picking in the display window or browser.(Re)Dimensioning and (Re)Distributing Structured GridsThe Structured Solver (Continued)86(Re)Dimensioning and (Re)Distributing Structured GridsSelecting

143、Elliptic Attributes Background Cont Funcs brings up the SELECT BACKGROUND CON FUN menu with the following choices:LaPlace maximize smoothness in the grid interior at the cost of grid point clustering and orthogonality.Thomas-Middlecoff (default) produces smooth grid while maintaining boundary point

144、clustering into the interior of the domain.Fixed Grid This method looks for and corrects local slope discontinuities in the grid. The Structured Solver (Continued)87The Structured Solver (Continued)(Re)Dimensioning and (Re)Distributing Structured GridsLaPlaceThomas-Middlecoff88(Re)Dimensioning and (

145、Re)Distributing Structured GridsSelecting Elliptic Attributes Foreground Cont Funcs brings up the FOREGROUND CONTROL FUNCS menu:Edges choose the edge(s) that require change to their foreground control settings or boundary conditions by toggling the corresponding color coded squares (when selected, t

146、he box outlines are filled). All or None can be selected as appropriate to save time.Set will reveal the SET ON EDGES menu.The Structured Solver (Continued)89SET ON EDGES options:Form refers to nature of control over near boundary grid points: Off do not use foreground controls. On (default) use for

147、eground controls. Hilgens (default) method of von Lavante-Hilgenstock-White, providing greatest control over spacing and orthogonality. Sorensn method by Steger-Sorensen, providing smoother grids at some cost to edge orthogonality and spacing. s Calc refers to distance between boundary edge/face gri

148、d points and the first layer of grid points inward: Type-In enter a spacing value via the keyboard. Interpl (default) linearly interpolate the spacings from the ends of the edge along the length of the edge. Cur Grd store and maintain the original spacings along the length of the edge. Adj Grd use t

149、he spacings from an adjacent domain along the length of the edge. The adjacent domain must be in the solver simultaneously, reverting to Cur Grd if adjacent domain not available.(Re)Dimensioning and (Re)Distributing Structured GridsThe Structured Solver (Continued)90HilgensSorensnThe Structured Solv

150、er (Continued)(Re)Dimensioning and (Re)Distributing Structured Grids91(Re)Dimensioning and (Re)Distributing Structured GridsSET ON EDGES options (continued): s Blend controls blending of spacing constraints into grids interior: Linear blending is a linear function of grid point index from the edge.

151、Exponen (default) blending is a decaying exponential function. Decay number of grid lines into the interior at which foreground control decays to 10% of its maximum edge contribution. Calc refers to angle that transverse grid lines make with boundary: Orthgnl (default) 90 degree grid line-edge inter

152、sections will be enforced as reasonable. Interpl linear interpolates spacings from edge ends. Cur Grd store and maintain original spacings. Adj Grd uses spacing from adjacent domain. Blend controls blending of angle constraints into interior: Linear see above. Exponen see above. Decay see above.The

153、Structured Solver (Continued)92(Re)Dimensioning and (Re)Distributing Structured GridsSelecting Solver Bound. Conds. brings up the ELLIPTIC SOLVER EDGE BC menu:Edges choose the edge(s) for which you wish to change the control settings for their grid point distributions by toggling the corresponding c

154、olor coded squares (when selected, the box outlines are filled). All or None can be selected as appropriate to save time.Set will reveal the SELECT FOR EDGE menu.The Structured Solver (Continued)93(Re)Dimensioning and (Re)Distributing Structured GridsThe SELECT FOR EDGE menu provides the following o

155、ptions:Fixed (default) edge grid points will not be allowed to move.Floating common connectors between adjacent domains will change shape and distribution as if an interior grid line when the adjacent domains are all run in the solver.Orthogonal grid point distribution along the edge will be allowed

156、 to change in order to achieve the best possible orthogonality.The Structured Solver (Continued)94Selecting Algorithm Attributes brings up the Algorithm Atts menu with the following choices:Single grid solves the elliptic PDEs on the selected entity based on the focus grids relaxation factor, define

157、d by selecting the Relaxation tab below (grayed out when Multigrid is toggled).Multigrid (default) solves the elliptic PDEs on the selected entity via a multigrid approach, i.e., based on the actual mesh and two coarser intermediates that Gridgen creates. This technique achieves convergence in fewer

158、 steps than the single grid method. Two controls are provided: Relaxation controls the over-relaxation of the solution. The default is 0.9. Lower values increase robustness but will require more iterations. Prolongation controls the transfer of grid point changes from the coarse grid solutions back

159、to the initial finer grid. The default is 0.6. Lower values will again increase robustness at the price of more iterations.(Re)Dimensioning and (Re)Distributing Structured GridsThe Structured Solver (Continued)95Toggling Single Grid and selecting Relaxation brings up the SELECT RELAXATION PARAM menu

160、 with the following choices:Use Optimal Relaxation (default) the highest possible relaxation value is used at each grid point to accelerate the elliptic solution.Use Nominal Relax 0.7 a conservative mean value is used at all grid points, sometimes necessary for smooth convergence when using Shape DB

161、.Enter Relax via Keyboard enter a new value, between 0 and 2, directly when prompted via the keyboard.(Re)Dimensioning and (Re)Distributing Structured GridsThe Structured Solver (Continued)96(Re)Dimensioning and (Re)Distributing Structured GridsThe Structured Solver (Continued)2D to 3D DifferencesmS

162、ix faces instead of four edges.mNo Surface Shape Params or Project Grid to DB necessary.mNo Adj Grd foreground control.mOnly Fixed boundary condition available.97GridgenTrainingReviewmIn this session:mBuilding 3D Structured Grids.m(Re)Dimensioning and (Re)Distributing Structured Grids.mTutorial: “Sw

163、ept Ramp: Basic Multi Block Structured Grid.” 98GridgenTrainingmIn this session:mBuilding 3D Unstructured Grids.m(Re)Dimensioning and (Re)Distributing Unstructured Grids.mExamining and Correcting Grids.mTutorial: “Pierced Elbow: Basic Unstructured Grid.” Overview99Building 3D Unstructured GridsBuild

164、ing 3D Unstructured GridsTurning again to the hybrid airfoil mesh, the 3D unstructured block will now be constructed.100The “Bottom-Up”Gridgen ProcessSelect Analysis Software and Mesh DimensionalityImport and Manipulate Database GeometryCreate Segments and ConnectorsDimension Connectors and Distribu

165、te Grid PointsAssemble DomainsAssemble BlocksSetup CFD Analysis BoundariesExport and Save FilesBuilding 3D Unstructured Grids101Building 3D Unstructured GridsAssemble DomainsMost of the faces needed for the unstructured block beneath the airfoil have already been created. Only the bottom and two end

166、 domains have yet to be formed. Since this process has already been demonstrated, it will not be shown in detail again. Just remember using Auto Save and Auto Complete will save time. Here is the scene after these three domains have been formed.102Assemble BlocksFinally, its time to assemble the blo

167、ck. In the MAIN MENU, Blocks is selected.This opens the BLOCK COMMANDS submenu. Here Create is selected.This opens the CREATE BLOCK submenu. Be sure that Cell Type is set to unstructuredThen select Assemble Faces. Next, select Add 1st Face.Building 3D Unstructured Grids103Assemble Blocks (Continued)

168、The ASSEMBLE 1st FACE menu will open and the mouse can be used to pick the first domain to be added. In this case, the domain that makes up the back of the block has been selected.Note the blackboard window simply states that one domain has been added to the unstructured face. Additional domains wil

169、l be added until the face completely encloses the block. The exception would be an unstructured baffle where the face can be open. Building 3D Unstructured Grids104The process continues as additional domains are added to the face. Note that a bold yellow outline marks the edge of those domains that

170、are now part of the face it will disappear when the face is closed.If a mistake is made and an unwanted domain is added, it can be erased with EraseDom just as in the case of structured block assembly. Note that Save the Face is not available until the face is closed.Building 3D Unstructured GridsAs

171、semble Blocks (Continued)105Building 3D Unstructured GridsAssemble Blocks (Continued)Once the face is closed, the bold yellow outline disappears and the Save the Face command can be selected.106Assemble Blocks (Continued)Building 3D Unstructured GridsOnce the face is saved, the menu changes once mor

172、e. Yellow arrows show the face normals.If need be, they can be reversed with the Reorient Faces command.The new block can be given a name with the ReName command.Finally, the block is saved with the Done Save Blocks command. However, the blocks interior is not defined until the unstructured solver i

173、s run more on this later.Closeup showing face normal arrows.107(Re)Dimensioning and (Re)Distributing Unstructured Grids(Re)Dimension GridsDimensioning and redimensioning connectors has already been touched upon in discussing (re)dimensioning structured grids. In addition, a previously defined connec

174、tor can be redimensioned with the Redimension Grids command found in the CONNECTOR, DOMAIN, and BLOCK COMMANDS menus. In the SET DEFAULT VALUES menu, Con Dim dimen can be used to establish a default dimension for all subsequently created connectors. 108(Re)Dimension Grids (Continued)(Re)Dimensioning

175、 and (Re)Distributing Unstructured GridsSince unstructured grids have no topological restrictions, Redimension Grids can be used for quick dimensioning of individual connectors whether they are part of a domain or not. 109As discussed in conjunction with structured meshes, its also possible to redim

176、ension a connector via the Modify command in the CONNECTOR COMMANDS menu.Modify is selected in the the CONNECTOR COMMANDS menu.This opens the MODIFYING CONNECTORS menu. The connector(s) to be redimensioned can be selected via the menu options or mouse picked. Once selection is completed select Done.

177、Once selected, ReDimension can be picked in the MODIFY CONNECTOR menu.(Re)Dimension Grids (Continued)(Re)Dimensioning and (Re)Distributing Unstructured Grids110After ReDimension is selected, the chosen connector(s) become highlighted in black with orange and blue triangles at the beginning and end.I

178、f subcon is selected, the dimension to be copied from other connector(s) chosen via the mouse.Selecting Done-ReDimension will move to the next step of deciding whether to also copy the distribution of grid points. (Re)Dimension Grids (Continued)(Re)Dimensioning and (Re)Distributing Unstructured Grid

179、s111Next, the question of whether the distribution of the grid point spacing of the source connector(s) is also to be copied onto the target(s) must be answered. As unstructured meshes are normally built with equal grid point spacing, this is usually a moot point here.Once that decision is made, the

180、 MODIFY CONNECTOR menu reappears and the modified connector(s) can be saved by clicking Done Replace Connectors. (Re)Dimension Grids (Continued)(Re)Dimensioning and (Re)Distributing Unstructured Grids112(Re)Distribute Grids(Re)Dimensioning and (Re)Distributing Unstructured GridsGrid points along uns

181、tructured connectors are typically equally spaced or have points inserted based on curvature or deviation: Max Ang adds additional grid points where turning angle for consecutive points is greater than specified.Max Dev adds additional grid points where discrete grid shape deviates from the true con

182、nector or underlying database shape more than the maximum deviation specified.Surf considers curvature in all directions of underlying database surface for Max Ang and Max Dev if toggled. Only applies if either or both are set.If it is desired, (re)distribution can be handled in the same way as for

183、structured meshes, but more useful in controlling unstructured meshes are: IntPt (Interior Points) controls whether grid points are inserted into unstructured domains when they are created.Decay Factor controls how far boundary cell size affects interior cell size, ranges from 0 (no influence) to 1

184、(0.5 default).MinEdg and MaxEdg specify the minimum and maximum edge lengths for cells, respectively.MaxAng specifies the maximum dihedral angle allowed between two triangles sharing an edge.MaxDev specifies the maximum distance allowed between a domains analytical shape (based on its database) and

185、its discrete shape (the triangular facets).113(Re)Distribute Grids (Continued)As with structured grids, its also possible to redistribute grid points via the Modify command in the CONNECTOR COMMANDS menu. Modify is selected in the the CONNECTOR COMMANDS menu.This opens the MODIFYING CONNECTORS menu.

186、 The connector(s) to be redistributed can be selected via the menu options or mouse picked. Once selection is completed select Done.Once selected, ReDistribute can be picked in the MODIFY CONNECTOR menu.(Re)Dimensioning and (Re)Distributing Unstructured Grids114(Re)Distribute Grids (Continued)(Re)Di

187、mensioning and (Re)Distributing Unstructured GridsThe connectors to be modified can now be selected by mouse clicking in the display window and various operations can be selected from the GRID POINT DISTRIBUTION menu. Amongst these is Select Distrib. Func. which opens the DISTRIBUTION FUNCTION MENU.

188、 Amongst the options here is Max Dev + Max Ang, which can move grid points about to satisfy the input deviation values without changing the overall connector dimension.115The Unstructured Solver(Re)Dimensioning and (Re)Distributing Unstructured GridsFor domains, the unstructured solver is primarily

189、used to change the interior distribution of points, typically for smoothing or more accurately resolving geometric shape. To run the solver, first choose Run Solver Unstrctrd from the DOMAIN COMMANDS menu. The domain is next picked in this case by highlighting the entry in the browser window. Altern

190、atively the mouse can be used for selecting the domain. Once Done is selected, the RUN UNSTRUCTRD SOLVER menu appears. 116The Unstructured Solver (Continued)(Re)Dimensioning and (Re)Distributing Unstructured GridsRUN UNSTRUCTRD SOLVER menu options include:Initialize deletes existing interior cells a

191、nd repopulates based on current defaults and attributes.Tri Solver inserts (Refine), removes (Decimate), or smoothes (Smooth Only) points based on attributes. The latter involves LaPlacian smoothing and diagonal swapping.Project Grid to DB constrains grid to underlining database (grayed out when not

192、 present).Set Solver Attribs opens menu for setting attributes.117The Unstructured Solver (Continued)(Re)Dimensioning and (Re)Distributing Unstructured GridsHaving selected Set Solver Attribs, the SET UNSTRUCTRD SOLVER ATTS menus opens and the image of the selected grid changes. The options here are

193、:Surface Shape Params opens the SELECT SHAPE TYPE menu to choose how the domain surface shape will be determined.Relaxation Parameter opens the SELECT RELAXATION PARAM menu to change the unstructured solver smoothing.Grid Control Params opens the SELECT GRID CONTROL PARAM menu to select and change v

194、arious grid attributes. 118The Unstructured Solver (Continued)(Re)Dimensioning and (Re)Distributing Unstructured GridsThe SELECT SHAPE TYPE menu provides these options:Free solver runs with no constraint on domain shape.DB shape is constrained to underlying database surface(s). Selecting the latter

195、opens the following options:Proj Typ Lin-Def an average of the domain normals at the four corners is . used for the projection vector for the linear projection method. Lin-Cur the current view orientation is set and saved as the . projection vector for the linear projection method. ClosePt the close

196、st point projection method is used.Proj DBs Default a default set of database surfaces is chosen based on . domain/connector associativities. Picked the database surfaces are picked via mouse or the . browser window.119The Unstructured Solver (Continued)(Re)Dimensioning and (Re)Distributing Unstruct

197、ured GridsThe SELECT RELAXATION PARAM menu has these options:Use Nominal Relax 1.0 (default) uses the mean value for determining the number of smoothing iterations. Enter Relax via Keyboard replaces default with a new value (between 0 and 2) entered via the keyboard.The SELECT GRID CONTROL PARAM men

198、u offers these options for controlling Triangle cell geometry:Min Edge minimum triangle edge length.Max Edge maximum triangle edge length.Max Surf Dev maximum allowed distance of triangle centroid from underlying database surface, inserting grid points as needed to remain below maximum.Max Ang Dev m

199、aximum allowed turning angle between adjacent triangles, inserting grid points as needed.Boundary Decay distance into domain interior that boundary grid point spacing affects interior triangle edge length.120Max Surf DevMax Ang DevBoundary DecayWITHOUTWITHWITHOUTWITH(Re)Dimensioning and (Re)Distribu

200、ting Unstructured GridsThe Unstructured Solver (Continued)0 (OFF)1 (MAX)121The Unstructured Solver (Continued)Returning to the airfoil mesh, well increase the triangle min and max edge control parameters so we can coarsen the grid with the Decimate command. Selecting Min Edge in the SELECT GRID CONT

201、ROL PARAM menu prompts for a new value. Type 0.1 via the keyboard and then click Enter. Selecting Max Edge in the SELECT GRID CONTROL PARAM menu prompts for a new value. Type 0.5 via the keyboard and then click Enter. Pick Done Setting Attributes to return to the RUN UNSTRUCTRD SOLVER screen. (Re)Di

202、mensioning and (Re)Distributing Unstructured Grids122With these new parameters defined, the grid density on the back plane of the unstructured mesh can now be reduced.Selecting Decimate (or typing the d hot key) will run the unstructured solver with these new parameters. Selecting Done Save will sav

203、e the modified mesh, while Abort Dont Save will return the mesh to its previous state. The Unstructured Solver (Continued)(Re)Dimensioning and (Re)Distributing Unstructured Grids123The Unstructured Solver (Continued)(Re)Dimensioning and (Re)Distributing Unstructured GridsFor blocks, the unstructured

204、 solver is primarily used to initialize their interiors, i.e., fill them with tetrahedral cells, after their exterior shells have been defined.To run the solver, first choose Run Solver Unstrctrd from the BLOCK COMMANDS menu. The block is next picked in this case by highlighting the entry in the bro

205、wser window. Alternatively the mouse can be used for selecting it. As there are no cells defined yet, the block is described as empty.Once Done is selected, the RUN UNSTRUCTRD SOLVER menu appears. 124The Unstructured Solver (Continued)RUN UNSTRUCTRD SOLVER menu options include:Initialize passes the

206、block information to the tetrahedral solver to fill the block with tet cells. Once selected, the message window will report UNSTRUCTURED SOLVER: Working. until the process is completed. During the calculations, the cursor is replaced with an hourglass .Release Vol Grid deletes any tet cells previous

207、ly created for the block from memory.Set Solver Attribs opens another menu to set various attributes for the solver. (Re)Dimensioning and (Re)Distributing Unstructured Grids125The Unstructured Solver (Continued)(Re)Dimensioning and (Re)Distributing Unstructured GridsHaving selected Set Solver Attrib

208、s, the SET UNSTRUCTRD SOLVER ATTS menu opens. Grid Control Params can be selected to reveal the SELECT GRID CONTROL PARAM submenu, with these options for the Tetra(hedral) cells:Min Edge minimum triangle edge length.Max Edge maximum triangle edge length.Memory Size maximum amount of memory to be all

209、ocated to the tetrahedral solver. Default is 64 MB. Rough estimate is 1 MB per 15,000 tetrahedra.Iterations controls number of runs through tetrahedral solver. Additional iterations might improve grid quality in inadequate regions of a bad mesh. Default is 1, and max is 10.Boundary Decay distance in

210、to interior that boundary grid point spacing affects interior triangle edge length.126Gridgen includes extensive tools for examining various mesh characteristics and isolating resulting mesh problems. Specific tools available for studying connectors, domains, and blocks can be accessed via the Exami

211、ne command in the corresponding COMMANDS menus. Examining and Correcting GridsClicking on Examine (or typing e) opens the Examine menu. Examining and Correcting Grids127Examine ConnectorsExamining and Correcting GridsOnce Examine has been picked in the CONNECTOR COMMANDS menu, the individual connect

212、ors to be considered can be selected from the browser window or via the mouse in the display window. When the selection is complete, Done is picked, opening the Examine window.Focus allows the diagnostic function to be reported for specific connectors or grid points, depending on the Mode and Hilite

213、r status, by toggling Next or Prev.Display opens another menu for selecting display options for diagnostics information.Function selects the specific diagnostic function to be applied.Mode allows one of the chosen connectors to be examined (Local) or all of them(Global).Hiliter On will show diagnost

214、ic information about a specific grid point in the blackboard window. The buttons below provide options for picking this grid point.128Examine Connectors (Continued)Examining and Correcting GridsClicking on None in the EXAMINE menu opens the DIAGNOSTIC submenu where the diagnostic function to be appl

215、ied can be chosen.Usage will show what entities (domains, etc.) utilize the selected connector(s).Once the function has been selected, Next Page must be clicked to reveal the Done button to return.Size will show the lengths between grid points along the connector(s).Smooth (Smoothness) will show the

216、 normalized turning angle of the connector at each grid point.Size Rat (Size Ratio) will show the ratio of these lengths amongst adjacent points.DB will show whether the connectors grid points are on and/or off (depending on the toggle settings) the database.129Examine Connectors (Continued)Examinin

217、g and Correcting GridsHere, the DB Function has been chosen (note the DB identifier next to Function), with both on and off toggled. Three connectors were chosen, the top and bottom of the airfoil and the edge between the structured and unstructured blocks. As the airfoil is referenced to the wings

218、database, the grid points appear as green, i.e., theyre on the database. As the other connector is not on the database, its grid points are red, i.e., theyre off the database. Note the summary of this information in the blackboard window.130Examine Connectors (Continued)Here, the Size Function has b

219、een chosen (note the Size identifier next to Function in the menu). The three connectors are now color coded by the lengths between grid points. The color scale on the left of the display window shows the corresponding lengths in model units. Again, note the summary information in the blackboard win

220、dow.Examining and Correcting Grids131Examine DomainsExamining and Correcting GridsAs before, clicking on None in the EXAMINE menu opens the DIAGNOSTIC submenu where the diagnostic function to be applied can be chosen.Usage will show what entities utilize or are utilized by the selected domain(s).As

221、in the case of the DIAGNOSTIC menu for connectors, Next Page must be clicked to reveal the Done button to return.Size will show the cell areas in the selected domain(s).Skewness will show cells minimum included angle (min ), maximum included angle (max ), or the maximum ratio of cells included angle

222、 to the angle of an equilateral triangle (angle). angle values less than 0.8 are considered good, but values up to 0.9 may be acceptable for some solvers.Aspect Ratio will show ratio of average length to average width of the cells in the domains.DB will show whether the grid points are on and/or off

223、 the database.132Here, the Size Function has been chosen (note the Size identifier next to Function in the menu). The two domains that make up the front surface of the mesh have been chosen, and their cell faces are now color coded by area. The color scale on the left of the display window shows the

224、 corresponding areas in model units. Again, note the summary information in the blackboard window.Examine Domains (Continued)Examining and Correcting Grids133Examine Domains (Continued)Examining and Correcting GridsNext, the Aspect Ratio has been chosen (note the identifier next to Function in the m

225、enu). Some cells appear to have aspect ratios greater than 10, a problem for some solvers. To find these, some changes to the display may be useful. This can be done by clicking the Solid+Wire button next to Display.134Examine Domains (Continued)Examining and Correcting GridsFirst, Maximum is select

226、ed under Color Bar Values, and then Type-In is picked so that 10 can be entered via the keyboard. Next, Above is toggled under Show Cells _ _ ? _ _ Range so that only those cells with aspect ratios above 10 will be highlighted.Then, Histogram is toggled to provide more information on numbers of cell

227、s vs. their aspect ratios.Clicking Done returns to the previous menu.135Examine Domains (Continued)Examining and Correcting GridsFinally, Skewness is chosen, with the angle option. As the plot shows, all the cells in these domains have very low skewness (a good thing).In this case, the Hiliter has a

228、lso been turned on and a set of cell indices (45, 6) entered via the kbrd. As a result, Gridgen highlights the cells location in the display window and shows its skewness value in the blackboard window.136Examine BlocksExamining and Correcting GridsAs before, clicking on None in the EXAMINE menu ope

229、ns the DIAGNOSTIC submenu where the diagnostic function to be applied can be chosen.Usage will show what entities utilize or are utilized by the selected block(s).As in the case of the DIAGNOSTIC menus for connectors and domains, Next Page must be clicked to reveal the Done button to return.Size wil

230、l show the cell volumes in the selected block(s).Skewness will show cells minimum included angle (min ), maximum included angle (max ), or the maximum ratio of cells included angle to equilateral triangle angle (angle).Aspect Ratio will show ratio of average length to average width of the cells in t

231、he block(s).Jacobian will show cells pos, pos skew, zero, neg skew, neg Jacobian, as toggled. 137Examine Blocks (Continued)Examining and Correcting GridsCell Jacobian Classifications138Examine Blocks (Continued)In this case, the positive (Pos) Jacobian for both blocks is being plotted. The blackboar

232、d window in this case shows the number of cells in all five Jacobian classifications (all positive in this instance). Examining and Correcting Grids139Examine Blocks (Continued)The Hiliter can be used to examine cells on various surfaces within the block(s). There are two hiliters available, topolog

233、ical and physical.Topo (topological) displays constant computational coordinate planes ( , , ) for structured grids blocks. Here a surface of constant is shown. The plane can be moved in the chosen coordinate direction by using the arrow keys on the keyboard or the row of arrow buttons (, etc.) in t

234、he menu.Examining and Correcting Grids140Examine Blocks (Continued)In the case of a prism block, only planes in the extrusion direction can be displayed in Topo mode, as shown here.Examining and Correcting Grids141Examine Blocks (Continued)Phy (physical) displays constant Cartesian coordinate cuts (

235、X, Y , Z). The cutting plane (Flat) at that location or the layer of cells (Cells) intersecting that surface can be shown. Here the cells cut through a surface of constant X are shown. If Permanent is toggled, existing slices shown in display window are retained when a new one is created. If not, th

236、e previous plots are removed when a new one is made.Examining and Correcting Grids142Examine Blocks (Continued)For tet meshes, Crinkle is available. Here, for every touched tetrahedral cell that has only three of its four faces cut by the plane, the fourth uncut face becomes part of the crinkle surf

237、ace. The resulting three-dimensional surface is not flat, but resembles a crinkled sheet of foil hence the name.This example also shows that if no function (None) is selected, only the mesh itself is rendered.Examining and Correcting Grids143mThe vast majority of cell issues encountered in Gridgen r

238、esult from either (or both):mConnector point distribution or shape problems.mDomain point distribution or shape problems.mCheck to see if:mA change to a connector distribution requires a domain update.mA connector and/or domain projection has resulted in poor shape or distribution.mAdjacent domains

239、interiors intersect or cross.mOpposing distributions cause excessive pull or twist in the grid interior.Solving Grid ProblemsExamining and Correcting Grids144GridgenTrainingReviewmIn this session:mBuilding 3D Unstructured Grids.m(Re)Dimensioning and (Re)Distributing Unstructured Grids.mExamining and

240、 Correcting Grids.mTutorial: “Pierced Elbow: Basic Unstructured Grid.” 145146GridgenTrainingmIn this session:mBuilding 2D Structured Extruded Grids.mBuilding 3D Structured Extruded Grids.mTutorial: “Swept Ramp: Advanced Multi Block Structured Grid.”mBuilding 3D Unstructured Extruded Grids.mCreating

241、Hybrid Grids.mTutorial: “Droplet in a Cylinder: Hybrid Grid.”Overview147Building Structured Extruded GridsExtrusion is another means of quickly building meshes with Gridgen. 2D domains can be easily extruded from connectors or edges, while 3D blocks can be readily extruded from domains or faces. In

242、either case, there are a number of different marching schemes available:mHyperbolic.mNormal.mRotational.mTranslational.mPath.Lets first look at applying these to build structured extruded grids. Since the steps to select analysis software, import geometry, create connectors, and dimension them are u

243、nchanged, they will be skipped.Building 2D Structured Extruded Grids148The “Bottom-Up”Gridgen ProcessSelect Analysis Software and Mesh DimensionalityImport and Manipulate Database GeometryCreate Segments and ConnectorsDimension Connectors and Distribute Grid PointsExtrude DomainsAssemble BlocksSetup

244、 CFD Analysis BoundariesExport and Save FilesBuilding 2D Structured Extruded Grids149Creating Demo ConnectorsBuilding 2D Structured Extruded GridsFor the classroom extrusion demos, it will be convenient to define the system of three connectors shown below. 1. Import the airfoil database file (reext.

245、dba).2. Create connectors on the upper and lower airfoil database entities.3. Dimension them to 20 and set s to 0.01 on both at the airfoil leading edge.4. Create a two point connector from 1,0,0 (the trailing edge) to 2,0,0.5. Dimension this connector to 6.6. Save the file for later use.150Extrude

246、DomainsWith one or more dimensioned connectors in place, domains can be extruded from either the individual connectors or an edge formed by combining the connectors. From the MAIN MENU, select Domains to open the DOMAIN COMMANDS submenu. From here, select Create to open CREATE DOMAINS. Be sure that

247、the Cell Type is set to structured. Next, its time to select either From Cons (connectors) or From An Edge to choose which will be the basis of the extrusion. Building 2D Structured Extruded Grids151Cons vs. EdgesFrom Cons A separate extrusion is performed on each individual connector selected, thus

248、 allowing each to have its own extrusion attributes. A floating boundary condition is applied at shared nodes so adjacent extrusions blend smoothly. Each connector extrudes to a separate domain.From An Edge The selected connectors form a single edge from which a single new domain is extruded. Genera

249、lly, From An Edge is preferred for mesh quality and extrusion algorithm numerical stability reasons.If From Cons was selected, the EXTRUDE CONNECTORS submenu appears. Connectors can then be picked by mouse from the browser window or directly from the display window. When picking is finished, Done is

250、 clicked. If From An Edge was selected, the CREATE EXTRUSION EDGE submenu appears. The edge is formed in the same manner as with the Assemble Edges command. Once con-nectors begin to be added,the menu changes to reveal more commands. Save Edge is clicked when the edge is complete.Building 2D Structu

251、red Extruded Grids152Extrusion AttributesWhen the connector(s) or edge for the extrusion is defined, the DOMAIN EXTRUSION menu appears, but before marching through the extrusion, there are several attributes for the process that need to be set or, at least, reviewed. Selecting Set Attributes brings

252、up the EXTRUSION ATTRIBS submenu, with the blackboard window now showing the current values for most of the attributes.Building 2D Structured Extruded Grids153Extrusion TypesThe first attribute that needs to be selected is the Type as this will determine the basic character of the domain to be extru

253、ded and also bring up the appropriate command buttons to define the extrusion: Hyperbolic (Hyp) Based on the solution of a set of PDEs prescribing a orthogonal trajectory for the grid lines from the initial grid entity.Normal (Nrml) An algebraic method that mimics the hyperbolic technique. The hyper

254、bolic method is preferred.Rotational (Rot) An algebraic method that sweeps grid in a circular path about a prescribed axis.Translational (Tran) An algebraic method that sweeps grid in a linear path in a prescribed direction.Path An algebraic method that sweeps grid along a connector defined path.Bui

255、lding 2D Structured Extruded Grids154Hyp and Nrml Extrusion AttributesIf extruding from a set of connectors, Focus allows the attributes to be set for individual connectors. This feature is not available if extruding from an edge.Hyp or Nrml are the Type of extrusion set.The initial spacing, s Init,

256、 for the extruded cells can be set, as can the characteristics of the Growth Rate.BeforeIf necessary, flip can be used to change the marching direction. AfterBoundary Conditions and Advanced Settings opens more menus for setting additional controls.Building 2D Structured Extruded Grids155Hyp and Nrm

257、l Boundary ConditionsOnce the desired boundaries have been selected (by picking the appropriate color coded boxes), the boundary conditions can be Set.Splay sets the degree of marching front expansion.Step Suppression lags or accelerates the marching front at nodes.Symmetry X, Y, Z provides true sym

258、metry boundary condition involving ghost.Constant X, Y, Z forces constant value boundary condition. Gridlines may intersect symmetry plane non-normal. Building 2D Structured Extruded Grids156Hyp and Nrml BC EffectsSplay = 0.1 (Default) Splay = 0.0 Constant X Building 2D Structured Extruded GridsThe

259、effect of varying Splay or holding a Constant X at the downstream edge of the advancing grid front is shownbelow. Note that even zero Splay still leads to a slight downstream drift in the boundary as marching progresses. 157Hyp and Nrml BC Effects (Continued)The effect of Step Suppression for Nrml e

260、xtrusions is illustrated below. The outer portion of the grids is generated first by extruding inward from the four connectors on the outer edge - on the left with the default StepSuppression of 0, on the right it set to0.5. The negative coefficient retards the extrusion front at the boundaries of t

261、he growing domains, producing a more square middle region. This leads to a better quality H grid in the center. Step Suppression = 0 (Default) Step Suppression = -0.5Building 2D Structured Extruded Grids158Hyp and Nrml ExtrusionAfter selecting Done in the EXTRUSION ATTRIBS menu, the marching process

262、 can begin back in the DOMAIN EXTRUSION menu. Extrusion can be advanced one layer at a time (Run 1), for multiple layers (Run N), or until a variety of criteria are met (Set Stop Criteria). If the latter two are selected, the windows change to offer appropriate options to complete the selection proc

263、ess. Building 2D Structured Extruded Grids159Rot Extrusion AttributesThe key attributes in a rotational (Rot) extrusion are the ROTATION ANGLE and the ROTATION AXIS. These can be defined by picking from the display or typing via the keyboard.Rotational extrusions are generally more useful in extrudi

264、ng 3D blocks than for 2D domains. Keyboard entry for axis points is similar. Building 2D Structured Extruded Grids160Rot ExtrusionWith the key attributes set, all that remains is to define the number of steps that will be taken to march through the specified rotation angle. Once Run N is clicked, th

265、is can be entered via the keyboard.Note that the rotation axis defined for the extrusion is shown in the display window. In this case, the axis was defined as stretching from 0,-0.5,0 to 1,-0.5,0. The inset image shows the extruded grid.Building 2D Structured Extruded Grids161Tran Extrusion Attribut

266、es The key attributes in a translational (Tran) extrusion are the TRANSLATION DISTANCE and the TRANSLATION VECTOR. These can be defined by picking from the display or typing via the keyboard.Translational extrusions are equally effective in generating 2D domains or 3D blocks. Keyboard entry for tran

267、slation vector is similar. Building 2D Structured Extruded Grids162Tran ExtrusionWith the key attributes set, all that remains is to define the number of steps that will be taken to march the specified distance. Once Run N is clicked, this can be entered via the keyboard.Note that the translation ve

268、ctor defined for the extrusion is shown in the display window. In this case, the vector was defined as 1,1,1. The inset image shows the extruded grid.Building 2D Structured Extruded Grids163Path Extrusion AttributesUnlike rotational and translational extrusions, the direction and, to a large extent,

269、 the distance that a path extrusion will encompass are defined not by any set attributes, but rather the dimensioned connector(s) that make up the path, since successive layers are spaced according to the node distribution along these connector(s).Once Pick Path Cons is selected, the menu changes an

270、d the connector(s) that will make up the path can be picked via the mouse from the display window. Various options for erasing subconnectors from the path, reversing the direction of the path, etc. are also available. Done Picking Subconns. ends path selection.Path Rotations controls whether success

271、ive extrusion layers will maintain the same relative angle to the path toggled off gives a stacked grid. Building 2D Structured Extruded Grids164With the path selected, all that remains is to define the number of nodes to be marched down the path connector(s). Once Run N is clicked, this can be ente

272、red via the keyboard.Note that the path connector(s) are shown as are their nodes in the display window.The inset images show the resulting extrusions, with and without the Path Rotations toggle selected.Path ExtrusionBuilding 2D Structured Extruded Grids165Building 3D Structured Extruded GridsBuild

273、ing 3D Structured Extruded GridsJust as 2D domains can be easily extruded from connectors or edges, 3D blocks can be readily extruded from domains or faces. Indeed, the techniques are basically the same, and the same marching schemes are available:mHyperbolic.mNormal.mRotational.mTranslational.mPath

274、.Building on our 2D extrusion experience, lets continue onto building 3D structured blocks. As before, well skip the initial steps to select analysis software, import geometry, create connectors, and assemble domains.166The “Bottom-Up”Gridgen ProcessSelect Analysis Software and Mesh DimensionalityIm

275、port and Manipulate Database GeometryCreate Segments and ConnectorsDimension Connectors and Distribute Grid PointsCreate DomainsExtrude BlocksSetup CFD Analysis BoundariesExport and Save FilesBuilding 3D Structured Extruded Grids167Extrude BlocksWith one or more domains in place, blocks can be extru

276、ded from either the individual domains or a face formed by combining them. From the MAIN MENU, select Blocks to open the BLOCK COMMANDS submenu. From here, select Create to open CREATE BLOCK. Be sure that the Cell Type is set to structured. Next, its time to select either From Doms (domains) or From

277、 A Face to choose which will be the basis of the extrusion. Building 3D Structured Extruded Grids168Doms vs. FacesFrom Doms A separate extrusion is performed on each individual domain selected, thus allowing each to have its own extrusion attributes. A floating boundary condition is applied at share

278、d connectors so adjacent extrusions blend smoothly. Each domain extrudes to a separate block.From A Face The selected domains form a single face from which a single new block is extruded. As might be expected from the case of domain extrusion, From A Face is preferred for mesh quality and extrusion

279、algorithm numerical stability reasons.If From Doms was selected, the EXTRUDE DOMAINS submenu appears. Domains can then be picked by mouse from the browser window or directly from the display window. When picking is finished, Done is clicked. If From An Face was selected, the ASSMBL EXTRUD FAC submen

280、u appears. The face is formed in the same manner as with the Assemble Faces command. Once complete, Save the Face is selected to finish the process.Building 3D Structured Extruded Grids169Extrusion AttributesWhen the domain(s) or face for the extrusion is defined, the BLOCK EXTRUSION menu appears, b

281、ut before marching through the extrusion, there are several attributes for the process that need to be set or, at least, reviewed. Selecting Set Attributes brings up the EXTRUSION ATTRIBS submenu, with the blackboard window now showing the current values for most of the attributes.Building 3D Struct

282、ured Extruded Grids170Extrusion TypesAs with domain extrusion, the first attribute that needs to be selected is the Type as this will determine the basic character of the block to be extruded and bring up the appropriate options defining the extrusion: Hyperbolic (Hyp) Based on the solution of a set

283、 of PDEs prescribing a orthogonal trajectory for the grid lines from the initial grid entity.Normal (Nrml) An algebraic method that mimics the hyperbolic technique. The hyperbolic method is preferred.Rotational (Rot) An algebraic method that sweeps grid in a circular path about a prescribed axis.Tra

284、nslational (Tran) An algebraic method that sweeps grid in a linear path in a prescribed direction.Path An algebraic method that sweeps grid along a connector defined path.Building 3D Structured Extruded Grids171Since the setup for the various extrusion types is the same for 2D and 3D cases, the corr

285、esponding menus will not be reviewed again. However, to show the 3D process in action, a translational extrusion of the 2D airfoil domain will be performed.Tran Extrusion ExampleBuilding 3D Structured Extruded Grids172Tran Extrusion Attributes As before, the key attributes in a translational (Tran)

286、extrusion are the TRANSLATION DISTANCE and the TRANSLATION VECTOR. These can be defined by picking from the display or typing via the keyboard.In the present example, the vector is 1, 1, 1 and the distance is 1. Building 3D Structured Extruded Grids173With the key attributes set, all that remains is

287、 to define the number of steps that will taken to march the specified distance. Once Run N is clicked, this can be entered via the keyboard. In this case, 20 will be input.Note that the translation vector defined for the extrusion is shown in the display window. Building 3D Structured Extruded Grids

288、Tran Extrusion174Tran Extrusion (Continued)After the steps are entered and the Enter button is clicked, this is the result. If this is not the desired outcome, the extrusion can be reversed to the beginning (Back), by one step (Back 1), or by N step (Back N). If the new block is satisfactory, Done c

289、an be selected.Building 3D Structured Extruded Grids175Building 3D Unstructured Extruded GridsBuilding 3D Unstructured Extruded GridsAs might be imagined, its not possible to extrude a 2D unstructured domain from a connector or edge, which leaves extruding 3D prism blocks from unstructured domains a

290、nd faces. Many aspects of this process are identical to those already discussed with respect to structured blocks, so wont be repeated here, but there are some differences. For example, only four marching schemes are available:mNormal.mRotational.mTranslational.mPath.As well see, its also possible t

291、o mix structured and unstructured domains as the starting point for a combined or combo extrusion.176Select Analysis Software and Mesh DimensionalityImport and Manipulate Database GeometryCreate Segments and ConnectorsDimension Connectors and Distribute Grid PointsCreate DomainsExtrude BlocksSetup C

292、FD Analysis BoundariesExport and Save FilesThe “Bottom-Up”Gridgen ProcessBuilding 3D Unstructured Extruded Grids177Extrude BlocksWith one or more domains in place, blocks can be extruded from either the individual domains or a face formed by combining them. From the MAIN MENU, select Blocks to open

293、the BLOCK COMMANDS submenu. From here, select Create to open CREATE BLOCK. Be sure that the Cell Type is set to unstructured. Next, its time to select either From Doms (domains) or From A Face to choose which will be the basis of the extrusion. Building 3D Unstructured Extruded Grids178Doms vs. Face

294、sFrom Doms For unstructured domains that do not share any edges, separate extrusions are performed on each individual domain selected, thus allowing each to have its own extrusion type. However, connected unstructured domains will auto-matically be combined into a single face. For domains that do re

295、main separate, separate blocks are generated. Of course, this is the only choice for combo extrusions, i.e., from a mix of structured and unstructured domains. From A Face The selected domains form a single face from which a single new block is extruded. If From Doms was selected, the EXTRUDE DOMAIN

296、S submenu appears. Domains can then be picked by mouse from the browser window or directly from the display window. When picking is finished, Done is clicked. If From A Face was selected, the ASSMBL EXTRUD FAC submenu appears. The face is formed in the same manner as with the Assemble Faces command.

297、 Once complete, Save the Face is selected to finish the process.Building 3D Unstructured Extruded Grids179Extrusion AttributesWhen the domain(s) or face for the extrusion is defined, the BLOCK EXTRUSION menu appears, but before marching through the extrusion, there are several attributes for the pro

298、cess that need to be set or, at least, reviewed. Selecting Set Attributes brings up the EXTRUSION ATTRIBS submenu, with the blackboard window now showing the current values for most of the attributes.Building 3D Unstructured Extruded Grids180Extrusion TypesAs with structured block extrusions, the fi

299、rst attribute that needs to be selected is the Type as this will determine the basic character of the block to be extruded and bring up the appropriate options defining the extrusion: Hyperbolic (Hyp) Not available for unstructured block extrusion.Normal (Nrml) An algebraic method that mimics the hy

300、perbolic technique. Rotational (Rot) An algebraic method that sweeps grid in a circular path about a prescribed axis. Note that axis cannot lie on an edge of the initial front as this will result in degenerate prism cells along edge.Translational (Tran) An algebraic method that sweeps grid in a line

301、ar path in a prescribed direction.Path An algebraic method that sweeps grid along a connector defined path.Building 3D Unstructured Extruded Grids181Nrml Extrusion ExampleSince the setup for the various extrusion types is the same as with the 3D structured extrusions, the corresponding menus will no

302、t be reviewed again. However, to show the process in action, a normal extrusion starting from an unstructured 2D domain built around the airfoil geometry will be performed.Building 3D Unstructured Extruded Grids182Nrml Extrusion Attributes The Type is set to Nrml. In this particular case, we want a

303、uniform marching distance, so the initial s will be set to the desired step size (0.1) and the Growth Rate will be set to 1. Once the values are entered via the keyboard, Enter is clicked to return to the EXTRUSION ATTRIBS menu. Note that the blackboard window shows the updated values for the change

304、d attributes.Building 3D Unstructured Extruded Grids183With the key attributes set, all that remains is to define the number of steps that will taken to march the specified distance. Once Run N is clicked, this can be input via the keyboard. In this case, 10 will be entered.Nrml ExtrusionBuilding 3D

305、 Unstructured Extruded Grids184Nrml Extrusion (Continued)After the steps are entered and the Enter button is clicked, this is the result. If this is not the desired outcome, the extrusion can be reversed to the beginning (Back), by one step (Back 1), or by N step (Back N). If the new block is satisf

306、actory, Done can be selected.Building 3D Unstructured Extruded Grids185Creating Hybrid GridsCreating Hybrid GridsGridgen supports construction and export of hybrid grids grids which contain a mixture of cell types. Cell types currently supported by Gridgen include quadrilaterals, triangles, hexahedr

307、a, tetrahedra, prisms, and pyramids. With the exception of pyramids, grid construction with all of these cell types has already been discussed, so the tools needed to generate hybrid grids are already known for the most part. Indeed, a 2D example, the airfoil mesh here, has already been considered.

308、Other 2D hybrid grids could be built in a similar fashion.186Similarly, an example of a 3D hybrid grid has also been built. Interestingly, the unstructured block here contains two types of cells, tetrahedra and pyramids. The pyramids were created automatically by the unstructured solver along the up

309、per surface of the unstructured block to interface the tets below with the structured domains bounding that surface. This is the only case where Gridgen creates blocks with mixed cell types, although a structured block may contain degenerate hexes when the block contains a singularity. The inset sho

310、ws the pyramids in the first layer of cells in the unstructured block in a view looking up from below the wing leading edge is on the right. Creating Hybrid Grids (Continued)Creating Hybrid Grids187Pyramids and the Unstructured SolverThe characteristics of the pyramids generated by the unstructured

311、solver can be controlled just like those of the tetrahedra. The controls are located in the SELECT GRID CONTROL PARAM submenu and include:Min Height setting the minimum allowable pyramid height.Max Height setting the maximum allowable height.Aspect Ratio specifying the aspect ratio used to scale nom

312、inal pyramid height to give the true pyramid height (default is 1).Display toggling whether the pyramids will be displayed while within the solver.Creating Hybrid Grids188Creating Hybrid GridsStructured Viscous Layer Hybrid GridsMost hybrid grids are constructed for viscous analyses. Generally they

313、are created with either a prism (left) or hex (right) viscous layer, both of which provide proper grid structure and growth through the thickness of the layer. The remainder of the volume is usually filled with tets.189Combo ExtrusionIts also possible to combine the extrusion of structured and unstr

314、uctured domains into a hybrid grid. The extrusion has to be performed From Doms (domains), and then the remaining attributes for each domain are individually set. Both the structured and unstructured blocks can then be extruded simultaneously. Here is an example of a translational combo extrusion of

315、 the airfoil geometry. Creating Hybrid Grids190Mixing Layer TypesCreating Hybrid GridsSometimes is may be desirable to have mixed layer types. In other words, have prism layers on some or most of the geometry surface and fill in with hex layer blocks. This type of construction is suitable for: mCase

316、s where certain parts of the geometry cannot be easily extruded.mCases where certain parts of the geometry require the resolution or distribution control of a structured block. In these instances, combo extrusion can often be effectively employed (as at right). If not, the prism blocks are to be ext

317、ruded first, and the structured blocks then assembled from the exposed prism layer quad faces and additional structured domains as required.191ReviewGridgenTrainingmIn this session:mBuilding 2D Structured Extruded Grids.mBuilding 3D Structured Extruded Grids.mTutorial: “Swept Ramp: Advanced Multi Bl

318、ock Structured Grid.”mBuilding 3D Unstructured Extruded Grids.mCreating Hybrid Grids.mTutorial: “Droplet in a Cylinder: Hybrid Grid.”192GridgenTrainingmIn this session:mLayer Manager.mTutorial: “Cubes and Spheres: Layer Manager.”mAdvanced Tools.mTutorial: “B-747 Nacelle: Working with an IGES Databas

319、e.” Overview193The Layer ManagerGridgens layer manager provides flexible control over what portions of a database model are displayed. Its very similar in style to that of common CAD software packages. Indeed, the layer manager preserves layer information from the original CAD models when they are i

320、mported into GridgenEach database entity can be assigned to only one layer (there are 1024 total layers available). Each layer can be likened to a transparency overlay, the user choosing which layers are visible at any given time in the Display Window. Once defined, the layer information is saved in

321、 the composite database file (.dba) for future editing sessions.The layer manager is accessed by clicking on the Layer Manager button in the MAIN MENU or the DATABASE COMMANDS menu (or via the M hot key).Layer Manager194The Layer Manager PanelThe layer manager panel is a separate desktop window. The

322、 M hot key can be used to pop it to the top of all other desktop windows at any time, even when the panel has already been opened. The box on the bottom of the window can be toggled to always keep it on top of the main Gridgen window. The panel has four logical sections: The Layer Browser List, List

323、 Filters, Layer Operations, and Saved Layer Sets.Layer Manager195The Layer Browser List is used to select individual or sets of layers to operate on. The list has three columns: Layer lists the layer numbers (0 1023), with * indicating the current working layer where, for example, newly created data

324、base entities will be placed. Ents contains + or symbols indicating whether the layer contains enabled or disabled, respectively, database entities (no symbol indicates a layer is empty).Description contains each layers user-supplied name. Text color indicates layer status: layers in red are current

325、ly on and their entities rendered in the display (if enabled), while layers in black are currently off and their entities arent rendered (even if enabled). Layers highlighted in blue are currently selected for layer operations. In addition to the *, the current working layer is also highlighted in g

326、reen.The Layer Browser ListLayer Manager196The Layer Filters are used to manage which layers will be shown in the Layer Browser List. They are, in order of precedence:Show Empty if toggled (the default), the browser list will show all layers, including those containing no entities. If off, empty lay

327、ers will not be listed.Description Layers whose descriptions do not include the text string entered in the adjacent text entry field (including wildcards, *) are removed from the browser list.Range Layers whose layer numbers are not in the list entered in the adjacent text entry field are removed fr

328、om the browser list. The list can contain no spaces with non-sequential numbers separated by commas and ranges of numbers separated by dashes.Remember that the current working layer is always shown, regardless of any filtering applied.List FiltersLayer Manager197These functions operate on the layer(

329、s) selected in the Layer Browser List:Isolate sets the selected layer (its only available if a single layer is picked) to the current working layer and turns off all others.Description opens a dialog panel where an alpha-numeric description can be typed which will be applied to the layer(s) selected

330、.Set Current sets the selected layer (only available when a single layer is picked) to the current working layer. All subsequently created database entities will be assigned to this layer (until another is made the current working layer).Move opens a dialog panel where a target layer number can be e

331、ntered. The selected layer will be moved to this layer. Options allow moved layers to take their descriptions and on/off status as indicated.Layer OperationsLayer Manager198Combine opens a dialog panel where a target layer number can be entered. The entities in the selected layers will be combined i

332、nto this layer.The Status commands simply change the on/off state of the selected layer(s):All On turns on display of all layers.All Off turns off display of all layers except the current working layer.On turns on the layers currently selected in the browser list.Off turns off the layers currently s

333、elected in the browser list.Toggle reverses the on/off state of all layers.Right clicking on individual or multiple layers can access some of these operations.Layer Operations (Continued)Layer Manager199The Saved Layer Sets tools store and recall on/off states of all layers, as well as the designate

334、d current working layer. Saved layer sets do not preserve any filter settings.Save opens a dialog panel where the name of the new saved layer set is entered.Restore restores the saved layer set selected from the Saved Layer Sets browser.Delete removes the selected saved layer set from the Saved Laye

335、r Sets Browser.Saved Layer SetsLayer Manager200Layer AssignmentIn addition to the Move and Combine commands previously discussed, there are two other ways that database entities can be assigned to layers:If an IGES or native CAD file is imported via Database Import in the INPUT/OUTPUT COMMANDS menu,

336、 all level information in the file is transferred to Gridgens layers.Assign Layer in the DATABASE COMMANDS menu can also be used to manually reassign the layers to which entities belong. Once selected, the browser window changes to list all available database entities. This list only shows entities

337、that can be assigned to a layer. Entities in layers whose status is off are not available for reassignment and are not shown. This list is also subject the enable/disable status of each entity in the currently displayed layer set disabled entities are not available. Once the entities to be reassigne

338、d are chosen and Done is clicked, the browser window changes to show all 1024 layers by number, a + or indicating their enabled or disabled status, and finally their layer descriptions. Selection from this list immediately assigns the chosen entities.Layer Manager201Another way that database informa

339、tion can be controlled in the GUI display is via the appropriate commands in the DISPLAY COMMANDS menu. En/DisableHow individual entities are rendered can be selected via the Edit Dspla DB command. The En/Disable DB command allows database entities to be temporarily “turned off,” minimizing how the

340、are rendered and removing them from the pick list. The Show DsbldDB and EnbldDB toggles provides further quick controls on how these two groups of entities are rendered. Of course, similar controls are available for domains and blocks as well.Layer Manager202Advanced ToolsAdvanced ToolsA number of a

341、dvanced tools exist in Gridgen for manipulating grid and database entities. Most of these can be found in the DB Modification and the Modify Connector, Domains, and Blocks sub-menus, as indicated in the table on the right. Some of these tools have already been discussed or applied in the tutorials.

342、In this section, a more systematic look at these and a few other useful commands not found in the modify menus will be provided.203TransformationsAdvanced ToolsTransformation commands can be applied to all entity types from the corresponding menu. They include: Translate alters one or more selected

343、entities by moving them to a new position in Cartesian space. User picks handle and provides x, y, and z offsets.Rotate alters one or more selected entities by rotating them about a specified axis. User picks axis and provides rotation angle.Scale alters one or more selected entities by scaling. Use

344、r picks anchor (fixed point during scaling) and provides handle or x, y, and z scale factors.Stretch alters one or more selected entities by scaling along a defined vector. User picks anchor and handle.Mirror reflects selected entity about a specified plane. 204Transformations (Continued)Advanced To

345、olsAs an example, the Scale command will be used to modify the airfoil database geometry.From the MAIN MENU, Database is selected to open the DATABASE COMMANDS menu.Import is used to read in the reext.dba file from the appropriate directory, and Modify is then chosen to open the MODIFY DB ENTITIES m

346、enu.Pick All is selected to pick the pair of entities that comprise the airfoil geometry. When Done is selected, the DB MODIFICATION menu will open, and Scale can be picked. 205Transformations (Continued)Advanced ToolsOnce Scale is selected, the menu changes to allow the anchor point to be selected

347、via the mouse from the Display or entered via the keyboard. In this example, the leading edge will serve as the anchor, and the mouse cursor has been moved into position. 206Transformations (Continued)Once the anchor point has been selected, it becomes highlighted with a circle. The scale can be set

348、 graphically by picking a handle point, either by mouse clicking in the Display window or by typing via the keyboard. Alternatively, scale factors can be entered via the keyboard. In this example, Enter Handle via Keybrd will be selected, and 1.5, 1.5, 0 is entered for the handle point.Advanced Tool

349、s207Once the handle point is defined, a black square (the handle point) appears with a cross superimposed in the Display window. By holding down the right mouse button, the cross is moved, scaling the selected database entities, as seen at right. The original database entities are shown in pink, whi

350、le the scaled entities appear in black. When the desired scaling has been achieved, Done Scale is selected to complete the process. Stretch is setup similar to Scale by defining anchor and handle points.Transformations (Continued)Advanced Tools208Advanced ToolsMirror is a special version of the scal

351、e command that reflects either database or grid entities about a plane (either a coordinate plane or a previously defined plane in the database).To see how it works, the lower database curve from the airfoil has been deleted so it can be replaced by mirroring the upper surface database curve.After s

352、electing Modify in the DATABASE COMMANDS menu, the upper airfoil database entity is selected and Mirror selected in the DB MODIFICATION menu. This leads to the SELECT PLANE menu at right. The Y=0 plane is selected to perform the reflection. Transformations (Continued)209Transformations (Continued)Th

353、is is the result. If satisfactory, Done Mirror is selected to complete the process. If not, Abort Dont Mirror can be selected to cancel.Note: The Mirror command here in the Modify submenu will simply move the existing database entity. To recreate the airfoil, the Mirror command in the Copy submenu w

354、ould be used to make a mirror copy of the upper surface database entity, leaving the upper surface entity in place.Advanced Tools210Split/JoinAs with the transformation commands, Split and Join are found in the DB MODIFICATION and MODIFY CONNECTOR, DOMAINS, and BLOCKS menus.Split is used to divide a

355、 database or grid entity into two separate entities.Join is used to assemble individual entities into a larger entity. Advanced Tools211Advanced ToolsSplit/Join (Continued)As an example, the upper surface of the airfoil database will be split.After selecting Modify in the DATABASE COMMANDS menu, the

356、 upper airfoil database entity is selected and Split selected in the DB MODIFICATION menu. This leads to the SPLIT menu at right. The Hiliter, , is moved along the entity via the mouse while holding down the right mouse button or via the menu commands. Once the desired location is found, Split at Hi

357、liter is selected. The menu changes, and the choice is confirmed by clicking on Split It?212Advanced ToolsIn the case of connectors, the SPLIT CONNECTOR menu opens after the connector to be split has been selected and Split in the MODIFY CONNECTOR menu chosen.Here, the cursor, , is moved along the c

358、onnector via the mouse while holding down the right mouse button or via the menu commands. Once the desired location is found, Split at Cursor or Split at Picked is selected.The split is immediately made, and the cursor moves to the next connector to begin again. If no more splits are needed, Abort

359、Dont Split should then be selected.Split/Join (Continued)213For structured domains, the SPLITTING A DOMAIN menu opens after the domain has been picked and Split in the MODIFY DOMAINS menu chosen.Here, the choice of constant I Lines or J Lines (as in I and J coordinates) must be made first by togglin

360、g the corresponding button. The hilite is then moved across the corresponding coordinate curves via the mouse while holding down the right mouse button or via the menus keyboard command. Once the desired location is found, Done - Split at Hilite is selected.The split is immediately made, and the GUI

361、 returns to the DOMAIN COMMANDS menu.Split/Join (Continued)Advanced Tools214For structured blocks, the SPLITTING A BLOCK menu opens after the block has been picked and Split in the MODIFY BLOCKS menu chosen.Here, the choice of constant computational coordinate sur-faces ( , , ) must be made first by

362、 toggling the corresponding button. The selection surface is then moved via the mouse while holding down the right mouse button, the arrow buttons, or the menus keyboard command. Once the desired surface is found, Done - Split at Surface is picked.The split is immediately made, and the GUI returns t

363、o the BLOCK COMMANDS menu.Split/Join (Continued)Advanced Tools215Split/Join (Continued)Joining entities is even easier and follows a similar process for all entities. As an example, the two blocks just split from the airfoil model will be reassembled. The first block to be joined is picked from MODI

364、FYING BLOCKS menu. Once selected, the MODIFY BLOCKS menu opens, and Join is selected. Here the other block is picked via the mouse from the Display window. Once picked, the two blocks are immediately joined, and the GUI returns to the BLOCK COMMANDS menu.Advanced Tools216For the next example, the tw

365、o-dimensional airfoil database must be modified into a three-dimensional wing. The initial steps are:1. The reext.dba database file is imported.2. The two database entities making up the airfoil are copied.3. The copies are translated 1 unit in the z-direction.4. Two Curve Line entities are created

366、connecting leading and trailing edges of the original airfoil and the copy.Create is next picked.Database CreationAdvanced Tools217In the DB CREATION menu, Coons is selected to define a Coon surface forming the upper wing. The four database entities marking the boundaries of the upper surface are th

367、en picked via the mouse. Once selected, Done is picked and the surface saved. The process is then repeated for the lower wing surface the last entity, the trailing edge, is just about to be selected.Database Creation (Continued)Advanced Tools218ProjectionThis unstructured domain will now be projecte

368、d to the upper surface wing database.The first step will be to disable the database entities that make up the lower surface of the wing. Once that is done, the four connectors can be projected to the upper wing surface, followed by the rest of the domain.1,0,00,0,11,0,1202020500,0,0Advanced Tools219

369、Projection (Continued)This opens the MODIFYING CONNECTORS menu, where the four connectors can be chosen via the mouse. When Done is selected, the MODIFY CONNECTOR menu opens.In the CONNECTOR COMMANDS menu, Modify is selected.Here, Project is selected.This opens SELECT PROJECTION, where Closest Pt (i

370、.e., the connectors grid points will be moved to the closest points on the database entities) is chosen.To make sure all grid points on the connectors are projected, Nodes Too is selected. Done Project is then clicked.Done Replace Connectors finishes the process.Advanced Tools220Projection (Continue

371、d)Advanced ToolsWhile all of the edges of the domain are now coincident with the database, the interior of the domain is not. This can be seen using the Examine command. Again, the first step is disabling lower surface database entities. 221Projection (Continued)Advanced ToolsThis opens the MODIFYIN

372、G DOMAINS menu, where the domain can be chosen via the mouse. When Done is selected, MODIFY DOMAINS opens.In the DOMAIN COMMANDS menu, Modify is selected.Here, Project is selected.This opens SELECT PROJECTION, where Closest Pt is again chosen.Since the edges are already on the database, Int Pts is c

373、hosen. Done Project is then clicked.Replace Domains finishes the process.Maintain Linkage is clicked in the CONFIRM menu.222Advanced ToolsProjection (Continued)The domain is now projected to the upper wing database. The process could be repeated to project another domain onto the lower wing.223Misce

374、llaneousAdvanced ToolsThe remaining commands in this table have more limited uses so will only be summarized:Re-extrude allows previously extruded domains and blocks to be extruded again.Smooth provides a means of smoothing database curves through fitting.Add is used to add a segment on the end of a

375、n existing connector.Insert is used to insert a segment into a connector.Erase will remove segment(s) from a connector.Edit allows individual control points in a segment to be re-positioned.Least Squares Fit replaces a dimensioned connectors shape with a least squares fit of its grid points.224Gridg

376、enTrainingmIn this session:mLayer Manager.mTutorial: “Cubes and Spheres: Layer Manager.”mAdvanced Tools.mTutorial: “B-747 Nacelle: Working with an IGES Database.” Review225226GridgenTrainingmIn this session:mGlyph.mTutorial: “Converging-Diverging Nozzle: Using Glyph Scripting.”Overview227GlyphGlyphG

377、lyph, Gridgens scripting language, is based on the Tcl programming language and provides a text-based, procedural interface to Gridgens features. Glyph scripts can be useful for:mEstablishing preferred display states and default values.mStarting Gridgen and automatically importing database and Gridg

378、en files for current mesh building projects.mEncapsulating repetitive tasks.mRunning Gridgen in batch mode.mDeveloping specialized meshing applications.#Gridgen(V.15.08REL1)InitializationScript#WrittenMonJan100:00:002000#Thisfilewillbeautomaticallyloadedifnamed_gridgenrc#andlocatedintheworkingdirect

379、oryoryourhomedirectory.#DEFAULTSgg:defDbCoordDispUVgg:defCFBGTMgg:defCFFGHILGENSTOCKgg:defConDistBeg0.0gg:defConDistEnd0.0gg:defConDistFuncTANHgg:defConMaxAng0.0gg:defConMaxDev0.0gg:defConSurCrv0gg:defQuickSavequicksave.gggg:defUnsIpts1gg:defUnsMaxAng0.0gg:defUnsMaxDev0.0gg:defUnsMaxMem64gg:defUnsPy

380、rAR0.5gg:defUnsPyrMax0.0gg:defUnsPyrMin0.0gg:defUnsTetDecay0.5gg:defUnsTriBndDecay0.5gg:defUnsTetBndDecay0.5gg:defUnsTetMax0.0gg:defUnsTetEdgeMax0.0gg:defUnsTetMin0.0gg:defUnsTetEdgeMin0.0gg:defUnsTriDecay0.5gg:defUnsTriMax0.0gg:defUnsTriEdgeMax0.0gg:defUnsTriMin0.0gg:defUnsTriEdgeMin0.0gg:defJoinAn

381、g0.0gg:defSplitAng0.0#RUNSTRUCTUREDSOLVER#gg:domTFISolverRun$dom_Agg:domEllSolverAtt$dom_A-bg_controlLAPLACEgg:domEllSolverBegin$dom_Asetresultsgg:domEllSolverStep-iterations100#Printouttheresidualresultsneatlyputsiterresidualmaxresidforeachiresmaxres$resultsputsformat%4d%-8.4e%8.4e$i$res$maxresgg:d

382、omEllSolverEnd#EXPORTPLOT3DGRIDFILE#gg:domExportALLbump.grd-stylePLOT3D-formatASCII-precisionDOUBLE#SETFLOWSOLVER#228Executing Glyph ScriptsGlyphThere are four ways to execute a Glyph script :mPlacing the script file _gridgenrc (on Windows platforms) or .gridgenrc (on Unix platforms) in the home or

383、root folder, respectively, or setting the environment variable GRIDGEN_RCFILE to the path/name of the Glyph script will lead to the scripts execution on Gridgen startup.mEntering the script files name on the Gridgen command line (will execute after any RC script).mRunning Gridgen in batch mode by en

384、tering gridgen b my_glyph_script.glf on the command line (Unix) or at the DOS prompt (Windows).mSelecting Execute Script in the GLYPH COMMANDS menu.229Glyph CommandsGlyphThe following commands are available in the GLYPH COMMANDS menu: Execute Script select script for execution using the file browser

385、.Re-execute Last Script executes the previously executed script. Begin Journaling begin writing all Gridgen actions to a Glyph script file. End Journaling cease writing to Glyph script file.Add Variable add variable which is recorded in the current journal or available during the current non-journal

386、ed session.Add Comment insert comment into script file at the current point in a journal session. 230JournalingJournaling is a Gridgen mode during which GUI commands are written to a file as their Glyph equivalents, thus allowing a meshing session to be captured and later replayed. As there isnt a o

387、ne-to-one correspondence between GUI and Glyph commands, commands without Glyph equivalents will be grayed out during journaling. During journal sessions, a notation to that effect appears in the top left of the Display window, along with the name of the journal file being written to.Glyph231Begin J

388、ournalingWhen Begin Journaling is selected in the GLYPH COMMANDS menu, the INITIALIZE JOURNAL menu appears. The first three buttons offer choices for initialization commands to be written at the top of the journaled Glyph script: Clear/Reset All will clear all entities and reset all tolerances and d

389、efaults. This would be chosen to ensure that the replayed script starts completely afresh. Echo State to File writes current defaults and tolerance settings to the journal file, but does not clear any existing grid or database entities. No Initialization as indicated no initialization commands will

390、be saved. Care must be taken with the latter two options that the resulting script file is not dependent on the starting conditions or that the required starting conditions exist when it is replayed.Glyph232GlyphThe Update Policy options define how the journaled script will update the Display window

391、 when replayed: Update Display will lead to the Display being updated when any entities change appearance (including creation). Check Input will lead to the Display being updated only when an explicit Tcl call is included in the script. The results of the script will otherwise only appear once the s

392、cript finishes.Apply Options writes the initialization and update policy commands to the journal file.Skip Initialization indicates that no such commands should be written to the journal file.Once one of these two buttons is selected, journaling will be enabled.Begin Journaling (Continued)233Variabl

393、esVariables are name-value pairs that can be defined and used in Gridgen for parameters that will be used often. Used in conjunction with journaling, variables can be used for parameters that need to be easily changeable for remeshing. Such a variable need only be changed in one location to effect c

394、hanges throughout the mesh. Their values may be scalar or vector, real or integer or string. Once defined, they may be used whenever Gridgen requires input via the Text Input window. For example, suppose a variable named A is defined and assigned an integer value. When prompted for the number of gri

395、d points to dimension a connector, $A could be typed in, and As value would then be used for this dimension. If two such integer variables were defined (say A and B), a connector could be dimensioned with their sum by typing expr$A+$B at the prompt. The process of defining a variable begins by selec

396、ting Add Variable in the GLYPH COMMANDS menu. A new name can then be entered or an existing variable can be selected to reassign its value.Glyph234Add VariablesGlyphOnce a new variable name has been entered or an existing variable chosen, Enter is selected and the ADD VARIABLE menu appears with the

397、following options:Mode Local, when journaling, limits the scope of the variable to the journaled script only.Mode Global, when journaling, makes a variable persist after a script ends.Enter Tcl Expression defines the variable by a Tcl expression entered in the Text Input window. The expression can s

398、imply be a numerical value or a line of Tcl programming commands.Pick Point on DB assigns to the variable a 3-element list of the parametric u and v coordinates and ID of the point on a database entity picked in the Display window.235Add Variables (Continued)GlyphPick XYZ Point assigns to the variab

399、le the 3-element list of x, y, and z coordinates of the point picked in the Display window.Pick DB Entities assigns to the variable the list of IDs of the database entities picked in the Display window.Pick Connectors assigns to the variable the list of IDs of the connectors picked in the Display wi

400、ndow.Pick Domains assigns to the variable the list of IDs of the domains picked in the Display window.Pick Blocks assigns to the variable the list of IDs of the blocks picked in the Display window.236GlyphModesGlyph is modal. Certain commands are only available after a given mode has been entered. E

401、ach commands reference page in the Glyph Reference Manual lists the mode or modes where the command is available. The table on the following slides summarizes all of the modes, which command enters the mode, which command exits the mode, and a brief description of the mode.Additionally, some command

402、s can be used during text input via Gridgens Text Input window. Only Glyph commands that perform queries without altering the grid system or requiring a specific mode can be used.237GlyphModes (Continued)238GlyphModes (Continued)239Tcl SyntaxCommandsA Glyph script is composed of a series of commands

403、. These commands may be native Tcl functions, Glyph-specific functions, or user functions defined elsewhere in the script. Each line in a Tcl script starts with a command followed by zero or more arguments separated by spaces. Commands terminate by the end-of-the-line or by a semicolon ; enabling mu

404、ltiple commands to be entered on the line:setA10;setB10VariablesAs noted before, variables are name-value pairs. Values are assigned to variables for substitution in subsequent commands. Tcl variables do not need to be declared before using them. Variable names are case sensitive. As shown above, va

405、riables are assigned values with the set command, and their values obtained by prepending $ to their names:setC$AGlyph240GlyphTcl Syntax (Continued)ArraysArrays are special types of variables used to form more complex data structures. They use string-valued indices to access the multiple values stor

406、ed under a single variable name. As the index is string-valued, it can be any type of string: a number, a word, a phrase, or any combination. The indices are delimited by parentheses (). As the parentheses are not a grouping mechanism, care should be used in using indices with spaces (or, better yet

407、, avoid using spaces in indices altogether). The syntax for defining an array element is:setarray(index)value Once defined as an array, a variable cannot be subsequently used as a regular, non-array variable, i.e., given the above declaration, a subsequent declaration of the form below would result

408、in an error:setarrayvalue The index of an array can itself be a variable.241Tcl Syntax (Continued)GlyphGroupingAs noted previously, spaces are used to separate arguments of a command. Multiple words are grouped into a single argument by double quotes “” or braces . Double quotes allow variable and c

409、ommand substitution, but braces do not. Braces are typically used when no substitutions are desired or to delay substitution as in a conditional statement or loop.Braces can also be used to delimit odd variable names, including those containing characters other than letters, numbers, and underscore:

410、setnewvar5Braces and double quotes include everything between them, including semicolons and new lines. Braces inside double quotes are treated as regular characters. A backslash is needed before a double quote or brace to use it as a regular character:setA“Use”forquote”242Tcl Syntax (Continued)Comm

411、and SubstitutionThe value returned by a function can be substituted into a command by enclosing the call in square brackets:setB81setrootexprsqrt($B)Here root is being assigned the value of the square root of B. As Tcl does not support math functions directly, Tcl commands such as expr are required.

412、 Note the use of the braces to group the argument for expr.Functions can be nested. In such instances, the most deeply nested commands are performed first. Commands at the same nesting level are evaluated from left to right.CommentsA comment is indicated by inserting a pound character # at the begin

413、ning of a line. The comment is continued until the end of the line or can be carried onto the next line by using a backslash . Semicolons will not terminate a comment, but they can be used to terminate a command so that a comment can be added on the same line:setB81;#SetthevalueofBto81Glyph243Glyph

414、ConventionsFunction NamingAll Glyph commands begin with either gg: or ggu: to avoid possible naming conflicts with standard Tcl commands. Commands starting with gg are the main routines that correspond to Gridgen commands, while those beginning with ggu are generally supporting routines that have no

415、 direct correlation to functionality within Gridgen.Glyph commands follow the form:gg: ?entity_ids?arguments?where is the type of object or entity that is the subject of the action and is the action itself. The first argument after the commands name is the list of entities to be operated on, followe

416、d possibly by additional flags or arguments. For commands that can operate on more than one entity, All can be used to collectively indicate all appropriate entities as the argument.Here are the values used in Glyph commands:asw analysis software settingsblk blocks db database entities def default s

417、ettingscon connectorsdisp display settingsdom domainsedge domain edgesface block facesseg connector segmentstol tolerance settingsxform transformationsGlyph244Glyph Conventions (Continued)GlyphEntitiesEach individual entity of the four major types in Gridgen (Connectors, Domains, Blocks, and Databas

418、e entities) has a unique identifier. Sub-blocks and sub-domains also receive unique identifiers. These identifiers are obtained either as return values when creating the entity, loading the entity, or through direct query. For example, a list of all connector identifiers in a model could be obtained

419、 with:setconIDListgg:conGetALLIdentifiers should never be hardcoded in a script. There is no guarantee that they will remain the same across Gridgen releases.245PointsGridgen points have two forms: Free points consist of lists of three floating-point values representing X, Y, and Z coordinates, e.g.

420、, setptlist1.02.03.0 Database constrained points consist of two floating-point values (normalized U and V coordinates) and a third value representing the database entity identifier. The UV values are always between 0 and 1, inclusive.Some Glyph commands can take either form with an appropriate flag,

421、 but most commands require XYZ coordinates. Fortunately, gg:dbUVTtoXYZ can convert from UVD to XYZ coordinates:setdb_ptlist0.51.0$db_curvegg:conSetBreakPt$congg:dbUVToXYZ$db_ptConversely, gg:dbSurfClosestPt will convert XYZ to UVD coordinates:setxyzlist1.02.03.0setdb_ptgg:dbSurfClosestPtALL$xyzIf th

422、e point xyz is on the surface of any enabled database entity, the returned value will be that point in UVD form. Otherwise, the command will return the closest point on an enabled database entity. To find the point or closest point projection on a specific database entity, that entitys identifier re

423、places ALL.Glyph Conventions (Continued)Glyph246Control StructuresIf Then ElseConditional statement of the form:ifexpression?then?body1?else?body2If expression is true, then the command listed in body1 is executed, otherwise that in body2 is executed. The then and else are optional. Multiple conditi

424、onals can be chained together with elseif. Typically, braces are placed around the command bodies and conditionals to avoid confusion. Heres an example:if$sp=0setspacing0.5elseif$sp0.5setdsexpr0.5*$ds249GlyphControl Structures (Continued)ForeachConditional statement of the form:foreachvarvaluesbodyT

425、his command loops over body once for each value in the list of values with var taking on successive values in the list. It is recommended that list be used to define the list of values (double quotes can be used, but may lead to unexpected results). Heres an example:foreachdblist$db_1$db_2$db_3gg:db

426、Enable$db250ForConditional statement of the form:forstarttestnextbodyThestart,next, and body arguments are commands. The testargument is an expression. The command begins with start. While test is true, body is executed followed by next. This is repeated until test is false.setvalue0forsetj0$j10incr

427、jsetvalueexpr$value+$jThe incr command used here increments j by 1 an optional second argument for incr could be used to specify a different increment.Break and ContinueLoop execution can be immediately exited with Break, while Continue skips the remainder of the current loop and begins the next ite

428、ration.Control Structures (Continued)Glyph251ProceduresGlyphNew functions, or procedures, can be defined within a script using the following:procnameargsbodyThe new function is called name, replacing any previous function called name (caution is advised). The name is case sensitive. The formal param

429、eter list, args, is next, and the actions to be executed by the function follow in body. If a value is to be returned from the procedure, the return command is used. Heres an example:procxValptsetxlindex$pt0return$xsetptAlist1.02.03.0setxxVal$ptAHere, xVal is given a list of values representing the

430、XYZ coordinates of a point. It uses the lindex function to extract the first element in the series (Tcl starts numbering list elements at 0) and returns the value. In the second section, ptA is defined, and x is then defined with the results of xVal. In this case, it will end up with the value of 1.

431、0.252GlyphProcedures (Continued)Procedures have a separate scope from the rest of a script, meaning that variables defined within a procedure are not shared outside of the procedure unless they are explicitly defined as global variables. Conversely, a variable defined outside of a procedure cannot b

432、e used within unless it is passed into it or defined as a global variable. The result is that variables sometimes need to be shared inside and/or outside of a procedure.The global command can do this:globalvarname1varname2defining variables named varname1, varname2, etc. The global command has to ap

433、pear in each scope where access to the same variable is desired. Hence, for a variable to be shared in both inside and outside a procedure, the corresponding global command must also appear inside and outside of that procedure.253GlyphListsTcl lists are simply sequences of values and can be establis

434、hed in a variety of ways:setlist1listab1.0setlist2“ab1.0”setlist3ab1.0setlist4ab1.02.03.0cdNote that the last example above has lists inside the list. The first example is preferred as it is somewhat more efficient.Elements of a list are accessed via the lindex command (remembering that Tcl starts e

435、lement numbering with 0 hence the third element has the index of 2):setListlistabcde#Getthevaluecsetellindex$List2#Getthelengthofthelistsetlenllength$ListThe llength command gives the length of a list.254FilenamesGlyphAs file conventions on UNIX and Windows platforms are different, Tcl provides for

436、file naming and handling in a cross-platform manner. The file command has numerous options for operating on file names. Here are a few:filedirnamename Returns the parent directory of the file namefileexistsname Returns 1 if name exists, 0 otherwisefileextensionname Returns the extension of file name

437、, including the dotfilejoinpathpath.Joints pathname components into a new pathnamefilenativenamename Returns the platform-native version of namefilereadablename Returns 1 if name has read permissions, 0 otherwisefilerootnamename Returns all but extension of name (including directory)filetailname Ret

438、urns the last pathname component of namefilewritablename Returns 1 if name has write permissions, 0 otherwise255Error HandlingErrors occasionally occur, e.g., when invalid values or an improper number of arguments are passed to a function. If uncaught, the error will cause the termination of the scr

439、ipts execution. The catch command can be used to trap and handle errors:catchcommand?result?The command argument is a body of commands to be executed. If the commands return an error, catch returns a non-zero value. If the optional result argument is present, it names a variable which is set to the

440、error message. If the commands execute successfully, catch returns a zero value and, if present, the result argument is set to the commands return value. Heres an example:ifcatchcommandarg1.resultputs“error:$result”returnelse#noerror,continueonwithexecution,result#containsreturnvalueAn error conditi

441、on is raised in a function with the error function:error?message?info?code?The message argument is a string that would be stored in the result variable of catch. Glyph256GlyphInitializing GridgenPlacing the script file _gridgenrc (on Windows platforms) or .gridgenrc (on Unix platforms) in the home o

442、r root folder, respectively, or setting the environment variable GRIDGEN_RCFILE to the path/name of the Glyph script will lead to the scripts execution on Gridgen startup.A quick way to create such a file is by selecting Export Glyph Init File in the INPUT/OUTPUT COMMANDS menu. This opens the GLYPH

443、FILE submenu where the new file to be created or existing file to overwrite can be selected. The _gridgenrc or .gridgenrc file created here will contain all of the default and display command settings from the current e Gridgen session.The file can be subsequently edited as desired.257#Gridgen(V.15.

444、08REL1)InitializationScript#WrittenMonJan100:00:002000#Thisfilewillbeautomaticallyloadedifnamed_gridgenrc#andlocatedintheworkingdirectoryoryourhomedirectory.#DEFAULTSgg:defDbCoordDispUVgg:defCFBGTMgg:defCFFGHILGENSTOCKgg:defConDistBeg0.0gg:defConDistEnd0.0gg:defConDistFuncTANHgg:defConMaxAng0.0gg:de

445、fConMaxDev0.0gg:defConSurCrv0gg:defQuickSavequicksave.gggg:defUnsIpts1gg:defUnsMaxAng0.0gg:defUnsMaxDev0.0gg:defUnsMaxMem64gg:defUnsPyrAR0.5gg:defUnsPyrMax0.0gg:defUnsPyrMin0.0gg:defUnsTetDecay0.5gg:defUnsTriBndDecay0.5gg:defUnsTetBndDecay0.5gg:defUnsTetMax0.0gg:defUnsTetEdgeMax0.0gg:defUnsTetMin0.0

446、gg:defUnsTetEdgeMin0.0gg:defUnsTriDecay0.5gg:defUnsTriMax0.0gg:defUnsTriEdgeMax0.0gg:defUnsTriMin0.0gg:defUnsTriEdgeMin0.0gg:defJoinAng0.0gg:defSplitAng0.0Initializing Gridgen (Continued)GlyphHere is a typical _gridgenrc file. Indeed, with a couple of exceptions, all settings are at their normal def

447、aults.As with most programs, it begins with a header of comment statements, including a time stamp of when Gridgen wrote the file.Next the default settings are listed. Notice that most, if not all, of the Glyph equivalents can be readily deduced, e.g., gg:defConDistBeg is the same as the Con Dist Bg

448、n s command found in the SET DEFAULT VALUES menu.Should the values need to be changed, this file can be edited directly or a new file simply generated from within Gridgen.258Initializing Gridgen (Continued)gg:defImportVisibility0gg:defConDimnone#TOLERANCESgg:tolCon0.0001gg:tolNode0.0001gg:tolGP1e-00

449、7gg:tolModelSize1000.0#DISPLAYgg:dispBGColorWHITEgg:dispBell0gg:dispBodyAxes0gg:dispColor0#E63C87gg:dispColor1#005F00gg:dispColor2#FF4500gg:dispColor3#0000AFgg:dispColor4#FFD700gg:dispColor5#7D0000gg:dispColor6#9100FFgg:dispConGPS0gg:dispDemote0.0gg:dispDisabledDB0gg:dispDisabledGrid1gg:dispDoublePr

450、ecision0gg:dispEnabledDB1gg:dispFrameBufferRGBgg:dispGlide1gg:dispLeftPick0gg:dispLight000gg:dispLineWidth1gg:dispMenuSideLEFTgg:dispMouseWarp1gg:dispQuickMenu0gg:dispSmallText0gg:dispViewProjPERSPECTIVEgg:dispViewCons1gg:dispViewDoms1gg:dispViewNodes1gg:dispXYZAxes0GlyphHere is the remainder of the

451、 _gridgenrc file from the previous slide. Notice how the default settings wrap up by setting the default connector dimensions, gg:defConDim.Next, some key tolerances are set next, again repeating parameters that can be set via the GUI, in this case in the SET TOLERANCE VALUES submenu of the SET DEFA

452、ULT VALUES menu.Finally, the display settings can be fixed. In this particular file, two settings have been changed from the defaults, gg:dispBGColor (changed from BLACK to WHITE) and gg:dispBodyAxes (changed from 1 to 0, i.e., on to off). 259#GridgenJournalFileV1(Gridgen15.08REL1)#CreatedMonJan100:

453、00:002005#packagerequirePWI_Glyph1.6.8#Deleteanyexistinggridsanddatabaseentities.ResetAS/W,defaults,and#tolerances.gg:tolResetgg:defResetgg:aswDeleteBC-glob*gg:aswDeleteVC-glob*gg:aswSetGENERIC-dim3#Readdatabaseandgridfiles.gg:dbImportC:/ProgramFiles/Pointwise/GridgenV15/MyGrids/gridgen.dba-typeDBAg

454、g:gridImportC:/ProgramFiles/Pointwise/GridgenV15/MyGrids/gridgen.gg Project Start-UpGlyphA Glyph script can be used to simplify the start-up process by having the script clear out old information and import the files needed for the project.Here is an example of a start-up script that does exactly th

455、is:This series of Glyph commands performs the same operations as the Restart Gridgen command in the MAIN MENU with all options picked.This section reads in the new composite database, called gridgen.dba here, and Gridgen restart, called gridgen.gg here, files.Banner comments indicating Gridgen versi

456、on and script creation date.260GlyphProject Start-Up (Continued)#GridgenJournalFileV1(Gridgen15.08REL1)#CreatedMonJan100:00:002005#packagerequirePWI_Glyph1.6.8#Deleteanyexistinggridsanddatabaseentities.ResetAS/W,defaults,and#tolerances.gg:tolResetgg:defResetgg:aswDeleteBC-glob*gg:aswDeleteVC-glob*gg

457、:aswSetGENERIC-dim3#Readdatabaseandgridfiles.gg:dbImportfilejoinfiledirnameinfoscriptgridgen.dba“-typeDBAgg:gridImportfilejoinfiledirnameinfoscript“gridgen.gg“Actual file paths can be troublesome if the script and files are moved to another location. Therefore, its helpful to make scripts independen

458、t of a specific path, as in the rewritten version of the start-up script below:This section no longer calls out a fixed path to the files to be imported. Instead, infoscript returns the complete path and name of the script file being executed, while filedirnameinfoscript strips away the script files

459、 name and returns just the path. Its then left for filejoin to combine this path with the dba or gg file listed.261Anatomy of a ScriptGlyphOf course, Glyph scripts can also be used to build entire grids. To illustrate this, a script which builds the familiar mesh shown here will be examined. This sc

460、ript, as well as other grid generation examples, is provided as part of the standard Gridgen installation in the examples folder. In addition, some utility scripts are located in the utils folder. Finally, a repository of even more useful scripts is maintained at: http:/ files contained in this “Gly

461、ph Exchange,” besides being useful tools, are also useful instructional aids.262#Copyright2002(c)Pointwise,Inc.#Allrightsreserved.#ThissampleGridgenscriptisnotsupportedbyPointwise,Inc.#Itisprovidedfreelyfordemonstrationpurposesonly.#SEETHEWARRANTYDISCLAIMERATTHEBOTTOMOFTHISFILE.#GlfLowLevelAPIscript

462、fortheBumponaWalltutorial.#Structuredgridversion.#G-F#|#|#|#|H|#|/|#|/|#B-CD-E#A#Clearoutanypreviousgridsgg:memClear#Resetthedefaultvaluestoavoidsurprisesgg:defResetAnatomy of a Script (Continued)GlyphThe script starts off with a comment block indicating where it came from and what it does. A cartoo

463、n diagram mimicking the diagram accompanying the original tutorial shows the basic geometry and defines the names of the nodes that will be used to define it.The command gg:memClear removes any previous information out of memory to avoid any possible conflicts.Just to be safe, gg:defReset is invoked

464、 to restore Gridgens defaults.263setA0-80setB-2000setC-1000setD1000setE2000setF20200setG-20200setH050#setnumberofgridpointsonconnectorssetnumgp_BG21setnumgp_EF$numgp_BGsetnumgp_BC7setnumgp_CD15setnumgp_DE7setnumgp_FGexpr$numgp_BC+$numgp_CD+$numgp_DE-2#CREATECONNECTORS#CDgg:conBegin#Circulararcsegmen

465、tgg:segBegin-typeCIRCULAR_ARCgg:segAddControlPt$Cgg:segAddControlPt$Dgg:segAddControlPt$Hgg:segEndsetcon_CDgg:conEnd#dimensiongg:conDim$con_CD$numgp_CDAnatomy of a Script (Continued)GlyphNext, the nodes that will define the grids connectors are delimited. Notice that each nodes coordinates are group

466、ed within double quotes.The dimensions for the connectors are now assigned. Since the connector EF must have the same dimension as connector BG, numgp_EF is defined in terms of numgp_BF. Similarly, connector FGs dimension is defined in terms of the dimensions of connectors BC, CD, and DE.The first c

467、onnector to be defined will be the circular arc segment CD. Notice that the arc is defined from its two endpoints C and D and a third point, H, between them. Once the curve is defined, its given the name con_CD and then dimensioned.264#BCgg:conBegin#Linesegmentgg:segBegin-type3D_LINEgg:segAddControl

468、Pt$Bgg:segAddControlPt$Cgg:segEndsetcon_BCgg:conEnd#dimensiongg:conDim$con_BC$numgp_BC#DEgg:conBegin#Linesegmentgg:segBegin-type3D_LINEgg:segAddControlPt$Dgg:segAddControlPt$Egg:segEndsetcon_DEgg:conEnd#dimensiongg:conDim$con_DE$numgp_DE#BGgg:conBegin#Linesegmentgg:segBegin-type3D_LINEgg:segAddContr

469、olPt$Bgg:segAddControlPt$Ggg:segEndsetcon_BGgg:conEnd#dimensiongg:conDim$con_BG$numgp_BGAnatomy of a Script (Continued)GlyphThe remaining connectors all consist of single line segments, simplifying their definition. Once told that a connector is being defined with gg:conBegin, Gridgen is next told t

470、hat a 3D_LINE segment is being added via the gg:segBegin command. After the control points at each end are defined, the gg:segEnd command is issued to complete the segment definition. The completed connector is then named (gg:conEnd not only ends creation, but returns the ID) and dimensioned.#EFgg:c

471、onBegin#Linesegmentgg:segBegin-type3D_LINEgg:segAddControlPt$Egg:segAddControlPt$Fgg:segEndsetcon_EFgg:conEnd#dimensiongg:conDim$con_EF$numgp_EF#FGgg:conBegin#Linesegmentgg:segBegin-type3D_LINEgg:segAddControlPt$Fgg:segAddControlPt$Ggg:segEndsetcon_FGgg:conEnd#Dimensiongg:conDim$con_FG$numgp_FG#Rese

472、tviewgg:dispViewResetOnce the connectors are all made, a little housekeeping is done by reseting the view in the display window.265#CREATESTRUCTUREDDOMAIN#gg:domBegin-typeSTRUCTURED#edgeBCDE(jmin)gg:edgeBegingg:edgeAddCon$con_BCgg:edgeAddCon$con_CDgg:edgeAddCon$con_DEsetedge_BEgg:edgeEnd#edgeEF(imax

473、)gg:edgeBegingg:edgeAddCon$con_EFsetedge_EFgg:edgeEnd#edgeFG(jmax)gg:edgeBegingg:edgeAddCon$con_FGsetedge_FGgg:edgeEnd#edgeBG(jmin)gg:edgeBegingg:edgeAddCon$con_BGsetedge_BGgg:edgeEndsetdom_Agg:domEndAnatomy of a Script (Continued)GlyphNext, the structured domain is assembled from the connectors. Th

474、e process starts with the gg:domBegin command, with the type option set to STRUCTURED (not necessary actually as this is the default). Each edge is then defined starting with the gg:edgeBegin command. The bottom edge BCDE is composed of three connectors (BC, CD, and DE), while the remaining three ed

475、ges have one connector each. Each connector is added with the gg:edgeAddCon command. Each edge is also named when the gg:edgeEnd command is issued to finish the corresponding edge (the command returning the edge number of the newly created edge). The domain is similarly named when the gg:domEnd comm

476、and is issued (the command returning the ID of the new domain).266#RUNSTRUCTUREDSOLVER#gg:domTFISolverRun$dom_Agg:domEllSolverAtt$dom_A-bg_controlLAPLACEgg:domEllSolverBegin$dom_Asetresultsgg:domEllSolverStep-iterations100#Printouttheresidualresultsneatlyputsiterresidualmaxresidforeachiresmaxres$res

477、ultsputsformat%4d%-8.4e%8.4e$i$res$maxresgg:domEllSolverEnd#EXPORTPLOT3DGRIDFILE#gg:domExportALLbump.grd-stylePLOT3D-formatASCII-precisionDOUBLE#SETFLOWSOLVER#gg:aswSetFLUENTV5-dim2Anatomy of a Script (Continued)GlyphWith the domain formed, the structured solver is called to do some smoothing of the

478、 mesh (just as in the tutorial). In this script, the structured domain $dom_A is first initialized using TFI (strictly speaking not required here as this was done automatically by the last command gg:domEnd). Next, the background control function attribute is set to LAPLACE with the gg:domEllSolverA

479、tt command. The solver is then told to step through 100 iterations (gg:domEllSolverStep) with the residuals “neatly” printed to the screen. The solver is then exited. The domain is then exported as a PLOT3D grid file. Note the use of for continuation of the gg:domExport options.The solver is next se

480、t with the gg:aswSet command to FLUENTV5, and the mesh is declared to be two-dimensional.267#CREATEBLOCK#gg:blkBegin-typeSTRUCTUREDgg:faceBegingg:faceAddDom$dom_Agg:faceEndsetblk_Agg:blkEnd#APPLYANDEXPORTFLUENTBCS#gg:aswSetBC$con_EFOUTFLOWgg:aswSetBC$con_BC$con_CD$con_DEWALLgg:aswSetBC$con_FGPRESSUR

481、EFARFIELDgg:aswSetBC$con_BGPRESSUREINLETgg:aswExportbump.cas#EXPORTGRIDGENFILE#gg:gridExportbump-str.gg#DISCLAIMER:#TOTHEMAXIMUMEXTENTPERMITTEDBYAPPLICABLELAW,POINTWISEDISCLAIMS#ALLWARRANTIES,EITHEREXPRESSORIMPLIED,INCLUDING,BUTNOTLIMITED#TO,IMPLIEDWARRANTIESOFMERCHANTABILITYANDFITNESSFORAPARTICULAR

482、#PURPOSE,WITHREGARDTOTHISSCRIPT.TOTHEMAXIMUMEXTENTPERMITTEDBY#APPLICABLELAW,INNOEVENTSHALLPOINTWISEBELIABLETOANYPARTYFORAnatomy of a Script (Continued)GlyphBlock creation follows, simplified here as this is a two-dimensional mesh and hence theres only one face. As with connector and domain creation,

483、 the corresponding block creation mode has to be entered (gg:blkBegin) to start and exited (gg:blkEnd) to end. Fluent-specific boundary conditions are next set. Since Gridgen has been previously told that this is a two-dimensional problem, it expects the entities to be connectors.The final commands,

484、 gg:aswExport and gg:gridExport, write the analysis software and Gridgen restart files, respectively.Finally, there is a comment block for a “Disclaimer.” Unfortunately, space precludes listing it here in its entirety.268Man PagesAs even this simple example shows, theres a great number of Glyph comm

485、ands, and each has very specific rules governing its use. A vital resource to learning about and understanding these commands is the Glyph Reference Manual. This is available online through the Help button in the GUI (printed copies are also available by order). Contained in this manual are detailed

486、 descriptions, instructions, and examples for all Glyph commands.269Tk, Tcls Graphical ToolkitGlyphTk is Tcls graphical toolkit for creating graphical user interfaces, like that shown here. Tk is actually a set of Tcl commands for creating widgets, a window in the interface with a particular appeara

487、nce and behavior. Examples of widgets include buttons, sliders, text input windows, menus, and the general canvas to place them on.Delving into the intricacies of Tk is beyond the scope of this course. However, there are a number of examples included with the standard installation of Gridgen and on

488、our website.270Tk, Tcls Graphical Toolkit (Continued)GlyphTk was originally developed for X window systems, so Tk widgets are stored in a hierarchy just like X widgets. Thus, there is usually a parent window with several child windows, each of which can have additional children widgets and so on. Th

489、is hierarchy forms the basis of identifying widgets and arranging them graphically on the screen. Adding a widget to a hierarchy involves two steps: creation and placement. Each widget type has a specific creation routine, while geometry managers that control a childs size and location relative to t

490、heir parent govern placement. Tk programming differs from Tcl in that Tk is event driven while Tcl essentially executes commands serially. A Tk program typically starts with the creation of widgets and definition of routines to be called in response to specific events and then enters an event loop t

491、o wait for user action.There are many references that provide additional details on Tk. These are listed in the Glyph Reference Manual.271Tk, Tcls Graphical Toolkit (Continued)GlyphGridgen includes a standalone Tk interpreter, called ggwish, for running or testing Tk scripts (note that this interpre

492、ter only understands non-Gridgen-specific commands as those commands are not recognized outside Gridgen itself). This interpreter is virtually identical to the standard wish interpreter that normally comes with standard Tcl/Tk distributions except for a few bug fixes.Running a Tk-enabled script in G

493、ridgen differs slightly from running it in wish or ggwish in that two commands have to be added: One informs Gridgen that Tk widgets will be used to define an interface other than the default one. This is gg:tkLoad which has to be placed before any Tk commands can be issued. This command causes Grid

494、gen to dispose of the default interface and expose the Tk commands to the script. The other prevents the script from terminating prematurely. When Gridgen normally encounters the end of a script, script execution is terminated and control reverts back to the standard GUI interface. In wish (and ggwi

495、sh), an event loop is entered when the end of a script is reached. This facilitates the operation of the Tk program as described on the previous slide. To duplicate this behavior in Gridgen, gg:tkLoop has to be called. This puts Gridgen into an event loop until exit (exits the script normally), gg:abort (exits and reports the script was aborted), or gg:terminate (exits script and closes Gridgen) is called.272GridgenTrainingmIn this session:mGlyph.mTutorial: “Converging-Diverging Nozzle: Using Glyph Scripting.”Review273

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 资格认证/考试 > 自考

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号