![]() |
Lethe Open-Source Library version 1.2.0
Developer Guide
|
#include <dem.h>
Public Member Functions | |
| DEMSolver (DEMSolverParameters< dim > dem_parameters) | |
| void | solve () |
Private Member Functions | |
| void | setup_parameters () |
| void | setup_distribution_type () |
| void | setup_solid_objects () |
| void | setup_functions_and_pointers () |
| std::function< void()> | set_contact_search_iteration_function () |
| std::shared_ptr< Integrator< dim, PropertiesIndex > > | set_integrator_type () |
| void | box_refine_mesh (const bool restart) |
| void | setup_triangulation_dependent_parameters () |
| void | setup_background_dofs () |
| void | load_balance () |
| void | check_contact_search_iteration_constant () |
| void | check_contact_search_iteration_dynamic () |
| void | insert_particles () |
| void | particle_wall_contact_force () |
| void | move_solid_objects () |
| void | update_temperature_solid_objects () |
| void | update_temperature_walls () |
| void | execute_contact_detection_and_search () |
| void | compute_contact_forces () |
| void | synchronize_velocities () |
| void | finish_simulation () |
| void | write_output_results () |
| void | post_process_results () |
| void | report_statistics () |
| void | sort_particles_into_subdomains_and_cells () |
| bool | packed_insertion_report_and_status () |
Solver using the soft-sphere model of the discrete element method (DEM) to simulate granular systems.
| dim | An integer that denotes the number of spatial dimensions. |
| PropertiesIndex | Index of the properties used within the ParticleHandler. |
| DEMSolver< dim, PropertiesIndex >::DEMSolver | ( | DEMSolverParameters< dim > | dem_parameters | ) |
Definition at line 39 of file dem.cc.
References background_dh, checkpoint_controller, computing_timer, contact_build_number, mapping, mpi_communicator, n_mpi_processes, parameters, particle_handler, pcout, size_distribution_object_container, this_mpi_process, and triangulation.
|
private |
Refine the triangulation within the user-specified refinement boxes.
Each box is described by its own mesh; every cell of the background triangulation that lies within a box is refined the number of times requested for that box. Nothing is done when restarting, since the triangulation stored in the checkpoint already carries its refinement.
| [in] | restart | Flag indicating whether this is a restart. |
Definition at line 296 of file dem.cc.
References Parameters::MeshBoxRefinement< dim, spacedim >::box_additional_refinements, build_refinement_box_triangulation(), computing_timer, LetheGridTools::flag_cells_in_refinement_box(), Parameters::MeshBoxRefinement< dim, spacedim >::number_of_refinement_boxes, parameters, pcout, Parameters::MeshBoxRefinement< dim, spacedim >::refinement_boxes_meshes, and triangulation.
|
inlineprivate |
Establish if this is a contact detection iteration using the constant contact detection frequency. If the iteration number is a multiple of the frequency, this iteration is considered to be a contact detection iteration.
Definition at line 533 of file dem.cc.
References action_manager, parameters, and simulation_control.
|
inlineprivate |
Establish if this is a contact detection iteration using the maximal displacement of the particles. If this particle displacement surpasses a threshold, this iteration is a contact detection iteration.
Definition at line 517 of file dem.cc.
References displacement, find_particle_contact_detection_step(), mpi_communicator, parameters, particle_handler, simulation_control, and smallest_contact_search_criterion.
|
private |
Calculate the particle-particle and the particle-wall contact forces and torques at the current position of the particles.
Definition at line 776 of file dem.cc.
References contact_manager, contact_outcome, grid_motion_object, particle_particle_contact_force_object, particle_wall_contact_force(), simulation_control, and updated_boundary_points_and_normal_vectors.
|
private |
Check if a contact detection is required at the current iteration and, if it is, map the solid objects in the background triangulation, sort the particles into subdomains and cells and execute the particle-particle and particle-wall broad and fine searches. Otherwise, only update the ghost particles.
Definition at line 684 of file dem.cc.
References action_manager, background_dh, boundary_cell_object, contact_build_number, contact_detection_iteration_check_function, contact_manager, find_floating_mesh_mapping_step(), mpi_communicator, neighborhood_threshold_squared, parameters, particle_handler, periodic_boundaries_cells_information, periodic_boundaries_object, simulation_control, smallest_solid_object_mapping_criterion, solid_surfaces, solid_surfaces_mesh_info, solid_volumes, solid_volumes_mesh_info, sort_particles_into_subdomains_and_cells(), sparse_contacts_object, and triangulation.
|
private |
Execute the last post-processing at the end of the simulation and output test results if necessary.
Definition at line 833 of file dem.cc.
References background_dh, computing_timer, Parameters::Timer::end, forces_boundary_information, Parameters::Testing::mobility_status, mpi_communicator, parameters, particle_handler, Parameters::Testing::particles, pcout, simulation_control, sparse_contacts_object, Parameters::Testing::subdomain, torques_boundary_information, triangulation, visualization_object, and write_forces_torques_output_results().
|
private |
Check if particles have to be inserted at this iteration and perform it if necessary.
Definition at line 542 of file dem.cc.
References action_manager, insertion_object, parameters, particle_handler, simulation_control, and triangulation.
|
private |
Check if a load balancing is required according to the load balancing method and perform it if necessary.
Definition at line 441 of file dem.cc.
References action_manager, background_dh, boundary_cell_object, computing_timer, contact_manager, load_balancing, mpi_communicator, parameters, particle_handler, pcout, periodic_boundaries_cells_information, periodic_boundaries_object, setup_background_dofs(), sparse_contacts_object, triangulation, and updated_boundary_points_and_normal_vectors.
|
private |
Move all solid objects.
Definition at line 628 of file dem.cc.
References action_manager, simulation_control, solid_surfaces, and solid_volumes.
|
private |
Hook for particular operations that are related to the packed insertion.
Definition at line 1106 of file dem.cc.
References InsertionPacked< dim, PropertiesIndex >::apply_shift_displacement(), contact_outcome, displacement, maximum_particle_diameter, mpi_communicator, parameters, particle_handler, particle_particle_contact_force_object, particle_point_line_contact_force_object, particle_wall_contact_force_object, pcout, simulation_control, and write_output_results().
|
private |
Calculates particles-wall contact forces.
Definition at line 561 of file dem.cc.
References action_manager, contact_manager, contact_outcome, force, parameters, particle_point_line_contact_force_object, particle_wall_contact_force_object, simulation_control, and solid_surfaces.
|
private |
Calculate average velocity and other post-processed quantities that need to be outputted to files.
Definition at line 970 of file dem.cc.
References background_dh, grid_pvdhandler, mpi_communicator, parameters, particle_handler, simulation_control, sparse_contacts_object, triangulation, and write_post_processing_results().
|
private |
Calculate statistics on the particles and report them to the terminal. This function is notably used to monitor the time min, max and total performed contact searches, and the instant min, max, avg and total values of the linear velocity, angular velocity, linear kinetic energy and angular kinetic.
Definition at line 990 of file dem.cc.
References add_statistics_to_table_handler(), DEM::calculate_granular_statistics(), computing_timer, contact_build_number, contact_list, Parameters::Timer::iteration, mpi_communicator, DEM::omega, parameters, particle_handler, pcout, DEM::rotational_kinetic_energy, simulation_control, this_mpi_process, DEM::translational_kinetic_energy, and DEM::velocity.
|
inlineprivate |
Set the iteration check function according to the chosen contact detection method.
Definition at line 255 of file dem.cc.
References check_contact_search_iteration_constant(), check_contact_search_iteration_dynamic(), and parameters.
|
private |
Set the integration method.
Definition at line 275 of file dem.cc.
References parameters.
|
private |
Set up the background degree of freedom used for parallel grid output or mapping of periodic dofs when using periodic boundaries.
Definition at line 394 of file dem.cc.
References action_manager, background_constraints, background_dh, parameters, and sparse_contacts_object.
|
private |
Initialize the distribution type for the particles, and sets the maximum particle diameter and the neighborhood threshold squared in the process.
Definition at line 160 of file dem.cc.
References maximum_particle_diameter, neighborhood_threshold_squared, parameters, pcout, setup_distributions(), size_distribution_object_container, and this_mpi_process.
|
private |
Set up the pointers to the functions and classes according to the parameters.
Definition at line 209 of file dem.cc.
References contact_detection_iteration_check_function, disable_position_integration, DEMActionManager::get_action_manager(), insertion_object, integrator_object, maximum_particle_diameter, parameters, particle_particle_contact_force_object, particle_wall_contact_force_object, pcout, set_contact_search_iteration_function(), set_insertion_type(), set_integrator_type(), set_particle_particle_contact_force_model(), set_particle_wall_contact_force_model(), DEMActionManager::set_sparse_contacts_disabled(), Parameters::Lagrangian::shift, size_distribution_object_container, sparse_contacts_object, and triangulation.
|
private |
Set the parameters for the DEM simulation.
Definition at line 63 of file dem.cc.
References action_manager, announce_string(), create_output_folder(), disable_position_integration, g, DEMActionManager::get_action_manager(), grid_motion_object, input_parameter_inspection(), load_balancing, n_mpi_processes, Parameters::Lagrangian::ModelParameters< dim >::none, parameters, particle_handler, pcout, periodic_boundaries_object, setup_distribution_type(), setup_solid_objects(), simulation_control, size_distribution_object_container, sparse_contacts_object, this_mpi_process, and triangulation.
|
private |
Set up the solid object containers with serial objects. TODO: Modify this set up once the solid volumes are fully implemented.
Definition at line 177 of file dem.cc.
References action_manager, parameters, solid_surfaces, solid_surfaces_mesh_info, solid_volumes, and solid_volumes_mesh_info.
|
private |
Set up the triangulation dependent parameters after the reading of the mesh and/or the simulation restart.
Definition at line 340 of file dem.cc.
References background_dh, contact_manager, maximum_particle_diameter, parameters, particle_particle_contact_force_object, periodic_boundaries_cells_information, periodic_boundaries_object, setup_background_dofs(), smallest_contact_search_criterion, smallest_solid_object_mapping_criterion, sparse_contacts_object, and triangulation.
| void DEMSolver< dim, PropertiesIndex >::solve | ( | ) |
Engine of the DEM solver. Calls all the necessary functions to set parameters, solve the simulation, and finish the simulation.
Definition at line 1158 of file dem.cc.
References action_manager, announce_string(), boundary_cell_object, box_refine_mesh(), checkpoint_controller, collision_event_log, compute_contact_forces(), computing_timer, contact_manager, contact_outcome, disable_position_integration, execute_contact_detection_and_search(), finish_simulation(), force, forces_boundary_information, g, grid_motion_object, grid_pvdhandler, DEM::has_thermal_properties, insert_particles(), insertion_object, integrate_temperature(), integrator_object, load_balance(), log_collision_data(), maximum_particle_diameter, MOI, move_solid_objects(), mpi_communicator, ongoing_collision_log, packed_insertion_report_and_status(), parameters, particle_handler, particles_pvdhandler, pcout, periodic_boundaries_cells_information, post_process_results(), read_checkpoint(), read_mesh_and_manifolds(), report_cell_size_to_particle_diameter_ratio(), report_statistics(), setup_functions_and_pointers(), setup_parameters(), setup_triangulation_dependent_parameters(), simulation_control, solid_surfaces, sparse_contacts_object, synchronize_velocities(), this_mpi_process, torque, torques_boundary_information, triangulation, update_temperature_solid_objects(), update_temperature_walls(), updated_boundary_points_and_normal_vectors, Parameters::verbose, write_checkpoint(), write_collision_stats(), write_forces_torques_output_locally(), and write_output_results().
|
inlineprivate |
Execute the sorting of particle into subdomains and cells, and reinitialize the containers dependent on the local particle ids.
Definition at line 1070 of file dem.cc.
References action_manager, contact_outcome, displacement, MOI, and particle_handler.
|
private |
Carry out the closing half velocity step of a staggered integration scheme, which synchronizes the velocities of the particles with their positions at the final time. The contact forces are re-evaluated at the final position of the particles, hence n + 1 integration operations are carried out to complete n time steps.
Definition at line 805 of file dem.cc.
References action_manager, compute_contact_forces(), execute_contact_detection_and_search(), force, g, integrator_object, MOI, particle_handler, simulation_control, sparse_contacts_object, torque, and triangulation.
|
private |
Update solid objects temperatures.
Definition at line 648 of file dem.cc.
References action_manager, DEM::has_thermal_properties, simulation_control, solid_surfaces, and solid_volumes.
|
private |
Update the temperatures of the walls of the grid.
Definition at line 672 of file dem.cc.
References DEM::has_thermal_properties, parameters, set_wall_temperature_time(), and simulation_control.
|
private |
Generate VTU file with particles information for visualization.
Definition at line 903 of file dem.cc.
References background_dh, Visualization< dim, PropertiesIndex >::build_patches(), computing_timer, contact_manager, mpi_communicator, parameters, particle_handler, particles_force_chains_object, particles_pvdhandler, particles_pvdhandler_force_chains, properties_class, set_force_chains_contact_force_model(), simulation_control, solid_surfaces, solid_volumes, write_boundaries_vtu(), and write_vtu_and_pvd().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
The contact search frequency criterion for the dynamic contact detection method. The value is the smallest value between those two quantities:
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |