Skip to content

talmolab/mosquito-cfd

Repository files navigation

Mosquito Swarm CFD

CI Docker

GPU-accelerated CFD simulations of mosquito flight aerodynamics using IAMReX (Immersed-boundary Adaptive Mesh Refinement).

Purpose

Prototype simulations for the APEX supercomputing proposal, validating against van Veen et al. (2022) mosquito wing aerodynamics.

Quick Start

Using Docker (Recommended)

# Pull the pre-built FP64 image
docker pull ghcr.io/talmolab/mosquito-cfd:fp64

# Run with GPU support
docker run --gpus all -it -v $(pwd):/workspace ghcr.io/talmolab/mosquito-cfd:fp64

# Inside container: run FlowPastSphere example
cd /opt/cfd/IAMReX/Tutorials/FlowPastSphere
mpirun --allow-run-as-root -np 1 ./amr3d.gnu.MPI.CUDA.ex inputs.3d.flow_past_sphere max_step=10

Available images:

  • ghcr.io/talmolab/mosquito-cfd:fp64 - Validation (accurate, currently recommended)
  • ghcr.io/talmolab/mosquito-cfd:fp32 - A40 prototyping (blocked: upstream bug)
  • ghcr.io/talmolab/mosquito-cfd:python - Post-processing only

See docker/README.md for full documentation.

Manual Build

Prerequisites

  • CUDA 12.x with A40 or newer GPU
  • MPI (OpenMPI recommended)
  • GNU compilers (g++, gfortran)

Clone Dependencies

cd /path/to/mosquito-cfd
git clone https://github.com/ruohai0925/amrex
git clone https://github.com/ruohai0925/AMReX-Hydro
git clone https://github.com/ruohai0925/IAMReX.git -b development

Build (A40 GPU, FP32)

cd IAMReX/Tutorials/FlowPastSphere
export AMREX_HOME=/path/to/mosquito-cfd/amrex
export AMREX_HYDRO_HOME=/path/to/mosquito-cfd/AMReX-Hydro

# Edit GNUmakefile:
#   USE_CUDA=TRUE
#   CUDA_ARCH=86
#   PRECISION=FLOAT

make -j$(nproc)

Run

mpirun -np 1 ./amr3d.gnu.MPI.CUDA.ex inputs.3d.flow_past_sphere max_step=10

Directory Structure

mosquito-cfd/
├── src/mosquito_cfd/ # Python utilities (marker generation, metadata, force surrogate)
├── scripts/          # Thin CLI drivers over the library (e.g. run_sweep.py, extract_forces.py)
├── examples/         # Validation cases + force-surrogate sweep corpus
├── cluster/argo/     # Argo Workflows for cluster-side sweep orchestration
├── docker/           # Dockerfiles and build documentation
├── .github/workflows/# CI/CD pipelines
├── openspec/         # Specification-driven development
├── pyproject.toml    # Python project configuration
└── uv.lock           # Dependency lockfile

Hardware Notes

The NVIDIA A40 has strong FP32 (37.4 TFLOPS) but weak FP64 (0.585 TFLOPS). We use PRECISION=FLOAT for development and validate accuracy against FP64 spot-checks.

References

  • van Veen et al. (2022). "The unsteady aerodynamics of insect wings with rotational stroke accelerations." Journal of Fluid Mechanics, 936, A3. DOI
  • IAMReX GitHub
  • AMReX Documentation

License

TBD

About

CFD simulations of mosquito flight aerodynamics using IAMReX

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors