Discretization of $\sum_{nbr}\left(u_i u_j n_j\right)_{nbr}$

23 Views Asked by At

I am studying engineering and I like to code simulations from scratch in my freetime and right now I am working with the navier stokes equation.

I was reading this page: Discretization of Navier–Stokes equations

I totally understand the steps but am stuck at this point:

$$\dfrac{\partial u_i}{\partial t} V + \sum_{nbr}\left(u_i u_j n_j\right)_{nbr} = - \sum_{nbr}\left(Pn_jA\right)_{nbr} + \sum_{nbr}\left(\nu \dfrac{\partial u_i}{\partial x_j} n_j A \right)_{nbr} + f_iV$$

I am working with a cartesian coordinate system in 2 dimension but with an unorganized grid. But that's not the point of this question.


The part that confused me is this: $$\sum_{nbr}\left(u_i u_j n_j\right)_{nbr}$$

I assumed that $u_i = \begin{pmatrix} u_{i1} \\ u_{i2}\end{pmatrix}$, but have no idea how to evaluate $u_j$ and $n_j$. First I thought they might be scalar values but I do not think that is true. I need to write these equation for the x and y direction ($j=1,2$) and in both equations, I would end up with a vector which would not work.

My second thought is that $u_j$ is a vector and $u_iu_j$ is the inner product of them which would be a scalar. I do not understand how $u_j$ might be computed then. It looks like a scalar because of the $j$-subscript (which means it is into $j$-direction ($x$,$y$).


I am very happy if someone could help me understand that part and how to evaluate the components of it.

Greetings, Finn