Validation/Transient conduction
Transient slab conduction in OpenFOAM
The same mathematics as the code_aster slab, reached through a different code — and with the two discretisation orders measured separately, second in space and first in time, exactly as the schemes promise.
Why this case
The OpenFOAM conduction family had no named reference of any kind behind it. This case gives it one, and it gives it the two numbers a first reference for a family ought to produce: an order of convergence in space and an order of convergence in time, measured separately.
The obvious steady version would not have done. A slab with two faces held at fixed temperatures settles on a straight line, a straight line lies inside the discrete solution space, and any correct implementation reproduces it on any mesh — the same trap the steady plane wall documents. So the case is run as a transient, from a uniform initial temperature that is not on that line, and the transient is where the discretisation shows.
There is a second thing worth saying about it. The closed form here is the same piece of mathematics that the code_aster transient slab is measured against, arrived at through a different mesher, a different deck writer, a different solver and a different result reader. Neither run was told the other’s answer.
| Physics | Transient linear conduction, one-dimensional by construction |
|---|---|
| Backend | OpenFOAM, laplacianFoam |
| Slab | 0.2 m thick, diffusivity D = 4 × 10⁻⁵ m²/s |
| Initial state | Uniform 293.15 K |
| Faces | 307.75 K at x = 0 and 288.15 K at x = L, from t = 0 |
| Sides | Adiabatic, so the problem really is 1-D |
| Compared at | t = 100 s — Fourier number Dt/L² = 0.1 |
| Mesh study | 20, 40 and 80 cells along the slab, at a 0.02 s step |
| Time study | 1.0, 0.5 and 0.25 s steps, on the 160-cell mesh |
| Schemes | Gauss linear for the Laplacian, Euler for the time derivative |
| Reference | Separation of variables for a slab with unequal face temperatures: a linear steady profile plus a decaying Fourier sine series, summed to 200 terms with the truncation measured |
| Agreement | L1 4.607 × 10⁻⁴ K on 80 cells over a 19.6 K range, with observed orders of 1.850 in space and 0.980 in time — and, once the study is run without the confound described below, 2.010 and 2.005 in space |
The exact solution
Separation of variables again, but with the two faces held at differenttemperatures, so the slab is heading for a sloping steady profile rather than a uniform one. The solution splits into that steady line plus a transient that dies away:
Separation of variables, unequal face temperatures
T(x,t) = T1 + (T2 - T1) x/L
+ sum over n of B_n sin(n pi x/L) exp(-D (n pi/L)^2 t)
B_n = (2/(n pi)) [ (T_i - T1)(1 - (-1)^n) + (T2 - T1)(-1)^n ]
L = 0.2 m, D = 4e-5 m^2/s, T_i = 293.15 K, T1 = 307.75 K, T2 = 288.15 KBecause the face temperatures differ, the even modes do not drop out — Bₙ carries both a term from the initial-to-hot-face step and a term from the slope, and both are needed. That makes this a stricter reading of the same mathematics than a symmetric case gives.
“The reference is exact” is a claim about the sum, not about the first two hundred terms of it, so the truncation is measured rather than assumed. The series is summed to 200 terms and the contribution of the last hundred of them is 0.0 K at the comparison time — the series converges as exp(−n²) and at a Fourier number of 0.1 it is finished after a handful of terms. A benchmark whose reference was truncated too early would report its own arithmetic as the product’s discretisation error, and the check refuses to run if that number is not below 10⁻⁹ K.
Result: two orders, measured separately
Space and time are refined in separate studies, and each study is run where the other error is small. That is not tidiness — it is the only arrangement in which either number means anything, and the section below shows what happens when it is not done.
| Cells along x | Δx (m) | Total cells | L1 (K) | L∞ (K) | Observed order |
|---|---|---|---|---|---|
| 20 | 0.01000 | 4 000 | 4.762560 × 10⁻³ | 1.033637 × 10⁻² | — |
| 40 | 0.00500 | 8 000 | 1.321550 × 10⁻³ | 2.871222 × 10⁻³ | 1.850 |
| 80 | 0.00250 | 16 000 | 4.607464 × 10⁻⁴ | 1.005247 × 10⁻³ | 1.520 |
| Δt (s) | Steps | L1 (K) | L∞ (K) | Observed order |
|---|---|---|---|---|
| 1.0 | 100 | 8.172662 × 10⁻³ | 1.823511 × 10⁻² | — |
| 0.5 | 200 | 4.143802 × 10⁻³ | 9.231563 × 10⁻³ | 0.980 |
| 0.25 | 400 | 2.103120 × 10⁻³ | 4.682113 × 10⁻³ | 0.978 |
Second order in space and first order in time, which is exactly what the two schemes promise: Gauss linear for the Laplacian and Euler for the time derivative. Two entirely different orders, measured in two separate studies, both landing where the scheme says they should. That is a stronger statement than either number on its own, because a harness that was accidentally measuring one error in both places could not produce two different answers.
The absolute size is worth putting in context. The temperature range across this slab is 19.6 K, so an L1 of 4.607 × 10⁻⁴ K on the finest mesh is about two parts in 10⁵ of it.
| Cells along x | Δt (s) | Probe x (m) | Measured (K) | Exact there (K) | Difference (K) |
|---|---|---|---|---|---|
| 20 | 0.02 | 0.105000 | 295.2018652 | 295.2083067 | −6.44 × 10⁻³ |
| 40 | 0.02 | 0.102500 | 295.4367619 | 295.4386598 | −1.90 × 10⁻³ |
| 80 | 0.02 | 0.101250 | 295.5544496 | 295.5551251 | −6.76 × 10⁻⁴ |
| 160 | 0.25 | 0.100625 | 295.6107732 | 295.6136835 | −2.91 × 10⁻³ |
One more thing is asserted rather than assumed: the problem is supposed to be one-dimensional, and it is checked to be. The spread of temperature across the slab at a single x — which the four adiabatic side faces should hold at round-off — is at worst 5.2 × 10⁻⁴ K across every run on this page.
Why the two studies are run at different settings
Refining the mesh at a 1 s time step produces observed orders of 0.139 and 0.034. That reads like a spatial scheme that has stopped converging, and it is nothing of the kind.
At a 1 s step the temporal error is the larger by an order of magnitude, so the mesh study refines its way down onto a floor it cannot pass: L1 goes 9.211 × 10⁻³, 8.365 × 10⁻³, 8.173 × 10⁻³ — flattening onto the time-step error exactly as it should. That run is kept as a fixture, because the failure mode it demonstrates is the one that would otherwise be reported as a defect in the spatial discretisation.
| Cells along x | Δt (s) | L1 (K) | Observed order |
|---|---|---|---|
| 40 | 1.0 | 9.210646 × 10⁻³ | — |
| 80 | 1.0 | 8.365059 × 10⁻³ | 0.139 |
| 160 | 1.0 | 8.172662 × 10⁻³ | 0.034 |
The failure that looks healthiest
There is one way for this case to be wrong that no error norm would catch, and it is worth describing because it is what makes the transient scheme an assertion here rather than an assumption.
| Cells along x | Δt (s) | L1 (K) | L∞ (K) | Midplane probe (K) |
|---|---|---|---|---|
| 20 | 0.02 | 1.4516593 | 2.2893584 | 297.460000 |
| 40 | 0.02 | 1.4505400 | 2.2898719 | 297.705000 |
| 80 | 0.02 | 1.4502600 | 2.2900698 | 297.827500 |
| 160 | 1.0 / 0.5 / 0.25 | 1.4501901 | 2.2900842 | 297.888749 |
What this page does not establish
That separation has since been run, and it says the floor was the whole story. The mesh study above holds the time step fixed while the cell size halves, so the diffusion number D Δt/Δx² quadruples at every level — 0.0080, 0.0320, 0.1280 — and the sweep reads that climb as much as it reads the mesh. Repeating the same three meshes with the diffusion number held at 0.0080 gives observed orders of 2.010 and 2.005.
So the solver is second order in space, and the 1.850 above is what a confounded study measures rather than what the scheme does. The figure is left in place because it is what this benchmark’s fixture holds and what its gate judges — it is simply not the scheme’s order. The same confound was found in two other benchmarks, in one of them removing convergence altogether, and is recorded in the project’s gaps ledger.
- The mesh is refined along x only. The problem is one-dimensional by construction, so cells across it buy nothing and refining all three directions would multiply the cost eightfold per level to measure the same thing. Nothing here says anything about the spatial discretisation on a mesh that is not aligned with the gradient, and nothing here exercises a non-orthogonal or unstructured mesh at all.
- Constant diffusivity, no source, one material. All three are what make the series exact, and all three are absent from any real conduction problem worth running.
- Dirichlet boundary conditions only. No flux, no film, no radiation.
- This is the conduction solver, not a coupled one. laplacianFoam solves a scalar transport equation with no flow field in it. Nothing on this page carries over to conjugate heat transfer or to convection.
- One Fourier number. Every run is compared at Dt/L² = 0.1. Very early times, where the initial discontinuity is still sharp, are not measured — and that is precisely the regime where the companion code_aster case loses its formal temporal order.
Repeat this yourself
Every case here is set up from the worked examples in the product, with no hand-editing of solver files — so you can run it, and get the same numbers. The free tier runs real cases up to 250,000 cells of fluids, or 100,000 nodes of solid, with no account needed to download and no time limit.
Other cases
- Transient conduction in a slabA slab stepped on both faces, against the Fourier series. The first thermal case whose error is discretisation rather than bookkeeping — and the one that shows the time step, not the mesh, is what limits it.
- Steady conduction through a plane wallA steel wall driven by an imposed flux and by a convective film, against the closed form. The answer is linear and therefore inside the element space, so this pins coefficients and sign conventions rather than spatial accuracy — and says so.
- A manufactured solutionThe only case here that checks the arithmetic rather than the answer. Pick the solution first, work out what source term it needs, and the error is then known exactly on every mesh.
All validation cases · Written by the team building SHD Sim.