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.
- 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. - 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
Section titled “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
Section titled “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.