Numerical Methods · interactive worked example
Laplace's equation on a rectangle is easy to mesh — every interior point looks the same. Cut a slanted wall into the domain and suddenly the mesh itself has to be generated automatically, node by node, before you can even write the equations.
From the site author's own Mathematica work, presented in "Report from the Trenches: Tips, Tricks and Traps for Mathematica Programmers" — reading geometry from input points, auto-generating the FD grid, and solving, for a potential-flow conduit problem.
Velocity field u(x,y) — solved live on the cut-corner conduit
—
None of this changes if you swap "potential flow velocity" for "steady-state temperature" or "electrostatic potential" — Laplace's equation doesn't know which physics it's describing. The geometry-handling machinery is the actual reusable skill.
With both free-surface velocities at 10 m/s (the original problem's values), this lab's solve reproduces the original notebook's printed solution exactly — every one of the 23 interior values matches to six decimal places. Try making the exit velocity larger than the entrance: the flow accelerates through the narrowing/widening geometry, and the contour bands compress near the slanted wall where the domain changes shape fastest.
EngineeringCandy · Mesh generated and matrix solved live, from raw boundary points · the slanted wall is just data, not a special case in the code