Creating source of liquid particles

55 views
Skip to first unread message

Leonid Lunin

unread,
Nov 19, 2020, 7:36:44 AM11/19/20
to mantaflow Forum
Hello,

I want to make a simulation with a stream of liquid, for example a faucet in sink. As I unerstood there is a special function for making source of gases, but for liquids it's not. A possible soluation, that I can imagine,  could be generating a given field of particles with given velocities and coordinate for every dt (time step).

Is there any more elegant way?

Thanks in advance

Sebastián Barschkis

unread,
Nov 26, 2020, 11:33:47 AM11/26/20
to mantaflow Forum
Hello,

One way to achieve a continuous inflow of liquid is to repeatedly sample new particles. For example, by placing `sampleLevelsetWithParticles()` in your simulation loop.
The phi argument of that function would define the inflow area. It could be derived from a `Shape` with the `computeLevelset()` function.

If you want to give your inflow some initial velocity, I recommend using `setSource()` before calling the sampling function. This way all new particles will be initialized with the velocity from the source grid.

Hope this helps,

Best wishes,
Sebastián
Reply all
Reply to author
Forward
0 new messages