Skip to content

Reply To: Wall contact in particle simulation (dkt2d example)

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Wall contact in particle simulation (dkt2d example) Reply To: Wall contact in particle simulation (dkt2d example)

#8468
jan
Participant

Dear avrachan,

If you only want to define the bottom wall, using IndicInverse<T, DESCRIPTOR::d> is wrong. This indicator inverts the indicator that is passed to it, i.e. thebottomboxyou define is the hole in a wall that takes up the rest of the indicator’s bounding box (defined byminandmax). Therefore, I suggest that you only use theIndicatorCuboid directly:


Vector<T,2> extend_mL(lengthX,L/2.);
Vector<T,2> origin_mL(0.,-L/2);
solidBoundaries.push_back( SolidBoundary<T, DESCRIPTOR::d>(
std::make_unique<IndicatorCuboid2D<T, DESCRIPTOR::d>>(extend_mL,origin_mL), 2, wallContactMaterial));

The error you saw is caused by the particles being completely immersed in the walls. Therefore, a contact is detected and a force is calculated. Full overlap is unrealistic, and the contact model is not valid in this case either, making the force obviously incorrect and likely causing unexpected behavior.

Regarding the second question. You’re absolutely right, you could wrap that part with another if condition that checks if the corresponding location is near a wall (e.g. using the circumference radius of the geometry). However, in most cases the signed distance functions should be fairly cheap to evaluate, and in my tests the contact detection on the lattice wasn’t the limiting factor, the force calculation was usually more expensive, but that might admittedly change if many complex walls are involved.

Best regards,
Jan

  • This reply was modified 1 month ago by jan.