EXERCISES - FLOW-3D v11 Water Environment 3 Day Intro PDF
EXERCISES - FLOW-3D v11 Water Environment 3 Day Intro PDF
EXERCISES - FLOW-3D v11 Water Environment 3 Day Intro PDF
EXERCISES
FLOW-3D Version 11
CFD Project Overview
This project workflow guide is not an exhaustive decision-tree for all elements of a project. Rather, it is
meant to be a checklist with a middling level of detail. Some possible project elements have been
omitted (generating geometry, for example). The Flow Science support staff hopes you find this guide
helpful. Please send suggestions to support@flow3d.com.
FLOW-3D Version 11
CFD Project Overview
A test case may still be valuable even if it doesnt meet all of the above criteria, but there will be
relatively less certainty in how to parameterize the case of interest.
FLOW-3D Version 11
CFD Project Overview
Are physics model and component coefficients correct? Check units and values carefully.
If all of the above considerations have been checked carefully and the problem is not
resolved, refer to the User Manual > Troubleshooting chapter.
Continue adjusting and re-running the coarse case model until you are confident in the
simulation and ready to commit to longer run times.
FLOW-3D Version 11
CFD Project Overview
Compare results from indicated implicit methods to results from explicit methods.
If the results are sufficiently similar and the implicit method(s) are noticeably faster,
consider using the implicit method for the rest of the project.
FLOW-3D Version 11
CFD Project Overview
Adjust the finish time (if desired). The adjustment (if any) depends on (1) how long it
took the coarse case to reach steady state and (2) if the new simulation is a restart.
Repeat the process to create a third case with an even finer mesh. The third case may
be set up as a restart from the second case even if the second case has not run yet.
Numerical uncertainty
The results from mesh-dependency study described above can be used to calculate numerical
uncertainty, order of convergence, Grid Convergence Index, and extrapolated results.
Input uncertainty
Input parameters represent physical reality, which is to some extent unknowable. The way to
deal with this is to quantify the uncertainty of the CFD results due to the uncertainty in the input
parameters. This means estimating the distributions of likely input values, picking values from
the distributions, and recording and interpreting the results when those values are used. This is
time-consuming. It is preferable to find input uncertainty using the design mesh, but using a
coarse mesh is much faster.
Experimental uncertainty
You must make some estimate of the experimental data uncertainty whenever you want to
compare CFD results to experimental results. Standard methods exist for quantifying
experimental uncertainty; most involve estimating measurement uncertainties and combining
Page 5 of 7
FLOW-3D Version 11
CFD Project Overview
them to find result uncertainties. Detailed experimental uncertainties are ideal, approximate
evaluations (e.g., 2%) are common in practice.
Validation uncertainty
Validation uncertainty is the estimated standard deviation of the parent population of the
combination of errors (ASME 2009), that is, a function of numerical, input, and experimental
data uncertainty. The uncertainty uval can be compared to the disagreement |E| between the
CFD model and the experiment:
Wherever uval is greater than or close to |E|, the disagreement is within the level of
noise of the experiment, and the model can be considered good.
When the disagreement |E| is greater than uval, it suggests that the model setup could
be improved (e.g., by calibrating mesh-dependent parameters as described below) or
that the CFD itself is of limited reliability (e.g., turbulence models).
FLOW-3D Version 11
CFD Project Overview
mesh-dependent, and a physically-realistic input value requires a mesh resolution that is not
feasible for the project time constraints).
Report results
Describe the physical situation and why CFD modeling is needed
Describe the test case & report results
Report model options, whether they were the same or different as in the test case.
Report results for the variables of interest from the design mesh resolution.
Justify the design mesh resolution (e.g., mesh dependency results or prior experience).
Report any conclusions drawn or lessons learned from the simulation.
FLOW-3D Version 11
Simulation Setup
This setup guide is not an exhaustive decision-tree for all elements of a simulation. Rather, it is meant to
be a checklist with a middling level of detail. Some possible model elements have been omitted
(electromechanical physics models, for example). The Flow Science support staff hopes you find this
guide helpful. Please send suggestions to support@flow3d.com.
Before starting
Draw and annotate a diagram of the physical problem
The diagram should include:
A consistent unit system (e.g., SI, CGS, slug/foot/second) that matches the scale of the
problem (very small and very large numbers can increase rounding error),
Geometric dimensions,
Locations of fluid and free surfaces,
Notes on body forces (like gravity) and boundary forces (like shear stress),
All heat and fluid fluxes and sources,
All solid moving objects and their velocities, locations, and travel paths
Unknown variables and the locations where you want to them.
The completed diagram should be an sketch of the physical problem that includes all of the
relevant engineering information.
Page 1 of 11
FLOW-3D Version 11
Simulation Setup
Determine the physics packages that are part of the modeling approach
Now decide which physical mechanisms are important. Add the relevant engineering
information for each of these options to the diagram. Try to justify why physical mechanisms
were included or ignored this helps catch mistakes early. A common checklist is given below.
Can gravity and reference-frame motion be ignored? If not, consider gravity and noninertial reference frame physics.
If heat transfer cant be ignored, consider heat transfer physics, and make fluid-to-solid
heat transfer selections below:
o Can all solid components be treated as having a constant, uniform temperature?
If yes, consider no fluid-to-solid heat transfer.
o Can all solids be treated as having a lumped (spatially-uniform) temperature?
If yes, consider uniform component temperatures.
o If some solids must have temperature that vary in space due to initial condition
but are constant in time, consider the non-uniform, constant temperature
option.
o If some solids must have temperatures that vary in both space and time,
consider the full energy equation option.
If a fluid varies in density (e.g., due to temperature gradients, salinity gradients,
contaminants, or entrained air), consider variable density physics.
If a fluid contains other phases (e.g., contaminants, particles, or tiny bubbles):
o consider scalar physics if the contaminant(s) can be treated as continuous
concentrations,
Page 2 of 11
FLOW-3D Version 11
Simulation Setup
o
FLOW-3D Version 11
Simulation Setup
each block so that the x, y, and z distances between them are even multiples of the
largest cell length of the same direction in all blocks. This will make perfectly aligned
gridlines between blocks and minimize interpolation error.
Write the edge coordinates of the blocks.
Page 4 of 11
FLOW-3D Version 11
Simulation Setup
Page 5 of 11
FLOW-3D Version 11
Simulation Setup
Associate the subcomponents with components. Define components so that all their
subcomponents share the same material properties (e.g., surface, solid, and motion
properties). Give descriptive names to each component.
Define domain-removing components to block off open regions where flow will never
occur, and where the open void does not need to vent to a boundary condition. This
reduces the active cell count, and makes the simulation faster. If in doubt, skip this step.
FLOW-3D Version 11
Simulation Setup
Page 7 of 11
FLOW-3D Version 11
Simulation Setup
Valves allow gas (aka void) bubble pressure to escape the domain in a realistic way.
Identify the location point of each. They must be in open areas, not solids.
Estimate the valve loss coefficient and external pressure for each valve (see User
Manual).
Give each valve a descriptive name, and mark it on the diagram.
Follow the annotated diagram for locations to measure output variables and/or check known
variables.
Give each probe and sampling volumes a descriptive name for post-processing.
Define locations and coupled motion parameters for history probes.
Define particle counting bins for sampling volumes (see flux surfaces section above).
FLOW-3D Version 11
Simulation Setup
Boundaries should usually be located far enough from the region of interest that
increasing the boundary distance further does not change the results in the region of
interest. This can be checked later with multiple versions of the same simulation set up.
Boundary types should be appropriate for the situation. For example:
o Pressure boundaries set reference pressure and free surface elevation,
temperature, contaminant concentration, etc. These flow parameters are
communicated into the domain. In free-surface flows, Pressure boundaries are
appropriate where the Froude number Fr < 1. They do not specify velocity
(except for tangential components).
o Outflow boundaries do not communicate any information into the domain,
unless they unintentionally reflect angular momentum. Free-surface elevation
cannot be specified at Outflow boundaries, which are appropriate where Fr > 1.
o Velocity and Volumetric-flow-rate boundaries apply a uniform velocity below a
free surface elevation, and do not specify pressure.
o Grid-overlay boundaries are used to interpolate a flow solution from a previous
simulation as a spatially-varied, time-constant velocity profile. They do not
specify pressure.
Page 9 of 11
FLOW-3D Version 11
Simulation Setup
for selected, history, and short print data. Specified intervals are in
Adjust the model setup if necessary and repeat the check. The preprocessed simulation results
should give you a good idea of how the run will start.
FLOW-3D Version 11
Simulation Setup
Check each section in Diagnostics > Preprocessor Summary (prpout.xxx). Some
commonly checked items are given for demonstration here:
o In section /OBS/, do specified component surface area and calculated
component surface area agree reasonably well? If not, consider adjusting the
mesh resolution.
o In section summary of open areas at inter-block boundaries, is the percent
difference less than 1% (ideal), 3% (typical) or 5% (usually the max acceptable)?
If not, consider adjusting the mesh resolution.
o In section /PARTS/, were any fluid history probes eliminated unexpectedly? If
yes, consider adjusting the history probe location.
o In section /PARTS/, is the total number of particles generated less than the
maximum number of particles requested (max possible)? Will the simulation run
out of available particles during the run?
Page 11 of 11
Page 1 of 24
3. The project has now been imported into the Hydraulics Examples workspace. Load the project
by double-clicking its name:
Page 2 of 24
2. Left Button Rotate. Click and hold the left-mouse button and move the mouse in the
Meshing_Geometry window. The model will rotate accordingly.
3. Middle Buttom or Wheel Zoom. Click and hold the middle-mouse button or wheel while
moving the mouse vertically, or rotate the wheel, to zoom.
4. 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 24
the
button to reset the view and then toggle the
button until the x-axis points to the
right and the z-axis points up. You can toggle the axis and control its location by selecting the
options in View > Draw Axis on the toolbar menu above the view pane.
9. Global Transparency: The Global Transparency slider in the toolbar controls the transparency
of all objects in the display window.
5. Component- and Subcomponent-specific Transparency: these can be set in the Geometry tree
(toggle
). Right-click on a component name or open the Subcomponents list and right-click
on a subcomponent to adjust the transparency. Try out the transparency options.
7. Mesh Display: 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 viewed from the Mesh menu item.
Check the Mesh > Show option so the mesh is displayed, and select Mesh > View Mode > Grid
Lines.
Page 4 of 24
Mesh Planes (user-specified grid lines) are displayed in a different color and/or weight than the
regular Grid Lines, which are generated automatically by FLOW-3D.
8. 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.
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 24
2. Check that Geometry Surface = Solid Volume and ISO Surface Value = 0.5 (more or less). Click
Render to view a gray iso-surface fitted to the solver-embedded solid geometry.
3. The checkboxes associated with individual Components allow all or some components to be
FAVORized. There is only one component, so ignore the checkboxes in the middle of the dialog.
4. At the bottom of the dialog, activate the Show Issues checkbox. Cells where FAVORize will have
known problems will be highlighted in orange. Check that there are no known issues when the
relative Tolerance = 0 and 100.
5. The component/subcomponent list at the bottom of the dialog lets you overlay the geometry
that was imported with iso-surfaces that are fit to the embedded geometry. First de-select
Geometry Surface 0 to turn off the FAVORized iso-surface. Then highlight Subcomponent 1 and
Subcomponent 3 to see the solid part of the geometry. The remaining subcomponents are holes
that cut bevels into the visible subcomponents. Now turn Geometry Surface 0 back on to see
the contrast between the embedded geometry iso-surface and the original defined
subcomponents. Play with Transparency and viewing the mesh Grid Lines while youre looking
Page 6 of 24
at this view. Increasing mesh resolution will usually improve the match between iso-surface and
original geometry. Its important to understand that the way the solver will see the embedded
geometry most accurately viewed in 2-D plots (which youll do later). The 3-D FAVORize view is
not precise because the iso-surface fitting is imperfect and approximate.
6. Close the dialog to return to the normal setup view.
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.
Page 7 of 24
2. The interface will prompt you to Save the FAVORize selections you made (click Yes) and will
then 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.
3. In the Solver text, scroll up and find the total, fluid, and solid sub-domain cell counts. The total
and fluid counts are both around 50,000 cells. This is important information, since the number
of active cells directly relates 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 check the model setup.
Page 8 of 24
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. You 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.
The next step will be to generate a 2-D plot along the weir centerline to show the initial fluid pressure
and location with the mesh.
4. Select the Analyze > 2-D tab.
5. Select the X-Z radio button in the Plane group. 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 both of 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 created by
Page 9 of 24
the solver: the first cell at J = 1 is a ghost cell (outside of the domain) used to compute boundary
conditions.
7.
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 and pan with the right mouse button. The sharp crest of the weir
indicates the mesh resolution is probably adequate for capturing the important geometric features, and
Page 10 of 24
that the rounded edges in the FAVORize view were due to poor iso-surface fitting. The initial fluid
pressure (the color variable) and velocity (the vectors) are shown. They are important for checking the
setup. 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.
Check the Simulation Units are specified to allow labels on output plots
Request Hydraulic Data (includes Froude number, fluid depth, free-surface elevation,
near-bottom and depth-averaged velocity)
Specify Selected Data output for more frequent plots to see details and make movies
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.
Page 11 of 24
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.
Rule of Thumb
Only specified selected data variables will be written to the results file. If you decide 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.
, terminated
Page 12 of 24
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.
Use Ctrl+left-click 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
Page 13 of 24
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
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 or interblock interpolation errors, in percent. Usually much less than 1%, and should always be less
than 3%.
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. Mass-averaged mean kinetic energy and Mass-averaged mean turbulent energy: the domainaveraged, time-mean, kinetic and turbulent kinetic energies. These are two more indicators of
the steadiness of the flow. Average TKE is not shown in this case 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.
Page 14 of 24
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 Interval. 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 (cx = x-direction
convective fluid flux, for example)
6. number of pressure iterations during the cycle iter,
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 24
Custom: a rarely-used way to get under the hood of the post-processor. Text commands used for
this tab are given in the User Manual chapter on Post-Processing.
Probe: Displays values for individual cells as well as non-cell data like integrated global values,
boundary condition values, and component-specific integrated output. Plots charts or text of values
vs. time.
1-D: Flow parameters and other data can be viewed along a line of cells in the X, Y, or Z direction.
Extents (limits) can be applied both in space and in time.
2-D: Results can be viewed in an X-Y, Y-Z, or X-Z plane. Plot limits can be applied both spatially and
in time. Solids are always displayed, and fluid is colored by selected flow parameters. Velocity
vectors and particles (if present) can be displayed. Solid surfaces and fluid free surfaces are drawn
using all available data, and are more accurate than in 3-D plots.
3-D: Both fluid and solid surfaces can be visualized together or separately. The fluid surface can be
colored by flow quantities, which show the state at that surface. Additional information such as
velocity vectors, particles (if present), and streamlines can be added. Plot limits can be applied both
spatially and in time. The surfaces are drawn using a 3-D iso-surface method that does not locate
them as accurately as in 2-D plots.
Text Output: Restart, Selected, and Solidification data can be written to text files for every cell
within selectable extents in space and time. Use this tab to get many cell-by-cell numerical values. If
just a few locations are of interest, it is easier to place History Probes before the run and get their
output from the Probe tab.
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 output from the finite-element stress-analysis
physics package.
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 any Additional Output.
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.
Page 16 of 24
2. Color variable: The selection here will determine what variable to color the fluid surface with.
Select Pressure.
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. Time: 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
Page 17 of 24
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.
Page 18 of 24
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.
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.
Page 19 of 24
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. Click the Capture button to accept the selection.
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 in a later exercise on using FlowSight postprocessing. 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.
Page 20 of 24
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.
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 24
the location of the cell centers closest to the centerline at Y = 0. Set the Time Frame sliders to
include all output times.
4. Select Contour Variable = Velocity Magnitude. Geometry is always displayed on 2-D plots, so
nothing needs to be selected to view it.
5. Click Render to generate a time sequence of 2-D plots of pressure in the plane. Graphics similar
to following will appear on the Display tab.
6. Make an overlay of the free surface with time: select Overlay from the dropdown plot type list
in the upper right:
Page 22 of 24
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.
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 24 of 24
Learning Objectives
In this exercise you will learn techniques to:
1.
2.
3.
4.
5.
Check and fix stereolithography (.stl) geometry files using netfabb Basic and pyAdmesh,
Add .stl geometry to a simulation,
Add simple geometry to a simulation using "primitives",
Create holes in geometry (Boolean operations),
Transform geometry (rotation, translation, magnification).
Page 1 of 16
Select File > Add New Simulation from the dropdown menu at the top of the screen.
Enter Weir Geometry as the simulation name.
Leave Create Subdirectory Using Simulation Name checked.
Select OK.
Page 2 of 16
c. The
image in netfabb Basic indicates that there are errors. Select Extras > New
Analysis > Standard Analysis. A new branch of the tree appears in the Context Area at the
right. You can switch between views and information by clicking on different branches of
the tree.
d. Read the analysis in the Context Area and find where it reports that: (a) the surface is not
closed, and (b) there is 1 hole with 3 boundary edges and 0 bad edges.
e. Check the volume and surface area of the part. Note that mm just means unit of length:
most .stl tools assume you are making .stl files for 3-D printing.
f. Rotate (right mouse button) and pan (center mouse button/wheel) the view until the front
face of the weir is visible. Note the red facet on the left side of the crest. This is the missing
facet.
4. Repair the .stl file using netfabb Basic.
a. Select Extras > Repair Part. Select Automatic Repair at the bottom of the Context Area.
Choose Default Repair and then Execute.
b. Click Update and note how the number of holes is changed to zero.
c. Click Apply Repair and then choose to Remove Old Part.
d. Dont use the Save option. Instead, choose Part > Export Part > as STL. Name the file
weir1_repaired.stl, and make sure its being saved into the Weir Geometry project folder.
Click Save.
e. Repeat the process for Topo_Example_04_fixed.stl. There should be no errors in that file.
Page 3 of 16
You can load multiple parts at once and toggle between them using the tree to check that they are
oriented correctly and in the same coordinate system. There are many other features of netfabb Basic
that you can explore on your own.
A second .stl tool, called qAdmesh, is included with FLOW-3D. The default mode of operation for
qAdmesh is to check a file and report any errors found, without fixing the errors. qAdmesh fixes normals
more precisely than netfabb Basic, but generally does not fill holes as well. It is recommended that you
use qAdmesh after netfabb Basic as a final check.
5. Re-check and repair the .stl file using qADMesh:
a. In FLOW-3D, go to the Model Setup > Meshing & Geometry tab.
b. Select Tools > qAdmesh.
c. Select Browse (next to the Input box) and then find your local copy of weir1_repaired.stl.
The simulation folder should already be open in Windows; look at the address bar at the top
of that window to guide your browsing. Select Open when youve selected
weir1_repaired.stl.
d. Under Output, select the Binary STL radio button. The Output location box is now
activated.
e. Change the name of the output file (at the end of the path) to weir1_repaired2.stl.
f. Click Apply to Default check (and fix) the file.
g. Check the Messages pane and carefully review the details of the repair.
Page 4 of 16
The information in the Messages pane indicates the results. The status listed under Final indicates no
errors, so the file has been fixed.
Under some conditions, .stl tools may have difficulty fixing a file. If multiple repairs do not solve the
problems then re-export the .stl file from CAD. Different .stl tools use different repair algorithms and
may produce different results. Its recommended that you repeat the process of checking and fixing files
until both netfabb Basic and qAdmesh report no errors.
If an .stl file is larger than about 420 MB, neither software will be able to open it. In that case use a 64bit software like MeshLab or a professional version of netfabb. The use of MeshLab is discussed in a
separate exercise on topography.
Page 5 of 16
3. Toggle the
4. Select View > Draw Axis > Origin from the menu above the display to set the axis at the origin.
5. Set the Transparency slider all the way to the left so the weir is opaque.
6. Zoom and pan the view so the crest fills the screen as shown below. Do not rotate the view.
Page 6 of 16
7. Select View > Probe Points List from the display pane menu.
8. Left-click the mouse button and then press and hold Shift. Repeat if necessary until the mouse
arrow becomes a cross-hairs when you hold Shift.
9. Carefully Shift-click on the edges of the notch at the points shown.
a.
b.
c.
d.
10. Use your measurements to find the edge coordinates of the crest notch. The notch is open from
y = -5 to 5 (10 units wide), and begins at z = 12 and continues to the top of the plate at z = 17 (5
units tall).
11. The list remains populated until you select Clear Probe Points. Do this now.
12. Click on the
icon to switch to a profile view from the side. Pan and zoom to view the weir.
Page 7 of 16
13. Use the Transparency slider to increase transparency until you can see the blade edge. You may
see two, in which case the one of interest is the lower one.
14. Repeat the measuring process to find the coordinates of the blade endpoints.
Page 9 of 16
Page 10 of 16
3. The Geometry tree now has two components, each with one subcomponent. Note that the new
box has been added as Subcomponent 2: the subcomponents are numbered in the order they
appear in the tree, regardless of which component they are part of. Next you will add the walls.
Page 11 of 16
4. Add the first wall as another solid box like before but with the following specifications:
a. Add the box to Component 2: channel.
b. X low = -31, X high = 0.3048.
c. Z low = 0, Z high = 6.
d. Y low = -4, Y high = -3.
5. Expand the Min/Max tree under Subcomponent 3 and verify that the values match what the
input above. If there are any mistakes, fix them with the following steps:
a. To adjust the X,Y, and Z extents, change the values under the Limiters branch.
b. To associate a subcomponent with a different component, right-click the subcomponent
name and select Reassign.
c. Locate these two options now for future reference.
6. Double-click the wall subcomponent in the view to select it (it will turn green). Right-click the
selected subcomponent to bring up a context menu. The title of the menu should be
Subcomponent 3.
a. Select Copy
b. Make sure that Add to Subcomponent = 2: channel.
c. Set Position = As Last Subcomponent.
d. Click Transform, and set Translate Y = 7.
e. Click OK, check that youre adding the new wall to Subcomponent 2, and then OK again.
f. Double click anywhere in blank space to deselect the wall.
7. Save your work.
Page 12 of 16
Page 13 of 16
Page 14 of 16
4. Check your work. If you made a mistake defining the cylinder size, use the Limiters branch of
tree to fix it. If you made mistakes rotating or translating, use the Transformations branch.
5. Save your work so far.
6. Create the second hole as a copy of the first one:
a. Right-click the name Subcomponent 2: Outfall 1 in the tree and select Copy
b. Name the new subcomponent LH hole.
c. Add it to component 1: weir.
d. Assign the Position: As Last Subcomponent.
e. Make sure the Subcomponent Type is Hole.
f. Select OK to create the subcomponent copy.
7. Practice finding the Translation branch of the new subcomponent. Change the Y Translation
from negative to positive 1. Check your work against the image below.
8. The holes will only be drilled through the weir plate (Component 1). Now re-do the holes to
drill the rest of the way into the bed (Component 2).
a. Practice: make a Copy of both holes by right-clicking either the tree or the shape.
b. Set Add to Component = 2: channel for both copies.
c. Set Position = As Last Subcomponent for both copies.
d. Check that you have 9 subcomponents in 3 components, and that #2, #3, #7, and #8 are the
holes, as shown below. Use right-click Reassign if necessary to match the picture.
9. Save your work again.
Page 15 of 16
Page 16 of 16
Picking cell sizes to resolve the geometry and flow features according to rules of thumb,
Using nested, linking, and conforming mesh blocks to selectively resolve flow regions,
Mesh dependency studies: reducing cell sizes in multiples of 2 until the results converge.
Page 1 of 21
Page 2 of 21
b. Browse to the Weir_Mesh folder and open prepin.Weir_Mesh. The simulation will appear
with the old name (which is stored as text in the prepin file itself).
c. Right-click on the new (highlighted) Weir Geometry and select Rename. Name it Weir
Mesh.
d. Select File > Save All from the menu at top to save the new name in the prepin text and in
the Workspace file that specifies the project paths.
2. Select the Model Setup > Meshing & Geometry tab and show the Mesh Window
3. Right-click on Mesh Cartesian in the tree and select Add a Mesh Block. New blocks are
created at the origin and are 1 m x 1 m x 1m. Find the block at the bottom of the weir.
4. Expand the Mesh - Cartesian > Mesh Block 1 tree and expand Block 1's X Direction, Y Direction,
and Z Direction subtrees.
5. The first and last Mesh Plane coordinates for each direction are the block edges. Enter values
for both Mesh Planes in the X Direction, Y Direction, and Z Direction as shown on the left side
of the image below.
6. Repeat steps 3 5 using the values on the right side of the image below to add the
DOWNSTEAM block 2.
7. Repeat steps 3 5 using the values on the bottom side of the image below to add the FINER
WEIR BLOCK block 3.
8. Check that the mesh tree matches the next page, and the mesh seen from above matches the
page after that.
a. Use the X-Y View button
to view the mesh from above.
b. Turn on Mesh > View Mode > Grid Lines if necessary.
c. Experiment with different levels of Transparency.
9. Save your work!
Page 3 of 21
The settings shown above define the three mesh blocks that appear on the next page. Notice that the
grid lines dont match at all. Its important to match grid lines between blocks or risk increasing the
interpolation error. Now youll work on making the cell sizes accurate.
Page 4 of 21
Page 5 of 21
size of the containing block should be an even multiple of the smaller mesh block cell size to match the
grid lines.
1. Right-click on the title Mesh Block 3: FINER WEIR BLOCK and select Auto Mesh
2. You will activate directions and fill in values as shown below. Blocks 1 and 2 will get Auto
Mesh twice each for different vertical and horizontal cell sizes. For each step:
a. Delete the value in Total Cells (not required, but makes things more clear)
b. Select the Size of Cells radio button
c. Enter Size of Cells as shown below.
d. Select OK to accept the new criteria.
e. Repeat for each block and each direction as shown below, clicking OK after each step.
f. Check visually that all grid lines match. Toggle between views and zoom in as needed.
3. Save your work.
Page 6 of 21
the geometry to
Page 7 of 21
Page 8 of 21
g. For this exercise, lets assume its (2). The cell size that gives most closely approximates
a square is then dx = 0.16764 and dy = 0.16933333. You can find this by dividing the
weir opening 3.048 by the already-determined X size 0.1674 to find nearly 18 cells
across it. Divide 3.048 by 18 to find the exact cell size.
h. The Y mesh planes now need to be shifted slightly so all distances are even multiples of
0.16933333 m. The image below illustrates the idea. Dont worry about inputting
numbers yet.
6. This is a time-consuming algebraic exercise, which is why its often skipped. It is perfectly OK to
skip entering the values, which are given on the next page. However, the rest of the exercise will
assume that youve entered the values as shown below.
Page 9 of 21
Now the grid lines in X and Y match exactly and align to the most important geometry exactly. Check this
by making the geometry transparent and viewing the grid lines in the Cartesian directions. The same
process can be applied to the Z direction, where the important geometry is the bed and the weir crest.
Instead of using algebra to find the cell size, youll just place a mesh plane on the crest and the floor
instead.
Page 10 of 21
Use Mesh Planes as sparingly as possible because theyre likely to cause stretching.
Mesh Planes should only be used to define flat solids that are parallel to an axis.
Mesh Planes must never be used to try to resolve fluid free surfaces.
Mesh Planes should always be used to match nested and overlapping block extents.
Expand the Mesh Blocks in the tree and check against the image on the next page.
Select Mesh > View Mode > Mesh Planes to view only the specified planes.
Click on Mesh Planes in the tree to highlight them.
If there is an error, edit the Mesh Plane coordinate manually in the Mesh Block tree,
or right-click the incorrect Mesh Plane and select Delete, then Add it again.
Page 11 of 21
Page 12 of 21
The generalized way to determine the optimal location of grid lines (for your later reference):
Place internal mesh planes (internal means they are not the ends of the blocks) only
where absolutely necessary to resolve geometry. In this exercise, mesh planes could be
omitted altogether, except that its important you learn how to use them.
Start by selecting the largest cell sizes in X, Y, Z so that there are even multiples of the
largest cells between every set of adjacent mesh planes and important flat surfaces.
Surfaces that are not flat are well-resolved in FLOW-3D without any effort on your part!
Move block boundaries by starting at the required mesh plane location and adding or
subtracting the largest cell size repeatedly until the value is close to the desired
boundary location. Place the boundary there. If the boundary is outside the geometry,
consider extending the geometry to the boundary.
Continue the process in all directions until all mesh planes and important flat surfaces
are separated by even multiples of the largest cell size.
Make cells in finer blocks exactly , , etc. of the largest cell size.
Repeat mesh planes in all adjacent blocks to tie the grids together precisely.
Page 13 of 21
Check the Mesh Aspect Ratios with the Mesh Information Tool
1. This is a very important tool for checking your mesh quality:
a. Right-click Mesh Block 1 and select Mesh Information
b. Check the Maximum Adjacent Cell Size Ratios (X, Y, and Z): they are close to 1 and < 1.25.
c. Check the Maximum Aspect Ratios (ZY, YZ, and ZX): they are < 3. 1 would be optimal.
d. Check the output against that shown below.
e. Close the dialog and repeat for Mesh Block 2 and Mesh Block 3.
Page 14 of 21
Now the fourth mesh block will include even finer cells, but only within a distance of one meter of the
weir plate. The conforming mesh will only appear as defined in 2-D plots, like those found from preprocessing the simulation. Note also that when the simulation is post-processed, even the unused parts
of Block 4 will contribute to the memory usage of the post-processor. When simulating, the unused
parts do not contribute to the resource demand.
Page 15 of 21
Check the Total Cell Count with the Mesh Block Summary Information Tool
1. Right-click Mesh - Cartesian and select Mesh Block Summary Information
2. Check the text display that appears. The total number of real cells defined in all the blocks is
1,983,000 cells. More ghost cells that are associated with boundary conditions will be added
when you preprocess the simulation, and cells in solids and unused parts of the conforming
block will be removed, so this is a preliminary estimate.
3. Two million cells is a lot for a classroom simulation. Removing some cells is advised.
Page 16 of 21
Volumetric Flow Rate or Velocity type boundaries specify a free surface elevation and flow rate
or velocity. They represent a design storm or are derived from field measurements.
Stagnation Pressure type boundaries specify a free surface elevation and represent a fluid
source with zero velocity but known depth (i.e., a reservoir). Water levels above the specified
elevation exit the domain, and levels below the specified elevation (or pressure) draws fluid in.
The downstream boundary condition depends in large part on the Froude number of the downstream
flow. There are two boundaries that are appropriate for downstream in channels.
Pressure type boundaries are appropriate when the flow is subcritical. They represent tailwater,
and require an estimate of the downstream free surface elevation.
Page 17 of 21
Outflow type boundaries are appropriate when the flow is supercritical. They do not transmit
information back into the domain, so they are appropriate when the flow is faster than gravity
waves.
The upstream boundary condition here will be specified as pressure-type using total head H. The
downstream boundary flow is expected to be sub-critical and you will use Pressure boundaries with
tailwater depths. The top of the domain is open to the atmosphere (Pressure-type with Fluid Fraction =
0), and the bottom of the domain is a solid surface (Wall).
The pressure in the simulation can either be gauge (atmospheric pressure = 0) or absolute (atmospheric
pressure ~ 101 kPa). The atmospheric pressure (gauge or absolute) must be specified at all Pressure-type
boundary conditions, and as the initial void pressure.
Specify the boundaries as follows:
10. Open Mesh block 1: UPSTREAM > Boundaries. Each boundary has a one- or two-character
identifier that can be clicked on to change it. The default is S for Symmetry boundary.
11. Set the upstream boundary:
a. Click on the S next to X Min to open the boundary dialog.
b. Select the Specified Pressure button.
c. Select Fluid Elevation and set the value = 4.2 (measured from Cartesian z = 0).
d. Specify Pressure = 0. This means that the pressure at the free surface is local gauge
atmospheric pressure.
e. Leave Stagnation Pressure checked. The stagnation option means that the water velocity
outside the mesh (in the ghost cells) is set to zero. This corresponds to the idea that the
free-surface elevation specified is the total head (static + velocity). Stagnation pressure is
required for upstream pressure boundaries, because it is stable. When stagnation pressure
is turned off, the boundary condition is called static pressure. Static pressure allows the
solver to calculate a velocity in the boundary ghost cells, and this can lead to run-away flow
unless there is significant back-pressure on the boundary.
f. Select OK to close the dialog.
g. Leave the rest of the boundaries in Block 1 as Symmetry (S) for now.
h. Save your work.
Page 18 of 21
Page 19 of 21
The final number of cells including ghost cells and cell deactivation effects,
The exact location of all grid lines and cell centers,
Adjustments made to the geometry to eliminate sliver cells (described in more detail in
the lectures on Numeric Options and Troubleshooting), and
Disagreement between geometry resolution at inter-block boundaries.
1. Select Simulate > Preprocess Simulation > Local from the menu at the top. The view will change
to the Simulation Manager tab, and the solver text will show the steps as they are completed.
When it shows "Preprocessor Done", the results are ready to view.
2. Select Diagnostics > Preprocessor Errors to view the prperr.Weir_Mesh file. This file contains
important messages when inconsistencies are detected by the preprocessor. It will warn you
that different resolutions are causing different open areas between blocks. This is common
when cross-boundary aspect ratios are greater than 2:1. All the reported warnings involve Block
4, which has the same extents as Block 3 but only half the resolution. This does not matter
because the actual extents of Block 4 after it conforms to the weir will be inside Block 3, and the
ratio will be 2:1 there.
3. Select Diagnostics > Preprocessor Summary to view the prpout.Weir_Mesh file generated by
the preprocessor. You can also read the diagnostics files in any text editor.
a. There is an enormous amount of information in this preprocessor summary, which
documents every step taken by the preprocessor.
b. Click on Search at the top of the dialog and search for mesh. The first instance of the term is
at the beginning of the mesh block namelist. Namelists are sections of the prepin file; the
preprocessor goes through the namelists in order and interprets them. Press Cancel to close
the search box and scroll down to find the section labeled mesh generated in x direction:
c. Click on Search at the top of the text dialog and search for cell summary. Review the
information, which should appear as it does below. There are 144,385 active cells out of
202,498 total cells; both counts include boundary cells. The solid and domain-removing
components deactivated 29% of the cells. This correlates directly to a reduction in memory
use and a substantial runtime efficiency improvement. Fully blocked real cells are cells that
are filled with solid geometry but are still active for heat transfer: there are none here.
Page 20 of 21
cell summary:
total number of cells (active and passive)
fluid sub-domain cells
solid sub-domain cells
cells common to both solid & fluid sub-domains
= 2221792
= 783824
= 66570
= 52888
= 652642
= 619659
= 32983
= 33336
= 111528
d. Search again for areas at inter-block. Review the information. The inter-block area fraction
differences seems high, but most of them misleadingly apply to a conforming block (#4),
while Block 1 and Block 2 only interface directly with each other across the solid sides of the
weir plate. For this case, the inter-block area warnings can be ignored.
e. Search again for area/vol. Cells that have a large open facial area to volume ratio are likely
to have high fluxes which can limit the time step (slow down runtime). FLOW-3D normally
adjusts these by adding virtual volume to cells with A/V ratio greater than a specified
threshold called AVRCK (by default 3.1). This speeds up the solution and makes it more
stable at the cost of a (usually) slight degree of accuracy.
In this simulation, FLOW-3D added 0.21 m3 of volume and the total open volume in the
mesh is 383 m3. The total adjustment is less than 0.06% of the total volume: an insignificant
loss of accuracy for a probable efficiency gain.
4. Select OK to close the text file.
Page 21 of 21
Page 1 of 13
Page 2 of 13
1. On the Model Setup > Physics tab, select the Viscosity and Turbulence button.
2. Select the options shown below.
3. Click OK to accept the changes and Save your work.
2. Select Materials > Fluids Database... from the menus at the very top of the interface.
3. Choose Water_at_20_C, and select Load Fluid 1.
4. You have already set the unit system, so the only units available are SI.
5. Select OK, then OK again, then Close the database. Save again.
Page 4 of 13
future reference, the equation is: Limited Compressibility RCSQL = 1/K = 1/(f W2). K is the fluid
bulk modulus, f is the fluid density, and W is the adiabatic speed of sound.
6. Save your simulation!
3. Change the Pressure from Uniform Pressure to Hydrostatic Pressure. The surface pressure will
be that of the initial void pressure, which defaults to zero, and will be maintained by the Z-max
pressure boundary (where F = 0). The boundary pressures and initial void pressures match at 0
Pa. Matching the void, initial, and boundary pressures can be very important when the void
pressure varies via bubble physics.
4. Open the Global > Fluid Initialization branch and set Fluid Initialization = Use Fluid Elevation
and Initial Fluid Elevation = 1.5 m. This will fill the entire domain to the level of the downstream
boundary condition.
Page 5 of 13
5. Close the Global tree branch, then right-click Fluid Regions and select Add a Fluid Region.
6. Name the new fluid region Upstream. Fluid regions overwrite global areas that they overlap.
7. Note that the region will Add Fluid, and that the Fluid Fraction = 1 (100% Fluid 1 = water).
8. Open the Limiters branch of the tree fluid region tree.
a. Specify X High = 0 m to fill the upstream channel to the weir.
b. Specify Z High = 4.2 (to match the upstream boundary condition free surface elevation).
c. The unspecified limits default to the domain extents.
9. Note that initial Velocities, Pressure, and Turbulent Kinetic Energy can also be specified, but do
not need to be here.
10. Save your work.
Page 6 of 13
11. View the FAVORized geometry using the computational mesh. You should already know how to
do this from previous exercises. This time select Fluid Surface = Fluid 1.
Page 7 of 13
2. Go back to the Model Setup > Meshing & Geometry tab and open the Mass/Momentum
Source Window
3. Right-click Mass Momentum Sources and select Add a Mass Momentum Source.
4. Click to check the Enabled box to activate the first source.
5. Enter the values shown below. The Volumetric Flow Rate gives 2 m/s velocity: QV = U x A.
1. Adjust Transparency so you can see the circular source at the origin.
2. Right-click Mass Momentum Source 1 and select Copy. In the new source, change only
Geometries > Translation > Y = -1.
3. Check that your model appears as shown, with flow vector pointing outward, and Save.
Page 8 of 13
2. Name the new baffle weir flux. Output will be titled with this name.
3. Check the Define as Flux Surface option. Now the baffle will measure flow rates, depth, and
hydraulic energy and head.
4. Define the baffle location and parameters:
a.
b.
c.
d.
Open Baffle Region 1 > Definitions. Only one definition should be specified per baffle.
Specify X Coordinate = 0. The baffle now defines the plane at x = 0.
Open Baffle Region 1 > Limiters. These are used to bound the defined plane.
Specify Y Low = -1.7, Y High = 1.7, and Z Low = 3. This makes the baffle slightly larger than
the opening, which may be important when the baffle moves to the nearest grid lines.
e. Open Porosity Properties and set Porosity = 1. This is not strictly required, since flux
surfaces cannot be completely solid, and will default to porosity = 1 if the default 0 is left.
5. Save your work.
Page 9 of 13
Page 10 of 13
3. Save again.
Page 11 of 13
Page 12 of 13
3. Check the box for Hydraulic Data under Additional Output. The parameter is also added to the
Selected Data list in the center of the screen.
4. Under Selected Data, check the boxes for:
a.
b.
c.
d.
Fluid fraction,
Fluid velocities,
Hydraulic Data, and
Pressure
5. Note that the Restart Data Interval, Selected Data Interval, and History Data Interval can be
forced to other than the default 1/10th, 1/100th, amd 1/100th of the finish time, respectively.
Intervals are specified in seconds and can usually be left to the default.
6. Save your work!
Page 13 of 13
Launch FLOW-3D.
Select the Simulation Manager tab.
Click to highlight the Hydraulics Examples > Weir Finish simulation that you ran.
Select the Analyze tab.
If prompted to select a file, continue with step 7 below.
If not, select the Open Results File button at the bottom left of the Analyze tab.
Select Custom to display flsgrf and prpgrf files.
Select flsgrf.Weir_Finish.
Select OK. The file loads and the GUI switches to the Analyze > 3-D tab with all options reset.
Page 1 of 13
Page 2 of 13
4. Select the other Color Variables from the dropdown in the upper left corner of the interface. Do
the results make sense?
5. Set Color Variable = Froude Number, and open Tools > Options from the menu above the
display window. Uncheck the default values option and enter the values shown below. Note that
the nappe appears subcritical. This is because Hydraulic Data is depth-averaged along z, so the
Froude number includes the depth and velocity of the pool beneath the nappe.
Page 3 of 13
6. Re-activate the Default Values option and click Apply to return to the normal color scale.
Note how a supercritical jet expands away from the wake, while the rest of the pool is subcritical. This
makes the appropriateness of the downstream boundary unclear. Pressure boundaries are best for
subcritical tailwater, while Outflow boundaries are best for supercritical flow. The X-max and Y-max
boundaries should be placed farther from the nappe to avoid this difficulty.
Also note the contraction of the jet as it falls; the degree of contraction in the CFD model depends on
the momentum advection method, volume-of-fluid (VOF) method for free-surface tracking, and the
geometric resolution of the weir crest.
Finally, note that the upstream depth (as shown for Fluid Depth and Free Surface Elevation) does not
vary much. This indicates very minor head loss due to friction. The degree of friction appearing in the
model depends on the water velocity, the roughness height of the component, and the mesh resolution
near the bed.
Add Streamlines
1. Access the Streamline Edit dialog
or select Tools > Streamline Edit. If the dialog doesnt
appear, return to the Analyze tab, activate Plain Streamline Seeding, and Render again.
2. Set a single streamline starting point and edit its appearance:
a. Select the X direction radio button for the Seeding Plane.
b. Slide the Seeding Plane slider back and forth and watch the green plane move in the display.
c. Adjust Transparency so you can see the entire plane.
d. Hold Shift and left-click on the plane at a point near the bed and approximately on the
centerline of the flow.
e. Select Render.
f. A line should appear showing the streamline from t = 0 to the selected time in the Available
Time Frames list.
g. If no line appears, troubleshoot by:
i. adjusting transparency,
ii. selecting a later time frame (for a time when fluid is moving),
iii. making sure that the point you added isnt inside the bed (no flow there).
iv. Use Clear and try again, if necessary. Remember to Render again after adding a point.
h. Increase the number of Integration Steps by a factor of 10 (add a zero) and Render again.
The number of steps controls the resolution of the line, as well as the length. Usually 10,000
or 100,000 integration steps are sufficient to complete the line. Repeat the increase until
the line reaches the end or no longer changes. If the line terminates at a free surface, try a
different starting location.
i. Locate the Object List pane in the lower left. Right-click the Streamlines entity there to get
display options.
j. Try changing the display shape to Ribbons, adjusting the transparency, and changing the
color and weight (ribbon scale percentage) of the streamline. Also try adjusting the
transparency of the other entities (solid and fluid surfaces),
Page 4 of 13
Page 5 of 13
Page 6 of 13
2. After the meshblock mismatch errors discussed in There is one warning, which is displayed
below.
Solver Messages:
convective flux exceeded stability limit
at t= 3.0009E-02 cycle=
1 iter= 51 delt= 3.0009E-02 mesh block 4
restarting cycle with smaller time step
maximum failure ratio = 2.26944E+00 is in x-coordinate direction
at cell ( 82, 34, 17) mesh block 4
3. The meaning is as follows:
a. At t = 0.03 seconds, a packet of fluid tried to move more than one cell at a time. The packet
probably accelerated unexpectedly, which is why the solver didnt predict the velocity of the
packet. The stability limit is the requirement that fluid packets only move one cell per time
step. The solver takes care of the problem by restarting the time step with a smaller dt.
b. The error occurred in Mesh Block 4, the conforming block.
c. The offending cell number is i, j, k = 82, 34, 17. Remember that i,j,k values are block-specific,
while x,y,z values are global.
d. The problematic fluid packet was moving in the x-direction. In the next step you will find the
problem cell and identify why the problem occured.
4. Use the small X in the upper right corner of the dialog to close the Warnings & Errors.
5. Scroll up through the text output displayed below the plots and find the same warning. Notice
that the cell location and mesh block are not given in this summary.
6. Select Diagnostics > Solver Errors from the menu at the top of the screen: the same information
is displayed. Some errors report additional information to the Solver Errors file, so it should
always be checked.
The only run-time error reported in this simulation is a single convective flux error which does not affect
solver accuracy. Except for the purposes of this exercise, you can safely ignore isolated errors. If
convective flux errors recur frequently, they will at best slow down the simulation, and at worst cause it
to terminate before completion. Errors should be addressed when they are repetitive.
Page 7 of 13
Page 8 of 13
Page 9 of 13
The problem cell is just inside the top of the pipe. Notice the recirculation zone to the right above the
pipe discharge jet. Convective flux errors are associated with sudden accelerations. The flow is making a
corner here, so it can be induced that the discharge, forming in quiet water, interacted with the pool
and experienced an unexpected acceleration at t = 0.03 seconds. Even at t = 0.35 and 0.7 seconds you
can still see where the recirculating pool flow accelerates from the downward direction to the horizontal
direction as its caught by the pipe discharge. By the visible time steps, however, the flow is predictable
enough that the dynamically chosen time step accounts for the change in direction.
Identifying the problem cell is useful when there are many errors in a row. In this case the failure is of a
type that can usually be ignored, especially since it occurs only once. Common causes of serious (that is,
numerous) errors include:
bad geometry files: fix with pyAdmesh and netfabb or re-export from CAD,
unresolved or poorly resolved gaps between geometry: use finer cells or different geometry,
incorrect boundaries or sudden changes in boundary conditions or mass/momentum sources,
incorrect initial conditions, and/or
flying droplets/splashing of fluid.
Use Probe > General History Data for Measurement Location Output
1. Go to the Analyze > Probe tab and select Data Source = General History.
2. Display units:
a. Click Units at the bottom right of the screen.
b. Activate Show Units on Plots.
c. Select Units System = SI.
d. Select OK to close the dialog.
3. Scroll down in the Data Variables list and select the following:
a. staff gauge: flow depth (around #14). This is output from the History Probe you placed
upstream.
b. fluid 1 volume flow rate @ weir flux (around #59). This is output from the Flux Surface you
put at the weir.
4. Render the plots graphically, using multi plots to look at the data side-by-side.
Page 10 of 13
Luckily for you, the diffusion and volume loss appear to occur after the critical control at the weir crest. If
you are interested in flow rate over the weir, the multi-block error wont affect your results. If, however,
youre interested in the nappe impingement and its effect on the downstream topography, then the
model has a problem and should be re-meshed to enclose the nappe in a single block.
Page 12 of 13
This model predicts a flow rate of about 2.4 m3/s, while the Kindsvater and Carter (1957) equations
predict about 2.1 m3/s. The disagreement is about 13%. A careful check of the limits of applicability of
their equation (found in Bos 1989) show that the model is within the region of applicability for approach
head depth, crest height above the channel, channel size, and drop length of the nappe. Feel free to
suggest how this model could be improved to your instructor. For one successful example, see Abd ElHady Rady (2011) 2D-3D Modeling of Flow Over Sharp Crested Weirs, Journal of Applied Sciences
Research.
Congratulations on completing your first FLOW-3D simulation from start to finish!
Page 13 of 13
X-min
Z-max
X-max
Z-min
Figure 1: Schematic of Experimental Apparatus and CFD domain
Page 1 of 13
z
15 cm
gz = - g cos
g = 980 cm/s2
10
gx = + g sin
100
where:
Fr = Froude number, given as 3.0,
U = average velocity of the fluid,
g = gravity, 980 cm/s2,
h = mean depth of the flow, given as 5 cm.
Page 2 of 13
Technically, h is the hydraulic mean depth, equal to the wetted area Aw divided by top surface width T.
Because this is a 2-D model that ignores the curvature of the pipe, the true meaning of h will also be
ignored (again contributing to the results being for illustration only).
1. Add a new mesh block, ignoring its dimensions for now.
2. Rearrange the Froude equation and solve to find the mean upstream velocity U = 210 cm/s.
3. Make the upstream (x-min) boundary velocity-type:
a. Set X-Velocity = 210 cm/s.
b. Set Free Surface Elevation = 5 cm.
where:
Tu = initial intensity of turbulence (dimensionless, equation is empiric for fully-developed pipe flow),
Re = pipe Reynolds number (dimensionless),
Aw = wetted area (cm2),
DH = characteristic hydraulic length, taken to be the pipe hydraulic diameter (cm),
h = depth of 2-D flow (cm),
kT = mean turbulent kinetic energy per unit mass (cm2/s2),
T = rate of dissipation of turbulent kinetic energy per unit mass (cm2/s3),
LT = turbulent length scale, aka turbulent mixing length, about 7% of pipe diameter (cm),
Pw = wetted perimeter (cm),
U = mean fluid velocity (cm/s),
= fluid dynamic viscosity (g/cm/s),
= fluid density (g/cm3),
Page 3 of 13
The upstream depth of flow is 5 cm, velocity is 210 cm/s, density is 1 g/cm3, and viscosity is 0.01 g/cm/s.
The Reynolds number is therefore 4.2E5, so the flow is fully turbulent. Assume the pipe is hydraulically
smooth. The following empirical upstream boundary turbulence values apply:
Tu 0.0156 (1.56%)
kT 16 cm2/s2
LT 0.35 cm (potential range 0.25 0.65 cm)
T 30 cm2/s3.
A second way to approach the problem is to put brackets on the initial turbulent intensity. Most pipe
flows exhibit Tu between 1% and 5%. In rivers Tu often exceeds 10%! The brackets give us two more
possible values:
Estimation Method
Full-pipe Tu 1%
Full-pipe Tu 0.16Re-1/8 1.6%
Full-pipe Tu 5%
kT (cm2/s2)
7
17
165
T (cm2/s3)
8
33
998
***** Note that there is no widely agreed-on method of deducing upstream turbulent parameters, and,
as shown in Figure 3 below, the effect of an arbitrary value can be significant! For this reason, some CFD
modelers prefer to model upstream turbulence explicitly, even if it requires more than one simulation.
Page 4 of 13
Figure 3: Volumetric fraction of entrained air and jump shape at 3 seconds as a function of upstream
boundary turbulence (top to bottom: kT = 80, 660, 4400 cm2/s2, T = 140, 3600, 61500 cm2/s3)
Page 5 of 13
Gravity
gx = 97.5136 cm/s2,
gz = - 975.136 cm/s2,
Page 6 of 13
X-min = 0 cm
Boundary =
Velocity
U = 210 cm/s
FSE = 5 cm
TKE = 16 cm2/s2
DTKE = 30
cm2/s3
Z-max = 15 cm
X-max = 100 cm
Boundary = Wall
X-Low2 = 40 cm
Z-Low2 = 5 cm
U2 = 0 cm/s
Boundary =
Stagna. Pressure
FLUID REGION 2
P = 6000 g/cm/s2
Fluid Fraction = 1
Page 7 of 13
fluid probe #1: volume fraction of entrained air: cm3 air/cm3 air-water mix
fluid 1 volume flow rate @ flux surface 1: cm3/s air-water mix x +/- unit vector
entrained air flux @ flux surface 1: cm3/s air, may be negative x +/- unit vector
sampling volume 1: entrained air volume: cm3 air at time t
entrained air volume: cm3 air at time t in the entire domain including ghost cells
Note that the outputs above count only entrained air scalar and do not include resolved void bubbles.
Do not use Mesh Dependent History data, as it will only report the specified air volume fraction in the
ghost cells (zero), and not the calculated volume crossing it.
Example Calculation for Flux Plane:
1. Select Units > CGS to avoid converting the output units.
2. Render the Probe > General History data variables above as Text. The variables are written leftto-right in the same order that they are listed (top-to-bottom) in the selection list.
3. Find TIME = 5 seconds (the last output time).
4. Find FFLUX1 (the Fluid 1 Flow Rate at the Flux Plane) = 1050 (cm3 air-water mix)/s. Since Density
Evaluation physics are not activated, the density of the mixture is the density of pure water. No
density variation due to entrained air is included. Therefore the liquid flow rate through the
plane QV,WATER = 1055 cm3 water/s.
5. Find FPSCL1 (the volumetric air concentration at the plane) = 96.1 amount/s. The units for
FPSCL1 are tricky: they represent a scalar, so FLOW-3D reports them as g/s. In actuality, scalars
can be defined with any consistent measure of amount unless Density Evaluation physics are
active: then density scalars must be defined as mass/volume. So what is the measure of
amount for the scalar Air Entrainment model? Its a dimensionless volumetric fraction: the
volume of air per volume of liquid. When the fraction and velocity are integrated over the area
of the flux plane, the result is a volumetric flow rate (despite what FLOW-3D reports). So FPSCL1
= QV,AIR = 96.1 cm3 air/s.
6. % concentration of air in the mixture = QV,A/QV,MIX = 96.1/(1055 + 96.1) = 8.3% by volume
crossing the flux plane at t = 5 seconds. This is an instantaneous value in an oscillating flow; the
time-average is better for reporting and is 6.6% by volume over the final 2.5 seconds.
Page 8 of 13
The Scalar model should only be used without Density Evaluation physics when the volume of air is less
than 1% or 2%. When the fraction is higher the mixture should include bulking and density effects.
Page 9 of 13
3. % concentration of air in the mixture = QV,AIR/QV,MIX = 6.3% by volume at t = 5 seconds. The time
average is 6.7% by volume over the final 2.5 seconds, similar to the scalar-only physics results.
The magnitude of oscillation is much smaller with density physics than with scalars only.
Figure 8: Parameters for air bubbles and water for drift-flux model
Page 10 of 13
A brief description of the parameters in Figure 8 follows. Values for air bubbles can be found in the
literature, and a description of the drift-flux model equations that can be used to fit parameters to
experimental data can be found in the User Manual and in Technical Note 83 at users.flow3d.com. Note
that the Drift Flux model requires 1st or 2nd order Density Evaluation physics.
Drag Coefficient is the fully-turbulent limit of the drag coefficient CD. FLOW-3D uses a smooth
function that gives Stokes settling in the laminar regime and drag defined by CD in the fully
turbulent regime. The default value of CD is 0.5, which is correct for dense spheres. Values of
0.75 to 1.5 are typical for sand and gravel. 0.95 has been demonstrated to be accurate for
buoyant spheres (S < 900 kg/m3), where the rising sphere exhibits a corkscrew motion due to
pressure/buoyancy effects that causes more drag; see Karamenev (1992).
Average Particle Radius: typically taken to be between 0.5 mm and 1 mm for air bubbles, but
the data scatter is significant. Impinging jets often exhibit bidisperse-normal distribution of
bubble radius, which complicates the estimate of a single mean radius.
Richardson-Zaki Coefficient Multiplier: this should be 1.0 for the standard Richardson-Zaki
correlation, which describes the additional effect of particle-particle (bubble-bubble) wake
interaction in a concentrated cloud of the dispersed phase. The multiplier can be used to curvefit existing data, if needed. See the Tech Note for the full equation.
Viscosity of Two-Phase Mixture: the viscosity used in the Navier-Stokes cell-to-cell momentum
equations, regardless of phase concentrations. Typically assumed to be the viscosity of the
continuous phase, so here it is the viscosity of water. Values entered here will change the value
of Fluid 1 Viscosity on the Fluids tab. If the cell-to-cell viscosity varies, consider borrowing the
solidification variables as discussed in the lecture on Multiphase Flow. An example of this
situation would be two liquids (water and oil, e.g.) that flow as unmixed phases in different parts
of the domain. Here, the continuous phase will always be water.
Viscosity of Phase #1 is the viscosity used in the in-cell evaluation of relative (separation)
velocity between the continuous and dispersed phases. Set this to the viscosity of water also.
Density of Phase #1 is the density of the continuous phase, pure water. Values entered here will
change Fluid 1 Density on the Fluids tab.
Density of Phase #2 is the density of the dispersed phase, pure air. This value was entered on
the Air Entrainment physics dialog, and changes made here will change the value there.
Minimum Volume Fraction of Phase 1 is the irreducible fraction of water allowed in a cell. Unity
minus this value is the maximum fraction of air allowed in a cell. The correct value should be
Page 11 of 13
some small number that reflects the thin film of water between bubbles, but this value is not
known, so use 0 as a reasonable approximation.
Maximum Volume Fraction of Phase 1 is the upper limit fraction of water permitted in a cell. 1
this value is the irreducible minimum air permitted in a cell. Water can be present without air in
it, so 1 is appropriate.
Volume Fraction of Phase #2 at Inversion Point is the maximum volumetric fraction of air in a
cell before the continuous and dispersed phases switch so that air is considered continuous. If
modeling another liquid, 0.5 would make sense. Because we assume air bubbles will always be
discontinuous (separated by films), 1 is appropriate. The equations of the Drift Flux model do
not make physical sense for any other value when the two phases are different states (liquid vs.
solid or gas).
Allow Gas to Escape at Free Surface allows phase #2 to disappear at free surfaces and should be
activated for the best physical representation of bubbles.
The model will take even longer to run than the last one, due again to the added physics. Review the
results as before, but use Auto contour limits this time. Compare your results to Figure 9.
Figure 9: Final time step (t = 5.0 seconds) for drift-flux model version of problem
Calculate as before to find the instant and time-averaged air flow:
1. QV,MIX = FFLUX1 = 1141 cm3 mixture/second at t = 5 seconds.
2. QV,AIR = FPSCL1 = 82 cm3 air/s, 5% greater than in the density-evaluation only model.
3. % concentration of air in the mixture = QV,AIR/QV,MIX = 7.2% by volume at t = 5 and 6.6% by
volume averaged over the final 2.5 seconds, about the same as the density-only model.
One last calculation:
1. View the results in 2-D using Restart Data and Contour Variable = Macroscopic Density.
2. Now use Probe > General History Data to plot text for fluid 1 volume flow rate @ flux surface 1
(FFLUX1) and mass flow rate @ flux surface 1 (MFLUX).
3. Divide the mass flow rate (g/s) by the volume flow rate (cm3/s) at the last time step to find the
spatially-averaged mixture density MIX at the flux surface. Use the equation:
Page 12 of 13
The percentage of air calculated from the density is the same as was determined by dividing entrained
air flux @ flux surface 1 (FPSCL1) by fluid 1 volume flow rate @ flux surface 1 (FFLUX1). This verifies
that FPSCL1 is the volume fraction of air in the mixture, not g/s. You can use this approach for any
density scalar to determine if the reported units are correct.
References
Brethour, J.M. and C.W. Hirt (2009). Drift Model for Two-Component Flows. FSI-09-TN83Rev.
Flow Science Inc.: Santa Fe, NM.
Hirt, C.W. (2003, 2011). Modeling Turbulent Entrainment of Air at a Free Surface. FSI-03-TN61R.
Flow Science Inc.: Santa Fe, NM.
Page 13 of 13
Define Geometry
The general process for the Model Setup > Meshing & Geometry tab will be to define the geometry,
assign properties to the components, define the mesh and boundary conditions, and then set the
initial state of the fluid and void. Start by defining the components. The tank will primarily be
defined using the mesh boundaries, but the filling tube and valve will be components.
1. Geometry: defined in the Geometry Window
.
a. Nozzle
i.
Create a solid cylinder subcomponent with the following dimensions. Name the new
Component 1: Nozzle.
1. Z low = undefined (blank, not zero), Z high = 0.15 cm
2. Cylinder outer radius = undefined (make it blank after you build the cylinder)
3. Cylinder inner radius = 0.0105 cm. The inner radius is like pipe inner diameter; it
must set it in the tree under Limiters and with the undefined outer radius will make
everything outside the inner radius solid.
ii.
Create a solid torus subcomponent with the following dimensions:
1. Component = Nozzle
2. Torus Minor radius = 0.0075 cm
3. Torus Major radius = 0.0105 cm
4. Z low = undefined, Z high = 0 cm. This must be set in the subcomponent tree
Limiters. It cuts the torus across the centerline so only the lower half remains.
5. Cylinder outer radius = 0.0105 cm. Also set in the subcomponent Limiters; this
bevels the outer surface of the torus so its straight perpendicular in z.
iii.
Move the torus subcomponent into position by translating it 0.015 cm in Z.
Page 2 of 10
iv.
Check the effect of the additional limiters by FAVORizing the geometry: use a
Renderspace with extents -0.02 to 0.02 in all directions and 0.0005-cm cells. Because
the part is small relative to the unit system, the camera may not be zoomed in enough
when you Render. Use
b. Piston
i.
Create a cylinder subcomponent and assign it to a new Component 2: Piston.
1. Z low = undefined, Z high = 0.002 cm
2. Cylinder inner radius = undefined, Cylinder outer radius = 0.0085 cm. This makes
the piston solid.
3. FAVORize again and check your work against the picture below. You may need to
adjust transparency and/or rotate the view to see the piston inside the cavity.
Page 3 of 10
c. Dirt Particle
i.
Create a sphere subcomponent and assign it to a new Component 3: Dirt.
1. Sphere outer radius = 0.001
2. Translate it 0.012 cm in Z.
Page 4 of 10
Check your Moving Object Setup dialogs against the images on the next pages.
Page 5 of 10
Page 6 of 10
Page 7 of 10
Page 9 of 10
There are a few viscous stress iteration failures, but they are not consecutive and, unlike pressure
iteration failures, they do not affect the time step dt.
Postprocessing Visualization
1.
2.
3.
4.
Plot Selected Data for Pressure, and then Velocity Magnitude, in 2-D with No Velocity Vectors.
Activate the Horizontal Symmetry checkbox and Render.
Compare your output to that shown below at t = 3.9E-5 seconds.
Plot Probe > General History data > Component 3 GMO Shear Force Magnitude in Space
System to see the particle drag magnitude.
The dirt gets trapped in the ink droplet and drag makes the droplet move more slowly and elongate
the droplet. This would cause poor printer performance.
Page 10 of 10
Page 1 of 19
1-D
o Pros: fastest run-time, easiest analysis.
o Cons: velocity and pressure profile due to inlet/outlet effects and wall effects not modeled.
2-D
o Pros: fast run-time, easy analysis, inlet/outlet/wall effects can be approximated.
o Cons: Must assume axially and radially symmetric flow about z-axis.
3-D
o Pros: inlet/outlet/wall effects and non-axial/radial symmetric flow can be modeled.
o Cons: slowest run-time, most difficult analysis (requires spatial and temporal averaging).
Based on the above, a 2-D run in cylindrical coordinates is suggested to model axial and radial flow
symmetrically around the bed tube axis.
Page 2 of 19
Here E represents energy. Subscript Z is the potential (elevation) energy, P is the pressure energy, and V
is the kinetic (velocity) energy. Subscripts A and E are energy added or removed by hydraulic machinery,
f is the energy lost due to friction, and 1 and 2 are two points along a streamline. In this case because
the tubes are uniform diameter, the velocity is constant (conservation of mass), and the velocity and
hydraulic machinery terms can be omitted. Converting the remaining terms from energy to hydraulic
head (in units of feet) gives:
where P and z are pressure and elevation at point 1 or 2, is the fluid density, g is gravitational
acceleration, and hf is head loss due to friction. Let z2 be the outlet reference elevation and z1 be the
inlet elevation: they will be 0.4 m apart. Frictional losses will be zero when there is no flow, and the
above equation then indicates that the static pressure head at the outlet will be greater than the static
pressure head at the inlet by 0.4 m. This implies that at flow rates near zero, the pressure will increase
from the inlet to the outlet.
The graphical results reported in the paper show a head loss at all flow rates. We can (correctly) infer
that the researcher has already accounted for static head before reporting the results. The experimental
results reported are purely a function of the inlet and outlet pressures in the absence of gravity. They
would be equally valid for horizontal flow through the same media. Therefore do not use Gravity and
Non-Inertial Reference Frame physics.
SURFACE TENSION
The Surface Tension physics model is never active inside porous media components, since surface
tension effects are included empirically in the Porous Media physics, including capillary action. Surface
Tension physics can be used outside of porous media where there are free-surfaces. Since there is no
free surface in the model, do not use Surface Tension physics.
Page 3 of 19
where is the fluid density, is the fluid dynamic viscosity, Dp is the characteristic pore diameter, and
Up is the mean microscopic (or pore) velocity of the fluid. Microscopic velocity is almost never measured
Page 4 of 19
directly due to the difficulty of inserting probes between grains. Instead, macroscopic (or superficial)
velocity Umacro is measured as the transit time across the media, neglecting tortuosity. Macroscopic and
microscopic velocities are theoretically related by the media effective porosity:
where eff is the average effective porosity. Effective porosity is the porosity that is available for flow,
and excludes pores that cannot be filled or drained. In a completely saturated loose media eff can be
assumed to be the same as bulk porosity (0.50 in this case).
The experimental velocity given in the paper is superficial velocity Umacro (range 0.001 0.020 m/s). Use
porosity to convert to macroscopic velocity to microscopic velocity, and then find the pore Reynolds
number for each velocity assuming the pore diameter Dp is equal to the average grain diameter (1 mm):
EXPERIMENTAL
SUPERFICIAL
VELOCITY
Umacro
(m/s)
0.001
0.002
0.003
0.004
0.005
0.006
0.007
0.008
0.009
0.010
0.011
0.012
0.013
0.014
0.015
0.016
0.017
0.018
0.019
0.020
CALCULATED
MICROSCOPIC
VELOCITY
Up = Umacro/eff
(m/s)
0.002
0.004
0.006
0.008
0.010
0.012
0.014
0.016
0.018
0.020
0.022
0.024
0.026
0.028
0.030
0.032
0.034
0.036
0.038
0.040
CALCULATED
PORE
REYNOLDS #
ReP
(dimless)
2.0
4.0
5.9
7.9
9.9
11.9
13.9
15.8
17.8
19.8
21.8
23.8
25.7
27.7
29.7
31.7
33.7
35.7
37.6
39.6
Page 5 of 19
where K1 is the medias experimental DArcian permeability and K2 is the coefficient of non-DArcian
permeability. P/x is the pressure loss per unit distance traveled superficially, is fluid density, and is
the fluid dynamic viscosity. Of the three saturated porous drag models, only Permeability-Dependent
Saturated Drag is written in terms of macroscopic velocity Umacro; the rest use pore velocity UP.
To use the relationship above, the experimental head loss H needs to be converted to pressure loss P.
They are related by density and gravity g:
Figure 2 and Table 2, below, show the experimental head loss data (H/x), digitized using EnGauge
freeware, and the calculation of unit pressure loss (P/x) for use in the coefficient fitting equations.
Page 6 of 19
MICRO.
VELOCITY
Up = Umacro/eff
(m/s)
0.000
0.002
0.004
0.006
0.008
0.010
0.012
0.014
0.016
0.018
0.020
0.022
0.024
0.026
0.028
0.030
0.032
0.034
0.036
0.038
0.040
PORE
REYNOLDS
ReP
(dimless)
0.0
2.0
4.0
5.9
7.9
9.9
11.9
13.9
15.8
17.8
19.8
21.8
23.8
25.7
27.7
29.7
31.7
33.7
35.7
37.6
39.6
HEAD
LOSS
(H/x)
(m/m)
0.000
0.048
0.089
0.189
0.215
0.267
0.315
0.390
0.482
0.564
0.631
0.720
0.809
0.902
0.991
0.991
1.191
1.314
1.496
1.588
1.607
PRESS.
LOSS
(P/x)
(Pa/m)
0
472
872
1,853
2,108
2,617
3,089
3,816
4,725
5,524
6,178
7,050
7,923
8,831
9,704
9,704
11,666
12,865
14,646
15,555
15,736
Fit literature drag coefficients from empirical relations to the superficial equation, or
Fit case-specific experimental data to the superficial equation.
The second option is always a better choice when case-specific data exists. Compare the coefficients
from both options:
Empirical Correlations Without Experimental Data
The Ergun (1952) equation for packed spheres and a relation for crushed angular materials (sand) by
Idelchik (1986) are plotted below along with the experimental data.
Page 7 of 19
A and B are coefficients fitted to the experimental data. Use a statistics package or a spreadsheet
program to fit a 2nd order polynomial trend line to the experimental data. This gives a well-fit
correlation as shown below.
Page 8 of 19
And then solve for K1 and K2 using the known fluid density and viscosity:
K1 = /A = 2.3715E-9
K2 = /B = 5.1084E-5
Page 9 of 19
Problem Specification
Set up the problem following the model specifications below:
General and Numeric Tab Options
o Simulation name: Saturated Porous
o Simulation units UNITS = SI
o Simulation time TWFIN = 3598 seconds
o Number of processors NPROC = 2
o Initial time step DELT = 0.001 sec
o Minimum number of pressure iterations ITMIN = 2
o Maximum number of pressure iterations ITMAX = 500
o GMRES subspace size MRSTRT = 25
Physics
o Porous Media - Permeability Dependent Saturated Drag
o Viscosity & Turbulence
Viscous Flow
RNG Turbulence with Dynamically-Computed TLEN
Fluid Properties (Water, measured experimentally @ 24 26 C)
o Density = 998.2 kg/m3
o Viscosity = 0.001008 Pa-s (i.e. kg/m/s)
o Compressibility = 1/( W2) = 4.55E-10 (assume speed of sound W 1483 m/s)
Output
o Selected data at default 1% time intervals
Drag Function
Fluid Velocities
Pressure
Geometry
o 1 Subcomponent
Shape = Cylinder
Name = Packed Bed
Radius = 0.12 m
Z Low = 0.0 m
Z High = 0.3 m
Axis along origin
o 1 Component
Name = Packed Bed
Component Type = Porous
o Properties (Component Properties > Porous Properties)
Porosity = 0.5
Darcian Permeability = 2.3715E-9
Non-Darcian Permeability = 5.1084E-5
Problem specification is continued on the next page:
Page 10 of 19
Mesh Specifications
o Cylindrical (right-click on Mesh-Cartesian and select Change to Cylindrical Coordinates)
o 2-D Mesh Block
o Domain
X (r) = 0 m to 0.12 m ----------------- # Total Cells = 5
Y() = 0 degrees to 30 degrees --- # Total Cells = 1
Z (z) = -0.012 m to 0.312 m -------- # Total Cells = 20
Boundary Conditions
o X Min: Symmetry (S) (r = 0 is a discontinuity, and should always be symmetry)
o X Max: Wall (W)
o Y Min & Y Max: Periodic (Pd) (flow can rotate out one side and back in the other)
o Z Min: Gauge Stagnation Pressure (P)
F=1
P = 0 Pa
o Z Max: Velocity (V)
varies with time: import velocities & times from a .csv file (described below)
Initial Conditions
o Global > Fluid Initialization = Use Fluid Elevation.
o Initial Fluid Elevation = 0.312 m.
Page 11 of 19
0.300
0.324
2
m
m
SUPER.
FRONT EST. STDY TOTAL
VELOCITY TRANSIT
STATE
TIME
Umacro
tfront
tsteady,est.
ttotal
(m/s)
(s)
(s)
(s)
0.020
0
0.020
25
50
50
0.019
26
53
103
0.018
28
56
158
0.017
29
59
217
0.016
31
63
280
0.015
33
67
346
0.014
36
71
418
0.013
38
77
495
0.012
42
83
578
0.011
45
91
669
0.010
50
100
769
0.009
56
111
880
0.008
63
125
1,005
0.007
71
143
1,148
0.006
83
167
1,314
0.005
100
200
1,514
0.004
125
250
1,764
0.003
167
333
2,098
0.002
250
500
2,598
0.001
500
1,000
3,598
Table 3: Determining runtime of each velocity for the boundary profile
This is the basis for the Finish Time that was given above. FLOW-3D interpolates linearly between
tabular data points. Given the above table, FLOW-3D will generate an inflow velocity profile that looks
like Figure 6 below:
Page 12 of 19
Page 13 of 19
have only one associated value. The steps will cause rapid change at the inlet boundary condition, a
known cause of pressure problems! This is why increased pressure solver overhead was specified above.
Generate a table in a spreadsheet program, starting with the fastest velocity and working down, with a
header row, and save it as a .csv file. Note the negative values mean the velocity vector is pointing
toward the z-min boundary.
TIME
0
49
50
102
103
157
158
216
217
279
280
345
346
417
418
494
495
577
578
668
669
768
769
879
880
1,004
1,005
1,147
1,148
1,313
1,314
1,513
1,514
1,763
1,764
2,097
2,098
2,597
2,598
3,597
W
-0.020
-0.020
-0.019
-0.019
-0.018
-0.018
-0.017
-0.017
-0.016
-0.016
-0.015
-0.015
-0.014
-0.014
-0.013
-0.013
-0.012
-0.012
-0.011
-0.011
-0.010
-0.010
-0.009
-0.009
-0.008
-0.008
-0.007
-0.007
-0.006
-0.006
-0.005
-0.005
-0.004
-0.004
-0.003
-0.003
-0.002
-0.002
-0.001
-0.001
Page 14 of 19
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
Page 15 of 19
Page 16 of 19
Using what you already know, Open the results file and analyze the flow in 2-D.
Plot Pressure and Plain Velocity Vectors.
Turn off Contour Smoothing.
Make sure youre plotting with SI units.
Check your work against the final time step shown below.
Figure 10: Pressure drop (Pa) across porous media at t = 3598 sec
Page 17 of 19
Page 18 of 19
References
Abbood, D.W. 2009. An Experimental Model for Flow Through Porous Media Using Water Filter.
Proc. 13th International Water Technology Conference: Hurghada, Egypt.
Bejan, A. & D. Nield. 2006. Convection in Porous Media, 3rd Ed. New York, NY: Springer
Science+Business Media.
Ergun, S. 1952. Fluid flow through packed columns. Chem Engrg. Prog. 48, 89-94.
Flow Science. 2009. FLOW-3D v9.4 User Manual. Santa Fe, NM: Flow Science Inc.
Freeze, R.A. & J.A. Cherry. 1979. Groundwater. Englewood Cliffs, NJ: Prentice-Hall.
Idelchik, I.E. 1986. Handbook of Hydraulic Resistance. New York, NY: Hemisphere Publishing Corp.
Irmay, S. 1958. On the theoretical derivation of Darcy and Forchheimer formulas. Eos, Trans. AGU 39,
702-707.
Masch, F.D. & K.J. Denny. 1966. Grain size distribution and its effects on the permeability of
unconsolidated sands. Water Resour. Res. 2, 665-677.
Page 19 of 19
Point clouds are one of the most common ways that topographic data is recorded. Each point is a
measurement of surface location, defined by three coordinates in some reference system:
latitude/longitude/elevation, for example. The raw point data may be digitized from contour maps,
exported from GIS (geographical information system) software, or may be the output of LiDAR (Light
Detection and Ranging), TLS (terrestrial laser scanning), or satellite profiling equipment.
Stereolithography file format (.stl) is a non-proprietary system for recording 3-D surfaces.
The format is raw and unstructured, meaning that the elements of the surface can be
recorded in any order. The surface elements are triangles (called facets) composed of three
points and a normal vector pointing away from the surface. The points and vectors are
recorded in Cartesian coordinates. The .stl file format may be either binary (smaller file
size) or ASCII (readable in text editors); see Appendix A for the format definitions. FLOW3D uses .stl files as inputs to define complex geometry and as outputs to describe resolved
fluid and solid surfaces.
This exercise introduces FLOW-3Ds TOPO2STL utility for creating .stl parts from large
point clouds. No single program is ideal for converting large surface point sets to 3-D
geometry, so a method is presented here that combines freeware utilities with TOPO2STL
to get excellent results. Freeware tools introduced in this exercise include VIM, MeshLab,
CloudCompare, Admesh, and netfabb Basic.
Page 1 of 26
a. Create a space-delimited ASCII text file with one coordinate per line and no headers.
Each line must contain three numbers, separated by spaces, so that the first number is
the X coordinate, the second number is the Y coordinate, and the third number is the Z
(elevation) coordinate. The coordinate units must all be the same (e.g., feet or meters).
b. Visualize and check the data. The first test of the raw data is visual examination. Look
for outlying points, strange stretching (indicating that units are not the same), noise,
and other problems. Locate the minimum and maximum extents of the raw data.
c. Clean the data by manually removing artifacts. The most common artifacts are people
and equipment that are picked up by the recorder and outlying points that are added
inadvertently (usually when filtering the data with software).
d. Fill in surface elevations for absent data. Many point sets only include data in a region of
interest (like a river bed). The areas outside of this region are blank: there is no data
there. These outlying regions should be filled in with a uniform surface elevation, usually
one that is higher than the any of the known data. This optional step is highly
recommended because it speeds up the .stl conversion by a factor of 100-plus, and
because it produces better output with fewer artifacts (Figure 1 below).
e. Pre-decimate (subsample) the point data. This is an optional step that reduces the
number of points in the data set. The benefits of pre-decimating include more accurate
.stl surfaces, faster conversion times, and more reliable results when using software
post-condition the data. TOPO2STL also subsamples the data during the conversion, so
the purpose of this step is to prepare the data by making it more uniform. Its important
to use subsampling algorithms that preserve the data integrity (i.e., that dont create
new points) and that evenly distribute points (e.g., that dont cause higher point density
near contour lines).
Figure 1. 1-inch resolution .stls with (right) and without (left) data pre-conditioning
Page 2 of 26
Page 3 of 26
panel. Note there that the file has 15,010,488 points. Save the highlighted cloud as
MiddleRioGrande_CCtxt.xyz.
b. Use MeshLab to import and re-export the data: MeshLab is a powerful and free opensource tool for working with meshes and point clouds. There are many ways to use
MeshLab with point clouds and .stl files, a few of which will be detailed below. MeshLab
can be downloaded from meshlab.sourceforge.net. It is not as user-friendly as
CloudCompare, and Mr. Ps tutorials (www.youtube.com/user/mrpmeshlabtutorials)
are highly recommended when you are ready to learn more.
First make a copy of MiddleRioGrande.txt and rename it MiddleRioGrande.asc. Open
MeshLab and select File > Import Mesh. Set the file format type to ASC (ascii triplets of
points) and open MiddleRioGrande.asc. Set Header Row to be Skipped = 2 (per what
you saw in CloudCompare) and deselect Grid Triangulation, because this import filter
wont work with non-uniform point distributions. Select OK to begin importing the data.
The progress bar at the bottom will fill several times as various importation steps are
completed. Note at the bottom of the screen that the number of vertices (points) is
15,010,488, as before.
Importing the data as file type .asc works correctly but importing as .xyz type produces
an incorrect extra point at coordinates 0, 0, 0 at the beginning of the file. This is because
the .xyz format cannot contain headers and there is no option to skip initial lines.
MeshLab has a lot of little quirks like this.
Select File > Export Mesh As, set Files of Type = XYZ Point Cloud, and name the file
MiddleRioGrande_MLASCtxt.xyz. Click Save and on the next dialog deselect Normal so
that the file saves with only three coordinate values per line (instead of six).
All algorithms have the potential to produce noise or error in the results. Converting the data
with several methods and comparing the results is recommended. Comparing the files:
CLEANING METHOD
NUMBER OF POINTS
DIFFERENCE IN COORDINATE
(OUTPUT IS .XYZ FORMAT) (15,010,488 IN ORIGINAL)
VALUES FROM ORIGINALS
CloudCompare .txt import
15,010,488
+/- 3E-6 feet (< 1 micrometer, m)
MeshLab .asc import
15,010,488
+/- 2E-6 feet (< 1 micrometer, m)
15,010,489
(excluding the extra point)
MeshLab .xyz import
(adds point at 0,0,0)
Table 1. Comparison of cleaning methods for MiddleRioGrande.txt
The precision loss is due to rounding of large numbers. Few data sets require micrometer
precision, so the formatting method will usually depend on factors like file size, data column
order, and type(s) of bad values that must be removed. This particular data set contains a highly
precise measurement record. Though it will have negligible effects on modeling results, the
Page 5 of 26
cleaned file with the least introduced error should be used. The remainder of the exercise will
use MiddleRioGrande_MLASCtxt.xyz.
2) Visualize and check the data. The next step is checking that the topography looks right, locating
any bad data points, and making note of the minimum and maximum data extents. Two
methods are introduced.
a. Open and view the point cloud in MeshLab. Select File > Import Mesh and load
MiddleRioGrande_MLASCtxt.xyz. Select Render > Render Mode > Points from the
menus or
b. Color the points by elevation. Select Filters > Quality Measure and Computations > Per
Vertex Quality Function. Set func q = -z (you may have to use the Tab key to gain access
to the input box), and activate map into color. Click Apply. Select Render > Color > Per
Vertex from the menu bar to display the colored results.
Page 6 of 26
on the Standard
Matrix to actually change the point coordinates. Apply the filter, and then set the Z-Axis
= 0 again so the grid doesnt rise another 99.3 feet next time you click Apply. Enter Xaxis = 1 for translation and repeatedly click Apply until the grid has shifted so that it just
encloses the point cloud extents. Set X-axis = 0 and repeat the process for Y-axis. The
plane should overlap the original data with a small margin on all sides.
d. Color the layer. Assign a per-vertex attribute = z on Filters > Quality Measure and
Computations > Per Vertex Quality Function and manually equalize the colors with
Filters > Color Creation and Processing > Colorize by Vertex Quality to Min = -99.3 and
Max = -97.2. Check that the new grid color is red, meaning it is higher than the
maximum elevation of the original data.
e. Remove the plane vertices that overlap the point cloud edges. Select the original point
cloud topography layer and apply Filters > Selection > Select All. Then select Filters >
Sampling > Vertex Attribute Transfer. Make sure the source mesh is the point cloud
and the target mesh is the new plane. Deselect all default attributes and select Transfer
Selection. Set Max Search Distance = 0.5 (absolute world units). Apply then Close the
filter. Hide the point cloud layer, select the plane layer, and delete the vertices that
have been selected with the Delete Current Set of Selected Vertices
Figure 7 below).
tool (see
Figure 7. Delete points in the new plane that are within 0.5 feet of the river data
f.
Remove the plane vertices that overlap the point cloud center. Keep the original data
hidden and turn off the coloring by selecting Render > Color > None. Activate the Select
Vertexes on a Plane tool
and roll the mouse-wheel to set the HopThru size to less
than 0.5. Hold Control and click-drag the mouse to add and size selections. Select and
delete all of the points inside the originally-scanned data area. Use the Select Vertexes
tool
where necessary to make sharp edges in the selection and manually clean up
any points that escape the first attempt (see Figure 8 below). Check your work by
showing both layers together and individually (see Figure 9 below). Export the final
plane in .xyz format with no normals in case MeshLab crashes during the next step.
Page 9 of 26
Figure 8. Select and delete remaining plane points that overlap river data
Page 10 of 26
a. Apply Filters > Sampling > Poisson-disk Sampling. Activate Base Mesh Subsampling
(very important) and select Explicit Radius (absolute world unit) = 0.0833 for 1-inch
samples. Export the subsampled mesh with no normals as
MiddleRioGrande_MLASCtxt_clean_fill_PDSub0833.xyz.
Figure 10. Subsampling. Left: original point cloud. Middle: 1-inch clustered vertex subsampling
(emphasizes 1-inch contour lines). Right: recommended 1-inch Poisson-disk subsampling
6) Use the TOPO2STL utility to convert to.stl. Download TOPO2STL from the Utilities section at
users.flow3d.com. Uncompress it and run Topo2STL.exe to launch the file selector. Browse and
pick MiddleRioGrande_MLASCtxt_clean_fill_PDSub0833.xyz. The file will take several minutes to
load. Check that the Data Size (point count) reported is about 870,000 points.
a. Set point-sampling stencil. Set Spatial Resolution = 0.0833 feet. Very large .stl files that
exceed the available graphics card memory will not load in the FLOW-3D interface,
although they can be added manually to prepin files that are run from the command
line. The spatial resolution selection directly affects the file size. Post-conditioning can
reduce the output file size.
b. Estimate the total number of surface points. Find the number of points TOPO2STL will
either retain or create by multiplying the data extents in X and Y (60 x 180 = 1800 ft2)
Page 11 of 26
and dividing by the spatial resolution squared (0.08332) to get the approximate total
number of points (1.6 million). A good rule of thumb is that .stl output files are about 1
GB for every 11 million points (including converting the output to binary .stl format).
c. Other conversion settings. Set STL Minimum Z-Coordinate = 90 ft. Set the name of the
output file as MiddleRioGrande_MLASCtxt_clean_fill_PDSub0833_T2STL0833.stl.
d. Generate the .stl. Click Convert to begin. Table 3 shows the conversion time for various
spatial resolutions, with and without pre-conditioning the data set. Adding planar data
to blank regions speeds up the conversion by a factor of 50 to 100. Pre-decimating the
data set after filling in the empty regions gives additional speed improvements.
POINT
SPACING FOR
MESHLAB
PREDECIMATION
& TOPO2STL
SAMPLING
7) Fix the output and convert it to binary format. All automated triangulation algorithms create
minor errors: disconnected edges between triangles, missing triangles (holes), and reversed or
incorrectly-computed facet normal vectors. These errors can cause bad pressure and velocity
solutions in FLOW-3D. Additionally, TOPO2STLs ASCII output is five times larger than binary
format. Fixing and converting the format of the .stl is always required. Three methods of fixing
Page 12 of 26
and converting the part are demonstrated here; the third also introduces post-conversion
simplification of unnecessary surfaces. The three methods use the free programs qAdmesh,
netfabb Basic, and MeshLab.
a. Use qAdmesh for repair & format conversion. This software is a user-interface for the
free command-line program Admesh. It comes bundled with FLOW-3D. Source code and
theory for Admesh are available at
https://sites.google.com/a/varlog.com/www/admesh-htm. Launch qAdmesh from
FLOW-3D by navigating to the Model Setup > Meshing & Geometry tab and selecting
Tools > qAdmesh from the menu above the viewing pane. Select Browse under Input
and load MiddleRioGrande_MLASCtxt_clean_fill_PDSub0833_T2STL0833.stl. Set the
Output type = Binary STL, and name the output file
MiddleRioGrande_MLASCtxt_clean_fill_PDSub0833_T2STL0833_admesh.stl. Select
Default check, and click Apply.
The results are given as text output: qAdmesh identifies about 5,400 facets with
disconnected edges, about 2.73 million incorrect normal vectors, and two identified
surface shells (which are called parts in qAdmesh).
Run qAdmesh again on the fixed output until no more changes are made to make sure
that the part is repairable. Notice that the repaired part still has 2 shells. This is not
ideal, but since the parts are fully closed and have no inverted normals it should not
affect the FLOW-3D model.
b. Use netfabb Basic for repair & format conversion. This free software can be
downloaded from http://www.netfabb.com/basic.php. It includes visualization, manual
and automatic analysis and repair, and other options.
Select Project > Add Part and load the ASCII TOPO2STL output file
MiddleRioGrande_MLASCtxt_clean_fill_PDSub0833_T2STL0833.stl. The entire part is
selected so all faces are green. Clicking anywhere except on the part will deselect it. Reselect the part by clicking on it or selecting it in the Parts tree at upper right, which
works much like the layers in MeshLab. Use the eye logo
Notice the warning label
detectable problems.
unclosed edges reported by qAdmesh. Note that netfabb does not report incorrect
normal vectors like qAdmesh, but it does correct them automatically.
Page 14 of 26
Choose Part > Export Part > As STL to save the repaired geometry in binary format.
Name the part
MiddleRioGrande_MLASCtxt_clean_fill_PDSub0833_T2STL0833_netfabb.stl. The binary
file size will always be about 81.5% smaller than the ASCII file size. Re-check it with
qAdmesh and verify there are no artifacts.
c. Use MeshLab for simplification, repair, and format conversion. MeshLab can be used to
reduce the size of .stl files, which is particularly important for those created with a fine
resolution. The goal is to reduce the file size without simplifying the data in the region of
interest. The way to do this is to recombine and simplify only the facets of the
surrounding box.
Import MiddleRioGrande_MLASCtxt_clean_fill_PDSub0833_T2STL0833.stl into MeshLab.
Choose Unify Duplicated Vertices during import.
Select only the non-river plane faces using Filters > Selection > Conditional Vertex
Selection, with Boolean function = (z > 99.298) or (z < 97) (see Table 2). Note that or
must be in lowercase. Activate Strict Face Selection to avoid picking up any river data.
Once the non-river surfaces are selected, apply Filters > Remeshing, Simplification and
Reconstruction > Quadric Edge Collapse Decimation with the following options: Target
Number of Faces = 100000, Quality Threshold = 0.3, Preserve Boundaries of the Mesh
(Boundary Preserving Weight = 10), Preserve Normal, Preserve Topology, Planar
Simplification, Post-Simplification Cleaning, and Simplify Only Selected Faces which is
very important to avoid simplifying the river! Check that the non-river facets have been
simplified as in Figure 12 below. Export the simplified part in Binary Format as
MiddleRioGrande_MLASCtxt_clean_fill_PDSub0833_T2STL0833_MLquad.stl.
Apply Filters > Selection > Select None to deselect the faces. Select Filters > Quality
Measure and Computations > Compute Topological Measures. The Layers dialog lists
the text results. There are a number of boundary edges (meaning the part is not closed),
non-manifold vertices, and incident faces.
Activate Render > Show Non Manif Edges and Render > Show Non Manif Vertices to
visualize where the problems are. They are at the four lower corners of the box.
Page 16 of 26
tool dialog. If there were many trivial holes, re-export the mesh in case MeshLab
crashes later.
Now select the big hole, this time using the Self Intersection repair option. Click Fill,
wait, and then click Accept. MeshLab will start to close the hole and incorrectly report
that there are no more holes to fill. Ignore this message (click OK to close it) and repeat
the process by re-launching the
tool. Keep selecting, filling, accepting and relaunching the tool until no more holes are reported when the tool starts. The bottom of
the part should now be closed (Figure 14 below). Export the part, and check Compute
Topological Measures again: there should be no boundary or non-manifold edges. The
part should be two-manifold and composed of a single component.
Figure 14. .stl bottom before (left) and after (right) removing non-manifold vertices and filling holes
Finally, apply Filters > Normals, Curvatures and Orientation > Recompute Face Normals
and then Filters > Normals, Curvatures and Orientation > Normalize Face Normals.
Export the part and check it with netfabb Basic (no errors detected) and qAdmesh
(about 5,400 bad normals detected). Fix the normals with qAdmesh and save the
output. Re-check the output with netfabb Basic and qAdmesh: both programs should
agree that the part is fixed.
The three repair methods introduced above are compared in Tables 4 and 5 below. The
MeshLab simplification and repair procedure with qAdmesh finishing is recommended for
general use because it can be performed on parts that are too detailed to load with the other
methods, and it further reduces the final .stl file size.
Page 17 of 26
SPATIAL
RESOLUTION
-inch
(0.0208 feet)
qAdmesh repair
qAdmesh repair
8) Check the output (quality control). The final step is to visually and numerically compare the
repaired .stl to the original artifact-clean point cloud to determine if the conversion process was
accurate.
a. Load the comparison data. Open CloudCompare and load
MiddleRioGrande_MLASCtxt_clean.xyz (set file type to ASCII) and
MiddleRioGrande_MLASCtxt_clean_fill_PDSub0833_T2STL0833_netfabb.stl (file type
STL).
b. Get preliminary comparison statistics. Hold Control + left-click to select both Cloud and
Mesh entities in the DB Tree. Select Tools > Distances > Cloud/Mesh Dist
. The
dialog that opens lists Approximate Results for the distance magnitudes between
original points and the nearest .stl facets. It will shortly be demonstrated that these
values are incorrect. The estimate of Max Relative Error gives the likely error of the
distance results themselves as a function of the distance d between any point and the
.stl. The Approximate Results are chamfer distances and not reliable for small d
(Girardeau-Montaut et al. 2012).
c. Get precise magnitude statistics and map them into color. Locate the Precise Results
section. For best accuracy, set Octree Depth = 9 or 10. Deactivate Signed Distances and
click Compute. After the calculation is complete click OK to exit the dialog and map the
point results into a scalar field.
Find the text Console panel at the bottom of the screen (press F8 to toggle it). The text
output gives a new estimate of the mean and standard deviation : about 0.01 feet (3
mm) for both. The mean unsigned error is referred to as the Mean Absolute Error (MAE).
d. Find the maximum error magnitude. The min and max SF scale slider values are the
minimum and maximum error magnitudes. In this case |E|MIN = 0 and |E|MAX = 0.242
feet 7 cm. The real maximum error is much smaller than was reported by the
Approximate Results.
In the DB Tree, un-check the Mesh part to hide it and then select the Cloud entity. Check
that Current Scalar Field = C2M Distances in the Properties panel. Activate Display Color
Scale under SF Scale. Under SF Scale, slide the displayed minimum slider all the way to
the right (or set the minimum value box to the same as the maximum). This makes all
values less than the maximum render as gray, and values equal to the maximum will be
displayed as red. Deselect NaN in grey to hide the non-maximum points. Move the
mouse near the upper-left of the display window to display Point Size options. Toggle
the Mesh display under DB Tree, rotate, pan, and zoom the view, and increase Point
Page 19 of 26
Size (+) until you locate the point of greatest error. Reactivate the Mesh entity to see
the .stl.
Figure 15. Maximum error between .stl and point cloud is high on a steep bank slope
e. Visualize the error magnitude. Reset the displayed sliders to the minimum and
maximum permissible (check that they match the color saturation slider values). Set the
color saturation maximum slider value box = 0.06 feet. Now all error magnitudes larger
than about 1.8 cm appear in red, illustrating the regions of greater error. As visible in
Figure 16 below, there are also some red areas that appear to be electrical cable for the
ground-based LiDAR camera and that were not included in the point cloud. From this
visualization it is clear that the majority of the error magnitudes are much less than 0.03
feet (less than 1 cm).
Figure 16. Visualization of error magnitude with blue = 0 and red = 0.06 feet.
f.
Visualize the error magnitude distribution. Select Tools > Statistics > Compute Stat.
Params, and set Distribution = Gauss to compare the actual error magnitudes to a
normal distribution. The resulting histogram contains all the information that has
already been determined: the maximum and minimum errors are the ends of the
abscissa, and the mean and standard deviation are summarized (and rounded) above
the chart. More significant figures can be displayed in the Settings options.
Page 20 of 26
The white line represents a normal distribution (based on the mean and standard
deviation). The normal distribution is not a good fit! Repeat the process and select
Weibull as the distribution type. The Weibull distribution is a good fit to the error
magnitudes. The curve parameters are given above the chart. Results should look like
Figure 17. The error mean and deviation should be reported in terms of these unsigned
values. The Console (F8 to toggle) gives a Chi-squared (2) test for each fit.
Figure 17. Statistical fitting of the error magnitude distribution: normal (left) and Weibull (right)
g. Visualize the signed error distribution. Select both the cloud and .stl layers, and re-run
the Tools > Distances > Cloud/Mesh Dist tool. Activate Signed Distances under Precise
Results and Compute the error to map it into the scalar field of the point cloud. Select
the point cloud layer and run the Tools > Statistics > Compute Stat. Params tool first for
Distribution = Gauss and then for Weibull. The results are shown in Figure 18. Its clear
from these and the 2 tests that the signed error is uniformly distributed about the
mean and that the .stl surface error (relative to the point cloud) is nearly unbiased
(neither higher nor lower on average).
Figure 18. Statistical fitting of the signed error distribution: normal (left) and Weibull (right)
Page 21 of 26
Table 6 below shows comparative mean error magnitude (MAE) results for various sampling
spacing and pre-conditioning approaches. The 3 repair methods described in Tables 4 & 5 gave
identical statistics (within 0.3 m) for each method and spacing, so the results shown in Table 6
are true for all repair methods, regardless of how many shells the method produced.
POINT
POINT CLOUD TO .STL DISTANCE MAGNITUDE (FEET)
SPACING FOR RAW DATA SET:
CLEANED DATA CLEANED DATA SET
MESHLAB NOT CLEANED, NOT SET WITH EMPTY
WITH EMPTY
PREPRE-FILLED, NOT
REGIONS PRE- REGIONS PRE-FILLED
DECIMATION
DECIMATED
FILLED, NOT PRE- & POISSON-DISK PRE& TOPO2STL
DECIMATED
DECIMATION TO
SAMPLING
TARGET TOPO2STL
SPACING
-inch
TOPO2STL could not Max: 0.247521
Max: 0.146637
(0.0208 feet) convert the raw data Mean: 0.004533
Mean: 0.004532
within 4 days
: 0.004472
: 0.004175
-inch
MeshLab could not Max: 0.307642
Max: 0.200105
(0.0416 feet) simplify non-river Mean: 0.006653
Mean: 0.006409
facets in 12 hours
: 0.006960
: 0.006309
1-inch
Max: 0.33902451 Max: 0.324913
Max: 0.242234
(0.0833 feet) Mean: 0.010307 Mean: 0.010395
Mean: 0.009717
: 0.012193
: 0.012463
: 0.010644
2-inch
Max: 0.383123
Max: 0.379844
Max: 0.316623
(0.1666 feet) Mean: 0.016889 Mean: 0.017011
Mean: 0.016472
: 0.023922
: 0.023929
: 0.019153
Table 6. Quality Control statistics for different conversion methods and spacing
Page 22 of 26
REFERENCES
1. Girardeau-Montaut, D., Bey, A., and Marc, R. (2012). CloudCompare Users Manual for Version
2.1. Le Faive, R., translator. http://www.danielgm.net/cc/, retrieved 3/7/2013.
2. Merriam-Webster (2013). topography. http://www.merriam-webster.com, retrieved
3/7/2013.
3. Willmott, C.J., Ackleson, S.G., Davis, R.E., Feddema, J.J., Klink, K.M., Legates, D.R., ODonnell, J.,
and Rowe, C.M. (1985). Statistics for the Evaluation and Comparison of Models. Journal of
Geophysical Research 90(C5): 8995-9005.
Page 23 of 26
Page 24 of 26
PROGRAM
Sublime Text 2
TextPad 6
ConTEXT 0.98.6
PilotEdit Lite
Notepad++ 5.9.8
CONVERTS TAB
TO SPACE IN
445 MB FILE1,2
INCLUDES
COLUMN
EDIT MODE
FREEWARE
?
NO. Uses 4 GB
memory. Does
not complete
within 1 hour.
NO. Unreliable.
Requires
multiple tries.
YES. Total time
about 3
minutes.
LIMITED.
Large column
operations
fail.
YES.
NO.
LIMITED.
Requires text
commands.
YES.
YES.
NO. Available
in EditPad
Pro only.
YES.
MAYBE.
Free for
noncommercia
l use only.
YES.
YES.
YES.
YES.
YES.
YES.
YES. Loads
YES. Converts
whole file into some
memory.
characters.
YES. Becomes briefly
unresponsive during scrolling
operations due to piecewise
loading method.
NO. Out-of-memory error.
YES.
NO. Location is NO. Uses all
loaded
available
unreliably:
memory. Does
final line #
not complete
changes on
within hour.
separate tests.
NO. Out-of-memory error.
YES. Loads entire file into
NO. Does not
memory.
complete
YES (loads into memory first).
within hour.
YES. Loads
NO. Uses 1 GB of memory, then
entire file into crashes.
memory.
Table B-1. Comparison of eight text editors
NO.
Notes:
1) Tested on Intel Core i7-3930K 3.20 GHz CPU w/ 16.0 GB RAM, Windows 7 Professional 64-bit OS
2) MiddleRioGrande.txt, courtesy of Colorado State University and US Bureau of Reclamation.
3) Enwiki9.txt, courtesy of Matt Mahoney and the Large Text Compression Benchmark project
(http://mattmahoney.net/dc/text.html, accessed Nov 19, 2012).
Page 25 of 26
Left click and drag to rotate the part and coordinate system around the trackball center.
Mouse wheel to move the part and coordinate system along line of sight relative to the trackball.
Center mouse button and drag to pan the part and coordinate system.
Shift+mouse wheel to change camera field-of-view.
Control + mouse wheel to move near clipping plane.
Control + Shift + mouse wheel to move far clipping plane.
Double-left-click to place the trackball center at the clicked-on point.
Alt + Enter to enter full screen mode.
Control+Shift+left mouse button and drag to change lighting direction (only if there are normals).
Left-click and drag to draw a box and select all faces or vertices in it (even those behind surfaces).
Alt+left click and drag to select only visible faces or vertices in the box.
Ctrl+left click and drag to add the faces or vertices in the box to the already-selected group.
Shift+left click and drag to remove the faces or vertices in the box from the already-selected group.
Ctrl+Alt+left click and drag to add only visible faces in the box to the group.
Shift+Alt+left click and drag to remove only visible faces in the box from the group.
Esc to toggle between navigation mode and the selection tool.
Important considerations
The trackball is the point about which the coordinate system (and part) rotates and moves.
There is no undo function: after every major processing step, export the mesh with a new filename.
Some filters are less stable: most do better with a few million points or less. Consider subsampling.
The MeshLab project file (.mlp) file records mesh file path, transformation, & camera/lighting data.
The .mlp file stores no information about the points or faces. That data is stored in the mesh file.
The transformation matrix is a 4x4 record of movement (scaling, rotation, translation) of the mesh.
The Freeze Matrix option means that when the mesh is exported it will include the transformations.
Page 26 of 26
The TIG Extrude Tool plugin will come in handy later so you wont have to manually draw each .stl face.
Follow the steps below to install it.
1.
2.
3.
4.
5.
6.
7.
Figure 1. Install the TIG Extrude Tools v2.5 extension in SketchUp Make 2014
Page 1 of 11
Select File > Geo-Location > Add Location... or select the icon in the toolbar.
Search and/or Navigate to find your location of interest.
Click the Select Region button and drag the corner pins to enclose the area of interest.
Click the Grab button to lay the selected topography image on the SketchUp map.
Page 2 of 11
Page 3 of 11
Figure 5. Explode the terrain to create a triangulated surface from the terrain model in SketchUp.
Page 4 of 11
4. Click the background to deselect the triangulated surface. Then double-click the object to select it with
edges.
5. Select Extrude Edges by Vector from the Extrusion Tools toolbar.
6. Extrude in -z axis. You may need to move the mouse somewhat until it extrudes by the blue axis.
7. Click the Select arrow icon from the main toolbar and a dialog will appear.
8. The tool sometimes extrudes reversed faces. If the faces are reversed they will appear gray, as in
Figure 7. If they are reversed, select Yes. Otherwise select No.
9. Another dialog will appear asking whether to explode extruded faces. Select Yes.
Page 5 of 11
Figure 7. Extrude the surface downward following the blue (z) axis and check and fix reversed faces.
Page 6 of 11
10. Select Shapes > Rectangle and draw a large rectangle on the canvas to completely surround the
topography.
11. Click the Move tool icon and lower the plane so it cuts the extruded faces without cutting the surface.
Page 7 of 11
Page 8 of 11
12. Adjust the camera and make a selection that includes all the extruded faces and the rectangle.
13. Right-click the selection and select Intersect Faces > With Selection.
14. Draw a selection box to select the surfaces below the rectangle and Delete the extended surfaces,
including the rest of the rectangle that extends past the topography.
15. Select All ( Ctrl+A) and then right-click the selection and select Make Group from the context menu.
16. Select File > Export > 3D Model... to export the geometry file. Save the file as .obj or .3ds format.
Figure 10. Select extruded faces and the rectangular plane together.
Figure 11. Intersect the faces and then delete the unneeded bottom faces and rectangle sides.
Page 9 of 11
Page 10 of 11
Page 11 of 11
INTRODUCTION
This note outlines a method for converting large topographic data sets to .stl format for use with FLOW3D. This note builds on the exercise Creating .STL Files from Topography, available on the FLOW-3D
Users Site. Many of the methods in this note are described in more detail in that exercise. This note
adds instructions for data sets from the U.S. Geological Survey (USGS) National Elevation Dataset (NED).
The example describes converting an area of interest from 1/3-arc-second resolution USGS data in
ArcGrid format to DEM, point cloud, and finally .stl formats. The method can also be used to convert
GeoTIFF formats and floating point formats to .stl. This exercise uses open source freeware and FLOW3Ds TOPO2STL utility. There are many other possible workflows that involve 3rd-party commercial
software that may be faster or more reliable. The basic processes and principles will be the same
regardless of software.
contain the region of interest. For this case, the region of interest results in two compressed files, each a
1 degree-square (35 N and 119W through 120W), in 1/3 arc-second ArcGrid format. Unzip each file into
a new temporary working folder located on the root. Refer to http://ned.usgs.gov/Ned/faq.asp for
details on NED data, including formats, accuracy, and methods of collection.
Figure 2. Two USGS 1-degree tiles, converted to DEM with MicroDEM and FWTOOLS
MicroDEM has the option to simultaneously open & merge, but memory limitations in the executable
prevent this from being useful for large data sets. Select File > Save DEM > ASCII > ASCII XYZ (.xyz) and
the following options for each of the DEM files.
Use Edit > Scalar Fields > Filter by Value to create a new cloud with elevations above 570 m removed.
This is because the initial water level behind the St. Francis Dam was 559.4 m (1,835 ft) per Outland
(1963), as cited in Sanders (2007). Select the Segment tool
from the menu bar to cut out the region
of interest. The segmentation tool opens with a new toolbar. Use left-click to add a point to the
selection polygon and right-click to close the polygon. Select the
action to make the contents of the
selection polygon a separate point cloud. Edit the cutoff values in the Properties pane > SF Display
Params section to help visualize the elevation gradients. Select
to accept the new point cloud. Repeat
as necessary. The goal is to minimize the X and Y extents of the topography. Save the final point cloud.
Use Tools > Projection > Export Coordinate(s) to Scalar Field(s) > X,Y,Z to export the coordinates. Check
the extents in the Properties pane > SF Display Params section. Toggle between coordinates by changing
the Active dropdown selection in the Properties pane > Scalar Fields section. Calculate the required shift
values so that the number of significant digits is minimized, and all coordinates are positive.
Use Edit > Apply Transformation and enter the calculated values for the Tx and Ty entries in the
transformation matrix. This step permanently shifts the saved cloud coordinates. The FLOW-3D output
will need to be shifted back by the opposite sign of these values to get UTM coordinates. This approach
minimizes the effect of rounding error in the CFD calculations.
X (m)
288,889.7 to
365,560.8
-286,000.00
2889.7 to 79560.8
Y (m)
3787191.3 to
3826153.5
-3,780,000.00
7191.3 to 46153.5
76,671.1
38,962.2
Table 1. Translated Area of Interest
Z (m)
-0.167 to 570.000
0.00
-0.167 to 570.000
570.167
Page 6 of 16
Page 7 of 16
Figure 12. The final surface combines ocean, bounding box, and topography layers
Page 8 of 16
Binary-format .stl files have the identical data but are 5.42 times smaller than ASCII format:
The above estimates are accurate within 15% of the actual size. The file can be made smaller by
recombining facets to simplify the unused (planar) surfaces. The ratio between high-resolution
topography and the entire surface can be estimated by checking the number of points in each layer
during Step 4 above:
The file size reduction is a function of the area of the upper surface, the area of the bounding plane, and
the aggressiveness of the simplification algorithm. The simplified file size can be estimated from the
averages of past projects:
The estimate is usually within 20% of the actual size of the final, simplified, binary-format file.
Using these rules of thumb, the simplified size of the output file will be 141 MB with 30-m resolution
and 565 MB with 15-m resolution. 420 MB is the approximate maximum binary file size that can be
repaired with 32-bit STL tools like qAdmesh and netfabb Basic, so the 15-m resolution file will need to
be repaired with a 64-bit tool like MeshLab or a professional version of netfabb.
Page 9 of 16
Figure 16. Recombine the bounding surface facets to reduce them by 90%
Page 11 of 16
Figure 18. Select and close holes with fewer than 10 edge facets
Page 12 of 16
Figure 21. Fill holes and repair the .stl bottom with MeshLab
If a smaller .stl file size is desired, repeat Steps 7 through 9 until the desired size is achieved. Note that
too much simplification can make a watertight surface impossible.
Page 14 of 16
ERROR MAGNITUDE
STANDARD
MEAN
DEVIATION
2.44 m
~2.3 m
(RMSE) (1/2 95th percentile)
As of June 2003, the USGS NED data exhibits vertical uncertainty vs. the real world that is similar to the
uncertainty generated by converting the NED data to .stl format with 15-m spacing. For details of the
NED error estimation, see USGS (2006) Vertical Accuracy of the National Elevation Dataset, online as
of 04/29/2014 at http://ned.usgs.gov/documents/NED_Accuracy.pdf. The area of interest (the valleys
where the St. Francis flood occurred) has a very low error, as shown in Figure 23. The error magnitude
distribution is shown in Figure 24: it is best described as a Weibull distribution. The 15-m .stl file (Figure
25) shows the least error, and will be used in subsequent FLOW-3D simulations.
Figure 23. Original point cloud, colored by distance from 15-m resolution .stl surface
(blue = 0 m, red = 7.6 m i.e. mean + 2 standard deviations)
Page 15 of 16
Figure 24. Histogram of point-cloud to 15-m .stl facet error. Gray region is outside 2 standard deviations.
Page 16 of 16