Migrated to KU Leuven gitlab
Cell(xsize=10, ysize=10, default_walls=False)
The Cell class serves as background for the simulation. It keeps track of particles and walls, as well as flux through the left-and right walls.
xsize
The size of the cell in the x-dimension. Default = 10.ysize
The size of the cell in the y-dimension. Default = 10.default_walls
IfTrue
, the default walls will be loaded. If set toFalse
, the top-and bottom walls are loaded, but others are to be loaded manually. Default = False.
add_particle(particle), remove_particle(wall)
Adds (removes) a particle to the cell.add_wall(wall), remove_wall(wall)
Adds (removes) a wall to the cell.set_field(val)
Sets field strength in the x-directionset_velocity(val)
Sets intrinsic velocity for particles in cellset_decay_rate(val)
Sets decay rate for particles in the cellset_pbc(True/False)
Set whether boundaries are periodicset_particle_radius(val)
Sets particle radius. Relevant to prevent wall glitches.
Cell.left_flux
returns the number of particles which left the cell through the left boundaryCell.right_flux
returns the number of particles which left the cell through the right boundary
Wall(x0, y0, xf, yf)
A simple wall object defined as a straight line between (x0
,y0
) and (xf
,yf
)
x0, y0, xf, yf
are the x-y coordinates of the end points of the wall.
RTP(x_pos=0, y_pos=0, angle=0)
The RTP class models a RTP and manages decays and collisions with walls.
x_pos
The x_position of the particle. Default = 0.y_pos
The y_position of the particle. Default = 0.angle
The angle of the particle. Default = 0
run(dt)
Advances the particle with a timestepdt
.tumble()
Assigns a random new angle to the particle.