Particle Basics
In MFIX-Exa, particles are managed by the MFIXParticleContainer
class. This class is derived from AMReX’s NeighborParticleContainer
and handles all of the particle data.
MFIXParticleContainer
provides the functions for solving the
particle dynamics (based on particle-particle, particle-fluid, and
particle-wall forces)
Particle Dynamics
During the DES steps, particle positions are updated using the MFIXParticleContainer::EvolveParticles method. It’s structure is:
1 // Set time-step size (subdt) and number (numbsebsteps) for the DES steps
2 des_init_time_loop( &time, &dt, &nsubsteps, &subdt, &subdt_io );
3
4 // Temporary storage of forces and torques
5 std::map<PairIndex, Vector<Real>> tow;
6 std::map<PairIndex, Vector<Real>> fc;
7 for (MFIXParIter pti(*this, lev); pti.isValid(); ++pti)
8 {
9 PairIndex index(pti.index(), pti.LocalTileIndex());
10 tow[index] = Vector<Real>();
11 fc[index] = Vector<Real>();
12 }
13
14 while (n < nsubsteps) // step over number of substeps (DES part)
15 {
16 // Neighborlist house-keeping
17 if (n % 25 == 0) {
18 clearNeighbors(lev);
19 Redistribute();
20 fillNeighbors(lev);
21 buildNeighborList(lev,sort_neighbor_list);
22 } else {
23 updateNeighbors(lev);
24 }
25
26 // Iterate over particles
27 for (MFIXParIter pti(*this, lev); pti.isValid(); ++pti)
28 {
29 // Forces and torques due to particle-wall collisions
30 calc_wall_collisions_ls(particles, & ntot, & nrp,
31 tow[index].dataPtr(), fc[index].dataPtr(), & subdt,
32 ...
33 );
34
35 calc_particle_collisions(particles , &nrp,
36 neighbors[index].dataPtr() , &size_ng,
37 neighbor_list[index].dataPtr(), &size_nl,
38 tow[index].dataPtr(), fc[index].dataPtr(),
39 &subdt, &ncoll);
40 }
41
42 // Move particles based on velocities and forces
43 des_time_loop(&nrp , particles,
44 &ntot, tow[index].dataPtr(), fc[index].dataPtr(), &subdt,
45 &xlen, &ylen, &zlen, &stime, &n);
46 }
where the highlighted lines are responsible for moving the particles.