Particle manager
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Particle manager
- This topic has 7 replies, 2 voices, and was last updated 1 year, 1 month ago by jan.
-
AuthorPosts
-
November 20, 2023 at 5:12 am #7919RookieParticipant
Dear OpenLB developers,
How do I apply gravity to the particles and the particles collide with the wall fully elastically in version 1.6 of bifurcation3d, this is how I added gravity and set the particles to collide at the boundaries in version 1.5:
std::vector<T> direction{0 ,0 ,-1};
const T g = 9.81;
auto weightForce = std::make_shared
< WeightForce3D<T, PARTICLE>
> ( direction, g );
supParticleSystem.addForce( weightForce );T dT = converter.getConversionFactorTime() ;
std::set<int> reflBMat = { 2 };
auto materialreflectBoundary = std::make_shared
< SimpleReflectBoundary3D<T, PARTICLE>
> (dT, superGeometry, reflBMat);
supParticleSystem.addBoundary(materialreflectBoundary);Then I only found it in version 1.6:
particleManager.execute<
couple_lattice_to_particles<T,DESCRIPTOR,PARTICLETYPE>,
process_dynamics<T,PARTICLETYPE>,
update_particle_core_distribution<T,PARTICLETYPE>
>();
Is the motion of the particles set in this file(/olb-1.6r0/src/particles/functions/particleTasks.h)?Regards,
RookieNovember 22, 2023 at 11:11 am #7935janParticipantDear Rookie,
Unfortunately I’m traveling at the moment and can’t check the code sufficiently. However, the beauty of the new particle system is that we now have one particle system for subgrid and resolved particles.
So I suggest you check how gravity is added in examples/particles/dkt2d and you should be able to set it up similarly in your application. There you should find another task called
apply_gravity
and that the external acceleration is passed to the constructor of theParticleManager
. Therefore all particles must have the same density. If you need different densities, you’ll have to implement another function following the example provided.Best regards,
JanNovember 22, 2023 at 11:51 am #7937RookieParticipantDear jan,
Have a good trip, I have added gravity, but what I want to achieve next is to achieve the particle collision with the wall, rather than capturing the particle, and can you use the point particle method to achieve the particle effect on the fluid, such as adding the particle effect on the lattice:
particleManager.execute<
couple_lattice_to_particles<T,DESCRIPTOR,PARTICLETYPE>,
process_dynamics<T,PARTICLETYPE>,
update_particle_core_distribution<T,PARTICLETYPE>,
apply_gravity<T,PARTICLETYPE>,
couple_particles_to_lattice<T,DESCRIPTOR,PARTICLETYPE>
>();Best regards,
RookieNovember 22, 2023 at 12:19 pm #7938janParticipantDear Rookie,
Sorry, I missed the second part of your question.
Unfortunately, there is no implemented method that allows for particle-wall interactions when considering subgrid particles using the new particle system. However, the legacy subgrid particle system is still available and can still be used. Alternatively, you’re free to port the functionality to the new particle system. However, I assume this is no small feat.
Best regards,
JanNovember 22, 2023 at 12:27 pm #7939RookieParticipantDear jan,
I did not get used to the new particle system and did not find some features implemented in version 1.5. If the 1.5 version of the code is used, how to implement the effect of the particles on the lattice?
Best regards,
RookieNovember 26, 2023 at 12:15 pm #7945janParticipantDear Rookie,
Unfortunately, the new particle system does not include all features that are available in the legacy subgrid particle system. For that reason, the legacy particle system is included in the latest release as well (see
src/particles/subgrid3DLegacyFramework
, which you can use in the same way as you used it in 1.5.The second part of the post I unfortunately don’t understand fully, because in both versions I’m not aware of any coupling from the subgrid particles to the lattice, only a coupling from the lattice (fluid) to the particles is used in the example, which uses the default Stokes drag as it does in version 1.5.
Best regards,
JanNovember 27, 2023 at 4:51 am #7946RookieParticipantDear jan,
Some literatures I read is to use the method of Particle-Source-In Cell to realize the two coupling of particles and fluids, I do not know whether it is implemented in openlb. Because I find this folder (/ olb 1.6 r0 / SRC/particles/subgrid3DLegacyFramework/twoWayCouplings), my guess is that to achieve the role of the grid granule on grid is achievable. But I don’t have an example to refer to how to add the code I need. I really beg for your help, which is really important to me.
Best regards,
RookieDecember 6, 2023 at 9:33 am #7985janParticipantDear Rookie,
I saw that you already found a way in the legacy code to couple back from the particles to the fluid: https://www.openlb.net/forum/topic/simulatewithtwowaycoupling/
I’m leaving it here in case someone in future stumbles over this thread.Best regards,
Jan -
AuthorPosts
- You must be logged in to reply to this topic.