Draft. This manual is new and still growing. If something here does not match what you see in the software, the software is right — tell us and we will fix the page.
Reduce a 3-D case to 2-D
OpenFOAM has no 2-D solver. A 2-D case is a mesh one cell thick with the two
side faces declared empty, and the solver then drops that direction from every
equation.
Runs on the free tier. It is roughly a hundred times cheaper than the 3-D equivalent, which is why so much everyday CFD is 2-D.
Steps
- Select Mesh.
- Turn on Two-dimensional.
- Set Thin direction to
x,yorz. It cannot be the flow direction — that is the direction the answer is in, and the Problems tab rejects it. On an enclosed-vessel case the control is not drawn at all; the thin axis is fixed to Y. - A
frontAndBackpatch is added for you and held at Empty (2D). The note under the control confirms the block is one cell thick along the chosen axis. - Press Generate mesh.
Turning Two-dimensional back off removes the patch again, so the boundary condition list never carries an entry for a patch the mesh no longer has.
On an imported or extruded mesh
If the mesh comes from elsewhere, the same thing is done under Operations:
- Extrude a patch with Mode
Linear, along the patch normal, Layers1and a small Thickness sweeps a surface into a one-cell slab. - Rename or merge patches with Type
emptydeclares the two thin faces. As the hint puts it:emptyis what makes a mesh two dimensional.
Then set the patch to Empty (2D) under Boundary conditions so the case and the mesh agree.
Check it worked
- The Problems tab is clear. A case set to two-dimensional with no
Empty (2D)patch is an error — the solver would otherwise treat it as 3-D and quietly solve a direction you did not want. - The cell count on Mesh dropped by about the factor you expected.
- A 2-D case and an axisymmetric case are alternatives, not a combination. Declaring both is rejected; see set up an axisymmetric case.