News for hackers. Stuff that matters.
Re:Fluid Simulation (with WebGL demo) by paulpauper on Saturday August 27, 2016 @02:15PM (#12373467)
We can expand this to its partial derivative form, expanding vector components to leave us with only scalar variables.

I don't understand the part where he expands the navier stokes equations to the matrix form. Can some explain how he gets to that step

Re:Fluid Simulation (with WebGL demo) by Figs on Saturday August 27, 2016 @05:47PM (#12374328)
The `u dot del u` term is describing the "self-advection" of the velocity field.

You can interpret `u dot del u` as `(u dot del)u` where `(u dot del)` is an operator which seems to sometimes be called the "advection operator" or the "directional derivative" or the "convection derivative" and probably even more names I don't even know -- which makes it really annoyingly hard to look up information about.

See https://en.wikipedia.org/wiki/Advection and https://en.wikipedia.org/wiki/Del (section "directional derivative").

`(u dot del)` expands to `u_x * d(__)/dx + u_y * d(__)/dy` in 2D -- a function taking a scalar (plugged into where I wrote the `__`s) and which evaluates to a scalar. As indicated on the 2nd link above, to operate on a vector just apply it to each component (similar to how you'd normally multiply a scalar and a vector). So that means that `(u dot del)u` becomes:

    u_x * d(u_x)/dx + u_y * d(u_x)/dy
    u_x * d(u_y)/dx + u_y * d(u_y)/dy
which can be factored into a matrix-vector multiplication (by pulling out the `u_x * ___ + u_y * ___` part into a vector):

    [d(u_x)/dx  d(u_x)/dy]   [u_x]
    [d(u_y)/dx  d(u_y)/dy] * [u_y]
    
As you can see, that's what was written in the article. I'm not sure why the author wrote it out with a matrix like this.

As DanWaterworth said in the other comment, `del p` is just the gradient of the pressure.

Re:Fluid Simulation (with WebGL demo) by DanWaterworth on Saturday August 27, 2016 @03:16PM (#12373722)
It's quite confusing, the del operator means different things in each term. del of p is just the gradient of the pressure, but the convective term is more complicated. This may help [1]. The key part is:

Generally the convective derivative of the field u•∇y, the one that contains the covariant derivative of the field, can be interpreted both as involving the streamline tensor derivative of the field u•(∇y), or as involving the streamline directional derivative of the field (u•∇) y, leading to the same result.

[1] https://en.wikipedia.org/wiki/Material_derivative