Skip to content

Reply To: How to set the degrees of freedom of the particle in HLBM

Due to recent bot attacks we have changed the sign-up process. If you want to participate in our forum, first register on this website and then send a message via our contact form.

Forums OpenLB General Topics How to set the degrees of freedom of the particle in HLBM Reply To: How to set the degrees of freedom of the particle in HLBM

#6496
jan
Participant

Dear Evan,

if you want to set the position of the particle, you can access the corresponding field directly. The following should work:


// get particle via id (starts from 0)
Particle<T, PARTICLETYPE> particle = particleSystem.get(particleID);
// set modified position
// you can use a similar method "getField" to get the content of the field
particle.template setField<GENERAL,POSITION>( modifiedPosition );

However, in my opinion it would be best to change the particle’s position before the coupling from the particle to the fluid via couple_particles_to_lattice. Therefore, you might have to separate the execution of the particleManager or even call the specified steps without it.

Best,
Jan

  • This reply was modified 3 years, 8 months ago by jan.