# How to implement boundary conditions on Finite Difference WENO5 scheme for the Euler equations

I'm implementing a Finite Difference WENO5 with Lax-Friedrich flux splitting on a uniform, structured grid to solve the 2D Euler equations of fluid dynamics on a rectangular domain in cartesian coordinates.

$$\frac{\partial U}{\partial t}+\frac{\partial F}{\partial x}+\frac{\partial G}{\partial y}=0$$

where:

$$U = (\rho,\rho{u},\rho{v},\rho E)^t$$ $$F = (\rho{u},\rho{u^2}+p,\rho u v, \rho uH)^t$$ $$G = (\rho{v},\rho u v,\rho{v^2}+p, \rho vH)^t$$

$$E = \frac{p }{\rho (\gamma-1)} + \frac{1}{2}(u^2+v^2)$$ $$H = \frac{\gamma p }{\rho (\gamma-1)} + \frac{1}{2}(u^2+v^2)$$

Although the interior scheme seems to work fine, I am having trouble with the numeric implementation of boundary conditions.

The WENO5 interpolation is done on the fluxes, to approximate the derivative on the node $i$ as: $$\left( \frac{\partial F}{\partial x}\right) _{i}=\frac{f^{WENO}_{i+1/2}-f^{WENO}_{i-1/2}}{\Delta x}$$ and then update the conservative variables' vector via a Runge-Kutta method.

I want to use ghost nodes, and I know there has to be 3 ghost nodes on each end of the domain (because of the stencil of the WENO5) but I do not know what values I have to assign to the ghost nodes, or what kind of extrapolation I have to use to find those values. In my case the physical boundaries coincide with the leftmost and rightmost (lowermost and uppermost for the other direction) points of the grid, respectively.

These are the three types of boundary conditions I'm working with at the moment, namely:

• Reflecting wall (x-direction): $$\begin{bmatrix}\frac{\partial \rho }{\partial x}=0 \\ u=0\\ \frac{\partial v }{\partial x}=0 \\ \frac{\partial p }{\partial x}=0 \end{bmatrix}$$

• Reflecting wall (y-direction): $$\begin{bmatrix}\frac{\partial \rho }{\partial y}=0 \\ \frac{\partial u }{\partial y}=0 \\ v=0\\ \frac{\partial p }{\partial y}=0 \end{bmatrix}$$

• Dirichlet condition with fixed value on all primitive variables: $$\begin{bmatrix} \rho =\rho_0 \\ u =u_0 \\ v =v_0 \\ p =p_0 \end{bmatrix}$$

• WENO is just a scheme to do an interpolation. You have values at $u_i$, $u_{i+1}$, $u_{i-1}$ etc. From that you get $u_{i+\frac{1}{2}}$. So, now when you impose $u_{i+\frac{1}{2}}$ as a boundary condition you have to use the same or lower order procedure to get back $u_i$, given $u_{i+\frac{1}{2}}$. For eg. if your interpolation is $0.5 (u_{i+1} + u_{i}) = u_{i+\frac{1}{2}}$ and $u_{i+\frac{1}{2}} = 0$ then you simply impose $u_{i} = -u_{i+1}$ Jan 20, 2017 at 14:17