Modified Eikonal Equation
COMSOL Multiphysics uses a modified eikonal equation based on the approach in Ref. 1. This modification changes the dependent variable from D to G = 1/D. Equation 16-16 then transforms to
(16-17)
Additionally, the modification adds some diffusion and multiplies G4 by a factor to compensate for the diffusion. The result is the following equation, which the Wall Distance interface uses:
(16-18)
where σw is a small constant. If σw is less than 0.5, the maximum error falls off exponentially when σw tends to zero. The default value of 0.2 is a good choice for both linear and quadratic elements.
The boundary conditions for Equation 16-18 is G = G0 = C/lref on solid walls and homogeneous Neumann conditions on other boundaries. The effect of C is that the solution becomes less smeared the higher the value of C. The error tends asymptotically to 0.2lref as C tends to infinity, but making it very large destabilizes Equation 16-18. C is 2 in the Wall Distance interface.
The effect of lref is loosely speaking that the distance to objects larger than lref is represented accurately, while objects smaller than lref appear to be further away than their exact geometrical distance. For a channel, lref should typically be set to the channel width or there about. lref has a lower bound in that it must be larger than all cells adjacent to any boundary where the boundary condition G = G0 is applied; otherwise, the solution displays oscillations. lref is the only parameter in the model, and the default value is half the shortest side of the geometry bounding box. If the geometry consists of several very slender entities, or if the geometry contains very fine details, this measure can be too large. Then define lref manually.
The initial value is by default defined as G0 = 2/lref, in correspondence with the boundary conditions.
The wall distance Dw = 1/G − 1/G0 is a predefined variable that is used for analysis. You also have access to a vector-valued variable that represents the direction toward the nearest wall, which is defined as
(16-19)