Theory
The mesher starts from a box of cubic background cells of size (blockMesh) and halves cells near the surfaces: a cell at refinement level has size , equation (1). Each surface is given a level range : every cell that the surface cuts is refined to , and a cell that sees surface intersections turning by more than resolveFeatureAngle is refined further, up to (OpenFOAM user guide, 2026). Between levels, nCellsBetweenLevels 3 keeps three cells per level, so the size changes gradually away from the wall.
Curvature sizing. The reference length is the hydraulic diameter of the whole fluid volume, equation (2), with the wetted area counting both sides of every internal and perforated wall. The background cell is a sixth of it, scaled by the fineness, equation (3). Every wall and baffle gets the level range : cells of on flat and gently curved walls, down to where the wall curves. The curvature threshold is radians, equation (4): a cell of size on a wall of radius sees the surface turn by about , so the wall is refined until , i.e. about cells across every pipe's own diameter , as far as level 3 allows. Each inlet and outlet gets one level, chosen so that cells fit across its own hydraulic diameter, but never coarser than the finest wall level, equation (5).
Uniform sizing. The finest cell is the smallest inlet or outlet hydraulic diameter divided by ; every surface is refined to that one level, equation (6), and resolveFeatureAngle stays at 30°. An internal wall narrower than that cell allows gets extra levels, so that its own diameter has at least cells across; the jet cylinders described below scale the same way.
In both modes each inlet gets a refinement cylinder 5 diameters long and 0.75 diameter in radius, running into the fluid, refined until its cells are at most ; the background box extends beyond the model ( the diagonal of the model's bounding box). The hydraulic diameter of a port is of its exported surface.
Before meshing, the program estimates the final cell count from the wetted area, equation (7), and sets the mesher's cell limit maxGlobalCells from the peak count during castellation, equation (8), which is when the limit actually applies. The estimate is shown on the Mesh step and saved in the run folder.
Equations
| where | meaning | unit |
|---|---|---|
| Cell size at refinement level | m | |
| Background (level-0) cell size | m | |
| Refinement level | - |
| where | meaning | unit |
|---|---|---|
| Reference length: hydraulic diameter of the fluid volume | m | |
| Fluid volume enclosed by the exported surface | m³ | |
| Area of every exported surface | m² | |
| Area of the internal and perforated walls (counted a second time: both sides are wetted) | m² | |
| Wetted area | m² | |
| Fineness, 1 to 5 | - | |
resolveFeatureAngle given to the mesher | ° | |
| Cells across a diameter | - | |
| Refinement level of an inlet or outlet face | - | |
| Hydraulic diameter of the port, | m |
| where | meaning | unit |
|---|---|---|
| Wall cell size (uniform sizing: every surface) | m | |
| Smallest hydraulic diameter of all inlets and outlets | m |
| where | meaning | unit |
|---|---|---|
| Estimated final cell count | - | |
| Number of background cells in the box | - | |
| Number of prism layers | - | |
| Wetted area that receives layers | m² | |
| Effective wall cell for the estimate | m | |
| Finest surface cell ( curvature, uniform) | m | |
| Fixed floor of the limit: 0.3, 0.7, 1.5, 3 and 6 million cells for fineness 1 to 5 | - |
Default and rule
- Default
- curvatureMeasured
- Rule
Curvature. Case files saved before the sizing setting existed (they carry a fineness or cells-across value but no sizing) open as uniform and mesh exactly as they did; a new case and every save from the Mesh step state the sizing explicitly.
- Source
The rule was developed on case V1 (a 2.0 m multi-chamber muffler with a perforated pipe and three absorptive packings; 40 mm smallest outlet):
- Uniform sizing at 16 cells across meshed every wall with 2.5 mm cells: 4,957,834 cells and 3,658 s of the mesher.
- Curvature sizing at its defaults, same pipeline: 1,042,226 cells and 686 s, layer coverage 93.0 %, maximum non-orthogonality 73.86° on 17 faces; quality gate 1 passed.
The divisor 6 and the level range were taken from a mesher case whose wall sizes matched a reference mesh of the same muffler made with another mesher; they have not been varied. On case V4 (a 0.3 m expansion chamber with an extended inlet tube) a flow solution on both meshes gave a pressure drop of 17.63 Pa (curvature, 278,987 cells) against 17.24 Pa (uniform, 274,916 cells), +2.3 %.
The cell-count constants 3.3, 0.8 and 4 were obtained separately from the logs of eight finished meshes: castellated cells 2.6-3.8, prism cells 0.6-0.97 per layer and peak 0.84-0.98 of the formula, all per . The level and feature-angle mechanics are the mesher's (OpenFOAM user guide, 2026).
Valid range curvature | uniform
Choice
Curvature or uniform. The meaning of Fineness and Cells across a pipe diameter changes with it.
Estimate
The cell estimate was within 0.85-1.17 of the real count on the eight calibration meshes and 29 % high on the first curvature mesh of V1. Not covered by a measurement: low-Re meshes (12 layers) and models with more than 24 % of their area in baffles.
Untested constants
The divisor 6, the wall level range and the port levels of curvature sizing come from one model and were not varied. Check the pressure drop with a mesh independence study before relying on it.