The plane-cube intersection problem has been around in literature since 1984 and iterative solutions to it have been used as part of piecewise linear interface construction (PLIC) in computational fluid dynamics simulation codes ever since. In many cases, PLIC is the bottleneck of these simulations regarding compute time, so a faster, analytic solution to the plane-cube intersection would greatly reduce compute time for such simulations. We derive an analytic solution for all intersection cases and compare it to the one previous solution from Scardovelli and Zaleski (Ruben Scardovelli and Stephane Zaleski. "Analytical relations connecting linear interfaces and volume fractions in rectangular grids". In: Journal of Computational Physics 164.1 (2000), pp. 228-237.), which we further improve to include edge cases and micro-optimize to reduce arithmetic operations and branching. We then extend our comparison regarding compute time and accuracy to include two different iterative solutions as well. We find that the best choice depends on the employed hardware platform: on the CPU, Newton-Raphson is fastest with vectorization while analytic solutions perform better without. The reason for this is that vectorization instruction sets do not include trigonometric functions as used in the analytic solutions. On the GPU, the fastest method is our optimized version of the analytic SZ solution. We finally provide details on one of the applications of PLIC: curvature calculation for the Volume-of-Fluid model used for free surface fluid simulations in combination with the lattice Boltzmann method.
翻译:自1984年以来,平方立方体交叉点问题一直出现在文献中,自1984年以来,对平方立方体交叉点问题一直被文献中,迭代解决办法一直被用作计算流体动态模拟代码中折叠线性界面构造的一部分。在许多情况下,PLIC是这些模拟关于计算时间的瓶颈,因此对平方十字点的快速分析解决方案将大大降低此类模拟的计算时间。我们为所有交叉点案例得出一个分析解决方案,并将其与Scardovelli和Zaleski(Ruben Scardovelli和Stephane Zaleski)的先前一个解决方案(Ruben Scardovelli和Stephane Zaleski ) 。“将线性界面和体积部分连接到矩形网格中。 ”在《对正方形物理学物理杂志》164.1(2000),第228-237页。 我们进一步改进这些模拟模型包括边际案例和微操作法, 从而减少算操作和分解法的精确度, 然后我们扩大我们关于计算时间和精度的比较方法的比较, 包括两个不同的迭代方解决方案。我们的最佳选择取决于所使用的硬件平台:在 CPPPPPU, New-d-drodrodeal- licalalalalalalalalalalalal commal commation commal commal commus commus laus la laus laus la lax lax lax lax laus lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax lax la