libCEED
libCEED copied to clipboard
examples/fluids: unstructured distance function
Computing distance from walls is necessary for some turbulence models and to create initial conditions for which the initial transient is not too extreme. The Eikonal equation offers a proper way to solve this equation, but it's difficult to solve scalably using variational methods. This paper compares several strategies and suggests a simple method:
- Solve $-\nabla^2 \phi = 1$ with boundary condition $\phi=0$ on no-slip walls.
- Compute distance as $d = \sqrt{\lVert \nabla \phi \rVert^2 + 2\phi} - \lVert \nabla \phi \rVert$.
This is accurate near walls, but not in the far field (where accurate distance isn't physically important). This requires solving one Poisson system and then evaluating the solution at quadrature points, which is where distance is needed in a turbulence model. If "nodal" distance is required, it can be projected into a nodal space using a (lumped) $L^2$ projection.