Dam break, free surface
At the end of this you will have a transient two-phase run of a column of water collapsing under its own weight, with a tracked interface you can watch move, and an understanding of why a free-surface case has three time-step controls instead of one.
This needs a paid licence. Multiphase (VoF) is not one of the analysis types the free tier allows. The Problems tab reports it against Models before you run, and says the case is safe and nothing has been lost — choosing another analysis type, or upgrading, will let it run.
Before you start
Section titled “Before you start”Read Flow over a cylinder for the transient workflow. This tutorial adds the second phase and the interface.
The domain comes from geometry. The application sizes the mesh block from the geometry bounding box; there is no field anywhere for typing a box in by hand. So the tank is defined by importing a box-shaped surface the size of the tank and then setting the wind-tunnel pads to zero, which is covered in step 3. Export a rectangular box as STL or OBJ at the size you want the tank to be.
Why gravity is not optional
Section titled “Why gravity is not optional”Skip this and the rest will not make sense.
A volume-of-fluid case does not model two fluids. It models one fluid whose
density and viscosity vary in space, and a scalar field — the phase fraction,
alpha — that says which fluid each cell is. The interface is wherever that
scalar passes through 0.5.
Nothing in that formulation makes water sink. The two phases would sit wherever you put them and slowly diffuse into each other. Buoyancy is the entire mechanism that separates them, and buoyancy is gravity acting on a density difference. Without gravity there is no interface, only a smearing.
The application will not let you make that mistake. A VoF case with gravity off raises an error on the Problems tab against Models:
A two-phase case needs gravity. Without it there is nothing to separate the phases and the interface will not settle.
Gravity opposes the up axis, and the up axis is derived from Flow direction under Mesh rather than pinned to −Y. Get the flow direction wrong on a tank and gravity points sideways.
1. Create the case
Section titled “1. Create the case”Press New case. In the Create Simulation dialog choose Multiphase, then Free Surface, then one of:
- Compression (MULES) — classic interface compression. The right-hand panel
lists dam break as its first application, and its tags say why: robust and very
widely validated. Derives
interFoam. - Geometric (isoAdvector) — geometric interface advection, much sharper,
with no smearing from the compression term. Derives
interIsoFoam.
Take MULES for a first dam break and switch later. The collapse is violent, the mesh is coarse, and MULES is the more forgiving of the two on both counts.
The review page inserts an extra line into SET UP NEXT for this family: Initial conditions, described as “where each phase starts - a VoF case with no filled region is a case with one phase”. That is the step people skip.
2. Geometry
Section titled “2. Geometry”Select Geometry and press Import geometry. Choose the box.
Check Units and check Size in the Geometry info block. The tank should be the size you meant.
3. Mesh — making the block the tank
Section titled “3. Mesh — making the block the tank”Select Mesh.
Set Mesher to blockMesh only (no body). There is no body here; the fluid is the inside of the tank, and the hint for that option says exactly that — a duct, a room, a manifold.
Set Flow direction. On a tank there is no flow direction in the aerodynamic sense, so what you are really choosing is which axis is up: the up axis is the one perpendicular to the flow axis, and gravity acts down it. The block below the domain pads shows the axis letters in its labels, so you can read off which is which.
Turn the domain into the tank. Leave Auto wind tunnel on and set all
five pads — Ahead, Wake, Sides, Above and Below — to 0.
The domain is then exactly the geometry bounding box, and the block underneath
confirms it:
→ … x … x … m blockMesh … x … x … = … M cellsA pad left at its default puts empty space around your tank and the water falls out of the bottom of it.
Set the base cell size honestly. A VoF interface is resolved by cells, not by the scheme, and a coarse mesh gives a thick smeared surface however good the capture scheme is. The reference here is the depth of the water column: you want enough cells across it to see the collapse.
Press Generate mesh and check Quality. A plain block should pass everything.
4. Refinements and Boundary layers
Section titled “4. Refinements and Boundary layers”Both are effectively unused on a blockMesh-only case — there is no surface to refine towards or to grow prisms off. Leave them.
5. Models
Section titled “5. Models”Select Models.
Time dependency offers only Transient, and the hint says why: “This analysis has no steady form - the solver integrates in time.” There is no steady dam break.
Under Physics, confirm Gravity / buoyancy is on. It is set on by default for this family, and the section above explains what happens if you turn it off.
For turbulence, Laminar is a defensible choice for a first dam break — the collapse is inertia-dominated and a turbulence model adds a viscosity you then have to argue about. Switch to k-omega SST once the case runs.
6. Materials — the two phases
Section titled “6. Materials — the two phases”Select Materials. Below the fluid block there is a Phases section that only appears for a two-phase family.
Read the note at the top of it before touching anything:
alphais the fraction of the first phase. Naming them the other way round inverts every initial and boundary condition in the case, so the order is the one thing here worth checking twice.
First phase is water and Second phase is air, each with its own
Density and Kinematic viscosity, plus a Surface tension between
them. Leave the names alone unless you have a reason; every field name in the
case is built from them, and alpha.water is what you will be contouring later.
The interface
Section titled “The interface”The Interface section is where the capture behaviour lives:
- Capture scheme — isoAdvector or MULES, and the hint tells you what each one does and which executable it runs. Changing this changes the solver.
- Compression — only shown for MULES. This is
cAlpha; 1 is the usual value, 0 turns compression off entirely. - Interface correctors — how many times
alphais corrected within a step. - Alpha sub-cycles — how many sub-steps
alphatakes per flow step. - Interface Courant limit —
maxAlphaCo, and it is tighter than the flow limit because the interface is the thing the time step has to resolve.
Leave all five at their defaults for a first run. They are the knobs for when the interface is smearing or the run is unstable, not the knobs for setting a case up.
Filling the tank
Section titled “Filling the tank”Start with the domain part filled and Fill level put water below a height on the up axis. That is the fastest way to a tank with something in it, and the hint says what happens otherwise: “A case that starts entirely air has nothing in it to compute.”
For a dam break specifically, the fill level is not the shape you want — a dam break starts with a column of water against one wall, not a flat layer. So turn the fill off here and use an initialisation region instead, which is the next step.
If you do neither, a warning appears against Materials: the domain starts entirely air, and the run has no water in it to move.
7. Initial conditions — the water column
Section titled “7. Initial conditions — the water column”Select Initial conditions and go to the Regions section at the bottom.
The pane explains the mechanism: “A patch of the domain given a different
initial value — a tank filled to a level, a hot zone, a slug of tracer.
setFields applies these after meshing and before the solver starts.”
Press + Add region. On the card:
- Shape —
box. - Field — the phase fraction. It appears in the list under the name the phases gave it.
- Value —
1for all water. The hint on the boundary-condition version of this field says it plainly: 1 is all of the first phase, 0 is all of the second. - Min X, Min Y, Min Z, Max X, Max Y, Max Z — the corners of the column, in metres, in case coordinates.
Set the box to a column standing against one wall of the tank, reaching part way up. Those are the coordinates of the dam.
The card has enable / disable and ✕, so you can keep alternative columns around and switch between them.
8. Boundary conditions
Section titled “8. Boundary conditions”Select Boundary conditions.
For a closed tank, every patch is a Wall. If the pane reports the patches do not match the mesh, press Use the mesh’s patches first, then set each one.
If the top of the tank is open, that patch wants a Pressure outlet at 0 Pa gauge so displaced air can leave. A sealed box with an incompressible pressure solver and nowhere for the air to go is a case that will fight you.
For any patch that lets fluid in or out, a water fraction field appears asking whether that opening is above or below the waterline. It is asked per patch rather than guessed from the geometry, because which it is decides whether the case fills or drains.
9. Simulation control — the transient controls
Section titled “9. Simulation control — the transient controls”Select Simulation control. This is the pane that decides whether a VoF run finishes or crawls.
End time is how long the physics runs for, in seconds. A dam break is over quickly — the column falls, hits the far wall, and runs back. Pick an end time that covers the collapse and the first return, not one that covers a minute of sloshing you will not look at.
Time step is the starting Δt only.
Adjust time step to Courant number is on by default and should stay on. A free-surface run is limited twice: once on the flow, by Max Courant, and once — harder — on the interface, by the Interface Courant limit you saw under Materials. The step the solver actually takes is whichever of those is smaller, which in practice is nearly always the interface one.
Max time step caps it regardless. This matters because at the moment the column is released the velocities are small and the Courant limit will happily grant a huge step, which then takes an enormous first jump before the physics has started.
The block underneath tells you how many steps that is at the starting Δt and how many times it will write. Read it. A transient VoF case writing every step is thousands of files and a run that spends its time on disc.
Write every and Keep last control that. For an animation you want several writes per shedding or sloshing event; Keep last at a small number throws away the intermediate ones and keeps the disc under control.
10. Result control
Section titled “10. Result control”Select Result control.
Force coefficients are not the answer here. What you want is:
- + Field minimum and maximum — the extremes of each field, which for a dam break includes the peak velocity and pressure at impact.
- + Patch data with Operation set to areaAverage on
pfor the wall the water hits, if the impact pressure is what you are after. - + Cutting plane if you want the interface sampled to VTK for an external viewer as the run goes.
11. Run
Section titled “11. Run”Select Runs and press Start run.
Watch the Log rather than the residuals. A transient VoF run reports the Courant number and the interface Courant number every step, and those are the numbers that tell you whether the run is healthy. Steps getting shorter and shorter is the interface tightening its limit; that is the solver protecting itself, not a fault, but a run that has slowed to a crawl will not finish.
Under Diagnostics in the Runs pane there is Trap floating-point exceptions. Leaving it on while a case is being set up is the right default: a run that produces a NaN stops at once, rather than running on and filling the case with nonsense.
12. Post-processing
Section titled “12. Post-processing”Select Post-processing and press Show results.
Under Ready-made views, press Free surface. It builds a contour of the phase fraction at 0.5 — which is the interface — with a section through it. The pane’s own description is the reason to use it rather than assembling one yourself: “The shape of the surface is what a two-phase run is for.”
Step through the written times. Then press Save animation under Export to write the sequence out; it is enabled once there is more than one time.
What you should see
Section titled “What you should see”A column that collapses under its own weight, runs along the floor as a front, climbs the far wall, and comes back. A sharp interface — a cell or two thick with isoAdvector, a few cells with MULES — that stays sharp as it moves.
Things that mean it is wrong:
- The water sits still. Gravity is off, or it is pointing along an axis you did not intend. Check Gravity / buoyancy under Models, then check Flow direction under Mesh, because that is what sets the up axis.
- The interface smears into a grey band and never recovers. Too few cells across the water, or the alpha sub-cycles and correctors are not keeping up. Refine before you touch the scheme settings.
- The tank is empty. No fill level and no initialisation region. The Problems tab warns about exactly this against Materials.
- The whole domain is water. The phase order is inverted, or the region value is on the wrong field. Re-read the note at the top of Phases.
What to try next
Section titled “What to try next”- Run the same case again with Capture scheme set to isoAdvector and compare the interface thickness. Add it as a second simulation so the Comparison node can put them side by side.
- Mesh independence study — an interface is more mesh-sensitive than a pressure field, so this matters more here, not less.
- The Marine & Waves analysis type is the same VoF machinery with waves generated at the inlet, if what you actually want is a structure in a sea state.