{"id":35677934,"url":"https://github.com/haimingz/vivsim","last_synced_at":"2026-01-29T18:52:36.840Z","repository":{"id":231351876,"uuid":"781555346","full_name":"haimingz/vivsim","owner":"haimingz","description":"Accelerated vortex-induced vibration (VIV) simulation using immersed boundary lattice Boltzmann method (IB-LBM) powered by JAX.","archived":false,"fork":false,"pushed_at":"2025-12-26T07:05:34.000Z","size":7195,"stargazers_count":28,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-27T18:49:23.425Z","etag":null,"topics":["cfd","jax","lbm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haimingz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-03T15:51:22.000Z","updated_at":"2025-12-26T07:05:37.000Z","dependencies_parsed_at":"2025-01-20T02:30:13.147Z","dependency_job_id":"0441c6ce-6a48-44d0-ae28-2f53d0c3eaca","html_url":"https://github.com/haimingz/vivsim","commit_stats":null,"previous_names":["haimingz/vivsim"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/haimingz/vivsim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haimingz%2Fvivsim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haimingz%2Fvivsim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haimingz%2Fvivsim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haimingz%2Fvivsim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haimingz","download_url":"https://codeload.github.com/haimingz/vivsim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haimingz%2Fvivsim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28882410,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T16:41:59.663Z","status":"ssl_error","status_checked_at":"2026-01-29T16:39:39.641Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cfd","jax","lbm"],"created_at":"2026-01-05T20:00:39.200Z","updated_at":"2026-01-29T18:52:36.835Z","avatar_url":"https://github.com/haimingz.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":["New Libraries"],"readme":"\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src =\"assets/vivsim.svg\"/\u003e\u003cbr/\u003e\u003cbr/\u003e\n\u003c/p\u003e\n\n## VIVSIM \n\n[![GitHub Traffic](https://img.shields.io/badge/dynamic/json?color=success\u0026label=Views\u0026query=count\u0026url=https://gist.githubusercontent.com/haimingz/b2e30dd706e57413c1c1f688de82ef6e/raw/traffic.json\u0026logo=github)](https://github.com/MShawon/github-clone-count-badge) [![GitHub Clones](https://img.shields.io/badge/dynamic/json?color=success\u0026label=Clone\u0026query=count\u0026url=https://gist.githubusercontent.com/haimingz/8981033dc17c32a7c2f409e631b57309/raw/clone.json\u0026logo=github)](https://github.com/MShawon/github-clone-count-badge)\n\n\nVIVSIM is a Python library for accelerated fluid-structure interaction (FSI) simulations based on the immersed boundary -lattice Boltzmann method (IB-LBM). It was originated from a research project requiring efficient simulation codes for studying vortex-induced vibration (VIV) of underwater structures. \n\nInspired by projects like [JAX-CFD](https://github.com/google/jax-cfd) and [XLB](https://github.com/Autodesk/XLB), VIVSIM utilizes [JAX](https://github.com/jax-ml/jax) as the backend to harness the power of hardware accelerators, achieving massive parallelism on GPU/GPUs. \n\n\n\n## Recent Updates\n\n**Version 1.1.0** (October 2024)\n- **Modular LBM Architecture**: Reorganized all LBM-related code into a structured `lbm` module with submodules for `boundary`, `collision`, and `forcing`, enabling easier maintenance and future extensions with new methods.\n- **Enhanced Boundary Conditions**: Implemented more boundary condition methods including Non-Equilibrium Extrapolation (NEE), Non-Equilibrium Bounce Back (NEBB), and equilibrium boundary conditions. Support predescribed velocity, density, and forces.\n- **Improved LBM Collision Operators**: Implemented Karlin-Bösch-Chikatamarla (KBC) collision operator that is super stable for high Re numbers.\n- **New Forcing Scheme**: Implemented the modified Exact Difference Method (EDM) which requires no correction to the collision operator when there are forces..\n- **Code Quality**: Improved code readability, fixed typos in docstrings, and enhanced documentation throughout the codebase using AI with my supervision. \n\n\n## Usage\n\nVIVSIM provides a collection of **pure functions** for IB-LBM computations. Users can construct custom simulation models for different tasks. Start with the included demo examples to see how easy that is! \n\nBelow is a minimum workable example for lid-driven cavity simulation:\n\n```python\nimport jax\nimport jax.numpy as jnp\nfrom vivsim import lbm\n\n# define constants\nU0 = 0.5  # velocity of lid\nNU = 0.1  # kinematic viscosity\n\nOMEGA = lbm.get_omega(NU)  # relaxation parameter\n\n# define fluid properties\nrho = jnp.ones((NX, NY), dtype=jnp.float32)      # density\nu = jnp.zeros((2, NX, NY), dtype=jnp.float32)    # velocity\n\n# initialize distribution function\nf = lbm.get_equilibrium(rho, u)\n\n# define compute routine\n@jax.jit\ndef update(f):\n    \n    # Collision\n    rho, u = lbm.get_macroscopic(f)\n    feq = lbm.get_equilibrium(rho, u)\n    f = lbm.collision_bgk(f, feq, OMEGA)\n\n    # Streaming\n    f = lbm.streaming(f)\n\n    # Boundary conditions\n    f = lbm.boundary_nee(f, loc='left')\n    f = lbm.boundary_nee(f, loc='right')\n    f = lbm.boundary_nee(f, loc='bottom')\n    f = lbm.boundary_nee(f, loc='top', ux_wall=U0)\n    \n    return f, rho, u\n\n# start simulation\nfor t in range(TM):   \n    f, rho, u  = update(f)\n\n    # export data \u0026 visualization ...\n\n```\n\n## Examples\n\n_Lid-driven cavity at Re = 2e4 on a 1000x1000 lattice grid_\n\n\u003cimg src=\"assets/cavity.gif\" alt=\"Lid-driven cavity flow\" width=\"300\"\u003e  \n\n_Flow passes some texts on a 1000x1000 lattice grid_\n\n\u003cimg src=\"assets/text.gif\" alt=\"Flow past text\" width=\"300\"\u003e  \n\n_VIV of a cylinder with U_r = 5 and Re = 1e2_\n\n\u003cimg src=\"assets/viv_100.gif\" alt=\"VIV at Re = 1e2\" width=\"300\"\u003e  \n\n_VIV of a cylinder with U_r = 5 and Re = 1e4_\n\n\u003cimg src=\"assets/viv_10000.gif\" alt=\"VIV at Re = 1e4\" width=\"300\"\u003e  \n\n## Capabilities\n\nLattice Models\n- D2Q9\n  \nCollision Models\n- Bhatnagar-Gross-Krook (BGK) collision operator\n- Multiple Relaxation Time (MRT) collision operator\n- Karlin–Bösch–Chikatamarla (KBC) collision operator\n\nBoundary Conditions:\n- Predescribed velocity, density, and forces at boundaies using: \n  - Non-Equilibrium Bounce Back (NEBB) method\n  - Non-Equilibrium Extrapolation (NEE) method\n  - Equilibrium boundary\n- Predescribed velocity boundary using\n  - Bounce-Back method (no-slip)\n  - Specular Reflection (slip)\n- Periodic boundary\n\nForcing Schemes:\n- Guo's Forcing sheme\n- Modified Exact Difference Method (EDM)\n\nFluid-Structure Interaction\n- Multi-Direct-Forcing (MDF) Immersed Boundary method.\n\nAcceleration techniques\n- Multi-GPU simulation (using JAX)\n- Gird refinement (shown below)\n- Dynamic IB region (shown below)\n\n\u003cimg src=\"assets/grid_refinement.png\" width=500 /\u003e\n\n## Todos\n\n- Standardized simulation routines.\n- 3D simulation capability.\n\n\n## Getting Started\n\nTo locally install VIVSIM for development:\n\n```bash\ngit clone https://github.com/haimingz/vivsim.git\npip install -e vivsim\n```\nThis package is based on JAX, whose installation may depend on the OS and hardware. If the above command does not work well, please refer to the [JAX Documentation](https://jax.readthedocs.io/en/latest/installation.html) for the latest installation guidance. \n\nMore detailed instructions can be found in our [Documentation](https://github.com/haimingz/vivsim/wiki/Installation).\n\n## Cite VIVSIM\n\nIf you find this repo useful, please cite [our paper](https://asmedigitalcollection.asme.org/OMAE/proceedings-abstract/OMAE2024/87844/1202724):\n```\n@article{zhu2025gpu,\n  title={{GPU} Accelerated Vortex-Induced Vibration Simulation Using {JAX}: Efficiency and Accuracy Strategies},\n  author={Zhu, Haiming and Yang, Yuan and Du, Zunfeng and Yu, Jianxing},\n  journal={Computers \\\u0026 Fluids},\n  pages={106913},\n  year={2025},\n  publisher={Elsevier}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaimingz%2Fvivsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaimingz%2Fvivsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaimingz%2Fvivsim/lists"}