Skip to content
Get started

4. Stokes flow and boundaries

Place a cylinder inside the channel. The flow must turn around it, so the parallel-flow calculation no longer applies. Which terms should we retain, and what does the outlet mean physically?

Choose a speed UU and length LL. Advective inertia scales as ρU2/L\rho U^2/L, while viscous force per volume scales as μU/L2\mu U/L^2. Their ratio is

Re=ρULμ=ULν.\mathrm{Re}=\frac{\rho UL}{\mu}=\frac{UL}{\nu}.

At small Reynolds number, for a steady flow, neglecting inertia leaves

−∇⋅σ=f,∇⋅u=0,σ=2μsym⁡(∇u)−pI.-\nabla\cdot\boldsymbol\sigma=\boldsymbol f, \qquad \nabla\cdot\boldsymbol u=0, \qquad \boldsymbol\sigma=2\mu\operatorname{sym}(\nabla\boldsymbol u)-p\boldsymbol I.

These are the steady Stokes equations. Small Reynolds number alone does not justify neglecting rapid temporal changes: on an imposed time scale TT, the unsteady-to-viscous ratio is L2/(νT)L^2/(\nu T). A rapidly oscillating low-speed flow may need unsteady Stokes equations.

For a homogeneous Stokes boundary problem driven only by an imposed inlet velocity, doubling that velocity doubles velocity and pressure; changing viscosity scales pressure while leaving the velocity solution unchanged. The traction data must scale consistently. This linearity provides a useful prediction even when the full spatial field has no simple formula.

Channel of length 2.2 m and height 0.41 m, with a circular cylinder of radius 0.05 m centred at 0.2 m, 0.2 m; inlet left, outlet right, stationary walls above and below.
The geometry supplies named regions to which the mathematical boundary laws attach.

The steady example chooses the inlet profile

uin(y)=(4Umax⁡y(H−y)H2,0),Umax⁡=0.3 m/s,H=0.41 m.\boldsymbol u_{\rm in}(y)=\left(\frac{4U_{\max}y(H-y)}{H^2},0\right), \qquad U_{\max}=0.3\,\mathrm{m/s},\quad H=0.41\,\mathrm m.

From Chapter 3, the mean inlet speed is 0.2 m/s0.2\,\mathrm{m/s} and the volume flux per unit span is 0.082 m2/s0.082\,\mathrm{m^2/s}. Steady incompressibility requires the same integrated outlet flux. These values are available before any solve.

At the cylinder and walls, no slip sets u=0\boldsymbol u=0. At the outlet, σn=0\boldsymbol\sigma\boldsymbol n=0 prescribes a traction. It does not separately impose both p=0p=0 and zero velocity gradient. The pressure and viscous contributions combine to satisfy the one vector condition.

The Stokes model contains no density parameter. It deliberately omits inertia; entering a large inlet speed does not add that missing term. Use a density and physical scales to assess applicability before treating a Stokes result as a prediction for an actual fluid.

The complete source imports the equations and boundary laws from Eqiora.Fluid:

steady-flow-past-cylinder.eqi
import Eqiora.Fluid.fluid as stokes;
// Equations-only component for steady, incompressible flow around a cylinder.
// The concrete channel and cylinder Geometry are authored separately in Python.
public component SteadyFlowPastCylinder(
support fluid: volume(ambient_dimension = 2),
support inlet: boundary(parent = fluid),
support outlet: boundary(parent = fluid),
support walls: boundary(parent = fluid),
support cylinder: boundary(parent = fluid),
// Values supplied when the component is compiled into a Model.
parameter dynamic_viscosity: kg / (m * s),
parameter inlet_speed: m / s,
parameter channel_height: m
) {
variable velocity: vector<m / s, 2> on fluid in smooth;
variable pressure: kg / (m * s ^ 2) on fluid in h1;
instance flow: stokes.SteadyStokes2d(
body = fluid,
exterior = boundaries(inlet, outlet, walls, cylinder),
velocity = velocity,
pressure = pressure,
dynamic_viscosity = dynamic_viscosity
);
instance inflow: stokes.NormalVelocityInlet2d(
body = fluid,
face = inlet,
speed = 4 * inlet_speed * coordinate(1) * (channel_height - coordinate(1))
/ channel_height ^ 2
);
instance outflow: stokes.TractionFree2d(body = fluid, face = outlet);
instance wall: stokes.NoSlip2d(body = fluid, face = walls);
instance obstacle: stokes.NoSlip2d(body = fluid, face = cylinder);
connect flow.mechanical[boundary = inlet], inflow.mechanical;
connect flow.mechanical[boundary = outlet], outflow.mechanical;
connect flow.mechanical[boundary = walls], wall.mechanical;
connect flow.mechanical[boundary = cylinder], obstacle.mechanical;
}

Read it from the inside out:

  1. velocity and pressure are unknown fields on the fluid region. Their dimensions are part of their declarations.
  2. SteadyStokes2d combines the unforced momentum and incompressibility laws with a velocity/traction interface on the complete exterior.
  3. NormalVelocityInlet2d receives the parabolic speed as a formula. At the left inlet, n=(−1,0)\boldsymbol n=(-1,0), so its inward velocity points right.
  4. NoSlip2d sets the wall and cylinder velocities to zero; TractionFree2d sets the outlet traction to zero.
  5. The connect statements attach each boundary condition to the corresponding member of flow.mechanical.

Open the complete source. The source names supports but does not define a circle or a mesh. The Python workflow supplies the geometry and binds each support to its named selection.

To see the mathematics behind the imports, the following handwritten relations express the unforced interior balance and all four boundary conditions. They use the same fluid, walls, fields and viscosity declared above. Keep those declarations and replace the imported instances and connect statements with this block; do not add it beside the imported laws:

eqiora
relation momentum on fluid {
-div(
2 * dynamic_viscosity * symmetric_part(grad(velocity))
- isotropic_lift(pressure)
) = 0;
}
relation incompressibility on fluid {
div(velocity) = 0;
}
relation inlet_velocity on inlet {
trace(velocity) = -normal_vector()
* (4 * inlet_speed * coordinate(1) * (channel_height - coordinate(1))
/ channel_height ^ 2);
}
relation wall_velocity on walls {
trace(velocity) = 0;
}
relation cylinder_velocity on cylinder {
trace(velocity) = 0;
}
relation outlet_traction on outlet {
normal(
2 * dynamic_viscosity * symmetric_part(grad(velocity))
- isotropic_lift(pressure)
) = 0;
}

Here symmetric_part(grad(velocity)) is D\boldsymbol D and isotropic_lift(pressure) is pIp\boldsymbol I. trace restricts velocity to its boundary; normal would contract the stress with the outward normal to write the outlet traction law. The inlet uses the inward normal and the same parabolic speed as the imported boundary component.

Open the standard fluid source and compare SteadyStokesBalance2d with the two interior relations. SteadyStokes2d combines that balance with VelocityTractionInterface2d. In the same source, NoSlip2d sets the boundary port’s velocity to zero; the connected interface equates it to the interior trace. This gives the handwritten stationary-wall condition above. The separately named ForcedSteadyStokesBalance2d adds a conservative body load and is not the unforced balance used here.

The cylinder source supplies its complete exterior with boundaries(inlet, outlet, walls, cylinder) and connects each named part. Use the standard-package reference for another runnable composition. The handwritten form explains each term; the imported form reuses those laws while keeping the problem’s data visible.

Pressure gauge: a boundary-dependent question

Section titled “Pressure gauge: a boundary-dependent question”

With prescribed velocity everywhere, adding a constant to pressure changes no interior pressure gradient. A pressure reference is then needed. A prescribed traction changes by −Cn-C\boldsymbol n under p↦p+Cp\mapsto p+C; it can fix that freedom. Do not introduce an extra arbitrary pressure condition without first checking what the existing boundary laws already determine.

  1. Integrate the inlet parabola and recover 0.082 m2/s0.082\,\mathrm{m^2/s}.
  2. At a right-hand boundary, what velocity direction would the same normal-inlet relation prescribe? Explain using its outward normal.
  3. Which part of the source changes when a wall moves? Which part changes when viscosity depends on shear rate?
  4. Why can the steady source not produce a time-evolving vortex street, however fine its mesh becomes?

Check your reasoning. A right-hand normal inlet points left into the region. Moving a wall changes a boundary law; non-Newtonian viscosity changes the constitutive law. Mesh refinement cannot introduce terms absent from the model.

Previous: Exact parallel flows · Book map · Next: Computing incompressible flow