########################################################################## # # Now we set up the three LB boundaries that form the rectifying geometry. # The cylinder boundary/constraint is actually already capped, but we put # in two planes for safety's sake. If you want to create a cylinder of # 'infinite length' using the periodic boundaries, then the cylinder must # extend over the boundary. # ########################################################################## # Setup cylinder cylinder = LBBoundary(shape=espressomd.shapes.Cylinder(center=0.5 * BOX_L, axis=[1, 0, 0], radius=DIAMETER / 2.0, length=LENGTH, direction=-1)) system.lbboundaries.add(cylinder) # Setup walls wall = LBBoundary(shape=espressomd.shapes.Wall(dist=PADDING, normal=[1, 0, 0])) system.lbboundaries.add(wall) wall = LBBoundary( shape=espressomd.shapes.Wall(dist=-(LENGTH + PADDING), normal=[-1, 0, 0])) system.lbboundaries.add(wall) # Setup cone IRAD = 4.0 ANGLE = np.pi / 4.0
os.remove(os.path.join(checkpoint.checkpoint_dir, filepath)) LB_implementation = None if 'LB.CPU' in modes: LB_implementation = espressomd.lb.LBFluid elif 'LB.GPU' in modes and espressomd.gpu_available(): LB_implementation = espressomd.lb.LBFluidGPU if LB_implementation: lbf = LB_implementation(agrid=0.5, visc=1.3, dens=1.5, tau=0.01) system.actors.add(lbf) if 'THERM.LB' in modes: system.thermostat.set_lb(LB_fluid=lbf, seed=23, gamma=2.0) if any(has_features(i) for i in ["LB_BOUNDARIES", "LB_BOUNDARIES_GPU"]): if 'EK.GPU' not in modes: system.lbboundaries.add( LBBoundary(shape=Wall(normal=(0, 0, 1), dist=0.5), velocity=(1e-4, 1e-4, 0))) EK_implementation = None if 'EK.GPU' in modes and espressomd.gpu_available( ) and espressomd.has_features('ELECTROKINETICS'): EK_implementation = espressomd.electrokinetics ek = EK_implementation.Electrokinetics(agrid=0.5, lb_density=26.15, viscosity=1.7, friction=0.0, T=1.1, prefactor=0.88, stencil="linkcentered") ek_species = EK_implementation.Species( density=0.4, D=0.02,
system.actors.add(lbf) ########################################################################## # # Now we set up the three LB boundaries that form the rectifying geometry. # The cylinder boundary/constraint is actually already capped, but we put # in two planes for safety's sake. If you want to create a cylinder of # 'infinite length' using the periodic boundaries, then the cylinder must # extend over the boundary. # ########################################################################## # Setup cylinder cylinder = LBBoundary( shape=Cylinder( center=BOX_L / 2., axis=[1, 0, 0], radius=DIAMETER / 2.0, length=LENGTH, direction=-1)) system.lbboundaries.add(cylinder) # Setup walls ## Exercise 1 ## # Set up two walls to cap the cylinder respecting the padding # between them and the edge of the box, with a normal along the x-axis wall = ... # Setup cone IRAD = 4.0 ANGLE = pi / 4.0 ORAD = (DIAMETER - IRAD) / sin(ANGLE)
system.thermostat.set_lb(LB_fluid=lbf, gamma=frict, seed=42) ################################################################################ # # Now we set up the three LB boundaries that form the rectifying geometry. # The cylinder boundary/constraint is actually already capped, but we put # in two planes for safety's sake. If you want to create a cylinder of # 'infinite length' using the periodic boundaries, then the cylinder must # extend over the boundary. # ########################################################################## # Setup cylinder cylinder = LBBoundary( shape=Cylinder( center=[length / 2.0, (diameter + 4) / 2.0, (diameter + 4) / 2.0], axis=[1, 0, 0], radius=diameter / 2.0, length=length, direction=-1)) system.lbboundaries.add(cylinder) # Setup walls ## Exercise 1 ## # Set up two walls to cap the cylinder a distance of 2 away # from the edge of the box, with a normal along the x-axis wall = ... # Setup cone irad = 4.0 angle = pi / 4.0 orad = (diameter - irad) / sin(angle)
system.actors.add(lbf) ########################################################################## # # Now we set up the three LB boundaries that form the rectifying geometry. # The cylinder boundary/constraint is actually already capped, but we put # in two planes for safety's sake. If you want to create a cylinder of # 'infinite length' using the periodic boundaries, then the cylinder must # extend over the boundary. # ########################################################################## # Setup cylinder cylinder = LBBoundary( shape=espressomd.shapes.Cylinder( center=BOX_L / 2., axis=[1, 0, 0], radius=DIAMETER / 2.0, length=LENGTH, direction=-1)) system.lbboundaries.add(cylinder) # Setup walls ## Exercise 1 ## # Set up two walls to cap the cylinder respecting the padding # between them and the edge of the box, with a normal along the x-axis wall = LBBoundary(shape=espressomd.shapes.Wall(...), ...) # Setup cone IRAD = 4.0 ANGLE = np.pi / 4.0 ORAD = (DIAMETER - IRAD) / np.sin(ANGLE) SHIFT = 0.25 * ORAD * np.cos(ANGLE)
########################################################################## # # Now we set up the three LB boundaries that form the rectifying geometry. # The cylinder boundary/constraint is actually already capped, but we put # in two planes for safety's sake. If you want to create a cylinder of # 'infinite length' using the periodic boundaries, then the cylinder must # extend over the boundary. # ########################################################################## # Setup cylinder cylinder = LBBoundary(shape=Cylinder(center=BOX_L / 2., axis=[1, 0, 0], radius=DIAMETER / 2.0, length=LENGTH, direction=-1)) system.lbboundaries.add(cylinder) # Setup walls ## Exercise 1 ## # Set up two walls to cap the cylinder respecting the padding # between them and the edge of the box, with a normal along the x-axis wall = ... # Setup cone IRAD = 4.0 ANGLE = pi / 4.0
########################################################################## # # Now we set up the three LB boundaries that form the rectifying geometry. # The cylinder boundary/constraint is actually already capped, but we put # in two planes for safety's sake. If you want to create a cylinder of # 'infinite length' using the periodic boundaries, then the cylinder must # extend over the boundary. # ########################################################################## # Setup cylinder cylinder = LBBoundary(shape=Cylinder(center=0.5 * BOX_L, axis=[1, 0, 0], radius=DIAMETER / 2.0, length=LENGTH, direction=-1)) system.lbboundaries.add(cylinder) # Setup walls wall = LBBoundary(shape=Wall(dist=PADDING, normal=[1, 0, 0])) system.lbboundaries.add(wall) wall = LBBoundary(shape=Wall(dist=-(LENGTH + PADDING), normal=[-1, 0, 0])) system.lbboundaries.add(wall) # Setup cone IRAD = 4.0
################################################################################ # # Now we set up the three LB boundaries that form the rectifying geometry. # The cylinder boundary/constraint is actually already capped, but we put # in two planes for safety's sake. If you want to create an cylinder of # 'infinite length' using the periodic boundaries, then the cylinder must # extend over the boundary. # ################################################################################ # Setup cylinder cylinder = LBBoundary(shape=Cylinder( center=[length / 2.0, (diameter + 4) / 2.0, (diameter + 4) / 2.0], axis=[1, 0, 0], radius=diameter / 2.0, length=length, direction=-1)) system.lbboundaries.add(cylinder) # Setup walls ## Exercise 1 ## # Set up two walls to cap the cylinder a distance of 2 away # from the edge of the box, with a normal along the x-axis wall = ... # Setup cone irad = 4.0 angle = pi / 4.0