4. Stokes flow and boundaries
The question
Section titled “The question”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?
Compare inertia with viscosity
Section titled “Compare inertia with viscosity”Choose a speed and length . Advective inertia scales as , while viscous force per volume scales as . Their ratio is
At small Reynolds number, for a steady flow, neglecting inertia leaves
These are the steady Stokes equations. Small Reynolds number alone does not justify neglecting rapid temporal changes: on an imposed time scale , the unsteady-to-viscous ratio is . 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.
Define the geometry and boundaries
Section titled “Define the geometry and boundaries”The steady example chooses the inlet profile
From Chapter 3, the mean inlet speed is and the volume flux per unit span is . Steady incompressibility requires the same integrated outlet flux. These values are available before any solve.
At the cylinder and walls, no slip sets . At the outlet, prescribes a traction. It does not separately impose both 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.
Write the mathematics in Eqiora
Section titled “Write the mathematics in Eqiora”The complete source imports the equations and boundary laws from Eqiora.Fluid:
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:
velocityandpressureare unknown fields on the fluid region. Their dimensions are part of their declarations.SteadyStokes2dcombines the unforced momentum and incompressibility laws with a velocity/traction interface on the complete exterior.NormalVelocityInlet2dreceives the parabolic speed as a formula. At the left inlet, , so its inward velocity points right.NoSlip2dsets the wall and cylinder velocities to zero;TractionFree2dsets the outlet traction to zero.- The
connectstatements attach each boundary condition to the corresponding member offlow.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.
Write the laws directly
Section titled “Write the laws directly”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:
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 and
isotropic_lift(pressure) is . 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.
Recognize the reusable law
Section titled “Recognize the reusable law”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 under ; it can fix that freedom. Do not introduce an extra arbitrary pressure condition without first checking what the existing boundary laws already determine.
Exercises
Section titled “Exercises”- Integrate the inlet parabola and recover .
- At a right-hand boundary, what velocity direction would the same normal-inlet relation prescribe? Explain using its outward normal.
- Which part of the source changes when a wall moves? Which part changes when viscosity depends on shear rate?
- 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