doyubkim/fluid-engine-dev

How do I set up a fluid particles at rest and a fluid particles with initial velocity

xiaoxiaoyu1872 opened this issue · 3 comments

such as water-crown example, droplet has initial velocity (0, -5, 0).
auto fbox = Box3::builder()
.withLowerCorner({0, 0, 0})
.withUpperCorner({1, 0.25 * domain.height(), 1})
.makeShared();

auto sphere = Sphere3::builder()
                  .withCenter(domain.midPoint())
                  .withRadius(0.15 * domain.width())
                  .makeShared();

auto surfaceSet = ImplicitSurfaceSet3::builder()
                      .withExplicitSurfaces({fbox})
                      .makeShared();

auto surfaceSet_sphere = ImplicitSurfaceSet3::builder()
                  .withExplicitSurfaces({sphere})
                  .makeShared();


auto emitter = VolumeParticleEmitter3::builder()
                   .withImplicitSurface(surfaceSet)
                   .withSpacing(targetSpacing)
                   .withMaxRegion(sourceBound)
                   .withIsOneShot(true)
                   .makeShared();


auto emitter_sphere = VolumeParticleEmitter3::builder()
                   .withImplicitSurface(surfaceSet_sphere)
                   .withSpacing(targetSpacing)
                   .withMaxRegion(sourceBound)
                   .withIsOneShot(true)
                   .withInitialVelocity(Vector3D(0, -5, 0)) 
                   .makeShared();


solver->setEmitter(emitter);
solver->setEmitter(emitter_sphere);

The problem with this is that emitter_sphere will overwrite emitter

Hi @xiaoxiaoyu1872,

In such cases (multiple emitters), can you try creating ParticleEmitterSet3, add your emitters to it, and then add the emitter set to the solver?

ParticleEmitterSet3 worked! Thank you very much

Awesome!