How howardho-cfd/collocated_simple works
This repository is a Python implementation of the SIMPLE algorithm for a lid-driven cavity flow, with a central-difference momentum solver. The principal workflow in simple.py initializes a uniform mesh, boundary conditions, and flow fields; iterates momentum and pressure-correction solves and field corrections until a pressure-correction threshold is met; then plots the results. The graph distinguishes orchestration, discretization and solving, and visualization. Edges are based on the shown simple.py and functions.py excerpts and the README; unsampled code is not used to infer additional links.
Main entry points: simple.py SIMPLE iteration · functions.py Velocity solve wrappers · solver.py Sparse linear solver · pre_processing.py Uniform mesh
Components 16
Simulation workflow
- SIMPLE iteration
simple.py - Uniform mesh
class_mods/pre_processing.py - Initial velocity fields
class_mods/pre_processing.py - Cell-center coordinates
functions.py - Mesh data
class_mods/storage.py - Boundary data
class_mods/storage.py
Numerical methods
- Face fluxes
functions.py - Momentum assembly
class_mods/u_solver.py - Pressure correction assembly
class_mods/p_solver.py - Sparse linear solver
class_mods/solver.py - Velocity solve wrappers
functions.py - Pressure solve wrapper
functions.py - Field correction
functions.py - Pressure face values
functions.py
Results and plotting
- Plotting
class_mods/post_processing.py
Other components
- Engineer
Connections 16
- Engineer → SIMPLE iteration: runs
README.md - SIMPLE iteration → Uniform mesh: creates
simple.py - SIMPLE iteration → Mesh data: stores mesh
simple.py - SIMPLE iteration → Boundary data: sets boundaries
simple.py - SIMPLE iteration → Initial velocity fields: initializes
simple.py - SIMPLE iteration → Cell-center coordinates: computes
simple.py - SIMPLE iteration → Face fluxes: updates fluxes
simple.py - SIMPLE iteration → Velocity solve wrappers: solves velocity
simple.py - Velocity solve wrappers → Momentum assembly: assembles
functions.py - SIMPLE iteration → Pressure solve wrapper: solves correction
simple.py - Pressure solve wrapper → Pressure correction assembly: assembles
functions.py - Velocity solve wrappers → Sparse linear solver: solves system
functions.py - Pressure solve wrapper → Sparse linear solver: solves system
functions.py - SIMPLE iteration → Field correction: corrects fields
simple.py - SIMPLE iteration → Pressure face values: updates faces
simple.py - SIMPLE iteration → Plotting: plots results
simple.py