Professional Documents
Culture Documents
THREE
TUTORIAL
3.1 Tutorial Overview
This chapter is intended to familiarize new users with major components of the FLOW-3D Graphical User Interface (GUI) and to walk through the setup and running of various simulations. A brief section on the Philosophy for Using CFD is followed by an introduction to the Simulation Filenames and ways to run simulation les. After those introductions follows a discussion of how to preprocess and postprocess simulations. The problems in this chapter are intended to cover the basics of using FLOW-3D. New users are advised to work through all of the problems and the variations. The tutorial problems were chosen to illustrate a variety of topics and address a number of questions that might be encountered. This tutorial should be used while you are sitting at your computer running FLOW-3D.
Chapter 3. Tutorial
wave speed propagation, boundary layer growth, etc.) can give the user condence that the model is set up correctly and that the program is running accurately.
38
Chapter 3. Tutorial
At the very top of the GUI is a Menu Bar which includes the following menu headings: File, Diagnostics, Preference, Physics, Utilities, Simulate, Materials and Help. Below the menu bar is a row of tabs: Simulation Manager, Model Setup, Analyze, and Display. Each of these tabs corresponds to specic steps in a FLOW-3D simulation. When FLOW-3D is opened, the Simulation Manager tab is presented. This is where the user can create, save, copy, delete, and queue simulations to run. This tab also displays useful information on simulations that are running or have been previously run. Simulations are grouped into Workspaces, which are like folders and may represent individual projects or users of the program. For example, simulations related to the same design project can be organized into one workspace for ease of their setup. All simulations in a workspace can be run sequentially at a click of the mouse.
Chapter 3. Tutorial
1. On the Simulation Manager tab, create a new workspace by selecting File New Workspace. 2. Enter a name for your workspace. Type in Hydraulics Examples. It is recommended that the Create subdirectory using workspace name checkbox be selected so that all the les associated with this project are in their own directory. Click OK to create the workspace.
Add the Flow Over a Weir Example Simulation 1. Your FLOW-3D installation includes several dozen pre-built simulations, called Examples. Add one to this workspace by selecting File Add Example from the menu bar. The dialog below will appear. Select Flow Over a Weir from the list. Select the Open button to import the project and click OK to accept the default creation options.
More Ways to Manage Simulations in Workspaces New or existing simulations can be added to a highlighted workspace containing other simulation using the File menu. To start a simulation from scratch, go to File Add New Simulation. To work with an existing simulation (an alreadycreated prepin le and associated geometry les), select Add Existing Simulation instead. A simulation can be removed from the workspace by selecting the simulation and pressing the Delete key or selecting Remove Simulation from the File menu at the top or the pop-up menu that appears by right-clicking a simulation.
40
Chapter 3. Tutorial
Note: Although it is possible to locate and open les located on other machines on the network, the user will not be able to run them with FLOW-3D on their own machine. To run a simulation that has been set up on another machine, the user must rst copy the input le and any associated geometry les to the local hard disk.
1. Left-button Rotate: Click and hold the left-mouse button and move the mouse in the Meshing & Geometry window. The model will rotate accordingly. 2. Middle-button Zoom: Click and hold the middle-mouse button while moving the mouse vertically in the window. Moving the mouse toward the top of the screen zooms in and moving the mouse downward zooms out. 3. Right-button Move: Click and hold the right-mouse button and move the mouse in the window. The model will move with the mouse.
Display Functions
Global Transparency 1. The Transparency slider in the toolbar controls the transparency of ALL objects in the Meshing & Geometry display window. Move the slider from left to right and you will observe that the weir structure becomes more transparent as you continue to move the slider to the right. Later you will learn how to select transparency for individual objects in the display.
41
Chapter 3. Tutorial
View Model Along Axes 1. Due to the complexity of three dimensional simulations, it is often necessary to view objects in 2-D. This can be accomplished by selecting one of the axes from the toolbar: Select the +X icon to position the view so that the geometry is viewed along the X-axis, looking toward the negative X pole. The icon now changes to -X.
2. Click the same icon (now -X) to change the view to the opposite pole, looking along the X-axis in the positive direction. Mesh Viewing Options 1. Click the Mesh menu item at the top of the display (above the simple geometric shapes toolbar). 2. Make sure the Show option is checked so the mesh is displayed.
3. To display only the outline of the mesh (domain extents), select Mesh View Mode Outline. This view is shown at lower right. 4. To display all user-specied gridlines (but not automatically generated gridlines), select Mesh View mode Mesh Planes. 5. Finally, display all the gridlines in the mesh by selecting Mesh View Mode Grid Lines.
Assessing Mesh Resolution One of the most important aspects of simulation setup is choosing an appropriate computational mesh. If the mesh is too coarse, portions of the geometry may not be resolved and the simulation will not represent the actual problem. If the mesh is too ne, the runtime may be unnecessarily long. The goal of mesh setup is to use just enough cells to resolve the geometry and the ow features of interest. There are two ways of judging how well a computational mesh resolves the geometry. One way is to run the preprocessor but this can be time-consuming. A quicker way is to FAVORize the geometry. FAVORize embeds the geometry in the current computational mesh and displays the result in the Display window. The resulting geometry is called the FAVORized geometry.
42
Chapter 3. Tutorial
) in the Meshing & Geometry window toolbar. The FAVOR dialog will appear.
2. To display the solid geometry, select the Solid radio button. 3. Click Render to display the solid geometry as in the image below.
The image above on the right shows the weir structure. The sharp crest of the weir is visible and it appears to be adequately resolved. In later exercises you will use the FAVORize function to evaluate mesh resolution. 4. Select Return to Model Building. Additional methods of checking the mesh resolution should also be used. In particular, the tri-directional aspect ratio of individual cells and the uni-directional aspect ratio between neighboring cells should be examined, especially when multiple mesh blocks are used. These checks are described in the application-specic tutorials.
43
Chapter 3. Tutorial
2. If you are prompted to Save, select Yes. 3. Switch to the Simulation Manager tab. The Flow Over A Weir simulation has been added to the Simulation Queues pane. It will have a clock-like icon: . Scroll over the icon to display a note indicating that it is running and connected. Once the solver begins to preprocess the simulation, a status bar will ll above the dashboard and the clock icon will also ll. It should complete (100%) within a few seconds. The next step is to display the preprocessor results.
Although the full capabilities of the Analyze panel are available, typically only 2-D and 3-D plots are necessary to validate the model setup. First, you will generate the same display that was generated by the FAVORize function. 5. Select the Analyze 3-D sub-tab.
44
Chapter 3. Tutorial
6. On the 3-D tab, select Complement of Volume Fraction in the Iso-surface dropdown and select None from the Color Variable dropdown.
7. Select Render. You will see the same image in the Display window as you saw in the FAVORize display. A 3-D display of Complement of Volume Fraction shows the same image as you saw when you FAVORized.
The next step will be to generate 2-D plots with the mesh overlayed. The object will be to generate a 2-D display of pressure in the X-Z plane at Y = 0. 8. Select the Analyze 2-D sub-tab. 9. Choose the X-Z radio button. 10. Move both Y-direction limits sliders to the left-most position (J = 2, Y = 0.25). 11. Select the Mesh checkbox to overlay the mesh on the results.
12. Click Render to generate the graphics. You will see the image shown below.
45
Chapter 3. Tutorial
This is the uid and solid conguration at the rst simulation time step, looking at the cell centers of the X-Z plane at Cartesian Y = 0 (this location is the the minimum Y-extent of the domain, which is the centerline of the weir). The sharp crest of the weir can be seen indicating the mesh resolution is probably adequate for resolving the geometry features of interest. The initial uid conguration is also shown. The initial velocity is shown, with the maximum vector value in the upper right. The units of the vector are length/time in whatever consistent units the simulation is set up in. Pressure is shown in this plot, also in units of mass/length/time2 . In the next section, you will check which unit system is being used. This plot, and others like it, allow the user to determine the correctness of the setup before running the simulation. If other ow quantities such as density or scalar concentration were initialized, they could be checked here as well by selecting them in the Contour Variable dropdown list.
46
Chapter 3. Tutorial
2. Note that CGS is selected in the dropdown box. This means that the geometry and uid unit of length is the cm, the unit of mass is the gram, and the unit of time is the second. Any unit system is acceptable, but the imported geometry must have matching units of length, and the length/mass/time units must be the same for all geometric and uid properties (such as density, dynamic viscosity, etc.) Temperature is not selected because there is no thermal calculation in this model. Any temperature units may be used, as long as they are also uniformly applied to all model parameters.
Request Hydraulic Data 1. Select the Model Setup Output tab. 2. In the Additional Output section, select the checkbox for Hydraulic Data as shown below. This will cause the uid elevation, uid depth, Froude number, and depth-averaged velocity to be computed and stored in the results le. Additional Output data will not be computed unless it is selected on the Output tab before running the simulation because it is secondary data (derived from other primary quantities).
Specify Selected Data Output Selected data is data chosen by the user to be output more frequently than Restart data. Selected data is output at default intervals of 1/100th of the simulation time and includes only variables of interest whereas Restart data is output at default intervals of 1/10th of the simulation time and includes all variables necessary to solve the uid ow equations. Selected data is useful for creating smooth animations without making excessively large output les. 1. On the Output tab, select the following data: Fluid Fraction, Fluid Velocities, Hydraulic data, and Pressure as shown below.
47
Chapter 3. Tutorial
Selected data output should be chosen with care since only the specied variables will be written more frequently to the results le during the simulation. If you determine later that you need a variable which was not specied in the Selected Data list, the simulation will need to be re-run with this output specied.
1. Start the simulation by selecting Simulate Run Simulation from top menu bar. 2. The simulation must be saved before running, so select Yes when prompted to save. 3. Switch to the Simulation Manager tab. The right side of the Simulation Manager tab can be thought of as a dashboard for the simulation. The efciency and accuracy of the simulation are indicated by the runtime diagnostics plots and the runtime messages. This space also allows the user to interact with the solver while it runs. The Terminate icon: or Simulate Terminate Simulation... from the top menu will shut down the preprocessor or solver. When the solver is terminated, it will write a nal data plot to the output le before shutting down. 4. Select Preference Show Simulation Text in Navigator from the top menu. The status of a FLOW-3D simulation, as well as any warning or error messages generated, will appear in the Runtime Messages window below the plot.
48
Chapter 3. Tutorial
5. Familiarize yourself with the various runtime diagnostic plots available in the drop-down list above the plot. Each selection shows a different graph. Stability limit & dt: Provides a comparison of the time step stability limit (largest time step allowable) and dt, the actual time step being used. Ideally the time step dt is the same as the stability limit but it may be smaller due to various factors such as excessive pressure iteration or splashing. Time-step size: The solver time step. Epsi & max residual: Epsi represents the pressure iteration convergence criteria. The max residual represents the actual value of the criteria after the pressure iteration has either converged or the iteration count has reached the maximum allowable value. If a pressure iteration failure occurs, the max residual plot will be above the Epsi plot. Pressure iteration count: The number of pressure iterations. Low values indicate good pressure convergence. Different pressure solvers have different values that may be considered high. Fill fraction: The total volume of uid divided by the total open (non-solid) volume in the domain. A near-constant value is one indication that the ow is nearly steady. Conv. volume error (% lost): Represents the amount of uid gained (negative value) or lost (positive value) due to advection errors. Typically much less than 1%, values larger than 1%-3% may indicate problems with the simulation, particularly with mesh aspect ratio, excessive uid break-up, or rapid solid (moving object) motion. Volume of uid 1: The uid volume within the domain over time. Indicates if the domain is lling or draining, and can be used to estimate if a simulation has reached steady state. Fluid 1 surface area: The free-surface area of Fluid #1 is the domain. Scattered values indicate sloshing, waves, droplets, or lling/draining. 3.5. Tutorial - Running an Example Problem 49
Chapter 3. Tutorial
Mass-avg mean kinetic energy: Provides a measure of the average mean kinetic energy of ow. This is a good indicator of the steadiness of the ow. Particle count: The number of Lagrangian particles in the domain, if present. In this example, particles are used to visualize ow paths, and are not re-generated at the inlet, so the total number of particles decreases over time.
4. A list of available plots appears at the right. A particular plot may be viewed by clicking on the name of that plot in the list. Select plot 26.
50
Chapter 3. Tutorial
Viewing Custom Plots 1. Click on the Analyze tab. A message appears indicating that the prpgrf le no longer exists. The prpgrf le, which was generated during the Preprocess phase, is deleted when the simulation is run. Select Continue and the FLOW-3D Results dialog will be presented. If no message appears (the Analyze tab opens), select Load Results File to open the same dialog. 2. Select the Custom radio button to see full output les. Full output les include prpgrf.* les and flsgrf.* les. Since the simulation has been run, the preprocessor output le has been deleted and incorporated into the flsgrf le. 3. Select the flsgrf.Flow_Over_A_Weir le in the dialog and click OK.
51
Chapter 3. Tutorial
The Analyze tab will now be displayed. There are many ways to visualize the results of the simulation. The available plot types are: Custom: Can be used to write an output le using the output codes in the Customized Postprocessing section of this manual. Probe: Displays output data for individual computational cells, boundaries, components, and domain-wide (global) parameters. 1-D: Cell data can be viewed along a line of cells in the X, Y, or Z direction. Plot limits can be applied both spatially and in time. 2-D: Cell data can be viewed in X-Y, Y-Z, or X-Z planes. Plot limits can be applied both spatially and in time. Velocity vectors and particles can be added. 3-D: Surface plots of both uid and solid can be generated and colored by cell data. Additional information such as velocity vectors, particles (if present), and streamlines can be added. Plot limits can be applied both spatially and in time. Text Output: Restart, Selected, and Solidication data can be written to text les. Neutral File: Restart and Selected Data can be output for user-specied interpolation points. FSI TSE: Output specic to the nite-element uid/solid interaction and thermal-stress evolution physics package, not used in this example. Data Sources Once a plot type has been selected, the next step is to choose the data source. There are six sources of data in FLOW3D: Restart: All ow variables. Default output frequency = 1/10th of the simulation time. Selected: Only user selected ow variables. Default output frequency = 1/100th of the simulation time. General History: Time-dependent data such as time step and kinetic energy. Default output frequency = 1/100th of the simulation time. Mesh Dependent: Variables (such as ow rate) computed or specied at boundary conditions.
52
Chapter 3. Tutorial
Solidication: Only available if the solidication model is active. FSI TSE: Additional output options for deformable solids. Examples of some of the available plot types will be generated in the next section.
3. Select Color variable = pressure. This selection determines which variable is used to color the iso-surface (in this case, the uid surface will be drawn colored by pressure).
4. Select Component iso-surface overlay = Solid volume. Solid Volume will display the solid components along with the uid. In a previous step, you did this by selecting Complement of volume fraction as the iso-surface, but this option allows simultaneous plotting of both the uid and solid surface.
5. Move the Time frame sliders to the min and max positions (0 to 1.25 seconds).
6. Click the Render button to switch to the Display tab and generate a series of 11 plots between t = 0.0 and 1.25 seconds which show the weir structure along with uid surfaces colored by pressure. There are 11 plots because Restart data was selected. 7. The available plots are listed in the Available Time Frames list. Click Next to step between the time frames, or double-click a time frame to display it. The rst and last time frames should look like the following:
53
Chapter 3. Tutorial
8. Return to the Analyze 3-D tab and choose the Selected data radio button from the Data Source group.
9. Notice that both sliders in the Time Frame selector are at the right now so that only the last time frame will be generated. This is done automatically by the interface when Selected data is chosen since there are many time frames available and it could take a long time to render them. Move the left-hand slider to Time Frame Min = 0 to render all available time frames. 10. Click the Render button. Within a few seconds the view will switch to the Display window and 101 plots will be listed in the Available Time Frames list. Click Next repeatedly to step between the time frames.
54
Chapter 3. Tutorial
2. Click Render. The uid surface should now appear open at the symmetry boundary on the Display tab. 3. Select Tools Symmetry from the toolbar menu above the display. 4. Select the Y direction checkbox in the dialog to mirror the results across the Y = 0 plane.
5. Select Apply and Close. 6. Select the nal time frame. The display shows a full weir structure as shown below.
55
Chapter 3. Tutorial
3. Click Render to re-draw and return to the Display tab. 4. Repeat your selection of Tools Symmetry Y direction Apply to mirror the results across the Y = 0 plane. 5. Select Tools Animation Rubberband Capture as shown below, and select OK after reading the message that appears.
6. Click and hold the left mouse button while dragging to select the portion of the screen to animate. A selection box will appear around the region you selected.
56
Chapter 3. Tutorial
7. Select the Capture button. A dialog will appear to start the animation. 8. The default name for animations is out.avi. A more descriptive name is recommended as shown below. 9. The default frame rate is 10 frames per second. This simulation has a nish time of 1.25 seconds, and 100 plots at regular time intervals, so the real-world rate is 80 frames/second. This might be too fast, so enter 5 instead and press OK.
Each time frame will be rendered to the Display window and bitmap les will be written in the simulation directory. Once this process is complete, the following dialog will appear.
57
Chapter 3. Tutorial
10. Click the OK button to begin the next step of the process. 11. The default compression for animations is uncompressed. This is not recommended for most animations since the le size can be too large to load in a viewer. Select Microsoft Video 1 if using Windows, or Cinepak if using Linux. The selection here depends on what video codecs your computer has available, and what will be available on the machines you use to display the video. 12. Unselect the Data Rate checkbox so that the quality of animations is not limited by the data rate.
13. Click OK to begin the compression process. When the compression is complete, the following dialog will appear.
14. Click OK. The animation process is now complete. 15. The fasted way to nd the .avi le in Windows Explorer is to select the Simulation Manager tab and click on the link labeled Simulation Input File. 16. Play the animation by double clicking on the .avi le.
58
Chapter 3. Tutorial
4. Click Vector Options and enter X = 2 and Z = 2. Vectors will now be plotted every other cell. Select OK to accept the vector options.
5. Click Render to generate a time sequence of 2-D plots of pressure in the Y = 0 plane. Graphics similar to following will appear, where T = 0.0 seconds (left); T = 0.125 seconds (middle); and T = 1.25 seconds (right).
6. Select the Format button in the upper right-hand corner of the Display screen.
7. Experiment with the various options such as changing line colors, vector lengths and arrowhead sizes. Select Apply to see your changes. When you are done, select Reset and OK to return to the default settings and close the dialog. If there is a set of options you prefer for all plots, you may save them by selecting the Save button.
59
Chapter 3. Tutorial
4. Select X-direction because the ow direction in this simulation is primarily parallel to the x-axis. 5. Move the Y-direction slider to 0.25 (J = 2) so that the cells nearest the ow centerline in the Y-direction are displayed. 6. By default the entire X range will be displayed. You may move the X-direction sliders if you wish to limit the extents of the plot. The location of the Z-direction slider will not matter since only one free-surface elevation is recorded for each column of z-cells in a given x,y location. The Time frame sliders should be at 0 and 1.25 seconds.
7. Click Render. A series plots from t = 0.0 to t = 1.25s will be listed in the plot list on the Display tab. There
60
Chapter 3. Tutorial
are a number of modes in which to view these plots. The default mode is the Single mode and is shown in the dropdown box below the Format button.
8. To compare plots of uid surface elevation at various times, select the Overlay mode from the dropdown box. 9. Click to select plots 1, 13, and 101 in the right-hand pane. The plot names also show the times at which they were recorded: (t = 0.0, 0.15s, and 1.25 s). The output appears as shown below.
10. To save this plot to a bitmap or Postscript le, select the Output button. 11. Check the Plots on Screen checkbox to capture the overlay plot (and make only a single output le). 12. Select the Write button to create the image le. 13. The resulting image le will be located in the simulation directory (remember how to nd this from the Simulation Manager tab) and will be named plots_on_screen.bmp.
61
Chapter 3. Tutorial
62
Chapter 3. Tutorial
4. Select Units to open the Plotting Units dialog. 5. Select Show units on plots. 6. Select SI, CGS, slugs/feet/seconds, or pounds/inches/seconds to convert and output the results in the unit system of your choice. Showing and converting units requires that a unit system was selected on the Model Setup > General tab. You checked this in an earlier step; the geometry and uid properties were specied in the centimeters/grams/seconds system.
63
Chapter 3. Tutorial
7. Select OK to close the Plotting Units dialog. 8. Select Render to generate a graphical output of the data. The output shows mass-averaged mean kinetic energy for all of the uid in the domain over time. The plot will appear as shown, with unit labels based on your selection in the previous step. The plot indicates that the total kinetic energy is oscillating around some mean value. As the oscillations become smaller, the simulation approaches steady-state ow.
64
Chapter 3. Tutorial
9. Return to the Analyze Probe tab. 10. Output the graph as text data by selecting Text in the Output Form group and then re-select Render.
11. The output can be saved to a text le by selecting the Save As button in the text dialog that appears. 12. Select Continue to close the output window.
65
Chapter 3. Tutorial
4. Click OK to create a new folder on the computer and in the Portfolio. The simulation copy has now been imported into the workspace Hydraulics Examples.
66
Chapter 3. Tutorial
3. Select Add to component = New Component (2) as shown below. 4. Enter the dimensions of the cylinder: Radius = 2.0, Z low=-20.0 and Z high = 20.0, as shown in the gure below. The name is optional.
5. Click Transform to open the dialog box shown below. By default, the cylinder object is created vertically around the z-axis, so it must be rotated and moved (translated) to the desired position.
6. Enter Rotate X = 90 (degrees) so that the cylinder becomes parallel to the Y axis, Tranlsate X = 10 so that the cylinder is centered downstream at x = 10 cm, and then Magnication X = 2.5 so that the cylinder is stretched 3.6. Copy and Modify a Simulation 67
Chapter 3. Tutorial
in the X direction and becomes elliptical. These transformations are applied in alphabetical order: rst the (m)agnication, then the (r)otation, and nally the (t)ranslation. The cylinder was dened with original center at z=0 to eliminate the need for additional translations. 7. Click OK to apply the transformation to the cylinder object, and then click OK again to accept the nal subcomponent denition. Finally, click OK to accept the component type as a standard Solid. A new elliptical structure should now be created at the downstream of the weir and displayed as below. Additional changes or corrections can be made in the Geometry window, which is accessible from the icon: and appears as a window pane pinned to the left side of the GUI by default.
8. Use the menu option File Save Simulation to keep your changes. 9. Start the simulation by selecting Simulate Run Simulation from the menu bar. Switch to the Simulation Manager tab to view the running simulation progress.
Chapter 3. Tutorial
6. Select Display 2 under Display options. 7. Click Render. The view in the interface will automatically switch to the Display tab. Only the pressure contour from the new copy will now be shown in the graphic window, as Display 2, and the one from the original simulation is hidden. 8. Select View Side by Side Layout to show both results next to each other. 9. On the left, select Nearest time frame under Lock frames. 10. Select Next to step through the simulation results simultaneously.
In this case, the most obvious consequence of the change is that more water is trapped downstream next to the weir, due to the elliptical obstruction.
69
Chapter 3. Tutorial
are the restart data writes, shown as restart and spatial... data edits in the solver messages le hd3msg.* of the original run and in the Restart options dialog in the GUI. The example below demonstrates the use of a restart simulation to mimic the change of the boundary condition after a certain time. It is based on the example simulation Flow Over A Weir and has a different type of upstream boundary to mimic a gate closing after t = 1.25s.
3. Name the simulation Weir Gate. Select the new simulation to begin setting up the problem. Creating a restart simulation copies the original and activates the Restart dialog to dene the restart parameters and the results le to restart from. To perform a restart, the flsgrf le from the previous simulation must be available to extract the solution data from. The name and location of this le is automatically dened in the Restart dialog. 4. Select the Model Setup General Restart dialog (shown below) and examine the options. The Activate restart options button is checked to indicate that the initial conguration of the uid will come from a previous results le.
70
Chapter 3. Tutorial
5. Select OK to close the dialog. 6. On Model Setup General set Finish Time = 2.5 seconds. This is because the new simulation will begin at 1.25 seconds, which was the last time step of the original.
71
Chapter 3. Tutorial
2. Activate the Show Mesh Window button: to open the mesh window. There are a number of windows that can be shown or hidden. Each provides access to an element of model setup. Windows can be moved around the screen. 3. Open the Mesh Cartesian Mesh Block 1 Boundaries tree.
Previously a pressure boundary with a uid height was applied at the x-min boundary, and it needs to be changed to a wall boundary to represent the instantaneous closing of an upstream gate after t = 1.25s. 4. Click the P button next to X Min. This opens the X Min Boundary dialog box. 5. Select Wall as the Boundary type and click OK to close the dialog box.
72
Chapter 3. Tutorial
4. Click the Create button in the dialog box and give the name gate.plt in the next Create plot le dialog box. Click the Write button to write the list of plots to the le gate.plt in the simulation directory. Click OK when prompted that the write is complete. Select Quit Create and then Close to close the dialog boxes.
73
Chapter 3. Tutorial
5. Go back to the Analyze 2-D tab and click the Open Results File button. Select [..] to move one directory up. Select the [Flow_Over_A_Weir] directory and open the original flsgrf.Flow_Over_A_Weir le. 6. Again, switch to X-Z plane view and select only the Y = 0.25 plane. Click Render to plot the pressure contours. 7. Click the Files button and then Open (append) in the next File options dialog box. Browse to the directory where the restart simulation Weir_Gate is stored and Open the le gate.plt.
8. Click Close on the File options dialog box. The Display tab should now show a list of 22 time frames from 0.0s to 2.5s, including the transitional moment t = 1.25s when the upstream gate is closed. Note that the frame for t = 1.25 repeats twice. Concatenate 3-D Graphics To concatenate the results les for 3-D display purposes, it is required that both les are stored in the same directory. 1. Select the Analyze 3-D tab Open results le button. Browse to the directory where the original simulation Flow Over A Weir is stored, and select the le flsgrf.Flow_Over_A_Weir. 3.7. Perform a Restart Simulation 74
Chapter 3. Tutorial
2. Select the 3-D sub-tab. Activate the component iso-surface overlay option Solid volume, and make sure that the Time frame range is 0.0 to 1.25 seconds. 3. Activate the checkbox Render frames to disk and then Render. The pressure contours from the original simulation will now be shown on the Display tab. 4. Select the Analyze 3-D tab Open results le button and browse to open the le flsgrf.Weir_Gate. 5. Select the component iso-surface overlay option Solid volume, Time frames from 1.375 to 2.5 seconds (to eliminate duplicate frames), and the checkbox Render frames to disk. 6. Select the checkbox Append to existing output. In the dialog box that opens, back up one folder level and select Flow Over A Weir and then Select Folder. 7. When prompted to over-write les, select Yes to All. 8. Click Render. The Display should now have the list of all available restart time frames from 0.0s to 2.5s, which includes a single instance of the transitional moment t = 1.25s when the upstream gate is closed. FLOW-3D and TruVOF are registered trademarks in the USA and other countries.
75
CHAPTER
FOUR
THEORY
4.1 Theory Overview
FLOW-3D is a general-purpose computational uid dynamics (CFD) software. It employs specially developed numerical techniques to solve the equations of motion for uids to obtain transient, three-dimensional solutions to multi-scale, multi-physics ow problems. An array of physical and numerical options allows users to apply FLOW-3D to a wide variety of uid ow and heat transfer phenomena. Fluid motion is described with non-linear, transient, second-order differential equations. The uid equations of motion must be employed to solve these equations. The science (and often art) of developing these methods is called computational uid dynamics. A numerical solution of these equations involves approximating the various terms with algebraic expressions. The resulting equations are then solved to yield an approximate solution to the original problem. The process is called simulation. An outline of the numerical solution algorithms available in FLOW-3D follows the section on the equations of motion. Typically, a numerical model starts with a computational mesh, or grid. It consists of a number of interconnected elements, or cells. These cells subdivide the physical space into small volumes with several nodes associated with each such volume. The nodes are used to store values of the unknowns, such as pressure, temperature and velocity. The mesh is effectively the numerical space that replaces the original physical one. It provides the means for dening the ow parameters at discrete locations, setting boundary conditions and, of course, for developing numerical approximations of the uid motion equations. The FLOW-3D approach is to subdivide the ow domain into a grid of rectangular cells, sometimes called brick elements. A computational mesh effectively discretizes the physical space. Each uid parameter is represented in a mesh by an array of values at discrete points. Since the actual physical parameters vary continuously in space, a mesh with a ne spacing between nodes provides a better representation to the reality than a coarser one. We arrive then at a fundamental property of a numerical approximation: any valid numerical approximation approaches the original equations as the grid spacing is reduced. If an approximation does not satisfy this condition, then it must be deemed incorrect. Reducing the grid spacing, or rening the mesh, for the same physical space results in more elements and nodes and, therefore, increases the size of the numerical model. But apart from the physical reality of uid ow and heat transfer, there is also the reality of design cycles, computer hardware and deadlines, which combine in forcing the simulation engineers to choose a reasonable size of the mesh. Reaching a compromise between satisfying these constraints and obtaining accurate solutions by the user is a balancing act that is a no lesser art than the CFD model development itself. Rectangular grids are very easy to generate and store because of their regular, or structured, nature. A non-uniform grid spacing adds exibility when meshing complex ow domains. The computational cells are numbered in a consecutive manner using three indices: i in the x-direction, j in the y-direction and k in the z-direction. This way each cell in a three-dimensional mesh can be identied by a unique address (i, j, k), similar to coordinates of a point in the physical space.
76
Chapter 4. Theory
Structured rectangular grids carry additional benets of the relative ease of the development of numerical methods, transparency of the latter with respect to their relationship to the original physical problem and, nally, accuracy and stability of the numerical solutions. The oldest numerical algorithms based on the nite difference and nite volume methods have been originally developed on such meshes. They form the core of the numerical approach in FLOW-3D. The nite difference method is based on the properties of the Taylor expansion and on the straightforward application of the denition of derivatives. It is the oldest of the methods applied to obtain numerical solutions to differential equations, and the rst application is considered to have been developed by Euler in 1768. The nite volume method derives directly from the integral form of the conservation laws for uid motion and, therefore, naturally possesses the conservation properties. FLOW-3D can be operated in several modes corresponding to different limiting cases of the general uid equations. For instance, one mode is for compressible ows, while another is for purely incompressible ow situations. In the latter case, the uid density and energy may be assumed constant and do not need to be computed. Additionally, there are one uid and two uid modes. Free surface can be included in the one-uid incompressible mode. These modes of operations correspond to different choices for the governing equations of motion. Free surface exists in many simulations carried out with FLOW-3D. It is challenging to model free surfaces in any computational environment because ow parameters and materials properties, such as density, velocity and pressure experience a discontinuity at it. In FLOW-3D, the inertia of the gas adjacent to the liquid is neglected, and the volume occupied by the gas is replaced with an empty space, void of mass, represented only by uniform pressure and temperature. This approach has an advantage of reducing the computational effort since in most cases the details of the gas motion are unimportant for the motion of much heavier liquid. Free surface becomes one of the liquids external boundaries. A proper denition of the boundary conditions at the free surface is important for an accurate capture of the free-surface dynamics. The Volume of Fluid (VOF) method is employed in FLOW-3D for this purpose. It consists of three main components: the denition of the volume of uid function, a method to solve the VOF transport equation and setting the boundary conditions at the free surface. Some physical and numerical models are described in more detail in Flow Sciences Technical Notes: http://users.ow3d.com/tech-notes/default.asp, which also include examples.
77
Chapter 4. Theory
78