Skip to content
SHD Sim
Menu

Validation/Electrostatics

Electrostatic plates

The product’s own staged Electrostatics case, measured against the parallel-plate closed form — and the demonstration that the potential field cannot see the permittivity at all.

VerificationCapacitance 2.8333401068 pF against the closed form, +2.4 × 10⁻⁷ %

Why this case

The electrostatics family that runs on OpenFOAM had no reference of any kind behind it. Its solver-reference entry lists one solver, electrostaticFoam, with three outputs marked as built and nothing standing behind them.

This page is not the parallel-plate capacitor again, and the distinction matters enough to state it before any number. That case runs on Elmer, through StatElecSolve. This one runs on OpenFOAM, through electrostaticFoam. The deck writer, the mesher, the solver and the field reader are four separate pieces of code in the two cases, and they share none of themselves. Agreement in one says nothing about the other.

The second difference is what is being measured. The Elmer case is a bar meshed for the benchmark. This one is the case the product itself stages, taken exactly as --analysis=Electrostatics --dump-case writes it, with two output-control tokens changed for the reason set out below and nothing else touched. Every number in the reference is arithmetic on that deck’s own inputs, read back out of the staged dictionaries rather than typed into the harness.

PhysicsElectrostatic, no free charge — Laplace’s equation in φ
SolverOpenFOAM electrostaticFoam, on the product’s own staged case
DomainA hex block 1 × 0.8 × 0.4 m at 40 × 32 × 16 cells — 20 480 cells
Appliedanode at x = 0 held at 1000 V, cathode at x = 1 m held at 0 V
SidesEvery other face zero-gradient in φ; ρ = 0 everywhere
Permittivityε₀ = 8.85418782 × 10⁻¹² F/m, as the deck writes it
ReferenceParallel-plate electrostatics: a linear potential, a uniform field V/d, and the closed-form capacitance
AgreementCapacitance 2.8333401068 pF against ε₀A/d = 2.8333401001 pF, +2.4 × 10⁻⁷ %
Last run2026-08-28

The closed form, and what the deck makes of it

Two whole opposite faces of a block held at fixed potentials, every other face zero-gradient, and no free charge anywhere. That is a parallel-plate capacitor with the gap entirely filled, so:

    phi(x) = V (1 - x/d)      E = V/d      C = epsilon0 A / d

with V = 1000 V, d = 1 m and A = 0.8 × 0.4 = 0.32 m². The solver-reference table cites the charged-wire tutorial as this family’s OpenFOAM example. The charged wire is not what the product stages, and a reference has to match what is run, so it is not the reference here.

The reference, computed from the staged deck’s own inputs
QuantityValue
E = V/d1000 V/m exactly
Plate area A0.32 m²
Gap d1.0 m
C = ε₀A/d2.8333401000960 × 10⁻¹² F
ε₀ used for the reference8.8541878128 × 10⁻¹² F/m (CODATA)
ε₀ in the staged deck8.85418782 × 10⁻¹² F/m
The deck's permittivity is the CODATA value truncated in the tenth significant figure, which is where the +2.4 × 10⁻⁷ % on the capacitance below comes from. It is a property of the deck, not of the solve.

Two defects in the staged case, found by running it

Neither is judged as a measurement, and neither can change an answer. They are recorded because they are why the harness has to touch the deck at all, and because they are product findings rather than harness ones.

  • The staged case writes no solution. Its controlDict carries an end time of 1 with a write interval of 100. The first write time is a hundred times the end of the run. electrostaticFoam executes all 1000 iterations, converges, prints End, and leaves behind exactly one time directory — the initial condition. There is nothing to post-process and nothing to look at.
  • All three probes are outside the mesh. The probe function object samples z = −1.8, −4.05 and −6.3 in a domain whose z runs from 0 to 0.4 m. Every one is skipped and the function object produces nothing at all.

So the harness edits exactly two tokens of the control dictionary — the write interval from 100 to 1, and the write format from binary to ascii — and records both edits in the JSON it writes. Both are output controls, read after the equations are solved, and neither is capable of moving a number below.

Result

Measured against the closed form on the product’s staged case
QuantityMeasuredClosed formDifference
E along the gap1000.0000016 V/m1000 V/m+1.6 × 10⁻⁷ %
Capacitance2.8333401068 × 10⁻¹² F2.8333401001 × 10⁻¹² F+2.4 × 10⁻⁷ %
φ against V(1 − x/d)1.53 × 10⁻⁵ % RMS of V
E spread, plane to plane6.47 × 10⁻⁷0
φ spread across a plane1.01 × 10⁻⁶ of V0
Interior range of φ0.975 of V
Largest free charge density0.00
All seven read out of the fixture the harness writes, on 20 480 cells. E is measured plane to plane along x, across the forty planes of the mesh.

The interior range is in that table because the initial condition is a uniform zero and a solve that never moved off it would still print End and exit cleanly. Spanning 0.975 of the applied voltage is what forty cells can span between two plates; a run whose field never moved would read 0.

The potential cannot see the permittivity

The agreement in the first row of that table is nearly free, and this page would be overclaiming if it led with it.

Something similar, for a different reason, is true of φ’s agreement with V(1 − x/d). The exact answer here is linear, and a linear function sits inside the finite-volume space exactly, at any mesh density. Eight figures is what any consistent scheme returns on this problem however coarse the mesh. So the φ RMS is reported last on this page, and its band in the judge is set five orders of magnitude looser than the measurement, deliberately.

The shape checks, and the fixture that breaks them

Because the field strength is weak evidence, the case is built on whether the field is the shape the reference describes: uniform along the gap, and constant across it. Both are independent of the value of E, so they survive a wrong voltage or a wrong gap and they fail on a field that is not parallel-plate at all.

The grounded-walls fixture is that failure, and it is a one-token change to the potential field’s boundary file: the side walls held at 0 V instead of zero-gradient. That turns the problem into a three-dimensional grounded box, for which E = V/d is simply not the answer.

The healthy run against the grounded-walls fixture, on the same mesh
QuantityHealthyWalls grounded
φ spread across a plane1.01 × 10⁻⁶ of V0.723 of V
E1000.0000016 V/m822.536 V/m — −17.75 %
E spread, plane to plane6.47 × 10⁻⁷10.518
Capacitance vs ε₀A/d+2.4 × 10⁻⁷ %−17.75 %
φ RMS vs V(1 − x/d)1.53 × 10⁻⁵ %46.86 %
φ checksum98ede686…d31aa94c…
Both columns from the fixtures. The grounded-walls run is not a wrong answer to this problem; it is the right answer to a different one, which is why the transverse spread is reported before the field strength.

What this page does not establish

  • There is one mesh. Everything on this page is 20 480 cells. There is no refinement study, and on this problem there could not usefully be one: the answer is linear, so it is represented exactly at every density and there is nothing for refinement to improve. That is a statement about the problem, not a result about the solver.
  • The zero-charge check has never been demonstrated to fire. The largest free charge density is exactly 0.0 on every fixture in this case, so the band around it can only be pushed negative. That shows the comparison is wired to the right quantity and shows nothing whatever about its sensitivity. It is not counted as coverage.
  • No fringing is measured. Two entire opposite faces are held at potential and the gap is filled, which makes this a one-dimensional problem with no edge for a field to bulge around — not an approximation to a pair of finite plates in space. Reading the agreement as “fringing is negligible” would be crediting the right answer to the wrong cause.
  • Nothing here is a statement about the Elmer electrostatics path. The two cases share no code. The parallel-plate capacitor covers that one, and arrives at the same conclusion about permittivity by an entirely separate route.

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.