C++ code for running Computational fluid dynamics (CFD) simulation of larval zebrafish, and MATLAB code for preprocessing and postprocessing. See the companion preprint Behavioral adaptation to changing energy constraints via altered frequency of movement selection by Thomas Darveniza, Shuyu I Zhu, Zac Pujic, Biao Sun, Matthew Levendosky, Robert Wong, Ramesh Agarwal, Michael H McCullough, Geoffrey J Goodhill for more information.
To facilitate use of this CFD software by others, we demonstrate how to run a randomly-selected 9 dpf larval zebrafish swim bout through the CFD simulation pipeline.
Preprocess the swim bout according to steps described in the paper.
Following successful preprocessing, the swim bout should be in a similar form to simulation/zebrafish_2D_coords.txt
. To better understand this form, run the script preprocess/preSimVis.m
.
- Following successful simulation, there should be two new folders:
ZFISH3d
, andexamplespline.txt
.ZFISH3d
contains various IBAMR outputs, including power expenditureexamplespline.txt
contains tracking points on the 3D fish during simulation, which is used during validation
- Navigate to
postprocess/postprocess.m
, and run the post-processing functions
This code requires MATLAB (tested on R2021b–R2023b) for the pre/postprocessing, make
or cmake
and IBAMR library (tested on 0.{8,9,13,14}.0, currently 0.14.0 is used) for the main CFD simulation.
Thomas Darveniza [email protected]