Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
DEMActionManager Class Reference

#include <dem_action_manager.h>

Public Member Functions

 DEMActionManager (const DEMActionManager &copy)=delete
DEMActionManager & operator= (const DEMActionManager &copy)=delete
void reset_triggers ()
void set_periodic_boundaries_enabled ()
bool check_periodic_boundaries_enabled ()
void set_solid_objects_enabled ()
bool check_solid_objects_enabled ()
void set_sparse_contacts_enabled ()
void set_sparse_contacts_disabled ()
bool check_sparse_contacts_enabled ()
void set_grid_motion_enabled ()
bool check_grid_motion_enabled ()
void restart_simulation ()
void load_balance_step ()
void particle_insertion_step ()
void contact_detection_step ()
void solid_objects_search_step ()
void first_dem_of_cfddem_iteration_step ()
void last_dem_of_cfddem_iteration_step ()
bool check_restart_simulation ()
bool check_load_balance () const
bool check_contact_search ()
bool check_update_sparse_contacts_cells ()
bool check_solid_object_search ()
bool check_clear_tangential_displacement ()
bool check_resize_containers ()
bool check_mobility_status_reset ()
bool use_default_broad_search_functions ()

Static Public Member Functions

static DEMActionManager * get_action_manager ()

Private Member Functions

 DEMActionManager ()

Private Attributes

bool periodic_boundaries_enabled
bool solid_objects_enabled
bool sparse_contacts_enabled
bool grid_motion_enabled
bool read_checkpoint_trigger
bool load_balance_trigger
bool clear_tangential_displacement_trigger
bool resize_containers_trigger
bool contact_search_trigger
bool solid_object_search_trigger
bool sparse_contacts_cells_update_trigger
bool mobility_status_reset_trigger

Static Private Attributes

static DEMActionManager * instance = nullptr

Detailed Description

Manage the actions to be performed in the DEM solver and on the DEM part of the coupling CFD-DEM solver.

Any event that needs some following actions is handled by the action manager. The event communicates to the action manager that it happened and the action manager will change the trigger flags to the actions to be taken. When this action is about to be performed, it checks with the action manager if it should be triggered. Many events can trigger the same actions, but when the action is about to be performed, it only checks if it has to be performed, not what event have happened.

If you implement a new feature that needs resetting or contact search after (or other actions), you should add a new "step" function to the action manager that will set the trigger to the action to be performed. If you implement new actions, you should add a new trigger flag and a new check function to the action manager. Obviously, you should also have to initialize the trigger in the constructor, and reset it in the reset function called after a DEM iteration. If the action depends on a enabling of a feature, you should add a new function to set the enabled flag.

Definition at line 30 of file dem_action_manager.h.

Constructor & Destructor Documentation

◆ DEMActionManager() [1/2]

DEMActionManager::DEMActionManager ( const DEMActionManager & copy)
delete

Copy constructor as a delete function to make sure it can not be copied. It will never be used.

Parameters
copyThe object to be copied

References DEMActionManager().

◆ DEMActionManager() [2/2]

Member Function Documentation

◆ check_clear_tangential_displacement()

bool DEMActionManager::check_clear_tangential_displacement ( )
inline

Check if the tangential displacement history needs to be cleared.

Definition at line 363 of file dem_action_manager.h.

References clear_tangential_displacement_trigger.

◆ check_contact_search()

bool DEMActionManager::check_contact_search ( )
inline

Check if the contact search needs to be performed.

Definition at line 336 of file dem_action_manager.h.

References contact_search_trigger.

◆ check_grid_motion_enabled()

bool DEMActionManager::check_grid_motion_enabled ( )
inline

Check if the solid objects are enabled to perform some actions that are not handled by triggers of the action manager.

Returns
True if the solid objects are enabled.

Definition at line 177 of file dem_action_manager.h.

References grid_motion_enabled.

◆ check_load_balance()

bool DEMActionManager::check_load_balance ( ) const
inline

Check if the repartitioning (load balancing) needs to be performed.

Definition at line 327 of file dem_action_manager.h.

References load_balance_trigger.

◆ check_mobility_status_reset()

bool DEMActionManager::check_mobility_status_reset ( )
inline

Check if the mobility status need to be reset to mobile.

Definition at line 381 of file dem_action_manager.h.

References mobility_status_reset_trigger.

◆ check_periodic_boundaries_enabled()

bool DEMActionManager::check_periodic_boundaries_enabled ( )
inline

Check if the periodic boundaries are enabled to perform some actions that are not handled by triggers of the action manager.

Returns
True if the periodic boundaries are enabled.

Definition at line 93 of file dem_action_manager.h.

References periodic_boundaries_enabled.

◆ check_resize_containers()

bool DEMActionManager::check_resize_containers ( )
inline

Check if the containers need to be resized.

Definition at line 372 of file dem_action_manager.h.

References resize_containers_trigger.

◆ check_restart_simulation()

bool DEMActionManager::check_restart_simulation ( )
inline

Check if checkpoint needs to be read.

Definition at line 318 of file dem_action_manager.h.

References read_checkpoint_trigger.

◆ check_solid_object_search()

bool DEMActionManager::check_solid_object_search ( )
inline

Check if the solid object has to be searched.

Definition at line 354 of file dem_action_manager.h.

References solid_object_search_trigger.

◆ check_solid_objects_enabled()

bool DEMActionManager::check_solid_objects_enabled ( )
inline

Check if the solid objects are enabled to perform some actions that are not handled by triggers of the action manager.

Returns
True if the solid objects are enabled.

Definition at line 118 of file dem_action_manager.h.

References solid_objects_enabled.

◆ check_sparse_contacts_enabled()

bool DEMActionManager::check_sparse_contacts_enabled ( )
inline

Check if the sparse contacts is enabled to perform some actions that are not handled by triggers of the action manager.

Returns
True if the sparse contacts is enabled.

Definition at line 156 of file dem_action_manager.h.

References sparse_contacts_enabled.

◆ check_update_sparse_contacts_cells()

bool DEMActionManager::check_update_sparse_contacts_cells ( )
inline

Check if the sparse contacts cells need to be updated.

Definition at line 345 of file dem_action_manager.h.

References sparse_contacts_cells_update_trigger.

◆ contact_detection_step()

void DEMActionManager::contact_detection_step ( )
inline

Set trigger for the contact search to be performed in the current time step because of a contact detection step.

It triggers:

  • contact search: might be from a selected frequency for the contact search (frequent method) or from the displacement evaluation (dynamic)

Definition at line 259 of file dem_action_manager.h.

References contact_search_trigger.

◆ first_dem_of_cfddem_iteration_step()

void DEMActionManager::first_dem_of_cfddem_iteration_step ( )
inline

Set trigger that the mobility status need to be reset to mobile at the first DEM time step if the sparse contacts are enabled.

It trigger:

  • mobility status reset: all the mobility status of the cells need to be mobile since the velocity of the particles are not yet computed and the status can not be evaluated. In the case of CFD-DEM, we force the full computation of the particles at the first DEM time step since hydrodynamic forces, which have just been calculated, may change the behavior of particles.

Definition at line 292 of file dem_action_manager.h.

References mobility_status_reset_trigger, and sparse_contacts_enabled.

◆ get_action_manager()

DEMActionManager * DEMActionManager::get_action_manager ( )
static

Getter of the unique instance of the DEMActionManager.

Definition at line 9 of file dem_action_manager.cc.

References DEMActionManager(), and instance.

◆ last_dem_of_cfddem_iteration_step()

void DEMActionManager::last_dem_of_cfddem_iteration_step ( )
inline

Set trigger for the contact search to be performed at the last DEM iteration of the CFD iteration.

It triggers:

  • contact search: the contact search is performed in order to call the sorting of particles in cells and for the update of the particle reference locations prior of the void fraction calculation.

Definition at line 309 of file dem_action_manager.h.

References contact_search_trigger.

◆ load_balance_step()

void DEMActionManager::load_balance_step ( )
inline

Set triggers for actions to be performed in the current iteration because it is a load balancing step.

It triggers:

  • load balancing: the used method has determined that the load needs to be balanced
  • contact search: cells and particles will not be on the same processor, so all the contact search needs to be performed.
  • clearing the tangential displacement: the tangential displacement history of the particles pairs (or particle-wall) are lost when particles are handled by another processor. For consistency reasons, all the tangential displacement history is reset for all particles.
  • resizing the containers: the containers need to be resized to the new number of local particles.
  • solid object search (if enabled): the solid objects need to be mapped to the rebalanced cells.
  • update the sparse contacts cells (if enabled): the sparse contacts cells need to be updated since they only contain local and ghost cells.

Definition at line 224 of file dem_action_manager.h.

References clear_tangential_displacement_trigger, contact_search_trigger, load_balance_trigger, resize_containers_trigger, solid_object_search_trigger, solid_objects_enabled, sparse_contacts_cells_update_trigger, and sparse_contacts_enabled.

◆ operator=()

DEMActionManager & DEMActionManager::operator= ( const DEMActionManager & copy)
delete

Copy constructor as a delete function to make sure it can not be assigned. It will never be used.

Parameters
copyThe object to be copied

References DEMActionManager().

◆ particle_insertion_step()

void DEMActionManager::particle_insertion_step ( )
inline

Set trigger for the contact search to be performed in the current time step because of a particle insertion step.

It triggers:

  • contact search: since there are new particles in the simulation, contact search needs to be performed for all particles.

Definition at line 244 of file dem_action_manager.h.

References contact_search_trigger.

◆ reset_triggers()

void DEMActionManager::reset_triggers ( )
inline

Reset all triggers to false. TODO: modify the handling of the contact search at counter = 1 because of the resetting of the mobility status.

Definition at line 62 of file dem_action_manager.h.

References clear_tangential_displacement_trigger, contact_search_trigger, load_balance_trigger, mobility_status_reset_trigger, read_checkpoint_trigger, solid_object_search_trigger, and sparse_contacts_cells_update_trigger.

◆ restart_simulation()

void DEMActionManager::restart_simulation ( )
inline

Set triggers for actions to be performed in the current time step because the simulation starts from restart files (previously called checkpoint step).

It triggers the reading of checkpoints, the contact search, clearing the contact structures, the solid object mapping (if enabled), and the update of the sparse contacts cells (if enabled).

Definition at line 192 of file dem_action_manager.h.

References clear_tangential_displacement_trigger, contact_search_trigger, read_checkpoint_trigger, solid_object_search_trigger, solid_objects_enabled, sparse_contacts_cells_update_trigger, and sparse_contacts_enabled.

◆ set_grid_motion_enabled()

void DEMActionManager::set_grid_motion_enabled ( )
inline

Flag that the grid will motion in the simulation.

Definition at line 165 of file dem_action_manager.h.

References grid_motion_enabled.

◆ set_periodic_boundaries_enabled()

void DEMActionManager::set_periodic_boundaries_enabled ( )
inline

Flag that there are periodic boundary in the simulation.

Definition at line 81 of file dem_action_manager.h.

References periodic_boundaries_enabled.

◆ set_solid_objects_enabled()

void DEMActionManager::set_solid_objects_enabled ( )
inline

Flag that there are solid objects in the simulation. Already trigger a solid object search in the background map.

Definition at line 103 of file dem_action_manager.h.

References solid_object_search_trigger, and solid_objects_enabled.

◆ set_sparse_contacts_disabled()

void DEMActionManager::set_sparse_contacts_disabled ( )
inline

Disables the ASC.

Definition at line 141 of file dem_action_manager.h.

References mobility_status_reset_trigger, and sparse_contacts_enabled.

◆ set_sparse_contacts_enabled()

void DEMActionManager::set_sparse_contacts_enabled ( )
inline

Flag that the ASC is enabled and trigger a mobility status reset to initialize the containers.

Definition at line 128 of file dem_action_manager.h.

References mobility_status_reset_trigger, and sparse_contacts_enabled.

◆ solid_objects_search_step()

void DEMActionManager::solid_objects_search_step ( )
inline

Set triggers for actions to be performed in the current time step because of a solid object search step.

It triggers the solid object search and the contact search.

Definition at line 271 of file dem_action_manager.h.

References contact_search_trigger, and solid_object_search_trigger.

◆ use_default_broad_search_functions()

bool DEMActionManager::use_default_broad_search_functions ( )
inline

Check if the default broad search functions should be used. It depends if adaptive sparse contacts is enabled, if so, it is a step where the mobility status are reset.

Definition at line 392 of file dem_action_manager.h.

References mobility_status_reset_trigger, and sparse_contacts_enabled.

Member Data Documentation

◆ clear_tangential_displacement_trigger

bool DEMActionManager::clear_tangential_displacement_trigger
private

Flag of the trigger for clearing the tangential displacement history.

Definition at line 454 of file dem_action_manager.h.

◆ contact_search_trigger

bool DEMActionManager::contact_search_trigger
private

Flag of the trigger for the contact search.

Definition at line 465 of file dem_action_manager.h.

◆ grid_motion_enabled

bool DEMActionManager::grid_motion_enabled
private

Flag for motion of grid in the simulation.

Definition at line 439 of file dem_action_manager.h.

◆ instance

DEMActionManager * DEMActionManager::instance = nullptr
staticprivate

Pointer to the unique of the DEMActionManager.

Definition at line 419 of file dem_action_manager.h.

◆ load_balance_trigger

bool DEMActionManager::load_balance_trigger
private

Flag of the trigger for load balancing execution.

Definition at line 449 of file dem_action_manager.h.

◆ mobility_status_reset_trigger

bool DEMActionManager::mobility_status_reset_trigger
private

Flag of the trigger for the mobility status reset to mobile status.

Definition at line 481 of file dem_action_manager.h.

◆ periodic_boundaries_enabled

bool DEMActionManager::periodic_boundaries_enabled
private

Flag for periodic boundaries in the simulation.

Definition at line 424 of file dem_action_manager.h.

◆ read_checkpoint_trigger

bool DEMActionManager::read_checkpoint_trigger
private

Flag of the trigger for reading the checkpoint.

Definition at line 444 of file dem_action_manager.h.

◆ resize_containers_trigger

bool DEMActionManager::resize_containers_trigger
private

Flag of the trigger for resize the vector dependant of the local particles.

Definition at line 460 of file dem_action_manager.h.

◆ solid_object_search_trigger

bool DEMActionManager::solid_object_search_trigger
private

Flag of the trigger for the solid object search, mapping the solid with the background triangulation.

Definition at line 471 of file dem_action_manager.h.

◆ solid_objects_enabled

bool DEMActionManager::solid_objects_enabled
private

Flag for solid objects in the simulation.

Definition at line 429 of file dem_action_manager.h.

◆ sparse_contacts_cells_update_trigger

bool DEMActionManager::sparse_contacts_cells_update_trigger
private

Flag of the trigger for the update of the sparse contacts cells.

Definition at line 476 of file dem_action_manager.h.

◆ sparse_contacts_enabled

bool DEMActionManager::sparse_contacts_enabled
private

Flag for the enabling of the sparse contacts.

Definition at line 434 of file dem_action_manager.h.


The documentation for this class was generated from the following files: