08 – 1D Stokes Equation
This exercise focuses on solving the one-dimensional Stokes equation for a channel flow with both constant and depth-dependent viscosity. The problem setup allows direct comparison between the analytical solution and the numerical approximation, providing a way to test the accuracy of finite difference methods.
The main objectives are:
- Deriving and discretizing the 1-D Stokes equation with finite difference operators,
- Defining viscosity profiles (constant and logarithmically varying with depth),
- Implementing Dirichlet and Neumann boundary conditions,
- Assembling and solving the linear system of equations,
- Comparing numerical and analytical solutions,
- Visualizing velocity profiles and the relative error.
The resulting velocity distributions illustrate the difference between Couette and Couette–Poiseuille flow, and highlight the influence of variable viscosity on the channel flow solution.
Figure 1. Solution of the 1-D Stokes problem.