Professional Documents
Culture Documents
2
Training Notes
Fluent User Services Center Introductory GAMBIT Training
GAMBIT 2.2 December 2004
www.fluentusers.com
Introduction to GAMBIT
What is GAMBIT?
Geometry And Mesh Building Intelligent Toolkit
A single, integrated preprocessor for CFD analysis:
z Geometry construction and import
Using ACIS solid modeling capabilities
Using STEP, Parasolid, IGES, etc. import
Cleanup and modification of imported data
z Mesh generation for all Fluent solvers (including FIDAP and POLYFLOW)
Structured and Unstructured hexahedral, tetrahedral, pyramid, and prisms.
z Mesh quality examination
z Boundary zone assignment
Operation
General sequence of operations
z Initial setup
Solver selection, Mesh size, Defaults, etc.
z Geometry Creation (ACIS, STEP, Parasolid, IGES or Mesh import)
Create full geometry
Decompose into mesh-able sections
z Meshing
Local meshing: Edge, Boundary layers and Size Functions
Global meshing: Face and/or Volume
z Mesh examination
z Zone assignment
Continuum and Boundary attachment
z Mesh export
GAMBIT Start-up
GAMBIT can be started up using the startup icon (Windows
XP/2000 only). Gambit 2.2.13.lnk
Files (1)
GAMBIT directory and files
z When GAMBIT starts up, it creates a directory called GAMBIT.#
Files (2)
GAMBIT directory and files
z GAMBIT permanently saves these files to your working directory as
Journal Files
Journal File:
z Executable list of Gambit commands
Created automatically by Gambit from GUI and TUI.
Can be edited or created externally with text editor.
z Journals are small - easy to transfer, e-mail, store
Uses:
z Can be parameterized, comments can be added
z Easy recovery from a crash or power loss
z edit existing commands to create new ones
GUI
Main Menu bar Operation toolpad
Edit Title
z Title will be included on any printed graphics
Edit File
z Ability to launch an editor within GAMBIT
Edit Parameters
z Ability to define, modify and list parameters
parameters: $numeric = 10,
arrays: $array(3,4) = 5
z Parameters and arrays can also be directly defined in
the journal file using an editor (preferred option)
Solver Menu
Global (4)
Render Model - Wireframe , Shaded , Hidden
Modify Light/Label type
Change light source orientation and properties
Additional information on the entity label
Insert arrows and text for graphic presentations
Color Mode
Color by entity
Color by connectivity
Undo/Redo
Examine Mesh
z Display different element types by quality, plane cuts, etc.
Forms (1)
Form - components
z List box - (picking)
active (yellow) - ready to pick
inactive (white) - click to activate
z Radio buttons
mutually exclusive options
z Option button
Option menu
z Text box
Click-to-focus
z Check box
non-mutually exclusive options
z Command buttons
Forms (2)
Text box
Forms (3)
List box
z Highlighted in yellow if active
To activate - left click in the list box
z Tells you the name of the latest picked item
The item is highlighted in red on the screen
All previously picked items are pink
z Individual pick lists for each list box
z Forms with several list boxes:
Depending on the form, the order of picking may be important
Use Shift right-click to go to the next list box
Use left click (in the list box) to go to any list box
Forms (4)
Pick Lists
z Open the Pick List by clicking on the arrow
Preliminaries-1
Objective:
z Create and mesh the fluid region for flow problems and solid
regions for heat transfer (and structural analysis for Fidap Users).
z Typically accomplished by constructing and working with lower
order entity objects and volume primitives.
Terminology:
Lowest order entity z Vertex - a point
z Edge - a curve that is defined by at least 1 vertex (in the case of 1
vertex, the edge forms a loop)
z Face - a surface (not necessarily planar) bounded by at least 1 edge
(except for sphere and torus)
Highest order entity z Volume - a geometric solid (as in a solids model), also can be
thought of as an "air tight" set of bounding faces.
Preliminaries-2
Color Identification
z Vertices and Edges are colored according to the highest
order entity to which they are connected.
z The coloring scheme is:
Vertex (white)
Edge (yellow)
Face (light blue)
Volume (green)
Undo/Redo:
z 10 levels of undo by default.
Undoes geometry, meshing, and zoning commands.
Description window provides command to be undone
when mouse is passed over undo button.
z Left click to execute visible button operation.
z Right click to access options.
Coordinate system
Cartesian, Cylindrical and Spherical systems
Using Offset/Angle or Vertices for location/orientation
"Active" coordinate system is default in all forms
Grid creation with "snapping" of vertices
-Recommended for simple geometries only
Creation of rulers
(x,y,z)
Angle
Reflect: Scale:
Options:
z Connected geometry can also be Moved
z Mesh and/or Zone types can be copied linked or unlinked
2-5 Fluent Inc. 1/19/2005
Fluent User Services Center Introductory GAMBIT Training
GAMBIT 2.2 December 2004
www.fluentusers.com
Connect (Real)
z Vertices, Edges and Faces can be connected
z The operation eliminates all duplicate entities
and reconnects upper topology
z Only entities within the ACIS tolerance
will be connected
z Existing mesh will be preserved
Disconnect
Edge + Vertices
One Edge Two Edges
Correct: Delete Volume Volume is deleted. Faces, Edges and Vertices are
(deselect Lower Geometry) not deleted. Any of the six faces can be deleted
Modify Color/Label
Modify entity colors
Change entity label
Geometry Creation
ACIS - geometry engine ("kernel")
z Provides tools for bottom-up creation by:
Vertex: Add, Grid Snap, etc.
Edge: Line, Arc, Ellipse, Fillet, B-spline, etc.
Face: Wire Frame, Sweep, Net, etc.
Volume: Wire Frame, Sweep, Face Stitch, etc.
z Vertex Data
Format is similar, curve information is not needed
Start Angle
Major Vertex + +
End Angle
Center Vertex
On Edge Vertex +
Conic Arc
Created by three vertices
Shoulder Vertex +
Start Vertex
+
End Vertex +
Edge 2
NURBS
Third-order by default
Use tolerance for the approximate option
by wire frame
Net
Topologically intersecting edges
2-22 Fluent Inc. 1/19/2005
Fluent User Services Center Introductory GAMBIT Training
GAMBIT 2.2 December 2004
www.fluentusers.com
axis of revolution
Rigid
Edge
Path Path
Edge
2-24 Fluent Inc. 1/19/2005
Fluent User Services Center Introductory GAMBIT Training
GAMBIT 2.2 December 2004
www.fluentusers.com
Face Primitives
Face Primitives
z Dimensions and Plane/Direction must be specified
Rectangles
Circles
Ellipses
face
path
Perpendicular option
The driving edge/vector has to start in the
"plane" of the curve or face
Draft Twist
face
path face path
Volume Primitives-1
Real Volume Primitives
Brick
Width (X), Depth (Y) and Height (Z)
The Width (X) value is used for Y and Z if
no other input is given.
10 different preset positions (each octant plus
center)
Cylinder and Frustum
Height and two cross-sectional radii (3rd
radius for frustum)
The Radius 1 value is used for remaining
radii if no other radius input is given.
9 different preset directions (three in each
axis)
Volume Primitives-2
Real Volume Primitives
Prism and Pyramid
Corresponding to input of cylinder and
frustum
Number of sides
9 different preset directions (three in each
axis)
Torus
Major and cross-sectional radii
Three axis locations
Unite Volumes
A
B A+B
A A
B A-B B B-A
Intersect Volumes
A
B
A two volumes
B
Split B
with A
two volumes Volume/Face splits
A
B Bidirectional
Split
two volumes
three volumes
2-36 Fluent Inc. 1/19/2005
Fluent User Services Center Introductory GAMBIT Training
GAMBIT 2.2 December 2004
www.fluentusers.com
A B C
Unite A
with B Volume.2: face contains an
imprint of the cylinder
Volume Blends
Real Volume Blends
Blend - create fillet/rounded edges
Pick a volume
Pick the edges that need a blend and
specify radius
Pick vertex (if needed) and specify radius
using the Setback option
Bulge option is not recommended for
hexahedral meshing
Bulge option
Setback option
Plug-in tools
Plug-in tools are extra tools which can be added to GAMBIT.
z Download to the FLUENT.INC/Gambit2.2.x/plugins directory
(Windows) or your home directory (Unix/linux)
z Load by import plugin file
File -> Import -> Plug-in
z Access through the new Tools - Plug-in button
Meshing - General
To reduce overall mesh size, confine small cells to areas where they are
needed (e.g., where high gradients are expected).
Edge Meshing
Edge mesh distribution is controlled through
the spacing and grading parameters.
Using the Edge meshing form
z Picking
Temporary graphics
Links, Directions
z Grading/Spacing
z Special characteristics
Apply and Defaults
Invert and Reverse
z Options
Soft Links
Picking and soft links
z Pick with links
By enabling this option, Soft-linked edges can be selected in a single pick
Linked edges share the same information and can be picked in a single
pick
z Modifying soft links
You can anytime:
Form links
Break links
Maintain links
By default, GAMBIT will form links between unmeshed edges that are
picked together
By default, GAMBIT will maintain links between meshed edges that are
picked together
Grading
Controls mesh density distribution along an edge.
Grading can produce single-sided or double-sided Single-sided grading
mesh
z Doubled-sided mesh can be symmetric or asymmetric. Symmetric grading
Symmetric schemes produce symmetric mesh about
edge center.
Asymmetric schemes can produce asymmetric mesh Asymmetric grading
about edge center.
Single-sided grading:
z Uses a multiplicative constant, R, to describe the ratio of
the length of two adjacent mesh elements, i.e.,
R = l(i+1) / li
z R can be specified explicitly (Successive Ratio) or
determined indirectly
z Gambit also uses edge length and spacing information to
determine R.
Spacing
Spacing
z In all meshing forms, the following spacing functions can be specified:
Interval count - recommended for edge meshing only
A value of 5 creates 5 intervals on the edge (6 nodes, including ends)
% of edge length - recommended for edge meshing only
An edge length of 10 and a value of 20 creates 5 intervals on the edge
Interval size - the default setting
Identifies the interval size relative to overall dimensions of geometry
Identifies average interval size if used with grading
An edge-length of 10 and a value of 2 creates 5 intervals on the edge
Average size of elements/grid is 2
Mesh Options
Apply without meshing
z This option is useful in cases where you
want to impose a scheme without fixing
the number of intervals
z The higher level meshing scheme will decide
(and match) the intervals
Example
Specify fixed interval and no grading
Specify double sided grading and
Apply without Meshing on bottom edges
Face meshing will automatically match mesh
Remove Old Mesh
z Deletes old mesh
Ignore Sizing Function
z Sizing function has precedence on meshing
unless this option is enabled.
Face Meshing
Face Meshing form
z Upon picking a face
GAMBIT automatically chooses Quad elements
GAMBIT chooses the Type based on the
Solver/face vertex types
z Available element/scheme type combinations
Quad Quad/Tri
Map Map
Submap Pave
Tri-Primitive Wedge
Pave
Tri
Pave
Quad: Map
Quad: Submap
Quad: Tri-Primitive
Quad: Pave
Quad/Tri: Map
Quad/Tri: Pave
Quad/Tri: Wedge
Tri: Pave
Hard Linking
Mesh Links (Hard Links)
z Mesh linked entities have identical mesh
created for periodic boundary conditions
z Applicable to Edge, Face, and Volume entities
Best to use soft links for edge meshing
To link volume meshes, all faces must be hard
linked first.
Setting up Hard Links for Faces
z Select faces and reference vertices + + + +
Edge sense will appear
Reverse orientation on by default for sense
Periodic option should be used for periodic
boundary conditions, which creates a matched
mesh even if the edges are split differently.
z Mesh one face before or after hard link is defined
mesh on second face generated automatically
Multiple pairs of hard links can be created.
3-15 Fluent Inc. 1/19/2005
Fluent User Services Center Introductory GAMBIT Training
GAMBIT 2.2 December 2004
www.fluentusers.com
Mesh Smoothing
Face and Volume meshes can be smoothed by moving interior nodes to obtain
incremental improvement in quality.
z The mesh at the boundary is not altered.
z Face and volume meshes are smoothed using a default scheme.
of adjacent elements.
Winslow(for quad meshes only) : Optimizes element shapes
E E
E E
E E
E E
S E
default Map: 4*End
E E E E
C E C C
S + +S
C E C C
Tri-Primitive Scheme
Tri-Primitive Scheme: 3*End + N*Side
E
S
E E
E E
E E
default
E
3-25 Fluent Inc. 1/19/2005
Fluent User Services Center Introductory GAMBIT Training
GAMBIT 2.2 December 2004
www.fluentusers.com
max e e min
max ,
180 e e
where:
z max = largest angle in face or cell
Volume Meshing
Approach
Volume Meshing
Volume Meshing Form:
z Upon picking a Volume
GAMBIT will automatically choose a Type based on the solver selected and
the combination of the face Types of the volume.
In ambiguous cases, GAMBIT chooses the Tet/Hybrid: TGrid combination
z Available element/scheme type combinations
Hex
Map
Submap
Tet-Primitive
Cooper
Stairstep
Hex/Wedge
Cooper
Tet/Hybrid
Tgrid
Hex-Core
Hex: Tet-Primitive
Tet/Hybrid: Tgrid
Tet/Hybrid: Hex-Core
mesh
mesh
mesh
mesh
Mesh
Tet Primitive
Cooper direction
A A1 A2
Interior
loops
C
C2
B
A A1
S E E
S
S E
E C E
S E
E
3 Source Faces
Tetrahedral/Hybrid Meshing
Tetrahedral/Hybrid Mesh Scheme - TGrid
z Automatic - most volumes can be meshed without decomposition.
z Use boundary layers to create hybrid grids (prism layers on boundaries to
capture important viscous effects).
z Use on volumes that are adjacent to volumes that have been meshed with
hex elements will automatically result in a transitional layer of pyramids.
prism layer
low quality pyramid acute angle
triangles
zhanging edges created
split
z Pyramid (transition)
elements created
z Boundary hexes not
smoothed
4-19 Fluent Inc. 1/19/2005
Fluent User Services Center Introductory GAMBIT Training
GAMBIT 2.2 December 2004
www.fluentusers.com
3 cell layers
HEXCORE_OFFSET_LAYERS=3
(default)
5 cell layers
HEXCORE_OFFSET_LAYERS=5
Linear/Quadratic Elements
(FIDAP/POLYFLOW USERS ONLY)
General tools
z Higher-order elements
For FEM codes (FIDAP and POLYFLOW), the element order can
be changed at all three meshing levels
Only linear and quadratic elements are directly available
A change to quadratic element type at one level will
automatically change the element type in other levels
The following table presents the most commonly used and
recommended quadratic element types for FEM - solvers
POLYFLOW FIDAP
edge 3-node 3-node
face 8-node quad 9-node quad
volume 21-node brick 27-node brick
Decomposition
source faces
source faces
source face
source faces
source
face
source faces
source faces
source faces
source faces
source faces
Sizing functions can be used to smoothly control the growth in mesh size over
any particular region of the geometry or the entire geometry, starting from a
source or origin.
z Sizing functions are used to smoothly transition from fine mesh needed to resolve
flow physics, curved geometry and model flow in thin gaps.
Boundary layers are used to grow layers of cells of desired height from specified
boundaries of 2-D/3-D geometry and are typically used to capture near wall
phenomena such as turbulence and heat transfer.
Multiple Sizing Functions and Boundary Layers can be used to control mesh size
distribution.
Size Functions
Size Functions control the mesh distribution in a region of space,
including edges, faces, and volumes similar to the way grading
controls mesh distribution on edges.
Size Functions are accessed through the Tools menu:
Size Functions are designed to grade meshes with Tets even
though they can be used with a hex mesh.
Cells/gap = 2
6-10 Fluent Inc. 1/19/2005
Fluent User Services Center Introductory GAMBIT Training
GAMBIT 2.2 December 2004
www.fluentusers.com
A set of Cartesian boxes forming a grid that bounds the attachment geometry are
generated and successively refined i.e. split into smaller boxes, until a maximum number
of levels of refinement (or tree depth) are reached or the size variation in all the boxes
is less than a specified percentage tolerance limit.
z The GAMBIT Transcript window contains details of background grid generation for each size
function.
The maximum allowable tree depth and the tolerance limits are set by GAMBIT
Defaults, BGRID_MAX_TREE_DEPTH (=16 by default) and
NONLINEAR_ERR_PERCENT (=25% deviation from linear variation, by default).
Boundary Layers
Boundary layers are layers of elements growing out from a boundary
into the domain.
z Produces high quality cells near boundary.
z Allows resolution of flow field effects with fewer cells than would be
required without them.
In general, boundary layers are attached to:
z edges for 2D problems
z faces for 3D problems
complicated 3D shapes may require boundary layer attachments to edges.
Internal Continuity
The Internal Continuity toggle allows boundary layers to be formed
with no crossover or overlap regions.
vertex type change to End can cause the 3-D boundary layer to imprint.
140
S S
Attachment Face S
No imprinting of 3-D Boundary Layer
and gaps due to Side Type vertices at the
intersection of the faces
E E
E
Vertex Types changed to End closes the
gap and imprints 3-D boundary layer
6-23 Fluent Inc. 1/19/2005
Fluent User Services Center Introductory GAMBIT Training
GAMBIT 2.2 December 2004
www.fluentusers.com
Introduction
Several translation methods available to enable data exchange with
CAD/CAE systems.
z Appropriate approach depends upon source.
Translation can:
z return incomplete, corrupt, or disconnected geometry
z return geometry details unnecessary for CFD analysis
Geometry cleanup refers to processes required to prepare geometry for
meshing.
z Fix incomplete or corrupt geometry and connect disconnected geometry
z Remove unnecessary details
z Decompose geometry into meshable sections
Gambit's Virtual Geometry operations can help with the cleanup
process.
Tolerant Modeling
Automatic "real" geometry connect using
variable tolerance
Available at
z time of import
z inside the Heal Face (or Volume) Form
Application
z All Geometry files
z Relatively large gaps
z Real ACIS volumes generated during
import
Boolean operations subsequently possible
z Adding/Subtracting additional geometry
z Volume Extraction
z Retaining only or of model
z Volume Decomposition for better meshing
Face
smoothing
Virtual Geometry
Three kinds of geometry in GAMBIT:
z Real
Defined by the ACIS library of geometry creation/modification routines.
Geometry defined by mathematical formulae.
z Virtual
A Fluent Inc. library of routines providing additional functionality by redefining
topology.
Derive their geometrical descriptions by references to one or more real entities
(called the Hosts).
z Faceted geometry
Treated
Two like
objects that virtual
share geometry.
the same underlying geometry but different topologies.
Derived from importing a mesh or faceted geometry into GAMBIT, split mesh
operations, or stairstep meshing scheme.
Characteristics
Virtual entities:
z entities are colored differently from real entities.
z naming convention: v_vertex, v_edge, v_face, v_volume.
When performing a virtual geometry operation:
z Directly connected lower and upper geometry will become virtual
z Underlying real geometry (host) will become invisible and inaccessible (or
put in the "background")
Deleting virtual geometry:
z Will not delete host geometry.
z Typically, lower order entities (virtual) remain undeleted.
Meshing and Boundary Assignments:
z Meshing and boundary assignment operations are unaffected by virtual
geometry.
Collapse - splits a face and merges the resulting pieces with two or
more neighboring faces
between
collapse these faces
this face
Face Simplify
z Removes dangling edges
and hard points from a face.
z Result is virtual face
z The face with dangling edge
can also be split using
face split (by location)
Edge/Face Merge
Virtual Edge/Face Merge options
z Virtual (Forced)
Create one single edge/face from all edges/faces
face edge
+ +
merge merge
z Virtual (Tolerance)
Merge all entities shorter than Max. Edge/Face Length
Merge all entities of higher entity angle than Min. Angle
No input will merge all vertices connected to two edges only
+ max. edge = +
+ +
+ min. angle = 135
c
a b
Straight edge constructed between
Select 6 points (a,b,c,d,e,f) points c and d (and between d and e)
c and e lie on square edge because they lie on different edges.
+
+
z Location (Virtual)
Vertex locations can be adjusted after the split
Limitations (for both Face and Volume Split)
Split through voids, protrusions and dangling faces will create
incorrect geometry
Order of picking is important
If you do not Zoom in close to the object, the split might fail
First and last location on a face must be on its boundary
virtual volume
split
Connect
7-22 Fluent Inc. 1/19/2005
Fluent User Services Center Introductory GAMBIT Training
GAMBIT 2.2 December 2004
www.fluentusers.com
T-Junctions Option
T-Junctions - splits edges by vertices that exist within a specified tolerance of
the edges and then connects the split entities.
unconnected real edges/faces connected virtual edges/faces Invoking too early may result
in very small edges
Edge Splits
Virtual (Tolerance)
Face connect using
T-Junctions
Cleanup Tools
Cleanup Tools
Sequential, Semi-automatic Geometry
Cleanup Tool resulting in connected
geometry and a better mesh
Quickly identify, zoom-in, highlight areas
that cause connectivity and mesh quality
problems
z Graphics color coding set to connectivity
z Graphics window pivot set to mouse
z Zoom
In/Out: quick auto zoom in on or from the picked
items
z Auto: automatically zooms in on selected item
The edges that define the crack share The edges that define the crack share
one vertex two vertices
Virtual Virtual
truncated
face
distance
Chop
merged face
option
face - face Merge edges Tri-primitive
angle < 135
Before cleanup
After cleanup
The Cleanup
Domain is group2
Demo
Import a Non-ACIS File (demo.igs)
Apply Cleanup Tools
z There are many different approaches.
Mesh the Model using the Cooper Tool (Hexes).
Steps to Clean up
Import the .iges file using the default settings
(Make tolerant).
Change color coding to connectivity.
z Blue edges (2 connections) indicate connected
geometry.
z Orange edges (1 connection) indicate
unconnected geometry.
Try healing the faces (to retain Real Geometry)
Delete the problematic face
Source face
Apply Cleanup Tools (Virtual Geometry
Created)
z Short Edges
z Holes
z Large Angles
z Fillets
Create a Volume by stitching
Mesh using the Cooper Tool
Outline
Basis of Journal Files
Parameters: Scalars and Arrays
Special Constants
Expressions: Arithmetic, Logical and String
Functions: String and Arithmetic
Examples
DO and IF-THEN-ELSE Commands
Summary of Journal File Uses
Dynamic GUI and Examples
Journal Files
Journal File:
z Executable list of Gambit commands
Created automatically by Gambit from GUI and TUI.
Can be edited or created externally with text editor.
z Journals are small - easy to transfer, e-mail, store
Uses:
z Can be parameterized, comments can be added
z Easy recovery from a crash or power loss
z edit existing commands to create new ones
Comment lines
Parameters
Scalar or Array
Numeric or string
Defined by: $param = value
z param = name of parameter
z value = numeric or string value of parameter
Name of parameter
z Must start with $
z Is not case sensitive ($length same as $LENGTH)
/modified journal file with parameters for height ($h) and radius ($r)
$h = 10
$r = 2
volume create height $10 radius1 $r radius3 $r zaxis frustum
/modified journal file with parameters for height ($h) and radius ($r)
$h = 10
$r = 2 Use Parenthesis
volume create height $h radius1 $r radius3 $r offset 0 0 ($h/2) \
zaxis frustum
9-9 Fluent Inc. 1/19/2005
Fluent User Services Center Introductory GAMBIT Training
GAMBIT 2.2 December 2004
www.fluentusers.com
Array (1)
Define arrays by declare $p[{n1}:m1, {n2}:m2, ...]
z Where p is the name of the parameter
z n is the starting index ({} indicate this is optional; default is 1)
z m is the range of the dimension
z Square brackets [] are necessary
Elements in the array still need to have values assigned to them
z $p[1,2]= 6.5
declare $p[3,2]
1st dimension is the pipe number (1, 2 or 3)
2nd dimension is the radius (1) or height (2)
1 $p[1,1] = .5 $p[1,2] = 3
Pipe 1, 2, 3
2 $p[2,1] = 1 $p[2,2] = 3
3 $p[3,1] = 2 $p[3,2] = 4
Special Constants
Available for use in any expression
z PI 3.141592653590
z TWOPI 6.283185307180
z DEG2RAD 0.0174532925199
z RAD2DEG 57.29577951308
Examples
z 4 * $rad * RAD2DEG
z $arclength = PI * $radius
Expressions
Arithmetic, logical, or string
Enclose in parentheses when used as arguments to commands, IF statements,
or DO conditions
volume create height $h radius1 $r radius3 $r offset 0 0 ($h/2) \
zaxis frustum
String Expressions
String parameters defined as $name = GAMBIT
Enclose string constants in double-quotes
z "volume.1"
z "fluid"
z $extension = .one
Functions
Can be used in any expression
Return a single numerical, logical, or string value
Not case sensitive
Arguments are constants or expressions enclosed in parentheses
z ABS(exp)
z COS(exp)
String Functions
Many string functions available, such as STRLEN and STRCMP
STRLEN: number of characters in a string
z $x= STRLEN("title")
z $x=5
CSTRCMP: case sensitive string compare
z $y= CSTRCMP ("ABD","abd")
z $y=0
DO Loops (1)
Syntax
z DO PARA "$param" INIT exp1 COND(cond) INCR exp2
commands
ENDDO
Where
z PARA - loop parameter
$param - must be defined before loop
z INCR - increment
z INIT and INCR are optional; if one of them is not defined, its value
is set to 1 (i.e. $param is initialized to be 1 or is incremented by 1)
$i = 0
$j = 0
$imax = 5
$jmax = 5
/
do para "$i" init 0 cond ($i .le. $imax)
do para "$j" init 0 cond ($j .le. $jmax)
vertex create coordinates $i $j 0
enddo
enddo
In the following Gambit journal the condition is false and a coarse grid is
created
/coarse grid: a = - 1
/fine grid: a = 1
$a= -1
if cond ($a .gt. 0)
volume mesh "volume.1" cooper source "face.1" "face.3" size 1
else
volume mesh "volume.1" cooper source "face.1" "face.3" size 10
endif
Current Limitations
Parameter definition in the Edit - Parameters form does not
produce journal commands
Parameters and expressions can NOT be used within the GUI
Journals produced by GAMBIT contain the values of parameters
and expressions, not the parameters/expressions themselves