<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>mikeash.com pyblog/fluid-simulation-for-dummies.html comments</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>mikeash.com Recent Comments</description><lastBuildDate>Sat, 06 Jun 2026 19:43:23 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>SPC - 2026-06-03 18:46:56</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>A revision of the code, including bug fixes and documentation, is available here:
&lt;br /&gt;pastebin[dot]com/p4kZHfuy</description><guid isPermaLink="true">3ddb1dd86406bce0ec31f04816540a3d</guid><pubDate>Wed, 03 Jun 2026 18:46:56 GMT</pubDate></item><item><title>Fergal - 2026-06-03 18:07:20</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>For linsolve, it looks like you're solving the Laplace equation numerically: 
&lt;br /&gt;
&lt;br /&gt;You may find the Wikipedia article on 
&lt;br /&gt;Laplace_equation_for_irrotational_flow
&lt;br /&gt;
&lt;br /&gt;helpful</description><guid isPermaLink="true">3b0e856729616138ad0fa8426f7217e9</guid><pubDate>Wed, 03 Jun 2026 18:07:20 GMT</pubDate></item><item><title>Catto - 2026-04-02 16:49:06</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>niggerlicious</description><guid isPermaLink="true">fdff975cb2a268fbca5082f91f8240c9</guid><pubDate>Thu, 02 Apr 2026 16:49:06 GMT</pubDate></item><item><title>Where U Elevate - 2026-01-08 09:18:50</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Career guidance for freshers is crucial in today’s competitive market, and platforms like Where U Elevate help students discover the right career paths through startup exposure, internships, and real-world opportunities.
&lt;br /&gt;
&lt;br /&gt;whereuelevate.com/blogs/career-guidance-for-freshers</description><guid isPermaLink="true">1baf63ba5e71d5b46cfab6a257d4c1dc</guid><pubDate>Thu, 08 Jan 2026 09:18:50 GMT</pubDate></item><item><title>Omar - 2024-07-06 17:37:01</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Great to see an actual implementation after reading all the thoery, thank you for this. But seriously, what is going on with these variable names? Can anyone with a closer understanding of the code please explain what all the variables in the advect function do? </description><guid isPermaLink="true">a6af36748b7697dbae961229b1b9a945</guid><pubDate>Sat, 06 Jul 2024 17:37:01 GMT</pubDate></item><item><title>e - 2022-04-26 15:47:23</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>water</description><guid isPermaLink="true">9460370bb0ca1c98a779b1bcc6861c2c</guid><pubDate>Tue, 26 Apr 2022 15:47:23 GMT</pubDate></item><item><title>bentheone - 2022-02-15 09:04:28</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>@Anssi, yes ! Thank you, I can't believe nobody pointed that out before. The diffusion ratio being dependent on the grid size makes ZERO sense.</description><guid isPermaLink="true">e9becb3f2fadf2ef1ccf238584b0cac7</guid><pubDate>Tue, 15 Feb 2022 09:04:28 GMT</pubDate></item><item><title>Anssi - 2022-01-10 20:22:55</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>I think there are many intances in the code (also in Stam's original article), where 'N', or 'N-2' should be replace by '1/SCALE'.
&lt;br /&gt;
&lt;br /&gt;This because SCALE represents the spatial step size, not ​1/(N-2). Right?  
&lt;br /&gt;
&lt;br /&gt;For example, the variable 'a' in the diffuse function should be defined as
&lt;br /&gt;&amp;nbsp;a=dt*diff*SCALE^{-2}, instead of a=dt*diff*(N-2)^2.
&lt;br /&gt;
&lt;br /&gt;Similar corrections seem to be in order in 'advect' and 'project' functions.
&lt;br /&gt;
&lt;br /&gt;At least this works for me. Now the qualitative local behaviour does not depend on the size of the grid N, as it should not. You need to adjust the parameters again, if you had adjusted them according to the original code.
&lt;br /&gt;
&lt;br /&gt;Btw. In diffuse function the 'a' is usually less than 1, and we can replace the 'lin_solve' there with the faster (and more straightforward)
&lt;br /&gt;​x[IX(i, j)] =  ​x0[IX(i, j)] ​+ a*( x0[IX(i+1, j)]+x0[IX(i-1, j)] ​+x0[IX(i, j+1)]​+x0[IX(i, j-1)]​-4*x0[IX(i, j)]​)
&lt;br /&gt;which would be stable in this case. (This was considered in Stam's article but discarded unnecessarily in my mind.)
&lt;br /&gt;</description><guid isPermaLink="true">22fb2b218106475bf989df9ad25cb661</guid><pubDate>Mon, 10 Jan 2022 20:22:55 GMT</pubDate></item><item><title>Aadhavan P - 2021-09-04 16:26:13</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Hi!
&lt;br /&gt;Very good article. I'm saving this for later. Will try to implement it after my exams. I'm very interested in simulating stuff like these.</description><guid isPermaLink="true">13e89f4e0095bb580c9bd1d9a31171c3</guid><pubDate>Sat, 04 Sep 2021 16:26:13 GMT</pubDate></item><item><title>Polaris - 2021-03-03 20:27:03</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Hey are you sure this is for dummies? As a dummy myself, I regret to inform that I was unable to understand.</description><guid isPermaLink="true">642a5ebf66cda226f7b204f8410e38cc</guid><pubDate>Wed, 03 Mar 2021 20:27:03 GMT</pubDate></item><item><title>rich engle - 2021-01-14 03:07:01</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>is there any way to have 2 fluids, like water and air?</description><guid isPermaLink="true">91551f207f44431d606240ac9290e10c</guid><pubDate>Thu, 14 Jan 2021 03:07:01 GMT</pubDate></item><item><title>Dimitri - 2020-10-26 20:05:42</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Hey, great work! 
&lt;br /&gt;Truly life-saving when this is not your field of work or studies, feels good to see the implementation beyond the theory
&lt;br /&gt;Thanks a lot for posting it</description><guid isPermaLink="true">ee858ab0d99b5577516e8c400c15a697</guid><pubDate>Mon, 26 Oct 2020 20:05:42 GMT</pubDate></item><item><title>Eli Maynard - 2019-03-24 13:48:08</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Hi, in
&lt;br /&gt;
&lt;br /&gt;&lt;code&gt;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x[IX(0, 0, N-1)]     = 0.33f * (x[IX(1, 0, N-1)]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+ x[IX(0, 1, N-1)]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+ x[IX(0, 0, N)]);
&lt;br /&gt;&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;should the &lt;code&gt;IX(0, 0, N)&lt;/code&gt; be &lt;code&gt;IX(0, 0, N-2)&lt;/code&gt;?
&lt;br /&gt;
&lt;br /&gt;Thanks for the article!</description><guid isPermaLink="true">2355534bbe86acaa69fa8733fd3a5bea</guid><pubDate>Sun, 24 Mar 2019 13:48:08 GMT</pubDate></item><item><title>Sam - 2017-12-07 04:33:33</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>I haven't read the whole thing yet, but the pointers are confusing me a bit. Why initialize a pointer rather than a value?</description><guid isPermaLink="true">0d849a3aa790be86702d17c198d8d11d</guid><pubDate>Thu, 07 Dec 2017 04:33:33 GMT</pubDate></item><item><title>Scott - 2015-08-23 23:47:11</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Mike, Do you remember why you need to multiply 'a' by '(N-2)^2 ' in the diffuse function? For example Stam does this in 2D, so I'm expecting it to be '(N-2)^3' for 3D?</description><guid isPermaLink="true">175fbdecc0a84d22dc10176a022daf36</guid><pubDate>Sun, 23 Aug 2015 23:47:11 GMT</pubDate></item><item><title>EWD - 2014-05-31 18:42:54</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Can anybody explain to me why in 2006 people still use variable names such as "b", "N" or "p"??? Are they trying to save the compiler the work with reading long words?? Were the variables called 'shit' and 'fuck', it would still be more helpful!
&lt;br /&gt;
&lt;br /&gt;But reading some of the comments here, some people deserve it.
&lt;br /&gt;
&lt;br /&gt;bob: Yeah, N*N*N elements for a 3-dimensional array is a terrible waste. Try to allocate N elements for a 3-dimensional array.</description><guid isPermaLink="true">1af60c1977536d500e3afc5d7ae71a65</guid><pubDate>Sat, 31 May 2014 18:42:54 GMT</pubDate></item><item><title>bob - 2011-07-19 18:24:17</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Why do you allocate N*N*N size for each dimension? This becomes impractical when work with large amounts of particles. For example, 
&lt;br /&gt;sizeof(float) * 8 callocs * (1000 particles ^ 3) = 32 gb.</description><guid isPermaLink="true">c7bea71b8d05cd380d67370e2d9edfac</guid><pubDate>Tue, 19 Jul 2011 18:24:17 GMT</pubDate></item><item><title>Martin - 2011-03-29 15:48:51</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>I had a deep look at the advect function and ask myself if it's correct to call it with the N-value. Shouldn't this be N-2 (or Nflaot be initialized by N-2)?
&lt;br /&gt;
&lt;br /&gt;Anyway, thanks a lot for the code, it's really valuable for learning how this stuff works!
&lt;br /&gt;</description><guid isPermaLink="true">2f4cbeb03ca90f339ba6ec442cd0cb38</guid><pubDate>Tue, 29 Mar 2011 15:48:51 GMT</pubDate></item><item><title>libero - 2011-02-04 21:45:29</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>does anyone have a working main() for this code because seems to be crashing and I cant find the reason for that? any help you be appreciated.</description><guid isPermaLink="true">adad331c79d7ab67f53724e83690d940</guid><pubDate>Fri, 04 Feb 2011 21:45:29 GMT</pubDate></item><item><title>Akash Verma - 2010-10-23 21:31:08</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Could someone please put up a main() for this to see it working?</description><guid isPermaLink="true">0287702b37ff2d99a9a0a17543a305b5</guid><pubDate>Sat, 23 Oct 2010 21:31:08 GMT</pubDate></item><item><title>Aaron Moffatt - 2010-06-23 09:01:50</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Very, very useful document.  Just to the point, outlining and giving example code of the key concepts.  Really appreciate you writing and posting this.</description><guid isPermaLink="true">c69cde36a16443fa6dce28d070d3dc27</guid><pubDate>Wed, 23 Jun 2010 09:01:50 GMT</pubDate></item><item><title>uma sankar pradhan - 2010-04-02 22:13:04</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>the code is great.
&lt;br /&gt;But in the projection method,
&lt;br /&gt;during the calculation of divergence of velocity field,why your dividing it by N.I suppose ,it shoud be multiplied as dx=dy=dz=1/N
&lt;br /&gt;div[IX(i, j, k)] = -0.5f*(
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;velocX[IX(i+1, j  , k  )]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-velocX[IX(i-1, j  , k  )]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+velocY[IX(i  , j+1, k  )]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-velocY[IX(i  , j-1, k  )]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+velocZ[IX(i  , j  , k+1)]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-velocZ[IX(i  , j  , k-1)]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)*N;
&lt;br /&gt;instead of
&lt;br /&gt;div[IX(i, j, k)] = -0.5f*(
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;velocX[IX(i+1, j  , k  )]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-velocX[IX(i-1, j  , k  )]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+velocY[IX(i  , j+1, k  )]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-velocY[IX(i  , j-1, k  )]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+velocZ[IX(i  , j  , k+1)]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-velocZ[IX(i  , j  , k-1)]
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)/N;
&lt;br /&gt;One more thing,
&lt;br /&gt;the Vx0,Vy0 need to be initialised to zero before each iteration.
&lt;br /&gt;I may be wrong.If i am wrong,kindly inform me.
&lt;br /&gt;
&lt;br /&gt;</description><guid isPermaLink="true">974dbf13c337cadbe264b3b2b7a36f96</guid><pubDate>Fri, 02 Apr 2010 22:13:04 GMT</pubDate></item><item><title>fluid - 2009-10-09 10:33:03</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>really cool fluid simulation is here: &lt;a href="http://www.escapemotions.com/experiments/fluid_fire_3/index.html"&gt;http://www.escapemotions.com/experiments/fluid_fire_3/index.html&lt;/a&gt;</description><guid isPermaLink="true">3d52bd18092e61ef598411ef7e3919a3</guid><pubDate>Fri, 09 Oct 2009 10:33:03 GMT</pubDate></item><item><title>Kent - 2009-07-23 15:38:22</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Thanks heaps for posting this code. I was just about to start moving Stams code from 2D to 3D myself. And I really like the way you have presented the code here. Nice work!</description><guid isPermaLink="true">2297a1c8125a4877ce476449f4aeab76</guid><pubDate>Thu, 23 Jul 2009 15:38:22 GMT</pubDate></item><item><title>willem - 2009-05-14 06:34:43</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>great to see it written for a non-mathematician. thanks</description><guid isPermaLink="true">8eaf15fc44831b5121deb6d414688c26</guid><pubDate>Thu, 14 May 2009 06:34:43 GMT</pubDate></item><item><title>student - 2009-05-10 06:36:10</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Im around this same code the 3d code you provide was very helpfull thanks. 
&lt;br /&gt;Im hava used several linear solvers gauss seidel relaxation (seq and parallel - Red Black), jacobi (seq and parallel) .... 
&lt;br /&gt;I'm trying to implement the CG method also because I adjusted the stams code to allow internal boundaries (moving or not), among other things.
&lt;br /&gt;I have a pertinent question: I understood after considereble digging that we are solving a system of linear equations in the form Ax=b however what confuses me is what is A exactly?
&lt;br /&gt;
&lt;br /&gt;Any comments or regards on this would be quitte helpfull anyone?
&lt;br /&gt;
&lt;br /&gt;responses to: a14722@ubi.pt </description><guid isPermaLink="true">79948841688a372e57cb8d276179ccf4</guid><pubDate>Sun, 10 May 2009 06:36:10 GMT</pubDate></item><item><title>mikeash - 2009-04-14 02:33:14</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>There is no main function because it's a discussion of techniques, not a full working example. You will have to incorporate what is provided into your own code. If you know little C then an application of this complexity is probably not a good place to start. You need to learn to walk before you can run.</description><guid isPermaLink="true">dc9112748f6dbcf9eb301e4e9a3da614</guid><pubDate>Tue, 14 Apr 2009 02:33:14 GMT</pubDate></item><item><title>Tom - 2009-04-14 02:15:33</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Why is there no main function?
&lt;br /&gt;actually i know little about c, but i wanna learn this application and apply it into processing. </description><guid isPermaLink="true">b927e7cc0d41087398694ddefa6a1ff0</guid><pubDate>Tue, 14 Apr 2009 02:15:33 GMT</pubDate></item><item><title>nabeel - 2009-04-03 16:20:54</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Great stuff. Wonder why they never make sound this easy in texts. wonder if i can work out mixing in two phases with this???</description><guid isPermaLink="true">1b373fa7e49d4969f54c1a2988587b30</guid><pubDate>Fri, 03 Apr 2009 16:20:54 GMT</pubDate></item><item><title>Lars - 2008-12-17 05:12:52</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Thanks very much for the 3D conversion of Jos Stam's 2D code -- it has saved me work and brainache. :-)
&lt;br /&gt;I was hoping to make a fun screensaver and this should give me a good boost.</description><guid isPermaLink="true">efbff884cd89c3126ba9cec528b1b603</guid><pubDate>Wed, 17 Dec 2008 05:12:52 GMT</pubDate></item><item><title>Ivan DeWolf - 2008-09-17 10:25:18</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>
&lt;br /&gt;here is another website with a really legible java implementation in 2d... be sure to look at the source code...
&lt;br /&gt;it also uses a gauss-seidell relaxation scheme for it's linear solver. I really wish I understood the linear solver part more.
&lt;br /&gt;
&lt;br /&gt;&lt;a href="http://www.multires.caltech.edu/teaching/demos/java/stablefluids.htm"&gt;http://www.multires.caltech.edu/teaching/demos/java/stablefluids.htm&lt;/a&gt;
&lt;br /&gt;</description><guid isPermaLink="true">d408071dee7b935fe3fecdeb60de53ea</guid><pubDate>Wed, 17 Sep 2008 10:25:18 GMT</pubDate></item><item><title>Setis - 2008-06-16 20:40:59</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>About the rendering:
&lt;br /&gt;
&lt;br /&gt;Since you know how to take a 2d slice, showing the density of ink, you can render it in 3d this way:
&lt;br /&gt;
&lt;br /&gt;Take n 2d slices in a given time. Draw the slices in textures, so the more ink in a given cell, the less transparent and more colored is the corresponding pixel. Now draw a 3D cube of all the slices stacking. That way, you can see the ink moving in the cube. Just add some code for rotating the cube and so.</description><guid isPermaLink="true">907cd07f2d2308a8903316a05567b971</guid><pubDate>Mon, 16 Jun 2008 20:40:59 GMT</pubDate></item><item><title>anonymous friend - 2008-01-25 03:07:26</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>The lin_solve function simply solve a system of linear equations. Since the matrix of this system is sparse (i.e contain a lot of zeros), this system can be solved efficiently (note that there exist more accurate algorithms) using a Gauss-Seidel algorithm.
&lt;br /&gt;
&lt;br /&gt;What do we solve exactly ? For the diffusion, we try to find tthe densities which, when diffused backward in time, gives the density we started with. In the case of the projection, it is a little more complicated. We are solving a linear system called a poisson equation. In mathematics, Poisson's equation is a partial differential equation. To make sure that the fluid is incompressible, we need to satisfy the non-divergence condition.
&lt;br /&gt;
&lt;br /&gt;The divergence of a vector field (the velicity of the fluid)at a particular location is a scalar value that essentially represents how much the field is ‘expanding’ at the point. A positive value represents a divergence and a negative value represents a convergence or compression.If we use the assumption that a fluid is incompressible, then that implies that the divergence of the velocity must be zero everywhere. 
&lt;br /&gt;
&lt;br /&gt;A useful splitting method for solving the incompressible flow equations is the so-called ‘projection method’. In this technique, one first computes a divergent vector field that results from the advection &amp;amp; viscosity terms, and then projects that entire vector field onto the space of non-divergent vector fields
&lt;br /&gt;This can be thought of as creating an instantaneous pressure field whose gradient compensates for any divergence caused by the advection &amp;amp; viscosity.
&lt;br /&gt;
&lt;br /&gt;Getting back to the poisson equation, we create these beast to solve the unknown pressure field. The gradient of this pressure field is an additional force on the fluid and the divergence of this gradient compensates for the divergence resulting from the convection-viscosity equation. The result is a final velocity field that has no divergence.</description><guid isPermaLink="true">6f48e28ec5771ac309136f0efd4a22b3</guid><pubDate>Fri, 25 Jan 2008 03:07:26 GMT</pubDate></item><item><title>mikeash - 2006-12-12 23:27:00</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Brian, I&amp;amp;#8217;m glad you found it useful, and please do send me your results if you&amp;amp;#8217;d like.
&lt;br /&gt;</description><guid isPermaLink="true">04d858d99d3447770963e778ac71f85b</guid><pubDate>Tue, 12 Dec 2006 23:27:00 GMT</pubDate></item><item><title>Brian Silva - 2006-12-02 18:48:00</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Nice work! I am doing exactly the same work with Stam&amp;amp;#8217;s implementation, but I was having trouble getting the simulation step to function correctly. I took your methodology from the FluidCubeStep and it solved my problem. So, thank you!&amp;lt;br /&amp;gt;
&lt;br /&gt;&amp;lt;br /&amp;gt;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;I agree with you about the original sources: they are difficult to understand and don&amp;amp;#8217;t explain the math very well.  I&amp;amp;#8217;m not entirely mathematically-inclined so I struggled for a long time to understand it. I&amp;amp;#8217;m setting out on a school project to explain the math from this particular implementation in a clear way. If you&amp;amp;#8217;re interested, I can send it to you when I finish.&amp;lt;br /&amp;gt;
&lt;br /&gt;&amp;lt;br /&amp;gt;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Again, great work!
&lt;br /&gt;</description><guid isPermaLink="true">0f289d8d038fc3e9c6d69c61a5fd0060</guid><pubDate>Sat, 02 Dec 2006 18:48:00 GMT</pubDate></item><item><title>neil - 2006-08-16 08:54:00</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>im a newbei and i want to learn more about simulation and animation, but my problem is i cant afford to enroll to schools, thats why im looking for free ebooks and tutorials which is available in this world. but my collections are not enough for my thirsty head. all i want is to learn more, if anyone could share their knowledge and books or sites i dont know yet, please enlighten me, by the way im making some simulation in physics principles or topics to help me in my carrier as future physics teacher, but i still need to learn lots of things, so guys please share your informations i assure you it wont go to waste. thanks. heres my add, &amp;lt;a href="mailto:kaerfmove@yahoo.com, thanks!" rel="nofollow"&amp;gt;kaerfmove@yahoo.com, thanks!&amp;lt;/a&amp;gt;
&lt;br /&gt;</description><guid isPermaLink="true">d580917a5161e5dc314cdf8148cdebe1</guid><pubDate>Wed, 16 Aug 2006 08:54:00 GMT</pubDate></item><item><title>Artur W - 2006-07-12 14:23:00</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Thank you very much! Finally something for a dummy like myself. Less equations and more detail on turning them into actual implementation. &amp;lt;br /&amp;gt;
&lt;br /&gt;This helps!
&lt;br /&gt;</description><guid isPermaLink="true">e7896d53730c970f62482f2245fc0ae9</guid><pubDate>Wed, 12 Jul 2006 14:23:00 GMT</pubDate></item><item><title>N382AF - 2006-03-15 01:01:00</title><link>http://www.mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html#comments</link><description>Nice work here, I saved it for reading later.  A bit over my head, but I love learning this stuff!&amp;lt;br /&amp;gt;
&lt;br /&gt;&amp;lt;br /&amp;gt;
&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Thanks!
&lt;br /&gt;</description><guid isPermaLink="true">e070c725b1c6708ebaccb394034d3bb5</guid><pubDate>Wed, 15 Mar 2006 01:01:00 GMT</pubDate></item></channel></rss>
