Exercise 1 - Running & Post-Processing An Example
Exercise 1 - Running & Post-Processing An Example
1
Exercise 1: Running & Post-Processing an Example Simulation
2.
On the Simulation Manager tab, create a new workspace by selecting File > New Workspace
from the menu at the top.
3.
Enter the workspace name: Hydraulics Examples. Keep Create subdirectory using workspace
name checked so that the workspace and all its simulations will be under the same directory.
Page 1 of 26
2. Select Flow Over a Weir from the alphabetically-ordered examples list and Open. Keep the
default name and Create subdirectory using simulation name option. Click OK to finish
importing.
3. The project has now been imported into the Hydraulics Examples workspace. Open the project
by clicking once on it so that it is highlighted:
Page 2 of 26
Select the Model Setup tab and then the Meshing & Geometry tab below that. Locate the large
display window showing the model and domain illustrated below.
5.
A. Left-button Rotate. Click and hold the left-mouse button and move the mouse in the
Meshing_Geometry window. The model will rotate accordingly.
B.
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.
C.
Right-button Pan. Click and hold the right-mouse button and move the mouse in the window. The
model will move with the mouse.
Page 3 of 26
Transparency: The Global Transparency slider in the toolbar controls the transparency of ALL
objects in the display window.
2.
The first three buttons move the camera to a Plane View (parallel to a Cartesian axis, facing the
geometry) and toggle the camera between positive and negative axis positions. The third button
moves the camera to a corner XYZ view, and the last button toggles Perspective and
Orthographic views. Try out the different options.
3.
The first button prints the current view, which can be used with a .pdf printer program to
generate images of the mesh and geometry setup. The next two buttons allow you to place a
pivot point (either with a drag box or a single click). The default pivot is the center of the
domain. Next comes a button to fit the domain and geometry to the view window, options for
undoing and redoing camera selections, and a very important button
when the geometry isnt visible.
Page 4 of 26
Mesh: Its important to examine the mesh to assess resolution. Its also important to be able to
turn it off to see the geometry. The mesh can be added from the Mesh menu item. Check the
Mesh > Show option so the mesh is displayed, and select Mesh > View Mode > Grid Lines.
Mesh Planes (user-specified grid lines) are displayed in a different color or weight than the
regular Grid Lines, which are generated automatically by FLOW-3D.
5.
Color Options: Colors can be assigned to components, subcomponents, and mesh blocks. The
colors are to make identifying parts of the simulation easier when editing: they do not affect the
solution.
A. Open the Mesh window (
B. Click on the color palette next to Mesh Block 1 and experiment with different grid line and
mesh plane colors.
C. Select Tools > Options from the menu above the display pane. On the Color tab, select the
Background color swatch and make the background white. Adjust your mesh colors if
necessary to be able to visualize both mesh planes and grid lines.
Page 5 of 26
2. Select the Solid radio button to view the solid geometry as the solver will see it.
3. Click Render to process the geometry and show an iso-surface of it.
4. Note that you can still make selections from the toolbars above the view. Practice turning the
mesh on and off.
5. Select Return to Model Building to close the FAVORized view.
Page 6 of 26
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. There is a rounding at the weir corner that could be examined in 2-D
plots to see if its an artifact of the iso-surface approximation or actually poor geometry resolution. In
later exercises you will use the FAVORize function again to evaluate mesh and geometry resolution.
2. The interface will now switch back to the Simulation Manager and the preprocessor will run. It
should complete within a few seconds, and a message will appear in the Solver text indicating
Preprocessor Done.
Page 7 of 26
3. In the Solver text, scroll up and find the total and active cell counts. They are both around
50,000 cells. This is important information, since the number of active cells is directly related to
the simulation run time.
Viewing Preprocessed Geometry and Initial Fluid Configuration in 3-D and 2-D
The Analyze panel will now be displayed. Although all sub-tabs are available, typically only 2-D and 3-D
plots are necessary to validate the model setup.
The 3-D subtab will be displayed initially when the Analyze tab is selected. First, youll generate the
same display that was generated by the FAVORize function.
1. On the Analyze > 3-D tab, find the Iso-surface dropdown. Select Complement of Volume
Fraction so the surface that is plotted is the interface between solid geometry and open space.
2. Find the Color Variable dropdown, and select None. We do not need to color the surface by a
flow parameter right now.
3. Select Render in the lower right corner of the screen. The tab at top will change to the Display
tab, and will show the same image as you saw in the FAVORize display.
Page 8 of 26
The next step will be to generate 2-D plots of the initial fluid, with the mesh overlaid. We will generate a
2-D display of pressure in the X-Z plane along the centerline of the weir (Y=0).
4. Select the Analyze > 2-D tab.
5. Select the Plane > X-Z radio button to specify the 2-D view. Note that the sliders in the center
of the screen reset so that the full extents of the X and Z domain is plotted, and the Y sliders
come together so that by default only one slice is displayed (at y = 5.25, the geometric center of
the y-domain).
6. Move the Y-direction sliders to the left-most position. The numbers on either side of the slider
show you the Cartesian coordinate of the slider. We want both sliders to be at Y = 0.25, the cell
center of the first cell inside the domain. Note that the cell number J = 2. This indicates that the
first cell in the domain is actually the second cell in the mesh block known to the solver: the first
cell at J = 1 is a ghost-cell (outside of the domain) used to compute boundary conditions.
7.
Page 9 of 26
8. Click Render in the lower left to generate the graphics. You will see the image shown below.
Zoom in and out with the mouse roller. The sharp crest of the weir can be seen indicating the mesh
resolution is probably adequate for capturing the important geometric features. The initial fluid
pressure (the color variable) and velocity (the vectors) are shown. This is important information for
determining the correctness of the setup before running. If other flow quantities such as density or
scalar concentration had also been initialized, they could be checked by selecting them in the Contour
Variable dropdown list back on the Analyze > 2-D tab.
Page 10 of 26
Check the Simulation Units (specify them to allow conversion during post-processing)
Request Hydraulic Data (includes Froude number, fluid depth, free-surface elevation,
near-bottom and depth-averaged velocity)
Specify Selected Data output (more frequent plots to see details and make movies with)
1. Check the Simulation Units: Select the Model Setup > General tab. On the right-hand side you
will see a group box named Units. CGS (centimeters, grams, seconds) is selected for the
Simulation Units. There is no Temperature Unit, and none are needed since there are no Heat
Transfer physics models activated on the Physics tab.
2. Request Hydraulic Data: Select the Model Setup > Output tab. At the right, under Additional
Output, select the checkbox for Hydraulic Data as shown below. This will cause the fluid
elevation, fluid depth, and Froude number to be computed and stored in the results file. These
data are not computed unless this option is selected because they are secondary parameters
derived from other values.
3. Specify Selected Data output: Selected data are user-specified output parameters that are
written to the results more frequently than Restart data. By default Selected data and Restart
data are output every 1/100th and 1/10th of the simulation finish time, respectively. Selected
data is useful for creating smooth animations and seeing detailed flow patterns develop and
change.
On the Model Setup > Output tab, select the following Selected data: Fluid Fraction, Fluid
Velocities, Hydraulic Data (which is available now because you selected it as Additional
Output), and Pressure.
Page 11 of 26
Rule of Thumb
Selected data variables should be chosen with care since only the specified variables will
be written 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 to get the output you need! On the other hand, too many selected outputs will
increase the size of your results file. Its usually better to select too many than not enough.
2. Start the simulation by selecting Simulate > Run Simulation from the menu bar at top. The view
in the interface will automatically switch to the Simulation Manager tab and the preprocessor
will start, followed by the runtime solver. Simulations that are running or waiting to run can be
paused
, terminated
Page 12 of 26
The plots are generated at every History Data output step, which is, by default, 1/100th of the simulation
finish time. All the data shown here is also available as General History data in the output flsgrf file. You
can draw a box to zoom in on the plots by holding the left mouse button and dragging a zoom window.
Hold the Ctrl key and left-click with the mouse to zoom back out.
1. Stability limit & time step size: Compares the time step stability limit (the smallest time step
required in any cell to meet any explicit solver that is active) 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 when there
are too many pressure iterations or a stability limit is unexpectedly exceeded (e.g., due to
splashing).
2. Time-step size: A simple plot of the dynamically-selected time step over time.
3. Epsi & maximum pressure residual: Epsi represents the pressure iteration convergence criteria
that the solver uses to determine if the pressure solution is accurate. At every time step,
pressures and velocities are solved in all cells with fluid until the residual (a measure of
potential error) in each cell is less than some small cutoff value epsi. The max residual is for the
cell with the maximum value of after the pressure solution has either converged or reached
the maximum allowed number of iterations. The pressure iteration fails if the max residual is
larger than epsi after the maximum number of pressure solver iterations, otherwise it is
converged.
4. Pressure convergence ratio: the ratio of maximum residual to epsi. Less than one means the
pressure solution converged, greater than one means it did not. An ideal solution maintains
Page 13 of 26
res/epsi less than one at all times. A few iteration failures are unlikely to damage the simulation
accuracy, especially when they are isolated or occur at the beginning of the run. When the
maximum residual is much lower than epsi, it means that the solution is converging very quickly
(the solution is easy). When it is close to epsi, it implies that the convergence criteria selected
is an efficient choice. Non-default options for controlling the pressure solution are rarely
needed or desirable, but are available on the Model Setup > Numerics tab and will be discussed
in a later lecture.
5. Pressure iteration count: The number of iterations of the pressure solver. Different pressure
solvers have different best values, in general, less than ten is a desirable value.
6. Convective volume error (% lost) and Multi-block volume error (% lost): Represents the
amount of fluid gained (negative value) or lost (positive value) due to advection errors, in
percent. Usually much less than 1%, and should always be less than 3%. A second plot is also
available when multiple mesh blocks are used that describes volume errors due to interpolation
across inter-block boundaries.
7. Fill Fraction, Volume of fluid 1, and Fluid 1 surface area: self-explanatory. In this simulation,
the units of volume are cm3 and surface area is in cm2. Constant fluid volume and surface area
are two indicators that the simulation has reached steady state. Fill fraction is the dimensionless
ratio of fluid volume to total open (non-solid) volume in all blocks of the domain.
8. Mean kinetic energy and Avg. turbulent energy: Provides a measure of the domain-averaged
kinetic energy and turbulent kinetic energy of fluid. These are two more indicators of the
steadiness of the flow. Average TKE is not shown because the flow is being modeled as laminar
according to the selections on the Model Setup > Physics tab.
9. Other plots are available depending on the physics models used: these include thermal energy,
number of particles, and other output.
Take a few moments to look over the available runtime plots for the simulation. See if they make sense
to you.
Also look at the solver text output results at the bottom of the screen. This is a copy of the hd3msg file
that the solver writes to the simulation directory while it runs. Even if the user interface (GUI) crashes,
the solver will continue to run and write all the important output files. The text output lists a summary
of the simulation at each Short Print Data output step that corresponds to the plots. Each line gives:
1. output time t (usually in seconds, refers to time elapsed in the model)
2. output cycle (the number of time steps solved to date, including the current time step),
3. actual time step delt used during the cycle (less than or equal to dtstbl),
4. limiting time step required for stability by any explicit solver process dtstbl,
5. solver process that requires the limiting time step, as a two-letter code,
6. number of pressure iterations iter during the cycle,
Page 14 of 26
7. the ratio res/epsi of pressure solution maximum residual (any cell) to convergence criteria epsi
8. volume of fluid in the simulation domain,
9. the known %loss due to convective flux error and inter-block interpolation error
10. the fraction of the open domain volume that is filled with fluid frac,
11. elapsed real-world time and computer clock time el_time and clk_time (hh:mm:ss),
12. multi-processor efficiency ratio %PE, as percent
Page 15 of 26
them as accurately as in 2-D plots. You can color the iso-surface by free surface elevation to get the
accurate value of the surface location, if necessary.
Text Output: Restart, Selected, and Solidification data can be written to text files for every cell
within selectable extents in space and time. This is the most accurate and precise way to get cell-bycell surface elevations.
Neutral File: Restart and Selected Data can be interpolated to give results at a set of user-defined
points. This output is useful for plotting time-varied results along a flow path that curves within the
mesh.
FSI/TSE: Only used for visualizing deforming solids using finite-element stress-analysis physics.
Once a plot type (tab) is selected, the next step is to choose the data source. There are five sources of
data in FLOW-3D:
Restart: All cell-by-cell flow variables necessary for a complete solution, plus Additional Output (like
Froude number). Output frequency = 1/10th of the finish time by default.
Selected: User-selected cell-by-cell flow variables. Output frequency = 1/100th of the finish time by
default.
General History: Non-cell-specific data. Only available on the Probe sub-tab. Includes global output
like time step size, epsi, and mean kinetic energy. Also includes output for moving objects, history
probes, flux planes (measurement windows), control volumes, history particles, and more.
Mesh Dependent History: Only available on the Probe sub-tab. Includes boundary condition
information like flow rates.
Solidification: Only available if the solidification model is active.
Examples of some of the available plot types will be generated in the next step.
2. Color variable: The selection here will determine what variable to color the fluid surface with.
Select Pressure.
Page 16 of 26
3. Iso-surface options > Component Iso-Surface Overlay: options for plotting the interface
(surface) of solids. Select Solid Volume to plot the solid components (weir).
4. Click and drag the Left (Min) Time Frame Slider so that Min = 0 and Max = 1.25 seconds.
5. Click the Render button to generate a series of 11 plots between t = 0.0 and 1.25 seconds which
contain the weir and fluid surfaces, with the fluid surface colored by pressure. If the geometry
isnt visible, use
to reset the view. Step through the images by selecting time steps from the
list at the right. The first and last output times should be similar to these:
Page 17 of 26
6. Return to the Analyze > 3-D tab. Choose Selected data as the Data Source to access the more
frequent data specified earlier in the exercise.
7. Set the Min Time Slider all the way to the left (t=0.0)
8. Now click the Render button. The view will switch to the Display tab and 101 plots will be listed
in the Available Time Frames list. Click Next to advance through the frames.
2. Click Render. The fluid surface should now appear open (transparent with sharp edges) at the ymin symmetry boundary, which is at y = 0 cm.
3. To mirror the results across the y=0 plane, select Tools > Symmetry from the menu above the
display and select the Y Direction checkbox in the dialog. Click Apply and Close to exit the
dialog. The display show a full weir structure as shown below.
Page 18 of 26
2. Make sure you have selected all time steps with the Time Frame Sliders and click Render.
3. Again, select Tools > Symmetry > Y-Direction to mirror the results across the Y=0 plane. Select
Apply and Close. Pan (using the right mouse button) until the weir is just below and to the right
of the color bar.
4. To create the animation, select Tools > Animation > Rubberband Capture. Instructions will
appear to explain the next step; select OK to continue.
5. Click and hold the left mouse button somewhere to the upper-left of the weir and color bar, and
drag the selection box that appears so it encloses the weir and color bar. Repeat the process if
necessary to capture all the domain. Click the Capture button to accept the selection.
Page 19 of 26
6. A dialog will appear allowing the animation to be named. The default name for animations is
out.avi. A more descriptive name is always recommended. The default frame rate is 10 frames
per second. This may be too fast for some simulations, so enter frame rate = 5. Keep the option
to delete the individual frame images after theyve been combined into a movie.
7. Each time frame will be rendered to the Display window and bitmaps will be written (and then
deleted) in the simulation directory. The camera view may wobble a little during this process:
this is a known issue and will be addressed when EnSight post-processing is included with
FLOW-3D. Once the rendering is complete, the following dialog will appear. Click OK to begin
the next step of the process. The Video Compression dialog will open. Note that the message
below stays open: do not click OK on it again.
8. The default compression for animations is Full Frames (Uncompressed) and is not
recommended since the file size can be quite large and difficult to load in video players and slide
show presentations. Select Microsoft Video 1 since the codec is universally available on
Windows platforms. Unselect the Data Rate checkbox so that the quality of animations is not
limited by the data rate.
Page 20 of 26
9. Click OK to begin the compression process. When the compression is complete, the following
dialog will appear. Click OK to continue.
10. To play the animation, use the operating system to browse to the directory where the
simulation is located. You can do this quickly by going to the Simulation Manager tab and
clicking on the path listed for Simulation Input File. Find the .avi file you created and play it by
double-clicking on it.
Page 21 of 26
6. Make an overlay of the free surface with time: select Overlay from the dropdown plot type list
in the upper right:
7. Return to Single plots and click on the Format button in the upper right-hand corner.
Experiment with the options there, especially the Vector Size options. Click Apply to change the display
without closing the dialog. Take some time and experiment. When you are done, select Reset, then
change the Background to White, and then click OK to close the dialog.
Page 22 of 26
Page 23 of 26
4. Move the X sliders if you wish to limit the extents of the plot. Move the single Y slider to 0.75
so that the second cell in the Y-direction is displayed. The location of the Z-direction slider will
not matter since only one fluid elevation is recorded per column of cells with the same X,Y
coordinate. The recorded free surface elevation is written to all cells in that column.
5. Make sure all output times are selected and click Render. Select the Overlay mode from the
dropdown box to compare plots of fluid surface elevation at various times. Click on plot
numbers in the list at the right to select plot #1, #13, and #101 simultaneously. The example
below shows an overlay of these plots: #1 (t=0.0), #13 (t=0.15s) and #101 (t=1.25 s).
6. Save this plot as a bitmap .bmp or Postscript .ps file. Select the Output button in the upper right
button group. Check the Plots on Screen checkbox to capture the overlay plot instead of all the
time steps. Select the Write button to create the image file, which will be located in the
simulation directory (recall how to get there from the Simulation Manager tab) and will be
named plots_on_screen.bmp. Movies can also be created from this dialog in the same way as
for 3-D plots.
Page 24 of 26
4. Return to the Analyze > Probe tab and select Text as the output form. Then Render again.
5. The text output can be written to a file by selecting the Save As button (dont forget to name
the file). Click Continue to close the text output dialog.
Page 25 of 26
Page 26 of 26