[HN Gopher] Fluid Simulation
       ___________________________________________________________________
        
       Fluid Simulation
        
       Author : nbaksalyar
       Score  : 111 points
       Date   : 2023-10-05 13:27 UTC (9 hours ago)
        
 (HTM) web link (kyndinfo.notion.site)
 (TXT) w3m dump (kyndinfo.notion.site)
        
       | MilStdJunkie wrote:
       | Marvelous work! I'm just starting to familiarize myself with
       | CFD/OpenFOAM in a CAD/CAM context,and it's sometimes remarkable
       | how compact and elegant the math can _occasionally_ be.
       | 
       | I'm reminded of the occasional notion in cosmology that many
       | mysteries of existence go away if you regard spatial dimensions
       | as emergent phenomenon arising from deeper quantum "degrees of
       | freedom". It makes me think of ancient assumptions - _atomos_ ,
       | Arunic _kana_ - that there is a thing - a space, a volume - too
       | small to cut into. But doesn 't that seem a little contrived? How
       | can something be too small to divide? I'd propose they're coming
       | at it from the wrong way. It's not the _space_ , it's the fact
       | that it can't be cut any more. The system's freedom of action
       | restricted to a single vector - the future can be constrained no
       | further - and subsequent knife cuts do nothing. The sum of these
       | qualities in maco systems thus, in our minds, resolve into width,
       | depth, length.
       | 
       | Similarly, stack up the CFD stuff fine enough and dense enough,
       | and you get FEA emerging. Now, I'm . . ok, keep in mind I am a
       | layman in _absolutely everything_ . . but it seems like a not-
       | horrible metaphor.
        
         | [deleted]
        
       | jitl wrote:
       | Wow, besides this fluid simulation note the site has a ton of
       | discussion of other topics. I love to see personal notes wikis
       | like this.
       | 
       | https://kyndinfo.notion.site/Sketching-with-Math-and-Quasi-P...
        
       | peter-m80 wrote:
       | Beautiful
        
         | jrms wrote:
         | Indeed
        
       | infixed wrote:
       | This topic is about fluid simulation, but it also references
       | shaders as a way to performantly implement fluid simulation.
       | 
       | I've played around with shaders in the past to build particle
       | simulations with millions of points, and it's always really
       | tickled my mind. You basically write functions that operate
       | against a big 2d grid of colors. But because colors are
       | represented by a 4x1 vector [r,g,b,a], you can repurpose this
       | pattern to do general purpose computation (e.g. you can represent
       | a point in a 3D coordinate space as a [r,g,b] color).
       | 
       | You can see this in the codepen in this post. It's literally
       | creating "materials" and "render targets" that are actually just
       | intermediate computation steps in the fluid simulation.
       | class Fluid {           constructor(context) {
       | this.context = context;               this.speed = 4;
       | this.forceInitMaterial =
       | this.createShaderMaterial(forceInitFrag);
       | this.divergenceMaterial =
       | this.createShaderMaterial(divergenceFrag);               ...
       | this.divergence = this.createRenderTarget();
       | this.advection = this.createRenderTarget();               ...
        
         | KeplerBoy wrote:
         | that's pretty much how CUDA was born 15 years ago. Crazy how a
         | few guys playing with shaders to simulate clouds led to the AI
         | craze we have today.
         | 
         | Look up Mark Harris PhD thesis "Real-Time Cloud Simulation and
         | Rendering" for more details.
        
       | ivolimmen wrote:
       | I once wrote a lava lamp thingy back in school when we were
       | toying with 16bit C++ and 32bit assembly to get some nice demos
       | on an mcga screen. It looks a bit like this but it was not a
       | simulation we used three different buffers with pictures
       | containing balls that we xor-ed over each other while the layers
       | were moving in different directions using sin/cos functions.
        
       | automatoney wrote:
       | Extremely impressive, and VERY well explained. I can't
       | overemphasize how much I wish there were way more stuff like this
       | online. I also really like something about having the English and
       | Japanese text right next to each other... maybe it's just the
       | visual reminder that there's so much more internet outside of the
       | English-speaking bubble.
        
       ___________________________________________________________________
       (page generated 2023-10-05 23:00 UTC)