Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
particle_wall_contact_force.templates.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_wall_contact_force_templates_h
5#define lethe_particle_wall_contact_force_templates_h
6
7// This file contains the definitions of the member functions of
8// ParticleWallContactForce that are not defined in the class body.
9// They are in a header rather than in a source file because the explicit
10// instantiations of the class are distributed over two source files
11// (particle_wall_contact_force_2d.cc and
12// particle_wall_contact_force_3d.cc) so that they are compiled in parallel.
13// Only these source files should include this header; everything else should
14// include particle_wall_contact_force.h.
15
17
18#include <dem/contact_type.h>
21
22#include <algorithm>
23#include <ranges>
24#include <vector>
25
26template <
27 int dim,
28 typename PropertiesIndex,
33 contact_model,
34 rolling_friction_model>::
35 ParticleWallContactForce(const DEMSolverParameters<dim> &dem_parameters)
36 : dmt_cut_off_threshold(dem_parameters.model_parameters.dmt_cut_off_threshold)
37 , f_coefficient_epsd(dem_parameters.model_parameters.f_coefficient_epsd)
38{
39 set_effective_properties(dem_parameters);
41 {
42 set_multiphysic_properties(dem_parameters);
43 }
44}
45
46template <
47 int dim,
48 typename PropertiesIndex,
51void
53 PropertiesIndex,
54 contact_model,
55 rolling_friction_model>::
56 calculate_particle_wall_contact(
58 &particle_wall_pairs_in_contact,
59 const double dt,
61{
62 // Getting the threshold distance for contact force, this is useful
63 // for non-contact cohesive force models such as the DMT.
64 const double force_calculation_threshold_distance =
66
67 // Looping over all the active particles in particle-wall pairs
68 for (auto &&pairs_in_contact_content :
69 particle_wall_pairs_in_contact | boost::adaptors::map_values)
70 {
71 // Iterating over a map which contains the required information for
72 // calculation of the contact force for each particle
73 for (auto &&contact_info :
74 pairs_in_contact_content | boost::adaptors::map_values)
75 {
76 // Defining local variables which will be used within the contact
77 // calculation
78 auto particle = contact_info.particle;
79 auto particle_properties = particle->get_properties();
80 Point<3> point_on_boundary = contact_info.point_on_boundary;
81 // Normal vector from the wall to the particle
82 Tensor<1, 3> normal_vector = contact_info.normal_vector;
83
84 // Getting particle 3d location
85 Point<3> particle_location_3d = get_location(particle);
86
87 // Defining a tensor which connects the point_on_boundary to the
88 // center of particle
89 Tensor<1, 3> point_to_particle_vector =
90 particle_location_3d - point_on_boundary;
91
92 // Finding the projected vector on the normal vector of the boundary
93 Tensor<1, 3> projected_vector =
94 this->find_projection(point_to_particle_vector, normal_vector);
95
96 // Calculating the particle-wall distance using the projected vector
97 double normal_overlap =
98 ((particle_properties[PropertiesIndex::dp]) * 0.5) -
99 (projected_vector.norm());
100
101 if (normal_overlap > force_calculation_threshold_distance)
102 {
103 Tensor<1, 3> tangential_relative_velocity;
104 double normal_relative_velocity_value;
105 Tensor<1, 3> normal_force;
106 Tensor<1, 3> tangential_force;
107 Tensor<1, 3> tangential_torque;
108 Tensor<1, 3> rolling_resistance_torque;
109
110 // Updating contact information
111 this->update_contact_information(contact_info,
112 tangential_relative_velocity,
113 normal_relative_velocity_value,
114 particle_location_3d,
115 particle_properties,
116 dt);
117
118 // Calculating contact force and torque
119 this->calculate_contact(contact_info,
120 tangential_relative_velocity,
121 normal_relative_velocity_value,
122 normal_overlap,
123 dt,
124 particle_properties,
125 normal_force,
126 tangential_force,
127 tangential_torque,
128 rolling_resistance_torque);
129
130 // Applying the calculated forces and torques on the particle
131 types::particle_index particle_index =
132 particle->get_local_index();
133 Tensor<1, 3> &particle_torque =
134 contact_outcome.torque[particle_index];
135 Tensor<1, 3> &particle_force =
136 contact_outcome.force[particle_index];
137
138 this->apply_force_and_torque(normal_force,
139 tangential_force,
140 tangential_torque,
141 rolling_resistance_torque,
142 particle_torque,
143 particle_force);
144
146 {
147 // Multiphysics properties of the wall in contact
149 thermal_boundary_type =
150 this->get_thermal_boundary_type(contact_info.boundary_id);
151
152 if ((thermal_boundary_type !=
154 adiabatic) &&
155 (normal_overlap > 0))
156 {
157 const unsigned int particle_type =
158 static_cast<unsigned int>(
159 particle_properties[PropertiesIndex::type]);
160 const double temperature_particle =
161 particle_properties[PropertiesIndex::T];
162 double &particle_heat_transfer_rate =
163 contact_outcome
164 .heat_transfer_rate[particle->get_local_index()];
165 double thermal_conductance;
166
169 0.5 * particle_properties[PropertiesIndex::dp],
170 0,
171 this->effective_youngs_modulus[particle_type],
172 this->effective_real_youngs_modulus[particle_type],
173 this->equivalent_surface_roughness[particle_type],
174 this->equivalent_surface_slope[particle_type],
175 this->effective_microhardness[particle_type],
176 this->particle_thermal_conductivity[particle_type],
179 this->gas_parameter_m[particle_type],
180 normal_overlap,
181 normal_force.norm(),
182 thermal_conductance);
183
184 // The temperature of the wall is evaluated at the
185 // contact point, which is the projection of the center
186 // of the particle on the wall.
187 const Point<3> contact_point =
188 particle_location_3d - projected_vector;
189 const double temperature_wall =
190 this->get_boundary_temperature(contact_info.boundary_id,
191 contact_point);
192
193 // Apply the heat transfer to the particle
195 temperature_particle,
196 temperature_wall,
197 thermal_conductance,
198 particle_heat_transfer_rate);
199 }
200 }
201 }
202 else // If there is no contact (or interaction), we need to clear the
203 // tangential displacement and rolling resistance torque
204 {
205 contact_info.tangential_displacement.clear();
206 contact_info.rolling_resistance_spring_torque.clear();
207 }
208 }
209 }
210}
211
212template <
213 int dim,
214 typename PropertiesIndex,
217void
219 PropertiesIndex,
220 contact_model,
221 rolling_friction_model>::
222 calculate_particle_solid_object_contact(
224 dim>::particle_floating_mesh_potentially_in_contact
225 &particle_floating_mesh_potentially_in_contact,
226 const double dt,
227 const std::vector<std::shared_ptr<SerialSolid<dim - 1, dim>>> &solids,
229{
230 // Get the threshold distance for contact force, this is
231 // useful for non-contact cohesive force models such as
232 // the DMT.
233 const double force_calculation_threshold_distance =
235
236 // Initiate containers
237 std::vector<Point<dim>> triangle(this->vertices_per_triangle);
238
239 // Ensure there is one persistent contact record per solid object, reused
240 // (and cleared) every call instead of being reallocated from scratch each
241 // DEM timestep.
242 if (solid_contact_records.size() != solids.size())
243 solid_contact_records.resize(solids.size());
244
245 // Iterating over the solid objects
246 for (unsigned int solid_counter = 0; solid_counter < solids.size();
247 ++solid_counter)
248 {
249 // Extract the neighboring cell maps of this solid objects
250 const auto &[this_solid_es_neighbors, this_solid_vs_neighbors] =
251 solids[solid_counter]->get_neighbors_maps();
252
253 // For each solid surface, we reuse a persistent map, called the
254 // contact_record, used to store every contact. The key of that map is
255 // the particle local ID. The value is a vector of struct storing the
256 // required information to compute the contact force later on.
257 // The information includes:
258 // 1. The triangle cell with which the contact is occurring,
259 // 2. The normal overlap,
260 // 3. The type of contact (face, edge or vertex)
261 // 4. The contact info associated.
262 particle_triangle_contact_record &contact_record =
263 solid_contact_records[solid_counter];
264 contact_record.clear();
265
267 dim>::particle_triangle_cell_from_mesh_potentially_in_contact
268 &particle_floating_mesh_potential_contact_pair =
269 particle_floating_mesh_potentially_in_contact[solid_counter];
270
271 // Reserve for an upper bound on the number of distinct particles this
272 // solid's contact record will hold (the same particle may appear near
273 // several triangles, so this sum over-counts, but never under-counts),
274 // so it is not repeatedly rehashed while accumulating contacts across
275 // triangles below.
276 std::size_t total_candidate_count = 0;
277 for (const auto &triangle_entry :
278 particle_floating_mesh_potential_contact_pair)
279 total_candidate_count += triangle_entry.second.size();
280 contact_record.reserve(total_candidate_count);
281
282 // Loop over every triangle of the solid object
283 for (auto &[triangle_cell_iterator, map_info] :
284 particle_floating_mesh_potential_contact_pair)
285 {
286 if (map_info.empty())
287 continue;
288
289 // Build triangle vector from the triangle cell vertices
290 for (unsigned int vertex = 0; vertex < this->vertices_per_triangle;
291 ++vertex)
292 triangle[vertex] = triangle_cell_iterator->vertex(vertex);
293
294 // Precompute this triangle's particle-independent geometric data
295 // (edge vectors, normal, fundamental-form coefficients) once, so
296 // it is not recomputed for every particle candidate below.
297 const auto triangle_data =
299
300 // Loop on every particle using their contact info
301 for (auto &&contact_info : map_info | boost::adaptors::map_values)
302 {
303 // Defining local variables which will be used to check the
304 // contact and to store it in the contact record
305 auto &particle = contact_info.particle;
306 auto particle_properties = particle->get_properties();
307 const double particle_radius =
308 0.5 * particle_properties[PropertiesIndex::dp];
309 const Point<dim> particle_location = particle->get_location();
310
311 // We check the contact between the triangle and the particle.
312 // The normal overlap exceeds the force calculation threshold
313 // distance only if the particle center is closer to the
314 // triangle than the cutoff distance given here.
315 auto particle_triangle_information =
317 triangle_data,
318 particle_location,
319 particle_radius - force_calculation_threshold_distance);
320 // If we are using the DMT model, a force may need to be
321 // calculated even if the particle and the triangle are not
322 // touching.
323
324 const auto &[pass_distance_check,
325 projection_point,
326 normal_vector,
327 contact_indicator] = particle_triangle_information;
328
329 // The particle is too far from the triangle, there is no force
330 // calculation.
331 if (!pass_distance_check)
332 {
333 clear_contact_info(contact_info);
334 continue;
335 }
336
337 const double particle_triangle_distance =
338 get_location(particle).distance(projection_point);
339
340 // Find normal overlap
341 const double normal_overlap =
342 particle_radius - particle_triangle_distance;
343
344 // The contact is potentially valid, thus we need to store
345 // it in the contact record.
346 if (normal_overlap > force_calculation_threshold_distance)
347 {
348 // Update information in the contact_info
349 contact_info.normal_vector = normal_vector;
350 contact_info.point_on_boundary = projection_point;
351 contact_info.boundary_id = solid_counter;
352
353 contact_record[particle->get_local_index()].emplace_back(
354 triangle_cell_iterator,
355 normal_overlap,
356 contact_indicator,
357 &contact_info);
358 }
359 else
360 clear_contact_info(contact_info);
361 }
362 }
363 // Every contact between this solid object and the particles are
364 // recorded. Now, we need to remove the invalid contacts from
365 // the records and compute the forces associated with the valid
366 // contacts.
367
368 // Loop on every particle / contact record
369 for (auto &[particle_index, this_contact_record] : contact_record)
370 {
371 // Loop on every contact in the contact record. Double contacts
372 // involve at least two contacts, so the loop stops once a single
373 // contact is left.
374 for (auto C1 = this_contact_record.begin();
375 this_contact_record.size() > 1 &&
376 C1 != this_contact_record.end();)
377 {
378 // Extract the information of C1
379 auto T1_cell = C1->triangle_cell;
380 auto contact_indicator_C1 = C1->contact_indicator;
381 particle_wall_contact_info<dim> &contact_info_C1 =
382 *C1->contact_info;
383
384 // Assigning the triangle neighboring list of T1;
385 const auto &T1_es_neighbors = this_solid_es_neighbors.at(T1_cell);
386 const auto &T1_vs_neighbors = this_solid_vs_neighbors.at(T1_cell);
387
388 // Initialize variables. We need to compare C1 to every other
389 // contact (C2) that was not compared yet.
390 bool erase_contact_1 = false;
391 auto C2 = std::next(C1);
392 while (C2 != this_contact_record.end())
393 {
394 // Extract the information of C2
395 auto T2_cell = C2->triangle_cell;
396 auto contact_indicator_C2 = C2->contact_indicator;
397 particle_wall_contact_info<dim> &contact_info_C2 =
398 *C2->contact_info;
399
400 // First, we check if both triangle are neighbors. If they
401 // are not neighbors, C1 and C2 are automatically valid.
402 // (Disconnected triangles)
403 if (std::ranges::find(T1_es_neighbors, T2_cell) ==
404 T1_es_neighbors.end() &&
405 std::ranges::find(T1_vs_neighbors, T2_cell) ==
406 T1_vs_neighbors.end())
407 {
408 ++C2;
409 continue;
410 }
411 // If both triangles are neighbors (connected), we need to
412 // check for double contacts.
413 // If C1 is a face contact
414 if (contact_indicator_C1 ==
416 face_contact)
417 {
418 // If C1 and C2 are both face contacts, they are both
419 // valid. This case can happen with either edge-sharing or
420 // vertex-sharing triangles that are non-coplanar.
421 if (contact_indicator_C2 ==
423 face_contact)
424 {
425 ++C2;
426 continue;
427 }
428 // If C1 is a face contact and C2 is an edge contact.
429 if (contact_indicator_C2 ==
431 edge_contact)
432 {
433 // If T1 and T2 are vertex-sharing, C1 and C2 are
434 // valid. This could happen with two concave
435 // triangles.
436 if (std::ranges::find(T1_vs_neighbors, T2_cell) !=
437 T1_vs_neighbors.end())
438 {
439 ++C2;
440 continue;
441 }
442 // Otherwise, C2 is invalid and is erased from the
443 // current contact record.
444 clear_contact_info(contact_info_C2);
445 C2 = this_contact_record.erase(C2);
446 continue;
447 }
448
449 // If C1 is a face contact and C2 is a vertex
450 // contact.
451 // C2 is always invalid.
452 clear_contact_info(contact_info_C2);
453 C2 = this_contact_record.erase(C2);
454 continue;
455 }
456
457 // If C1 is an edge contact.
458 if (contact_indicator_C1 ==
460 edge_contact)
461 {
462 // If C1 is an edge contact and C2 is a face contact.
463 if (contact_indicator_C2 ==
465 face_contact)
466 {
467 // C2 is valid.
468 // C1 is invalid if T1 and T2 are connected. We
469 // already checked at the beginning of the while
470 // loop that this is the case, thus we know that
471 // both triangles are connected at this location
472 // in the code.
473 erase_contact_1 = true;
474 break; // must exit the while loop
475 }
476 // If C1 and C2 are both edge contacts.
477 if (contact_indicator_C2 ==
479 edge_contact)
480 {
481 // C1 is always valid.
482 // C2 is invalid if T1 and T2 are edge-sharing.
483 // This case means that both contacts occur on the
484 // edge that is connecting both triangles.
485 if (std::ranges::find(T1_es_neighbors, T2_cell) !=
486 T1_es_neighbors.end())
487 {
488 clear_contact_info(contact_info_C2);
489 C2 = this_contact_record.erase(C2);
490 continue;
491 }
492 else
493 {
494 // If they are vertex-sharing, this means that
495 // each contact is occurring on two different
496 // edges. This is not a double contact, C2 is
497 // also valid.
498 ++C2;
499 continue;
500 }
501 }
502 }
503 // If C1 is a vertex contact
504 if (contact_indicator_C1 ==
506 vertex_contact)
507 {
508 // If C1 is a vertex contact and C2 is a face contact.
509 if (contact_indicator_C2 ==
511 face_contact)
512 {
513 // C2 is valid.
514 // C1 is invalid if T1 and T2 are connected. We
515 // already checked at the beginning of the while
516 // loop that this is the case, thus we know if we
517 // enter this "if" that both triangle are
518 // connected.
519 erase_contact_1 = true;
520 break; // must exit the while loop
521 }
522 // If C1 is a vertex contact and C2 is an edge
523 // contact.
524 if (contact_indicator_C2 ==
526 edge_contact)
527 {
528 // C2 is valid
529 // C1 is invalid if T1 and T2 are vertex-sharing.
530 // This case means that both contacts occur on the
531 // vertex that is connecting both triangles,
532 // thus C1 and C2 are double contacts.
533 if (std::ranges::find(T1_vs_neighbors, T2_cell) !=
534 T1_vs_neighbors.end())
535 {
536 erase_contact_1 = true;
537 break;
538 }
539 // Otherwise, C1 is valid.
540 ++C2;
541 continue;
542 }
543 // If C1 and C2 are vertex contacts,
544 if (contact_indicator_C2 ==
546 vertex_contact)
547 {
548 // C2 is invalid
549 clear_contact_info(contact_info_C2);
550 C2 = this_contact_record.erase(C2);
551 continue;
552 }
553 }
554 ++C2;
555 } // While loop
556
557 // Erase C1 from the contact record is marked as true.
558 if (erase_contact_1)
559 {
560 clear_contact_info(contact_info_C1);
561 C1 = this_contact_record.erase(C1);
562 continue; // skip increment; erase() already advanced
563 }
564 ++C1;
565 } // For loop
566
567 // At this point, every contact in the contact record are valid,
568 // thus we can compute and applied the force and torques.
569
570 // Get translational and rotational velocities and center of
571 // rotation of solid object
572 const Tensor<1, 3> translational_velocity =
573 solids[solid_counter]->get_translational_velocity();
574 const Tensor<1, 3> angular_velocity =
575 solids[solid_counter]->get_angular_velocity();
576 const Point<3> center_of_rotation =
577 solids[solid_counter]->get_center_of_rotation();
578
579 // Multiphysics properties
581 thermal_boundary_type =
582 solids[solid_counter]->get_thermal_boundary_type();
583
584 for (auto contact = this_contact_record.begin();
585 contact != this_contact_record.end();
586 ++contact)
587 {
588 // Extract the information of the contact
589 auto normal_overlap = contact->normal_overlap;
590 particle_wall_contact_info<dim> &contact_info =
591 *contact->contact_info;
592
593 // Defining local variables which will be used within the
594 // contact calculation
595 auto &particle = contact_info.particle;
596 auto particle_properties = particle->get_properties();
597 Point<3> particle_location_3d = get_location(particle);
598 Tensor<1, 3> normal_force;
599 Tensor<1, 3> tangential_force;
600 Tensor<1, 3> tangential_torque;
601 Tensor<1, 3> rolling_resistance_torque;
602 double normal_relative_velocity_value;
603 Tensor<1, 3> tangential_relative_velocity;
604
605 // Updating contact information
607 contact_info,
608 tangential_relative_velocity,
609 normal_relative_velocity_value,
610 particle_properties,
611 dt,
612 translational_velocity,
613 angular_velocity,
614 center_of_rotation.distance(particle_location_3d));
615
616 // Calculating contact force and torque
617 this->calculate_contact(contact_info,
618 tangential_relative_velocity,
619 normal_relative_velocity_value,
620 normal_overlap,
621 dt,
622 particle_properties,
623 normal_force,
624 tangential_force,
625 tangential_torque,
626 rolling_resistance_torque);
627
628 // Applying the calculated forces and torques on the particle
630 normal_force,
631 tangential_force,
632 tangential_torque,
633 rolling_resistance_torque,
634 contact_outcome.torque[particle_index],
635 contact_outcome.force[particle_index]);
637 {
638 if ((thermal_boundary_type !=
640 (normal_overlap > 0))
641 {
642 const unsigned int particle_type =
643 static_cast<unsigned int>(
644 particle_properties[PropertiesIndex::type]);
645 const double temperature_particle =
646 particle_properties[PropertiesIndex::T];
647 double &particle_heat_transfer_rate =
648 contact_outcome
649 .heat_transfer_rate[particle->get_local_index()];
650 double thermal_conductance;
651
654 0.5 * particle_properties[PropertiesIndex::dp],
655 0,
656 this->effective_youngs_modulus[particle_type],
657 this->effective_real_youngs_modulus[particle_type],
658 this->equivalent_surface_roughness[particle_type],
659 this->equivalent_surface_slope[particle_type],
660 this->effective_microhardness[particle_type],
661 this->particle_thermal_conductivity[particle_type],
664 this->gas_parameter_m[particle_type],
665 normal_overlap,
666 normal_force.norm(),
667 thermal_conductance);
668
669 const double temperature_wall =
670 solids[solid_counter]->get_temperature();
671
672 // Apply the heat transfer to the particle
674 temperature_particle,
675 temperature_wall,
676 thermal_conductance,
677 particle_heat_transfer_rate);
678 }
679 }
680 }
681 }
682 }
683}
684
685
686template <
687 int dim,
688 typename PropertiesIndex,
691void
693 PropertiesIndex,
694 contact_model,
695 rolling_friction_model>::
696 set_effective_properties(const DEMSolverParameters<dim> &dem_parameters)
697{
698 auto properties = dem_parameters.lagrangian_physical_properties;
699
700 n_particle_types = properties.particle_type_number;
710
711 // Initialize wall variables and boundary conditions
712 this->center_mass_container = dem_parameters.forces_torques.point_center_mass;
721
722 // Wall properties
723 const double wall_youngs_modulus = properties.youngs_modulus_wall;
724 const double wall_poisson_ratio = properties.poisson_ratio_wall;
725 const double wall_restitution_coefficient =
726 properties.restitution_coefficient_wall;
727 const double wall_friction_coefficient = properties.friction_coefficient_wall;
728 const double wall_rolling_friction_coefficient =
729 properties.rolling_friction_wall;
730 const double wall_rolling_viscous_damping =
731 properties.rolling_viscous_damping_wall;
732 const double wall_surface_energy = properties.surface_energy_wall;
733 const double wall_hamaker_constant = properties.hamaker_constant_wall;
734
735 for (unsigned int i = 0; i < n_particle_types; ++i)
736 {
737 // Particle properties
738 const double particle_youngs_modulus =
739 properties.youngs_modulus_particle.at(i);
740 const double particle_poisson_ratio =
741 properties.poisson_ratio_particle.at(i);
742 const double particle_restitution_coefficient =
743 properties.restitution_coefficient_particle.at(i);
744 const double particle_friction_coefficient =
745 properties.friction_coefficient_particle.at(i);
746 const double particle_rolling_friction_coefficient =
747 properties.rolling_friction_coefficient_particle.at(i);
748 const double particle_rolling_viscous_damping_coefficient =
749 properties.rolling_viscous_damping_coefficient_particle.at(i);
750 const double particle_surface_energy =
751 properties.surface_energy_particle.at(i);
752 const double particle_hamaker_constant =
753 properties.hamaker_constant_particle.at(i);
754
755 // Effective particle-wall properties.
756 this->effective_youngs_modulus[i] =
757 (particle_youngs_modulus * wall_youngs_modulus) /
758 (wall_youngs_modulus *
759 (1. - particle_poisson_ratio * particle_poisson_ratio) +
760 particle_youngs_modulus *
761 (1. - wall_poisson_ratio * wall_poisson_ratio) +
762 DBL_MIN);
763
764 this->effective_shear_modulus[i] =
765 (particle_youngs_modulus * wall_youngs_modulus) /
766 ((2. * wall_youngs_modulus * (2. - particle_poisson_ratio) *
767 (1. + particle_poisson_ratio)) +
768 (2. * particle_youngs_modulus * (2. - wall_poisson_ratio) *
769 (1. + wall_poisson_ratio)) +
770 DBL_MIN);
771
773 harmonic_mean(particle_restitution_coefficient,
774 wall_restitution_coefficient);
775
777 harmonic_mean(particle_friction_coefficient, wall_friction_coefficient);
778
780 harmonic_mean(particle_rolling_friction_coefficient,
781 wall_rolling_friction_coefficient);
782
784 harmonic_mean(particle_rolling_viscous_damping_coefficient,
785 wall_rolling_viscous_damping);
786
787 this->effective_surface_energy[i] =
788 particle_surface_energy + wall_surface_energy -
789 std::pow(std::sqrt(particle_surface_energy) -
790 std::sqrt(wall_surface_energy),
791 2);
792
794 0.5 * (particle_hamaker_constant + wall_hamaker_constant);
795
796 const double log_coeff_restitution =
797 std::log(this->effective_coefficient_of_restitution[i]);
798 this->model_parameter_beta[i] =
799 log_coeff_restitution /
800 sqrt((log_coeff_restitution * log_coeff_restitution) + 9.8696);
801 }
802}
803
804template <
805 int dim,
806 typename PropertiesIndex,
809void
811 PropertiesIndex,
812 contact_model,
813 rolling_friction_model>::
814 set_multiphysic_properties(const DEMSolverParameters<dim> &dem_parameters)
815{
816 auto properties = dem_parameters.lagrangian_physical_properties;
817
818 n_particle_types = properties.particle_type_number;
825 this->gas_thermal_conductivity = properties.thermal_conductivity_gas;
826
827 // Wall properties
828 const double wall_real_youngs_modulus = properties.real_youngs_modulus_wall;
829 const double wall_poisson_ratio = properties.poisson_ratio_wall;
830 const double wall_surface_roughness = properties.surface_roughness_wall;
831 const double wall_surface_slope = properties.surface_slope_wall;
832 const double wall_microhardness = properties.microhardness_wall;
833 const double wall_thermal_accommodation =
834 properties.thermal_accommodation_wall;
835 this->wall_thermal_conductivity = properties.thermal_conductivity_wall;
836
837 for (unsigned int i = 0; i < n_particle_types; ++i)
838 {
839 // Particle properties
840 const double particle_real_youngs_modulus =
841 properties.real_youngs_modulus_particle.at(i);
842 const double particle_poisson_ratio =
843 properties.poisson_ratio_particle.at(i);
844 const double particle_surface_roughness =
845 properties.surface_roughness_particle.at(i);
846 const double particle_surface_slope =
847 properties.surface_slope_particle.at(i);
848 const double particle_microhardness =
849 properties.microhardness_particle.at(i);
850 const double particle_thermal_accommodation =
851 properties.thermal_accommodation_particle.at(i);
853 properties.thermal_conductivity_particle.at(i);
854
855 // Effective particle-wall properties
857 (particle_real_youngs_modulus * wall_real_youngs_modulus) /
858 (wall_real_youngs_modulus *
859 (1. - particle_poisson_ratio * particle_poisson_ratio) +
860 particle_real_youngs_modulus *
861 (1. - wall_poisson_ratio * wall_poisson_ratio) +
862 DBL_MIN);
864 sqrt(particle_surface_roughness * particle_surface_roughness +
865 wall_surface_roughness * wall_surface_roughness);
866 this->equivalent_surface_slope[i] =
867 sqrt(particle_surface_slope * particle_surface_slope +
868 wall_surface_slope * wall_surface_slope);
869 this->effective_microhardness[i] =
870 harmonic_mean(particle_microhardness, wall_microhardness);
871 this->gas_parameter_m[i] =
872 ((2. - particle_thermal_accommodation) /
873 particle_thermal_accommodation +
874 (2. - wall_thermal_accommodation) / wall_thermal_accommodation) *
875 (2. * properties.specific_heats_ratio_gas) /
876 (1. + properties.specific_heats_ratio_gas) *
877 properties.molecular_mean_free_path_gas /
878 (properties.dynamic_viscosity_gas * properties.specific_heat_gas /
879 properties.thermal_conductivity_gas);
880 }
881
882 // Thermal boundary types of the walls of the grid and temperature functions
883 // of the ones with an imposed temperature.
888}
889
890#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
Parameters::Lagrangian::BCDEM boundary_conditions
Parameters::Lagrangian::ForceTorqueOnWall< dim > forces_torques
Class where the outcomes of particle-particle interactions are stored.
std::vector< Tensor< 1, 3 > > force
std::vector< Tensor< 1, 3 > > torque
Execute calculation of particle-wall contacts.
std::vector< double > effective_coefficient_of_rolling_viscous_damping
std::map< types::boundary_id, Point< 3 > > point_on_rotation_vector
std::vector< double > equivalent_surface_slope
std::map< types::boundary_id, Parameters::Lagrangian::WallThermalBoundaryType > boundary_thermal_type_map
std::vector< particle_triangle_contact_record > solid_contact_records
Every solid-object is associated with a contact record. This container is index for each solid object...
void set_effective_properties(const DEMSolverParameters< dim > &dem_parameters)
Set every container needed to carry the particle-wall force calculation.
void update_contact_information(particle_wall_contact_info< dim > &contact_info, Tensor< 1, 3 > &tangential_relative_velocity, double &normal_relative_velocity_value, const Point< 3 > &particle_location, const ArrayView< const double > &particle_properties, const double dt)
Update the contact pair information for contact calculations.
std::vector< double > effective_surface_energy
std::map< types::boundary_id, std::shared_ptr< Function< 3 > > > boundary_temperature_function
void update_particle_solid_object_contact_information(particle_wall_contact_info< dim > &contact_info, Tensor< 1, 3 > &tangential_relative_velocity, double &normal_relative_velocity_value, const ArrayView< const double > &particle_properties, const double dt, const Tensor< 1, 3 > &cut_cell_translational_velocity, const Tensor< 1, 3 > &cut_cell_rotational_velocity, const double center_of_rotation_particle_distance)
Update the contact pair information for particle-solid object contacts.
void calculate_contact(particle_wall_contact_info< dim > &contact_info, const Tensor< 1, 3 > &tangential_relative_velocity, const double normal_relative_velocity_value, const double normal_overlap, const double dt, const ArrayView< const double > &particle_properties, Tensor< 1, 3 > &normal_force, Tensor< 1, 3 > &tangential_force, Tensor< 1, 3 > &tangential_torque, Tensor< 1, 3 > &rolling_resistance_torque)
Calculate the particle-wall contact force and torque according to the contact model.
void apply_force_and_torque(const Tensor< 1, 3 > &normal_force, const Tensor< 1, 3 > &tangential_force, const Tensor< 1, 3 > &tangential_torque, const Tensor< 1, 3 > &rolling_resistance_torque, Tensor< 1, 3 > &particle_torque, Tensor< 1, 3 > &particle_force)
Apply the calculated force and torque on the particle in contact.
double get_boundary_temperature(const types::boundary_id boundary_id, const Point< 3 > &point) const
Return the temperature at a given point of a wall of the background triangulation....
ankerl::unordered_dense::map< types::particle_index, particle_triangle_contact_description > particle_triangle_contact_record
Contact record for one solid object, mapping the local index of every particle with at least one cont...
std::map< types::boundary_id, double > boundary_rotational_speed_map
std::vector< double > effective_youngs_modulus
std::vector< double > effective_coefficient_of_friction
double get_force_calculation_threshold_distance()
Calculate the minimum overlap at which particle-wall forces are computed. This function is useful for...
std::vector< double > effective_hamaker_constant
void set_multiphysic_properties(const DEMSolverParameters< dim > &dem_parameters)
Set every containers needed to carry the heat transfer rate calculation.
std::vector< double > effective_microhardness
std::map< types::boundary_id, Tensor< 1, 3 > > boundary_translational_velocity_map
std::vector< double > equivalent_surface_roughness
std::vector< double > effective_real_youngs_modulus
std::vector< double > effective_shear_modulus
Parameters::Lagrangian::WallThermalBoundaryType get_thermal_boundary_type(const types::boundary_id boundary_id) const
Return the thermal boundary type of a wall of the background triangulation. The walls without a therm...
std::vector< double > effective_coefficient_of_restitution
std::vector< double > effective_coefficient_of_rolling_friction
std::map< types::boundary_id, Tensor< 1, 3 > > boundary_rotational_vector
std::vector< double > particle_thermal_conductivity
static void clear_contact_info(particle_wall_contact_info< dim > &contact_info)
Clears the tangential displacement and rolling resistance spring torque from a contact info structure...
@ particle_floating_mesh
@ particle_wall
Tensor< 1, 3 > find_projection(const Tensor< 1, 3 > &vector_a, const Tensor< 1, 3 > &vector_b)
This function is used to find the projection of vector_a on vector_b.
Point< 3 > get_location(const Particles::ParticleIterator< dim > &particle)
Get the 3d location of the particle.
PropertiesIndex
Particle property indices for pure DEM simulations.
constexpr bool has_thermal_properties
Whether a properties index set carries thermal properties.
ParticleTriangleContactIndicator
Indicates the type of contact between a particle and a triangle.
TriangleProjectionData< dim > prepare_triangle_projection_data(const std::vector< Point< dim > > &triangle)
Precomputes the particle-independent geometric data of a triangle (see TriangleProjectionData) used b...
std::tuple< bool, Point< 3 >, Tensor< 1, 3 >, ParticleTriangleContactIndicator > find_particle_triangle_projection(const TriangleProjectionData< dim > &triangle_data, const Point< dim > &particle_position, const double cutoff_distance)
Finds the contact point between a triangle (defined using three vertices) and a particle center,...
WallThermalBoundaryType
Thermal boundary type of the grid in multiphysic DEM. It is used to define the thermal boundary condi...
ParticleWallContactForceModel
Contact force model for particle-wall interactions.
RollingResistanceMethod
Method used to compute the rolling resistance torque.
SolidObjectThermalBoundaryType
Thermal boundary condition type applied on a solid object surface.
@ adiabatic
No heat flux through the solid boundary.
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 ...
DEM data structure containers To improve readability of containers, there's a simple description abov...
ankerl::unordered_dense::map< types::particle_index, ankerl::unordered_dense::map< global_face_id, particle_wall_contact_info< dim > > > particle_wall_in_contact
std::map< types::boundary_id, double > boundary_rotational_speed
std::map< types::boundary_id, Tensor< 1, 3 > > boundary_translational_velocity
std::map< types::boundary_id, std::shared_ptr< Function< 3 > > > boundary_temperature
std::map< types::boundary_id, WallThermalBoundaryType > thermal_boundary_type
std::map< types::boundary_id, Tensor< 1, 3 > > boundary_rotational_vector
std::map< types::boundary_id, Point< 3 > > point_on_rotation_axis
Handle the information related to the calculation of the particle-wall contact forces.
Particles::ParticleIterator< dim > particle