Pressure and flow fields derived from Bernoulli, continuity and stream functions, with potential flow around a cylinder implemented in Python and validated against stagnation points and Cp = 1 − 4sin²θ.
Fluid Mechanics Analysis Projects — Bernoulli, Stream Functions, and Potential Flow
All projectsDesign & Analysis
- Bernoulli and continuity analysis
- stream function analysis
- potential flow theory
- pressure coefficient
- Python engineering computation
- NumPy
- Matplotlib
- physical validation of results
- problem statement interpretation
Situation
Three individual analysis projects in BME 332, fluid mechanics. Each started from a physical setup, required a derivation from first principles, and ended in computed and plotted results.
Actions
- Pressure in a variable-area pipe. Derived the pressure distribution along a horizontal pipe draining from a reservoir, combining Bernoulli and continuity into p(x) = ρgh[1 − 1/f(x)²], and plotted it for reservoir depths of 1, 4, 10, and 25 m.
- Caught an error in the assignment. The printed area formula was missing its outer parentheses, so as written it contradicted the stated condition that the area equals A₀ at both ends. Identified the one form consistent with that condition, stated the interpretation openly at the top of the report, and solved on that basis.
- Streamlines from a stream function. For ψ = y(3x² + 1), derived the velocity components u = 3x² + 1 and v = −6xy, obtained the streamline family y = C/(3x² + 1), and plotted it, including the flow's symmetry and how streamlines converge toward the axis far from the origin.
- Potential flow around a cylinder. Implemented the classical solution in Python with NumPy and Matplotlib: stream function, radial and tangential velocity, and pressure from Bernoulli, on a masked grid excluding the cylinder interior, producing streamline, pressure, and velocity contour plots.
- Checked the result against the physics rather than trusting the plots: zero flow through the cylinder surface, stagnation points at front and rear, peak surface speed of 2U∞ at top and bottom, and a surface pressure coefficient of Cp = 1 − 4sin²θ.
Outcome
Three completed analyses, each carried from first principles to computed results, with the cylinder solution implemented as working Python code that produces the full set of flow-field plots.
Lessons / safety
Read the given information critically. Solving the pipe problem exactly as printed would have produced an answer that contradicted the problem's own boundary conditions. The correct move was to notice the inconsistency, choose the only interpretation that satisfies the stated conditions, and say so in the first line of the report rather than silently picking one. It is the same instinct as refusing to trust an FEA result that does not reconcile with its own contact areas in the model display stand project.
Check a computed field against known physics. Stagnation points, surface speed, and the pressure coefficient are all known in closed form for this problem. Confirming the code reproduces them is what makes the plots evidence rather than illustrations.
Skills demonstrated
- Bernoulli and continuity analysis
- stream function and potential flow theory
- pressure coefficient derivation
- Python engineering computation with NumPy and Matplotlib
- validation of computed results against analytical physics
- critical interpretation of a problem statement
Evidence
Three reports, the assignment PDF, and the cylinder flow script at C:\Users\Omar\Documents\UW\2026\fluid. Not tracked in git (AGENTS.md §3.6).