erizmr / SPH_Taichi

A high-performance implementation of SPH in Taichi.
195 stars 39 forks source link

Support for custom geometry? #5

Open mattragoza opened 2 years ago

mattragoza commented 2 years ago

Does this package allow defining a custom geometry that contains the flow (for example, particles moving through pipes), and if so are there any examples of how to do this? Thanks!

erizmr commented 2 years ago

Hi, currently it only supports box-like boundaries and adding particle cubes. But it is not difficult to implement some simple geometries as the pipes you mentioned. I am wondering if you could provide more details about the features you expect?

kayhan-batmanghelich commented 2 years ago

Hi @erizmr Thank you for your reply. Imagine we have a system of pipes and I want to simulate the propagation of bubble in it. In our application, the "system of pipes" are blood vessels and the bubble are air bubbles in blood. I wan to use this an forward simulators for a limited field of view (ie bubbles enter the field of view and exit). To do that we need to define our geometry (ie geometry of vessels). Do you think this is possible here? Is it possible to do that for 3D also?

erizmr commented 2 years ago

Hi @kayhan-batmanghelich, thanks for your additional information. I think it is possible to do that here only needs a further module for scene description. Actually it is on my road map to add such a module for importing arbitrary geometries but requires some time to develop it. (And it can be naturally extended to 3D cases) Also, sorry I am not familiar with the blood related simulation and wondering usually how to do that using SPH method ?

kayhan-batmanghelich commented 2 years ago

Hi @erizmr . Thank you for your reply.

  1. I wouldn't worry about the blood (or fluid) aspect of it, for now.
  2. Think about vessels as a series of pipe. If you want to visualize it, take a look at this: https://images.app.goo.gl/Pcb2WuK5RESXyenQ7

We are working on a project that needs this component and if it works, we are happy to have you on the manuscript. Contact me if you are interested.

Thanks

SimonZeng7108 commented 2 years ago

@kayhan-batmanghelich Adding customised geometry is not so difficult, you only need to slightly modify the add_cube function. As the only thing add_cube does is to create particles based on positions. I have attached my implementation and it works well with the SPH solver. It produces the geometry straight from readings the pixels from image segmentations. Happy to share the code if needed. add_fluids

Cococyh commented 2 years ago

@SimonZeng7108 Can you share your codes? Thanks! :)