• No results found

Introductory example

In document Flacs v9 Manual (Page 26-44)

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.

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

Use Run Manager→Tools→CASD (or click the FLACS pre-processor icon)

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>

• CASD: Volume is defined (16m out from vent, 8m to the sides; observe - sign)

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

Figure 2.13: Embedding the grid

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>

• CASD: Position of bounding box describing gas cloud

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

Figure 2.15: Adding monitoring points

Figure 2.16: Choosing variables for 3D output

Figure 2.17: Adding a gas cloud and choosing the gas composition

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

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

Figure 2.19: Showing pressure-time curves with annotation in Flowvis

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.

1. Repeat this method for PROD and VVEC variables (these can be plotted on the same plot)

• 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

Make animation of either 2D or volume plots using the export menu (with all timesteps)

Chapter 3

CASD

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.

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

• 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).

File formats: PNG, JPEG, GIF, TIFF

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

• Rectangle zoom: MOUSE+RIGHT+SELECT

• 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.

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

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

Table 3.2: Colour convention used by GexCon

Table 3.2: Colour convention used by GexCon

In document Flacs v9 Manual (Page 26-44)