Skip to content

Lagrangian Support

Elwardi edited this page Dec 5, 2025 · 1 revision

Lagrangian Cloud Support

Comprehensive support for Lagrangian particle clouds during adaptive mesh refinement (AMR) and load balancing (LB) operations was implemented in STFS-TUDa/blastAMR#29. This includes automatic particle remapping, particle-aware load balancing, and support for various cloud types.

Supported Cloud Types

Since the clouds APIs are divergent, the library provides built-in support for the following OpenFOAM cloud types:

  • passiveParticleCloud - Basic tracking particles
  • basicKinematicCloud - Kinematic particles with forces
  • basicKinematicCollidingCloud - Particles with DEM collisions
  • basicKinematicMPPICCloud - MPPIC method particles
  • basicThermoCloud - Heat transfer particles
  • basicReactingCloud - Evaporating/reacting particles
  • basicReactingMultiphaseCloud - Multiphase reaction particles

With the option for users to implement their own cloud type's LB support through specifying how parcel data should be communicated. Even though this is a little bit inefficient (may involve copying per-particle data), it's still better than no load-balancing.

How It Works

During mesh topology changes, particles need special handling:

  1. Before refinement/coarsening: Particle global positions are stored
  2. After refinement: Particles are remapped to new cells using autoMap
  3. Before load balancing: Particles are distributed to target processors
  4. After redistribution: Particles are relocated to their new cells

This is handled automatically by the cloudSupport library.

Particle-Aware Load Balancing

The cellCount load policy now accounts for particles when calculating processor load:

// In dynamicMeshDict or function object configuration
loadPolicy           cellCount;

// Coefficient for particle contribution to load
// load = cellCount + particleCoeff * particleCount
particleCoeff        1.0;

// Minimum cells per processor (prevents degenerate distributions)
minCellsPerProc      5;

Required Libraries

To use Lagrangian cloud support, load the following libraries in your system/controlDict:

libs
(
    libamrDynamicMesh
    libamrIndicators
    libamrLoadPolicies
    libamrCloudSupport      // For Lagrangian support
);

Example Case

  • tutorials/particleInjection2D showcases a simple setup of lagrangian particle cloud LB.
  • tutorials/MPPICcolumn showcases a complete example of MPPIC particles with AMR and load balancing through mesh motion.

Clone this wiki locally