Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
particle_heat_transfer.cc
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2025-2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
5
7
8#include <boost/math/special_functions/erf.hpp>
9
10#include <cmath>
11#include <ranges>
12
13double
14calculate_corrected_contact_radius(const double effective_radius,
15 const double effective_youngs_modulus,
16 const double effective_real_youngs_modulus,
17 const double normal_force_norm)
18{
19 const double contact_radius = pow((3 * normal_force_norm * effective_radius) /
20 (4 * effective_youngs_modulus),
21 (1.0 / 3.0));
22
23 // In certain cases, the simulation effective Young’s modulus
24 // can be chosen a few orders lower than the real effective Young’s modulus
25 // to ensure simulation stability (related to Rayleigh's time).
26 // As a consequence, the contact radius is overestimated, so a correctional
27 // factor is applied here.
28 return contact_radius *
29 pow(effective_youngs_modulus / effective_real_youngs_modulus,
30 1.0 / 5.0);
31}
32
33double
34calculate_macrocontact_resistance(const double harmonic_conductivity,
35 const double contact_radius)
36{
37 return 0.5 / (contact_radius * harmonic_conductivity + DBL_MIN);
38
39 // G. K. Batchelor and R. W. O’Brien, “Thermal or electrical conduction
40 // through a granular material,” Proc. R. Soc. Lond. A Math. Phys. Sci., vol.
41 // 355, no. 1682, pp. 313–333, Jul. 1977
42}
43
44double
45calculate_microcontact_resistance(const double equivalent_surface_slope,
46 const double equivalent_surface_roughness,
47 const double effective_microhardness,
48 const double contact_radius_squared,
49 const double harmonic_conductivity,
50 const double maximum_pressure)
51{
52 // 1.184 = (1+0.96/2)/1.25
53 return 1.184 / (M_PI * harmonic_conductivity * contact_radius_squared) *
54 (equivalent_surface_roughness / equivalent_surface_slope) *
55 pow(effective_microhardness / (maximum_pressure + DBL_MIN), 0.96);
56
57 // Van Lew, J. T. (2016). On thermal characterization of breeder pebble beds
58 // with microscale numerical modeling of thermofluid and pebble-pebble
59 // interactions (Doctoral dissertation, University of California, Los Angeles)
60 // Equations 3.25 to 3.27.
61}
62
63double
65 const double thermal_conductivity,
66 const double contact_radius_squared)
67{
68 // resistance = characteristic length parallel to heat flux /
69 // (thermal_conductivity
70 // * characteristic area perpendicular to the heat flux)
71
72 return 0.25 * M_PI * radius /
73 (M_PI * (radius * radius - contact_radius_squared) *
74 thermal_conductivity);
75
76 // C. Beaulieu, “Impact de la ségrégation granulaire sur le transfert de
77 // chaleur dans un lit rotatif”, Ph.D. thesis, Polytechnique Montréal, 2020.
78}
79
80double
82 const double equivalent_surface_roughness,
83 const double contact_radius_squared,
84 const double gas_parameter_m,
85 const double thermal_conductivity_gas,
86 const double maximum_pressure,
87 const double effective_microhardness)
88{
89 const double x_1 = 2.0 * maximum_pressure / effective_microhardness;
90 const double x_2 = 0.03 * maximum_pressure / effective_microhardness;
91
92 // If the values are out of the valid range ]0, 2[ of the erfc^-1 function,
93 // this resistance has no physical meaning. Particles are too close or not
94 // close enough for a microgap between them to make sense. This resistance is
95 // used in parallel with another one, so putting it to infinity ignores it in
96 // the total resistance.
97 if (x_1 >= 2.0 || x_1 <= 0.0)
98 {
99 return INFINITY;
100 }
101
102 const double a_1 = boost::math::erfc_inv(x_1);
103 const double a_2 = boost::math::erfc_inv(x_2) - a_1;
104
105 // 2.82842712475 = 2*sqrt(2)
106 return (2.82842712475 * equivalent_surface_roughness * a_2) /
107 (M_PI * thermal_conductivity_gas * contact_radius_squared *
108 std::log(abs(1 + a_2 / (a_1 + gas_parameter_m /
109 (2.82842712475 *
110 equivalent_surface_roughness)))));
111
112 // M. Bahrami, M. M. Yovanovich, and J. R. Culham, “Effective thermal
113 // conductivity of rough spherical packed beds,” Int. J. Heat Mass Transfer,
114 // vol. 49, no. 19–20, pp. 3691–3701, Sep. 2006
115}
116
117double
119 const double harmonic_radius,
120 const double thermal_conductivity_gas,
121 const double contact_radius_squared,
122 const double gas_parameter_m)
123{
124 const double A =
125 2. * sqrt(harmonic_radius * harmonic_radius - contact_radius_squared);
126 const double S = 2. * harmonic_radius -
127 contact_radius_squared / harmonic_radius + gas_parameter_m;
128
129 return 2.0 / (M_PI * thermal_conductivity_gas * (S * log(S / (S - A)) - A));
130
131 // M. Bahrami, M. M. Yovanovich, and J. R. Culham, “Effective thermal
132 // conductivity of rough spherical packed beds,” Int. J. Heat Mass Transfer,
133 // vol. 49, no. 19–20, pp. 3691–3701, Sep. 2006
134}
135
136template <ContactType contact_type>
137void
139 const double radius_one,
140 [[maybe_unused]] const double radius_two,
141 const double effective_youngs_modulus,
142 const double effective_real_youngs_modulus,
143 const double equivalent_surface_roughness,
144 const double equivalent_surface_slope,
145 const double effective_microhardness,
146 const double thermal_conductivity_one,
147 const double thermal_conductivity_two,
148 const double thermal_conductivity_gas,
149 const double gas_parameter_m,
150 const double normal_overlap,
151 const double normal_force_norm,
152 double &thermal_conductance)
153{
154 // Particle-wall contacts are either contacts with a wall of the background
155 // triangulation or with a solid object. The thermal conductance is calculated
156 // the same way for both.
157 constexpr bool is_particle_wall_contact =
158 (contact_type == ContactType::particle_wall) ||
159 (contact_type == ContactType::particle_floating_mesh);
160
161 const double harmonic_conductivity =
162 harmonic_mean(thermal_conductivity_one, thermal_conductivity_two);
163 // For particle-wall contacts, it is as if the radius of the wall is infinite.
164 const double harmonic_radius = is_particle_wall_contact ?
165 2. * radius_one :
166 harmonic_mean(radius_one, radius_two);
167
168 // Calculation of contact radius
169 // Hertz contact radius
170 const double contact_radius =
171 calculate_corrected_contact_radius(harmonic_radius * 0.5,
172 effective_youngs_modulus,
173 effective_real_youngs_modulus,
174 normal_force_norm);
175
176 // In the same way as the contact radius, if the effective Young's modulus is
177 // underestimated, the normal overlap is overestimated so a correctional
178 // factor is applied here.
179 const double corrected_normal_overlap =
180 normal_overlap *
181 pow(effective_youngs_modulus / effective_real_youngs_modulus, 2.0 / 3.0);
182
183 // Geometric contact radius
184 // (from analytical contact area between overlapping spheres)
185 // The following lines can be uncommented to use the geometric contact radius
186 // instead of the hertz one used currently.
187 // const double contact_radius = [&]() {
188 // if constexpr (is_particle_wall_contact)
189 // return sqrt(corrected_normal_overlap *
190 // (2. * radius_one - corrected_normal_overlap));
191 // else
192 // return sqrt(
193 // corrected_normal_overlap *
194 // (2. * radius_one - corrected_normal_overlap) *
195 // (2. * radius_two - corrected_normal_overlap) *
196 // (2. * radius_one + 2. * radius_two - corrected_normal_overlap) /
197 // ((radius_one + radius_two - corrected_normal_overlap) *
198 // (radius_one + radius_two - corrected_normal_overlap)));
199 // }();
200
201 // Squared contact radius, often used in resistances calculations.
202 const double contact_radius_squared = contact_radius * contact_radius;
203
204 const double maximum_pressure =
205 (2.0 * effective_real_youngs_modulus * corrected_normal_overlap) /
206 (M_PI * contact_radius + DBL_MIN);
207
208 // Calculation of each thermal resistance
209 // For particle-wall contacts, only the macrocontact resistance of the
210 // particle is considered.
211 const double resistance_macrocontact = [&]() {
212 if constexpr (is_particle_wall_contact)
213 return calculate_macrocontact_resistance(2. * thermal_conductivity_one,
214 contact_radius);
215 else
216 return calculate_macrocontact_resistance(harmonic_conductivity,
217 contact_radius);
218 }();
219
220 const double resistance_microcontact =
221 calculate_microcontact_resistance(equivalent_surface_slope,
222 equivalent_surface_roughness,
223 effective_microhardness,
224 contact_radius_squared,
225 harmonic_conductivity,
226 maximum_pressure);
227
228 double resistance_solid_macrogap =
230 thermal_conductivity_one,
231 contact_radius_squared);
232 // For particle-wall contacts, only the solid macrogap resistance of the
233 // particle is considered.
234 if constexpr (!is_particle_wall_contact)
235 resistance_solid_macrogap +=
237 thermal_conductivity_two,
238 contact_radius_squared);
239
240 const double resistance_gas_microgap =
241 calculate_interstitial_gas_microgap_resistance(equivalent_surface_roughness,
242 contact_radius_squared,
243 gas_parameter_m,
244 thermal_conductivity_gas,
245 maximum_pressure,
246 effective_microhardness);
247
248 double resistance_gas_macrogap =
250 thermal_conductivity_gas,
251 contact_radius_squared,
252 gas_parameter_m);
253
254 // For particle-wall contacts, there is only a macrogap around the particle
255 // and not the wall, so only half of the resistance is kept.
256 if constexpr (is_particle_wall_contact)
257 resistance_gas_macrogap *= 0.5;
258
259 // Calculation of the final thermal conductance (1 / total resistance)
260 // conductance = 1 / resistance contact area pathway + 1 / resistance magrogap
261 // pathway)
262 thermal_conductance =
263 1.0 / (resistance_macrocontact + 1.0 / (1.0 / resistance_microcontact +
264 1.0 / resistance_gas_microgap)) +
265 1.0 / (resistance_solid_macrogap + resistance_gas_macrogap);
266}
267
268void
269apply_heat_transfer_on_local_particles(const double temperature_one,
270 const double temperature_two,
271 const double thermal_conductance,
272 double &particle_one_heat_transfer_rate,
273 double &particle_two_heat_transfer_rate)
274{
275 const double heat_transfer_rate =
276 thermal_conductance * (temperature_two - temperature_one);
277 particle_one_heat_transfer_rate += heat_transfer_rate;
278 particle_two_heat_transfer_rate -= heat_transfer_rate;
279}
280
281void
283 const double temperature_one,
284 const double temperature_two,
285 const double thermal_conductance,
286 double &particle_one_heat_transfer_rate)
287{
288 particle_one_heat_transfer_rate +=
289 thermal_conductance * (temperature_two - temperature_one);
290}
291
292void
294 const Parameters::Lagrangian::BCDEM &boundary_conditions,
295 const double time)
296{
297 for (const auto &temperature_function :
298 boundary_conditions.boundary_temperature | std::views::values)
299 temperature_function->set_time(time);
300}
301
302// only particle-particle, particle-floating-mesh and particle-wall contacts
303template void
305 const double radius_one,
306 [[maybe_unused]] const double radius_two,
307 const double effective_youngs_modulus,
308 const double effective_real_youngs_modulus,
309 const double equivalent_surface_roughness,
310 const double equivalent_surface_slope,
311 const double effective_microhardness,
312 const double thermal_conductivity_one,
313 const double thermal_conductivity_two,
314 const double thermal_conductivity_gas,
315 const double gas_parameter_m,
316 const double normal_overlap,
317 const double normal_force_norm,
318 double &thermal_conductance);
319
320template void
322 const double radius_one,
323 [[maybe_unused]] const double radius_two,
324 const double effective_youngs_modulus,
325 const double effective_real_youngs_modulus,
326 const double equivalent_surface_roughness,
327 const double equivalent_surface_slope,
328 const double effective_microhardness,
329 const double thermal_conductivity_one,
330 const double thermal_conductivity_two,
331 const double thermal_conductivity_gas,
332 const double gas_parameter_m,
333 const double normal_overlap,
334 const double normal_force_norm,
335 double &thermal_conductance);
336
337template void
340 const double radius_one,
341 [[maybe_unused]] const double radius_two,
342 const double effective_youngs_modulus,
343 const double effective_real_youngs_modulus,
344 const double equivalent_surface_roughness,
345 const double equivalent_surface_slope,
346 const double effective_microhardness,
347 const double thermal_conductivity_one,
348 const double thermal_conductivity_two,
349 const double thermal_conductivity_gas,
350 const double gas_parameter_m,
351 const double normal_overlap,
352 const double normal_force_norm,
353 double &thermal_conductance);
354
355
356template void
359 const double radius_one,
360 [[maybe_unused]] const double radius_two,
361 const double effective_youngs_modulus,
362 const double effective_real_youngs_modulus,
363 const double equivalent_surface_roughness,
364 const double equivalent_surface_slope,
365 const double effective_microhardness,
366 const double thermal_conductivity_one,
367 const double thermal_conductivity_two,
368 const double thermal_conductivity_gas,
369 const double gas_parameter_m,
370 const double normal_overlap,
371 const double normal_force_norm,
372 double &thermal_conductance);
373
374template void
377 const double radius_one,
378 [[maybe_unused]] const double radius_two,
379 const double effective_youngs_modulus,
380 const double effective_real_youngs_modulus,
381 const double equivalent_surface_roughness,
382 const double equivalent_surface_slope,
383 const double effective_microhardness,
384 const double thermal_conductivity_one,
385 const double thermal_conductivity_two,
386 const double thermal_conductivity_gas,
387 const double gas_parameter_m,
388 const double normal_overlap,
389 const double normal_force_norm,
390 double &thermal_conductance);
391
392template void
394 const double radius_one,
395 [[maybe_unused]] const double radius_two,
396 const double effective_youngs_modulus,
397 const double effective_real_youngs_modulus,
398 const double equivalent_surface_roughness,
399 const double equivalent_surface_slope,
400 const double effective_microhardness,
401 const double thermal_conductivity_one,
402 const double thermal_conductivity_two,
403 const double thermal_conductivity_gas,
404 const double gas_parameter_m,
405 const double normal_overlap,
406 const double normal_force_norm,
407 double &thermal_conductance);
408
409template void
411 const double radius_one,
412 [[maybe_unused]] const double radius_two,
413 const double effective_youngs_modulus,
414 const double effective_real_youngs_modulus,
415 const double equivalent_surface_roughness,
416 const double equivalent_surface_slope,
417 const double effective_microhardness,
418 const double thermal_conductivity_one,
419 const double thermal_conductivity_two,
420 const double thermal_conductivity_gas,
421 const double gas_parameter_m,
422 const double normal_overlap,
423 const double normal_force_norm,
424 double &thermal_conductance);
double harmonic_mean(const double &value_one, const double &value_two)
@ ghost_periodic_particle_particle
@ particle_floating_mesh
@ ghost_local_periodic_particle_particle
@ local_periodic_particle_particle
@ particle_wall
double calculate_macrocontact_resistance(const double harmonic_conductivity, const double contact_radius)
Calculate the macrocontact thermal resistance for a particle-particle or particle-wall pair in contac...
double calculate_corrected_contact_radius(const double effective_radius, const double effective_youngs_modulus, const double effective_real_youngs_modulus, const double normal_force_norm)
Calculate the corrected contact radius for a particle-particle or particle-wall pair in contact.
double calculate_interstitial_gas_microgap_resistance(const double equivalent_surface_roughness, const double contact_radius_squared, const double gas_parameter_m, const double thermal_conductivity_gas, const double maximum_pressure, const double effective_microhardness)
Calculate the interstitial gas microgap thermal resistance for a particle-particle or particle-wall p...
template void calculate_contact_thermal_conductance< ContactType::ghost_particle_particle >(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)
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 set_wall_temperature_time(const Parameters::Lagrangian::BCDEM &boundary_conditions, const double time)
Set the time of the temperature functions of the walls of the grid with a temperature boundary condit...
template void calculate_contact_thermal_conductance< ContactType::particle_wall >(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)
double calculate_solid_macrogap_resistance(const double radius, const double thermal_conductivity, const double contact_radius_squared)
Calculate the solid macrogap thermal resistance for one particle.
double calculate_microcontact_resistance(const double equivalent_surface_slope, const double equivalent_surface_roughness, const double effective_microhardness, const double contact_radius_squared, const double harmonic_conductivity, const double maximum_pressure)
Calculate the microcontact thermal resistance for a particle-particle or particle-wall pair in contac...
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 ...
template void calculate_contact_thermal_conductance< ContactType::particle_floating_mesh >(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)
template void calculate_contact_thermal_conductance< ContactType::local_particle_particle >(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)
double calculate_interstitial_gas_macrogap_resistance(const double harmonic_radius, const double thermal_conductivity_gas, const double contact_radius_squared, const double gas_parameter_m)
Calculate the interstitial gas macrogap thermal resistance for a particle-particle or particle-wall p...
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.
Boundary conditions for DEM simulations.
std::map< types::boundary_id, std::shared_ptr< Function< 3 > > > boundary_temperature