• No results found

Flacs v9 Manual

N/A
N/A
Protected

Academic year: 2021

Share "Flacs v9 Manual"

Copied!
262
0
0

Loading.... (view fulltext now)

Full text

(1)

FLACS v9.0 User’s Manual

Copyright ©GexCon AS

(2)
(3)

Contents

1 Introduction 1

1.1 About this publication . . . 1

1.2 Preface . . . 2

1.3 Acknowledgements. . . 2

1.4 About this manual . . . 4

1.5 Feedback from users . . . 6

2 Getting started 7 2.1 Prerequisites for users . . . 8

2.2 Hardware and software requirements . . . 8

2.3 Software installation and setup . . . 9

2.4 Running FLACS . . . 15

2.5 Help and support . . . 19

2.6 Introductory example. . . 20

3 CASD 31 3.1 Overview. . . 32

3.2 File menu. . . 38

3.3 Geometry menu . . . 39

3.4 Object window in CASD . . . 48

3.5 Grid menu . . . 56 3.6 Porosities menu . . . 61 3.7 Scenario menu . . . 61 3.8 Block menu . . . 103 3.9 View menu. . . 105 3.10 Options menu . . . 107 3.11 Macro menu . . . 108 3.12 Help menu . . . 109

(4)

4 Flacs simulator 113

4.1 Overview. . . 114

4.2 The Run Manager . . . 114

4.3 Running several simulations in series . . . 116

4.4 Output variables in FLACS . . . 118

4.5 Files in FLACS. . . 129

4.6 Input files to FLACS simulations . . . 130

4.7 Output files from FLACS simulations . . . 149

4.8 Potential bugs or problems with Flacs . . . 153

4.9 Warning and error messages. . . 153

5 Flowvis 155 5.1 Overview. . . 156

5.2 Creating a new presentation . . . 161

5.3 File menu. . . 161 5.4 Edit menu . . . 164 5.5 Page menu . . . 165 5.6 Plot menu . . . 167 5.7 Verify menu . . . 178 5.8 Options menu . . . 179 5.9 Help . . . 180 5.10 Flowvis examples . . . 180

6 Utility programs in FLACS 187 6.1 Geometry, grid and porosities . . . 188

6.2 Release source modelling . . . 193

6.3 Modifying simulation files . . . 197

6.4 Post-processing of simulation data . . . 200

7 Best practice examples 205 7.1 Combined dispersion and explosion simulations with FLACS . . . 206

7.2 Simulation Example . . . 206

7.3 Equivalent Stoichiometric Gas Cloud. . . 215

7.4 Dispersion simulation with wind . . . 219

7.5 Hydrogen explosions and DDT . . . 219

8 Technical Reference 221 8.1 Definitions and gas thermodynamics. . . 222

(5)

CONTENTS iii

8.2 Stoichiometric reaction . . . 223

8.3 Governing equations for fluid flow . . . 224

8.4 Wall functions . . . 226

8.5 Wind boundary . . . 227

8.6 Combustion modelling . . . 229

8.7 Modelling of jet sources . . . 230

8.8 Numerical Schemes . . . 232

8.9 Linux Quick Reference . . . 233

9 Nomenclature 237 9.1 Roman letters . . . 238 9.2 Greek letters . . . 239 9.3 Subscripts . . . 239 9.4 Dimensionless groups . . . 240 9.5 Abbreviations . . . 240 9.6 FLACS variables. . . 241 10 References 243

(6)
(7)

Chapter 1

Introduction

1.1

About this publication

FLACS v9.0 User’s Manual

Copyright ©2009 GexCon AS All rights reserved

Updated: January 26 2009 Typeset in Doxygen Printed in Norway

Intellectual property notice

No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise, without written permission from GexCon AS.

GexCon AS hereby grants permission to use, copy, and print this publication to organizations or individuals holding a valid licence for one or several of the software packages described herein. For further information about GexCon AS, please visit the web site:http://www.gexcon.com

Exclusion of liability

GexCon AS has distributed this publication in the hope that it will be useful, but without any warranty, without even the implied warranty of merchantability or fitness for a particular pur-pose.

Although great care has been taken in the production of this publication to ensure accuracy, GexCon AS cannot under any circumstances accept responsibility for errors, omissions, or advice given herein.

(8)

Registered trademarks

• FLACS, DESC, CASD, and Flowvis are registered trademarks of GexCon AS. • Linux is a registered trademark of Linus Torvalds.

• Windows is a registered trademark of Microsoft Corporation.

Other product names mentioned herein are used for identification purposes only and may be trademarks of their respective companies.

1.2

Preface

Computational fluid dynamics (CFD) is a branch of fluid mechanics that uses numerical methods and algorithms to solve and analyze problems that involve fluid flow, with or without chemical reactions. Current use of CFD covers a broad range of applications, from fundamental theoret-ical studies involving models primarily derived from first principles, to practtheoret-ical engineering calculations utilizing phenomenological or empirical correlations.

Many of the hazards encountered in the society, and especially in the process industries, involve accident scenarios where fluid flow in complex, large-scale, three-dimensional (3D) geometries play a key role. FLACS is a specialized CFD toolbox developed especially to address process safety applications such as:

• Dispersion of flammable or toxic gas • Gas and dust explosions

• Propagation of blast and shock waves • Pool and jet fires

The development of FLACS started in 1980 at the Department of Science and Technology at Chris-tian Michelsen Institute (CMI). CMI established GexCon (Global Explosion Consultants) as a con-sultancy activity under the Process Safety Group in 1987. In 1992, the Science and Technology department at CMI became Christian Michelsen Research (CMR), and CMR established GexCon as a private limited company in 1998. GexCon AS is a wholly owned subsidiary of CMR, and holds the full proprietary rights to the CFD code FLACS.

The purpose of this manual is primarily to assist FLACS users in their practical work with the software. In addition, the manual aims at documenting both the physical and chemical models, and the numerical schemes and solvers, implemented in the CFD code. Ample references to published literature describe the capabilities and inherent limitations of the software.

1.3

Acknowledgements

The development of the FLACS software would not have been possible without the generous contributions received from supporting companies and government institutions throughout the years. The activity started at Christian Michelsen Institute (CMI) in 1980 with the Gas Explosion Programmes (GEPs), and FLACS-86 was the first version distributed to the supporting compa-nies.

(9)

1.3 Acknowledgements 3

Figure 1.1: The M24 compressor module represented in FLACS-86

The development of FLACS continued with the Gas Safety Programs (GSPs) and related projects up to around 2000:

• BP, Elf, Esso (Exxon), Mobil, Norsk Hydro, and Statoil supported the development of FLACS-86 during the First GEP (1980-1986).

• BP, Mobil, and Statoil supported the development of FLACS-89 during the Second GEP (1986-1989).

• BP, Elf, Esso, Mobil, Norsk Hydro, Statoil, Conoco, Philips Petroleum, Gaz de France, NV Nederlandse Gasunie, Bundes Ministerium für Forschung und Technologie (BMFT), Health and Safety Executive (HSE), and the Norwegian Petroleum Directorate supported the de-velopment of FLACS-93 during the First GSP (1990-1992).

• BP, Elf, Esso, Mobil, Statoil, Philips Petroleum, Gaz de France, HSE, and the Norwegian Petroleum Directorate supported the development of FLACS-94, FLACS-95, and FLACS-96 during the Second GSP (1993-1996).

• BP, Elf, Exxon, Mobil, Norsk Hydro, Statoil, Philips Petroleum, Gaz de France, HSE, Agip, MEPTEC, and the Norwegian Petroleum Directorate supported the development of FLACS-97, FLACS-98, and FLACS-99 during the Third GSP (1997-1999).

• BP, TotalElfFina (TEF), Norsk Hydro, Statoil, Gaz de France, Philips Petroleum, Mobil and supported the LICOREFLA project (2000-2001).

Since 2000, various Joint Industry Projects (JIPs), funding from the European Commission (EU) and the Norwegian Research Council (NFR), and support and maintenance fees (S&M) from an increasing number of commercial costumers have supported the development of the more recent FLACS releases, including several specialized versions of FLACS, such as DESC (Dust Explosion Simulation Code), FLACS-Dispersion, and FLACS-Hydrogen:

• FLACS-Dispersion and FLACS-Hydrogen became available in 2001. • FLACS v8.0 came in 2003, including a test release of FLACS-Explo. • FLACS v8.1 came in 2005.

(10)

• DESC 1.0 came in 2006.

• FLACS v9.0 came in 2008, including a test release of FLACS-Fire.

• GexCon also develops several in-house R&D tools, including Explo, FLACS-Aerosol, and FLACS-Energy.

GexCon is grateful to all companies, government institutions, and individuals that have partici-pated in the development of FLACS. We intend to honour these contributions by continuing to develop the software, and thereby contribute to improved safety in the process industries.

1.4

About this manual

This User’s Manual describes a family of computational fluid dynamics (CFD) software products from GexCon AS, generally referred to as FLACS:

• The preprocessor CASD

• The CFD simulator Flacs

• The postprocessor Flowvis

• Utility programs in FLACSsuch as:

geo2flacs,gm, andPorcalc jetandflash

rdfile,cofile, andcomerge r1file,r3file, anda1file

These programs constitute a specialized CFD tool, FLACS, or ’standard FLACS’, designed to study releases of flammable gas and gas explosions in complex congested geometries, both on-shore and offon-shore. This manual also describes specialized versions of FLACS:

• FLACS-Hydrogen • FLACS-Dispersion • FLACS-Aerosol • FLACS-Energy • FLACS-Explo • FLACS-Fire • DESC

A full version of Standard FLACS exhibits the full functionality of Hydrogen and FLACS-Dispersion, whereas DESC and FLACS-Fire are separate software products. FLACS-Energy, FLACS-Explo, and FLACS-Aerosol are still in-house R&D tools. The acronym FLACS (FLame ACceleration Simulator) refers to the complete package of software products, whereas the term Flacs refers specifically to the numerical solver in the CFD code.

The latest release of FLACS is version 9.0 (FLACS v9.0). This version represents a major upgrade to the graphical user interfaces (GUIs), and is the first version that runs under both the Linux and Windows operating systems.

Getting startedpresents a detailed example for new users of FLACS, andBest practice examples

contains further examples that highlight various applications of FLACS, including some of the specialized versions.

(11)

1.4 About this manual 5

1.4.1

Printing conventions in this manual

• The symbol ’>’ followed by text in typewriter font indicates command line input, e.g.: > command -options arguments (general syntax for commands)

> find -name flacs (command line input in Linux)

• The symbol ’∗’ followed by text in typewriter font field input commands, e.g.:

∗exit yes yes

• The symbol→indicates a path through nested menu items or dialog box options, e.g.: File→Save

Scenario→Ignition→Time of ignition

• Certain features of the software may only be accessible through text file input, and the content of a text file is also printed in typewriter font:

THE FIRST LINE OF THE FILE ... THE SECOND LINE OF THE FILE ...

... ...

• The format for describing keyboard and mouse input follows the pattern: CTRL+C

CTRL+MOUSE+LEFT

• The use of bold or italic font emphasizes specific words or phrases in the text.

• TheNomenclaturechapter lists the symbols and abbreviations adopted in this manual.

1.4.2

Special messages

Warning:

Look out for the potential pitfalls pointed out by this heading!

Attention:

Be aware of practical information pointed out by this heading.

Remarks:

Take notice of the points summarized under this heading.

See also:

Follow up the additional sources of information suggested by this heading if required.

1.4.3

Job numbers

The typical application of the FLACS software is to quantify potential consequences of industrial accident scenarios involving compressible fluid flow, with or without chemical reactions. Proper characterization of a particular problem may involve several simulations, and it is usually conve-nient to organize the files from related scenarios in a dedicated directory. The individual FLACS simulations are assigned job numbers, or simulation numbers, or simply jobs. A user may for instance type:

> run9 flacs 010100

on the command line in Linux to start a FLACS simulation for job number 010100. The job numbers are constructed from a six-digit string ijklmn, where traditionally:

(12)

• ij is the project number. • kl is the geometry number. • mn is the sequence number.

The default job number used in many of the examples in this manual is 010100, i.e. project 01, geometry 01, simulation 00. However, each of the six digits in the job number may in principle take on any integer value from zero to nine, and the references to project, geometry, and sequence numbers only apply when the job numbers are derived from the file database in CASD.

Any updated version of this manual may be found on the FLUG web site.

1.5

Feedback from users

Feedback on the content in this manual is most welcome, and FLACS users may submit their comments or suggestions by e-mail to:[email protected]

When submitting comments or suggestion to the content of the manual, or when pointing out misprints in the text, please indicate the relevant page numbers or sections, and the correspond-ing version of the manual (date issued).

(13)

Chapter 2

(14)

This chapter describes the basics of setting up the FLACS software for new users, including rec-ommendations concerning the user threshold, typical hardware requirements, and procedures for installing FLACS on both Linux and Windows.

2.1

Prerequisites for users

Efficient use of FLACS does not require detailed knowledge about computational fluid dynam-ics (CFD). However, users should possess some experience in the application of computers for routine tasks, such as text editing. Proper interpretation of simulation results requires adequate knowledge within the field of fluid dynamics. A suitable starting point for the novice in the field of gas explosions is theGas Explosion Handbook (Bjerketvedt et al., 1993) from Christian Michelsen Research (CMR), and new users of FLACS should attend a three-day introductory course arranged by GexCon AS (http://www.gexcon.com).

2.2

Hardware and software requirements

FLACS v9 is available on Linux and on Microsoft Windows. The hardware requirements for running the FLACS software depend to some extent on the size of the problem in question, i.e. the number of grid cells required to resolve the computational domain properly. Most modern computers, be it desktops and laptops, will perform well for small or medium sized problems. A powerful screen card may be required to handle large geometries in CASD, extra memory (RAM) is necessary for simulating large problems, and storage of large amounts of simulation data dictates the requirements for disk space.

Hardware requirements:

• Processor: Intel or AMD ix86 32 bit, Intel EM64T or AMD64. Intel IA64 is not supported. • Internal memory; 2GB or more recommended.

• Free harddrive capacity: 350MB for software installation and typically 100GB simulation space.

• Graphics card using NVIDIA chip set. Graphics cards using for instance ATI or Intel chipsets are in general not supported.

• DVD-RW drive recommended.

• High resolution colour screen (minimum 19", 1600x1200, 24 bit color depth). FLACS v9 has been tested on the following platforms.

Linux: • OpenSuse 10.0, 10.2, 10.3, 11.0 • CentOS 4.6, 5.1 • Ubuntu 7.10 • Fedora 8 Microsoft Windows: • XP (32 bit) • Vista (32 bit)

(15)

2.3 Software installation and setup 9

Red Hat Enterprise Linux 4.6, 5.1 is expected to be FLACS v9 compatible since it is compatible with CentOS 4.6, 5.1.

For updated hardware and software requirements, please refer to GexCon’s website,

http://www.gexcon.com.

2.3

Software installation and setup

A license server is necessary for running FLACS. This section presents FLACS installation, the FLACS Licence Server and the FLACS Configuration Wizard that guides users through the basic steps of setting up a FLACS Licence Server. All FLACS installations on a network acquire their individual licenses from a central licence server, and only one FLACS License Server should therefore be running on a given network.

FLACS is distributed in a single setup file.

2.3.1

On Linux

On Linux FLACS can be installed system wide, in which case FLACS will be available to all users, or in a user’s home directory, in which case it will be available to this user only.

2.3.1.1 Installing in users home directory

If only one person will be using FLACS, the software can be installed in this users home directory. FLACS will by default be installed under /home/my_user/GexCon.

Save the installation package to a convenient location. Make sure the file is executable:

> chmod u+x /home/my_user/flacs-v9.0-installer

Run the installation program:

> /home/my_user/flacs-v9.0-installer

Please follow the instructions given. It is recommended to keep the default parameters.

FLACS requires a license to run. The license is provided by a license server, which is installed on only one machine on the local network. During the installation the user can choose to install:

1. Both FLACS software and FLACS license manager 2. FLACS license manager only

For a user home directory installation option 1 should be selected.

The FLACS license manager must be set up before using FLACS. Please refer to the section about

FLACS configure wizard.

2.3.1.2 Installing system wide as super user

To install FLACS system wide, access to the system super user ("root") is required. /path/to/installationis the path to the location of the FLACS installation package.

(16)

Change user to super user ("root"): > su <give password>

Make sure the file is executable:

> chmod u+x /path/to/installation/flacs-v9.0-installer

Run the installation program:

> /path/to/installation/flacs-v9.0-installer

Please follow the instructions given. It is recommended to keep the default parameters.

FLACS requires a license to run. The license is provided by a license server, which is installed on only one machine on the local network. During the installation the user can choose to install:

1. Both FLACS software and FLACS license manager 2. FLACS license manager only

Option 2 can be used to install a FLACS license manager on a system not running FLACS. Alter-natively one FLACS workstation in the network can be set up to serve licenses to all other FLACS installations in the network.

The FLACS license manager must be set up before using FLACS. Please refer to the section about

FLACS configure wizard.

2.3.2

On Windows

To install FLACS on Windows please double-click the installation package "flacs-v9.0-installer.exe". This will start the installation wizard. Please follow the instructions given. It is recommended to keep the default parameters.

FLACS requires a license to run. The license is provided by a license server, which is installed on only one machine on the local network. During the installation the user can choose to install:

1. Both FLACS software and FLACS license manager 2. FLACS license manager only

Option 2 can be used to install a FLACS license manager on a system not running FLACS. Alter-natively one FLACS workstation in the network can be set up to serve licenses to all other FLACS installations in the network.

The FLACS license manager must be set up before using FLACS. Please refer to sectionSetting up the FLACS license server.

2.3.3

Setting up the FLACS license server

FLACS version 9.0 has a completely new license server/manager system, which operates through a network protocol. This means that the license manager can be installed anywhere on the net-work, as long as it is available to the FLACS clients through the local network. The license man-ager can be installed locally on the machine where the FLACS simulation software is installed, or

(17)

2.3 Software installation and setup 11

separately from the simulation software. Only one license manager should be running on your network, and this is where the FLACS license is installed. All other FLACS installations should be set up using this license manager.

After the installation is finished, the FLACS license configuration utility should start automat-ically. In the event that this does not happen please start the configuration utility as follows, depending on your installation.

Linux:

> /usr/local/GexCon/FLACS_v9.0/bin/run configureWizard

Windows:

> C:\Program Files\GexCon\FLACS_v9.0\bin\configureWizard.exe

Alternatively it can be started from the FLACS Runmanager Help→Start Configuration Wizard. If FLACS is installed system wide (installed as root), on Linux, the license manager must be running as user root.

The configuration utility will guide you through the setup of the license manager. The config-uration utility is also used to configure a FLACS installation that gets its license from a license manager on a separate machine.

2.3.3.1 Setting up the license server on client only FLACS installation

If a FLACS license server is installed and running somehwere on the local network, the FLACS installation must be configured to connect to the license server.

Figure 2.1: Setting up the license server on client only FLACS installation

2.3.3.2 Setting up the license server on a combined license server and client FLACS installa-tion

If there is no FLACS license server available on the local network, a license server must be in-stalled. To install a license server together with the FLACS simulation software, on the same

(18)

machine, please use the following procedure. Alternatively a FLACS license server can be in-stalled on a separate machine, with or without FLACS software. Please refer to section Stan-dalone FLACS license manager installation.

Figure 2.2: Setting up the license server on a combined license server and client FLACS installa-tion (steps 1 and 2)

Figure 2.3: Setting up the license server on a combined license server and client FLACS installa-tion (steps 3 and 4)

2.3.3.3 Standalone FLACS license manager installation

It is possible to install the FLACS license manager only. This is useful if you would like to have the license manager on a separate machine. To do this select the appropriate option during in-stallation (seeSoftware installation and setup).

(19)

2.3 Software installation and setup 13

To configure a standalone FLACS license manager prompt the license manager for an activation key, by running the following command in a terminal window.

Linux:

> /usr/local/GexCon/FLACS_LicenseManager/bin/FLMserver --get-ActivationKey

Windows:

> C:\Program Files\GexCon\FLACS_LicenseManager\bin\FLMserver.exe --get-ActivationKey

Send the activation key together with the IP address and license manager communication port number to<[email protected]>.

The communication port defaults to 25001. Please make sure that this port is available, and open on your system. If you are not sure about this please contact your system administrator.

GexCon will, based on the activation key, create a license text file. This file must be saved to: Linux:

> /usr/local/GexCon/FLACS_LicenseManager/license/license-server.flm

Windows:

> C:\Program Files\GexCon\FLACS_LicenseManager\license\license-server.flm

Note that when using a standalone FLACS license manager, the license manager must be started manually each time the computer is restarted. This can be done using a startup script (not pro-vided).

2.3.3.4 Starting FLACS license manager as a service on Windows

The FLACS license manager can be started as a service on Windows using the following proce-dure.

1. Verify that the FLACS License Manager is working properly as a desktop application (a) FLACS software and license key must be installed (see procedureabove)

(b) Test run FLMserver with the graphical user interface and then quit:> "C:\Program Files\GexCon\FLACS_LicenseManager\bin\FLMserver.exe"

(c) Make sure to quit FLMserver, the service will not function if there is a desktop FLM-server running.

2. Download and install the Windows Resource Kit (rktools.exe) (a) See the following links about Windows Services and related tools:

• http://search.microsoft.com/results.aspx?mkt=en-US&setlang=en-US&q=rktools.exe

• http://support.microsoft.com/kb/137890

3. Install the FLACS License Manager service "FLMserver" using INSTSRV: (a) > instsrv FLMserver "C:\Program Files\Windows Resource

Kits\Tools\srvany.exe"

(b) The service can be removed with> instsrv FLMserver REMOVE (c) The path to srvany.exe might be different on your Windows installation

(20)

4. Run REGEDIT to set up the details of the service

(a) It is strongly advised to backup your current registry before editing (b) > regedit

(c) Locate and select the FLMserver key:

• "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FLMserver" (d) Add one new value for FLMserver: Description

• Edit→New→String Value : "Description" • Description = "FLACS License Manager service." (e) Add one new key for FLMserver: Parameters

• Edit→New→Key : "Parameters"

Add two new values for FLMserver\Parameters: Application and AppParam-eters

* Edit→New→String Value : "Application" * Edit→New→String Value : "AppParameters"

* Application = "C:\Program Files\GexCon\ FLACS_-LicenseManager\bin\FLMserver.exe"

* AppParameters = –without-gui

* IMPORTANT NOTE: options start with double dashes: –without-gui • The service will start automatically on reboot, it can also be started/stopped

man-ually:

Control Panel→Administrative Tools→Services

2.3.4

Setting up the FLACS environment

After installation FLACS programs can be accessed from the system menu, in the following loca-tions:

Linux (KDE): Start→Applications→Edutainment→Construction

Linux (Gnome): Applications→Other

Windows: Start→All Programs→GexCon→FLACS_v9.0

Some systems may require the user to log out and restart before FLACS will appear in the system menu.

Desktops that do not follow the freedesktop.org standards will not install an icon in the Appli-cations menu. This will happen on older distributions. In these cases, the user may be able to install icons and associations manually. Refer to your GNU/Linux distribution vendor for details on how to customize your desktop.

2.3.4.1 FLACS User setup on Linux

For easy access to FLACS from the command line add the following text to you startup file. If you use the csh/tcsh shell, edit or create the .cshrc file:

alias run9 /usr/local/GexCon/FLACS_v9.0/bin/run

If you use the bash shell, edit or create the .bashrc file: alias run9=/usr/local/GexCon/FLACS_v9.0/bin/run

(21)

2.4 Running FLACS 15

2.3.5

Uninstalling FLACS

Linux: Run the program "/usr/local/GexCon/uninstall-GexCon.sh".

Windows: FLACS can be uninstalled using Control Panel/Add or Remove Programs.

2.4

Running FLACS

A typical simulation session with the CFD code FLACS involves several steps. Assuming FLACS is properly installed on the computer, including valid lisence files for the software, users can initiate a FLACS session by clicking the FLACS icon on the desctop:

Figure 2.4: The FLACS icon

This should open the Run Manager window:

Figure 2.5: The FLACS Runmanager

Some of the main tasks of the Run Manager are: • Starting the Licence Manager

• Starting the preprocessor CASD • Running CFD simulations

(22)

• Starting the postprocessors Flowvis

The preprocessor should start when clicking the CASD icon in the Run Manager:

Figure 2.6: The CASD icon

The CASD window looks like this:

Figure 2.7: FLACS preprocessor CASD

Work in CASD often involves opening the Database window from the Geometry menu: Geometry→Database

(23)

2.4 Running FLACS 17

Figure 2.8: Geometry database window

Typical tasks performed from the Database window include:

• Creating a new database and new geometries

• Opening existing databases and geometries

• Creating new materials (i.e. colours), or modifying existing materials

• Creating new objects, or modifying existing objects

The New Object button, available in the Objects tab in the Database window, opens the Object window:

(24)

Figure 2.9: CASD object window

The main purpose of the Object window is to construct a new object, or to modify an existing object. Users can build complex objects by adding or subtracting several insides (i.e. boxes or cylinders). Any geometry can consist of one or several objects, or assemblies of several objects. An alternative way of working with geometries involves geometry import using thegeo2flacs utility. However, this requires that a representation of the geometry already exists on a compat-ible CAD format (typically Microstation or PDMS).

Apart from geometry building, the menus in CASD also perform the following tasks: • Definition of the computational domain and the computational grid

• Porosity calculations with the utility program Porcalc, as well as porosity verification • Scenario setup, including:

Definition of monitor point locations, and selection of output variables

Specification of boundary conditions

Specification of vent panels and leaks

Specification of fuel type

Specification of ignition position and time of ignition

After defining the scenario, the next step is to run the actual FLACS simulations: • Simulations can be started and monitored with the run manager

• The same operations can be controlled from the command line in Linux > run9 flacs 010100

(25)

2.5 Help and support 19

The final step in a FLACS session is typically the presentation and verification of simulation re-sults with the postprocessor Flowvis, as well as data extraction and reporting. The postprocessor should start when clicking the Flowvis icon in the Run Manager:

Figure 2.10: The Flowvis icon

The Flowvis window looks like this:

Figure 2.11: FLACS postprocessor Flowvis

Some of the most frequently used features in Flowvis include: • Verifying porosities in a geometry

• Creating scalar-time plots, 2D-plots, 3D-plots, ... • Creating animations

Data reporting may also include the extraction of numerical simulation results with the utility programs r1-file and r3-file. These programs run only from command line input in the current version of FLACS.

2.5

Help and support

(26)

Email: [email protected]

Phone: +47 55574330

Commercial customers are entitled to support and maintenance:

Support: Up to 70 hours of email or phone support per year

Maintenance: New releases of FLACS as they are made available

In addition to the above the user has access to the FLACS User Group web site, which contains information about FLACS, including a FAQ (Frequently Asked Questions) and a self support portal where the user can search for answers (as of November 2008 GexCon is working on im-plementing the self support portal, but a release date is not yet decided)

The support and maintenance requires the user to have a payed and valid support and mainte-nance contract.

2.6

Introductory example

This chapter contains an introductory example. It gives a first impression of how to set up and run a simple FLACS explosion simulation. For additional examples see sections Best practice examplesandFlowvis examples.

2.6.1

Things to keep in mind before you begin

FLACS is a CFD (Computational Fluid Dynamics) Explosion Simulator tool. The input to a CFD calculation is:

• A geometry, either created manually for the specific purpose, or imported from a CAD system

• A grid which divides the simulation domain into cells. In one cell a variable (eg. pressure) does not vary in space. FLACS use a regular, Cartesian grid, which means box grid cells. • Various scenario parameter, such as boundary conditions, monitoring point locations, gas

cloud size, position and composition, and ignition location.

All of the above is normally handled in the FLACS pre-processor CASD. The geometry is saved to a file structure, called a file database. The file database file structure starts in a top level directory given a name with suffix ".db". The file database should not contain user files, or files other than those created by the file database interface in CASD.

In addition to the file database a number of other files are created before and during the simula-tion. All files contains the job number, a 6 digit number. The following files are created as input to the simulation (010101 is the job number).

cg010101.dat3 The grid file

cs010101.dat3 The scenario file

co010101.dat3 The geometry file. This file contains a snapshot of the geometry contained in the file database.

cp010101.dat3 The porosity file, which is created by Porcalc. Please see section andPorcalcfor details.

(27)

2.6 Introductory example 21

During the simulation a set of result files will be created:

r1010101.dat3 Scalar-time output from monitor points

r3010101.dat3 Field output at selected times. Needed to create 2D and 3D plots

rt010101.dat3 Simulation log file

FLACS can also create and use other files. Please see sectionFiles in FLACSfor details.

Due to the number of files created by each simulation it is important to create a good file struc-ture of directories to keep track of the files. See sectionFiles in FLACSfor details and further recommendations.

2.6.2

Initialising the work directory

As FLACS creates a relatively large number of files it is important to have a good system for book keeping. It is recommended to start out with an empty directory.

2.6.2.1 On Linux

Make a distinct directory (DIRECTORY_NAME) in which you perform the exercise: > mkdir DIRECTORY_NAME

Move into this directory: > cd DIRECTORY_NAME

Copy geometry files (notice the space before the ".").

> cp /usr/local/GexCon/FLACS_v9.0/doc/examples/ex2/*00001* .

Start up the FLACS runmanager: > run9 runmanager

2.6.2.2 On Windows

1. Make a distinct directory in which you perform the exercise: Open the file browser ("My Documents") and choose File→New→Folder.

2. Copy files from C:\Program Files\GexCon\FLACS_v9.0\doc\examples\ex2\∗00001∗

(∗00001∗means all files containing the text "00001").

3. Start the FLACS runmanager by clicking the desktop icon, or go to Start Menu→All Programs→GexCon→FLACS_v9.0→FLACS Runmanager.

2.6.3

Initialising and starting the preprocessor CASD

(28)

2.6.3.1 Open and view the geometry in CASD (Move cursor to the CASD window)

1. choose OPEN in the FILE menu OR∗file open<CR>OR ALT-f o (<CR>means carrige return, ie. the enter key)

• CASD Ask for opening an existing job file 2. choose 100001.caj<OK>

• CASD: Open jobfile 100001, using MOUSE+LEFT 3. if any error message appears click<OK>

• CASD: Ignore error message =>error message

• CASD: Play with visualisation options, fly through geometry etc.

Figure 2.12: The geometry used in example 1

2.6.3.2 Make a grid for the simulation

Make a grid (mesh) for the simulation, calculate porosities (module dim.: 25.6m x 8m x 8m, origin in corner below the control room).

1. Choose SIMULATION_VOLUME from GRID menu

• CASD: To enter the extension of the simulation domain

2. Enter -16<TAB>-8<TAB>0<TAB>40<TAB>16<TAB>16<OK>

(29)

2.6 Introductory example 23

3. In GRID menu, choose DIRECTION X

4. In GRID menu, choose REGION and enter 56<OK>

• CASD: 56 grid cells chosen (1.0m grid size). 5. Repeat steps for Y direction and use REGION 24

• CASD: 24 cells in Y-direction

6. Repeat steps for Z direction and use REGION 16 • CASD: 16 cells in Z-direction

7. In GRID menu, click INFORMATION, and<OK>to close window • CASD: Check that grid dimension is 1.0m as intended

8. Choose SAVE from the FILE menu • CASD: Save geometry and grid files 9. Choose CALCULATE from POROSITIES menu

• CASD: Map geometry information onto the grid, porcalc 10. Choose DISPLAY OFF in the GRID menus

• CASD: Don’t draw the grid anymore

(30)

Figure 2.14: Porsity calculations using Porcalc

2.6.3.3 Define explosion scenario

1. Choose MONITOR_POINTS in SCENARIO menu OR∗scen mon<CR>

• CASD: Define where to measure variables

2. Click<ADD>,<EDIT>and 0.8<TAB>4.7<TAB>7.9<OK>

• CASD: Add and define location of monitor point 1 3. Repeat this for point 2 (12.3, 4, 0.1) and point 3 (24, 7.9, 7.9)

• CASD: To edit a non-highlighted monitor, click on its number 4. Click<OK>

• CASD: Close MONITOR_POINT window

5. Choose SINGLE_FIELD_SCALAR from SCENARIO menu • CASD: Define which variables to report at monitors

6. Click on<P>, drag mouse pushing MOUSE+LEFT across all monitors,<OK>

• CASD: Log pressure at all three transducers 7. Repeat for<PIMP>and<DRAG>

• CASD: Log pressure impulse and dynamic pressure, too

8. Click<OK>and choose SINGLE_FIELD_3D from SCENARIO menu • CASD: Define variables for contour plots

9. Click on<P>, CTRL-<PROD>, CTRL-<VVEC>,<OK>

• CASD: Pressure, flame and velocity vectors. CTRL needed to select more than one (NB! deselect when using the scroll bar)

10. Choose SIMULATION in SCENARIO menu OR∗scen sim<CR>

• CASD: Choose output and simulation parameters 11. Click on<NPLOT>, enter 50<OK>,<OK>

• CASD: Increase number of contour plots, return to main menu 12. Click on GAS_COMP... in SCENARIO menu OR∗scen gas_c<CR>

• CASD: Define gas cloud loc., size, comp. and concentration 13. Click on<POS...>, 0<TAB>0<TAB>0<OK>

(31)

2.6 Introductory example 25

14. Click on<DIM...>, 25.6<TAB>8<TAB>8<OK>

• CASD: Dimension of gas cloud equals module dimensions

15. Click on<VOL...>,<METHANE>91.7<OK> <ETHANE>7<OK> <PROPANE>1.3

<OK> <OK>

• CASD: Gas composition is defined

16. Click on<EQUI...>1.05<TAB>0<OK> <OK>

• CASD: Slightly rich gas mixture is chosen ER=1.05

17. Click on IGNITION in SCENARIO menu<POS...>12.5<TAB>4.1<TAB>4.25<OK> <OK>OR∗scen ign pos 12.5 4.1 4.25 OK<CR>

• CASD: Define location of ignition (12.5, 4.1, 4.25) 18. Choose SAVE from the FILE menu

• CASD: Save all files, ready to run flacs 19. Minimize CASD

• CASD: Leave CASD for now, can be activated easily

(32)

Figure 2.16: Choosing variables for 3D output

(33)

2.6 Introductory example 27

2.6.4

Start FLACS simulation

Select the job in Run Manager and click simulate (if job not visible, use add directory or if di-rectory is already added, right click and rescan), check how the simulation starts up (click log file)

Figure 2.18: Running a simulation in the FLACS Runmanager

2.6.5

Study results in post prosessor Flowvis

Use Run Manager→Tools→Flowvis (or click the FLACS post-processor icon) 1. choose ADD from Page menu (or CTRL+a)

• FLOWVIS: Prepare first page

2. click MOUSE+RIGHT, choose PLOT_TYPE and SCALAR_TIME plot • FLOWVIS: Plotting of time histories of variables

3. choose 100001 and P with MOUSE+LEFT, select all 3 monitors (drag mouse)<OK>

• FLOWVIS: Plot pressure time history at all monitors 4. <RESCAN>

• FLOWVIS: if simulation is running rescan will update plot

5. Choose MODIFY in the Page menu (or CTRL+m), enter<TAB>1<TAB>2<OK>

• FLOWVIS: divide page into 2 plots

6. Click at lower frame, then MOUSE+RIGHT, PLOT_TYPE, ANNOTATION_ST (or CTRL+0) • FLOWVIS: show numerical values from pressure plots

(34)

7. ADD page and do the same for the DRAG and PIMP variables

8. Choose ADD in Page menu (or CTRL+a), click MOUSE+RIGHT, PLOT_TYPE, 2D... (or CTRL+2)

• FLOWVIS: prepare 2D contour plot 9. Choose 100001, P, click<OK>

• FLOWVIS: contour plot of pressure

10. click MOUSE+RIGHT, choose PLOT_DOMAIN, change k-index to 5<OK>

• FLOWVIS: choose XY-cut plane through ignition

11. Click MOUSE+RIGHT, choose VARIABLE_APPEARANCE change Value Range Setting to Fixed

• FLOWVIS: choose a user-defined fixed scale for all time steps 12. Choose Min. Value as 0.05 and Max. Value as 2.0

• FLOWVIS: define the scale

(35)

2.6 Introductory example 29

Figure 2.20: 2D cutplane plot showing over-pressures

Figure 2.21: Setting plot domain for a volume plot

Time steps can now be changed moving the bottom scroll bar to the right, page can be varied using the right scroll bar.

(36)

• FLOWVIS: visualize flame and velocity vectors

Try to show PRESSURE and PROD on the same page using PAGE MODIFY (use a fixed scale for PROD from 0.15 to 0.2 and change Min. Color Index to 9 and Max to 10) Now that you are familiar with Flowvis, try the volume plot menu to study the development of flame (PROD) and pressure Use PLOT DOMAIN to narrow the view window and see below the ceiling

2.6.6

Study the effect of ignition location

Enter CASD, open the 100001.caj job-file, save this as a new job number e.g. 100002.caj Change ignition location in order to study how pressures may vary with different ignition locations End ignition (0.5, 4.1, 4.25), (job number 100002) Your own assumed worst-case location (job number 100003)

Report highest pressure achieved on monitor point

(37)

Chapter 3

(38)

The preprocessor CASD for the CFD simulator FLACS is used to prepare the input data, or job data , that defines a FLACS simulation: geometry model, computational grid, porosites, and scenario description. CASD is an acronym for Computer Aided Scenario Design.

CASD 4 released in 1994, use X11 graphics, but a new version is available based on QT

CASD 5 released in 2001, use Open Inventor graphics

CASD 6 released in 2008, use QT and Coin 3D graphics

This manual describes CASD 6, but the general functionality of CASD 6 is in principle the same for CASD 4 and CASD 5. CASD 6 is fully backward compatible with CASD 4 and CASD 5.

3.1

Overview

This section provides a general overview of the functionality in CASD.

3.1.1

Starting CASD

Users start CASD by clicking the CASD icon in the run manager window:

Figure 3.1: The CASD desktop icon

or alternatively by executing the command: > run9 casd6

on the command line in Linux.

3.1.2

CASD command line options

The following options can be given when starting CASD on the command line:

Option Description

-macro macro file name Read input from specified macro file -numMat maximum number of materials Default is 50

-numObj maximum number of objects Default is 10000 -numAsis maxmimum number of

assemblies/instances

Default is 3500 -stackAsis maxmimu number of nested assembly

levels

Default is 8

-noLock Turns of locking on the database files. Must not be used if more than one user accesses the database simultaneously. This option speeds up the database operations significantly.

(39)

3.1 Overview 33

-display and others Linux: options accepted by X Table 3.1: CASD command line options

Example: Linux:

run9 casd -numObj 20000 -numAsis 20000 -noLock

Windows:

casd -numObj 20000 -numAsis 20000 -noLock

Alternatively the options can be set permanently in the FLACS Runmanager, Options→Preferences. This will only apply if CASD is started from the Runmanager.

3.1.3

The main window in CASD

Starting CASD 6 opens the main window.

Figure 3.2: The main window in CASD

The main window is divided into the following parts: • The menu bar

(40)

• The icon bar

• The command input field • The geometry window(s) • The status field

These parts are described in the following subsections.

3.1.4

The menu bar

The menu bar contains the following menus: • File • Geometry • Grid • Porosities • Scenario • Block • View • Options • Macro • Help

The options on the various menus are described in separate sections in this chapter.

3.1.5

The icon bar

The icon bar contains the following toolbars:

• Main toolbar, provides shortcuts to several of the commands on the meny bar:

New, Open, Save, Save as, Import, and Result on the File menu.

Database icon on the Geometry menu.

Calculate and Verify porosities on the Porosity menu.

• Graphics toolbar, controls various features of the geometry window(s).

View splitting.

Rectangle zoom.

Spinning (toggle on/off).

Highlighting option, from filled only (0) to various degrees of contour highlighting (1-5).

• Drawing toolbar, opens the plan drawing dialog box:

Specifying file names for texture (e.g. drawings).

(41)

3.1 Overview 35

3.1.6

The command input field

The command input field represents an alternative interface between the user and CASD, in addition to the regular menus on the menu bar. The control input field contains a scrollable command history list, and a current command context indicator (left side). The user controls the command history list from the keyboard:

• UP: retrieves the previous line from the command history list • DOWN: retrieves the next line from the command history list • RETURN: processes the content of the command input field

Hence, the user can choose whether to use a menu options on the menu bar, e.g: File→Exit→Yes (to exit and save) or to execute, after typing or retrieving, the following command in the com-mand input field:

∗ file exit yes yesCommand line input will in many situations be the most efficient way to work with CASD, and other sections in this chapter present additional examples on how to use this feature.

Examples: Using the command input field in CASD

• Select a box primitive in an object. The following command moves the box to (2, 2, 2), and would cause the properties dialog to be shown

∗ edit properties 2 2

This is because the position is not completely specified. The user does not have to specify all parameters, but must include all values for the parameter specified. • If the user wants to edit one of the last parameters in the dialog, it is not necessary to specify

all the parameters in front. The parameter name can be used to indicate which parameter to edit

∗ edit properties size 2 2 2 vol_por 0.5

• The user can also supply the answer to a question in the input field. To delete an assem-bly/instance, CASD will ask to confirm the operation. To avoid the question dialog, type the following command

∗ geometry delete yes

or shorter:∗ ge de y

• To direct the output from a list to a file, append the file name after the list command. For instance, to list geometries in the database, enter the following command, which will create the text file outfile.txt

∗ geometry list outfile.txt

3.1.7

The graphical area

The graphical area in the main window displays the geometry and the computational grid. In addition to the options on the View menu, there are several ways of manipulating the view:

• Rotation: MOUSE+LEFT • Panning: CTRL+MOUSE+LEFT • Zoom: MOUSE+SCROLL

(42)

• Splitting and closing views: MOUSE+RIGHT+SELECT

The use of these features are quite intuitive, and they will not be described in more detail in this manual.

3.1.8

The message area

The message area in the main window contains information concerning the active database, project, geometry, grid, and units.

3.1.9

Files in CASD

CASD stores job data on a set of files. For the arbitrary job number 010100, the most important files are:

• Header file, 010100.caj: ASCII file created by CASD; defines the co, cg, and cm files used by CASD.

• Geometry file, co010100.dat3: binary file created by CASD; contains a list of primitives from a CASD database that define the geometry; used by Porcalc and Flowvis.

• Grid file, cg010100.dat3: binary file created by CASD; defines the computational mesh; used by CASD, Flacs, and Flowvis.

• Porosity file, cp010100.dat3: binary file created by Porcalc (typically from the Grid menu in CASD); defines the porosities for each grid cell; used by Flacs and Flowvis.

• Polygon file, cm010100.dat3: binary file created by CASD; defines the polygon model; used by Flowvis (if the file exists).

• Scenario file, cs010100.dat3: ASCII file created by CASD; defines the general scenario (mon-itor points, output variables, fuel region, pressure relief panels, ignition position, etc.); used by CASD, Flacs, and Flowvis.

The grid-file is also called the obstruction file, or co-file, and is not a direct input to the simulation; it is however used by Porcalc when generating the porosity file. The File menu in the main window contains commands for creating, opening, and saving the various job files. See sectionFiles in FLACSfor further information.

3.1.10

Working with geometries in CASD

To implement the geometry model in CASD can often be the most time consuming part of a project. For modern process facilities it may be possible to import a geometry from an existing CAD model, but for many installations the geometry must be constructed manually from draw-ings, photographs, etc.

A large projects, such as a full probabililistic analysis, can involve hundreds of CFD simulations, and each simulation will typically produce 10-15 different files. Hence, it is very important to organize the files in a well-structured manner.

The building blocks in a CASD geometry are instances of objects. The structure within an object is a so-called Constructive Solid Geometry (CSG) model, where simple solid primitives (boxes and cylinders) are combined by Boolean operators (unions and left differences).

Objects in CASD can be eitherglobalorlocal. Several geometries can contain instances of the same global object, whereas a local object can only be included in the geometry where it was created. It is generally recommended to use global objects, and avoid the use of local objects.

(43)

3.1 Overview 37

The list of information required to implement a typical process facility, such as an offshore oil platform or an onshore process plant, is quite extensive:

• Plot plan

• Sectional drawings • Piping plan • HVAC layout • Cable trays layout • Framing plans • Cladding • Deck plan

Most FLACS users find it convenient to define standardized axis directions, and the following convention is used by GexCon for typical process facilities:

• East-West along the x-axis, with positive x towards the east. • North-South along the y-axis, with positive y towards the north. • Up-Down along the z-axis, with positive z pointing upwards.

This results in a conventional right handed coordinate system, where the lower south-western corner of the facility coincides with the origin (0,0,0).

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. Many FLACS users find it convenient to assign certain hues to various structural elements, and the following convention is used by GexCon for typical process facilities.

Hue Colour Description

0 Red solid walls and decks

30 Orange pressure relief and and

louvred panels

60 Yellow grated decks

120 Green anticipated congestion

180 Cyan equipment

200 Light blue structure

220 Medium Blue secondary structure

250 Dark Blue piping

300 Pink equipment

Table 3.2: Colour convention used by GexCon

A standardized colour scheme makes it more straightforward to review geometries from old projects.

3.1.11

About congestion, confinement, and vents

In order to have a good representation of the effect of obstacles it is important that they are well represented geometrically by the chosen grid. In most practical situations it will not be possible to represent the smaller obstacles on the grid, these should still be included since they may be treated by proper sub-grid models. Larger obstacles like the floor (or the ground), the ceiling, the walls and larger equipment will be resolved on-grid. This means that they will be adjusted to match the grid lines.

(44)

The most challenging geometry to represent properly is repeated obstacles of the same size and spacing as the chosen grid resolution, in such cases the user should consider to change the grid to achieve a better representation. If this type of geometry is dominant it is of vital importance for the accuracy of the result that the representation is good enough. In cases where such a geometry is not dominant one may pay less attention to how it is represented. For normal offshore modules there will be a range of subgrid sized obstacles which are more or less randomly distributed in space.

In many experimental setups one will find repeated obstacles of the same size. The basic research on gas explosions past many years now has focused on the effect of obstacle arrays, perhaps to a greater extent than on the effect of more realistic geometries. Both categories are important in order to be able to validate tools like FLACS.

It is important to represent the vent openings of a semi-confined geometry properly. If obstacles close to the outer boundaries are adjusted to match the grid, the effective vent area may be af-fected. In order to verify that the representation of the vent openings is as good as possible the user should check the porosity fields (using CASD or Flowvis).

3.2

File menu

3.2.1

New

Shortcut CTRL+N

Starts a new simulation job.

The New command in the File menu creates a new empty job. If there were unsaved changes to the current job, a dialog box is displayed, asking about saving the changes.

3.2.2

Open

Shortcut: CTRL+O

This command opens an existing set of simulation files. The default selection is defined in a∗.caj file.

The Open command in the File menu opens an existing job.

If you enter the file name in the command input field, the path must be encapsulated in apostro-phes, for instance:

∗ open "../../Test/000000.caj"

If you select the command from the menu bar, or if no name is specified in the command input field, the Open dialog box is displayed, allowing you to specify a path and file name to open. By default, the file filter is initiated for selecting CASD job header files (type ∗.caj). But you may also select a geometry file (type co∗.dat3). CASD will then open all files with the same job number.

If a geometry is open (in the database), the filter string will be constructed from the project and geometry numbers. It is not possible to open a job that is not compatible with the open project and geometry numbers.

If there were unsaved changes to the current job, a dialog box is displayed, asking about saving the changes.

(45)

3.3 Geometry menu 39

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

(46)

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.

(47)

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.

(48)

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.

(49)

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.

(50)

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.

(51)

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.

References

Related documents