mus_particle_MEM module contains routines needed for the simulation of fully resolved Momentum Exchange Method particles
-------------------- AUXILIARY ROUTINES ------------------------!!
Routine to initialize a newly created MEM particle
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_MEM_type), | intent(inout) | :: | particle |
Particle to initialize |
||
| integer, | intent(in) | :: | particleID |
Number to uniquely identify particle particle |
||
| type(mus_geom_type), | intent(in) | :: | geometry |
Geometry to determine TreeIDs of elements 'covered' by particle |
||
| type(mus_scheme_type), | intent(inout) | :: | scheme |
Scheme for access to level descriptor |
||
| integer, | intent(in) | :: | myRank |
MPI rank of this process |
||
| type(mus_particles_communication_type) | :: | comm |
Communication data type for particles |
|||
| logical, | intent(out) | :: | rmflag |
flag to indicate whether particle exists on this process or should be removed |
ApplyHydrodynamicForces performs the momentum transfer from fluid TO particle
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_MEM_type), | intent(inout) | :: | this | |||
| type(mus_scheme_type), | intent(inout) | :: | scheme |
Scheme for access to level descriptor |
||
| type(tem_stencilHeader_type), | intent(in) | :: | stencil |
fluid stencil |
||
| type(mus_param_type), | intent(in) | :: | params |
Parameters for access to conversion factors between units |
||
| real(kind=rk), | intent(in), | optional | :: | rho_p_lat |
Density value to compute equilibrium PDFs with in case local fluid density is not available because i.e. the adjacent element is a wall or another particle. |
mapToLattice is the high-level routine performs a full re-mapping each time step
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_MEM_type), | intent(inout) | :: | this | |||
| type(mus_particle_group_type), | intent(inout) | :: | particleGroup |
Particle group in which to search for collisions |
||
| type(mus_scheme_type), | intent(inout) | :: | scheme |
Scheme for access to level descriptor |
||
| type(tem_stencilHeader_type), | intent(in) | :: | stencil |
fluid stencil |
||
| type(mus_geom_type), | intent(in) | :: | geometry |
Geometry to determine TreeIDs of elements 'covered' by particle |
||
| type(mus_param_type), | intent(in) | :: | params |
Parameters for access to e.g. time step dt |
||
| logical, | intent(out) | :: | rmflag |
Flag that tells whether to remove this particle from this process |
updateCoordOfOrigin updates the integer coordinate of the origin of a particle
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_MEM_type), | intent(inout) | :: | this |
Particle to update coordOfOrigin of |
||
| type(mus_geom_type), | intent(in) | :: | geometry |
Geometry information to determine new coord of origin |
UpdateExclusionList uses the continuous particle position and particle radius to determine which lattice elements belong to the particle. These are stored in the 'ExclusionList' of elements which do not participate in stream-and-collide. It also checks if particles exist or should exist on some other process and stores this information in the logical masks of the particle.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_MEM_type), | intent(inout) | :: | this | |||
| type(mus_scheme_type), | intent(inout) | :: | scheme |
Scheme for access to level descriptor |
||
| type(mus_geom_type), | intent(in) | :: | geometry |
Geometry information to determine TreeIDs of elements 'covered' by particle |
||
| integer, | intent(in) | :: | myRank |
This process's rank |
||
| integer, | intent(in) | :: | procs(:) |
Array of neighbor procs on which particle could possibly exist |
||
| integer, | intent(in) | :: | nProcs |
Number of procs in array procs |
||
| real(kind=rk), | intent(in) | :: | dx |
Mesh size |
||
| logical, | intent(out) | :: | rmflag |
Logical to indicate whether particle should be removed from this process |
updateSolidNodes modifies connectivity of scheme%pdf%neigh such that the particle cells do not participate in the streaming process. Specifically it: * runs over the elements in this%exclusionList * sets kernel neighbor list values to the particle elements themselves. * This way they are effectively excluded from the streaming process. * Sets the property bit prp_solid to 1 to indicate elements belonging to a particle
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_MEM_type), | intent(inout) | :: | this | |||
| type(mus_scheme_type), | intent(inout) | :: | scheme |
Scheme for access to pdf%neigh |
||
| type(tem_stencilHeader_type), | intent(in) | :: | stencil |
fluid stencil |
updateFluidNeighbors Runs over all particle elements (those in exclusionList) and then over each stencil direction. When it finds a fluid neighbor in a direction it sets the bounceback condition for that neighbor
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_MEM_type), | intent(inout) | :: | this | |||
| type(mus_scheme_type), | intent(inout) | :: | scheme |
Scheme for access to level descriptor |
||
| type(tem_stencilHeader_type), | intent(in) | :: | stencil |
fluid stencil |
updateNewFluidNodes restores the correct connectivity for new fluid elements which were particle elements in the previous time step.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_MEM_type), | intent(inout) | :: | this | |||
| type(mus_scheme_type), | intent(inout) | :: | scheme |
Scheme for access to level descriptor |
||
| type(tem_stencilHeader_type), | intent(in) | :: | stencil |
fluid stencil |
destroyParticle_MEM removes a particle from the lattice and the particleGroup It will * empty the exclusionList * initialize all the former particle elements to new fluid elements * restore connectivity for all these new fluid elements This routine should be followed up by a call to remove_particle_from_da_particle_MEM!
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_MEM_type), | intent(inout) | :: | this | |||
| type(mus_particle_group_type), | intent(inout) | :: | particleGroup |
Particle group in which to search for collisions |
||
| type(mus_scheme_type), | intent(inout) | :: | scheme |
Scheme for access to level descriptor |
||
| type(mus_param_type), | intent(in) | :: | params |
Parameters for access to dx and dt |
ApplyVelocityBounceback adds the momentum exchange term to the distribution function at the particle neighboring fluid nodes this term accounts for the moving boundary of the particle.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_MEM_type), | intent(inout) | :: | this | |||
| type(mus_scheme_type), | intent(inout) | :: | scheme |
Scheme for access to level descriptor |
||
| type(tem_stencilHeader_type), | intent(in) | :: | stencil |
fluid stencil |
||
| type(mus_param_type), | intent(in) | :: | params |
Parameters for access to dt, dx, conversion factors between units |
handleParticleOverlap checks for overlap with discrete representations of other particles. Returns overlapsOtherParticle = TRUE if there is overlap. This does not require communication with other processes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_MEM_type), | intent(inout) | :: | this |
Particle we are currently checking overlap for |
||
| type(mus_particle_group_type), | intent(inout) | :: | particleGroup |
particleGroup to search for overlapping particles in |
||
| type(mus_scheme_type), | intent(in) | :: | scheme |
Scheme for access to level descriptor |
||
| logical, | intent(out) | :: | overlapsOtherParticle |
logical indicating if a overlap has been detected (1) or not (0) |
setToEquilibrium sets elements to equilibrium distribution
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | elemList(:) |
list containing positions in state vector of elements to set to equilibrium distribution |
||
| integer, | intent(in) | :: | N |
number of values in elemList |
||
| integer, | intent(in) | :: | lev |
level |
||
| type(mus_scheme_type), | intent(inout) | :: | scheme |
scheme for access to levelDesc and pdf |
||
| real(kind=rk), | intent(in) | :: | rho(:) |
density value for computing fEq |
||
| real(kind=rk), | intent(in) | :: | vel(:,:) |
velocity vector |
make_pdf_tiny sets the state vector (particle distribution function) values to some tiny value. This is done for visualization purposes. It has no effect on the flow as the particle elements do not participate in the stream-and-collide process.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_scheme_type) | :: | scheme | ||||
| type(mus_particle_MEM_type) | :: | particle | ||||
| integer | :: | lev |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_MEM_type), | intent(inout) | :: | this | |||
| type(mus_scheme_type), | intent(inout) | :: | scheme |
Scheme for access to level descriptor |
||
| type(mus_geom_type), | intent(in) | :: | geometry |
Geometry information to determine TreeIDs of elements 'covered' by particle |
||
| integer, | intent(in) | :: | myRank |
This process's rank |
||
| integer, | intent(in) | :: | procs(:) |
Array of neighbor procs on which particle could possibly exist |
||
| integer, | intent(in) | :: | nProcs |
Number of procs in array procs |
updateExistsOnProc updates the mask that tells us whether a particle exists on our neighboring procs. It does this by checking which processes are intersected by the bounding box of the particle + a "bumper" of one lattice cell to account for the fact that a particle can also exist on a proc as purely halos
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_MEM_type), | intent(inout) | :: | this | |||
| type(mus_scheme_type), | intent(inout) | :: | scheme |
Scheme for access to level descriptor |
||
| type(mus_geom_type), | intent(in) | :: | geometry |
Geometry information to determine TreeIDs of elements 'covered' by particle |
||
| integer, | intent(in) | :: | myRank |
This process's rank |
||
| integer, | intent(in) | :: | procs(:) |
Array of neighbor procs on which particle could possibly exist |
||
| integer, | intent(in) | :: | nProcs |
Number of procs in array procs |
||
| logical, | intent(out) | :: | rmflag |
logical to set whether particle should be removed from this proc |
find particle index and ID in particleGroup array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mus_particle_group_type), | intent(in) | :: | particleGroup |
Array of particles |
||
| integer, | intent(in) | :: | elemPos |
Index of element for which to find particle in state array |
||
| integer | :: | thisParticleIndex |
Index of particle that was found in particleGroup%particles |
|||
| integer | :: | findParticleIndex | ||||
| integer | :: | particleID |
ID of particle that was found |