In this paper we present the algorithm and implementation of an open-source immersed boundary code sdfibm, which is based on OpenFOAM v6 and written in C++. The immersed boundary method (“ibm” of the name) treats the velocity field as the volume average of fluid and solid velocities, and applies the volume-average discrete forcing to account for the fluid–solid interaction. The signed distance field (“sdf” of the name) representation of the solid shape, together with the proposed pyramid decomposition method, allow accurate calculations of the volume fraction field created by solids overlapping with an arbitrary unstructured fluid mesh. SDF removes the need of intersection test between the solid and fluid mesh, or the discretization and re-sampling of the solid shape. Users can freely combine different components (shapes, materials, and motion constraints) into new solids within the plain-text input file, and implement new shapes and motion constrains easily. sdfibm is an efficient and robust tool for exploring complex fluid–solid interactions in a fully-resolved sense, and can generate data for closure models in upscaling procedures.
Supplementary notes can be added here, including code, math, and images.