-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement new LB boundary infrastructure #4381
Comments
Actually, the |
The most clear syntax would probably be
If we want a convenience funciton
|
I'm open to name changes.
I'm afraid people won't do this for shape-based constraints. Setting the slip velocity of the 4-roller mill with this syntax on a 128x128x4 LB grid took me 30 seconds on a Release build, and probably several minutes on a Debug build. Before the convenience functions were introduced, the boundary velocity assignment was wrapped in a
Yes, that's a good idea. What we would also need to figure out, is where to store the boundary field. Currently this is contained in the LB class, but the EK code also needs it, and EK doesn't necessarily have a blockforest. We could duplicate the |
Replacing the calls to Maybe you @jngrad or @RudolfWeeber have a clue what the problem is. Otherwise my next steps would be to debug it and see what exactly changes the values of the pressure tensor. I already looked at the code of both the old and the new method quite deeply but could not see what the issue could be. Here is the diff causing the issue: @@ -99,6 +99,7 @@ class LBShearCommon:
self.lbf = self.lb_class(**LB_PARAMS)
self.system.actors.add(self.lbf)
+ self.lbf.clear_boundaries()
wall_shape1 = espressomd.shapes.Wall(
normal=shear_plane_normal, dist=AGRID)
@@ -109,8 +110,10 @@ class LBShearCommon:
wall2 = espressomd.lbboundaries.LBBoundary(
shape=wall_shape2, velocity=.5 * SHEAR_VELOCITY * shear_direction)
- self.system.lbboundaries.add(wall1)
- self.system.lbboundaries.add(wall2)
+ self.lbf.add_boundary_from_shape(
+ wall_shape1, velocity=-.5 * SHEAR_VELOCITY * shear_direction)
+ self.lbf.add_boundary_from_shape(
+ wall_shape2, velocity=.5 * SHEAR_VELOCITY * shear_direction)
t0 = self.system.time
sample_points = int(H / AGRID - 1) |
I had a quick look into it, and I can't tell what the issue is. The |
I printed out the content of the core hash map and can now report that the old I and @reinaual still don't understand why this is an issue, because fluid cells in contact with the boundaries physically cannot be in contact with the ghost layer boundaries (in this particular setup), therefore it shouldn't matter that the slip velocities are wrong in the old def check_profile(self, shear_plane_normal, shear_direction):
"""
Integrate the LB fluid and regularly compare with
the exact solution.
"""
self.tearDown()
self.setUp()
self.system.box_l = np.max(
((W, W, W), shear_plane_normal * (H + 2 * AGRID)), 0)
self.system.actors.add(self.lbf)
wall_shape1 = espressomd.shapes.Wall(
normal=shear_plane_normal, dist=AGRID)
wall_shape2 = espressomd.shapes.Wall(
normal=-1.0 * shear_plane_normal, dist=-(H + AGRID))
wall1 = espressomd.lbboundaries.LBBoundary(
shape=wall_shape1, velocity=-.5 * SHEAR_VELOCITY * shear_direction)
wall2 = espressomd.lbboundaries.LBBoundary(
shape=wall_shape2, velocity=.5 * SHEAR_VELOCITY * shear_direction)
wall_shape3 = espressomd.shapes.Wall(
normal=shear_plane_normal, dist=0)
wall_shape4 = espressomd.shapes.Wall(
normal=-1.0 * shear_plane_normal, dist=-(H + 2*AGRID))
wall3 = espressomd.lbboundaries.LBBoundary(
shape=wall_shape3, velocity=-20. * SHEAR_VELOCITY * shear_direction)
wall4 = espressomd.lbboundaries.LBBoundary(
shape=wall_shape4, velocity=20. * SHEAR_VELOCITY * shear_direction)
implementation = 'new'
if implementation == 'old':
self.system.lbboundaries.add(wall1)
self.system.lbboundaries.add(wall2)
self.system.lbboundaries.add(wall3)
self.system.lbboundaries.add(wall4)
else:
self.lbf.add_boundary_from_shape(
wall_shape1, velocity=-.5 * SHEAR_VELOCITY * shear_direction)
self.lbf.add_boundary_from_shape(
wall_shape2, velocity=.5 * SHEAR_VELOCITY * shear_direction)
self.lbf.add_boundary_from_shape(
wall_shape3, velocity=-20. * SHEAR_VELOCITY * shear_direction)
self.lbf.add_boundary_from_shape(
wall_shape4, velocity=20. * SHEAR_VELOCITY * shear_direction) With @reinaual There must be something wrong in the streaming step. |
@RiccardoFrenner for the time being, you can comment out the failing test in |
Okay, sure. |
@jngrad How should the For my understanding: |
You can comment out the lines in python tests that query boundary forces. These forces are not reliable at the moment, because the dynamic UBB doesn't natively support a macroscopic value getter to sum up the forces. That might change in the near future. |
The last thing I need to do is to move the |
You can move it to |
Where/how should I do my pull request? |
Simply post your branch name here, I'll review and merge it from the command line. |
Thanks! The merge was successful. |
Old infrastructure
The
LBBoundaries
framework offers aLBBoundary
wrapper class forShape
objects and a container to store and serializeLBBoundary
objects.Advantages:
Shapes
that were used to build that geometry can be recovered, including their slip velocitiesDisadvantages:
ObjectList
manager, which has a high maintenance costNew infrastructure
It is now possible to pass
Shape
objects directly to theLBFluidWalberla
instance to build the desired geometry without the above-mentioned disadvantages. It's also possible to pass a list of node indices to theLBFluidWalberla
instance, or to update nodes individually viaVelocityBounceBack
.It is however not possible to recover the sequence of shapes that were used to build that geometry, so if this information is important, one has to keep the
Shape
objects in a Python list and manually register this list in the checkpoint file. Likewise, the visualizer cannot know the sequence of shapes that was used to build the boundary geometry, so it needs to be rasterized withLB_draw_node_boundaries
.Outline
The new framework could be completed with the following steps:
system.lbboundaries.add(LBBoundary(shape=my_shape), velocity=my_vel)
tolb_fluid.add_boundary_from_shape(shape=my_shape, velocity=my_vel)
in the testsuite, samples, tutorials and user guide using 61b2e05 as a templateLB_draw_boundaries
feature from the OpenGL visualizer: the boundary geometry is now rasterized with theLB_draw_node_boundaries
featureVelocityBounceBack
class fromlbboundaries.py
tolb.pyx
LBBoundary
andLBBoundaries
classes in the core, script interface and python interfaceLB_BOUNDARIES
macro from the core, testsuite, samples, docs andmaintainer/configs/*.hpp
edge_detection()
andcalc_cylinder_tangential_vectors()
utility functions fromlbboundaries.py
; these are used to set up a cylindrical slip velocity in the testsuite and samplesThe text was updated successfully, but these errors were encountered: