Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
particle_particle_contact_force.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2020-2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_particle_particle_contact_force_h
5#define lethe_particle_particle_contact_force_h
6
8
9#include <dem/contact_info.h>
10#include <dem/contact_type.h>
11#include <dem/data_containers.h>
16
17#include <boost/range/adaptor/map.hpp>
18
19#include <algorithm>
20#include <unordered_map>
21#include <vector>
22
23using namespace dealii;
24
25/**
26 * @brief Base class for the particle-particle contact force models
27 * This class does not implement any of the models but ensures that
28 * an interface without template specialization is available. All the
29 * actual implementations of the models are carried out in the
30 * ParticleParticleContactForce class, which is templated by the contact model
31 * type.
32 * @tparam dim An integer that denotes the number of spatial dimensions.
33 * @tparam PropertiesIndex Index of the properties used within the
34 * ParticleHandler.
35 */
36template <int dim, typename PropertiesIndex>
38{
39public:
40 /**
41 * @brief Calculate the contact outcomes using the contact pair information
42 * obtained in the fine search and physical properties of particles.
43 *
44 * @param local_adjacent_particles Container of the contact pair candidates
45 * information for calculation of the local particle-particle contact forces.
46 * @param ghost_adjacent_particles Container of the contact pair candidates
47 * information for calculation of the local-ghost particle-particle contact
48 * forces.
49 * @param local_local_periodic_adjacent_particles Container of the contact
50 * pair candidates information for calculation of the local periodic
51 * particle-particle contact forces.
52 * @param local_ghost_periodic_adjacent_particles Container of the contact
53 * pair candidates information for calculation of the local-ghost periodic
54 * particle-particle contact forces.
55 * @param ghost_local_periodic_adjacent_particles Container of the contact
56 * pair candidates information for calculation of the ghost-local periodic
57 * particle-particle contact forces.
58 * @param dt DEM time step.
59 * @param contact_outcome Interaction outcomes.
60 */
61 virtual void
64 &local_adjacent_particles,
66 &ghost_adjacent_particles,
68 &local_local_periodic_adjacent_particles,
70 &local_ghost_periodic_adjacent_particles,
72 &ghost_local_periodic_adjacent_particles,
73 const double dt,
75
76 /**
77 * @brief Set the distance between a principal periodic boundary pb0 (with
78 * mesh ID boundary_id) and its associated periodic boundary pb1 in the
79 * periodic_offsets map.
80 *
81 * @param[in] offset Distance between the pair of periodic boundaries.
82 * @param[in] boundary_id Mesh ID of the principal periodic boundary of the
83 * pair.
84 */
85 inline void
86 set_periodic_offset(const Tensor<1, dim> &offset,
87 const types::boundary_id boundary_id)
88 {
89 this->periodic_offsets[boundary_id] = offset;
90 }
91
92 /**
93 * @brief Return the number of contacts that occurred in the
94 * present pseudo-time step when using the packed insertion method.
95 *
96 * @return The number of contacts that occurred in the present pseudo-time
97 * step.
98 */
99 unsigned int inline get_number_of_contacts() const
100 {
101 return n_contacts;
102 }
103
104 /**
105 * @brief Reset the counter of number of contacts for the next pseudo-time step.
106 */
107 void
109 {
110 n_contacts = 0;
111 }
112
113protected:
114 // Counter for the number of contacts
115 unsigned int n_contacts = 0;
116
117 /**
118 * @brief Map storing offset distance between periodic boundaries, keyed by
119 * the boundary ID (pb0). It is calculated from the first pair of cells on
120 * periodic boundaries, so all pairs of cells on a given peridodic boundary
121 * are assumed to have the same offset.
122 */
123 std::unordered_map<types::boundary_id, Tensor<1, dim>> periodic_offsets;
124};
125
126/**
127 * @brief Execute calculation of particle-particle contact forces including
128 * linear, non-linear contact models, and non-linear with cohesive forces.
129 *
130 * Instead of using an inheritance hierarchy to distinguish between
131 * the contact model, the class is templated with the type of force model
132 * and rolling friction model. Consequently, the code for each
133 * combination of force model is generated at compile time.
134 *
135 * @tparam dim The dimension of the problem.
136 * @tparam contact_model The particle-particle contact force model.
137 * @tparam rolling_friction_model The rolling resistance model.
138 */
139template <
140 int dim,
141 typename PropertiesIndex,
145 : public ParticleParticleContactForceBase<dim, PropertiesIndex>
146{
147public:
149
150 virtual ~ParticleParticleContactForce() = default;
151
152 /**
153 * @brief Calculate the contact outcomes using the contact pair information
154 * obtained in the fine search and physical properties of particles.
155 *
156 * @param local_adjacent_particles Container of the contact pair candidates
157 * information for calculation of the local particle-particle contact forces.
158 * @param ghost_adjacent_particles Container of the contact pair candidates
159 * information for calculation of the local-ghost particle-particle contact
160 * forces.
161 * @param local_local_periodic_adjacent_particles Container of the contact
162 * pair candidates information for calculation of the local periodic
163 * particle-particle contact forces.
164 * @param local_ghost_periodic_adjacent_particles Container of the contact
165 * pair candidates information for calculation of the local-ghost periodic
166 * particle-particle contact forces.
167 * @param ghost_local_periodic_adjacent_particles Container of the contact
168 * pair candidates information for calculation of the ghost-local periodic
169 * particle-particle contact forces.
170 * @param dt DEM time step.
171 * @param[out] contact_outcome Interaction outcomes.
172 */
173 virtual void
176 &local_adjacent_particles,
178 &ghost_adjacent_particles,
180 &local_local_periodic_adjacent_particles,
182 &local_ghost_periodic_adjacent_particles,
184 &ghost_local_periodic_adjacent_particles,
185 const double dt,
186 ParticleInteractionOutcomes<PropertiesIndex> &contact_outcome) override;
187
188protected:
189 /**
190 * @brief Update the contact pair information for all contact force
191 * calculations.
192 *
193 * @param[out] contact_info Contact information of a particle pair in
194 * the neighborhood.
195 * @param[out] tangential_relative_velocity Tangential relative velocity.
196 * @param[out] normal_relative_velocity_value Normal relative contact
197 * velocity.
198 * @param[out] normal_unit_vector Normal vector of the contact.
199 * @param[in] particle_one_properties Properties of particle one in contact.
200 * @param[in] particle_two_properties Properties of particle two in contact.
201 * @param[in] particle_one_location Location of particle one in contact.
202 * @param[in] particle_two_location Location of particle two in contact.
203 * @param[in] dt DEM time step.
204 */
205 inline void
208 Tensor<1, 3> &tangential_relative_velocity,
209 double &normal_relative_velocity_value,
210 Tensor<1, 3> &normal_unit_vector,
211 const ArrayView<const double> &particle_one_properties,
212 const ArrayView<const double> &particle_two_properties,
213 const Point<3> &particle_one_location,
214 const Point<3> &particle_two_location,
215 const double dt)
216 {
217 // Calculation of the contact vector from particle one to particle two
218 auto contact_vector = particle_two_location - particle_one_location;
219
220 // Calculation of the normal unit contact vector
221 normal_unit_vector = contact_vector / contact_vector.norm();
222
223 // Defining velocities and angular velocities of particles one and
224 // two as vectors
225 Tensor<1, 3> particle_one_omega, particle_two_omega;
226
227 // Defining relative contact velocity
228 Tensor<1, 3> contact_relative_velocity;
229
230 // Assigning velocities and angular velocities of particles
231 contact_relative_velocity[0] =
232 particle_one_properties[PropertiesIndex::v_x] -
233 particle_two_properties[PropertiesIndex::v_x];
234 contact_relative_velocity[1] =
235 particle_one_properties[PropertiesIndex::v_y] -
236 particle_two_properties[PropertiesIndex::v_y];
237 contact_relative_velocity[2] =
238 particle_one_properties[PropertiesIndex::v_z] -
239 particle_two_properties[PropertiesIndex::v_z];
240
241 particle_one_omega[0] = particle_one_properties[PropertiesIndex::omega_x];
242 particle_one_omega[1] = particle_one_properties[PropertiesIndex::omega_y];
243 particle_one_omega[2] = particle_one_properties[PropertiesIndex::omega_z];
244
245 particle_two_omega[0] = particle_two_properties[PropertiesIndex::omega_x];
246 particle_two_omega[1] = particle_two_properties[PropertiesIndex::omega_y];
247 particle_two_omega[2] = particle_two_properties[PropertiesIndex::omega_z];
248
249 // Calculation of contact relative velocity
250 // v_ij = (v_i - v_j) + (R_i*omega_i + R_j*omega_j) × n_ij
251 contact_relative_velocity += (cross_product_3d(
252 0.5 * (particle_one_properties[PropertiesIndex::dp] * particle_one_omega +
253 particle_two_properties[PropertiesIndex::dp] * particle_two_omega),
254 normal_unit_vector));
255
256 // Calculation of normal relative velocity. Note that in the
257 // following line the product acts as the inner product since both
258 // sides are vectors, while in the second line the product is
259 // scalar and vector product
260 normal_relative_velocity_value =
261 contact_relative_velocity * normal_unit_vector;
262
263 // Calculation of tangential relative velocity
264 // v_rt = v_ij - (v_ij⋅n_ij)*n_ij
265 tangential_relative_velocity =
266 contact_relative_velocity -
267 (normal_relative_velocity_value * normal_unit_vector);
268
269 // Calculation of new tangential_displacement, since this value is
270 // history-dependent, it needs the value at a previous time step. This
271 // variable is the main reason that we have iteration over two different
272 // vectors: tangential_displacement of the particles which were already in
273 // contact needs to be modified using its history, while the
274 // tangential_displacements of new particles are equal to zero
275 // delta_t_new = delta_t_old + v_rt*dt
276 contact_info.tangential_displacement += tangential_relative_velocity * dt;
277 contact_info.tangential_displacement -=
278 (contact_info.tangential_displacement * normal_unit_vector) *
279 normal_unit_vector;
280 }
281
282 /**
283 * @brief Get the location of the particle.
284 *
285 * @param[in] particle The particle from which to get the location.
286 *
287 * @return The location of the particle.
288 */
289 inline Point<3>
290 get_location(const Particles::ParticleIterator<dim> &particle) &
291 {
292 if constexpr (dim == 3)
293 return particle->get_location();
294
295 if constexpr (dim == 2)
296 return point_nd_to_3d(particle->get_location());
297 }
298
299 /**
300 * @brief Get the shifted location of a particle on a periodic boundary.
301 *
302 * @param[in] particle The particle to get the location from.
303 * @param[in] periodic_offset The periodic offset with which to shift the
304 * location.
305 *
306 * @return The offset periodic location of the particle.
307 */
308 inline Point<3>
309 get_periodic_location(const Particles::ParticleIterator<dim> &particle,
310 const Tensor<1, dim> &periodic_offset) &
311 {
312 if constexpr (dim == 3)
313 return (particle->get_location() + periodic_offset);
314
315 if constexpr (dim == 2)
316 return point_nd_to_3d(particle->get_location() + periodic_offset);
317 }
318
319 /**
320 * @brief Calculate the particle-particle contact force and torque
321 * according to the contact model.
322 *
323 * @param[in,out] contact_info A container that contains the required
324 * information for calculation of the contact force for a particle pair in
325 * contact.
326 * @param[in] tangential_relative_velocity Tangential relative velocity.
327 * @param[in] normal_relative_velocity_value Normal relative contact velocity.
328 * @param[in] normal_unit_vector Normal unit vector between particles in
329 * interaction.
330 * @param[in] normal_overlap Contact normal overlap.
331 * @param[in] dt DEM time step.
332 * @param[in] particle_one_properties Properties of particle one in contact.
333 * @param[in] particle_two_properties Properties of particle two in contact.
334 * @param[out] normal_force Contact normal force.
335 * @param[out] tangential_force Contact tangential force.
336 * @param[out] particle_one_tangential_torque Contact tangential torque on
337 * particle one.
338 * @param[out] particle_two_tangential_torque Contact tangential torque on
339 * particle two.
340 * @param[out] rolling_resistance_torque Contact rolling resistance torque.
341 */
342 inline void
344 const Tensor<1, 3> &tangential_relative_velocity,
345 const double normal_relative_velocity_value,
346 const Tensor<1, 3> &normal_unit_vector,
347 const double normal_overlap,
348 const double dt,
349 const ArrayView<const double> &particle_one_properties,
350 const ArrayView<const double> &particle_two_properties,
351 Tensor<1, 3> &normal_force,
352 Tensor<1, 3> &tangential_force,
353 Tensor<1, 3> &particle_one_tangential_torque,
354 Tensor<1, 3> &particle_two_tangential_torque,
355 Tensor<1, 3> &rolling_resistance_torque)
356 {
357 using namespace Parameters::Lagrangian;
358
359 if constexpr (contact_model == ParticleParticleContactForceModel::linear)
360 {
361 calculate_linear_contact(contact_info,
362 tangential_relative_velocity,
363 normal_relative_velocity_value,
364 normal_unit_vector,
365 normal_overlap,
366 dt,
367 particle_one_properties,
368 particle_two_properties,
369 normal_force,
370 tangential_force,
371 particle_one_tangential_torque,
372 particle_two_tangential_torque,
373 rolling_resistance_torque);
374 }
375
376 if constexpr (contact_model == ParticleParticleContactForceModel::hertz)
377 {
378 this->calculate_hertz_contact(contact_info,
379 tangential_relative_velocity,
380 normal_relative_velocity_value,
381 normal_unit_vector,
382 normal_overlap,
383 dt,
384 particle_one_properties,
385 particle_two_properties,
386 normal_force,
387 tangential_force,
388 particle_one_tangential_torque,
389 particle_two_tangential_torque,
390 rolling_resistance_torque);
391 }
392
393 if constexpr (contact_model ==
395 {
397 contact_info,
398 tangential_relative_velocity,
399 normal_relative_velocity_value,
400 normal_unit_vector,
401 normal_overlap,
402 dt,
403 particle_one_properties,
404 particle_two_properties,
405 normal_force,
406 tangential_force,
407 particle_one_tangential_torque,
408 particle_two_tangential_torque,
409 rolling_resistance_torque);
410 }
411
412 if constexpr (contact_model == ParticleParticleContactForceModel::
413 hertz_mindlin_limit_overlap)
414 {
416 contact_info,
417 tangential_relative_velocity,
418 normal_relative_velocity_value,
419 normal_unit_vector,
420 normal_overlap,
421 dt,
422 particle_one_properties,
423 particle_two_properties,
424 normal_force,
425 tangential_force,
426 particle_one_tangential_torque,
427 particle_two_tangential_torque,
428 rolling_resistance_torque);
429 }
430
431
432 if constexpr (contact_model == ParticleParticleContactForceModel::hertz_JKR)
433 {
434 this->calculate_hertz_JKR_contact(contact_info,
435 tangential_relative_velocity,
436 normal_relative_velocity_value,
437 normal_unit_vector,
438 normal_overlap,
439 dt,
440 particle_one_properties,
441 particle_two_properties,
442 normal_force,
443 tangential_force,
444 particle_one_tangential_torque,
445 particle_two_tangential_torque,
446 rolling_resistance_torque);
447 }
448
449 if constexpr (contact_model == ParticleParticleContactForceModel::DMT)
450 {
451 this->calculate_DMT_contact(contact_info,
452 tangential_relative_velocity,
453 normal_relative_velocity_value,
454 normal_unit_vector,
455 normal_overlap,
456 dt,
457 particle_one_properties,
458 particle_two_properties,
459 normal_force,
460 tangential_force,
461 particle_one_tangential_torque,
462 particle_two_tangential_torque,
463 rolling_resistance_torque);
464 }
465
466 if constexpr (contact_model == ParticleParticleContactForceModel::shift)
467 {
468 // The shift model returns a displacement instead of a force. It goes
469 // through the normal force so that it is accumulated on the particles
470 // like a force.
471 calculate_shift_displacement(normal_unit_vector,
472 normal_overlap,
473 particle_one_properties,
474 particle_two_properties,
475 normal_force);
476 }
477 }
478
479 /**
480 * @brief Calculate the minimum overlap at which particle-particle forces are
481 * computed.
482 *
483 * @return minimum overlap for the force calculation.
484 */
485 inline double
487 {
488 if constexpr (contact_model == Parameters::Lagrangian::
489 ParticleParticleContactForceModel::DMT)
490 {
491 // We are looking for the maximum Hamaker constant and minimum surface
492 // energy to compute the biggest distance at which force will be
493 // computed. In other words, we are maximising the delta_0.
494 // This way, force_calculation_threshold_distance can be set
495 // to const variable, which should make the code faster.
496 const double max_effective_hamaker_constant =
497 *(std::ranges::max_element(this->effective_hamaker_constant));
498 const double min_effective_surface_energy =
499 *(std::ranges::min_element(this->effective_surface_energy));
500
501 // Return the critical delta_0. We put a minus sign in front since a
502 // positive overlap means that particles are in contact.
503 return -std::sqrt(
504 max_effective_hamaker_constant /
505 (12. * M_PI * min_effective_surface_energy * dmt_cut_off_threshold));
506 }
507 return 0.;
508 }
509
510private:
511 /**
512 * @brief Apply the calculated force and torque on the local-local
513 * particle pair in contact.
514 *
515 * @param[in] normal_force Contact normal force.
516 * @param[in] tangential_force Contact tangential force.
517 * @param[in] particle_one_tangential_torque Contact tangential torque on
518 * particle one.
519 * @param[in] particle_two_tangential_torque Contact tangential torque on
520 * particle two.
521 * @param[in] rolling_resistance_torque Contact rolling resistance torque.
522 * @param[in,out] particle_one_torque
523 * @param[in,out] particle_two_torque
524 * @param[in,out] particle_one_force Force acting on particle one
525 * @param[in,out] particle_two_force Force acting on particle two
526 */
527 inline void
529 const Tensor<1, 3> &normal_force,
530 const Tensor<1, 3> &tangential_force,
531 const Tensor<1, 3> &particle_one_tangential_torque,
532 const Tensor<1, 3> &particle_two_tangential_torque,
533 const Tensor<1, 3> &rolling_resistance_torque,
534 Tensor<1, 3> &particle_one_torque,
535 Tensor<1, 3> &particle_two_torque,
536 Tensor<1, 3> &particle_one_force,
537 Tensor<1, 3> &particle_two_force)
538 {
539 // Calculation of total force
540 Tensor<1, 3> total_force = normal_force + tangential_force;
541
542 // Updating the force and torque of particles in the particle handler
543 particle_one_force -= total_force;
544 particle_two_force += total_force;
545 particle_one_torque +=
546 -particle_one_tangential_torque + rolling_resistance_torque;
547 particle_two_torque +=
548 -particle_two_tangential_torque - rolling_resistance_torque;
549 }
550
551 /**
552 * @brief Apply the calculated force and torque on the local-ghost particle
553 * pair in contact. The contact force is only applied on the local particles
554 *
555 * @param[in] normal_force Contact normal force.
556 * @param[in] tangential_force Contact tangential force.
557 * @param[in] particle_one_tangential_torque Contact tangential torque.
558 * @param[in] rolling_resistance_torque Contact rolling resistance torque.
559 * @param[in,out] particle_one_torque Torque acting on particle one (local).
560 * @param[in,out] particle_one_force Force acting on particle one (local).
561 */
562 inline void
564 const Tensor<1, 3> &normal_force,
565 const Tensor<1, 3> &tangential_force,
566 const Tensor<1, 3> &particle_one_tangential_torque,
567 const Tensor<1, 3> &rolling_resistance_torque,
568 Tensor<1, 3> &particle_one_torque,
569 Tensor<1, 3> &particle_one_force)
570 {
571 // Updating the force and torque acting on particles in the particle handler
572 particle_one_force -= normal_force + tangential_force;
573 particle_one_torque +=
574 -particle_one_tangential_torque + rolling_resistance_torque;
575 }
576
577 /**
578 * @brief Calculate the effective mass and the effective radius of the particle
579 * pair.
580 *
581 * @param[in] particle_one_properties Properties of particle one in contact.
582 * @param[in] particle_two_properties Properties of particle two in contact.
583 */
584 inline std::tuple<double, double>
586 const ArrayView<const double> &particle_one_properties,
587 const ArrayView<const double> &particle_two_properties)
588 {
589 // Calculate the effective radius
590 const double diameter_one = particle_one_properties[PropertiesIndex::dp];
591 const double diameter_two = particle_two_properties[PropertiesIndex::dp];
592 double effective_radius =
593 (diameter_one * diameter_two) / (2 * (diameter_one + diameter_two));
594
595 // Calculate the effective mass
596 const double mass_one = particle_one_properties[PropertiesIndex::mass];
597 const double mass_two = particle_two_properties[PropertiesIndex::mass];
598 double effective_mass = (mass_one * mass_two) / (mass_one + mass_two);
599
600 return std::make_tuple(effective_radius, effective_mass);
601 }
602
603 /**
604 * @brief Calculate the rolling resistance torque acting on the particles
605 * according to the rolling resistance model.
606 *
607 * @param[in] effective_radius Effective radius of the particle pair.
608 * @param[in] particle_one_properties Properties of particle one in contact.
609 * @param[in] particle_two_properties Properties of particle two in contact.
610 * @param[in] rolling_friction_coeff Effective rolling friction coefficient.
611 * @param[in] rolling_viscous_damping_coeff Effective rolling viscous damping
612 * coefficient
613 * @param[in] dt DEM time step.
614 * @param[in] normal_spring_constant normal contact stiffness constant.
615 * @param[in] normal_force_norm Norm of the normal force.
616 * @param[in] normal_unit_vector Normal unit vector between particles in
617 * contact.
618 * @param[in,out] cumulative_rolling_resistance_spring_torque Cumulative
619 * spring rolling resistance torque applied between particle one and two.
620 *
621 */
622 inline Tensor<1, 3>
624 [[maybe_unused]] const double effective_radius,
625 [[maybe_unused]] const ArrayView<const double> &particle_one_properties,
626 [[maybe_unused]] const ArrayView<const double> &particle_two_properties,
627 [[maybe_unused]] const double rolling_friction_coeff,
628 [[maybe_unused]] const double rolling_viscous_damping_coeff,
629 [[maybe_unused]] const double dt,
630 [[maybe_unused]] const double normal_spring_constant,
631 [[maybe_unused]] const double normal_force_norm,
632 [[maybe_unused]] const Tensor<1, 3> &normal_unit_vector,
633 Tensor<1, 3> &cumulative_rolling_resistance_spring_torque)
634 {
635 using namespace Parameters::Lagrangian;
636
637 if constexpr (rolling_friction_model == none)
638 {
640 }
641
642 if constexpr (rolling_friction_model == constant)
643 {
645 effective_radius,
646 particle_one_properties,
647 particle_two_properties,
648 rolling_friction_coeff,
649 normal_force_norm);
650 }
651
652 if constexpr (rolling_friction_model == viscous)
653 {
655 effective_radius,
656 particle_one_properties,
657 particle_two_properties,
658 rolling_friction_coeff,
659 normal_force_norm,
660 normal_unit_vector);
661 }
662 if constexpr (rolling_friction_model == epsd)
663 {
665 effective_radius,
666 particle_one_properties,
667 particle_two_properties,
668 rolling_friction_coeff,
669 rolling_viscous_damping_coeff,
671 normal_force_norm,
672 dt,
673 normal_spring_constant,
674 normal_unit_vector,
675 cumulative_rolling_resistance_spring_torque);
676 }
677 }
678
679 /**
680 * @brief Calculate the particle-particle linear contact force and torque
681 * based on the updated values in contact_info.
682 *
683 * @param[in,out] contact_info A container that contains the required
684 * information for calculation of the contact force for a particle pair in
685 * contact.
686 * @param[in] tangential_relative_velocity Tangential relative velocity.
687 * @param[in] normal_relative_velocity_value Normal relative contact velocity.
688 * @param[in] normal_unit_vector Normal unit vector between particles in
689 * interaction.
690 * @param[in] normal_overlap Contact normal overlap.
691 * @param[in] dt DEM time step.
692 * @param[in] particle_one_properties Properties of particle one in contact.
693 * @param[in] particle_two_properties Properties of particle two in contact.
694 * @param[out] normal_force Contact normal force.
695 * @param[out] tangential_force Contact tangential force.
696 * @param[out] particle_one_tangential_torque Contact tangential torque on
697 * particle one.
698 * @param[out] particle_two_tangential_torque Contact tangential torque on
699 * particle two.
700 * @param[out] rolling_resistance_torque Contact rolling resistance torque.
701 */
702 inline void
705 const Tensor<1, 3> &tangential_relative_velocity,
706 const double normal_relative_velocity_value,
707 const Tensor<1, 3> &normal_unit_vector,
708 const double normal_overlap,
709 const double dt,
710 const ArrayView<const double> &particle_one_properties,
711 const ArrayView<const double> &particle_two_properties,
712 Tensor<1, 3> &normal_force,
713 Tensor<1, 3> &tangential_force,
714 Tensor<1, 3> &particle_one_tangential_torque,
715 Tensor<1, 3> &particle_two_tangential_torque,
716 Tensor<1, 3> &rolling_resistance_torque)
717 {
718 // Calculation of effective radius and mass
719 auto [effective_radius, effective_mass] =
720 find_effective_radius_and_mass(particle_one_properties,
721 particle_two_properties);
722
723 // Get the reference of the effective properties according to the particle
724 // types in vectors for easy-to-read equations.
725 const unsigned int particle_one_type =
726 static_cast<unsigned int>(particle_one_properties[PropertiesIndex::type]);
727 const unsigned int particle_two_type =
728 static_cast<unsigned int>(particle_two_properties[PropertiesIndex::type]);
729 const unsigned int pair_index =
730 vec_particle_type_index(particle_one_type, particle_two_type);
731
732 const double youngs_modulus = this->effective_youngs_modulus[pair_index];
733 const double beta = this->model_parameter_beta[pair_index];
734 const double rolling_viscous_damping_coeff =
736 const double friction_coeff =
737 this->effective_coefficient_of_friction[pair_index];
738 const double rolling_friction_coeff =
740
741 // Get particle diameter references
742 const double &diameter_one = particle_one_properties[PropertiesIndex::dp];
743 const double &diameter_two = particle_two_properties[PropertiesIndex::dp];
744
745 // Characteristic velocity is set at 1.0 so that the normal and tangential
746 // spring constant remain constant throughout a simulation.
747 constexpr double characteristic_velocity = 1.0;
748
749 // Calculate the normal spring constant using the following formula:
750 // kn = 16/15 * sqrt(Re) * Ye * (15/16 * (me * vc^2 / (sqrt(R) * Ye))^0.2
751 double normal_spring_constant =
752 1.0667 * sqrt(effective_radius) * youngs_modulus *
753 pow((0.9375 * effective_mass * characteristic_velocity *
754 characteristic_velocity / (sqrt(effective_radius) * youngs_modulus)),
755 0.2);
756
757 // Calculate the tangential spring constant
758 // REF: R. Garg, J. Galvin-Carney, T. Li, and S. Pannala, “Documentation of
759 // open-source MFIX–DEM software for gas-solids flows”, Tingwen Li Dr., p.
760 // 10, Sep. 2012.
761 double tangential_spring_constant = normal_spring_constant * 0.4;
762
763 // Calculate the normal damping constants
764 // -2 * beta * sqrt(m * kn)
765 double normal_damping_constant =
766 -2 * beta * sqrt(effective_mass * normal_spring_constant);
767
768 // Calculate the tangential damping constant
769 double tangential_damping_constant =
770 normal_damping_constant * 0.6324555320336759; // sqrt(0.4)
771
772 // Calculation of the normal force
773 const double normal_force_value =
774 normal_spring_constant * normal_overlap +
775 normal_damping_constant * normal_relative_velocity_value;
776 normal_force = normal_force_value * normal_unit_vector;
777
778 // Calculation of tangential force. Since we need damping tangential force
779 // in the gross sliding again, we define it as a separate variable
780 Tensor<1, 3> damping_tangential_force =
781 tangential_damping_constant * tangential_relative_velocity;
782
783 tangential_force =
784 (tangential_spring_constant * contact_info.tangential_displacement) +
785 damping_tangential_force;
786
787 double coulomb_threshold = friction_coeff * normal_force_value;
788
789 // Check for gross sliding
790 if (tangential_force.norm() > coulomb_threshold)
791 {
792 // Gross sliding occurs. The tangential displacement is recalculated
793 // from the tangential force limited to Coulomb's criterion.
794 const Tensor<1, 3> limited_tangential_force =
795 coulomb_threshold *
796 (tangential_force / (tangential_force.norm() + DBL_MIN));
797
798 // Calculate the tangential displacement from the limited tangential
799 // force minus the spring tangential force divided by the spring
800 // constant.
801 contact_info.tangential_displacement =
802 (limited_tangential_force - damping_tangential_force) /
803 (tangential_spring_constant + DBL_MIN);
804
805 // Recalculate the tangential force using the new tangential
806 // displacement.
807 tangential_force =
808 (tangential_spring_constant * contact_info.tangential_displacement) +
809 damping_tangential_force;
810 }
811
812 // Calculation of caused by tangential force (tangential_torque)
813 particle_one_tangential_torque =
814 cross_product_3d(normal_unit_vector,
815 tangential_force * diameter_one * 0.5);
816 particle_two_tangential_torque =
817 particle_one_tangential_torque * diameter_two / diameter_one;
818
819 // Rolling resistance torque
820 rolling_resistance_torque = calculate_rolling_resistance_torque(
821 effective_radius,
822 particle_one_properties,
823 particle_two_properties,
824 rolling_viscous_damping_coeff,
825 rolling_friction_coeff,
826 dt,
827 normal_spring_constant,
828 normal_force.norm(),
829 normal_unit_vector,
831 }
832
833 /**
834 * @brief Calculate the particle-particle non-linear contact force and torque
835 * based on the updated values in contact_info. It uses the Hertz-Mindlin
836 * contact model. If gross sliding occurs, the tangential displacement is
837 * recalculated from the limited tangential to the Coulomb's criterion.
838 *
839 * @param[in,out] contact_info A container that contains the required
840 * information for calculation of the contact force for a particle pair in
841 * contact.
842 * @param[in] tangential_relative_velocity Tangential relative velocity.
843 * @param[in] normal_relative_velocity_value Normal relative contact velocity.
844 * @param[in] normal_unit_vector Normal unit vector between particles in
845 * interaction.
846 * @param[in] normal_overlap Contact normal overlap.
847 * @param[in] dt DEM time step.
848 * @param[in] particle_one_properties Properties of particle one in contact.
849 * @param[in] particle_two_properties Properties of particle two in contact.
850 * @param[out] normal_force Contact normal force.
851 * @param[out] tangential_force Contact tangential force.
852 * @param[out] particle_one_tangential_torque Contact tangential torque on
853 * particle one.
854 * @param[out] particle_two_tangential_torque Contact tangential torque on
855 * particle two.
856 * @param[out] rolling_resistance_torque Contact rolling resistance torque.
857 */
858 inline void
861 const Tensor<1, 3> &tangential_relative_velocity,
862 const double normal_relative_velocity_value,
863 const Tensor<1, 3> &normal_unit_vector,
864 const double normal_overlap,
865 const double dt,
866 const ArrayView<const double> &particle_one_properties,
867 const ArrayView<const double> &particle_two_properties,
868 Tensor<1, 3> &normal_force,
869 Tensor<1, 3> &tangential_force,
870 Tensor<1, 3> &particle_one_tangential_torque,
871 Tensor<1, 3> &particle_two_tangential_torque,
872 Tensor<1, 3> &rolling_resistance_torque)
873 {
874 // Calculation of effective radius and mass
875 auto [effective_radius, effective_mass] =
876 find_effective_radius_and_mass(particle_one_properties,
877 particle_two_properties);
878
879 const unsigned int particle_one_type =
880 static_cast<unsigned int>(particle_one_properties[PropertiesIndex::type]);
881 const unsigned int particle_two_type =
882 static_cast<unsigned int>(particle_two_properties[PropertiesIndex::type]);
883 const unsigned int pair_index =
884 vec_particle_type_index(particle_one_type, particle_two_type);
885
886 const double youngs_modulus = this->effective_youngs_modulus[pair_index];
887 const double shear_modulus = this->effective_shear_modulus[pair_index];
888 const double beta = this->model_parameter_beta[pair_index];
889 const double friction_coeff =
890 this->effective_coefficient_of_friction[pair_index];
891 const double rolling_viscous_damping_coeff =
893 const double rolling_friction_coeff =
895
896 // Get particle diameter references;
897 const double &diameter_one = particle_one_properties[PropertiesIndex::dp];
898 const double &diameter_two = particle_two_properties[PropertiesIndex::dp];
899
900 // Calculate intermediate model parameters
901 const double radius_times_overlap_sqrt =
902 sqrt(effective_radius * normal_overlap);
903 const double model_parameter_sn =
904 2.0 * youngs_modulus * radius_times_overlap_sqrt;
905 double model_parameter_st = 8.0 * shear_modulus * radius_times_overlap_sqrt;
906
907 // Calculation of normal and tangential spring and dashpot constants
908 // using particle properties
909
910 // Calculate the normal spring constant using the following formula:
911 // kn = 4/3 * Ye * sqrt(Re * delta_n)
912 // TODO this is 0.66667
913 double normal_spring_constant = 0.66665 * model_parameter_sn;
914
915 // Calculate the normal damping constants from the following equation:
916 // eta_n = -2 * sqrt(5/6) * beta * sqrt(Sn * me)
917 double normal_damping_constant =
918 -1.8257 * beta * sqrt(model_parameter_sn * effective_mass);
919
920 // Calculate the tangential spring constant
921 // kt = 8 * Ge * sqrt(Re * delta_n)
922 double tangential_spring_constant =
923 8.0 * shear_modulus * radius_times_overlap_sqrt;
924
925 // Calculate the tangential damping constant from the ratio with the normal
926 // damping constant, but the equation is:
927 // eta_t = -2 * sqrt(5/6) * beta * sqrt(St * me)
928 double tangential_damping_constant =
929 normal_damping_constant * sqrt(model_parameter_st / model_parameter_sn);
930
931 // Calculation of normal force
932 const double normal_force_value =
933 normal_spring_constant * normal_overlap +
934 normal_damping_constant * normal_relative_velocity_value;
935 normal_force = normal_force_value * normal_unit_vector;
936
937 // Calculation of tangential force. Since we need damping tangential force
938 // in the gross sliding again, we define it as a separate variable
939 Tensor<1, 3> damping_tangential_force =
940 tangential_damping_constant * tangential_relative_velocity;
941 tangential_force =
942 (tangential_spring_constant * contact_info.tangential_displacement) +
943 damping_tangential_force;
944
945 double coulomb_threshold = friction_coeff * normal_force_value;
946
947 // Check for gross sliding
948 if (tangential_force.norm() > coulomb_threshold)
949 {
950 // Gross sliding occurs. The tangential displacement is recalculated
951 // from the tangential force limited to Coulomb's criterion
952 const Tensor<1, 3> limited_tangential_force =
953 coulomb_threshold *
954 (tangential_force / (tangential_force.norm() + DBL_MIN));
955
956 // Calculate the tangential displacement from the limited tangential
957 // force minus the spring tangential force divided by the spring
958 // constant.
959 contact_info.tangential_displacement =
960 (limited_tangential_force - damping_tangential_force) /
961 (tangential_spring_constant + DBL_MIN);
962
963 // Recalculate the tangential force using the new tangential
964 // displacement.
965 tangential_force =
966 (tangential_spring_constant * contact_info.tangential_displacement) +
967 damping_tangential_force;
968 }
969
970 // Calculation of torque caused by tangential force (tangential_torque)
971 particle_one_tangential_torque =
972 cross_product_3d(normal_unit_vector,
973 tangential_force * diameter_one * 0.5);
974 particle_two_tangential_torque =
975 particle_one_tangential_torque * diameter_two / diameter_one;
976
977 // Rolling resistance torque
978 rolling_resistance_torque = calculate_rolling_resistance_torque(
979 effective_radius,
980 particle_one_properties,
981 particle_two_properties,
982 rolling_friction_coeff,
983 rolling_viscous_damping_coeff,
984 dt,
985 normal_spring_constant,
986 normal_force.norm(),
987 normal_unit_vector,
989 }
990
991 /**
992 * @brief Calculate the particle-particle non-linear contact force and torque
993 * based on the updated values in contact_info. It uses the Hertz-Mindlin
994 * contact model. If gross sliding occurs, the tangential displacement and
995 * tangential force are limited to Coulomb's criterion.
996 *
997 * @param[in,out] contact_info A container that contains the required
998 * information for calculation of the contact force for a particle pair in
999 * contact.
1000 * @param[in] tangential_relative_velocity Tangential relative velocity.
1001 * @param[in] normal_relative_velocity_value Normal relative contact velocity.
1002 * @param[in] normal_unit_vector Contact normal unit vector.
1003 * @param[in] normal_overlap Contact normal overlap.
1004 * @param[in] dt DEM time step.
1005 * @param[in] particle_one_properties Properties of particle one in contact.
1006 * @param[in] particle_two_properties Properties of particle two in contact.
1007 * @param[out] normal_force Contact normal force.
1008 * @param[out] tangential_force Contact tangential force.
1009 * @param[out] particle_one_tangential_torque Contact tangential torque on
1010 * particle one.
1011 * @param[out] particle_two_tangential_torque Contact tangential torque on
1012 * particle two.
1013 * @param[out] rolling_resistance_torque Contact rolling resistance torque.
1014 */
1015 inline void
1018 const Tensor<1, 3> &tangential_relative_velocity,
1019 const double normal_relative_velocity_value,
1020 const Tensor<1, 3> &normal_unit_vector,
1021 const double normal_overlap,
1022 const double dt,
1023 const ArrayView<const double> &particle_one_properties,
1024 const ArrayView<const double> &particle_two_properties,
1025 Tensor<1, 3> &normal_force,
1026 Tensor<1, 3> &tangential_force,
1027 Tensor<1, 3> &particle_one_tangential_torque,
1028 Tensor<1, 3> &particle_two_tangential_torque,
1029 Tensor<1, 3> &rolling_resistance_torque)
1030 {
1031 // Calculation of effective radius and mass
1032 auto [effective_radius, effective_mass] =
1033 find_effective_radius_and_mass(particle_one_properties,
1034 particle_two_properties);
1035
1036 const unsigned int particle_one_type =
1037 static_cast<unsigned int>(particle_one_properties[PropertiesIndex::type]);
1038 const unsigned int particle_two_type =
1039 static_cast<unsigned int>(particle_two_properties[PropertiesIndex::type]);
1040 const unsigned int pair_index =
1041 vec_particle_type_index(particle_one_type, particle_two_type);
1042
1043 const double youngs_modulus = this->effective_youngs_modulus[pair_index];
1044 const double shear_modulus = this->effective_shear_modulus[pair_index];
1045 const double beta = this->model_parameter_beta[pair_index];
1046 const double friction_coeff =
1047 this->effective_coefficient_of_friction[pair_index];
1048 const double rolling_viscous_damping_coeff =
1050 const double rolling_friction_coeff =
1052
1053 // Get particle diameter references;
1054 const double &diameter_one = particle_one_properties[PropertiesIndex::dp];
1055 const double &diameter_two = particle_two_properties[PropertiesIndex::dp];
1056
1057 // Calculate intermediate model parameters
1058 const double radius_times_overlap_sqrt =
1059 sqrt(effective_radius * normal_overlap);
1060 const double model_parameter_sn =
1061 2.0 * youngs_modulus * radius_times_overlap_sqrt;
1062 double model_parameter_st = 8.0 * shear_modulus * radius_times_overlap_sqrt;
1063
1064 // Calculate the normal spring constant using the following formula:
1065 // kn = 4/3 * Ye * sqrt(Re * delta_n)
1066 // TODO this is 0.66667
1067 double normal_spring_constant = 0.66665 * model_parameter_sn;
1068
1069 // Calculate the normal damping constants from the following equation:
1070 // eta_n = -2 * sqrt(5/6) * beta * sqrt(Sn * me)
1071 double normal_damping_constant =
1072 -1.8257 * beta * sqrt(model_parameter_sn * effective_mass);
1073
1074 // Calculate the tangential spring constant
1075 // kt = 8 * Ge * sqrt(Re * delta_n)
1076 double tangential_spring_constant =
1077 8.0 * shear_modulus * radius_times_overlap_sqrt;
1078
1079 // Calculate the tangential damping constant from the ratio with the normal
1080 // damping constant, but the equation is:
1081 // eta_t = -2 * sqrt(5/6) * beta * sqrt(St * me)
1082 double tangential_damping_constant =
1083 normal_damping_constant * sqrt(model_parameter_st / model_parameter_sn);
1084
1085 // Calculation of normal force using spring and dashpot normal forces
1086 const double normal_force_value =
1087 normal_spring_constant * normal_overlap +
1088 normal_damping_constant * normal_relative_velocity_value;
1089 normal_force = normal_force_value * normal_unit_vector;
1090
1091 // Calculation of tangential force. Since we need damping tangential force
1092 // in the gross sliding again, we define it as a separate variable
1093 Tensor<1, 3> damping_tangential_force =
1094 tangential_damping_constant * tangential_relative_velocity;
1095 tangential_force =
1096 (tangential_spring_constant * contact_info.tangential_displacement) +
1097 damping_tangential_force;
1098
1099 double coulomb_threshold = friction_coeff * normal_force_value;
1100
1101 // Check for gross sliding
1102 if (tangential_force.norm() > coulomb_threshold)
1103 {
1104 // Gross sliding occurs. The tangential displacement and tangential
1105 // force are limited to Coulomb's criterion
1106 tangential_force =
1107 coulomb_threshold *
1108 (tangential_force / (tangential_force.norm() + DBL_MIN));
1109 }
1110
1111 // Calculation of torque caused by tangential force (tangential_torque)
1112 particle_one_tangential_torque =
1113 cross_product_3d(normal_unit_vector,
1114 tangential_force * diameter_one * 0.5);
1115 particle_two_tangential_torque =
1116 particle_one_tangential_torque * diameter_two / diameter_one;
1117
1118 // Rolling resistance torque
1119 rolling_resistance_torque = calculate_rolling_resistance_torque(
1120 effective_radius,
1121 particle_one_properties,
1122 particle_two_properties,
1123 rolling_friction_coeff,
1124 rolling_viscous_damping_coeff,
1125 dt,
1126 normal_spring_constant,
1127 normal_force.norm(),
1128 normal_unit_vector,
1130 }
1131
1132 /**
1133 * @brief Calculate the particle-particle non-linear contact force and torque
1134 * based on the updated values in contact_info. It uses the Hertz contact
1135 * model, same as the Hertz-Mindlin with limit of the tangential force
1136 * without the tangential damping force.
1137 *
1138 * @param[in,out] contact_info A container that contains the required
1139 * information for calculation of the contact force for a particle pair in
1140 * contact.
1141 * @param[in] normal_relative_velocity_value Normal relative contact velocity.
1142 * @param[in] normal_unit_vector Contact normal unit vector.
1143 * @param[in] normal_overlap Contact normal overlap.
1144 * @param[in] dt DEM time step.
1145 * @param[in] particle_one_properties Properties of particle one in contact.
1146 * @param[in] particle_two_properties Properties of particle two in contact.
1147 * @param[out] normal_force Contact normal force.
1148 * @param[out] tangential_force Contact tangential force.
1149 * @param[out] particle_one_tangential_torque Contact tangential torque on
1150 * particle one.
1151 * @param[out] particle_two_tangential_torque Contact tangential torque on
1152 * particle two.
1153 * @param[out] rolling_resistance_torque Contact rolling resistance torque.
1154 */
1155 inline void
1158 const Tensor<1, 3> & /*tangential_relative_velocity*/,
1159 const double normal_relative_velocity_value,
1160 const Tensor<1, 3> &normal_unit_vector,
1161 const double normal_overlap,
1162 const double dt,
1163 const ArrayView<const double> &particle_one_properties,
1164 const ArrayView<const double> &particle_two_properties,
1165 Tensor<1, 3> &normal_force,
1166 Tensor<1, 3> &tangential_force,
1167 Tensor<1, 3> &particle_one_tangential_torque,
1168 Tensor<1, 3> &particle_two_tangential_torque,
1169 Tensor<1, 3> &rolling_resistance_torque)
1170 {
1171 // Calculation of effective radius and mass
1172 auto [effective_radius, effective_mass] =
1173 find_effective_radius_and_mass(particle_one_properties,
1174 particle_two_properties);
1175
1176 const unsigned int particle_one_type =
1177 static_cast<unsigned int>(particle_one_properties[PropertiesIndex::type]);
1178 const unsigned int particle_two_type =
1179 static_cast<unsigned int>(particle_two_properties[PropertiesIndex::type]);
1180 const unsigned int pair_index =
1181 vec_particle_type_index(particle_one_type, particle_two_type);
1182
1183 const double youngs_modulus = this->effective_youngs_modulus[pair_index];
1184 const double shear_modulus = this->effective_shear_modulus[pair_index];
1185 const double beta = this->model_parameter_beta[pair_index];
1186 const double friction_coeff =
1187 this->effective_coefficient_of_friction[pair_index];
1188 const double rolling_viscous_damping_coeff =
1190 const double rolling_friction_coeff =
1192
1193 // Get particle diameter references;
1194 const double &diameter_one = particle_one_properties[PropertiesIndex::dp];
1195 const double &diameter_two = particle_two_properties[PropertiesIndex::dp];
1196
1197 // Calculate intermediate model parameters
1198 const double radius_times_overlap_sqrt =
1199 sqrt(effective_radius * normal_overlap);
1200 const double model_parameter_sn =
1201 2.0 * youngs_modulus * radius_times_overlap_sqrt;
1202
1203 // Calculate the normal spring constant using the following formula:
1204 // kn = 4/3 * Ye * sqrt(Re * delta_n)
1205 // TODO this is 0.666667
1206 double normal_spring_constant = 0.66665 * model_parameter_sn;
1207
1208 // Calculate the normal damping constants from the following equation:
1209 // eta_n = -2 * sqrt(5/6) * beta * sqrt(Sn * me)
1210 double normal_damping_constant =
1211 -1.8257 * beta * sqrt(model_parameter_sn * effective_mass);
1212
1213 // Calculate the tangential spring constant
1214 // kt = 8 * Ge * sqrt(Re * delta_n)
1215 double tangential_spring_constant =
1216 8.0 * shear_modulus * radius_times_overlap_sqrt;
1217
1218 // Calculation of normal force using spring and dashpot normal constants.
1219 const double normal_force_value =
1220 normal_spring_constant * normal_overlap +
1221 normal_damping_constant * normal_relative_velocity_value;
1222 normal_force = normal_force_value * normal_unit_vector;
1223
1224 // Calculation of tangential force using the spring tangential constant.
1225 tangential_force =
1226 tangential_spring_constant * contact_info.tangential_displacement;
1227
1228 double coulomb_threshold = friction_coeff * normal_force_value;
1229
1230 // Check for gross sliding
1231 if (tangential_force.norm() > coulomb_threshold)
1232 {
1233 // Gross sliding occurs. The tangential displacement and tangential
1234 // force are limited to Coulomb's criterion
1235 tangential_force =
1236 coulomb_threshold *
1237 (tangential_force / (tangential_force.norm() + DBL_MIN));
1238 }
1239
1240 // Calculation of torque caused by tangential force (tangential_torque)
1241 particle_one_tangential_torque =
1242 cross_product_3d(normal_unit_vector,
1243 tangential_force * diameter_one * 0.5);
1244 particle_two_tangential_torque =
1245 particle_one_tangential_torque * diameter_two / diameter_one;
1246
1247 // Rolling resistance torque
1248 rolling_resistance_torque = calculate_rolling_resistance_torque(
1249 effective_radius,
1250 particle_one_properties,
1251 particle_two_properties,
1252 rolling_friction_coeff,
1253 rolling_viscous_damping_coeff,
1254 dt,
1255 normal_spring_constant,
1256 normal_force.norm(),
1257 normal_unit_vector,
1259 }
1260 /**
1261 * @brief Calculate the particle-particle contact and cohesive forces and
1262 * contact torque based on the updated values in contact_info. It uses the JKR
1263 * cohesive force model.
1264 *
1265 * @param[in,out] contact_info A container that contains the required
1266 * information for calculation of the contact force for a particle pair in
1267 * contact.
1268 * @param[in] tangential_relative_velocity Tangential relative velocity.
1269 * @param[in] normal_relative_velocity_value Normal relative contact velocity.
1270 * @param[in] normal_unit_vector Contact normal unit vector.
1271 * @param[in] normal_overlap Contact normal overlap.
1272 * @param[in] dt DEM time step.
1273 * @param[in] particle_one_properties Properties of particle one in contact.
1274 * @param[in] particle_two_properties Properties of particle two in contact.
1275 * @param[out] normal_force Contact normal force.
1276 * @param[out] tangential_force Contact tangential force.
1277 * @param[out] particle_one_tangential_torque Contact tangential torque on
1278 * particle one.
1279 * @param[out] particle_two_tangential_torque Contact tangential torque on
1280 * particle two.
1281 * @param[out] rolling_resistance_torque Contact rolling resistance torque.
1282 */
1283 inline void
1286 const Tensor<1, 3> &tangential_relative_velocity,
1287 const double normal_relative_velocity_value,
1288 const Tensor<1, 3> &normal_unit_vector,
1289 const double normal_overlap,
1290 const double dt,
1291 const ArrayView<const double> &particle_one_properties,
1292 const ArrayView<const double> &particle_two_properties,
1293 Tensor<1, 3> &normal_force,
1294 Tensor<1, 3> &tangential_force,
1295 Tensor<1, 3> &particle_one_tangential_torque,
1296 Tensor<1, 3> &particle_two_tangential_torque,
1297 Tensor<1, 3> &rolling_resistance_torque)
1298 {
1299 // Calculation of effective radius and mass
1300 auto [effective_radius, effective_mass] =
1301 find_effective_radius_and_mass(particle_one_properties,
1302 particle_two_properties);
1303
1304 const unsigned int particle_one_type =
1305 static_cast<unsigned int>(particle_one_properties[PropertiesIndex::type]);
1306 const unsigned int particle_two_type =
1307 static_cast<unsigned int>(particle_two_properties[PropertiesIndex::type]);
1308 const unsigned int pair_index =
1309 vec_particle_type_index(particle_one_type, particle_two_type);
1310
1311 const double youngs_modulus = this->effective_youngs_modulus[pair_index];
1312 const double shear_modulus = this->effective_shear_modulus[pair_index];
1313 const double beta = this->model_parameter_beta[pair_index];
1314 const double friction_coeff =
1315 this->effective_coefficient_of_friction[pair_index];
1316 const double rolling_viscous_damping_coeff =
1318 const double rolling_friction_coeff =
1320 const double surface_energy = this->effective_surface_energy[pair_index];
1321
1322 // Get particle diameter references;
1323 const double &diameter_one = particle_one_properties[PropertiesIndex::dp];
1324 const double &diameter_two = particle_two_properties[PropertiesIndex::dp];
1325
1326 // Calculate intermediate model parameters
1327 const double radius_times_overlap_sqrt =
1328 sqrt(effective_radius * normal_overlap);
1329 const double model_parameter_sn =
1330 2.0 * youngs_modulus * radius_times_overlap_sqrt;
1331 double model_parameter_st = 8.0 * shear_modulus * radius_times_overlap_sqrt;
1332
1333 // Calculation of the contact path radius using the Ferrari analytical
1334 // solution.
1335 const double c0 =
1336 Utilities::fixed_power<2>(effective_radius * normal_overlap);
1337 const double c1 = -2. * Utilities::fixed_power<2>(effective_radius) * M_PI *
1338 surface_energy / youngs_modulus;
1339
1340 const double c2 = -2. * normal_overlap * effective_radius;
1341 const double P = -Utilities::fixed_power<2>(c2) / 12. - c0;
1342 const double Q = -Utilities::fixed_power<3>(c2) / 108. + c0 * c2 / 3. -
1343 Utilities::fixed_power<2>(c1) * 0.125;
1344 const double root1 =
1345 0.25 * Utilities::fixed_power<2>(Q) + Utilities::fixed_power<3>(P) / 27.;
1346 const double U = std::cbrt(-0.5 * Q + std::sqrt(root1));
1347 const double s = -c2 * (5. / 6.) + U - P / (3. * U);
1348 const double w = std::sqrt(std::max(1e-16, c2 + 2. * s));
1349 const double lambda = 0.5 * c1 / w;
1350 const double root2 = std::max(1e-16, w * w - 4. * (c2 + s + lambda));
1351 const double a = 0.5 * (w + std::sqrt(root2));
1352
1353 // Calculation of the normal damping constant.
1354 const double normal_damping_constant =
1355 -1.8257 * beta * sqrt(model_parameter_sn * effective_mass);
1356
1357 // Calculation of the tangential spring constant
1358 const double tangential_spring_constant =
1359 8.0 * radius_times_overlap_sqrt * shear_modulus;
1360 // Calculation of the tangential damping constant
1361 const double tangential_damping_constant =
1362 normal_damping_constant * sqrt(model_parameter_st / model_parameter_sn);
1363
1364 // Calculation of the normal force coefficient (F_n_JKR) # Eq 20
1365 const double normal_force_coefficient =
1366 4. * Utilities::fixed_power<3>(a) / (3. * effective_radius) *
1367 youngs_modulus -
1368 std::sqrt(8. * M_PI * surface_energy * youngs_modulus *
1369 Utilities::fixed_power<3>(a));
1370
1371 // Calculation of the final normal force vector
1372 normal_force = (normal_force_coefficient +
1373 normal_damping_constant * normal_relative_velocity_value) *
1374 normal_unit_vector;
1375
1376 tangential_force =
1377 tangential_spring_constant * contact_info.tangential_displacement +
1378 tangential_damping_constant * tangential_relative_velocity;
1379
1380 // JKR theory says that the coulomb threshold must be modified with the
1381 // pull-out force.
1382 const double two_pull_off_force =
1383 3. * M_PI * surface_energy * effective_radius;
1384
1385 const double modified_coulomb_threshold =
1386 (normal_force_coefficient + two_pull_off_force) * friction_coeff;
1387
1388 if (tangential_force.norm() > modified_coulomb_threshold)
1389 {
1390 // Gross sliding occurs. The tangential displacement and tangential
1391 // force are limited to Coulomb's criterion
1392 tangential_force =
1393 modified_coulomb_threshold *
1394 (tangential_force / (tangential_force.norm() + DBL_MIN));
1395 }
1396
1397 // Calculation of torque caused by tangential force (tangential_torque)
1398 particle_one_tangential_torque =
1399 cross_product_3d(normal_unit_vector,
1400 tangential_force * diameter_one * 0.5);
1401 particle_two_tangential_torque =
1402 particle_one_tangential_torque * diameter_two / diameter_one;
1403
1404 // We need to compute the normal spring constant in case if we use the EPSD
1405 // rolling resistance model.
1406 double normal_spring_constant = 0.66665 * model_parameter_sn;
1407
1408 // Rolling resistance torque
1409 rolling_resistance_torque = calculate_rolling_resistance_torque(
1410 effective_radius,
1411 particle_one_properties,
1412 particle_two_properties,
1413 rolling_friction_coeff,
1414 rolling_viscous_damping_coeff,
1415 dt,
1416 normal_spring_constant,
1417 normal_force.norm(),
1418 normal_unit_vector,
1420 }
1421 /**
1422 * @brief Calculate the particle-particle contact and cohesive forces and
1423 * contact torque based on the updated values in contact_info. It uses the DMT
1424 * cohesive force model.
1425 *
1426 * @param[in,out] contact_info A container that contains the required
1427 * information for calculation of the contact force for a particle pair in
1428 * contact.
1429 * @param[in] tangential_relative_velocity Tangential relative velocity.
1430 * @param[in] normal_relative_velocity_value Normal relative contact velocity.
1431 * @param[in] normal_unit_vector Contact normal unit vector.
1432 * @param[in] normal_overlap Contact normal overlap.
1433 * @param[in] dt DEM time step.
1434 * @param[in] particle_one_properties Properties of particle one in contact.
1435 * @param[in] particle_two_properties Properties of particle two in contact.
1436 * @param[out] normal_force Contact normal force.
1437 * @param[out] tangential_force Contact tangential force.
1438 * @param[out] particle_one_tangential_torque Contact tangential torque on
1439 * particle one.
1440 * @param[out] particle_two_tangential_torque Contact tangential torque on
1441 * particle two.
1442 * @param[out] rolling_resistance_torque Contact rolling resistance torque.
1443 */
1444 inline void
1446 const Tensor<1, 3> &tangential_relative_velocity,
1447 const double normal_relative_velocity_value,
1448 const Tensor<1, 3> &normal_unit_vector,
1449 const double normal_overlap,
1450 const double dt,
1451 const ArrayView<const double> &particle_one_properties,
1452 const ArrayView<const double> &particle_two_properties,
1453 Tensor<1, 3> &normal_force,
1454 Tensor<1, 3> &tangential_force,
1455 Tensor<1, 3> &particle_one_tangential_torque,
1456 Tensor<1, 3> &particle_two_tangential_torque,
1457 Tensor<1, 3> &rolling_resistance_torque)
1458 {
1459 constexpr double M_2PI = 2. * M_PI;
1460
1461 // Calculation of effective radius and mass
1462 auto [effective_radius, effective_mass] =
1463 find_effective_radius_and_mass(particle_one_properties,
1464 particle_two_properties);
1465
1466 const unsigned int particle_one_type =
1467 static_cast<unsigned int>(particle_one_properties[PropertiesIndex::type]);
1468 const unsigned int particle_two_type =
1469 static_cast<unsigned int>(particle_two_properties[PropertiesIndex::type]);
1470 const unsigned int pair_index =
1471 vec_particle_type_index(particle_one_type, particle_two_type);
1472
1473 const double surface_energy = this->effective_surface_energy[pair_index];
1474 const double hamaker_constant =
1475 this->effective_hamaker_constant[pair_index];
1476
1477 const double F_po = M_2PI * effective_radius * surface_energy;
1478
1479 const double delta_0 =
1480 -std::sqrt(hamaker_constant * effective_radius / (6. * F_po));
1481
1482 // Cohesive force. This will need to be added to the
1483 // first vector inside the tuple.
1484 double cohesive_term;
1485
1486 // Contact between particles + constant cohesive force.
1487 if (normal_overlap > 0.)
1488 {
1489 cohesive_term = -F_po;
1490
1492 contact_info,
1493 tangential_relative_velocity,
1494 normal_relative_velocity_value,
1495 normal_unit_vector,
1496 normal_overlap,
1497 dt,
1498 particle_one_properties,
1499 particle_two_properties,
1500 normal_force,
1501 tangential_force,
1502 particle_one_tangential_torque,
1503 particle_two_tangential_torque,
1504 rolling_resistance_torque);
1505 }
1506 // No contact, but still in the constant zone for the cohesive force.
1507 else if (normal_overlap > delta_0)
1508 {
1509 cohesive_term = -F_po;
1510 contact_info.tangential_displacement.clear();
1511 contact_info.rolling_resistance_spring_torque.clear();
1512 }
1513 // No contact. Particles are far from each other. The cohesive force is not
1514 // constant. It needs to be computed.
1515 else
1516 {
1517 cohesive_term = -hamaker_constant * effective_radius /
1518 (6. * Utilities::fixed_power<2>(normal_overlap));
1519 contact_info.tangential_displacement.clear();
1520 contact_info.rolling_resistance_spring_torque.clear();
1521 }
1522 normal_force += cohesive_term * normal_unit_vector;
1523 }
1524
1525 /**
1526 * @brief Calculate the displacement that separates two overlapping particles.
1527 * This "contact force" model is used by the packed insertion method. The
1528 * displacement is along the contact normal and is slightly larger than half
1529 * the normal overlap, so that the two particles are separated once each of
1530 * them is displaced.
1531 *
1532 * @param[in] normal_unit_vector Normal unit contact vector from particle one
1533 * to particle two.
1534 * @param[in] normal_overlap Contact normal overlap.
1535 * @param[in] particle_one_properties Properties of particle one in contact.
1536 * @param[in] particle_two_properties Properties of particle two in contact.
1537 * @param[out] normal_displacement Displacement of particle two along the
1538 * contact normal. Particle one is displaced by its opposite.
1539 */
1540 inline void
1542 const Tensor<1, 3> &normal_unit_vector,
1543 const double normal_overlap,
1544 const ArrayView<const double> &particle_one_properties,
1545 const ArrayView<const double> &particle_two_properties,
1546 Tensor<1, 3> &normal_displacement)
1547 {
1548 const double mean_diameter =
1549 0.5 * (particle_one_properties[PropertiesIndex::dp] +
1550 particle_two_properties[PropertiesIndex::dp]);
1551
1552 // TODO: 0.501 and 0.01 values should be parameters declared in the
1553 // parameter file
1554 normal_displacement =
1555 (0.501 * normal_overlap + 0.01 * mean_diameter) * normal_unit_vector;
1556
1557 ++this->n_contacts;
1558 }
1559
1560 /**
1561 * @brief Return the index to access the property vectors for a given
1562 * combination of particle types.
1563 *
1564 * @param[in] i First particle type index.
1565 * @param[in] j Second particle type index.
1566 * @return index associated with the combinations of particle types.
1567 */
1568 inline unsigned int
1569 vec_particle_type_index(const unsigned int i, const unsigned int j) const
1570 {
1571 return i * n_particle_types + j;
1572 }
1573
1574 /**
1575 * @brief Set every container needed to carry the particle-particle force
1576 * calculation.
1577 *
1578 * @param[in] dem_parameters DEM parameters declared in the .prm file.
1579 */
1580 void
1582 {
1583 auto properties = dem_parameters.lagrangian_physical_properties;
1584
1585 n_particle_types = properties.particle_type_number;
1599
1600 for (unsigned int i = 0; i < n_particle_types; ++i)
1601 {
1602 const double youngs_modulus_i =
1603 properties.youngs_modulus_particle.at(i);
1604 const double poisson_ratio_i = properties.poisson_ratio_particle.at(i);
1605 const double restitution_coefficient_i =
1606 properties.restitution_coefficient_particle.at(i);
1607 const double friction_coefficient_i =
1608 properties.friction_coefficient_particle.at(i);
1609 const double rolling_viscous_damping_coefficient_i =
1610 properties.rolling_viscous_damping_coefficient_particle.at(i);
1611 const double rolling_friction_coefficient_i =
1612 properties.rolling_friction_coefficient_particle.at(i);
1613 const double surface_energy_i =
1614 properties.surface_energy_particle.at(i);
1615 const double hamaker_constant_i =
1616 properties.hamaker_constant_particle.at(i);
1617
1618 for (unsigned int j = 0; j < n_particle_types; ++j)
1619 {
1620 const unsigned int k = i * n_particle_types + j;
1621
1622 const double youngs_modulus_j =
1623 properties.youngs_modulus_particle.at(j);
1624 const double poisson_ratio_j =
1625 properties.poisson_ratio_particle.at(j);
1626 const double restitution_coefficient_j =
1627 properties.restitution_coefficient_particle.at(j);
1628 const double friction_coefficient_j =
1629 properties.friction_coefficient_particle.at(j);
1630 const double rolling_viscous_damping_coefficient_j =
1631 properties.rolling_viscous_damping_coefficient_particle.at(j);
1632 const double rolling_friction_coefficient_j =
1633 properties.rolling_friction_coefficient_particle.at(j);
1634 const double surface_energy_j =
1635 properties.surface_energy_particle.at(j);
1636 const double hamaker_constant_j =
1637 properties.hamaker_constant_particle.at(j);
1638
1639 this->effective_youngs_modulus[k] =
1640 (youngs_modulus_i * youngs_modulus_j) /
1641 ((youngs_modulus_j * (1.0 - poisson_ratio_i * poisson_ratio_i)) +
1642 (youngs_modulus_i * (1.0 - poisson_ratio_j * poisson_ratio_j)) +
1643 DBL_MIN);
1644
1645 this->effective_shear_modulus[k] =
1646 (youngs_modulus_i * youngs_modulus_j) /
1647 (2.0 * ((youngs_modulus_j * (2.0 - poisson_ratio_i) *
1648 (1.0 + poisson_ratio_i)) +
1649 (youngs_modulus_i * (2.0 - poisson_ratio_j) *
1650 (1.0 + poisson_ratio_j))) +
1651 DBL_MIN);
1652
1654 harmonic_mean(restitution_coefficient_i,
1655 restitution_coefficient_j);
1656
1658 harmonic_mean(friction_coefficient_i, friction_coefficient_j);
1659
1661 harmonic_mean(rolling_viscous_damping_coefficient_i,
1662 rolling_viscous_damping_coefficient_j);
1663
1665 harmonic_mean(rolling_friction_coefficient_i,
1666 rolling_friction_coefficient_j);
1667
1668 this->effective_surface_energy[k] =
1669 surface_energy_i + surface_energy_j -
1670 std::pow(std::sqrt(surface_energy_i) -
1671 std::sqrt(surface_energy_j),
1672 2);
1673
1675 0.5 * (hamaker_constant_i + hamaker_constant_j);
1676
1677 double restitution_coefficient_particle_log =
1678 std::log(this->effective_coefficient_of_restitution[k]);
1679
1680 this->model_parameter_beta[k] =
1681 restitution_coefficient_particle_log /
1682 sqrt(restitution_coefficient_particle_log *
1683 restitution_coefficient_particle_log +
1684 9.8696);
1685 }
1686 }
1687 }
1688
1689 /**
1690 * @brief Set every container needed to carry the heat transfer rate
1691 * calculation.
1692 *
1693 * @param[in] dem_parameters DEM parameters declared in the .prm
1694 * file.
1695 */
1696 void
1698 {
1699 auto properties = dem_parameters.lagrangian_physical_properties;
1700
1701 n_particle_types = properties.particle_type_number;
1708 this->thermal_conductivity_gas = properties.thermal_conductivity_gas;
1709
1710 for (unsigned int i = 0; i < n_particle_types; ++i)
1711 {
1712 const double real_youngs_modulus_i =
1713 properties.real_youngs_modulus_particle.at(i);
1714 const double poisson_ratio_i = properties.poisson_ratio_particle.at(i);
1715 const double surface_roughness_i =
1716 properties.surface_roughness_particle.at(i);
1717 const double surface_slope_i = properties.surface_slope_particle.at(i);
1718 const double microhardness_i = properties.microhardness_particle.at(i);
1719 const double thermal_accommodation_i =
1720 properties.thermal_accommodation_particle.at(i);
1721
1722
1724 properties.thermal_conductivity_particle.at(i);
1725
1726 for (unsigned int j = 0; j < n_particle_types; ++j)
1727 {
1728 const unsigned int k = i * n_particle_types + j;
1729
1730 const double real_youngs_modulus_j =
1731 properties.real_youngs_modulus_particle.at(j);
1732 const double poisson_ratio_j =
1733 properties.poisson_ratio_particle.at(j);
1734 const double surface_roughness_j =
1735 properties.surface_roughness_particle.at(j);
1736 const double surface_slope_j =
1737 properties.surface_slope_particle.at(j);
1738 const double microhardness_j =
1739 properties.microhardness_particle.at(j);
1740 const double thermal_accommodation_j =
1741 properties.thermal_accommodation_particle.at(j);
1742
1744 (real_youngs_modulus_i * real_youngs_modulus_j) /
1745 ((real_youngs_modulus_j *
1746 (1.0 - poisson_ratio_i * poisson_ratio_i)) +
1747 (real_youngs_modulus_i *
1748 (1.0 - poisson_ratio_j * poisson_ratio_j)) +
1749 DBL_MIN);
1751 sqrt(surface_roughness_i * surface_roughness_i +
1752 surface_roughness_j * surface_roughness_j);
1753 this->equivalent_surface_slope[k] =
1754 sqrt(surface_slope_i * surface_slope_i +
1755 surface_slope_j * surface_slope_j);
1756 this->effective_microhardness[k] =
1757 harmonic_mean(microhardness_i, microhardness_j);
1758 this->gas_parameter_m[k] =
1759 ((2. - thermal_accommodation_i) / thermal_accommodation_i +
1760 (2. - thermal_accommodation_j) / thermal_accommodation_j) *
1761 (2. * properties.specific_heats_ratio_gas) /
1762 (1. + properties.specific_heats_ratio_gas) *
1763 properties.molecular_mean_free_path_gas /
1764 (properties.dynamic_viscosity_gas * properties.specific_heat_gas /
1765 properties.thermal_conductivity_gas);
1766 }
1767 }
1768 }
1769
1770 /**
1771 * @brief Execute the contact calculation step for the particle-particle
1772 * contact according to the contact type
1773 *
1774 * @param[in] adjacent_particles_list Container of the adjacent particles of a
1775 * particle.
1776 * @param[in] dt DEM time step.
1777 * @param[out] contact_outcome Interaction outcomes.
1778 */
1779 template <ContactType contact_type, typename ContactInfoContainer>
1780 inline void
1782 ContactInfoContainer &adjacent_particles_list,
1783 const double dt,
1785 {
1786 // No contact calculation if no adjacent particles
1787 if (adjacent_particles_list.second_particles.empty())
1788 return;
1789
1790 // Define local variables which will be used within the contact calculation
1791 Tensor<1, 3> normal_unit_vector;
1792 Tensor<1, 3> normal_force;
1793 Tensor<1, 3> tangential_force;
1794 Tensor<1, 3> particle_one_tangential_torque;
1795 Tensor<1, 3> particle_two_tangential_torque;
1796 Tensor<1, 3> rolling_resistance_torque;
1797 double normal_relative_velocity_value;
1798 Tensor<1, 3> tangential_relative_velocity;
1799
1800 // Gather information about particle 1 and set it up. The iterator to
1801 // particle 1 is shared by all its contacts and stored once in the adjacency
1802 // value.
1803 auto particle_one = adjacent_particles_list.particle_one;
1804 auto particle_one_properties = particle_one->get_properties();
1805
1806 types::particle_index particle_one_id = particle_one->get_local_index();
1807 Tensor<1, 3> &particle_one_torque = contact_outcome.torque[particle_one_id];
1808 Tensor<1, 3> &particle_one_force = contact_outcome.force[particle_one_id];
1809
1810 // Fix particle one location for 2d and 3d
1811 Point<3> particle_one_location = get_location(particle_one);
1812
1813 for (auto &&contact_info :
1814 adjacent_particles_list.second_particles | boost::adaptors::map_values)
1815 {
1816 // Getting information (location and properties) of particle 2 in
1817 // contact with particle 1
1818 auto particle_two = contact_info.particle_two;
1819 auto particle_two_properties = particle_two->get_properties();
1820
1821 // Get particle 2 location
1822 Point<3> particle_two_location;
1823 if constexpr (contact_type == ContactType::local_particle_particle ||
1825 {
1826 particle_two_location = get_location(particle_two);
1827 }
1828
1829 // Get particle 2 periodic location.
1830 if constexpr (contact_type ==
1832 contact_type ==
1834 contact_type ==
1836 {
1837 particle_two_location =
1838 get_periodic_location(particle_two, contact_info.periodic_offset);
1839 }
1840
1841 // Calculation of normal overlap
1842 double normal_overlap =
1843 0.5 * (particle_one_properties[PropertiesIndex::dp] +
1844 particle_two_properties[PropertiesIndex::dp]) -
1845 particle_one_location.distance(particle_two_location);
1846
1847 // Get the threshold distance for contact force, this is useful for
1848 // non-contact cohesive force models such as the DMT.
1849 const double force_calculation_threshold_distance =
1851
1852 if (normal_overlap > force_calculation_threshold_distance)
1853 {
1854 // Update of contact information and calculation of contact force
1855 // are the same for all local-local and local-ghost contact.
1856 // However, they are based on particle two for ghost-local periodic
1857 // contact, where particle one is the ghost particle, so the order
1858 // of particles given to the function is reversed.
1859 if constexpr (contact_type ==
1861 contact_type ==
1863 contact_type ==
1865 contact_type ==
1867 {
1868 // Update all the information
1869 this->update_contact_information(contact_info,
1870 tangential_relative_velocity,
1871 normal_relative_velocity_value,
1872 normal_unit_vector,
1873 particle_one_properties,
1874 particle_two_properties,
1875 particle_one_location,
1876 particle_two_location,
1877 dt);
1878
1879 // Calculation of the contact force
1880 this->calculate_contact(contact_info,
1881 tangential_relative_velocity,
1882 normal_relative_velocity_value,
1883 normal_unit_vector,
1884 normal_overlap,
1885 dt,
1886 particle_one_properties,
1887 particle_two_properties,
1888 normal_force,
1889 tangential_force,
1890 particle_one_tangential_torque,
1891 particle_two_tangential_torque,
1892 rolling_resistance_torque);
1893 }
1894
1895 if constexpr (contact_type ==
1897 {
1898 // In ghost_local periodic contacts, particle one and two are
1899 // swapped when calling the update_contact_information and the
1900 // calculate_contact. This is because the first particle
1901 // received by these functions
1902 // should always be a local particle. In this case, since this
1903 // is a ghost_local container, particle_two is the local
1904 // particle and particle_one is a ghost particle.
1905 // Update all the information
1906 this->update_contact_information(contact_info,
1907 tangential_relative_velocity,
1908 normal_relative_velocity_value,
1909 normal_unit_vector,
1910 particle_two_properties,
1911 particle_one_properties,
1912 particle_two_location,
1913 particle_one_location,
1914 dt);
1915
1916 // Calculation of the contact force
1917 this->calculate_contact(contact_info,
1918 tangential_relative_velocity,
1919 normal_relative_velocity_value,
1920 normal_unit_vector,
1921 normal_overlap,
1922 dt,
1923 particle_two_properties,
1924 particle_one_properties,
1925 normal_force,
1926 tangential_force,
1927 particle_two_tangential_torque,
1928 particle_one_tangential_torque,
1929 rolling_resistance_torque);
1930 }
1931
1932 // Apply the calculated forces and torques on both particles
1933 // of the pair for local-local contacts
1934 if constexpr (contact_type ==
1936 contact_type ==
1938 {
1939 types::particle_index particle_two_id =
1940 particle_two->get_local_index();
1941
1942 Tensor<1, 3> &particle_two_torque =
1943 contact_outcome.torque[particle_two_id];
1944 Tensor<1, 3> &particle_two_force =
1945 contact_outcome.force[particle_two_id];
1946
1948 normal_force,
1949 tangential_force,
1950 particle_one_tangential_torque,
1951 particle_two_tangential_torque,
1952 rolling_resistance_torque,
1953 particle_one_torque,
1954 particle_two_torque,
1955 particle_one_force,
1956 particle_two_force);
1957 }
1958
1959 // Apply the calculated forces and torques only on the local
1960 // particle of the pair for local-ghost contacts
1961 if constexpr (contact_type ==
1964 {
1966 normal_force,
1967 tangential_force,
1968 particle_one_tangential_torque,
1969 rolling_resistance_torque,
1970 particle_one_torque,
1971 particle_one_force);
1972 }
1973
1974 // Apply the calculated forces and torques only on the local
1975 // particle of the pair for ghost-local contacts
1976 if constexpr (contact_type ==
1978 {
1979 types::particle_index particle_two_id =
1980 particle_two->get_local_index();
1981
1982 Tensor<1, 3> &particle_two_torque =
1983 contact_outcome.torque[particle_two_id];
1984 Tensor<1, 3> &particle_two_force =
1985 contact_outcome.force[particle_two_id];
1986
1988 normal_force,
1989 tangential_force,
1990 particle_two_tangential_torque,
1991 rolling_resistance_torque,
1992 particle_two_torque,
1993 particle_two_force);
1994 }
1995 }
1996 else
1997 {
1998 // If the adjacent pair is not in contact anymore, only the
1999 // tangential displacement is set to zero
2000 contact_info.tangential_displacement.clear();
2001 contact_info.rolling_resistance_spring_torque.clear();
2002 }
2003
2005 {
2006 if (normal_overlap > 0)
2007 {
2008 const unsigned int particle_one_type =
2009 static_cast<unsigned int>(
2010 particle_one_properties[PropertiesIndex::type]);
2011 const unsigned int particle_two_type =
2012 static_cast<unsigned int>(
2013 particle_two_properties[PropertiesIndex::type]);
2014 const unsigned int pair_index =
2015 vec_particle_type_index(particle_one_type, particle_two_type);
2016 const double temperature_one =
2017 particle_one_properties[PropertiesIndex::T];
2018 const double temperature_two =
2019 particle_two_properties[PropertiesIndex::T];
2020 types::particle_index particle_two_id =
2021 particle_two->get_local_index();
2022 double &particle_one_heat_transfer_rate =
2023 contact_outcome.heat_transfer_rate[particle_one_id];
2024 double &particle_two_heat_transfer_rate =
2025 contact_outcome.heat_transfer_rate[particle_two_id];
2026
2027 double thermal_conductance;
2029 0.5 * particle_one_properties[PropertiesIndex::dp],
2030 0.5 * particle_two_properties[PropertiesIndex::dp],
2031 this->effective_youngs_modulus[pair_index],
2032 this->effective_real_youngs_modulus[pair_index],
2033 this->equivalent_surface_roughness[pair_index],
2034 this->equivalent_surface_slope[pair_index],
2035 this->effective_microhardness[pair_index],
2036 this->thermal_conductivity_particle[particle_one_type],
2037 this->thermal_conductivity_particle[particle_two_type],
2039 this->gas_parameter_m[pair_index],
2040 normal_overlap,
2041 normal_force.norm(),
2042 thermal_conductance);
2043
2044 // Apply the heat transfer to both particles
2045 // of the pair for local-local contacts
2046 if constexpr (contact_type ==
2048 contact_type ==
2050 {
2052 temperature_one,
2053 temperature_two,
2054 thermal_conductance,
2055 particle_one_heat_transfer_rate,
2056 particle_two_heat_transfer_rate);
2057 }
2058
2059 // Apply the heat transfer only to the local
2060 // particle of the pair for local-ghost contacts
2061 if constexpr (contact_type ==
2063 contact_type ==
2065 {
2067 temperature_one,
2068 temperature_two,
2069 thermal_conductance,
2070 particle_one_heat_transfer_rate);
2071 }
2072
2073 // Apply the heat transfer only to the local
2074 // particle of the pair for ghost-local contacts
2075 if constexpr (contact_type ==
2076 ContactType::
2077 ghost_local_periodic_particle_particle)
2078 {
2080 temperature_two,
2081 temperature_one,
2082 thermal_conductance,
2083 particle_two_heat_transfer_rate);
2084 }
2085 }
2086 }
2087 }
2088 }
2089
2090 // Members of the class
2091 // Contact model parameter. It is calculated in the constructor for
2092 // different combinations of particle types. For different combinations, a
2093 // map of map is used to store this variable
2094 unsigned int n_particle_types;
2095 std::vector<double> effective_youngs_modulus;
2097 std::vector<double> effective_shear_modulus;
2102 std::vector<double> effective_surface_energy;
2103 std::vector<double> effective_hamaker_constant;
2104 std::vector<double> model_parameter_beta;
2107 std::vector<double> equivalent_surface_roughness;
2108 std::vector<double> equivalent_surface_slope;
2109 std::vector<double> effective_microhardness;
2111 std::vector<double> gas_parameter_m;
2113};
2114
2115#endif
double harmonic_mean(const double &value_one, const double &value_two)
Handles all the parameters declared in the parameter handler file.
Parameters::Lagrangian::LagrangianPhysicalProperties lagrangian_physical_properties
Class where the outcomes of particle-particle interactions are stored.
std::vector< Tensor< 1, 3 > > force
std::vector< Tensor< 1, 3 > > torque
Base class for the particle-particle contact force models This class does not implement any of the mo...
unsigned int get_number_of_contacts() const
Return the number of contacts that occurred in the present pseudo-time step when using the packed ins...
void reset_number_of_contacts()
Reset the counter of number of contacts for the next pseudo-time step.
void set_periodic_offset(const Tensor< 1, dim > &offset, const types::boundary_id boundary_id)
Set the distance between a principal periodic boundary pb0 (with mesh ID boundary_id) and its associa...
virtual void calculate_particle_particle_contact(typename DEM::dem_data_structures< dim >::adjacent_particle_pairs &local_adjacent_particles, typename DEM::dem_data_structures< dim >::adjacent_particle_pairs &ghost_adjacent_particles, typename DEM::dem_data_structures< dim >::periodic_adjacent_particle_pairs &local_local_periodic_adjacent_particles, typename DEM::dem_data_structures< dim >::periodic_adjacent_particle_pairs &local_ghost_periodic_adjacent_particles, typename DEM::dem_data_structures< dim >::periodic_adjacent_particle_pairs &ghost_local_periodic_adjacent_particles, const double dt, ParticleInteractionOutcomes< PropertiesIndex > &contact_outcome)=0
Calculate the contact outcomes using the contact pair information obtained in the fine search and phy...
std::unordered_map< types::boundary_id, Tensor< 1, dim > > periodic_offsets
Map storing offset distance between periodic boundaries, keyed by the boundary ID (pb0)....
std::vector< double > effective_coefficient_of_rolling_friction
Point< 3 > get_periodic_location(const Particles::ParticleIterator< dim > &particle, const Tensor< 1, dim > &periodic_offset) &
Get the shifted location of a particle on a periodic boundary.
void calculate_hertz_mindlin_limit_force_contact(particle_particle_contact_info< dim > &contact_info, const Tensor< 1, 3 > &tangential_relative_velocity, const double normal_relative_velocity_value, const Tensor< 1, 3 > &normal_unit_vector, const double normal_overlap, const double dt, const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties, Tensor< 1, 3 > &normal_force, Tensor< 1, 3 > &tangential_force, Tensor< 1, 3 > &particle_one_tangential_torque, Tensor< 1, 3 > &particle_two_tangential_torque, Tensor< 1, 3 > &rolling_resistance_torque)
Calculate the particle-particle non-linear contact force and torque based on the updated values in co...
void execute_contact_calculation(ContactInfoContainer &adjacent_particles_list, const double dt, ParticleInteractionOutcomes< PropertiesIndex > &contact_outcome)
Execute the contact calculation step for the particle-particle contact according to the contact type.
void calculate_DMT_contact(particle_particle_contact_info< dim > &contact_info, const Tensor< 1, 3 > &tangential_relative_velocity, const double normal_relative_velocity_value, const Tensor< 1, 3 > &normal_unit_vector, const double normal_overlap, const double dt, const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties, Tensor< 1, 3 > &normal_force, Tensor< 1, 3 > &tangential_force, Tensor< 1, 3 > &particle_one_tangential_torque, Tensor< 1, 3 > &particle_two_tangential_torque, Tensor< 1, 3 > &rolling_resistance_torque)
Calculate the particle-particle contact and cohesive forces and contact torque based on the updated v...
void calculate_hertz_JKR_contact(particle_particle_contact_info< dim > &contact_info, const Tensor< 1, 3 > &tangential_relative_velocity, const double normal_relative_velocity_value, const Tensor< 1, 3 > &normal_unit_vector, const double normal_overlap, const double dt, const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties, Tensor< 1, 3 > &normal_force, Tensor< 1, 3 > &tangential_force, Tensor< 1, 3 > &particle_one_tangential_torque, Tensor< 1, 3 > &particle_two_tangential_torque, Tensor< 1, 3 > &rolling_resistance_torque)
Calculate the particle-particle contact and cohesive forces and contact torque based on the updated v...
void calculate_contact(particle_particle_contact_info< dim > &contact_info, const Tensor< 1, 3 > &tangential_relative_velocity, const double normal_relative_velocity_value, const Tensor< 1, 3 > &normal_unit_vector, const double normal_overlap, const double dt, const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties, Tensor< 1, 3 > &normal_force, Tensor< 1, 3 > &tangential_force, Tensor< 1, 3 > &particle_one_tangential_torque, Tensor< 1, 3 > &particle_two_tangential_torque, Tensor< 1, 3 > &rolling_resistance_torque)
Calculate the particle-particle contact force and torque according to the contact model.
double get_force_calculation_threshold_distance()
Calculate the minimum overlap at which particle-particle forces are computed.
void set_multiphysic_properties(const DEMSolverParameters< dim > &dem_parameters)
Set every container needed to carry the heat transfer rate calculation.
std::tuple< double, double > find_effective_radius_and_mass(const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties)
Calculate the effective mass and the effective radius of the particle pair.
void calculate_hertz_mindlin_limit_overlap_contact(particle_particle_contact_info< dim > &contact_info, const Tensor< 1, 3 > &tangential_relative_velocity, const double normal_relative_velocity_value, const Tensor< 1, 3 > &normal_unit_vector, const double normal_overlap, const double dt, const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties, Tensor< 1, 3 > &normal_force, Tensor< 1, 3 > &tangential_force, Tensor< 1, 3 > &particle_one_tangential_torque, Tensor< 1, 3 > &particle_two_tangential_torque, Tensor< 1, 3 > &rolling_resistance_torque)
Calculate the particle-particle non-linear contact force and torque based on the updated values in co...
Point< 3 > get_location(const Particles::ParticleIterator< dim > &particle) &
Get the location of the particle.
void calculate_linear_contact(particle_particle_contact_info< dim > &contact_info, const Tensor< 1, 3 > &tangential_relative_velocity, const double normal_relative_velocity_value, const Tensor< 1, 3 > &normal_unit_vector, const double normal_overlap, const double dt, const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties, Tensor< 1, 3 > &normal_force, Tensor< 1, 3 > &tangential_force, Tensor< 1, 3 > &particle_one_tangential_torque, Tensor< 1, 3 > &particle_two_tangential_torque, Tensor< 1, 3 > &rolling_resistance_torque)
Calculate the particle-particle linear contact force and torque based on the updated values in contac...
virtual void calculate_particle_particle_contact(typename DEM::dem_data_structures< dim >::adjacent_particle_pairs &local_adjacent_particles, typename DEM::dem_data_structures< dim >::adjacent_particle_pairs &ghost_adjacent_particles, typename DEM::dem_data_structures< dim >::periodic_adjacent_particle_pairs &local_local_periodic_adjacent_particles, typename DEM::dem_data_structures< dim >::periodic_adjacent_particle_pairs &local_ghost_periodic_adjacent_particles, typename DEM::dem_data_structures< dim >::periodic_adjacent_particle_pairs &ghost_local_periodic_adjacent_particles, const double dt, ParticleInteractionOutcomes< PropertiesIndex > &contact_outcome) override
Calculate the contact outcomes using the contact pair information obtained in the fine search and phy...
void calculate_hertz_contact(particle_particle_contact_info< dim > &contact_info, const Tensor< 1, 3 > &, const double normal_relative_velocity_value, const Tensor< 1, 3 > &normal_unit_vector, const double normal_overlap, const double dt, const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties, Tensor< 1, 3 > &normal_force, Tensor< 1, 3 > &tangential_force, Tensor< 1, 3 > &particle_one_tangential_torque, Tensor< 1, 3 > &particle_two_tangential_torque, Tensor< 1, 3 > &rolling_resistance_torque)
Calculate the particle-particle non-linear contact force and torque based on the updated values in co...
void calculate_shift_displacement(const Tensor< 1, 3 > &normal_unit_vector, const double normal_overlap, const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties, Tensor< 1, 3 > &normal_displacement)
Calculate the displacement that separates two overlapping particles. This "contact force" model is us...
std::vector< double > effective_rolling_viscous_damping_coefficient
void update_contact_information(particle_particle_contact_info< dim > &contact_info, Tensor< 1, 3 > &tangential_relative_velocity, double &normal_relative_velocity_value, Tensor< 1, 3 > &normal_unit_vector, const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties, const Point< 3 > &particle_one_location, const Point< 3 > &particle_two_location, const double dt)
Update the contact pair information for all contact force calculations.
ParticleParticleContactForce(const DEMSolverParameters< dim > &dem_parameters)
Tensor< 1, 3 > calculate_rolling_resistance_torque(const double effective_radius, const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties, const double rolling_friction_coeff, const double rolling_viscous_damping_coeff, const double dt, const double normal_spring_constant, const double normal_force_norm, const Tensor< 1, 3 > &normal_unit_vector, Tensor< 1, 3 > &cumulative_rolling_resistance_spring_torque)
Calculate the rolling resistance torque acting on the particles according to the rolling resistance m...
unsigned int vec_particle_type_index(const unsigned int i, const unsigned int j) const
Return the index to access the property vectors for a given combination of particle types.
void set_effective_properties(const DEMSolverParameters< dim > &dem_parameters)
Set every container needed to carry the particle-particle force calculation.
void apply_force_and_torque_on_local_particles(const Tensor< 1, 3 > &normal_force, const Tensor< 1, 3 > &tangential_force, const Tensor< 1, 3 > &particle_one_tangential_torque, const Tensor< 1, 3 > &particle_two_tangential_torque, const Tensor< 1, 3 > &rolling_resistance_torque, Tensor< 1, 3 > &particle_one_torque, Tensor< 1, 3 > &particle_two_torque, Tensor< 1, 3 > &particle_one_force, Tensor< 1, 3 > &particle_two_force)
Apply the calculated force and torque on the local-local particle pair in contact.
virtual ~ParticleParticleContactForce()=default
void apply_force_and_torque_on_single_local_particle(const Tensor< 1, 3 > &normal_force, const Tensor< 1, 3 > &tangential_force, const Tensor< 1, 3 > &particle_one_tangential_torque, const Tensor< 1, 3 > &rolling_resistance_torque, Tensor< 1, 3 > &particle_one_torque, Tensor< 1, 3 > &particle_one_force)
Apply the calculated force and torque on the local-ghost particle pair in contact....
@ ghost_periodic_particle_particle
@ ghost_particle_particle
@ local_particle_particle
@ ghost_local_periodic_particle_particle
@ local_periodic_particle_particle
constexpr bool has_thermal_properties
Whether a properties index set carries thermal properties.
ParticleParticleContactForceModel
Contact force model for particle-particle interactions.
@ hertz_JKR
Hertz model with Johnson-Kendall-Roberts cohesive force.
@ hertz_mindlin_limit_force
Hertz-Mindlin model with a limitation on tangential force.
RollingResistanceMethod
Method used to compute the rolling resistance torque.
@ epsd
Elastic-plastic spring-dashpot.
@ viscous
Viscous rolling resistance.
@ constant
Constant rolling resistance.
@ none
No rolling resistance.
void apply_heat_transfer_on_local_particles(const double temperature_one, const double temperature_two, const double thermal_conductance, double &particle_one_heat_transfer_rate, double &particle_two_heat_transfer_rate)
Apply the heat transfer to a local-local particle pair in contact.
void calculate_contact_thermal_conductance(const double radius_one, const double radius_two, const double effective_youngs_modulus, const double effective_real_youngs_modulus, const double equivalent_surface_roughness, const double equivalent_surface_slope, const double effective_microhardness, const double thermal_conductivity_one, const double thermal_conductivity_two, const double thermal_conductivity_gas, const double gas_parameter_m, const double normal_overlap, const double normal_force_norm, double &thermal_conductance)
Calculate the total thermal conductance for particle-particle or particle-wall contacts.
void apply_heat_transfer_on_single_local_particle(const double temperature_one, const double temperature_two, const double thermal_conductance, double &particle_one_heat_transfer_rate)
Apply the heat transfer to a local particle. This function is used for local-ghost particle pairs or ...
Tensor< 1, 3 > viscous_rolling_resistance_torque(const double effective_r, const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties, const double effective_rolling_friction_coefficient, const double normal_force_norm, const Tensor< 1, 3 > &normal_unit_vector)
Calculation of the viscous rolling resistance torque model using the information obtained from the fi...
Tensor< 1, 3 > epsd_rolling_resistance_torque(const double effective_r, const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties, const double effective_rolling_friction_coefficient, const double effective_rolling_viscous_damping_coefficient, const double f_coefficient, const double normal_force_norm, const double dt, const double normal_spring_constant, const Tensor< 1, 3 > &normal_unit_vector, Tensor< 1, 3 > &cumulative_rolling_resistance_spring_torque)
Tensor< 1, 3 > constant_rolling_resistance_torque(const double effective_r, const ArrayView< const double > &particle_one_properties, const ArrayView< const double > &particle_two_properties, const double effective_rolling_friction_coefficient, const double normal_force_norm)
Calculation of the constant rolling resistance torque model using the information obtained from the f...
Tensor< 1, 3 > no_rolling_resistance_torque()
No rolling resistance torque model. No calculation is being done with this model.
ankerl::unordered_dense::map< types::particle_index, periodic_adjacent_particle_pairs_value > periodic_adjacent_particle_pairs
ankerl::unordered_dense::map< types::particle_index, adjacent_particle_pairs_value > adjacent_particle_pairs
Handle the information related to the calculation of the particle-particle contact force....
Tensor< 1, 3 > tangential_displacement
Tensor< 1, 3 > rolling_resistance_spring_torque
Point< 3 > point_nd_to_3d(const Point< dim > &point)