introduction to fluid simulation?

Started by
15 comments, last by johnstanp 15 years, 8 months ago
I just came across the upcoming book by Robert Bridson:

http://www.akpeters.com/product.asp?ProdCode=3260
Advertisement
So it was about books?( and not online resources? :D )

I really enjoyed reading Computation Methods for Fluid Dynamics by Joel H. Ferziger, some time ago for a Project( University ).Easy read, really. But it lacked some more specific information( it's good for beginners ). A better book is "Computational Fluid Dynamics" by John D. Anderson. And the Stam's papers are very interesting for people interested in animation( someone posted the link ).
The math is a bit involved, yes, but it's not that hard if you know a bit of calculus & linear algebra. It's not like you have to derive everything from scratch, more like understanding how to implement the formulas and methods (and in many cases pseudo-code is provided).

Like many have already stated, Bridson & Müller is imho the best reference for getting started with CFD. There is also some useful information in Mark Carlson's Phd Thesis, chapter 3: http://www.cc.gatech.edu/~carlson/papers/carlson-thesis.pdf

But really the best way to overcome obstacles on your road to implementing a fully functional fluid solver is to ask questions when you run into a problem you can't figure out.






Quote:But really the best way to overcome obstacles on your road to implementing a fully functional fluid solver is to ask questions when you run into a problem you can't figure out.


Ok :)

Well, I have a small question about the euler equations (I figure those are the simplest)

Heres the equations I found:
http://mathworld.wolfram.com/EulersEquationsofInviscidMotion.html

I don't quite understand how they are taking the gradient of u (in the second term). I could have sworn you could only take the gradient of a scalar field...

Also, in general the equation doesnt make sense to me. "du/dt" would result in a vector, as would "grad P / p". while "u dot grad u" would be a scalar.

There must be some other meaning to "u dot grad u"
Hey again.

Check out Bridson/Müller, Chapter 1 and 1.3.2 specfically which deals exactly with this question.

Taking the gradient of a vector-valued function results in something called a Jacobian, which is a matrix of first order partial derivatives (more on this here (http://en.wikipedia.org/wiki/Jacobian)).

You can think of it as taking the gradient of the scalar fields that make up each component in the vector field. Try reading Bridson, chapter 1. There are some quite graspable explanations of many of these concepts to be found.


Regards,

Marcus.
remember, a matrix transform is linear. locally a differentiable vector valued function can be approximated with a matrix, which as someone already pointed out is called the jacobian.
Quote:Original post by coderchris
Quote:But really the best way to overcome obstacles on your road to implementing a fully functional fluid solver is to ask questions when you run into a problem you can't figure out.


Ok :)

Well, I have a small question about the euler equations (I figure those are the simplest)

Heres the equations I found:
http://mathworld.wolfram.com/EulersEquationsofInviscidMotion.html

I don't quite understand how they are taking the gradient of u (in the second term). I could have sworn you could only take the gradient of a scalar field...

Also, in general the equation doesnt make sense to me. "du/dt" would result in a vector, as would "grad P / p". while "u dot grad u" would be a scalar.

There must be some other meaning to "u dot grad u"


The equation is (almost)right.

"u dot grad u" is actually:

d(uj.ui)/dxj, i=1,2,3 and j=1,2,3

The equations, using the "Einstein's notation", can be written:

d(ui)/dt + d(uj.ui)/dxj = -dp/dxi ( with p = P/rho ) i=1,2,3 and j = 1,2,3

When an index appears only once in a product, it designates a vector component. A product where an index appears twice is in fact a summation. A dot product would be written:

v1 * v2 = v1i.v2i ( i = 1,2,3 )
= v11.v21 + v12.v22 + v13.v23


( Wikipedia:
"According to this convention, when an index variable appears twice in a single term, once in an upper (superscript) and once in a lower (subscript) position, it implies that we are summing over all of its possible values." )

So in d(uj.ui)/dxj, the index i appears once, and it's logical since an index appearing only once in a product designates a vector component.
So the expression developped, is:

d(uj.ui)/dxj = d(u1.ui)/dx1 + d(u2.ui)/dx2 + d(u3.ui)/dx3 for i = 1,2,3

So for the x component of the equation we have:

d(u1)/dt + d(u1.u1)/dx1 + d(u2.u1)/dx2 + d(u3.u1)/dx3 = -dp/dx1

A good explanation of these equations are given in "Computational Methods for Fluid Dynamics" and it's the most intuitive explanation( better than the one provided by my Fluid Mechanics professor, even if, it is less complete ).

Note: of course, rho being constant, we know that the divergence of u equals zero...So, plugging that in the above equation, we have:

d(u1)/dt + u1.d(u1)/dx1 + u1.d(u1)/dx1 + u2.d(u1)/dx2 + u1.d(u2)/dx2 + u3.d(u1)/dx2 + u1.d(u3)/dx3 = -dp/dx1
=>d(u1)/dt + u1.d(u1)/dx1 + u2.d(u1)/dx2 + u3.d(u1)/dx3 = -dp/dx1 ( d(ui)/dxi = 0 )

Hence:

d(ui)/dt + u.grad(ui) = -dp/dxi, i=1,2,3

We generally calculate the gradiant of a scalar function, not the gradiant of a vectorial function( vector field ). I don't even know if the gradiant of a vector field do exist. The jacobian is something else( matrix built with the partial derivatives of the components of a vector field.

And finally, the dimensions are coherent:


[d(ui)/dt] = [L][T]¯1 [T]¯1 = [L][T]¯²;
[u.grad(ui)] = [L][T]¯1 [L][T]¯1 [L]¯1 = [L][T]¯²;
[dp/dxi] = [M][L][T]¯² [L]¯² [M]¯1[L]³ [L]¯1 = [L][T]¯²


[Edited by - johnstanp on August 13, 2008 10:50:43 AM]

This topic is closed to new replies.

Advertisement