The present study introduces the Finite Element Methods in theory and describes its implementation for an idealized two dimensional test case. The equations of interest are the Navier-Stokes equations, describing the conservation of momentum for fluid flows. Although the here presented test case is idealized, the Finite Element Method is capable of adapting to complex domains due to its ability to use irregularly triangulated meshes. We solve the steady Navier-Stokes equations for an incompressible fluid with homogeneous density but variable viscosity. Doing so, the model is able to simulate fluid flows up to Reynolds numbers of order 100. We use a regular triangulation of a square domain with linear finite elements as well as the bubble element for velocity in order to keep the solution stable. The model converges with increasing resolution n as O(n^-2) for pressure and velocity and has a runtime that increases with O(n^3). It is therefore concluded that the Finite Element Method provides a promising framework for solving partial differential equations. Although harder to implement, it comes with several advantages in comparison to the widely used Finite Difference Method and, depending on the problem, should be considered as a serious alternative.
You can find the corresponding model code on github including the report.