{"id":31133048,"url":"https://github.com/kandil2001/lid-cavity-evolution","last_synced_at":"2026-05-06T17:32:19.103Z","repository":{"id":313682724,"uuid":"1052266686","full_name":"Kandil2001/Lid-Cavity-Evolution","owner":"Kandil2001","description":"Lid Cavity Evolution is an open-source CFD suite for the lid-driven cavity problem, featuring MATLAB, Python, and parallel solvers with benchmark comparisons.","archived":false,"fork":false,"pushed_at":"2025-09-15T17:58:15.000Z","size":662,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-15T19:23:35.144Z","etag":null,"topics":["benchmarking","cfd","cfd-simulation","lid-driven-cavity","matlab","mpi","numpy","open-source","openfoam","openmp","parallel-computing","python","scientific-computing","simple-algorithm","star-ccm"],"latest_commit_sha":null,"homepage":"","language":null,"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/Kandil2001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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":"2025-09-07T18:34:52.000Z","updated_at":"2025-09-15T17:57:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"f658beb6-1223-4e20-8990-059210291589","html_url":"https://github.com/Kandil2001/Lid-Cavity-Evolution","commit_stats":null,"previous_names":["kandil2001/lid-cavity-evolution"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kandil2001/Lid-Cavity-Evolution","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kandil2001%2FLid-Cavity-Evolution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kandil2001%2FLid-Cavity-Evolution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kandil2001%2FLid-Cavity-Evolution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kandil2001%2FLid-Cavity-Evolution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kandil2001","download_url":"https://codeload.github.com/Kandil2001/Lid-Cavity-Evolution/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kandil2001%2FLid-Cavity-Evolution/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275712384,"owners_count":25514205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-18T02:00:09.552Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["benchmarking","cfd","cfd-simulation","lid-driven-cavity","matlab","mpi","numpy","open-source","openfoam","openmp","parallel-computing","python","scientific-computing","simple-algorithm","star-ccm"],"created_at":"2025-09-18T05:07:58.146Z","updated_at":"2025-09-18T05:08:01.031Z","avatar_url":"https://github.com/Kandil2001.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.mathworks.com/products/matlab.html\"\u003e\n    \u003cimg src=\"logos/matlab.png\" width=\"70\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.python.org/\"\u003e\n    \u003cimg src=\"logos/python.png\" width=\"70\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.openfoam.com/\"\u003e\n    \u003cimg src=\"logos/openfoam.png\" width=\"70\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://plm.sw.siemens.com/en-US/simcenter/fluids-thermal-simulation/star-ccm/\"\u003e\n    \u003cimg src=\"logos/starccm.png\" width=\"70\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e🌀 Lid Cavity Evolution\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\u003ci\u003eA benchmark suite for unsteady incompressible CFD: From MATLAB fundamentals to industrial applications\u003c/i\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Kandil2001/Lid-Cavity-Evolution/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"MIT License\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/Kandil2001/Lid-Cavity-Evolution/releases\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Version-0.1.0-green.svg\" alt=\"Version\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/Kandil2001/Lid-Cavity-Evolution/blob/main/CONTRIBUTING.md\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Contributions-Welcome-orange.svg\" alt=\"Contributions Welcome\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.mathworks.com/products/matlab.html\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/MATLAB-R2020a+-blue.svg\" alt=\"MATLAB\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.python.org/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Python-3.8+-blue.svg\" alt=\"Python\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.openfoam.com/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/OpenFOAM-Supported-lightgrey.svg\" alt=\"OpenFOAM\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://plm.sw.siemens.com/en-US/simcenter/fluids-thermal-simulation/star-ccm/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/STAR--CCM+-Supported-lightgrey.svg\" alt=\"STAR-CCM+\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://mpi-forum.org/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/MPI-Planned-green.svg\" alt=\"MPI\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.openmp.org/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/OpenMP-Planned-green.svg\" alt=\"OpenMP\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/Kandil2001/Lid-Cavity-Evolution/blob/main/CODE_OF_CONDUCT.md\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Code%20of%20Conduct-Active-blueviolet\" alt=\"Code of Conduct\"/\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/Kandil2001/Lid-Cavity-Evolution/blob/main/SECURITY.md\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Security-Policy-informational\" alt=\"Security Policy\"/\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n# Lid Cavity Evolution\n_A benchmark suite for unsteady incompressible CFD: From MATLAB fundamentals to industrial applications_\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Features](#features)\n- [Why the Lid-Driven Cavity?](#why-the-lid-driven-cavity)\n- [Why the SIMPLE Algorithm?](#why-the-simple-algorithm)\n- [Governing Equations](#governing-equations)\n- [SIMPLE Algorithm Steps](#simple-algorithm-steps)\n- [Numerical Methods \u0026 Boundary Conditions](#numerical-methods--boundary-conditions)\n- [Project Roadmap](#project-roadmap)\n- [Project Structure](#project-structure)\n- [Benchmark Table](#benchmark-table)\n- [Getting Started](#getting-started)\n- [Contributing](#contributing)\n- [Code of Conduct](#code-of-conduct)\n- [Security](#security)\n- [Support \u0026 Discussion](#support--discussion)\n- [License](#license)\n- [References](#references)\n- [Citation](#citation)\n- [Contact](#contact)\n\n\n## Introduction\n\n**Lid Cavity Evolution** is an open-source benchmark suite that chronicles the development of the classic lid-driven cavity CFD problem—from foundational MATLAB scripts to industrial-grade solvers. The project emphasizes accuracy, performance, and reproducibility for unsteady incompressible flow simulation.\n\n## Why the Lid-Driven Cavity?\n\n- **Standard Test Case:** Simple geometry, well-defined boundaries, and established reference solutions make it ideal for CFD code verification.\n- **Rich Physics:** Captures vortex formation, boundary layers, and evolving flow structures.\n- **Unsteady Simulation:** Tracks time evolution of flow fields, including transient and nonlinear phenomena.\n\n## Why the SIMPLE Algorithm?\n\nSimulating incompressible flows is numerically challenging due to tight coupling of velocity and pressure. The **SIMPLE (Semi-Implicit Method for Pressure-Linked Equations)** algorithm is widely used because it:\n- Decouples momentum and continuity equations for robust convergence.\n- Uses a staggered grid to prevent checkerboard pressure artifacts.\n- Applies under-relaxation for improved stability and efficiency.\n\n## Governing Equations\n\nThe solver models unsteady, incompressible, two-dimensional flow in a square cavity with a moving lid.\n\n### 1. Continuity Equation (Incompressibility)\n\n$\\nabla \\cdot \\mathbf{u} = 0$\n\n- $\\mathbf{u}$: Velocity vector, $\\mathbf{u} = (u, v)$\n  - $u$: velocity in $x$-direction\n  - $v$: velocity in $y$-direction\n\nThis equation enforces conservation of mass for incompressible flow: the net flow into any control volume is zero.\n\n### 2. Momentum Equations (Navier-Stokes, Unsteady, 2D)\n\n$\\frac{\\partial \\mathbf{u}}{\\partial t} + (\\mathbf{u} \\cdot \\nabla)\\mathbf{u} = -\\nabla p + \\frac{1}{Re}\\nabla^2 \\mathbf{u}$\n\nWhere each term means:\n- $\\frac{\\partial \\mathbf{u}}{\\partial t}$: **Unsteady term** — Time rate of change of velocity.\n- $(\\mathbf{u} \\cdot \\nabla)\\mathbf{u}$: **Convection term** — Transport of momentum by fluid motion.\n- $- \\nabla p$: **Pressure gradient term** — Acceleration caused by pressure differences.\n- $\\frac{1}{Re}\\nabla^2 \\mathbf{u}$: **Diffusion term** — Viscous spreading of momentum.\n- $Re = \\frac{UL}{\\nu}$: **Reynolds number**  \n    - $U$: Lid velocity  \n    - $L$: Cavity length  \n    - $\\nu$: Kinematic viscosity\n\n#### Expanded in 2D Components\n\n- **x-Momentum:**\n\n  $\\frac{\\partial u}{\\partial t} + u \\frac{\\partial u}{\\partial x} + v \\frac{\\partial u}{\\partial y} = -\\frac{\\partial p}{\\partial x} + \\frac{1}{Re} \\left( \\frac{\\partial^2 u}{\\partial x^2} + \\frac{\\partial^2 u}{\\partial y^2} \\right )$\n\n  - $\\frac{\\partial u}{\\partial t}$: Time derivative of $u$\n  - $u \\frac{\\partial u}{\\partial x}$: Convection of $u$ in $x$\n  - $v \\frac{\\partial u}{\\partial y}$: Convection of $u$ in $y$\n  - $-\\frac{\\partial p}{\\partial x}$: Pressure gradient in $x$\n  - $\\frac{1}{Re} \\frac{\\partial^2 u}{\\partial x^2}$: Viscous diffusion in $x$\n  - $\\frac{1}{Re} \\frac{\\partial^2 u}{\\partial y^2}$: Viscous diffusion in $y$\n\n- **y-Momentum:**\n\n  $\\frac{\\partial v}{\\partial t} + u \\frac{\\partial v}{\\partial x} + v \\frac{\\partial v}{\\partial y} = -\\frac{\\partial p}{\\partial y} + \\frac{1}{Re} \\left( \\frac{\\partial^2 v}{\\partial x^2} + \\frac{\\partial^2 v}{\\partial y^2} \\right )$\n\n  - $\\frac{\\partial v}{\\partial t}$: Time derivative of $v$\n  - $u \\frac{\\partial v}{\\partial x}$: Convection of $v$ in $x$\n  - $v \\frac{\\partial v}{\\partial y}$: Convection of $v$ in $y$\n  - $-\\frac{\\partial p}{\\partial y}$: Pressure gradient in $y$\n  - $\\frac{1}{Re} \\frac{\\partial^2 v}{\\partial x^2}$: Viscous diffusion in $x$\n  - $\\frac{1}{Re} \\frac{\\partial^2 v}{\\partial y^2}$: Viscous diffusion in $y$\n\n## SIMPLE Algorithm Steps\n\nThe SIMPLE algorithm solves these equations with the following procedure:\n1. **Predictor Step:**  \n   - Solve momentum equations for an intermediate velocity $\\mathbf{u}^*$ using the current pressure estimate.\n2. **Pressure Correction:**  \n   - Solve the pressure correction Poisson equation:  \n     $\\nabla^2 p' = \\frac{1}{\\Delta t} \\nabla \\cdot \\mathbf{u}^*$  \n     where $p'$ is the pressure correction and $\\Delta t$ is the time step.\n3. **Corrector Step:**  \n   - Update velocities and pressure:  \n     $\\mathbf{u}^{n+1} = \\mathbf{u}^* - \\Delta t \\nabla p'$  \n     $p^{n+1} = p^{n} + \\alpha p'$  \n     where $\\alpha$ is the under-relaxation factor ($0 \u003c \\alpha \\leq 1$).\n\n## Numerical Methods \u0026 Boundary Conditions\n\n- **Spatial Discretization:** Second-order central differencing\n- **Time Discretization:** First-order implicit Euler\n- **Grid:** Staggered (pressure at cell centers, velocities at faces)\n- **Boundary Conditions:**\n    - **Top lid:** $u = 1$, $v = 0$ (moving wall)\n    - **Other walls:** $u = v = 0$ (no-slip)\n    - **Pressure:** Neumann ($\\frac{\\partial p}{\\partial n} = 0$) at boundaries\n\n## Project Roadmap\n\n| Phase | Description | Status |\n|-------|-------------|--------|\n| **Phase 1** | MATLAB loop-based SIMPLE solver   | ✅ Complete |\n|             | Vectorized MATLAB implementation  | ✅ Complete |\n| **Phase 2** | Python/NumPy serial port          | 🚧 In Progress |\n|             | Vectorized NumPy solver           | 📋 Planned |\n|             | Parallel Python (Numba/Dask)      | 📋 Planned |\n| **Phase 3** | OpenFOAM case setup               | 📋 Planned |\n|             | STAR-CCM+ case setup              | 📋 Planned |\n| **Phase 4** | Validation \u0026 analysis             | 📋 Planned |\n\n## Project Structure\n```\nmain/\n├── matlab/\n│ ├── iterative-solver/\n│ │ ├── IterativeSolver.m\n│ │ └── README.md\n│ ├── vectorized-solver/\n│ │ ├── VectorizedSolver.m\n│ │ └── README.md\n│ └── README.md # MATLAB-specific overview\n├── python/\n│ ├── serial/\n│ │ ├── iterative/\n│ │ │ ├── IterativeSolver.py\n│ │ │ └── README.md\n│ │ ├── vectorized/\n│ │ │ ├── VectorizedSolver.py\n│ │ │ └── README.md\n│ │ └── README.md # Serial solvers overview\n│ ├── parallel/\n│ │ ├── mpi/\n│ │ │ ├── MPISOlver.py\n│ │ │ └── README.md\n│ │ ├── openmp/\n│ │ │ ├── OpenMPSolver.py\n│ │ │ └── README.md\n│ │ └── README.md # Parallel solvers overview\n│ └── README.md # Python-specific overview\n├── logos/ # Technology logos\n├── assets/\n├── .github/ISSUE_TEMPLATE/ # GitHub issue templates\n├── CODE_OF_CONDUCT.md\n├── CONTRIBUTING.md\n├── LICENSE\n├── SECURITY.md\n└── README.md # Main project documentation\n```\n## Benchmark Table\n\n| Solver                                   | Language      | Paradigm                | Elapsed Time (s) | Speedup | Status         |\n|-------------------------------------------|--------------|-------------------------|------------------|---------|---------------|\n| SIMPLE2D_LidDrivenCavity                  | MATLAB       | Serial (Loops)          | 36435            | 1x      | ✅ Complete    |\n| _SimpleLidCavityVector_                   | MATLAB       | Serial (Vectorized)     | TBD              | TBD     | 🚧 In Progress |\n| _lid_cavity_serial.py_                    | Python/NumPy | Serial (Loops)          | TBD              | TBD     | 📋 Planned     |\n| _lid_cavity_vectorized.py_                | Python/NumPy | Serial (Vectorized)     | TBD              | TBD     | 📋 Planned     |\n| _lid_cavity_parallel.py_                  | Python       | Parallel                | TBD              | TBD     | 📋 Planned     |\n| _OpenFOAM Case_                           | OpenFOAM     | Industrial CFD          | TBD              | TBD     | 📋 Planned     |\n| _STAR-CCM+ Case_                          | STAR-CCM+    | Commercial CFD          | TBD              | TBD     | 📋 Planned     |\n\n_Hardware: \n\n## Getting Started\n\n### Prerequisites\n- **MATLAB:** R2020a or later (for initial implementations)\n- **Python:** 3.8+ (NumPy, planned)\n- **OpenFOAM:** (planned)\n- **STAR-CCM+:** (planned)\n\n## Contributing\n\nWe welcome all contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on:\n- Adding new solver implementations\n- Improving code or documentation\n- Adding validation cases\n- Reporting issues or suggesting enhancements\nFeel free to open an issue or submit a pull request!\n\n## Code of Conduct\n\nPlease note that this project follows a [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.\n\n## Security\n\nIf you discover a vulnerability, please see our [SECURITY.md](SECURITY.md) for instructions on reporting it.\n\n## Support \u0026 Discussion\n\n- For bug reports or feature requests, please use our [issue tracker](https://github.com/Kandil2001/Lid-Cavity-Evolution/issues).\n- For general questions, open an issue or reach out via [email](mailto:kandil.ahmed.amr@gmail.com).\n\n## License\n\nThis project is licensed under the MIT License.  \nSee [LICENSE](LICENSE) for details.\n\n## References\n\n1. Ghia, U., Ghia, K. N., \u0026 Shin, C. T. (1982). _High-Re solutions for incompressible flow using the Navier-Stokes equations and a multigrid method_. J. Comput. Phys., 48(3), 387-411.\n2. Patankar, S. V. (1980). _Numerical Heat Transfer and Fluid Flow_. Hemisphere Publishing.\n3. Ferziger, J. H., Perić, M., \u0026 Street, R. L. (2002). _Computational Methods for Fluid Dynamics_. Springer.\n\n## Contact\n\nFor questions, suggestions, or collaboration inquiries, feel free to:\n\n- Open an issue on [GitHub](https://github.com/Kandil2001/Lid-Cavity-Evolution/issues)\n- Reach out via email: **kandil.ahmed.amr@gmail.com**\n- Connect on [LinkedIn](https://www.linkedin.com/in/ahmed-kandil01)\n\n\u003e **Note:** This project is under active development. Check back for updates and new solver releases!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkandil2001%2Flid-cavity-evolution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkandil2001%2Flid-cavity-evolution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkandil2001%2Flid-cavity-evolution/lists"}