Validating a GPU solidification solver: from +51% to within 3.7%
A fast solver that gives a wrong answer makes a wrong feeding decision look certain. When I wrote the solidification solver behind FoundryFlash, I spent as much time checking it as writing it. This post covers that checking and the error that mattered most. What the solver computes The solver integrates the transient heat equation in enthalpy form, which handles the latent heat released during freezing without special treatment: $$\rho \frac{\partial H}{\partial t} = \nabla \cdot \left( k \nabla T \right), \qquad T = T(H)$$It uses control-volume finite elements on linear tetrahedra and balances energy on the dual volume around each node. Time stepping is implicit backward Euler, solved with a Jacobi-preconditioned conjugate-gradient method. The mould is a region of its own: heat crosses the metal-mould interface through a heat-transfer coefficient \(h\), with flux \(q = h \, (T_\text{metal} - T_\text{mould})\). ...