in the database, CASD will display the contents of the geometry file in the graphic area after successful open. The contents of the geometry file can be edited using the Edit File command in the Geometry menu, see sectionGeometry menu.
3.2.3 Save
Shortcut: CTRL+S
Saves the current simulation job (i.e. the various files that define the job).
The Save command in the File menu saves the current job.
3.2.4 Save as
Shortcut: CTRL+SHIFT+S
The Save As command saves the current job under a new (user-defined) name (job number).
3.2.5 Import
Imports certain specifications from another simulation job (e.g. grid file, scenario file, etc.).
3.2.6 Exit
Shortcut: CTRL+Q Exits the CASD software.
3.3 Geometry menu
CASD stores the geometry in a database, and on the geometry file (co-file). The commands in the Geometry menu in the main window, except the Edit File command, are available when connected to a database. The Save and Save As commands in the File menu writes the geometry to the geometry file.
The building blocks in a CASD geometry are instances of objects. Objects can be global or local.
Several geometries can contain instances of the same global object, while a local object only can be included in the geometry where it was created.
Instances can be grouped under assemblies. Several levels of assemblies can be created. Each instance and assembly has a transformation matrix. The position, scale, and orientation of an instance is the result of the matrices on all levels above the instance, in addition to the matrix for the instance itself.
Each geometry is a member of a project. The project is the top level in the CASD data structures.
A project can own a number of geometries.
Instances and assemblies can be made invisible and visible using the following commands:
CTRL+I Make the selected assembly/instance invisible CTRL+SHIFT+I Make the selected assembly/instance visible.
Use the Position command in the Geometry menu to change the position of the selected assembly or instance.
3.3.1 Geometry Database
The first option on the Geometry menu in CASD opens the Database dialog box.
Figure 3.3: The geometry database window in CASD
In the Database dialog box the user can:
• Create a new database, project, geometry, or object.
• Connect to or save an existing database.
• Open or save existing, projects, geometries, or objects.
• Insert instances in a geometry.
• Define new materials or edit existing materials.
3.3.1.1 Geometry tab
On the Geometry tab the user can create, open and manipulate projects and geometries. Projects can be renamed and deleted, geometries can be renamed, copied and deleted.
3.3.1.2 Objects tab
The New Object button in the Database dialog box opens the Object window.
3.3.1.3 Materials tab
Each object in a CASD database is assigned a material property, and each ’material’ is assigned a colour hue from the 0-360° colour circle. To define a new material click the New Material button. The new material is defined by a name and a hue, a value between 0 and 360.
3.3 Geometry menu 41
3.3.2 Creating a CASD database
To create a database choose Geometry→Database or type∗ geometry database. The Geome-try Databasewindow is shown. Click the Connect button. A file selection dialog box is displayed.
Move to the directory where the database should be created, and write the name of the database, e.g. my_database.db. Alternatively the database can be created using the command input: ∗ database create my_database.db, which will create a database in the current directory.
If the Geometry Database window is not open, choose Geometry→Database. Use the New Project button to create a new project, or the Open Project button to open an existing project.
When a project is opened, a new geometry can be created clicking the New Geometry button, or open an existing geometry clicking the Open Geometry button.
When an existing geometry is opened, the assembly/instance structure and all objects and materials used are loaded into the CASD program. If the geometry contains many assem-blies/instances, you may get an error message indicating that there were not room enough in the CASD data structures. See sectionCASD command line optionsfor information on how you can use command line options to allocate more memory for these structures.
3.3.3 Connecting to a database
To create a new database, see sectionCreating a CASD database.
To connect to an existing database choose Geometry→Database or type ∗ geometry database. The Geometry Databasewindow is shown. Click the Connect button. A file se-lection dialog box is displayed. Select the CASD_DB file on the database directory you want to connect to.
If you enter the file name in the command input field, the path must be encapsulated in apostro-phes, for instance:
∗ database connect "MyCasdDB/CASD_DB"
3.3.4 Creating a new or opening an existing object
You can create a new object clicking the New Object button on the Objects tab in theGeometry Databasewindow, or open an existing object using the Open button.
When you have completed the New or Open Object command, the object window is displayed.
3.3.5 Selecting a node and a subtree
At any time, a part of the binary tree is selected. It may be a single node, or a subtree containing several nodes. If a subtree is selected, the top node is referred to as the selected node. In the postfix string, the top node is the rightmost node in the subtree.
The selected subtree is highlighted in the graphic window, and underlined in the message area.
There are two different methods for selecting a subtree.
1. Click MOUSE+LEFT while pointing at a primitive. If several primitives are hit, they are placed on a stack (list). Only one primitive is selected at a time. Press CTRL+TAB command to parse this stack.
2. Use the following commands:
CTRL+L Select the previous instance CTRL+R Select the next instance
3.3.6 Maintaining a CASD database
The dbfutil program is available for creating and maintaining CASD file databases.
Linux:
run9 dbfutil database command [option]
Windows:
dbfutil database command [option]
The usage of this program is described in tableUsing the the dbfutil program. Make sure that no other users are connected to the database when you execute this program.
Command Description
create Create database
destroy Destroy database
force Destroy database, override any errors
dellock Delete all locks. Use this command if files in
the database are still locked after a crash in CASD
restoredep Restore dependencies. For each object in the
database, there is a file containing a list of all geometries that contain instances of the object. (Executing the Information command in the File menu in the Object dialog lists the contents of this file.) This file is used for determining if the object can be deleted when you execute the Delete Object command in the Database menu. CASD updates these files when required. But if a problem should occur for some reason, the restoredep command might help. It updates the file mentioned above for all objects in the database.
restorehead Restore header files. This command resets
the process log file for the database. This file contains a list of (CASD) processes currently connected to the database.
3.3 Geometry menu 43
list List the content of all table files, e.g. list O
lists all objects:
P List the content of all project table files.
O List the content of all object table files.
M List the content of all material table files.
G List the content of all geometry table files.
L List the content of all local object table files.
U List the content of all objects-used table files.
A List the content of all asis table files.
Table 3.3: Using the dbfutil program
We strongly recommend that you make backups of your databases on a regular basis.
3.3.7 Local objects
Local objects consist simply of one box or one cylinder. Use local objects to define entities like walls, floors etc. Define global objects for more complicated things.
The name of a local object must start with an underscore character (_).
The Local Object command in the Geometry menu creates a local object, and one instance of it.
You can of course create several instances of the local object using the Instance command.
The Local Object command has two sub choices, Box and Cylinder. Select the appropriate primi-tive type.
CASD will first ask for the material name. Enter the name of an existing material. The material decides the colour of the object. If you haven’t defined any materials, use the New Material command in the Geometry Database window to create one.
CASD will then ask for the sizes and porosities for the primitive. CASD creates an instance of the object in (0, 0, 0). Use the Position or Translate command to move it to the correct position.
You can use the Properties command to edit material, sizes and porosities for a local object. The Rename command changes the name of the object.
3.3.8 Global objects
A global object is edited in a separate object window. All the commands described in this chapter refers to the menus in the object window.
Global objects can have instances in several geometries. The structure within a global object is a constructive solid geometry (CSG) model where simple solid primitives are combined by means of Boolean set operations. The primitives and operations are nodes in a binary tree where the leaves are primitives and the internal nodes are operations.
Boxes, cylinders, ellipsoids, general truncated cones (GTC) and complex polyhedrons (CP8) are
the primitive types supported. The box primitive includes planes as a special case. Available operation types are union and difference.
Warning:
Only boxes and cylinders should be used in by default, but ellipsoids, general truncated cones and complex polyhedrons can be used in special cases. These latter primitive types have the following important limitations:
• No subgrid models, thus not contribution to turbulence and drag force
• Porosity calculation takes a long time for these primitive types. There should be no more than 100-200 of these primitives in any given geometry
Figure 3.4: Supported primitive types
A root is a subtree that is not part of another subtree. The object typically contains several roots during editing. But it must contain only one root when it is saved.
The postfix string represents a way of visualising the binary tree defining the object.
The postfix string for the open object is displayed in the message area in the object window. The selected subtree is highlighted.
Amaterialis assigned to each object. The material decides the colour of the object.
3.3 Geometry menu 45
Figure 3.5: The binary tree for an objects, and the corresponding postfix string
3.3.9 Assembly
Opens a dialog box where the user can specify an assembly of several instances.
3.3.9.1 Adding an assembly
Assemblies represents a way to group the instances in complicated geometries. The Assembly command in the Geometry menu adds an assembly to the geometry. CASD will ask for the assembly name. You must enter a name that doesn’t exist on the same level, see below. The assembly is placed in (0, 0, 0). You can transform an assembly in the same way as an instance.
All geometries contains at least one assembly, called the top assembly. That assembly can not be deleted.
When you create an assembly, it is placed in the geometry structure depending on what was selected on forehand. If an instance was selected, the new assembly is placed after that instance under the same assembly. If an assembly was selected, the new assembly is placed under that assembly.
You can later rename the assembly using the Rename command.
3.3.9.2 Selecting an assembly or instance
The selected instance, or all the instances in the selected assembly, are highlighted in the graphic window. The name of the selection is written in the message area. The name is concatenated from the geometry name, the names of all assemblies above the selected assembly/instance, and the name of the selected assembly/instance. Each level is separated by a period (.). An example is shown below.
Current Geometry Selection: M24.A1.COOLER-2
Here, M24 is the geometry name, A1 is an assembly. The last part of the string is the lowest level. In this example, it is an instance, identified by the object name, COOLER, and the instance number.
There are three different methods for selecting an assembly or instance. The first method is to select from the graphic window. To do this, click MOUSE+LEFT while pointing at the instance. If several instances are hit, they are placed on a stack. Only one instance is selected at a time. In CASD4 use the CTRL+TAB command to parse this stack.
The second method is to use the following commands:
• Select the parent assembly: Press CTRL+U.
• Select the child assembly/instance: Press CTRL+D.
• Select the assembly/instance name: Press CTRL+F. You are asked to enter the concatenated name to select.
• Select the previous assembly/instance on the same level: Press CTRL+L.
• Select the next assembly/instance on the same level: Press CTRL+R.
The third method is to use the List command in the Geometry menu to pop up a list of the contents of the open geometry. You can use the mouse to select from the list.
3.3.10 Instance
Creates an instance in the current geometry and/or assembly.
3.3.10.1 Adding an instance
To add an instance of an object, use the Instance command in the Geometry menu. CASD will ask for the object name. You must enter the name of an existing object. The instance is placed in (0, 0, 0). Use the Position or Translate command to move it to the correct position.
Alternatively the Instance button on the Objects tab in Geometry Datbase dialog can be used.
When a new instance is created, it is placed in the geometry structure depending on what was selected on forehand. If an instance was selected, the new instance is placed after that instance under the same assembly. If an assembly was selected, the new instance is placed under that assembly.
3.3.11 Local object
Creates a local object in the current geometry.
3.3.12 Delete
Deletes either the currently selected instance, local object, or the current assembly (must be empty).
3.3.13 List
Lists all assemblies and instances in the current geometry, including modified positions.
3.3 Geometry menu 47
3.3.14 Duplicate
Duplicates the selected instances in the current geometry.
3.3.15 Position
Defines the position of an instance.
3.3.16 Translate
Translates the current instance.
3.3.17 Rotate
The Rotate command rotates the selected assembly or instance. Note that CASD only accepts axis parallel geometry. That means that the rotation angle must be a multiples of 90 degrees.
3.3.18 Scale
Scales the current instance by a certain factor in each spatial direction
3.3.19 Matrix
Specifies the transformation matrix of the current instance. This command is normally not used directly, but is available formacro reading and writing.
3.3.20 Making an assembly or instance visible or invisible
Shortcut: CTRL+I CTRL+SHIFT+I
This command lets the user make the current instance invisible/visible.
3.3.21 Select
Selects an instance in the current geometry through the following short cut options. See section Selecting an assembly or instance.
3.3.22 Substitute
Substitutes all instances of one object in the current geometry with instances of another object.
The user specifies the name of the existing object and new objects.
3.3.23 Properties
Opens a dialog box where the user can observe and edit the properties of a local object.
3.3.24 Rename
Opens a dialog box where the user can rename assemblies or local objects.
3.3.25 Object
Opens the currently selected object.
3.3.26 Edit file
The Edit File command in the Geometry menu makes it possible to edit thegeometry file (co file) for the open job. This command is only available when no geometry is open in the database.
The geometry is saved on the geometry file as one single object, when selectingSavein CASD.
Upon the Edit File command, an object window is therefore shown for editing this object, if the geometry database is not available, or the user wants to make small modifications to the geometry outside of the database.
Since the object structure lacks the assembly/instance mechanism, editing the geometry file di-rectly without using the database is recommended only for geometries with a relatively small number of primitives. For geometries with many primitives, the postfix string is long and diffi-cult to manage.
Editing the geometry file for FLACS simulations may be advantageous when the user want to test the impact of small changes in the geometry on the simulation results. Note that there is no way to update the database from the geometry file.