A thermofluid simulation tool based on the lattice Boltzmann method (LBM) was developed using HTML and JavaScript. This tool enables users to analyze the forced convection cooling of a heated cylinder through an intuitive GUI. It features animated visualization of both the flow and temperature fields during the LBM computation. Our simulation code employs LBM to calculate both the velocity and temperature fields. The no-slip boundary condition on the cylinder is imposed using the immersed boundary method, specifically the Multi-Direct Forcing Method. Although JavaScript is generally considered unsuitable for computationally intensive numerical simulations, we implemented two algorithmic optimizations and improved the rendering method to achieve practical performance. In particular, all two-dimensional arrays storing physical quantities were converted into one-dimensional arrays. Furthermore, to avoid redundant computation of weighting functions in the immersed boundary method, these functions were precomputed and stored in arrays. As a result, our tool runs at over 600 steps per second on a 200×80 lattice (16,000 nodes). This study demonstrates the applicability of client-side physics simulation using HTML and JavaScript to various engineering design problems. A representative forced convection problem, relevant to the thermal design of electronic components, is used as a case study.
Nakazawa et al. (Wed,) studied this question.