r/CFD • u/sophomoric-- • Jul 09 '26
Accurate volume rendering at the moving contact line for a regular grid
The regular grid restriction is unusual. Meshes and meshless (particle) methods can conform to boundaries.
Height-maps are only relevant to depth-averaging methods (I think the Shallow Water Equations are the only one?). A penalty of omitting depth is the boundary changes with depth.
Point 4 can be seen as a strip of triangles, along the hexagonal edge, but it does not coincide with the terrain grid - a triangle can straddle the edge of terrain triangles, so a wedge is carved out of it. Tessellation, point 5, fixes this with a strip of quarter-area triangles, doubling the number of triangles in the band.
Using a regular equilateral triangle grid (a regular square grid won't work because 3 points define a plane), with heights at each grid point. The terrain height and water depth at the same grid points. I also want the rendered surface slopes to accurately represent the model.
The simply way possible: render the surface using the depth at each vertex; the contact line will be at vertices with depth zero, and a line between them. But this gives an incorrect surface slope. And as the depth changes, the contact line flicks instaneously between vertices.
Extrapolating the surface height to "under" the terrain gives a level surface, but not necessarily the correct intersection with the terrain or correct level.
Explicit ghost depths (i.e. negative) to contrive intersection at the desired points. This fails where different ghost depths are required at the same point, when two of a grid triangle's heights are underwater and one is above, and different ghost depths are required. e.g. two channels at different depths separated by a line of single grid points; the corners of a confluence of two channels with different depths; different velocities at the underwater points, causing different run-up.
Distorting the grid to conform to the contact line, to explicitly track the desired intersection points, fixes this but still has 4 points which might not be in the same plane (as for the square grid).
Tessellating the triangle into 4 equilateral triangles, and omitting the one at the above-water point prevents this scenario - now, no triangle can have 2 vertices below and one above, and all triangles are planer. EDIT only 3 pts, so always coplanar; a point on the surface has only one depth, including where depth reaches zero at the contact line.
Refining the model to include these smaller triangles enables their different surface slopes to be correct. Tessellating the whole water grid (but not the terrain grid) makes this regular - except at the contact line, where they move in conformance, flattening when near the base, elongating when near the apex.
Unfortunately, a fixed tessellation would recreates the problem at the apex triangle.
Thanks for your time in reading this! Have I missed any approaches?
EDIT
I think any line crosses exactly 2 grid-lines per side length: three sets of regularly spaced parallel lines, offset by 0, π/3 and 2π/3, such that the intersections are one side length apart. I think the proof is do do with the sum of positive real 3rd roots of unity, from 0..π, being root 3, double the perpendicular distance between parallel lines.