Particlulate Flow
› Forums › OpenLB › General Topics › Particlulate Flow
- This topic has 4 replies, 3 voices, and was last updated 2 years, 8 months ago by mathias.
-
AuthorPosts
-
March 31, 2023 at 7:48 pm #7346Henderson_CParticipant
Dear OpenLB community,
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.
Regards,
- This topic was modified 2 years, 8 months ago by Henderson_C.
April 3, 2023 at 11:33 am #7351janParticipantDear Henderson,
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.Best regards,
JanApril 3, 2023 at 1:11 pm #7352Henderson_CParticipantDear Jan,
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.
Code snippet:
T newDensity = 0.8;
particle.template setField<PHYSPROPERTIES,MASS>( newDensity*M_PI*radiusP*radiusP );
accExt[1] = -9.81 * (1. – 1. / newDensity);Best regards,
April 3, 2023 at 1:23 pm #7353janParticipantDear Henderson,
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_externalAccelerationpublic in src/olb/particles/particlemanager.h and then modify it directly or write a simple setter function yourself.Best regards,
JanApril 3, 2023 at 1:24 pm #7354mathiasKeymasterDear Henderson_C,
that is beyond what we can help here in the forum. Furter help is availble at our spring school or within a common project!
Best
Mathias -
AuthorPosts
- You must be logged in to reply to this topic.
