CHAPTER
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 files. 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.
3.2 Philosophy for Using CFD Computational Fluid Dynamics (CFD) is a method of simulating a flow process in which standard flow equations such as the Navier-Stokes and continuity equation are discretized and solved for each computational cell. Using CFD software is in many ways similar to setting up an experiment. If the experiment is not set up correctly to simulate a real-life situation, then the results will not reflect the real-life situation. In the same way, if the numerical model does not accurately represent the real-life situation, then the results will not reflect the real-life situation. The user must decide what things are important and how they should be represented. It is essential to ask a series of questions, including: • What do I want to learn from the calculation? • What is the scale and how should the mesh be designed to capture important phenomena? • What kinds of boundary conditions best represent the actual physical situation? • What kinds of fluids should be used? • What fluid properties are important for this problem? • What other physical phenomena are important? • What should the initial fluid state be? • What system of units should be used? It is important to ensure that the problem being modeled represents the actual physical situation as closely as possible. We recommend that users try to break down their complex simulation efforts into digestible pieces. Start with a relatively simple, easily understandable model of your process and work it through before moving on to add more complicating physical effects on an incremental basis. Simple hand calculations (Bernoulli’s equation, energy balance, 37
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
wave speed propagation, boundary layer growth, etc.) can give the user confidence that the model is set up correctly and that the program is running accurately.
3.3 Simulation Filenames The FLOW-3D input or “simulation” file is generally called prepin.ext where ext can be any character string which allows you to easily identify the input file. The prepin file contains all of the information necessary to describe a unique FLOW-3D simulation. The default name for the simulation input file is prepin.inp. When the prepin file has this default name, all output files will have the suffix .dat. When you give the prepin file an extension different than .inp,, as when you name the simulation in the GUI, then all of the output files will have the same extension as the input file, allowing you to keep track of which output files and input file go together. The main output file that contains solution results that are saved at various times during the simulation is called flsgrf. Users should be careful not to delete prepin and flsgrf files. Plots can be generated from any flsgrf file at any time during or after a simulation. For a restart simulation, the flsgrf file from a previous run must be available for data initialization in the solver. Note: Starting from a prepin file similar to the problem you intend to model can greatly simplify setup and is recommended whenever possible. Just open an existing input file and then save it to another directory and start working. The prepin file for a simulation can be recovered from its flsgrf file. The prepin file is written at the end of the file g_flsgrf which is created after the flsgrf is processed by the postprocessor or opened in the GUI’s Analyze tab.
3.4 Setting up Simulations There are two ways to create simulations: (1) using the graphical user interface (GUI) and (2) manually by editing the prepin file. If you are curious about the contents of the prepin file, refer to the Input Variable Summary and Units, which contains a general description of the prepin file and its variables. Most FLOW-3D variables have default values, so not all variables used by the simulation need to be specified in the file. These tutorials will focus on using the GUI to create and edit simulations.
3.5 Tutorial - Running an Example Problem In this exercise, you will learn how to create a new workspace and add an existing project file from the Examples directory. The example problem represents flow over a sharp-crested weir. You will learn how to view the setup, run the simulation, and then visualize the simulation results. Finally you will create a simulation copy and perform a restart. Along the way, other methods you can use to create simulations and view results will also be described. Numbered items are instructions to follow to complete the tutorial.
3.5.1 Using the FLOW-3D Graphical User Interface This section shows how to use the GUI to open a simulation file and execute FLOW-3D.
3.3. Simulation Filenames
38
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
3.5.2 Starting the FLOW-3D Graphical User Interface To start the GUI on a Windows machine, click on the FLOW-3D icon on the desktop or find FLOW-3D in the program listing in the Start menu. To start the GUI on a Linux machine, type, “flow3d” at the command prompt and hit the Enter key. The picture below shows the opening screen of FLOW-3D. 1. Launch FLOW-3D by double-clicking the FLOW-3D icon on your desktop.
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 specific 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.
3.5.3 Create a Workspace and Add an Example Simulation Create a New Workspace When FLOW-3D is opened, a default workspace is automatically created. 3.5. Tutorial - Running an Example Problem
39
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 files 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 file and associated geometry files), 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.
3.5. Tutorial - Running an Example Problem
40
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
Note: Although it is possible to locate and open files 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 first copy the input file and any associated geometry files to the local hard disk.
3.5.4 Examine the Simulation Whether starting a new simulation or modifying an existing one, all of the selections or entries the user needs to make are executed in the Model Setup tab. The selections made in the Model Setup tab are recorded in an input file called the prepin file, which drives the FLOW-3D solver. When a simulation is selected in Simulation Manager, the Model Setup tab becomes active. The Model Setup tab has another row of tabs corresponding to various input sections for a FLOW-3D simulation. 1. Select Flow Over A Weir by clicking on it. 2. Select Model Setup → Meshing & Geometry tab. Mouse Modes and Display Functions in the Meshing & Geometry Tab Mouse Modes
Familiarize yourself with the three functions of the mouse buttons:
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.
3.5. Tutorial - Running an Example Problem
41
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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-specified 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 fine, the runtime may be unnecessarily long. The goal of mesh setup is to use just enough cells to resolve the geometry and the flow 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.
3.5. Tutorial - Running an Example Problem
42
Chapter 3. Tutorial
1. Click the FAVORize icon (
FLOW-3D Documentation, Release 10.1.0
) 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-specific tutorials.
3.5.5 Preprocess the Simulation Portions of the geometry may be hidden from view in simulations with complex geometries and may require more information than what is provided by FAVORize in order to be assessed. For example, if there were some internal structure within the weir, 2-D plots would be required to assess mesh resolution. Preprocessing a simulation generates more information than FAVORize and allows a user to determine essential information such as adequacy of mesh resolution. The Preprocess Simulation command runs the preprocessor in the preview mode. It verifies the problem specifications, creates the grid and geometry, and produces both printed and plotted output. Running the preprocessor helps to ensure that the problem is set up correctly before the solver is run, which can save time. The user can examine the preprocessor output files in the Diagnostics menu and visualize the geometry and initial conditions by loading the prpgrf file into the Analyze tab. These steps are described below. 1. Select Simulate → Preprocess Simulation from the menu bar.
3.5. Tutorial - Running an Example Problem
43
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 fill above the dashboard and the clock icon will also fill. It should complete (100%) within a few seconds. The next step is to display the preprocessor results.
3.5.6 Display the Preprocessed Results in 3-D and 2-D The preprocessor generates a results file named prpgrf.***. In this case, the project extension is “Flow Over A Weir”. 1. To display the results contained in the prpgrf.Flow_Over_A_Weir file, select the Analyze tab. 2. If another results file is already loaded, you will see the Analyze tab. Select the Open Results File button. If no other results file is loaded, FLOW-3D will take you directly to the FLOW-3D Results dialog described below. 3. Select the Custom radio button to display the full output files generated by the solver and select how you want to visualize the data. 4. Select prpgrf.Flow_Over_A_Weir from the dialog box, followed by OK. The Analyze tab is now displayed.
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.
3.5. Tutorial - Running an Example Problem
44
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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.
3.5. Tutorial - Running an Example Problem
45
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
This is the fluid and solid configuration at the first 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 fluid configuration 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 flow 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.
3.5.7 Modify the Simulation Before running the simulation, you want to: • Check the Simulation Units (to allow output unit labels) • Request Hydraulic Data (to record additional data of interest) • Specify Selected Data output (to record some data more frequently than by default) Check the Simulation Units 1. Select the Model Setup → General tab. On the right-hand side of the General tab you will see a group box named Units.
3.5. Tutorial - Running an Example Problem
46
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
2. Note that CGS is selected in the dropdown box. This means that the geometry and fluid 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 fluid 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 fluid elevation, fluid depth, Froude number, and depth-averaged velocity to be computed and stored in the results file. 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 fluid flow equations. Selected data is useful for creating smooth animations without making excessively large output files. 1. On the Output tab, select the following data: Fluid Fraction, Fluid Velocities, Hydraulic data, and Pressure as shown below.
3.5. Tutorial - Running an Example Problem
47
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
Selected data output should be chosen with care since only the specified variables will be written more frequently to the results file during the simulation. If you determine later that you need a variable which was not specified in the Selected Data list, the simulation will need to be re-run with this output specified.
3.5.8 Run the Simulation There are two ways to run FLOW-3D: (1) from the graphical user interface (GUI) and (2) from the command line. Either option launches the solver program called hydr3d.exe. Launching the solver from the command line may be useful during debugging and in other special cases. This example will launch the solver from the GUI, which is the typical usage. See Also: Running FLOW-3D from the Command Line The menu selections for running simulations are located in the Simulate menu at the top of the GUI window:
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 efficiency 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 final data plot to the output file 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.
3.5. Tutorial - Running an Example Problem
48
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 fluid divided by the total open (non-solid) volume in the domain. A near-constant value is one indication that the flow is nearly steady. Conv. volume error (% lost): Represents the amount of fluid 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 fluid break-up, or rapid solid (moving object) motion. Volume of fluid 1: The fluid volume within the domain over time. Indicates if the domain is filling 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 filling/draining. 3.5. Tutorial - Running an Example Problem
49
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
Mass-avg mean kinetic energy: Provides a measure of the average mean kinetic energy of flow. This is a good indicator of the steadiness of the flow. Particle count: The number of Lagrangian particles in the domain, if present. In this example, particles are used to visualize flow paths, and are not re-generated at the inlet, so the total number of particles decreases over time.
3.5.9 Introduction to Results Analysis The graphical results of a simulation can be viewed while the simulation is running or after the simulation is complete. It is often useful to visualize the 2-D and 3-D results while a simulation is running to check that it is running correctly. View Existing Plots 1. Click on the Analyze tab. A message appears indicating that the prpgrf file no longer exists. The prpgrf file, 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 Existing radio button. Two types of files will be shown in the data file path box, if they exist. Files with the name prpplt.* contain plots created automatically by the preprocessor, while files with the name flsplt.* contain plots automatically created by the postprocessor as well as plots pre-specified in the input file. 3. Select flsplt.Flow_Over_A_Weir and click OK. This will cause the Display tab to open automatically.
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.
3.5. Tutorial - Running an Example Problem
50
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
Viewing Custom Plots 1. Click on the Analyze tab. A message appears indicating that the prpgrf file no longer exists. The prpgrf file, 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 files. Full output files include prpgrf.* files and flsgrf.* files. Since the simulation has been run, the preprocessor output file has been deleted and incorporated into the flsgrf file. 3. Select the flsgrf.Flow_Over_A_Weir file in the dialog and click OK.
3.5. Tutorial - Running an Example Problem
51
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 file 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 fluid 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 Solidification data can be written to text files. Neutral File: Restart and Selected Data can be output for user-specified interpolation points. FSI TSE: Output specific to the finite-element fluid/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 flow variables. Default output frequency = 1/10th of the simulation time. Selected: Only user selected flow 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 flow rate) computed or specified at boundary conditions.
3.5. Tutorial - Running an Example Problem
52
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
Solidification: Only available if the solidification 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.5.10 Introduction to Custom 3-D Graphic Output 1. Select the Analyze → 3-D tab. 2. Select Iso-surface = Fraction of fluid. This is the variable that is used to draw a surface. The surface is drawn through all cells that meet the Contour Value criteria for the selected Iso-surface variable. Fraction of fluid is the default, and will show the fluid surface.
3. Select Color variable = pressure. This selection determines which variable is used to color the iso-surface (in this case, the fluid 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 fluid. 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 fluid 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 fluid 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 first and last time frames should look like the following:
3.5. Tutorial - Running an Example Problem
53
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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.
3.5.11 Show Symmetric Flow Since the simulation was set up with a symmetry plane down the center of the weir, only half of the weir structure is being simulated and displayed. For presentation purposes, it is often more useful to show both halves of a symmetric model. 1. Go back to the Analyze → 3-D tab and select the Open Symmetry Boundaries checkbox, as shown below.
3.5. Tutorial - Running an Example Problem
54
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
2. Click Render. The fluid 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 final time frame. The display shows a full weir structure as shown below.
3.5. Tutorial - Running an Example Problem
55
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
3.5.12 Create a 3-D Animation The next step will be to create an animation of the 3-D fluid surface. Animations are movies created from the frames in the Available Time Frames list. To improve the visual effect of animations, it is recommended that a common color scale be applied to all frames. 1. Return to the Analyze → 3-D tab. 2. Select both Global radio buttons in the Contour Limits group box.
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.
3.5. Tutorial - Running an Example Problem
56
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 finish 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 files will be written in the simulation directory. Once this process is complete, the following dialog will appear.
3.5. Tutorial - Running an Example Problem
57
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 file 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 find the .avi file 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 file.
3.5.13 Introduction to Custom 2-D Graphic Output 1. Select the the Analyze → 2-D tab. The most useful plane to view results for this simulation is the X-Z plane at the weir centerline, which is located at the plane Y = 0.0. 2. Choose the X-Z plane radio button. 3. Drag both Y limit sliders to Y = 0.25 (the cell center y-coordinate closest to Y = 0.0). You will also note that the same location is identified as J = 2, indicating that the cell in question is the second in the domain. The first cell is outside of the mesh, and is used for computing boundary condition properties. The default selection for contour variable is pressure and plain velocity vectors are selected by default. The solid geometry is displayed automatically with all 2-D plots, so it does not need to be activated like in 3-D plotting.
3.5. Tutorial - Running an Example Problem
58
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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.
3.5. Tutorial - Running an Example Problem
59
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
3.5.14 Introduction to Custom 1-D Graphic Output 1. Select the the Analyze → 1-D tab. This tab allows line-chart plots of calculated (spatially-varying) quantities such as pressure, fluid depth, fluid elevation, and velocity along a row of cells at one or more plot times. 2. Pick Selected as the Data Source. The available variables now show only those selected for more frequent plotting. 3. Select free surface elevation as the Data Variable. Hydraulic data is available since it was selected on the Output tab.
4. Select X-direction because the flow 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 flow 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
3.5. Tutorial - Running an Example Problem
60
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 fluid 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 file, select the Output button. 11. Check the Plots on Screen checkbox to capture the overlay plot (and make only a single output file). 12. Select the Write button to create the image file. 13. The resulting image file will be located in the simulation directory (remember how to find this from the Simulation Manager tab) and will be named plots_on_screen.bmp.
3.5. Tutorial - Running an Example Problem
61
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
3.5.15 Introduction to Custom Probe Plots 1. Select the Analyze → Probe tab. Time history plots are created from this tab as line-graphs or text output of a variable vs. time. There are three types of time-dependent data in FLOW-3D, which are selected from the Data Source group. Spatial data: Restart and Selected data sources. Time-dependent values of a single x, y, z cell center coordinate will be plotted. Values can be integrated with respect to time, differentiated with respect to time, or consolidated with a moving average (in time). General history data: Global quantities which vary only with time. Typical quantities are mean kinetic energy, time step, and convective volume error. This data type also includes all data from specified measurement locations (baffles, sampling volumes, history probes) as well as integrated output for moving or stationary solids and springs/ropes, when those options are selected on the Model Setup –> Meshing and Geometry tab. Mesh-dependent data: Time-dependent quantities (computed or user-specified) at mesh boundaries. Typical quantities are flow rate at a boundary and specified fluid height at a boundary. 2. Select the General History radio button under Data Source. Notice that the X, Y, and Z Data point sliders turn gray. This is because General history data is not associated with any specific cell. 3. Select mass-averaged fluid mean kinetic energy from the list.
3.5. Tutorial - Running an Example Problem
62
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 fluid properties were specified in the centimeters/grams/seconds system.
3.5. Tutorial - Running an Example Problem
63
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 fluid 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 flow.
3.5. Tutorial - Running an Example Problem
64
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 file by selecting the Save As button in the text dialog that appears. 12. Select Continue to close the output window.
3.5.16 Introduction to Custom Text Output 1. Select the Analyze → Text Output tab. Text output works the same way as the Probe tab, except that only cell-data (Restart or Selected) can be output (no component, measurement-station, or global data), and more than one cell can be selected to output data for each plot time. Cells are selected in 3-D blocks using the sliders. The default spatial extents are set to the entire domain. Up to 10 quantities can be output at a time. 2. Experiment with outputting text data on your own.
3.6 Copy and Modify a Simulation The next example problem shows how to copy the simulation just run and add an additional downstream structure.
3.6.1 Add Simulation Copy 1. Select the Simulation Manager tab. 2. Select the simulation Flow Over a Weir in the workspace “Hydraulics Examples”. Right click on the simulation and choose the option Add Simulation Copy in the pop-up menu. 3. Enter the name Weir Structure in the dialog as shown below. It is recommended that the Create subdirectory using simulation name checkbox be selected so that the simulation copy has its own folder in the same workspace directory as the original simulation “Flow Over a Weir”. This helps keep simulations organized in separate folders.
3.6. Copy and Modify a Simulation
65
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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”.
3.6.2 Add an Elliptical Downstream Structure 1. Select the Model Setup → Meshing & Geometry tab. The weir is exactly the same as in the original simulation. 2. Click the menu bar heading Subcomponent (above the display pane) and select the option Cylinder. This opens the Cylinder subcomponent dialog box.
3.6. Copy and Modify a Simulation
66
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 figure 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 Magnification X = 2.5 so that the cylinder is stretched 3.6. Copy and Modify a Simulation
67
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
in the X direction and becomes elliptical. These transformations are applied in alphabetical order: first the (m)agnification, then the (r)otation, and finally the (t)ranslation. The cylinder was defined 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 final subcomponent definition. 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.
3.6.3 Analyze Old and New Results Simultaneously Displaying two sets of results in the same display window helps when comparing two similar cases. 1. Select the original Flow Over a Weir simulation. 2. Practicing what you’ve already learned, go to the Analyze tab, Open results file flsgrf.Flow_Over_A_Weir, select the 3-D sub-tab, pick Selected data with Global contour limits, select all the Time frames using the sliders, and active Component iso-surface overlay = Solid volume. 3. Render the original simulation results. By default, the display option in the above steps is Display 1, which will render the output to the first available display. 4. Return to the Simulation Manager tab and select the new Weir Structure simulation. 5. Go to the Analyze → 3-D tab, Open results file flsgrf.Weir_Structure, and repeat the setup steps in item 2 above (do not Render yet). 3.6. Copy and Modify a Simulation
68
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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.
3.7 Perform a Restart Simulation A restart is a continuation from a previous FLOW-3D simulation. A user might choose to run a restart to continue a terminated simulation or to change certain parameters of the problem, such as the mesh, physical models, boundary conditions, properties, or numerical options. A common example of when a restart simulation is useful is when a detailed (high-resolution) solution of a steady-state problem is required. After the original simulation reaches steady state, a restart simulation is created with a finer mesh. This gives the required detail while saving on runtime to reach steady state. The restart simulation uses the solution data from an existing flsgrf output file to generate the initial fluid configuration of the new simulation (and interpolate velocities at Grid Overlay boundaries). The available solution times
3.7. Perform a Restart Simulation
69
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
are the ‘restart’ data writes, shown as ‘restart and spatial... ‘ data edits in the solver messages file 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.7.1 Add Restart Simulation To create a restart simulation from an existing simulation, you create a copy of the original simulation to restart from. 1. Select the Simulation Manager tab. 2. Select the simulation Flow Over A Weir in the workspace “Hydraulics Examples”. Right click the simulation and select Add Restart Simulation in the pop-up menu.
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 define the restart parameters and the results file to restart from. To perform a restart, the flsgrf file from the previous simulation must be available to extract the solution data from. The name and location of this file is automatically defined 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 configuration of the fluid will come from a previous results file.
3.7. Perform a Restart Simulation
70
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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.
7. Save the change.
3.7.2 Change Upstream Boundary Condition and Run the Restart 1. Switch to the Model Setup → Meshing & Geometry tab.
3.7. Perform a Restart Simulation
71
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 fluid 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.
3.7. Perform a Restart Simulation
72
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
6. Save and Run the simulation.
3.7.3 Concatenate and Analyze the Results This section explains the steps to concatenate two results files to create continuous animations of both 2-D and 3-D displays. Concatenate 2-D Graphics 1. Go to the Analyze and click the Open results file button. Select flsgrf.Weir_Gate from the Results dialog. 2. Select the 2-D sub-tab. Switch to X-Z plane view and slide both Y Limit sliders to the left. Click Render to plot the pressure contours in the Y = 0.25 plane. The pressure contours at all available restart time frames will be listed on the Display tab. 3. Click the Files button in the upper right of the Display tab to open the File options dialog box.
4. Click the Create button in the dialog box and give the name gate.plt in the next Create plot file dialog box. Click the Write button to write the list of plots to the file 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.
3.7. Perform a Restart Simulation
73
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 file. 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 file 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 files for 3-D display purposes, it is required that both files are stored in the same directory. 1. Select the Analyze → 3-D tab → Open results file button. Browse to the directory where the original simulation “Flow Over A Weir” is stored, and select the file flsgrf.Flow_Over_A_Weir. 3.7. Perform a Restart Simulation
74
Chapter 3. Tutorial
FLOW-3D Documentation, Release 10.1.0
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 file button and browse to open the file 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 files, 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.
3.7. Perform a Restart Simulation
75
CHAPTER
FOUR
THEORY 4.1 Theory Overview FLOW-3D is a general-purpose computational fluid dynamics (CFD) software. It employs specially developed numerical techniques to solve the equations of motion for fluids to obtain transient, three-dimensional solutions to multi-scale, multi-physics flow problems. An array of physical and numerical options allows users to apply FLOW-3D to a wide variety of fluid flow and heat transfer phenomena. Fluid motion is described with non-linear, transient, second-order differential equations. The fluid equations of motion must be employed to solve these equations. The science (and often art) of developing these methods is called computational fluid 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 defining the flow parameters at discrete locations, setting boundary conditions and, of course, for developing numerical approximations of the fluid motion equations. The FLOW-3D approach is to subdivide the flow domain into a grid of rectangular cells, sometimes called brick elements. A computational mesh effectively discretizes the physical space. Each fluid 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 fine 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 refining 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 fluid flow 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 flexibility when meshing complex flow 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 identified by a unique address (i, j, k), similar to coordinates of a point in the physical space.
76
Chapter 4. Theory
FLOW-3D Documentation, Release 10.1.0
Structured rectangular grids carry additional benefits 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, finally, accuracy and stability of the numerical solutions. The oldest numerical algorithms based on the finite difference and finite volume methods have been originally developed on such meshes. They form the core of the numerical approach in FLOW-3D. The finite difference method is based on the properties of the Taylor expansion and on the straightforward application of the definition of derivatives. It is the oldest of the methods applied to obtain numerical solutions to differential equations, and the first application is considered to have been developed by Euler in 1768. The finite volume method derives directly from the integral form of the conservation laws for fluid motion and, therefore, naturally possesses the conservation properties. FLOW-3D can be operated in several modes corresponding to different limiting cases of the general fluid equations. For instance, one mode is for compressible flows, while another is for purely incompressible flow situations. In the latter case, the fluid density and energy may be assumed constant and do not need to be computed. Additionally, there are one fluid and two fluid modes. Free surface can be included in the one-fluid 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 flow 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 liquid’s external boundaries. A proper definition 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 definition of the volume of fluid 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 Science’s Technical Notes: http://users.flow3d.com/tech-notes/default.asp, which also include examples.
4.2 Equations of Motion 4.2.1 Coordinate Systems The differential equations to be solved are written in terms of Cartesian coordinates (x, y, z). For cylindrical coordinates (r, θ, z) the x-coordinate is interpreted as the radialdirection, the y-coordinate is transformed to the azimuthal coordinate, θ, and z is the axial coordinate. For cylindrical geometry, additional terms must be added to the Cartesian equations of motion. These terms are included with a coefficient ξ, such that ξ = 0 corresponds to Cartesian geometry, while ξ = 1 corresponds to cylindrical geometry. All equations are formulated with area and volume porosity functions. This formulation, called FAVORTM for Fractional Area/Volume Obstacle Representation Method [Hirt-Sicilian-1985] is used to model complex geometric regions. For example, zero-volume porosity regions are used to define obstacles, while area porosities may be used to model thin porous baffles. Porosity functions also introduce some simplifications in the specification of free-surface and wall boundary conditions. Generally, in FLOW-3D, area and volume fractions are time independent. However, these quantities may vary with time when the moving obstacle model is employed.
4.2. Equations of Motion
77
Chapter 4. Theory
FLOW-3D Documentation, Release 10.1.0
4.2.2 Mass Continuity Equation and Its Variations The general mass continuity equation is: VF
∂ ∂ ∂ ρuAx ∂ρ + (ρuAx ) + R (ρvAy ) + (ρwAz ) + ξ = RDIF + RSOR ∂t ∂x ∂y ∂z x
(4.1)
where: • V F is the fractional volume open to flow, • ρ is the fluid density, • RDIF is a turbulent diffusion term, and • RSOR is a mass source. The velocity components (u, v, w) are in the coordinate directions (x, y, z) or (r, RSOR , z). Ax is the fractional area open to flow in the x-direction, Ay and Az are similar area fractions for flow in the y and z directions, respectively. The coefficient R depends on the choice of coordinate system in the following way. When cylindrical coordinates are used, y derivatives must be converted to azimuthal derivatives, 1 ∂ ∂ → ∂y r ∂θ
(4.2)
This transformation is accomplished by using the equivalent form 1 ∂ rm ∂ = r ∂θ r ∂y
(4.3)
where: • y = rm θ and • rm is a fixed reference radius. The transformation given by Eq. (4.3) is particularly convenient because its implementation only requires the multiplier R = rm /r on each y derivative in the original Cartesian coordinate equations. When Cartesian coordinates are to be used, R is set to unity and ξ is set to zero. The first term on the right side of Eq. (4.1), is a turbulent diffusion term, ∂ρ ∂ ∂ρ ∂ ∂ρ ρυρ Ax ∂ υ ρ Ax +R υρ Ay R + υ ρ Az +ξ RDIF = ∂x ∂x ∂y ∂y ∂z ∂z x
(4.4)
where: • the coefficient υρ is equal to Sc µ/ρ, in which µ is the coefficient of momentum diffusion (i.e., the viscosity) and • Sc is a constant whose reciprocal is usually referred to as the turbulent Schmidt number. • This type of mass diffusion only makes sense for turbulent mixing processes in fluids having a non-uniform density. The last term, RSOR , on the right side of Eq. (4.1) is a density source term that can be used, for example, to model mass injection through porous obstacle surfaces. Compressible flow problems require solution of the full density transport equation as stated in Eq. (4.1). For incompressible fluids, ρ is a constant and Eq. (4.1) reduces to the incompressibility condition ∂ ∂ ∂ uAx RSOR (uAx ) + R (vAy ) + (wAz ) + ξ = ∂x ∂y ∂z x ρ
4.2. Equations of Motion
(4.5)
78