---
title: "Bend a Wall, Transform a Flow Interactive Lab | Sandbox Physics"
description: "Why does a conformal map change flow speeds near corners even though it preserves angles? A conformal map stretches and turns each tiny patch by the same amount in every direction, so local angles survive. Lengths are multiplied by that stretch factor and flow speeds are divided by it, so the flow speeds up wherever the map squeezes it. Around a protruding sharp corner the ideal speed becomes infinite at the tip; inside a recessed corner it drops to zero."
canonical_url: "https://sandboxphysics.com/labs/schwarz-christoffel-flow/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/schwarz-christoffel-flow/"
last_modified: "2026-10-22"
---

Complex analysis · fluid geometry

# Schwarz–Christoffel Flow Mapper

**Why does a conformal map change flow speeds near corners even though it preserves angles?** A conformal map stretches and turns each tiny patch by the same amount in every direction, so local angles survive. Lengths are multiplied by that stretch factor and flow speeds are divided by it, so the flow speeds up wherever the map squeezes it. Around a protruding sharp corner the ideal speed becomes infinite at the tip; inside a recessed corner it drops to zero.

Two planes side by side show a simple flow over a straight wall being mapped onto a step, a ramp or a polygonal bump. Move the linked probe to check that angles are preserved, and compare how much the flow speeds up at the corners with the numerical errors at the wall and in the integral.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

The flow is steady, incompressible and ideal, and it slips along walls taken from a few predefined polygon families. The prevertices set the geometry; the Lab cannot work backward from an arbitrary polygon you design. A vortex is held fixed together with its opposite-signed image. Viscosity, separation, vortex motion and the physics of a finite vortex core are not modeled.

Physics tutorial

## Schwarz–Christoffel: a polygon hidden in a complex derivative

**Background** Start with steady flow above a straight wall that the fluid slips along. A conformal map bends the real axis into the straight segments of a polygonal wall. Every streamline and equipotential is carried by the same map, and the chain rule gives the physical speed.

**Why it matters** The bent grid is only the surface. The wall shape predicts where an ideal fluid speeds up, comes to rest or approaches a singularity, and a probe linked across both planes lets you measure those predictions.

Start with the essentials

- **Focus question**: How can the map keep a small right angle a right angle and still change the speed by a large factor?
- **One-sentence intuition**: Near each point, the derivative rotates and rescales a small patch. Lengths are multiplied by $|f'|$, but the physical velocity is divided by the derivative. Keeping angles does not mean keeping sizes or speeds.

### Core mathematical model

#### Schwarz–Christoffel derivative

$$
f'(\zeta)=C\prod_j(\zeta-a_j)^{\alpha_j-1},\qquad z=f(\zeta)
$$

Each prevertex sits on the real axis. Its exponent is the interior angle on the fluid side divided by pi, minus one. Integrating the derivative produces straight wall segments. The map is normalized by fixing it at an anchor point in the upper half-plane.

#### A family of two-corner steps

$$
f'(\zeta)=(\zeta+a)^p(\zeta-a)^{-p},\qquad \theta_{\pm}=\pi(1\pm p)
$$

Changing the spacing and the exponent gives a family of steps and ramps. With a zero exponent the map is the identity. You choose the prevertices; putting the physical vertices anywhere you like would require solving a separate nonlinear problem for the parameters.

#### Potential, velocity, and image vortex

$$
W(\zeta)=U\zeta+\frac{\Gamma}{2\pi i}\left[\log(\zeta-\zeta_v)-\log(\zeta-\overline{\zeta_v})\right],\qquad u-iv=\frac{W'(\zeta)}{f'(\zeta)}
$$

The image vortex of opposite sign makes the real axis a streamline. To get the physical velocity you divide by the map derivative; redrawing the preimage velocity on a bent grid would be wrong. The vortex is held in place from outside. The small disk around it is only left out of the display; it is not a finite core.

#### Power laws near a corner and tracer timing

$$
|f'|\sim|\zeta-a_j|^{\alpha_j-1},\quad |v|\sim|\zeta-a_j|^{1-\alpha_j},\quad \dot\zeta=\frac{\overline{W'(\zeta)}}{|f'(\zeta)|^2}
$$

These exponents measure distance in the preimage plane and assume the derivative of the potential is finite and nonzero there. Measured by physical distance from the corner, the exponent is different. The tracer equation must include the squared metric factor so that tracers follow physical trajectories.

#### Exact formula for the right-angle step

$$
F(\zeta)=\sqrt{\zeta-a}\sqrt{\zeta+a}+a\log\!\left(\frac{\zeta+\sqrt{\zeta-a}\sqrt{\zeta+a}}{a}\right)
$$

When the turning fraction is one half, this elementary antiderivative gives an independent check on the numerical integral. Multiplying the two principal square roots picks the branch for the upper half-plane. Subtract its value at the anchor before comparing.

### Common difficulties

#### Fast flow at a corner is not turbulence

**Typical misconception** The corner turns a warm color, so the model must be showing separation or a turbulent wake.

**Better mental model** This is ideal flow that slips along the walls. Where the wall juts into the fluid, the speed can grow without bound. Real viscosity, rounded corners, separation and boundary layers need other equations. The color scale tops out, but the mathematical singularity is still there.

#### Each small error check tests one thing

**Typical misconception** One small error number proves the result is accurate everywhere, corners included.

**Better mental model** The wall check samples points a short distance from the wall, away from the corners. The angle check uses small centered differences. The path residual tests whether the integral is the same along different paths. Only the right-angle step has an exact formula to compare with. Contour resolution changes how the picture is interpolated, not the tolerance of the integration.

### Run the experiment

1. 01

   #### Recover the straight wall

   Select Right-angle step and reduce the turning fraction to zero. Move the probe with the arrow keys.

   **What to observe:** Apart from how each panel is framed, the two planes now match. The local scale returns to one, the speed equals the background flow, and the wall-normal fraction stays small.

2. 02

   #### Compare the two corners

   Go back to the right-angle step. Move the probe just above each coral corner and compare the local scale, the speed and the distortion trace.

   **What to observe:** One corner shrinks lengths and speeds the flow up; the other stretches lengths and slows the flow down. The two probe arms stay perpendicular.

3. 03

   #### Put a vortex near the wall

   Select Vortex near wall, reverse the circulation and change the vortex height. Pause or step the tracers, then compare with Polygonal bump.

   **What to observe:** The streamlines change direction and shape, and the opposite-signed image still keeps fluid from crossing the wall. The vortex stays put, and tracers that leave the display window are seeded again.

4. 04

   #### Scientific basis and inspiration

   Model basis: Driscoll, Algorithm 756: A MATLAB Toolbox for Schwarz–Christoffel Mapping, ACM TOMS 22 (1996), DOI 10.1145/229473.229475; Driscoll and Trefethen, Schwarz–Christoffel Mapping (Cambridge, 2002).

   **What to observe:** Inspired by the Schwarz–Christoffel Flow entry at bugman123.com/FluidMotion/. The implementation and graphics are original; no legacy media or code is copied.

Physical conclusion

A conformal map keeps local angles but not lengths or speeds. One derivative builds the wall shape, carries the flow over and predicts what happens at the corners.

Conceptual inspiration: [FluidMotion](http://www.bugman123.com/FluidMotion/index.html). Original simulations and graphics; the model limits are described above.

Fields & matter · Starter path

## From a field to an electron microscope

Map an electric field and steer a charged particle. Then find the electron's wavelength and use electron beams to see a crystal and a surface.

[Start here → **Make an Electric Field Visible** Move the probe around a dipole and check that the field always points downhill on the potential landscape. Observe · 8 min](https://sandboxphysics.com/labs/electric-field/)

1. [1 Make an Electric Field Visible](https://sandboxphysics.com/labs/electric-field/)
2. [2 A Charge Bending through Fields](https://sandboxphysics.com/labs/charged-particle/)
3. [3 Electron Wavelength & Voltage](https://sandboxphysics.com/labs/electron-wavelength/)
4. [4 Electron Diffraction & Reciprocal Space](https://sandboxphysics.com/labs/electron-diffraction/)
5. [5 TEM Bright Field, Dark Field & SAED](https://sandboxphysics.com/labs/tem-mode-selector/)
6. [6 SEM Secondary-Electron Topography](https://sandboxphysics.com/labs/sem-topography/)

[View the full path →](https://sandboxphysics.com/topics/fields-and-matter/#starter-path)
