# Outflow BC

## Setup

Starting with the constant density Navier-Stokes equations

\nabla\cdot\mathbf{u} = 0

\frac{\partial \rho \mathbf u}{\partial t} = \nabla\cdot\mathbf{u} \rho\mathbf{u} – \nabla\cdot\boldsymbol{\tau} – \nabla p \equiv \mathbf{F} -\nabla p

A fractional step scheme consists of first integrating the momentum equations without the pressure gradient

\widehat{\rho \mathbf{u}}^{n+1} = \rho \mathbf{u}^n – \Delta t \mathbf{F}^n;\quad \nabla\cdot\widehat{\mathbf{u}}^{n+1} \neq 0

In general, $\widehat{\mathbf{u}}^{n+1}$ is not divergence free. To correct this, we do the projection

\widehat{\rho \mathbf{u}}^{n+1} = \rho \mathbf{u}^{n+1} – \Delta t \nabla p

Then, taking the divergence of the previous equation, one recovers a Poisson equation for the pressure

\nabla^2 p = – \frac{1}{\Delta t} \nabla \cdot \widehat{\rho \mathbf{u}}^{n+1}

## Outflow Boundary Conditions

For a staggered grid arrangement, we use the following outflow boundary conditions:

\begin{cases}
\rho u_{i+\tfrac{1}{2}}^{n}\geq0 & \frac{\partial\widehat{\rho u} ^n}{\partial x}=0\\
\rho u_{i+\tfrac{1}{2}}^{n}<0 & \widehat{\rho u}^n=0
\end{cases}
where $i$ is the index of the boundary cell (cell center) and $i+\tfrac{1}{2}$ is that of the corresponding face (on the plus side). For wasatch, the first condition implies, at first order

\frac{\partial\widehat{\rho u}}{\partial x}\approx\frac{(\widehat{\rho u})_{i+\tfrac{1}{2}}^{n}-(\widehat{\rho u})_{i-\tfrac{1}{2}}^{n}}{\Delta x}=0

or

(\widehat{\rho u})_{i+\tfrac{1}{2}}^{n}=(\widehat{\rho u})_{i-\tfrac{1}{2}}^{n}

in other words

(\rho u)_{i+\tfrac{1}{2}}^{n}+\Delta tF_{i+\tfrac{1}{2}}^{n}=(\rho u)_{i-\tfrac{1}{2}}^{n}+\Delta tF_{i-\tfrac{1}{2}}^{n}

All quantities are known except for $F_{i+\tfrac{1}{2}}^{n}$. This leads us to specifying

F_{i+\tfrac{1}{2}}^{n}=-\frac{1}{\Delta t}(\rho u)_{i+\tfrac{1}{2}}^{n}+\frac{1}{\Delta t}(\rho u)_{i-\tfrac{1}{2}}^{n}+F_{i-\tfrac{1}{2}}^{n}

The remaining boundary condition is simple and implies that

F_{i+\tfrac{1}{2}}^{n}=-\frac{1}{\Delta t}(\rho u)_{i+\tfrac{1}{2}}^{n}

In summary, we have the following

\begin{cases}
(\rho u)_{i+\tfrac{1}{2}}^{n}\geq0 & F_{i+\tfrac{1}{2}}^{n}=-\frac{1}{\Delta t}(\rho u)_{i+\tfrac{1}{2}}^{n}+\frac{1}{\Delta t}(\rho u)_{i-\tfrac{1}{2}}^{n}+F_{i-\tfrac{1}{2}}^{n}\\
(\rho u)_{i+\tfrac{1}{2}}^{n}<0 & F_{i+\tfrac{1}{2}}^{n}=-\frac{1}{\Delta t}(\rho u)_{i+\tfrac{1}{2}}^{n}
\end{cases}