Fluid simulation in thin tube

Hello, Im not used to making simulations. I tried a simple cube as a domain and a sphere as inflow and it worked just as the tutorial Ive seen. However, I need to make a thin tube getting filled with liquid. And with those objects, nothing is working. For context, its a scene about blood donation and Im trying to make the tube and the bag filled with blood. nothing is working despite me doing the same thing I did in the simplified test mentioned above. Can someone help me? I’ll upload a screenshot of my settings. Thank you in advance.

Fluid sim works in scale where inflow/outflow should be something like 10% of size of domain to avoid issues. So if you have inflow 1cm inside tube, your tube length should be something like 10cm. So it is better to have inflow outside of tube.

Also the domain should be shape as cube (X, Y and Z length can be unique) and that is volume of fluid simulation where things happens. Simulation resolution is then calculated from longest side. You can model there tube inside that domain as obstacle with some thickness, like 2mm thickness.

Simulation resolution will limit stuff because it is calculated as voxels and all objects must be enough big compared to resolution. So if tube thickness is 2mm, voxel size is good to have half of that 1mm so in full 1024 resolution, you can model volume something like 512x512x64mm and inside that volume you got inflow, tube and everything where fluid goes. Subdivision doesn’t work here, it makes things worse.

If that is not enough, like having blood circulation system of human body and bag of blood in the simulation it is better to do simulation using fluid particles. They are not limited to work inside some volume. With particles, you are limited amount of fluid you simulate. If your particle size is 1x1x1mm, 100cm^3 volume of fluid requires 100000 particles.

as I see in this image you made the tube as domain instead of obstacle! domain should be a simple cube.
also add thickness to your tube before sim to avoid leaking and remove it for rendering if you don’t want it.

I would look into an animated curve that is co-linear with your tube, rather than trying to do a real fluid sim. The surface tension inside a tube is difficult to simulate, and your resolution would need to be very high, and honestly, it probably wouldn’t even work well.

Thank you all for the answers! In the end, I made a texture half red and half transparent and animated the UV offset from one to the other and it worked out pretty well. But it’s good to know the things I was doing wrong regarding fluid simulation anyway, so thank you very much.

1 Like

Animating the texture is smart, nice work!