Commit 412b4c5f authored by Johannes Blaschke's avatar Johannes Blaschke
Browse files

wip: particle dynamics

parent a50b3ac2
Loading
Loading
Loading
Loading
+48 −0
Original line number Diff line number Diff line
@@ -21,4 +21,52 @@ particle-particle, particle-fluid, and particle-wall forces).
Particle Dynamics
-----------------

During the DES steps, particle positions are updated using the
`MFIXParticleContainer::EvolveParticles
<https://amrex-codes.github.io/MFIX-Exa/doxygen/class_m_f_i_x_particle_container.html#a158f3f5fa11c262ad6a9909b40a5cd13>`_
method. It's structure is:

.. highlight:: c++

::

    // Set time-step size (subdt) and number (numbsebsteps) for the DES steps
    des_init_time_loop( &time, &dt, &nsubsteps, &subdt, &subdt_io );
    
    // Temporary storage of forces and torques
    std::map<PairIndex, Vector<Real>> tow;
    std::map<PairIndex, Vector<Real>> fc;
    for (MFIXParIter pti(*this, lev); pti.isValid(); ++pti)
    {
        PairIndex index(pti.index(), pti.LocalTileIndex());
        tow[index] = Vector<Real>();
        fc[index] = Vector<Real>();
    }

    while (n < nsubsteps) // step over number of substeps (DES part)
    {
        // Neighbourlist house-keeping
        if (n % 25 == 0) {
            clearNeighbors(lev);
            Redistribute();
            fillNeighbors(lev);
            buildNeighborList(lev,sort_neighbor_list);
        } else {
            updateNeighbors(lev);
        }

        // Itterate over particles
        for (MFIXParIter pti(*this, lev); pti.isValid(); ++pti)
        {
            // Forces and torques due to particle-wall collisions
            calc_wall_collisions_ls(particles, & ntot, & nrp,
                                    tow[index].dataPtr(), fc[index].dataPtr(), & subdt,
                                    ...
                                    );
            
            calc_particle_collisions(particles                     , &nrp,
                                     neighbors[index].dataPtr()    , &size_ng,
                                     neighbor_list[index].dataPtr(), &size_nl,
                                     tow[index].dataPtr(), fc[index].dataPtr(), &subdt, &ncoll);
        }
    }