SpectraSim Documentation
Parameter · 09 Run

Mesh-independence study parameter

queue.mesh_study.parameter Step 09 · Run

The mesh setting that "Add mesh-independence study" varies over three levels. The queue solves the case on the three meshes and estimates the discretisation error of the pressure drop with the Grid Convergence Index (GCI).

Last updated

Theory

A mesh-independence study needs a systematic refinement: every cell size must shrink together, so that the three solutions lie on one convergence curve. Which setting does that depends on Mesh sizing:

  • Curvature sizing (default): Fineness scales every cell size together (about twice the cells per step), so the study varies fineness 2 / 3 / 4; it is the only choice offered.
  • Uniform sizing: Cells across a pipe diameter at 11 / 16 / 22 (centred on its default of 16) sizes the surface cells from the smallest port, and the internal-wall and jet refinement targets scale with it. Fineness 3 / 4 / 5 is offered only when cells across is not set: with cells across set, the finest surface cell does not depend on fineness at all, so a fineness study would hold the flow-resolving cell size fixed; the program refuses it.

The study is a queue job: a snapshot of the case is copied into a new folder inside the project's _files folder and the three points are run one after another, each a full mesh + solve in its own sub-folder of the run. Each point's pressure drop is the window mean of its convergence rule. From the three pressure drops and cell counts the program computes, following Celik et al. (2008), the representative cell size, the apparent order of convergence pp (fixed-point iteration of equations (2)-(3)), the extrapolated pressure drop and the GCI of the fine and coarse pairs, equations (4)-(5). If any point fails to give a pressure drop and a cell count, no GCI is computed; the table of points is still written (mesh_independence.csv). The coarse GCI uses ea32e_a^{32} and r32r_{32} the same way as equation (5); the asymptotic ratio GCIcoarse/(r21 p GCIfine)\mathrm{GCI}_{coarse}/(r_{21}^{\,p}\,\mathrm{GCI}_{fine}) close to 1 indicates the asymptotic range. The Results step shows the study (chart of Δp0\Delta p_0 against cells, and the GCI values).

Equations

hi=Ni−1/3,r21=h2h1,r32=h3h2,ε21=ϕ2−ϕ1,ε32=ϕ3−ϕ2h_i = N_i^{-1/3}, \qquad r_{21} = \frac{h_2}{h_1}, \quad r_{32} = \frac{h_3}{h_2}, \qquad \varepsilon_{21} = \phi_2 - \phi_1, \quad \varepsilon_{32} = \phi_3 - \phi_2
(1)
p=1ln⁡r21∣ln⁡∣ε32ε21∣+q(p)∣p = \frac{1}{\ln r_{21}}\left|\ln\left|\frac{\varepsilon_{32}}{\varepsilon_{21}}\right| + q(p)\right|
(2)
q(p)=ln⁡r21 p−sr32 p−s,s=sign⁡ε32ε21q(p) = \ln\frac{r_{21}^{\,p} - s}{r_{32}^{\,p} - s}, \qquad s = \operatorname{sign}\frac{\varepsilon_{32}}{\varepsilon_{21}}
(3)
ϕext=r21 pϕ1−ϕ2r21 p−1\phi_{ext} = \frac{r_{21}^{\,p}\phi_1 - \phi_2}{r_{21}^{\,p} - 1}
(4)
GCIfine=1.25 ea21r21 p−1,ea21=∣ϕ1−ϕ2ϕ1∣\mathrm{GCI}_{fine} = \frac{1.25\,e_a^{21}}{r_{21}^{\,p} - 1}, \qquad e_a^{21} = \left|\frac{\phi_1 - \phi_2}{\phi_1}\right|
(5)
wheremeaningunit
NiN_iCell count of mesh ii (1 finest, 3 coarsest)-
hih_iRepresentative cell size (relative; the domain volume is the same on all meshes)-
ϕi\phi_iTotal-pressure drop Δp0\Delta p_0 on mesh ii (window mean)Pa
ppApparent order of convergence-
ϕext\phi_{ext}Richardson-extrapolated pressure dropPa
GCIfine\mathrm{GCI}_{fine}Grid convergence index of the fine mesh (×100 for %)-
ea21e_a^{21}Relative difference between the fine and medium solutions-

Default and rule

Default
curvature sizing: fineness 2 / 3 / 4; uniform sizing: cells across 11 / 16 / 22
Rule

Follows the case's mesh sizing: curvature sizing studies fineness 2 / 3 / 4; uniform sizing studies cells across 11 / 16 / 22.

Source

GCI procedure of Celik et al. (2008) with the safety factor 1.25 for three meshes; the implementation is pinned by a unit test on f(h)=100+5h2f(h) = 100 + 5h^2 (recovers p≈2.0p \approx 2.0, GCI 5.95 %). The levels are the program's choice. The uniform fineness levels start at 3: fineness 1 failed quality gate 1 with 0 % layer coverage on a real test geometry.

Valid range curvature: fineness only; uniform: cells across, or fineness 3 / 4 / 5 when cells across is not set

Cost

Three full runs, the finest the most expensive (fineness +1 is about twice the cells with curvature sizing).

Not a refinement

A fineness study with cells across set is refused: it is not a systematic refinement and its GCI would be meaningless.

Equal results

When two meshes give exactly the same pressure drop, pp and the GCI are undefined and are left blank.

References 1

  1. Celik, I. B., Ghia, U., Roache, P. J. and Freitas, C. J. (2008). Procedure for estimation and reporting of uncertainty due to discretization in CFD applications. Journal of Fluids Engineering, 130(7), 078001. DOI 10.1115/1.2960953