Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add doc
Browse files Browse the repository at this point in the history
Modify back to each argument for container

Temporary merge other branch
acdaigneault committed Aug 11, 2024

Verified

This commit was signed with the committer’s verified signature.
woodruffw William Woodruff
1 parent 783d8cb commit b462747
Showing 13 changed files with 594 additions and 278 deletions.
118 changes: 96 additions & 22 deletions include/dem/dem_contact_manager.h
Original file line number Diff line number Diff line change
@@ -62,10 +62,6 @@ class DEMContactManager
* cells.
* @param[in] periodic_boundaries_cells_information Information of periodic
* cells used if periodic boundaries are enabled (next parameter).
* @param[in] has_periodic_boundaries Allow manipulations of periodic
* containers if required.
* @param[in] has_solid_objects Allow the computation of full neighbor lists
* of active cells computation if required.
*/
void
execute_cell_neighbors_search(
@@ -81,10 +77,6 @@ class DEMContactManager
* cells.
* @param[in] periodic_boundaries_cells_information Information of periodic
* cells used if periodic boundaries are enabled (next parameter).
* @param[in] has_periodic_boundaries Allow manipulations of periodic
* containers if required.
* @param[in] has_solid_objects Allow the computation of full neighbor lists
* of active cells computation if required.
*/
void
update_cell_neighbors(
@@ -113,9 +105,6 @@ class DEMContactManager
* Contact pairs are local particle-particle, ghost particle-particle,
* particle-wall, particle-floating wall contacts and particle-floating mesh
* contacts.
*
* @param[in] has_periodic_boundaries Allow manipulations of periodic
* containers if required.
*/
void
update_contacts();
@@ -130,9 +119,6 @@ class DEMContactManager
*
* @param[in] particle_handler Storage of particles and their accessor
* functions.
* @param[in] clear_contact_structures Allow clearing the contact structures.
* @param[in] has_periodic_boundaries Allow manipulations of periodic
* containers if required.
*/
void
update_local_particles_in_cells(
@@ -152,9 +138,7 @@ class DEMContactManager
* @param[in,out] particle_handler Storage of particles and their accessor
* functions.
* @param[in] sparse_particle_contact_object Allow to check the mobility
* status of cells
* @param[in] has_periodic_boundaries Allow manipulations of periodic
* containers if required.
* status of cells.
*/
void
execute_particle_particle_broad_search(
@@ -180,8 +164,7 @@ class DEMContactManager
* @param[in] floating_wall Properties of the floating walls.
* @param[in] simulation_time Current simulation time.
* @param[in] sparse_particle_contact_object Allow to check the mobility
* status of cells
* @param[in] has_solid_objects Allow dealing with floating mesh neighbors.
* status of cells.
*/
void
execute_particle_wall_broad_search(
@@ -200,8 +183,6 @@ class DEMContactManager
* compute the contact information of the collision pairs.
*
* @param[in] neighborhood_threshold Threshold value of contact detection.
* @param[in] has_periodic_boundaries Allow manipulations of periodic
* containers if required.
*/
void
execute_particle_particle_fine_search(const double neighborhood_threshold);
@@ -215,7 +196,6 @@ class DEMContactManager
* @param[in] floating_wall Properties of the floating walls.
* @param[in] simulation_time Current simulation time.
* @param[in] neighborhood_threshold Threshold value of contact detection.
* @param[in] has_solid_objects Allow the fine search with floating meshes.
*/
void
execute_particle_wall_fine_search(
@@ -236,6 +216,97 @@ class DEMContactManager
this->periodic_offset = offset;
}

/**
* @brief Return the particle-floating mesh contact container.
*/
inline typename dem_data_structures<dim>::particle_floating_mesh_in_contact &
get_particle_floating_mesh_in_contact()
{
return particle_floating_mesh_in_contact;
}

/**
* @brief Return the particle-floating wall contact container.
*/
inline typename dem_data_structures<dim>::particle_wall_in_contact &
get_particle_floating_wall_in_contact()
{
return particle_floating_wall_in_contact;
}

/**
* @brief Return the particle-wall contact container.
*/
inline typename dem_data_structures<dim>::particle_wall_in_contact &
get_particle_wall_in_contact()
{
return particle_wall_in_contact;
}

/**
* @brief Return the particle-line contact container.
*/
inline typename dem_data_structures<dim>::particle_line_in_contact &
get_particle_lines_in_contact()
{
return particle_lines_in_contact;
}

/**
* @brief Return the particle-point contact container.
*/
inline typename dem_data_structures<dim>::particle_point_in_contact &
get_particle_points_in_contact()
{
return particle_points_in_contact;
}

/**
* @brief Return the local-ghost particle contact container.
*/
inline typename dem_data_structures<dim>::adjacent_particle_pairs &
get_local_adjacent_particles()
{
return local_adjacent_particles;
}

/**
* @brief Return the local-ghost particle contact container.
*/
inline typename dem_data_structures<dim>::adjacent_particle_pairs &
get_ghost_adjacent_particles()
{
return ghost_adjacent_particles;
}

/**
* @brief Return the local-local periodic particle contact container.
*/
inline typename dem_data_structures<dim>::adjacent_particle_pairs &
get_local_periodic_adjacent_particles()
{
return local_periodic_adjacent_particles;
}

/**
* @brief Return the local-ghost periodic particle contact container.
*/
inline typename dem_data_structures<dim>::adjacent_particle_pairs &
get_ghost_periodic_adjacent_particles()
{
return ghost_periodic_adjacent_particles;
}

/**
* @brief Return the ghost-local periodic particle contact container.
*/
inline typename dem_data_structures<dim>::adjacent_particle_pairs &
get_ghost_local_periodic_adjacent_particles()
{
return ghost_local_periodic_adjacent_particles;
}

private:
// Container with the iterators to all local and ghost particles
typename dem_data_structures<dim>::particle_index_iterator_map
particle_container;
@@ -308,6 +379,9 @@ class DEMContactManager

// Containers with other information
typename DEM::dem_data_structures<dim>::cell_vector periodic_cells_container;

private:
Tensor<1, dim> periodic_offset = Tensor<1, dim>();
};

#endif
86 changes: 53 additions & 33 deletions include/dem/force_chains_visualization.h
Original file line number Diff line number Diff line change
@@ -59,7 +59,11 @@ class ParticlesForceChainsBase
* containers with periodic neighbors lists
*/
virtual void
calculate_force_chains(DEMContactManager<dim> &contact_manager) = 0;
calculate_force_chains(
typename dem_data_structures<dim>::adjacent_particle_pairs
&local_adjacent_particles,
typename dem_data_structures<dim>::adjacent_particle_pairs
&ghost_adjacent_particles) = 0;
/**
* @brief Output the force chains in VTU and PVTU files for each iteration and a PVD file.
*
@@ -114,23 +118,32 @@ class ParticlesForceChains
* ParticleParticleContactForce class' methods. Stock normal forces and
* particles position in vectors.
*
* @param contact_manager The container manager object that contains
* containers to modify of contact pair periodic candidates with other
* containers with periodic neighbors lists
* @param local_adjacent_particles Container of the contact pair candidates
* information for calculation of the local particle-particle contact forces.
* @param ghost_adjacent_particles Container of the contact pair candidates
* information for calculation of the local-ghost particle-particle contact
* forces.
*/
void
calculate_force_chains(DEMContactManager<dim> &contact_manager) override;
calculate_force_chains(
typename dem_data_structures<dim>::adjacent_particle_pairs
&local_adjacent_particles,
typename dem_data_structures<dim>::adjacent_particle_pairs
&ghost_adjacent_particles) override;

/**
* @brief Output the force chains in VTU and PVTU files for each iteration and a PVD file.
* @brief Output the force chains in VTU and PVTU files for each iteration and
* a PVD file.
*
* @param dem_parameters DEM parameters declared in the .prm file
* @param pvd_handler a PVDHandler to store the information about the file name and time associated with it
* @param mpi_communicator The mpi communicator
* @param folder a string that contains the path where the results are to be saved
* @param dem_parameters DEM parameters declared in the .prm file.
* @param pvd_handler a PVDHandler to store the information about the file
* name and time associated with it.
* @param mpi_communicator The mpi communicator.
* @param folder a string that contains the path where the results are to be
* saved.
* @param group_files the number of vtu files that will be generated.
* @param iter the iteration number associated with the file
* @param time the time associated with the file
* @param iter the iteration number associated with the file.
* @param time the time associated with the file.
*/
void
write_force_chains(const DEMSolverParameters<dim> &dem_parameters,
@@ -141,6 +154,16 @@ class ParticlesForceChains
const double time) override;

private:
/**
* @brief Execute the contact calculation step for the particle-particle
* contact only for local-local and local-ghost contacts with no periodicity.
* This is a simplified version of the contact calculation of the
* particle-particle contact forces class, without the other contact types and
* the update of the particles forces, torques and tangential overlap.
*
* @param adjacent_particles_list Container of the adjacent particles of a
* particles.
*/
inline void
execute_contact_calculation(
typename DEM::dem_data_structures<dim>::particle_contact_info
@@ -151,9 +174,6 @@ class ParticlesForceChains
return;

// Define local variables which will be used within the contact calculation
// Namely: normal and tangential contact forces, tangential and rolling
// torques, normal unit vector of the contact and contact relative velocity
// in the normal direction
Tensor<1, 3> normal_unit_vector;
Tensor<1, 3> normal_force;
Tensor<1, 3> tangential_force;
@@ -198,19 +218,18 @@ class ParticlesForceChains
particle_one_location,
particle_two_location);

this->calculate_particle_particle_contact(
contact_info,
tangential_relative_velocity,
normal_relative_velocity_value,
normal_unit_vector,
normal_overlap,
particle_one_properties,
particle_two_properties,
normal_force,
tangential_force,
particle_one_tangential_torque,
particle_two_tangential_torque,
rolling_resistance_torque);
this->calculate_contact(contact_info,
tangential_relative_velocity,
normal_relative_velocity_value,
normal_unit_vector,
normal_overlap,
particle_one_properties,
particle_two_properties,
normal_force,
tangential_force,
particle_one_tangential_torque,
particle_two_tangential_torque,
rolling_resistance_torque);
}

vertices.push_back(particle_one_location);
@@ -256,7 +275,6 @@ class ParticlesForceChains
// Defining relative contact velocity
Tensor<1, 3> contact_relative_velocity;


// Assigning velocities and angular velocities of particles
contact_relative_velocity[0] =
particle_one_properties[PropertiesIndex::v_x] -
@@ -276,15 +294,13 @@ class ParticlesForceChains
particle_two_omega[1] = particle_two_properties[PropertiesIndex::omega_y];
particle_two_omega[2] = particle_two_properties[PropertiesIndex::omega_z];


// Calculation of contact relative velocity
// v_ij = (v_i - v_j) + (R_i*omega_i + R_j*omega_j) × n_ij
contact_relative_velocity += (cross_product_3d(
0.5 * (particle_one_properties[PropertiesIndex::dp] * particle_one_omega +
particle_two_properties[PropertiesIndex::dp] * particle_two_omega),
normal_unit_vector));


// Calculation of normal relative velocity. Note that in the
// following line the product acts as inner product since both
// sides are vectors, while in the second line the product is
@@ -311,10 +327,14 @@ class ParticlesForceChains
multi_general_cell(Triangulation<1, 3> &tria,
const std::vector<Point<3>> &vertices);

// vector of normal forces between each touching particles.
/**
* @brief Vector of normal forces between each touching particles.
*/
std::vector<double> force_normal;

// vector of positions of touching particles.
/**
* @brief Vector of positions of touching particles.
*/
std::vector<Point<3>> vertices;
};
#endif
Loading

0 comments on commit b462747

Please sign in to comment.