Prism Layer Stack Calculator

Prism Layer Stack Calculator

The geometric series behind an inflation layer, done exactly: total thickness, last layer, the jump from the outermost prism into the core cell, and how much of the boundary layer the stack actually covers — with the layer count and the first layer solvable backwards from a target.

Prism layer stack and boundary-layer coverage

First layer, growth rate, layer count → stack thickness, transition jump and coverage
Three of the four quantities can be solved in closed form and are offered here. The GROWTH RATE cannot: h₁(rⁿ − 1)/(r − 1) = T is a polynomial of degree n − 1 in r, and for n above 5 it has no solution in radicals at all. This page will not pretend otherwise. Read the growth rate off the chart below instead, which plots layers-needed against growth rate over the whole practical range.
The wall-adjacent cell height — from the y+ to first cell height calculator if you are sizing from a y+ target. This is the CELL height, not the distance to its centroid.
The ratio of each layer’s thickness to the one below it. 1.1 to 1.25 is the usual band; above about 1.3 the wall-normal truncation error starts to show and above 1.5 the stack is a sequence of jumps rather than a graded mesh. r = 1 is allowed and means a uniform stack, which is the right answer inside a resolved viscous sublayer and the wrong one across a whole boundary layer.
Rounded to a whole number, because a stack cannot have 29.09 layers. When this page solves for the layer count it rounds UP, so the stack reaches at least the target thickness rather than stopping short of it.
Used when solving for the layer count or the first layer. Usually you want this to be the boundary layer thickness or a little more — the point of a prism stack is that the whole boundary layer is resolved by graded cells rather than half of it.
What the stack has to cover, and the number the headline verdict is measured against. The y+ to first cell height calculator reports δ at the station you are sizing for: 4.91x/√Re_x laminar, 0.16x Re_x^(−1/7) turbulent, and D/2 for fully developed internal flow.
The size of the background or core cell the outermost prism hands off to. This is what sets the transition jump, and it is the figure people most often never look at — a beautifully graded stack that ends in a 5:1 step into the core has thrown away most of what the grading bought.
One unit for the first layer, the target, δ and the core cell, because a mesh is normally dimensioned in one unit. Everything is converted internally and the total is also given in metres and inches.
118.2%Example

A stack of 30 layers growing at 1.2 from a first layer of 0.02 mm, against a 20 mm boundary layer and a 4 mm core cell

Advertisement

The geometric series, and which of its four quantities can be inverted

T = h₁(rⁿ − 1)/(r − 1)  [r ≠ 1] ·  T = n h₁  [r = 1] ·  hlast = h₁rⁿ⁻¹  ·  n = ln[1 + T(r − 1)/h₁] / ln r  ·  h₁ = T(r − 1)/(rⁿ − 1)  ·  jump = hcore/hlast
h₁
first layer thickness: the wall-adjacent cell height, the quantity a y+ target fixes
r
growth rate, each layer divided by the one below. 1.1 to 1.25 in practice. The one quantity on this page that CANNOT be solved for in closed form
n
number of layers, a whole number. Solved by logarithms and rounded up, so the stack reaches at least the target
T
total stack thickness, the geometric sum. Verified here against a direct layer-by-layer summation rather than against itself
h_last
outermost prism thickness, h₁r^(n−1). The number the transition jump is measured against, and the one nobody looks at
jump
core cell size divided by the last prism thickness. Should be near 1; between 0.8 and 1.5 is comfortable; beyond 2 in either direction puts a first-order error source inside the shear layer

Worked example

A stack of 30 layers growing at 1.2 from a first layer of 0.02 mm, against a 20 mm boundary layer and a 4 mm core cell
The geometric sum first. (rⁿ − 1)/(r − 1) with r = 1.2 and n = 30 is (1.230 − 1)/0.2 = (237.3763 − 1)/0.2 = 1181.882, so the total is 0.02 × 1181.882 = 23.6376 mm
That closed form was verified against a direct summation, not against itself. Adding the thirty layers one at a time — 0.02, 0.024, 0.0288, … — gives 23.637631380 mm against the closed form's 23.637631380 mm. The check was run over 20,000 random combinations of first layer, growth rate and layer count with no mismatch beyond floating-point rounding, and the r = 1 case is detected and handled linearly rather than being allowed to divide by zero
Coverage is the number that decides whether the stack is right: 23.6376/20 = 118.2 per cent of the boundary layer. Anything from about 100 to 150 per cent is the target, so this stack crosses δ with a little margin, which is what you want because δ grows downstream
The outermost layer is h₁rⁿ⁻¹ = 0.02 × 1.229 = 3.9563 mm, which is 198 times the first layer. That number is worth pausing on: a stack that starts at 20 μm ends in cells nearly 200 times thicker, and the grading is the whole reason 30 layers can cross 20 mm at all
Now the check almost nobody makes. The core cell next to the stack is 4 mm and the outermost prism is 3.9563 mm, so the transition jump is 4/3.9563 = 1.011. That is very close to 1, which is what you want: the mesh hands off from the stack to the core without a step. Get this wrong — a 0.5 mm last prism into a 4 mm core is a jump of 8 — and you have put a first-order error source in the shear layer, and no amount of refining the core will remove it
Read backwards: to reach exactly 20 mm at this first layer and growth rate you need ln(1 + 20 × 0.2/0.02)/ln 1.2 = 29.088 layers, so 30 — which is what the page reports when you ask it to solve for the layer count against a 20 mm target. To reach 15 mm it is 28 layers. And solving the other way, 30 layers reaching exactly 15 mm needs a first layer of 0.012692 mm
What this page will not do, and why. Solving for the GROWTH RATE from a target total, a first layer and a layer count means solving h₁(rⁿ − 1)/(r − 1) = T for r, and that is a polynomial of degree n − 1. For n above 5 there is no general solution in radicals — Abel–Ruffini — and the honest methods are all iterative. This site's expression language is deliberately numeric and non-iterative, so rather than ship a silent approximation the page plots layers-needed against growth rate over the whole practical range and lets you read r off the chart. It is one fewer button and one more thing you can actually check
One more sensitivity worth knowing: adding a single layer to this stack takes the total from 23.6376 to 28.3852 mm, a jump of 20.1 per cent, because the outermost layer is the thickest. Near the top of a geometric stack the layer count is a coarse control, which is exactly why the growth rate is the one you want to tune — and the one that cannot be solved for

Growth rate against layer count: the table that replaces solving for r

Growth rate rLayers to reach δ = 20 mm (exact)rounded upTotal with 30 layersCoverageLast layerTransition jump into a 4 mm core
1.001000.010000.600 mm3%0.020 mm200.00
1.0580.6811.329 mm7%0.082 mm48.59
1.1048.4493.290 mm16%0.317 mm12.61
1.1535.9368.695 mm43%1.152 mm3.47
1.2029.13023.638 mm118%3.956 mm1.01
1.2524.82564.543 mm323%12.925 mm0.31
1.3021.822174.600 mm873%40.308 mm0.10
1.4017.8181210.022 mm6050%345.735 mm0.01
1.5015.3167670.002 mm38350%2556.681 mm0.00
Read at a first layer of 0.02 mm, a 20 mm boundary layer and a 4 mm core cell — the page’s own defaults — so the columns can be compared directly against the calculator above. This table exists because the growth rate is the one quantity in a geometric stack that cannot be solved for in closed form, and it is more useful than a solver would be: it shows the whole trade at once. Going from r = 1.1 to r = 1.2 cuts the layers needed from 49 to 30, a saving of 40 per cent. Going on to r = 1.4 cuts it to 18. But look at what happens in the last two columns as you do it: with 30 layers the outermost cell grows from 4 mm at r = 1.2 to 346 mm at r = 1.4 and 2.6 metres at r = 1.5, and the transition jump into a 4 mm core collapses from 1.01 to 0.01 and then to 0.002. A stack that races to δ in eighteen layers is not resolving the outer part of the boundary layer, it is stepping over it. The r = 1.00 row is the uniform case: a thousand cells to cross δ, which is why grading exists.

The default stack, layer by layer

LayerThickness (mm)Cumulative (mm)Coverage of δ
10.020000.02000.1%
20.024000.04400.2%
30.028800.07280.4%
40.034560.10740.5%
50.041470.14880.7%
60.049770.19861.0%
…………
272.2895113.637168.2%
282.7474116.384581.9%
293.2968919.681498.4%
303.9562723.6376118.2%
The first six and last four layers of the worked example, with the cumulative total — which is the direct summation the closed form was checked against. Two things are worth reading off it. The first half of the stack does almost nothing for coverage: after six layers of thirty the stack has crossed 0.9 per cent of the boundary layer. And the last four layers do most of it: they contribute more than half the total between them. That is the nature of a geometric series and it has a practical consequence — the layer count is a coarse control at the top of the stack and a very fine one at the bottom, so if you need to adjust coverage slightly, adjust the growth rate; if you need to adjust the near-wall resolution, adjust the first layer.

The arithmetic that has to be exact, the jump nobody checks, and the one quantity that cannot be inverted

A prism layer stack is a geometric series, and the arithmetic is the easy part to get almost right. The total thickness of n layers starting at h₁ and growing by r each time is h₁(rⁿ − 1)/(r − 1), and every term of that expression has a trap in it. The formula divides by r − 1, so a uniform stack — r = 1, which is exactly what you want inside a resolved viscous sublayer — makes it 0/0; this page detects that and uses n h₁ instead. The exponent is n and not n − 1, while the LAST LAYER thickness is h₁rⁿ⁻¹ and not h₁rⁿ; getting those two confused is an error of one whole factor of r, which at r = 1.2 is 20 per cent. And the closed form was checked here against a direct layer-by-layer summation over twenty thousand random combinations rather than against itself, because a closed form that agrees with its own derivation proves nothing.

The transition jump is the number this page exists to make you look at. Everyone checks the first layer, because y+ makes them. Very few check what happens at the other end of the stack, where the outermost prism hands off to the core mesh. If the core cell is four times the last prism, the mesh takes one large step in cell size — and a size jump is a first-order error source in a finite-volume discretisation, because the face between two very different cells is no longer near the midpoint of the line joining their centroids and the gradient reconstruction across it degrades. What makes it worse is where the jump is: at the edge of a prism stack, which is inside the shear layer if the stack is short. Aim for a ratio between about 0.8 and 1.5, and note that the fix is usually the core cell size rather than the stack — it is the cheapest of the three levers.

Coverage, not total thickness, is the verdict. A stack 12 mm thick is excellent on a 10 mm boundary layer and useless on a 200 mm one, so the headline here is the ratio. The target band is roughly 100 to 150 per cent: cross the layer, hand off to the core outside it where a size jump is harmless, and leave some margin because δ grows along a surface. A stack sized on δ at one station is short of it downstream, and a stack sized on a LAMINAR δ is far short of it once the layer transitions — at Rex = 5 × 10⁵ the turbulent thickness is 3.5 times the laminar one — 0.0245x against 0.0069x. Getting δ itself is a different calculation, and the y+ to first cell height calculator reports it at the station you are sizing for.

Three of the four quantities invert; the growth rate does not, and this page says so. Given any three of h₁, r, n and T you can in principle find the fourth. The total is direct. The layer count comes out of a logarithm, n = ln[1 + T(r − 1)/h₁]/ln r, and is then rounded up so the stack reaches at least the target. The first layer is linear, h₁ = T(r − 1)/(rⁿ − 1). But solving for r means solving a polynomial of degree n − 1, and for n above five that has no general solution in radicals. Every real method is iterative, this site’s expression language is deliberately numeric and non-iterative, and a silent approximation in a mesh sizing tool is worse than an honest absence. So the growth rate is read off the chart instead — which shows the whole trade rather than one number, and is the more useful object anyway.

Growth rate, accuracy and the reason 1.2 keeps appearing. A stretched mesh loses formal order of accuracy: a second-order scheme is only second-order as the stretching ratio tends to 1, and the penalty grows with r. At 1.1 to 1.25 it is small enough to ignore against everything else in a RANS calculation; by 1.5 the wall-normal direction — the direction the wall shear is computed in — is effectively first-order in the first few cells. High growth rates also compound absurdly: at r = 1.5 the tenth layer is 38 times the first and the twentieth is 2,200 times, so the stack stops resolving anything long before it reaches δ. If a boundary layer is thick, the answer is more layers, not faster growth. The table above prices that trade: 1.1 needs 49 layers to cross a 20 mm layer from a 0.02 mm start, 1.2 needs 30, and 1.4 needs 18 — but at 1.4 the outermost cell of a 30-layer stack is 346 mm thick.

What no closed form can see. Everything on this page is one-dimensional, and a prism stack is not. Layers collapse in concave corners where they run into each other, fan out and thin over convex ones, collide with themselves across a narrow gap or a thin trailing edge, and get truncated by the mesher’s own quality controls where any of that happens — so the stack you asked for and the stack you got may differ, locally and silently. δ also varies over a real geometry by more than the margin most stacks carry. So use this page to design the stack and to check the two numbers that are easy to get badly wrong, then look at the mesh: at the corners, at the thinnest gap, and at the trailing edge. Then check the first layer where it matters with the first cell height to y+ calculator, because a stack whose layers collapsed to half thickness has halved its y+ too.

Advertisement

Frequently asked questions

Is the last layer h₁rⁿ or h₁r^(n−1)?

h₁r^(n−1). The first layer is h₁r⁰ = h₁, so the nth is h₁r^(n−1). Using h₁rⁿ overstates the outermost prism by one whole factor of r — 20 per cent at a growth rate of 1.2 — and since the last layer is what the transition jump is measured against, the error goes straight into the one check most people do not make. The same off-by-one appears in the total: the sum of n terms is h₁(rⁿ − 1)/(r − 1), with the exponent n, not n − 1. The two exponents are different and both are easy to write down wrong.

Why can this page not solve for the growth rate?

Because there is no closed form. Setting h₁(rⁿ − 1)/(r − 1) = T and solving for r is a polynomial equation of degree n − 1, and for n greater than five the Abel–Ruffini theorem says no general solution in radicals exists. Every practical method — Newton, bisection, secant — is iterative, and this site’s expression language is numeric and non-iterative on purpose, so the alternative would be a silent approximation inside a tool people use to size meshes. The chart on this page plots layers-needed against growth rate over 1.02 to 1.60 instead, which lets you read off the rate you want and shows you the sensitivity at the same time.

What should the transition jump be, and what happens if it is wrong?

Near 1; between about 0.8 and 1.5 is comfortable. It is the core cell size divided by the outermost prism thickness, so 1 means the mesh hands off from the stack to the core without a step. A jump of 4 means the cell size quadruples across one face, and in a finite-volume scheme that face is no longer near the midpoint of the line joining the two cell centroids, so the gradient reconstruction across it drops to first-order accuracy. Refining the core mesh does not fix it — it only moves the jump. Worse, if the stack is short the jump sits inside the shear layer, which is the least forgiving place to put a first-order error. Both directions are bad: a core cell much SMALLER than the last prism means the refinement runs backwards.

How many layers do I actually need?

Enough to cross the boundary layer with the growth rate you have chosen, which is the figure this page computes — typically 20 to 40 at a growth rate of 1.2 for a wall-resolved first layer, and 10 to 20 for a wall-function mesh whose first layer is much thicker. Two floors sit under that number regardless. A wall-resolved mesh wants at least three and preferably five cells inside y+ < 5, or the sublayer is not resolved however small the first cell is. And fewer than about five layers is not a graded stack at all: there is no configuration in which a boundary layer is usefully represented by four prisms.

Should I use a uniform stack, r = 1?

Inside a resolved viscous sublayer, yes — the profile there is nearly linear and there is nothing to grade. Across a whole boundary layer, no: covering δ uniformly at a first layer thickness that a y+ target of 1 demands takes hundreds to thousands of cells, against a few tens graded. The usual answer is a hybrid the sliders here cannot express: a handful of uniform cells nearest the wall, then geometric growth. If your mesher offers that, use it, and size the geometric part with this page from the top of the uniform block. Note that r = 1 makes the closed-form sum 0/0, so this page detects it and uses n·h₁; nothing here is an approximation at r = 1.

The total thickness is bigger than the target I asked for. Why?

Because the layer count was rounded up. n = ln[1 + T(r − 1)/h₁]/ln r is almost never a whole number, and rounding up means the stack reaches at least the target, which is the safe direction. At a growth rate of 1.2 one extra layer adds about 20 per cent to the total, because the new outermost layer is the thickest of all of them — so the overshoot can be substantial. Read the coverage figure rather than assuming you got what you typed, and if you need the total to be exact, solve for the first layer thickness instead: that is linear and lands on the target exactly.

Does the stack have to cover the whole boundary layer?

For anything that depends on the outer layer, yes — wake development, separation onset, mixing, and a heat transfer coefficient that the outer layer feeds. For a drag or pressure-drop calculation dominated by the near-wall region you can often get away with 60 to 80 per cent. What you cannot get away with is ending the stack in the middle of the layer AND having a large transition jump there, because then a first-order error source sits where the shear is strongest. If the stack has to be short, at least match the core cell to the last prism. And remember δ is not a sharp edge — it is the 99 per cent velocity point — so 90 per cent coverage is not 10 per cent short of anything in particular.

Related calculators

References

  1. The geometric series itself. No citation is needed for Σri, but the verification is worth recording: the closed form h₁(rⁿ − 1)/(r − 1) was checked against a direct layer-by-layer summation over 20,000 random combinations of first layer (10−4 to 10), growth rate (1.0 to 2.0) and layer count (1 to 200), with no disagreement beyond floating-point rounding. The r → 1 limit was checked separately, through the live engine rather than in the derivation: at r = 1 + 10−9, which is where this page switches to the exact linear form n h₁, the worst relative disagreement with a direct summation over every combination of layer count and first layer thickness tested was 4.5×10−9 — eleven orders of magnitude below anything a mesher can act on, and bounded by the switch rather than left to grow.
  2. Abel–Ruffini theorem (Ruffini 1799, Abel 1824). The reason this page offers three inversions and not four: h₁(rⁿ − 1)/(r − 1) = T is a polynomial of degree n − 1 in r, and for n > 5 the general quintic and above have no solution in radicals. Cited so the missing feature reads as a mathematical fact rather than an omission.
  3. H. Schlichting and K. Gersten, Boundary-Layer Theory. Cited by number for the boundary-layer thickness relations the coverage figure is measured against — the Blasius laminar δ99 = 4.91x/√Rex and the turbulent δ/x = 0.16 Rex−1/7 — and for the definition of δ99 as the 99 per cent velocity point, which is why coverage near 100 per cent should not be read as a sharp pass or fail. The Blasius constant was obtained here by integrating the Blasius equation numerically rather than read from a table: η99 = 4.90999, which is 4.910 and not the 5.0 often printed.
  4. ANSYS Fluent User’s Guide and ANSYS Meshing User’s Guide, Inflation and Prism layer mesher controls, and the Siemens Simcenter STAR-CCM+ Prism Layer Mesher documentation. Cited by number, not reproduced, for the parameterisation this page follows — first layer thickness, growth rate and number of layers, with total thickness derived — and for the practical growth-rate band of about 1.1 to 1.25. Worth knowing that meshers differ in what they take as the primary input: some ask for the total thickness and a layer count and derive the first layer, which is the third mode on this page, and some ask for the LAST layer thickness instead, in which case divide by r^(n−1) before entering it here.
  5. NASA Turbulence Modeling Resource, grid families for the 2D zero pressure gradient flat plate and the 2D bump-in-channel verification cases (NASA Langley Research Center). A US Government work. The published grid families are the practical reference for what a wall-resolved stack looks like at a given Reynolds number — first cell heights, growth rates and total layer counts for grids that are demonstrably grid-converged — and they are a better sanity check on a stack than any rule of thumb, because the accompanying solutions show what the mesh actually achieved.
  6. P. Roache, Verification and Validation in Computational Science and Engineering, on the order of accuracy of stretched meshes. Cited by number for the point this page makes about growth rate: the formal order of a scheme is recovered only in the limit of a smoothly varying mesh, and a large cell-to-cell size ratio — whether from a high prism growth rate or from a jump into the core mesh — degrades it locally, in a way that refining elsewhere does not repair.

Setup guidance, not validation. Correlations have ranges of validity and cell-count estimates are order-of-magnitude. A converged simulation is not a correct one. Full disclaimer at calcengines.com/disclaimer/