‘Fluid Simulation for Computer Graphics’reading notes 2

来源:互联网 发布:淘宝nala化妆品 编辑:程序博客网 时间:2024/04/28 11:18

Chapter 3 (Advection) and Chapter 4 (Incompressibility) are the essence of fluid simulation. Chapter 1 & 2 establish the physical model – Navier-Stokes Equation – these two chapters really elaborate how to make your fluid flowing.

Chapter 3 (Advection) states a not too hard concept: how to transfer (or, flow with) the desired quantities along with the flow. The basic framework is Semi-Lagrangian, which calculates the quantities on the fixed grid cells by back-tracing the imagery particles that is Lagrangian view. The direct way for this back-tracing is ‘forward Euler’, which is a simple linear calculation between dt and dv (- dt*dv). But it is said this ‘forward Euler’ is not accurate enough. So Rouge-Kutta level 2 is recommended. RK(2). All right, the consequent problem will be “how to handle the situation that the imagery particle is outside of the fluid?” The solution is quite simple: just use the initial value or the boundary value. This is the issue called ‘boundary condition’. The rest of the chapter focuses on some numerical issues. Convergence: because we are doing discretizing (kinda of finite element analysis??), we cannot take granularity too large – that is the limit for time step size. This is also known as CFL condition, that is not the same as Stability condition. This is a pure numerical analysis topic. Another important problem to solve: Numerical Dissipation. Note: we are using interpolation for back-tracing (forward Euler, Rouge-Kutta), and interpolation is only approximation – there will be error in each step. With steps accumulated, we will get a viscous-like fluid for inviscous fluid – the accumulated errors lead to the extra viscosity coefficient we discarded. Then the solution proposed by Ron Fedkiw, is to use a higher order of interpolation: Catmull-Rom interpolation (on quantities other than velocity – it is said velocity is not the main culprit). But this is not as stable as linear interpolation because that Catmull-Rom interpolation is not min/max bounded.. solution by Ron Fedkiw: just clamp the over- or under- errors.

Chapter 4 (Incompressibility) – this is “the heart of a fluid simulation”. In my opinion, particles only with advection can only lead to a bunch of Newtonian(gravity) particles without constrains among each other. So by N-S Equation, we have to subtract a portion of the velocity from the time step + density + divergence of pressure. Don’t forget we also need to make sure the incompressibility besides the N-S Equation. After substituting the velocity updated by N-S Equation into the Incompressibility Condition equation (the divergence-zero one), we can get a linear system to solve – for all the cells. Please note that we are calculating the new pressure values for the next time step. Preconditioned Conjugate Gradient method with Cholesky as the preconditioner is the solution for this linear system. (Umm.. MATHS again) We are set. But if you need a more accurate calculation on curved boundaries, several other solutions are available. The most intuitive one is geometrical – Finite Volume Method – in which we can involve the solid surface in the cell into the incompressibility equation. But better ones exist. We can treat everything from the Conservation of Energy view, thus we can ignore the geometrical details that are difficult to get precise. With the work transfer equation from high school physics combined with the Divergence Theorem equation (I love this theorem because it is the magical transfer between 2D and 3D quantities), we can get the similar linear system mentioned above. We can also involve multi-sampling to ‘smooth’ the quantities. Another notable point: still the boundary condition - several subtle tricks need to pay attention to. (Actually there are many MATHS details that I’m still not clear in this chapter. Well, I hope I can get more and more familiar with those in the following time.)

Also, a very talented undergrad from VT called Colin Braley is composing a much more intuitive introduction that helps me understand everything a lot. It is really appreciated that SPH is also introduced which Bridson doesn’t introduce in his book, which I love the most. BTW, the latest model for fluid simulation is LBM. Umm, sounds tasty..

P.S. There are tons of details of MATHS within the words.. and I’m not too familiar with some part of them.. I need learn MATHS simultaneously, of course.

原创粉丝点击