Skip to content
canoPdevPublic

About

Finite volume code for compressible single-phase and two-phase flows with AMR. Based on the kalypsso library, built on p4est octrees and kokkos; the physics is written in Python with pykokkos, compiled for CPU/GPU at run time.

Topics

Resources

Contributing

Stars

14 stars

Watchers

2 watching

Forks

Latest commit

 

History

96 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

canoP

canoP is a finite volume code for compressible single-phase and two-phase flows on adaptive meshes, for CPUs and GPUs. The mesh and its adaptive refinement come from the kalypsso library, built on p4est octrees and Kokkos; the physics of each model is written in Python with pykokkos and compiled for the CPU or the GPU at run time.

Documentation: https://canop.readthedocs.io

CI Documentation License: Apache-2.0 WITH LLVM-exception

Models

  • onephase: single-phase Euler and Navier-Stokes equations, Noble-Abel stiffened gas;
  • twophase5eq: five-equation model of two phases in mechanical equilibrium (Padioleau 2021);
  • twophase7eq: seven-equation Baer-Nunziato model with pressure and velocity relaxations (Chen 2019).

HLL, HLLC and all-regime fluxes with non-conservative products, MUSCL reconstruction with scalar limiters, forward Euler or SSP Runge-Kutta 2, viscous and thermal fluxes, gravity, block-based AMR driven by the jumps of any variable, MPI.

A new initial condition, boundary condition, flux or model is a Python file or directory of physics/: no need to compile canoP again.

Quick start with canoP studio

canoP studio is a web application to edit the input files, build canoP, run simulations and parameter studies (each with its versioned physics) and look at the results. It runs in VS Code in the browser (code-server), on a cluster login node or on a Linux or macOS computer, and serves its tools over MCP to AI agents such as Claude Code (.mcp.json, AGENTS.md).

git clone --recurse-submodules https://github.com/canoPdev/canoP.git
cd canoP
tools/install-code-server.sh

tools/install-code-server.sh installs code-server with the Claude Code and canoP studio extensions, prepares the Python environment of the studio (a few minutes, once) and starts code-server in the background. Everything goes into .local/ of the clone, ignored by git (--user installs once for your account instead). It needs curl, Python 3.10 or later and access to the internet.

It prints the address to open, http://localhost:<port>/, and the file that holds its password; on a remote machine, open first the ssh tunnel that it prints (ssh -L <port>:localhost:<port> <host>). In VS Code, the canoP icon of the left bar starts canoP studio, and the Claude panel asks you to log in once.

code-server keeps running after the terminal or the ssh connection is closed. To start it again, for example after a reboot of the machine:

tools/start-code-server.sh

The studio builds canoP with the dependencies below; on a cluster, set the environment modules in its build settings.

Quick start from the command line

Dependencies: a C++17 compiler, CMake, MPI, HDF5 and Python 3.11 to 3.14 (numpy and pybind11 3.1.0 are installed in a venv when missing); the CUDA toolkit or ROCm for GPUs.

git clone --recurse-submodules https://github.com/canoPdev/canoP.git
cd canoP
cmake -B _build -S . \
  -DCANOP_KALYPSSO_CORE_BUILD=ON \
  -DKALYPSSO_CORE_KOKKOS_BACKEND=OpenMP \
  -DKALYPSSO_CORE_BUILD_P4EST=ON \
  -DKALYPSSO_CORE_BUILD_SPDLOG=ON
cmake --build _build --parallel 8
mpirun -np 4 _build/src/canoP_2d settings/settings_onephase_blast.ini

The first run of a model compiles its kernels (about 10 s each, kept in _build/pykokkos_cache). See the documentation for GPUs, the input file and the physics.

Tests

cmake -B _build -S . -DCANOP_ENABLE_TESTING=ON ...
cd _build && ctest -L unit && ctest -L regression && ctest -L physics

Citing and licence

See CITATION.cff. canoP is distributed under the Apache License 2.0 with LLVM exception (LICENSE).

About

Finite volume code for compressible single-phase and two-phase flows with AMR. Based on the kalypsso library, built on p4est octrees and kokkos; the physics is written in Python with pykokkos, compiled for CPU/GPU at run time.

Topics

Resources

Contributing

Stars

14 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages