Friday, 17 April 2015

gambit tutorial ( lesson-1)

CREATING AND MESHING BASIC GEOMETRY :
This tutorial illustrates geometry creation and mesh generation for a simple geometry using GAMBIT.
In this tutorial you will learn how to:
  • Start GAMBIT
  • Use the Operation tool pad
  • Create a brick and an elliptical cylinder
  • Unite two volumes
  • Manipulate the display of your model
  • Mesh a volume
  • Examine the quality of the mesh
  • Save the session and exit GAMBIT

Prerequisites:
This tutorial assumes you have no prior experience of working with GAMBIT. You should, however, read Chapter 0, "Using This Tutorial Guide," to familiarize yourself with the GAMBIT interface and with conventions used in the tutorial instructions.

Problem Description:
The model consists of an intersecting brick and elliptical cylinder. The basic geometry is shown schematically in Figure 1-1.

Figure 1-1: Problem specification
 Strategy:
This first tutorial illustrates some of the basic operations for generating a mesh using GAMBIT. In particular, it demonstrates:
  • How to build the geometry easily using the "top-down" solid modeling approach
  • How to create a hexahedral mesh automatically
The "top-down" approach means that you will construct the geometry by creating volumes (bricks, cylinders, etc.) and then manipulating them through Boolean operations (unite, subtract, etc.). In this way, you can quickly build complicated shapes without first creating the underlying vertices, edges, and faces.
Once you have built a valid geometry model, you can directly and (in many cases) automatically create the mesh. In this example, the Cooper meshing algorithm is used to automatically create an unstructured, hexahedral mesh. More complicated geometries may require some manual decomposition before you can create the mesh; this is demonstrated in subsequent tutorials.
The steps you will follow in this tutorial are listed below:
  • Create two volumes (a brick and an elliptical cylinder).
  • Unite the two volumes.
  • Automatically generate the mesh.
  • Examine the quality of the resulting mesh.
To keep this introductory tutorial short and simple, certain steps that you would normally follow have been omitted:
  • Adjusting the distribution of nodes on individual edges of the geometry
  • Setting continuum types (for example, identifying which mesh zones are fluid and which are solid) and boundary types
These details, as well as others, are covered in subsequent tutorials.

Procedure:
Type
gambit -id mechanicalmines
to start GAMBIT.
This command opens the GAMBIT graphical user interface (GUI). (See Figure 1-2.) GAMBIT uses the name you specify (in this example, mechanicalmines) as a prefix to all files it creates: for example,mechanicalmines.jou.

Figure 1-2: The GAMBIT graphical user interface (GUI)

Step 1: Create a Brick:

1. Create a brick by doing the following:
a) In the Operation tool pad (located in the top right corner of the GAMBIT GUI), select the GEOMETRY command button by clicking on it with the left mouse button. If the Geometry sub pad does not appear when you select the GEOMETRY command button, click it again.

The name of a command button is displayed in the Description window at the bottom of the GAMBIT GUI when you hold the mouse cursor over the command button. The GEOMETRY command button will appear depressed when it is selected. Selecting the GEOMETRY command button opens the Geometry sub pad. Note that when you first start GAMBIT, the GEOMETRY command button is selected by default.
b) Use the left mouse button to select the VOLUMEcommand button in the Geometry sub pad.
Again, this command button will be depressed when selected. Selecting this command button opens the Geometry/Volume sub pad.
c) Use the left mouse button to select the CREATE VOLUMEcommand button in the Geometry/Volume sub pad.
This command sequence opens the Create Real Brick form.

The above description of selecting command buttons can be shortened to the following:
GEOMETRY—> VOLUME—> 
CREATE VOLUME 
The selection of the command buttons will be represented using this method for the remainder of this tutorial, and in all subsequent tutorials.
d) Left-click in the text entry box to the right of Width in the Create Real Brick form, and enter a value of 10 for the Width of the brick.
e) Use the Tab key on the keyboard to move to the Depth text entry box, and enter 6 for the Depth of the brick.
The text entry box for Height can be left blank; GAMBIT will set this value to be the same value as the Width by default.
f) Select Centered from the option menu to the right of Direction.
NOTE: When you first open the Create Real Brick form, the Centered option is selected by default.
i) Hold down the left mouse button on the option button to the right of Direction until the option menu appears.
ii) Select Centered from the list.
g) Click Apply.
A message appears in the Transcript window at the bottom left of the GAMBIT GUI to indicate that a volume, called volume.1, was created. The volume will be visible in the graphics window, as shown in Figure 1-3.
If you make a mistake at any point in the geometry creation process, you can use the UNDO command buttonto undo multiple levels of geometry creation. At this point, you have only performed one operation, so you can only undo one operation.

Figure 1-3: Rectangular brick volume (side view)

Step 2: Create an Elliptical Cylinder:

1. Create an elliptical cylinder.
a) Hold down the right mouse button while the cursor is on the CREATE VOLUME command button.
b) Select the CREATE REAL CYLINDER optionfrom the resulting menu.
! CREATE REAL CYLINDER is the text that is written in the Description window when you hold the mouse cursor over themenu item.
This action opens the Create Real Cylinder form.

The above method of selecting command buttons can be shortened to the following:
GEOMETRY—> VOLUME—> CREATE VOLUMER
where R indicates a tool pad choice using the right mouse button.
c) Enter a Height of 10.
d) Enter a value of 3 for Radius 1.
e) Enter a value of 6 for Radius 2.
f) Retain the default Axis Location of Positive Z.
g) Click Apply.
The brick and elliptical cylinder are shown in Figure 1-4.

Figure 1-4: Brick and elliptical cylinder


Step 3: Unite the Two Volumes :

1. Unite the brick and elliptical cylinder into one volume.
GEOMETRY—> VOLUME—> BOOLEAN OPERATIONS 
This command sequence opens the Unite Real Volumes form.

Notice that the top Volumes list box is yellow in the Unite Real Volumes form at this point. The yellow colour indicates that this field is active, and any volume selected will be entered into this box on the form.
a) Hold down the Shift key on the keyboard and select the brick by clicking on one of its edges in the graphics window using the left mouse button.
! The Shift key must always be held down when selecting entities in the graphics window using the left mouse button. This operation will be referred to as Shift-left-click in all further steps.
The brick will appear red in the graphics window and its name (volume.1) will appear in the Volumes list box in the Unite Real Volumes form.
b) Shift-left-click the elliptical cylinder in the graphics window.
c) Click Apply to accept the selection and unite the elliptical cylinder and brick.
! Alternatively, you could continue to hold down the Shift key and click the right mouse button in the graphics window to accept the selection of the volumes. This method allows you to rapidly accept selections and apply operations with minimal movement of the mouse.
! The Shift key must always be held down when clicking the right-mouse button to accept the selection of entities in the graphics window. This operation is referred to as Shift-right-click.
The volume is shown in Figure 1-5. You can rotate the display (as shown in Figure 1-5) by holding down the left mouse button in the graphics window and moving the mouse to the left. More information on manipulating the graphics display is given in the next step.

Figure 1-5: Brick and elliptical cylinder united into one volume

Step 4: Manipulate the Display:

1. Zoom out from the current view by holding down the right mouse button in the graphics window and pushing the mouse away from you.
2. Rotate the view around the screen centre by holding down the right mouse button and moving the mouse from side to side.
3. Rotate the view in free-form mode by holding down the left mouse button and moving the mouse.
4. Translate the display by holding down the middle mouse button and moving the mouse.
5. Divide the graphics window into four quadrants by clicking the SELECT PRESET CONFIGURATIONcommand button in the Global Control tool pad.
GAMBIT divides the graphics window into four quadrants and applies a different orientation to the model in each of the four quadrants. Each view of the graphics window can be manipulated independently. All changes to the model appear in all portions of the graphics window, unless you disable one or more quadrants.

Figure 1-6: GAMBIT GUI-four graphics-window quadrants
6. Restore a single display of the model.
a) Use the left mouse button to select the graphics-window "sash anchor"—the small gray box in the centre of the graphics window.
b) Use the mouse to drag the sash anchor to the bottom right corner of the graphics window.
7. Restore the front view of the model by left-clicking the ORIENT MODELcommand button in the Global Control tool pad. 8. Scale the model to fit the graphics window by clicking the FIT TO WINDOWcommand button in the Global Control tool pad.

Step 5: Mesh the Volume:

1. Create a mesh for the volume.
MESH—> VOLUME—> MESH VOLUMES 

This command sequence opens the Mesh Volumes form.

a) Shift-left-click the volume in the graphics window.
GAMBIT will automatically choose the Cooper Scheme Type as the meshing tool to be used, and will use an Interval size of 1 (the default) under Spacing. See the GAMBIT Modelling Guide, Chapter 3 for details about the Cooper meshing tool.
b) Click Apply at the bottom of the Mesh Volumes form.
This accepts the volume you selected as the one to be meshed. It also accepts the source faces (the faces whose surface meshes are to be swept through the volume to form volume elements) that GAMBIT has chosen for the Cooper meshing scheme and starts the meshing operation based on the current Mesh Volumes form specifications. A status bar appears at the top of the GAMBIT GUI to indicate how much of the meshing is complete.
The volume will be meshed as shown in Figure 1-7.

Figure 1-7: Meshed volume

Step 6: Examine the Mesh:

It is important that you check the quality of the resulting mesh, because properties such as skewness can greatly affect the accuracy and robustness of the CFD solution. GAMBIT provides several quality measures (sometimes called "metrics") with which you can assess the quality of your mesh. In the case of skewness measures such as Equi Angle Skew and EquiSize Skew, for example, smaller values are more desirable. It is also important to verify that all of the elements in your mesh have positive area/volume. You should consult the documentation for the target CFD solver for additional mesh quality guidelines.
1. Select the EXAMINE MESHcommand button at the bottom right of the Global Control tool pad.
This action opens the Examine Mesh form.

a) Click Update at the bottom of the Examine Mesh form.
GAMBIT does not automatically update the graphics display when you open the Examine Mesh form or modify its specifications, such as Display Type or Quality Type. To update the graphics display, you must click the Update pushbutton located at the bottom of the form. GAMBIT displays the Update pushbutton label in red lettering whenever the display needs to be updated to reflect the current Examine Mesh specifications.
Some Examine Mesh operations automatically update the graphics display. For example, if you select the Display Type: Range option and click one of the histogram bars (see below), GAMBIT automatically updates the display.
b) Select Range under Display Type at the top of the Examine Mesh form.
A histogram appears at the bottom of the form. The histogram consists of a bar chart representing the statistical distribution of mesh elements with respect to the specified Quality Type. Each vertical bar on the histogram corresponds to a unique set of upper and lower quality limits.
The 3D Element type selected by default at the top of the form is a brick.
c) Select or retain EquiSize Skew from the Quality Type option menu.
d) Click on one of the green vertical bars in the histogram to view elements within a certain quality range.
Each element has a value of skewness between 0 and 1, where 0 represents an ideal element. The histogram is divided into 10 bars; each bar represents a 0.1 increment in the skewness value. For a good mesh, the bars on the left of the histogram will be large and those on the right will be small.
Figure 1-8 shows the view in the graphics window if you click on the fourth bar from the left on the histogram (representing cells with a skewness value between 0.3 and 0.4).

Figure 1-8: Elements of the mesh within a specified quality range
e) Move the Upper and Lower slider boxes beneath the histogram to redefine the quality range to be displayed.

Step 7: Save the Session and Exit GAMBIT:

1. Save the GAMBIT session and exit GAMBIT.
File —> Exit
GAMBIT will ask you whether you wish to save the current session before you exit.
a) Click Yes to save the current session and exit GAMBIT.

Summary:


This tutorial provided a quick introduction to GAMBIT by demonstrating how to create a simple 3-D geometry using the "top-down" modelling approach. The Cooper scheme was used to automatically generate an unstructured, hexahedral mesh. For more information on the Cooper scheme, consult the GAMBIT Modelling Guide.


No comments: