PhiFlow Tutorial: Smoke Plume Simulation

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ม.ค. 2025

ความคิดเห็น • 52

  • @duncanhay9779
    @duncanhay9779 2 ปีที่แล้ว +4

    Love your teachings. they have helped me so much in my development. Thanks!

    • @MachineLearningSimulation
      @MachineLearningSimulation  2 ปีที่แล้ว

      Hey, thanks so much for the feedback and the donation :). I'm super happy I could help.

  • @alonsorodriguez5613
    @alonsorodriguez5613 2 ปีที่แล้ว +1

    As alwyas best CFD material on TH-cam.

  • @mickolesmana5899
    @mickolesmana5899 2 ปีที่แล้ว +2

    Ah nothing better than a video that reminds me of my assignment to do some fluid analysis

  • @ziqiangyang281
    @ziqiangyang281 2 ปีที่แล้ว +1

    Amazing!

    • @MachineLearningSimulation
      @MachineLearningSimulation  2 ปีที่แล้ว

      Nice, thanks 😊
      If you want more details on PhiFlow also check out the intro tutorial series by the main author:
      th-cam.com/play/PLYLhRkuWBmZ5R6hYzusA2JBIUPFEE755O.html

  • @johanj701
    @johanj701 2 หลายเดือนก่อน +1

    Hi I came across to your video while trying to make a 2D fluid sim inside cinema4d python editor. C4d does not call phi library. No module named 'phi'. Any advice?

    • @MachineLearningSimulation
      @MachineLearningSimulation  2 หลายเดือนก่อน

      Hi, phiflow is not natively installed in a python environment, hence I guess it is also not installed within the cinema4d python editor (very likely). If you have access to a terminal session for this python editor you could install it via pip. Alternatively, you can see if there is any GUI option to add additional packages.

    • @johanj701
      @johanj701 2 หลายเดือนก่อน +1

      @@MachineLearningSimulation Hi Felix. Thanks to you that I learned many things including how to use github more efficiently. I installed the phiflow to c4d python. I am curious about the rest. Best regards.

  • @ramakantgadhewal
    @ramakantgadhewal 2 ปีที่แล้ว +1

    Thank you so much.

  • @teddy3455
    @teddy3455 5 หลายเดือนก่อน

    Hi, I'm trying to use your model and add wind speed - but the buoyancy force rotates this wind which is unlike how it would act in real life . How would you resolve this ?

  • @sreeharihunnithan
    @sreeharihunnithan ปีที่แล้ว +1

    Hi amazing video!!. I couldn't find the video link to staggered grids. Can you share it here. Thanks

    • @MachineLearningSimulation
      @MachineLearningSimulation  ปีที่แล้ว

      You're welcome 😊
      Could you remind at which point in the video I talked about it, then I can recall.

    • @sreeharihunnithan
      @sreeharihunnithan ปีที่แล้ว

      @@MachineLearningSimulation at 2:30 . Also why is a staggered grid chosen to represent velocity vector ?

    • @MachineLearningSimulation
      @MachineLearningSimulation  ปีที่แล้ว

      Check out this video on the staggered grid (unrelated to phiflow though): th-cam.com/video/rV8tD2nQfkk/w-d-xo.html

    • @MachineLearningSimulation
      @MachineLearningSimulation  ปีที่แล้ว

      For me, the video link popped up in the info card to the video. From what kind of device are you watching these videos?

    • @MachineLearningSimulation
      @MachineLearningSimulation  ปีที่แล้ว

      Generally speaking, one uses staggered grids to avoid pressure oscillations. I think my video on the pipe flow scenario should explain the way the staggered grid avoids that :)

  • @MrPicklock
    @MrPicklock 2 ปีที่แล้ว +1

    Cool stuff!

  • @dr.ramchand2621
    @dr.ramchand2621 ปีที่แล้ว +1

    Can we implement the same technique of accelerating the simulation in another code, like DEM code?

    • @MachineLearningSimulation
      @MachineLearningSimulation  ปีที่แล้ว +1

      Hi, thanks for the comment? :)
      Do you refer to the point in the video when we used the jit compilation feature of phiflow?
      Yes, probably this will also help with other simulation paradigms (like DEM). If you write the simulation code in pure JAX (instead of phiflow) the gains of jit depend on the concrete operations you use. I'd encourage you to try it out :)

    • @MachineLearningSimulation
      @MachineLearningSimulation  ปีที่แล้ว

      If you use lower-level routines of phiflow, I'm sure you can also write dem simulations with it. 👍 And therefore also benefit from the jit features

    • @dr.ramchand2621
      @dr.ramchand2621 ปีที่แล้ว

      @@MachineLearningSimulation thank you for reply, please can you send me tutorial in this regard so that I can implement ? thanks in advance

    • @dr.ramchand2621
      @dr.ramchand2621 ปีที่แล้ว

      @@MachineLearningSimulation thank you very much, we can work on it. Please guide me

    • @MachineLearningSimulation
      @MachineLearningSimulation  ปีที่แล้ว

      @@dr.ramchand2621 I'm afraid I cannot send an individually crafted tutorial. That's beyond my available time.
      Feel free to take a look at PhiFlow's documentation and start with simple examples and slowly increase the complexity to the problem you want to solve. :)

  • @kumargaurav9824
    @kumargaurav9824 5 หลายเดือนก่อน

    How Can I add obstacles in smoke plume simulation? Can the environment layout be changed in the code?

    • @MachineLearningSimulation
      @MachineLearningSimulation  4 หลายเดือนก่อน

      As far as I am aware, PhiFlow should support the addition of obstacles within the domain and also supports rectangular domains.
      Check out its GitHub page with many cool examples: github.com/tum-pbs/PhiFlow
      This particular example could get you started: tum-pbs.github.io/PhiFlow/examples/grids/Batched_Smoke.html
      Since the phiflow 3.0 release, there is support for unstructured meshes but I haven't used it yet myself. You could check this example: tum-pbs.github.io/PhiFlow/examples/mesh/Build_Mesh.html

    • @kumargaurav9824
      @kumargaurav9824 4 หลายเดือนก่อน

      @@MachineLearningSimulation Thanks for the response. It was really helpful. I am trying to simulate a smoke plume in 2D field with obstacles. I want it to be without buoyancy. Is it possible to do so?

  • @maxmustermann-hx3fx
    @maxmustermann-hx3fx ปีที่แล้ว +1

    Wow I understand nothing but this is so cool

    • @MachineLearningSimulation
      @MachineLearningSimulation  ปีที่แล้ว

      :D. PhiFlow is quite abstract, which to some extent is also good as it helps you set up these simulations easily. If you want more in-depth coding tutorials, maybe check out this series of mine: th-cam.com/play/PLISXH-iEM4JmgBfU_QU262MQTYa7DoJK0.html
      Tutorials on even more details (also on the mathematical derivation of certain videos) will come over the next months :)

  • @adarshgouda847
    @adarshgouda847 2 ปีที่แล้ว +1

    Good job! This one has more details than the other one by Phil. When you step thru, smoke.advect --> compute buoyancy --> velocity projection -->velocity.advect --> add bouyancy --> make_incompressible. Where can I find literature on this method? What is this method called?

    • @MachineLearningSimulation
      @MachineLearningSimulation  2 ปีที่แล้ว +1

      Hey, thanks a lot 😊
      The approach taken in PhiFlow might not be the classical text book CFD, as it uses heavy operator splitting. The method used here goes by the name of "stable fluids" and is super common in computer graphics (aka special effects of smoke, fire or fluids in general). You can read more about it in Jos Stam's paper dl.acm.org/doi/10.1145/311535.311548 . You can easily find the PDF by googling. I also have a numpy/scipy implementation on the channel: th-cam.com/video/wbYe58NGJJI/w-d-xo.html
      As well as two Julia implementations with the FFT 😊

  • @ramakantgadhewal
    @ramakantgadhewal 2 ปีที่แล้ว +1

    Which python compiler are you using?

    • @MachineLearningSimulation
      @MachineLearningSimulation  2 ปีที่แล้ว +1

      I am using the standard Python interpreter. It is Python 3.8.8 with phiflow version 2.1.2

  • @jovanihernandez7331
    @jovanihernandez7331 2 ปีที่แล้ว +1

    which is your editor idle?

  • @pluronic123
    @pluronic123 2 ปีที่แล้ว +1

    Hi, I use PyCharm and somehow there is no module phi.jax
    There is "phi"
    AND
    there is "jax"
    But that generates a ton of other problems starting with:
    ModuleNotFoundError: No module named 'jaxlib'
    and so on..
    any suggestions? :)

    • @MachineLearningSimulation
      @MachineLearningSimulation  2 ปีที่แล้ว +2

      Hi,
      that's probably because you do not have Jax installed on your machine. If you use Windows, installing jax can be a bit more challenging (as of now it only works in the wsl2). However, you can also use pytorch or tensorflow. Just install one of the two and then call either "from phi.torch import flow" or "from phi.tf import flow".
      Let me know if that helped 😊

    • @pluronic123
      @pluronic123 2 ปีที่แล้ว +1

      @@MachineLearningSimulation Many thanks !
      I am currently learning from "Neural Networks from Scratch in Python" by Harrison Kinsley and Daniel Kukiela. And when I see scripts I always want to test them :D
      Couldn't install pytorch, got many errors but installing tensorflow worked for me. When I run the scrip I got a ton of errors but still worked. I think program wanted to use my GPU power, since GPU is old it switched to CPU, I guess.
      Big Thanks!

    • @MachineLearningSimulation
      @MachineLearningSimulation  2 ปีที่แล้ว +1

      You're welcome 😊
      I think tensorflow prints a couple of warnings there. It's the same for me actually on my laptop without a GPU.
      And good idea with trying out stuff, running scripts etc. That's the best way to learn it 👍

    • @dr.ramchand2621
      @dr.ramchand2621 ปีที่แล้ว

      @@MachineLearningSimulation Can I use this techniques of Jax with another code (FEM and DEM) for example LMGC90?

    • @MachineLearningSimulation
      @MachineLearningSimulation  ปีที่แล้ว

      ​@@dr.ramchand2621 Hi, thanks for the question :).
      I am unsure what you mean by the techniques of JAX? Generally speaking, JAX is very similar to NumPy: it's a set of mathematical operations (like MATLAB) that are available in a high-level language but are implemented efficiently in lower-level languages. Therefore, it allows you to implement (almost) all numerical algorithms you could have in NumPy or MATLAB.
      Feel free to ask a follow-up question, but please use a new comment and not in the thread that is already "closed". This increases visibility for me and organizes the topics better for someone else that might have a similar question :)

  • @jhanolaer8286
    @jhanolaer8286 2 ปีที่แล้ว

    may i know what is advection formula?

    • @MachineLearningSimulation
      @MachineLearningSimulation  2 ปีที่แล้ว

      For the smoke species, it is the Mac Cormack method (second order accurate and explicit): en.wikipedia.org/wiki/MacCormack_method
      For the fluid it is the semi-lagrangian scheme (adapted from the stable fluids algorithm): en.wikipedia.org/wiki/Semi-Lagrangian_scheme
      Also check out the corresponding PhiFlow documentation: tum-pbs.github.io/PhiFlow/phi/physics/advect.html

    • @jhanolaer8286
      @jhanolaer8286 2 ปีที่แล้ว

      @@MachineLearningSimulation Hi Sir.Can you help or guide me?😊, I want to do it in Excel and VBA, but I do not get the process.I tried to do something like this th-cam.com/video/LLnMKJSVgj0/w-d-xo.html but still confused how.

  • @velcro8299
    @velcro8299 4 หลายเดือนก่อน +1

    I do not know much about programming in python, But I have a lot of questions.

  • @jacobhelwig815
    @jacobhelwig815 2 ปีที่แล้ว +1

    More like Navier-SMOKES

    • @MachineLearningSimulation
      @MachineLearningSimulation  2 ปีที่แล้ว

      Definitely! :)
      Buoyancy flows or embedded species, in general, are fascinating to look at it.
      Will definitely have more videos on it, once the new series are back.