-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
Description
Overview
Add a comprehensive cavity flow example to sphinx-gallery that demonstrates using foamlib with OpenFOAM.
OpenFOAM Installation Methods
This example will support multiple OpenFOAM installation methods:
- openfoam-app: Using gerlero/openfoam-app - AppImage-based OpenFOAM
- Ubuntu APT: OpenFOAM installed via Ubuntu package manager (
apt install openfoam)
Reference Tutorial
This example will be based on the classic OpenFOAM tutorial:
- Tutorial Path:
tutorials/incompressible/icoFoam/cavity/cavity - Solver: icoFoam (transient solver for incompressible, laminar flow)
- Case Description: 2D square cavity with lid-driven flow
Tasks
- Create cavity case setup using foamlib (based on OpenFOAM cavity tutorial)
- Implement blockMesh mesh generation (20x20 grid)
- Run icoFoam solver (using openfoam-app or system OpenFOAM)
- Post-process results and visualize velocity field
- Add detailed documentation explaining each step
- Document how to use both openfoam-app and APT-installed OpenFOAM
Example Structure
The example should include:
- Case Setup: Create cavity geometry and boundary conditions using foamlib
- Square cavity: 0.1m x 0.1m
- Moving top wall with U = 1 m/s
- Stationary side and bottom walls
- Mesh Generation: Execute blockMesh
- Uniform mesh: 20x20 cells
- Support both openfoam-app and system OpenFOAM
- Solver Execution: Run icoFoam solver
- End time: 0.5s
- Time step: 0.005s
- Post-processing: Extract and visualize results
- Velocity profiles along cavity centerlines
- Pressure contours
- Streamlines
- Validation: Compare results with OpenFOAM tutorial case
Acceptance Criteria
- Example runs successfully in sphinx-gallery
- Generates meaningful plots and visualizations (matplotlib)
- Includes clear explanations of foamlib usage
- Works with both openfoam-app and APT-installed OpenFOAM
- Can be executed in CI/CD pipeline
- Results match OpenFOAM cavity tutorial
Related
Parent issue: #2
References
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request