New emitter concept for variable velocity and velocity profiles #369
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I discovered that the current implementation of emitters does not allow for changes in the emit-velocity. It works somewhat for small changes, but after setting the velocity to zero, for instance, the emitter won't wake up again. I mentioned this in #309, although I didn't fully understand it back then.
This PR changes the emitter concept to avoid using the calculation of future activity based on the current velocity. The emitter is simply filled at the beginning of the simulation and the particles are advected in every step as dictated by the current velocity. I also shortened the implementation by not repeating the code for square and circular emitters.
Additionally, I made the boundary surrounding the emitter optional. This is already the case elsewhere but was missing in this repo.
Lastly, I added velocity profiles for circular emitters: You can now select an integer as an exponent and the emitter will get a corresponding velocity profile with the max velocity in the center. 0 will result in a constant velocity across the emitter, 1 in a linear distribution, 2 in a quadratic and so on. The volume flow is always kept the same as it would be for a constant velocity. The max velocity will therefore be a bit higher than the specified velocity.
I am looking forward to your feedback!