# 1. The equations for fluid motion

## The goal of a flow solver

What does it mean to “solve” a flow problem? Well, it means that we find a vector flow field that satisfies (i.e solves) the Navier-stokes equations for a specific set of boundary conditions (in both time and space). The pressure field in the fluid may also be regarded as a part of the solution. This aspect is covered in chapter 5. Having access to the full four-dimensional (4D, space + time) flow field allows to compute interesting flow statistics like wind loads, mixing characteristics, flow transport properties, etc.

## The equations for fluid motion

In order to achieve an algorithmic solver for flow problems, we must first have a mathematical description of fluid flows. A central result from the classical mechanics era are the Navier-Stokes equations for incompressible flows. In vector form (i.e. it has multiple components) they read,

$\frac{\partial \mathbf{u}}{\partial t} + \left(\mathbf{u} \cdot \nabla \right)\mathbf{u} = -\nabla p + \nu \nabla^2 \mathbf{u},$

with the constraint that,

$\nabla \cdot \mathbf{u} = 0.$

Here, $$\mathbf{u}(\mathbf{x},t)$$ is the velocity vector as a function of space $$\mathbf{x} = \{x, y , z\}$$ and time $$t$$. $$\nabla$$ is the gradient operator, $$p$$ the scalar pressure field in the fluid and $$\nu$$ is the fluid’s viscosity. In this course we limit ourselves to solving for the flows of incompressible fluids with a constant density and viscosity parameter. Because the computer does not understand vector mathematics, it will prove useful to decompose the equations into their scalar components. For the first velocity component ($$u_x$$) we write,

$\frac{\partial u_x}{\partial t} + u_x \frac{\partial u_x}{\partial x} + u_y \frac{\partial u_x}{\partial y} + u_z \frac{\partial u_x}{\partial z} = -\frac{\partial p}{\partial x} + \nu \left( \frac{\partial^2 u_x}{\partial x^2} + \frac{\partial^2 u_x}{\partial y^2} + \frac{\partial^2 u_x}{\partial z^2}\right) ,$

and the other components follow analogous.

## The goal of our flow solver

In science and engineering practice, efficient and feature-rich flow solvers are required. It appears that for each application, the discretization style, grid structure and algorithms are different. This indicates that there is not a single recipe to solve flow problems and there is no consensus on what is best. Because our goal is more didactical in nature than gaining fame by rivalling solvers such as Openfoam, our solver will aim to be “minimalistic”. Where we will prefer coding simplicity over features and the solver’s speed performance. However, we will also write our solver in a modular fashion, so seperate components can be improved later. The final chapter includes some suggestions

Continue to Chapter 2

The marvelous design of this website is taken from Suckless.org