Ika is a Māori word meaning any creature that swims in fresh or salt water including marine mammals such as whales.
This is a repository for code to estimate power and thrust of an undulating fish and related simulations.
This repository supports the paper:
Coe, M., & Gutschmidt, S. (2023). IKA-FLOW : A Flexible Body Overset Mesh Implementation for Fish Swimming. OpenFOAM® Journal, 3, 75-119. https://doi.org/10.51560/ofj.v3.89
If you find this repository useful and use it for academic work, please site the paper. It really helps out my career.
@article{coe_ika-flow_2023, title = {IKA-FLOW: A Flexible Body Overset Mesh Implementation for Fish Swimming}, volume = {3}, issn = {2753-8168}, shorttitle = {IKA-FLOW}, url = {https://journal.openfoam.com/index.php/ofj/article/view/89}, doi = {10.51560/ofj.v3.89}, journal = {OpenFOAM® Journal}, author = {Coe, Michael and Gutschmidt, Stefanie}, month = jul, year = {2023}, keywords = {CFD, fish simulation, fish swimming, overset swimming}, pages = {75--119}, }
A copy of this repository is also available on figshare at:
https://doi.org/10.26021/canterburynz.33411658
Copy the folder OpenFOAM -> dynamicMesh to your working directory. Run wclean and wmake to make compile the solver. Note that the solver is working with OpenFoam v2206, currently.
There are 6 motion functions in the folder: Ika-Flow/OpenFOAM/dynamicMesh/motionSolvers/displacement/fishBody/fishBodyMotionFunctions that are based on the standard existing OpenFOAM displacement functions. If you create a new one, make sure to update the files document in Ika-Flow/OpenFOAM/dynamicMesh/Make so that it will be compiled when you run wmake.
Point motion is calculated down the tail of the fish (airfoil) at each timestep and then displaced by a certain amount. Important here is that you want to choose a suitable timestep so that displacement isn't large enough to cause errors. In practice, I had to manually tune this part in order to determine a value that efficiently ran the simulation and gave accurate enough results.
A test case is supplied in the folder OpenFOAM -> testCase. There are two folders here: mesh, and st0_40. The mesh folder holds the mesh and background mesh. The st0_40 has carangiform motion at a Strouhal number of 40.
First, you need to make sure all the files are executable. You can navigate to the top level folder testCase and run the following command:
find . -wholename "**/*.sh" -exec chmod +x {} \;Then you can create the mesh by navigating to the OpenFOAM -> testCase -> mesh folder and running
./run_mesh.shThe important part here is that the topSetDict_movingZone is executed. This is what sets the overset mesh as the moving zone and lets the solver know you want to move this part of the mesh.
To run the case, you navigate to OpenFOAM -> testCase -> st0_40 and use the command
./run_all.shImportant here is that the *controlDict has libs entries for both "liboverset.so" and the solver entry (which I have named "libfishBodyMotion.so"). Another important point here is that the dynamicMeshDict is set up with the moving zone and the proper coefficients to define the movement you want.
The folders are structured as follows:
The GMSH folder has scrips and .geo files for making an airfoil in gmsh.
The Lighthill folder contains ipython notebooks to model forces and energy via Lighthill's theorem. This was just a play around and shouldn't be taken too seriously.
This folder was used to model motions, forces, and energy from images of fish.
This folder holds all the files for the solver and a test case. Furthermore, all the post-processing scripts for after the cases are run.
This folder contains the script to compare the results to that of Yu et al.