Reply To: How to set the degrees of freedom of the particle in HLBM
OpenLB – Open Source Lattice Boltzmann Code › Forums › on 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
April 25, 2022 at 12:28 pm
#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 2 years, 9 months ago by jan.