I noticed that I can change the mass of the particle in the middle of the simulation. So I was wondering if I changed the mass of the particle at a certain time step, will the density change? I apologize if the question is silly.
This topic was modified 8 months, 1 week ago by Henderson_C.
You can change the mass in the particle field, that is correct. However, that mass is most likely only used to solve the velocity verlet algorithm in your setup. So in that context the density changes, yes. But it doesn’t affect the external acceleration caused by gravity. In the DKT2D example, this acceleration is quantified by the variable accExt, as you can see, the particle density affects it. If you want to change it, you would have to update it with the new particle density.
Thank you for your reply. You have been very helpful and I really appreciate it. I am aware of the variable (accExt) but how can I impose it to the particle manager at certain time step after initially setting it in the simulation?
For example: The particle density at time = 0 is 1 but after 10 seconds the particle will have a density of 0.8.
yes, it should work like that, but if you’re using the ParticleManager, you also have to update the external acceleration stored there. Apparently this is not easy in OpenLB 1.5 because it’s a private variable. In the future release you’ll update it like this: particleManager.setExternalAcceleration(accExt);. This function is missing in 1.5. As a workaround, if waiting for the next release is not an option, you could make the variable _externalAcceleration public in src/olb/particles/particlemanager.h and then modify it directly or write a simple setter function yourself.