Skip to content
SHD Sim
Menu

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.

VerificationL1 4.607 × 10⁻⁴ K over a 19.6 K range; observed order 1.850 in space at the benchmark’s fixed step, 2.010 and 2.005 with the diffusion number held

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.

PhysicsTransient linear conduction, one-dimensional by construction
BackendOpenFOAM, laplacianFoam
Slab0.2 m thick, diffusivity D = 4 × 10⁻⁵ m²/s
Initial stateUniform 293.15 K
Faces307.75 K at x = 0 and 288.15 K at x = L, from t = 0
SidesAdiabatic, so the problem really is 1-D
Compared att = 100 s — Fourier number Dt/L² = 0.1
Mesh study20, 40 and 80 cells along the slab, at a 0.02 s step
Time study1.0, 0.5 and 0.25 s steps, on the 160-cell mesh
SchemesGauss linear for the Laplacian, Euler for the time derivative
ReferenceSeparation 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
AgreementL1 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 K

Because 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.

Mesh refinement along the slab, at a 0.02 s time step
Cells along xΔx (m)Total cellsL1 (K)L∞ (K)Observed order
200.010004 0004.762560 × 10⁻³1.033637 × 10⁻²
400.005008 0001.321550 × 10⁻³2.871222 × 10⁻³1.850
800.0025016 0004.607464 × 10⁻⁴1.005247 × 10⁻³1.520
Norms are the fixture’s own, over the whole field against the series. The order column is computed from successive L1 values at a mesh ratio of two.
Time-step refinement on the 160-cell mesh
Δt (s)StepsL1 (K)L∞ (K)Observed order
1.01008.172662 × 10⁻³1.823511 × 10⁻²
0.52004.143802 × 10⁻³9.231563 × 10⁻³0.980
0.254002.103120 × 10⁻³4.682113 × 10⁻³0.978
Same field norms, on 32 000 cells throughout. The order column is computed from successive L1 values at a step ratio of two.

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.

Temperature at the cell centre nearest the midplane
Cells along xΔt (s)Probe x (m)Measured (K)Exact there (K)Difference (K)
200.020.105000295.2018652295.2083067−6.44 × 10⁻³
400.020.102500295.4367619295.4386598−1.90 × 10⁻³
800.020.101250295.5544496295.5551251−6.76 × 10⁻⁴
1600.250.100625295.6107732295.6136835−2.91 × 10⁻³
The probe is the cell centre nearest x = L/2, so it moves as the mesh refines and the exact column is re-evaluated at each probe position rather than at the midplane. Measured and exact columns are both from the fixture.

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.

The same mesh study run at a 1 s time step, kept as a fixture
Cells along xΔt (s)L1 (K)Observed order
401.09.210646 × 10⁻³
801.08.365059 × 10⁻³0.139
1601.08.172662 × 10⁻³0.034
A measured run, not a constructed one. The orders are computed from those L1 values and are the reason the published mesh study uses a 0.02 s step instead.

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.

The same case staged without asking for a transient, kept as a fixture
Cells along xΔt (s)L1 (K)L∞ (K)Midplane probe (K)
200.021.45165932.2893584297.460000
400.021.45054002.2898719297.705000
800.021.45026002.2900698297.827500
1601.0 / 0.5 / 0.251.45019012.2900842297.888749
The last row is three separate runs at three time steps differing by a factor of four; all three returned identical numbers to seven figures, which is the signature of a dropped time derivative.

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 Δtx² 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.

All validation cases · Written by the team building SHD Sim.