Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
particle_point_line_contact_force.cc
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
5
7
8using namespace dealii;
9
10// Constructor
11template <int dim, typename PropertiesIndex>
13 default;
14
15// In this function, the particle-point and particle-line contact forces are
16// calculated and the particle handler is updated based on this force
17template <int dim, typename PropertiesIndex>
18void
22 *particle_point_pairs_in_contact,
24 &physical_properties,
25 std::vector<Tensor<1, 3>> &force)
26
27{
28 // Looping over particle_point_line_pairs_in_contact
29 for (auto pairs_in_contact_iterator =
30 particle_point_pairs_in_contact->begin();
31 pairs_in_contact_iterator != particle_point_pairs_in_contact->end();
32 ++pairs_in_contact_iterator)
33 {
34 // Getting the required information for calculation of contact force from
35 // the map
36 auto contact_information = &pairs_in_contact_iterator->second;
37
38 // Defining particle and properties of particle as local parameters
39 auto &particle = contact_information->particle;
40 auto particle_properties = particle->get_properties();
41 Point<3> particle_location_3d;
42
43 if constexpr (dim == 3)
44 particle_location_3d = particle->get_location();
45
46 if constexpr (dim == 2)
47 particle_location_3d = point_nd_to_3d(particle->get_location());
48
49 const Point<3> point = contact_information->point;
50 double normal_overlap = ((particle_properties[PropertiesIndex::dp]) / 2) -
51 point.distance(particle_location_3d);
52
53 if (normal_overlap > 0)
54 {
55 // Calculation of normal vector, particle velocity and contact
56 // relative velocity
57 Tensor<1, 3> point_to_particle_vector = particle_location_3d - point;
58 Tensor<1, 3> normal_vector =
59 point_to_particle_vector / point_to_particle_vector.norm();
60
61 Tensor<1, 3> particle_velocity;
62 particle_velocity[0] = particle_properties[PropertiesIndex::v_x];
63 particle_velocity[1] = particle_properties[PropertiesIndex::v_y];
64 particle_velocity[2] = particle_properties[PropertiesIndex::v_z];
65
66 Tensor<1, 3> particle_omega;
67 particle_omega[0] = particle_properties[PropertiesIndex::omega_x];
68 particle_omega[1] = particle_properties[PropertiesIndex::omega_y];
69 particle_omega[2] = particle_properties[PropertiesIndex::omega_z];
70
71 // Defining relative contact velocity
72 Tensor<1, 3> contact_relative_velocity =
73 particle_velocity +
74 cross_product_3d((((particle_properties[PropertiesIndex::dp]) / 2) *
75 particle_omega),
76 normal_vector);
77
78 // Calculation of normal relative velocity
79 double normal_relative_velocity =
80 contact_relative_velocity * normal_vector;
81
82 // Calculation of effective Young's modulus of the contact
83 double effective_youngs_modulus =
84 physical_properties.youngs_modulus_wall /
85 (2 * (1 - pow(physical_properties.poisson_ratio_wall, 2)));
86
87 // Calculation of model parameters (beta and sn). These values
88 // are used to consider non-linear relation of the contact force to
89 // the normal overlap
90 double model_parameter_beta =
91 log(physical_properties.restitution_coefficient_wall) /
92 sqrt(pow(log(physical_properties.restitution_coefficient_wall), 2) +
93 9.8696);
94 double model_parameter_sn =
95 2 * effective_youngs_modulus *
96 sqrt(particle_properties[PropertiesIndex::dp] * normal_overlap);
97
98 // Calculation of normal spring and dashpot constants
99 // using particle and wall properties
100 double normal_spring_constant =
101 1.3333 * effective_youngs_modulus *
102 sqrt(particle_properties[PropertiesIndex::dp] / 2 * normal_overlap);
103 double normal_damping_constant =
104 -1.8257 * model_parameter_beta *
105 sqrt(model_parameter_sn *
106 particle_properties[PropertiesIndex::mass]);
107
108 // Calculation of normal force using spring and dashpot normal forces
109 Tensor<1, 3> spring_normal_force =
110 (normal_spring_constant * normal_overlap) * normal_vector;
111
112 Tensor<1, 3> dashpot_normal_force =
113 (normal_damping_constant * normal_relative_velocity) *
114 normal_vector;
115
116 // In particle-point and particle-line contacts, the tangential force
117 // is meaningless. So the total force is equal to the normal force
118 Tensor<1, 3> total_force = spring_normal_force - dashpot_normal_force;
119
120 // Getting force
121 Tensor<1, 3> &particle_force = force[particle->get_local_index()];
122
123 // Updating the body force of particles in the particle handler
124 particle_force += total_force;
125 }
126 }
127}
128
129// In this function, particle-line contact forces are
130// calculated and the particle handler is updated based on this force
131template <int dim, typename PropertiesIndex>
132void
136 *particle_line_pairs_in_contact,
138 &physical_properties,
139 std::vector<Tensor<1, 3>> &force)
140{
141 // Looping over particle_point_line_pairs_in_contact
142 for (auto pairs_in_contact_iterator = particle_line_pairs_in_contact->begin();
143 pairs_in_contact_iterator != particle_line_pairs_in_contact->end();
144 ++pairs_in_contact_iterator)
145 {
146 // Getting the required information for calculation of contact force from
147 // the map
148 auto contact_information = &pairs_in_contact_iterator->second;
149
150 // Defining particle and properties of particle as local parameters
151 auto particle = contact_information->particle;
152 auto particle_properties = particle->get_properties();
153 Point<3> particle_location_3d;
154
155 if constexpr (dim == 3)
156 particle_location_3d = particle->get_location();
157
158 if constexpr (dim == 2)
159 particle_location_3d = point_nd_to_3d(particle->get_location());
160
161 Point<3> point_one = contact_information->point_one;
162 Point<3> point_two = contact_information->point_two;
163
164 // For finding the particle-line distance, the projection of the particle
165 // on the line should be obtained
166 Point<3> projection =
167 find_projection_point(particle_location_3d, point_one, point_two);
168
169 // Calculation of the distance between the particle and boundary line
170 const double normal_overlap =
171 ((particle_properties[PropertiesIndex::dp]) / 2) -
172 projection.distance(particle_location_3d);
173
174 if (normal_overlap > 0)
175 {
176 // Calculation of normal vector, particle velocity and contact
177 // relative velocity
178 Tensor<1, 3> point_to_particle_vector =
179 particle_location_3d - projection;
180 Tensor<1, 3> normal_vector =
181 point_to_particle_vector / point_to_particle_vector.norm();
182
183 Tensor<1, 3> particle_velocity;
184 particle_velocity[0] = particle_properties[PropertiesIndex::v_x];
185 particle_velocity[1] = particle_properties[PropertiesIndex::v_y];
186 particle_velocity[2] = particle_properties[PropertiesIndex::v_z];
187
188
189 Tensor<1, 3> particle_omega;
190 particle_omega[0] = particle_properties[PropertiesIndex::omega_x];
191 particle_omega[1] = particle_properties[PropertiesIndex::omega_y];
192 particle_omega[2] = particle_properties[PropertiesIndex::omega_z];
193
194
195 // Defining relative contact velocity
196 Tensor<1, 3> contact_relative_velocity =
197 particle_velocity +
198 cross_product_3d((((particle_properties[PropertiesIndex::dp]) / 2) *
199 particle_omega),
200 normal_vector);
201
202
203 // Calculation of normal relative velocity
204 double normal_relative_velocity =
205 contact_relative_velocity * normal_vector;
206
207 // Calculation of effective Young's modulus of the contact
208 double effective_youngs_modulus =
209 physical_properties.youngs_modulus_wall /
210 (2 * (1 - pow(physical_properties.poisson_ratio_wall, 2)));
211
212 // Calculation of model parameters (beta and sn). These values
213 // are used to consider non-linear relation of the contact force to
214 // the normal overlap
215 double model_parameter_beta =
216 log(physical_properties.restitution_coefficient_wall) /
217 sqrt(pow(log(physical_properties.restitution_coefficient_wall), 2) +
218 9.8696);
219 double model_parameter_sn =
220 2 * effective_youngs_modulus *
221 sqrt(particle_properties[PropertiesIndex::dp] * normal_overlap);
222
223 // Calculation of normal spring and dashpot constants
224 // using particle and wall properties
225 double normal_spring_constant =
226 1.3333 * effective_youngs_modulus *
227 sqrt(particle_properties[PropertiesIndex::dp] / 2 * normal_overlap);
228 double normal_damping_constant =
229 -1.8257 * model_parameter_beta *
230 sqrt(model_parameter_sn *
231 particle_properties[PropertiesIndex::mass]);
232
233 // Calculation of normal force using spring and dashpot normal forces
234 Tensor<1, 3> spring_normal_force =
235 (normal_spring_constant * normal_overlap) * normal_vector;
236
237 Tensor<1, 3> dashpot_normal_force =
238 (normal_damping_constant * normal_relative_velocity) *
239 normal_vector;
240
241 // In particle-point and particle-line contacts, the tangential force
242 // is meaningless. So the total force is equal to the normal force
243 Tensor<1, 3> total_force = spring_normal_force - dashpot_normal_force;
244
245 // Getting force
246 Tensor<1, 3> &particle_force = force[particle->get_local_index()];
247
248 // Updating the body force of particles in the particle handler
249 particle_force += total_force;
250 }
251 }
252}
253
254template <int dim, typename PropertiesIndex>
255void
259 &particle_point_pairs_in_contact,
260 std::vector<Tensor<1, 3>> &displacement)
261{
262 for (const auto &pair_in_contact : particle_point_pairs_in_contact)
263 {
264 const auto &contact_information = pair_in_contact.second;
265 const auto &particle = contact_information.particle;
266
267 Point<3> particle_location_3d;
268
269 if constexpr (dim == 3)
270 particle_location_3d = particle->get_location();
271
272 if constexpr (dim == 2)
273 particle_location_3d = point_nd_to_3d(particle->get_location());
274
275 add_shift_displacement(particle,
276 particle_location_3d,
277 contact_information.point,
278 displacement);
279 }
280}
281
282template <int dim, typename PropertiesIndex>
283void
287 &particle_line_pairs_in_contact,
288 std::vector<Tensor<1, 3>> &displacement)
289{
290 for (const auto &pair_in_contact : particle_line_pairs_in_contact)
291 {
292 const auto &contact_information = pair_in_contact.second;
293 const auto &particle = contact_information.particle;
294
295 Point<3> particle_location_3d;
296
297 if constexpr (dim == 3)
298 particle_location_3d = particle->get_location();
299
300 if constexpr (dim == 2)
301 particle_location_3d = point_nd_to_3d(particle->get_location());
302
303 // The point of the line which is the closest to the particle center is
304 // the projection of the particle center on the line
305 const Point<3> projection =
306 find_projection_point(particle_location_3d,
307 contact_information.point_one,
308 contact_information.point_two);
309
310 add_shift_displacement(particle,
311 particle_location_3d,
312 projection,
313 displacement);
314 }
315}
316
317template <int dim, typename PropertiesIndex>
318void
320 const Particles::ParticleIterator<dim> &particle,
321 const Point<3> &particle_location,
322 const Point<3> &contact_point,
323 std::vector<Tensor<1, 3>> &displacement)
324{
325 const double particle_diameter =
326 particle->get_properties()[PropertiesIndex::dp];
327 const double distance = contact_point.distance(particle_location);
328 const double normal_overlap = 0.5 * particle_diameter - distance;
329
330 if (normal_overlap <= 0.)
331 return;
332
333 ++n_contacts;
334
335 // Normal unit vector pointing from the boundary to the particle center
336 const Tensor<1, 3> normal_vector =
337 (particle_location - contact_point) / distance;
338
339 // TODO: 1.02 and 0.01 are the arbitrary values of the particle-wall shift
340 // model. These values could be input parameters from a parameter file.
341 displacement[particle->get_local_index()] +=
342 (1.02 * normal_overlap + 0.01 * particle_diameter) * normal_vector;
343}
344
345template <int dim, typename PropertiesIndex>
346Point<3>
348 const Point<3> &point_p,
349 const Point<3> &point_a,
350 const Point<3> &point_b)
351{
352 Tensor<1, 3> vector_ab = point_b - point_a;
353 Tensor<1, 3> vector_ap = point_p - point_a;
354
355 Point<3> projection =
356 point_a + ((vector_ap * vector_ab) / (vector_ab * vector_ab)) * vector_ab;
357
358 return projection;
359}
360
362template class ParticlePointLineForce<2,
364
365template class ParticlePointLineForce<2,
369template class ParticlePointLineForce<3,
371
372template class ParticlePointLineForce<3,
Calculate the non-linear particle-point and particle-line contact force using the information obtaine...
void add_shift_displacement(const Particles::ParticleIterator< dim > &particle, const Point< 3 > &particle_location, const Point< 3 > &contact_point, std::vector< Tensor< 1, 3 > > &displacement)
Add the displacement that separates a particle from the boundary point or line it overlaps to the dis...
void calculate_particle_line_contact_force(const typename DEM::dem_data_structures< dim >::particle_line_in_contact *particle_line_pairs_in_contact, const Parameters::Lagrangian::LagrangianPhysicalProperties &physical_properties, std::vector< Tensor< 1, 3 > > &force)
Calculate of the particle-line contact force using non-linear (Hertzian) model.
void calculate_particle_point_shift_displacement(const typename DEM::dem_data_structures< dim >::particle_point_in_contact &particle_point_pairs_in_contact, std::vector< Tensor< 1, 3 > > &displacement)
Calculate the displacements that separate the particles from the boundary points they overlap....
Point< 3 > find_projection_point(const Point< 3 > &point_p, const Point< 3 > &point_a, const Point< 3 > &point_b)
This private function is used to find the projection of point_p on a line with beginning and ending v...
unsigned int n_contacts
Number of particle-point and particle-line contacts in the present pseudo-time step when using the pa...
void calculate_particle_point_contact_force(const typename DEM::dem_data_structures< dim >::particle_point_in_contact *particle_point_pairs_in_contact, const Parameters::Lagrangian::LagrangianPhysicalProperties &physical_properties, std::vector< Tensor< 1, 3 > > &force)
Calculate of the particle-point contact force using non-linear (Hertzian) model.
void calculate_particle_line_shift_displacement(const typename DEM::dem_data_structures< dim >::particle_line_in_contact &particle_line_pairs_in_contact, std::vector< Tensor< 1, 3 > > &displacement)
Calculate the displacements that separate the particles from the boundary lines they overlap....
PropertiesIndex
Particle property indices for CFD-DEM multiphysics simulations.
PropertiesIndex
Particle property indices for CFD-DEM simulations.
Point< 3 > find_projection_point(const Point< 3 > &point_p, const Point< 3 > &point_a, const Point< 3 > &point_b)
This private function is used to find the projection of point_p on a line with beginning and ending v...
std::unordered_map< types::particle_index, particle_line_contact_info< dim > > particle_line_in_contact
std::unordered_map< types::particle_index, particle_point_contact_info< dim > > particle_point_in_contact
Physical properties of particles, walls, and interstitial gas for Lagrangian (DEM) simulations.
double restitution_coefficient_wall
Coefficient of restitution of the wall.
Point< 3 > point_nd_to_3d(const Point< dim > &point)