Class: Particles
Introduction¶
This class handles creation of particle objects and their attributes
Particle objects are instances of the ParSim::Particle
class.
Each Particle
object has attributes like position variables \((x, y)\), velocity components \((vx,vy)\) etc.
Physical Attributes¶
All the general purpose attributes and their physical essence is listed in the following table.
Attributes | Description |
---|---|
double x |
position \(x\) coordinate |
double y |
position \(y\) coordinate |
double vx |
velocity component along \(x\) direction |
double vy |
velocity component along \(y\) direction |
double alpha |
angular position/orientation of particle |
double omega |
angular velocity of particle |
double force_radial[2] |
Components of radial force on the particle [\(x\)-component, \(y\)-component] |
double force_tangential[2] |
Components of tangential force on the particle [\(x\)-component, \(y\)-component] |
double torque |
scalar torque on particle |
double radius |
radius of particle |
double vx_activity |
Active velocity along \(x\) direction |
double vy_activity |
Active velocity along \(x\) direction |
double omega_activity |
Active angular velocity |
double theta |
Active translational velocity director |
We have used forces along radial and tangential directions instead of x and y directions because in general the former are easier to calculate and code.
Each Particle
object also as a c++ linked-list called Neighbours
that is meant for containing list of the
particle's neighbours.
Attributes | Description |
---|---|
std:: list<int> Neighbours |
linked-list that contains a particle's neighbours' indicies |
Some integration schemes (specifically of \(\mathcal{O}(dt^{2})\) and higher order), need to have information about a particle's poistion, velocity and forces of previous time step. The following attributes are meant to store this information.
Attributes | Description |
---|---|
double position_prev[2] |
position \((x,y)\) of previous step |
double velocity_prev[2] |
position \((vx,vy)\) of previous step |
double alpha_prev |
orientation of previous step |
double omega_prev |
angular velocity of previous step |
double force_radial_prev[2] |
radial force components of previous step |
double force_tangential_prev[2] |
tangential force components of previous step |
double torque_prev |
torque components of previous step |
If one requires a calculation of pressure or stress (using Irving Kirkwood formula) then sigma[4]
is the \(\sigma_{ab}\) matrix.
Attributes | Description |
---|---|
double sigma[4] |
\(\sigma_{ab}\) matrix in Irving-Kirkwood formula |
Intialization¶
Default constructor. Initializes all attributes to0
.
Parameterized constructor. Intializes with received values for x
,y
,vx
,vy
and alpha
respectively.
Parameterize constructor. Intializes particles on a lattice grid using void ParSim::Particle::Lattice_initialize
Initalizes N
particles on a lattice grid of side-length L
. Receivesomega_activity
as an input omega_act
. vx,vy,alpha,omega,theta
are randomly initialized using uniform real distributions.