Implementation of a numerical solver for Nav.-Stokes eqns. with stochastic excitation
Background
The flow problem: incompressible Navier-Stokes equations
In this project the student(s) are to setup a numerical flow solver for (2D) incompressible and wall-bounded flows obeying the incompressible Navier-Stokes equations in a bounded domain \(\Omega \subset \mathbb{R}^2\): \begin{align} \partial_t u - \operatorname{Re}^{-1} \Delta u + \operatorname{div}( u \otimes u ) - \nabla p & = f + g(x) \cdot dW, \\ \operatorname{div}( u ) & = 0, \end{align} where \(u\) is the velocity vector field and \(p\) is the pressure. \(dW\) is a (scalar) stochastic process (in time) and \(g(x)\) a force term that is randomly triggered by the Wiener process \(W\).
Domain setup and data (for the main setup)
The boundary is typically split into inflow, outflow and wall boundaries[1]Different types of boundary conditions exist, but can be neglected within this project.. In the main setup (driven cavity) of this project we can restrict to Dirichlet values, i.e. \(u=u_D\) is prescribed. The geometrical setup is described in [3], a quick web search delivers many more pictures and explanations on the setup.
In the Navier-Stokes equations the Reynolds number \(Re\) prescribes the ratio between advective and diffusive forces. If \(Re\) is large boundary interior and boundary layers can form leading to vortices that may interact. We will consider \(Re\) numbers in the order of magnitude \(100\) where the deterministic flow becomes stationary. This will be the starting point before we turn to the stochastic component of the problem.
Within the standard driven cavity setup we assume that a small region excites a random force on the flow (a fish swimming at an essentially fixed location). We will set \(g(x) = \exp(- \frac{\Vert x - x_0\Vert^2}{\sigma^2} ) \cdot (a,b)^T\) where \((a,b)^T\) describe the direction of the force and \(\sigma\) the confinedness of the force. The stochastic excitation follows a Wiener process. A Wiener process \(W(t)=W_t\) is characterised by the following properties:
- \(W_0 = 0\)
- \(W\) has independent increments: for every \(t > 0\), the future increments \(W_{t+u} − W_t\), \(u\geq0\), are independent of the past values \(W_s\), \(s \leq t\).
- \(W\) has Gaussian increments: \(W_{t+u} − W_t\) is normally distributed with mean \(0\) and variance \(u\), \(W_{t+u} \sim \mathcal{N}(0,u)\)
- \(W\) has continuous paths: \(W_t\) is continuous in \(t\).
Main components for solving the problem
The main tools for solving the previously described problem are:
- A deterministic Navier-Stokes solver for a time-increment \([t_{n},t_{n+1}]\). Here we will orient on existing solutions based on Netgen/NGSolve [1,2].
- A stochastic time integration solver to incorporate the Wiener process. Here, we will work with the Euler-Maruyama method.
Project goal and further details
In this project instationary solutions of a stochastic version of the incompressible Navier-Stokes equations shall be implemented.
The following sections define several milestones of this project. These may need to be adapted during the project. In the final section a more concrete list of tasks and rules is given (though still incomplete and not necessarily presented in the correct order).
1. Setup of simulation environment
In a first step the simulation setup that contain the components for the Navier-Stokes solver need to be set up. This includes the following steps:
- Installation of Netgen/NGSolve [1,2]
- Running a simple Navier Stokes discretization as in
py_tutorials/navierstokes.py
or thei-tutorials
ofNGSolve
[2]. Running these examples should initially only check if the installation setup is working properly - Setup a git repository (gitlab.gwdg.de) for the project
2. Setup of deterministic flow solver
In this step several flow configuration with
- varying Reynolds numbers and
- stationary and unsteady solutions shall be set up
- playing around with different geometries / boundary conditions / force terms and discretizations / resolutions shall be done to get some experience.
- Several steps and results shall be documented separatedly.
- One setup in terms of discretization type / mesh type etc. should be decided on, implemented in a class or function call which should be documented intensively.
3. Development of a (simple) stochastic time integrator
An Euler-Maruyama solver shall be developed in this step.
- To get started with this type of problem solvers a simple (stochastic) ODE problem can be set up and solved with the Euler-Maruyama method
- A time-discrete time stepping formulation for the Euler-Maruyama method applied on the Navier-Stokes equations shall be formulated
- The Euler-Maruyama scheme shall be implemented
- The Euler-Maruyama scheme and its implementation shall be properly documented.
4. Running and evaluation of flow solution
Finally, if all components run smoothly, simulations shall be carried out:
- Several runs of the stochastic flow solver shall be carried out for several parameters (varying \(Re\) number, excitation variance (\(\sigma\)) and magnitude \((a,b)^T\)).
- Numerical expectations and variances shall be computed based on comparing different runs
- Proper visualization and documentation of these numerical simulation shall be carried out.
A list of tasks and rules
The main guideline are the previously discussed steps, but there are a few more things to consider throughout the project:
Format of the project result
The project shall result in a git-repository containing the following:
- the source code (python),
- API documentation for the code (pydoc/sphinx),
- further documentation on the methods (markdown, gitlab pages, html, latex,..)
- continuous integration facilities including an automatic evaluation of a (gitlab CI / github actions)
- test suite (pytest, ...) As such the repository replace the submission of a usual report. Make sure that you include usable and understandable examples in the repo (i.e. your submission).
Some guidelines
Here are some suggested guidelines
- most of the stuff that you have to learn during the project should be documented. The result should be accessible for students that are in the state of knowledge that you had when you started the project.
- use gitlab issues to set up ToDo-items and organize assignments, etc..
- git: prefer many small commits over few large commits
- use branches and merge (requests) when working on the repo in parallel
- document the structure and the file organization in text-based files (e.g. markdown) in the repository
- for every new feature that you use, set up a test case with automated testing in the gitlab CI
- In a top-level file - similar to this description - write down the project goal an the steps achieved (where/how)
- Interactive demos such as jupyter notebooks are welcome and can serve as part of an "extended documentation"
- Write a log to keep track of the "history" of the project so that you can still explain and understand how the project developed the way it did.
References
[1] J. Schöberl et al., NGSolve
software homepage
[2] J. Schöberl et al., NGSolve
installation instructions
[3] U. Ghia, K.N. Ghia, C.T. Shin, High-Re solutions for incompressible flow using the Navier-Stokes equations and a multigrid method, Journal of Computational Physics 48(3), 1982, pp. 387--411, https://doi.org/10.1016/0021-9991(82)90058-4