Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
parameters_lagrangian.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#include <core/utilities.h>
6
7#include <deal.II/base/patterns.h>
8#include <deal.II/base/point.h>
9#include <deal.II/base/tensor.h>
10
11#include <deal.II/grid/grid_in.h>
12
13#include <vector>
14
15namespace Parameters
16{
17 namespace Lagrangian
18 {
19 namespace
20 {
21 /// Deprecated strings of the "distribution weighting basis" parameter
23 deprecated_distribution_weighting_type_names = {
26
27 /// Deprecated strings of the "rolling resistance torque method"
28 /// parameter
30 deprecated_rolling_resistance_method_names = {
31 {"no_resistance", RollingResistanceMethod::none},
32 {"constant_resistance", RollingResistanceMethod::constant},
33 {"viscous_resistance", RollingResistanceMethod::viscous},
34 {"epsd_resistance", RollingResistanceMethod::epsd}};
35
36 /// Particle-particle contact force models which can be selected with
37 /// the "particle particle contact force method" parameter. The shift
38 /// model is left out, since it is only used internally by the packed
39 /// insertion method.
40 const std::vector<ParticleParticleContactForceModel>
41 allowed_particle_particle_contact_force_models = {
48
49 /// Particle-wall contact force models which can be selected with the
50 /// "particle wall contact force method" parameter. The shift model is
51 /// left out, since it is only used internally by the packed insertion
52 /// method.
53 const std::vector<ParticleWallContactForceModel>
54 allowed_particle_wall_contact_force_models = {
59 } // namespace
60
61 void
63 ParameterHandler &prm) const
64 {
65 prm.enter_subsection("lagrangian physical properties");
66 {
67 prm.declare_entry("g",
68 Patterns::Tools::Convert<Tensor<1, 3>>::to_string(g),
69 Patterns::List(Patterns::Double(), 2, 3),
70 "Gravitational acceleration vector");
71
72 prm.declare_entry("number of particle types",
73 Patterns::Tools::Convert<unsigned int>::to_string(
75 Patterns::Integer(),
76 "Number of particle types");
77
78 for (unsigned int counter = 0; counter < particle_type_maximum_number;
79 ++counter)
80 {
81 prm.enter_subsection("particle type " +
82 Utilities::int_to_string(counter, 1));
83 {
85 }
86 prm.leave_subsection();
87 }
88
89 prm.declare_entry("young modulus wall",
90 Patterns::Tools::Convert<double>::to_string(
92 Patterns::Double(),
93 "Young's modulus of wall");
94 prm.declare_entry("poisson ratio wall",
95 Patterns::Tools::Convert<double>::to_string(
97 Patterns::Double(),
98 "Poisson's ratio of wall");
99 prm.declare_entry("restitution coefficient wall",
100 Patterns::Tools::Convert<double>::to_string(
102 Patterns::Double(),
103 "Coefficient of restitution of wall");
104 prm.declare_entry("friction coefficient wall",
105 Patterns::Tools::Convert<double>::to_string(
107 Patterns::Double(),
108 "Friction coefficient of wall");
109 prm.declare_entry("rolling friction wall",
110 Patterns::Tools::Convert<double>::to_string(
112 Patterns::Double(),
113 "Rolling friction coefficient of wall");
114 prm.declare_entry("rolling viscous damping wall",
115 Patterns::Tools::Convert<double>::to_string(
117 Patterns::Double(),
118 "Rolling viscous damping wall");
119 prm.declare_entry("surface energy wall",
120 Patterns::Tools::Convert<double>::to_string(
122 Patterns::Double(),
123 "Surface energy of wall");
124 prm.declare_entry("hamaker constant wall",
125 Patterns::Tools::Convert<double>::to_string(
127 Patterns::Double(),
128 "Hamaker constant of wall");
129 prm.declare_entry("thermal conductivity wall",
130 Patterns::Tools::Convert<double>::to_string(
132 Patterns::Double(),
133 "Thermal conductivity of wall");
134 prm.declare_entry("microhardness wall",
135 Patterns::Tools::Convert<double>::to_string(
137 Patterns::Double(),
138 "Microhardness of wall");
139 prm.declare_entry("surface slope wall",
140 Patterns::Tools::Convert<double>::to_string(
142 Patterns::Double(),
143 "Surface slope of wall");
144 prm.declare_entry("surface roughness wall",
145 Patterns::Tools::Convert<double>::to_string(
147 Patterns::Double(),
148 "Surface roughness of wall");
149 prm.declare_entry("thermal accommodation wall",
150 Patterns::Tools::Convert<double>::to_string(
152 Patterns::Double(),
153 "Thermal accommodation of wall");
154 prm.declare_entry("real young modulus wall",
155 Patterns::Tools::Convert<double>::to_string(
157 Patterns::Double(),
158 "Real Young's modulus of wall");
159
160 prm.declare_entry("thermal conductivity gas",
161 Patterns::Tools::Convert<double>::to_string(
163 Patterns::Double(),
164 "Thermal conductivity of interstitial gas");
165 prm.declare_entry("specific heat gas",
166 Patterns::Tools::Convert<double>::to_string(
168 Patterns::Double(),
169 "Specific heat of interstitial gas");
170 prm.declare_entry("dynamic viscosity gas",
171 Patterns::Tools::Convert<double>::to_string(
173 Patterns::Double(),
174 "Dynamic viscosity of interstitial gas");
175 prm.declare_entry("specific heats ratio gas",
176 Patterns::Tools::Convert<double>::to_string(
178 Patterns::Double(),
179 "Specific heats ratio of interstitial gas");
180 prm.declare_entry("molecular mean free path gas",
181 Patterns::Tools::Convert<double>::to_string(
183 Patterns::Double(),
184 "Molecular mean free path of interstitial gas");
185 }
186 prm.leave_subsection();
187 }
188
189 void
191 {
192 prm.enter_subsection("lagrangian physical properties");
206 number,
223
224 std::vector<std::string> vector_of_string(
225 Utilities::split_string_list(prm.get("g")));
226 std::vector<double> vector_of_double =
227 Utilities::string_to_double(vector_of_string);
228
229 if (vector_of_double.size() == 2)
230 vector_of_double.push_back(0.);
231
232 for (unsigned int i = 0; i < 3; ++i)
233 g[i] = vector_of_double[i];
234
235 particle_type_number = prm.get_integer("number of particle types");
236
237 for (unsigned int id = 0; id < particle_type_number; ++id)
238 {
239 prm.enter_subsection("particle type " +
240 Utilities::int_to_string(id, 1));
242 prm.leave_subsection();
243 }
244
245 youngs_modulus_wall = prm.get_double("young modulus wall");
246 poisson_ratio_wall = prm.get_double("poisson ratio wall");
248 prm.get_double("restitution coefficient wall");
249 friction_coefficient_wall = prm.get_double("friction coefficient wall");
250 rolling_friction_wall = prm.get_double("rolling friction wall");
252 prm.get_double("rolling viscous damping wall");
253 surface_energy_wall = prm.get_double("surface energy wall");
254 hamaker_constant_wall = prm.get_double("hamaker constant wall");
255 thermal_conductivity_wall = prm.get_double("thermal conductivity wall");
256 microhardness_wall = prm.get_double("microhardness wall");
257 surface_slope_wall = prm.get_double("surface slope wall");
258 surface_roughness_wall = prm.get_double("surface roughness wall");
259 thermal_accommodation_wall = prm.get_double("thermal accommodation wall");
260 real_youngs_modulus_wall = prm.get_double("real young modulus wall");
261 // Only use the real Young's modulus if it is higher than the Young's
262 // modulus
265
266 thermal_conductivity_gas = prm.get_double("thermal conductivity gas");
267 specific_heat_gas = prm.get_double("specific heat gas");
268 dynamic_viscosity_gas = prm.get_double("dynamic viscosity gas");
269 specific_heats_ratio_gas = prm.get_double("specific heats ratio gas");
271 prm.get_double("molecular mean free path gas");
272
273 prm.leave_subsection();
274 }
275
276 void
278 {
279 // Defines the type of distribution
281 "size distribution type",
283 "Particle size distribution.");
284
285 // Normal and lognormal distributions
286 prm.declare_entry("average diameter",
287 "0.001",
288 Patterns::Double(0.),
289 "Particle diameter.");
290 // (Alias for the uniform distribution)
291 prm.declare_alias("average diameter", "diameter", false);
292 prm.declare_entry("standard deviation",
293 "0",
294 Patterns::Double(0.),
295 "Particle size standard deviation.");
296
297 // Custom distribution
298 prm.declare_entry("custom distribution from file",
299 "false",
300 Patterns::Bool(),
301 "Indicates whether the diameter and probability "
302 "values are extracted from a file.");
303 prm.declare_entry("custom distribution filename",
304 "custom_distribution.txt",
305 Patterns::FileName(),
306 "Indicates the file where the custom distribution "
307 "values should be read from.");
309 "custom distribution probability function type",
311 "Particle size distribution.");
312 prm.declare_entry("custom distribution interpolation",
313 "false",
314 Patterns::Bool(),
315 "Indicates whether the sampling using the custom "
316 "distribution should be interpolated.");
317
318 prm.declare_entry("custom distribution diameters values",
319 "0.001 , 0.0005",
320 Patterns::List(Patterns::Double(0.)),
321 "Diameter values for a custom distribution");
322 prm.declare_alias("custom distribution diameters values",
323 "custom diameters",
324 false);
325 prm.declare_entry(
326 "custom distribution diameters probabilities",
327 "0.6 , 0.4",
328 Patterns::List(Patterns::Double(0.)),
329 "Probabilities associated with each diameter values for "
330 "a custom distribution. ");
331
332 // Normal, lognormal and custom distributions
334 "distribution weighting basis",
336 "Weighting basis for the size distribution.",
337 deprecated_distribution_weighting_type_names);
338 prm.declare_entry("distribution prn seed",
339 "1",
340 Patterns::Integer(),
341 "Seed for generation of random numbers"
342 " for the size distribution");
343 prm.declare_alias("distribution prn seed",
344 "random seed distribution",
345 false);
346 prm.declare_entry("minimum diameter cutoff",
347 "-1.",
348 Patterns::Double(),
349 "Minimum cutoff value when sampling a distribution. "
350 "If equal to -1., the cutoff will be fixed at "
351 "0.1% of the cumulative density function of the "
352 "distribution.");
353 prm.declare_entry("maximum diameter cutoff",
354 "-1.",
355 Patterns::Double(),
356 "Maximum cutoff value when sampling a distribution. "
357 "If equal to -1., the cutoff will be fixed at "
358 "99.9% of the cumulative density function of the "
359 "distribution.");
360
361 // Every type of distribution
362 prm.declare_entry("number of particles",
363 "0",
364 Patterns::Integer(0),
365 "Number of particles of this type");
366 prm.declare_entry("density particles",
367 "1000",
368 Patterns::Double(0),
369 "Particle density");
370 prm.declare_entry("young modulus particles",
371 "1000000",
372 Patterns::Double(0),
373 "Particle Young's modulus");
374 prm.declare_entry("poisson ratio particles",
375 "0.3",
376 Patterns::Double(0.),
377 "Particle Poisson ratio");
378 prm.declare_entry("restitution coefficient particles",
379 "0.1",
380 Patterns::Double(0., 1.),
381 "Particle restitution coefficient");
382 prm.declare_entry("friction coefficient particles",
383 "0.1",
384 Patterns::Double(0.),
385 "Particle friction coefficient");
386 prm.declare_entry("rolling viscous damping particles",
387 "0.1",
388 Patterns::Double(0.),
389 "Particle rolling viscous damping");
390 prm.declare_entry("rolling friction particles",
391 "0.1",
392 Patterns::Double(0.),
393 "Particle rolling friction");
394 prm.declare_entry("surface energy particles",
395 "0.0",
396 Patterns::Double(0.),
397 "Particle surface energy");
398 prm.declare_entry("hamaker constant particles",
399 "4.e-19",
400 Patterns::Double(0.),
401 "Material Hamaker constant");
402 prm.declare_entry("thermal conductivity particles",
403 "1",
404 Patterns::Double(),
405 "Particle thermal conductivity");
406 prm.declare_entry("specific heat particles",
407 "1000",
408 Patterns::Double(),
409 "Particle specific heat");
410 prm.declare_entry("microhardness particles",
411 "1.e9",
412 Patterns::Double(),
413 "Particle microhardness");
414 prm.declare_entry("surface slope particles",
415 "0.1",
416 Patterns::Double(),
417 "Particle surface slope");
418 prm.declare_entry("surface roughness particles",
419 "1.e-9",
420 Patterns::Double(),
421 "Particle surface roughness");
422 prm.declare_entry("thermal accommodation particles",
423 "0.7",
424 Patterns::Double(),
425 "Particle thermal accommodation");
426 prm.declare_entry("real young modulus particles",
427 "0.",
428 Patterns::Double(),
429 "Particle real Young's modulus");
430 }
431
432 void
434 const unsigned int &particle_type,
435 const ParameterHandler &prm)
436 {
437 // Defines the type of distribution
439 prm.get("size distribution type")));
440
441 // Normal and lognormal distributions
442 particle_average_diameter.push_back(prm.get_double("average diameter"));
443 particle_size_std.push_back(prm.get_double("standard deviation"));
444
445 // Custom distribution
447 prm.get_bool("custom distribution from file"));
449 prm.get("custom distribution filename"));
450
453 prm.get("custom distribution probability function type")));
454
456 prm.get_bool("custom distribution interpolation"));
457
459 prm, "custom distribution diameters values"));
460
462 prm, "custom distribution diameters probabilities"));
463
464 // Normal, lognormal and custom distributions
467 prm.get("distribution weighting basis"),
468 deprecated_distribution_weighting_type_names,
469 "distribution weighting basis"));
470
471 seed_for_distributions.push_back(
472 prm.get_integer("distribution prn seed"));
473
474 diameter_min_cutoff.push_back(prm.get_double("minimum diameter cutoff"));
475 diameter_max_cutoff.push_back(prm.get_double("maximum diameter cutoff"));
476
477 number.push_back(prm.get_integer("number of particles"));
478 density_particle.push_back(prm.get_double("density particles"));
479 youngs_modulus_particle.push_back(
480 prm.get_double("young modulus particles"));
481 poisson_ratio_particle.push_back(
482 prm.get_double("poisson ratio particles"));
484 prm.get_double("restitution coefficient particles"));
486 prm.get_double("friction coefficient particles"));
488 prm.get_double("rolling viscous damping particles"));
490 prm.get_double("rolling friction particles"));
491 surface_energy_particle.push_back(
492 prm.get_double("surface energy particles"));
494 prm.get_double("hamaker constant particles"));
496 prm.get_double("thermal conductivity particles"));
497 specific_heat_particle.push_back(
498 prm.get_double("specific heat particles"));
499 microhardness_particle.push_back(
500 prm.get_double("microhardness particles"));
501 surface_slope_particle.push_back(
502 prm.get_double("surface slope particles"));
504 prm.get_double("surface roughness particles"));
506 prm.get_double("thermal accommodation particles"));
508 prm.get_double("real young modulus particles"));
509
510 // Checks
511 // Only use the real Young's modulus if it is higher than the Young's
512 // modulus
513 if (real_youngs_modulus_particle.at(particle_type) <
514 youngs_modulus_particle.at(particle_type))
515 {
516 real_youngs_modulus_particle.at(particle_type) =
517 youngs_modulus_particle.at(particle_type);
518 }
519 }
520
521 void
523 std::vector<SizeDistributionType> &dist_types,
524 std::vector<double> &p_average_diameter,
525 std::vector<double> &p_size_std,
526 std::vector<bool> &custom_dist_read_from_file,
527 std::vector<std::string> &custom_dist_file_names,
528 std::vector<ProbabilityFunctionType> &custom_function_type,
529 std::vector<bool> &custom_interpolation,
530 std::vector<std::vector<double>> &custom_diameter_values,
531 std::vector<std::vector<double>> &custom_probabilities_values,
532 std::vector<DistributionWeightingType> &distribution_weighting_basis_type,
533 std::vector<unsigned int> &seed_for_dist,
534 std::vector<double> &dia_min_cutoff,
535 std::vector<double> &dia_max_cutoff,
536 std::vector<int> &p_number,
537 std::vector<double> &p_density,
538 std::vector<double> &p_youngs_modulus,
539 std::vector<double> &p_poisson_ratio,
540 std::vector<double> &p_restitution_coefficient,
541 std::vector<double> &p_friction_coefficient,
542 std::vector<double> &p_rolling_viscous_damping_coefficient,
543 std::vector<double> &p_rolling_friction_coefficient,
544 std::vector<double> &p_surface_energy,
545 std::vector<double> &p_hamaker_constant,
546 std::vector<double> &p_thermal_conductivity,
547 std::vector<double> &p_specific_heat,
548 std::vector<double> &p_microhardness,
549 std::vector<double> &p_surface_slope,
550 std::vector<double> &p_surface_roughness,
551 std::vector<double> &p_thermal_accommodation,
552 std::vector<double> &p_real_youngs_modulus) const
553 {
554 dist_types.reserve(particle_type_maximum_number);
555 p_average_diameter.reserve(particle_type_maximum_number);
556 p_size_std.reserve(particle_type_maximum_number);
557 custom_dist_read_from_file.reserve(particle_type_maximum_number);
558 custom_dist_file_names.reserve(particle_type_maximum_number);
559 custom_function_type.reserve(particle_type_maximum_number);
560 custom_interpolation.reserve(particle_type_maximum_number);
561 custom_diameter_values.reserve(particle_type_maximum_number);
562 custom_probabilities_values.reserve(particle_type_maximum_number);
563 distribution_weighting_basis_type.reserve(particle_type_maximum_number);
564 seed_for_dist.reserve(particle_type_maximum_number);
565 dia_min_cutoff.reserve(particle_type_maximum_number);
566 dia_max_cutoff.reserve(particle_type_maximum_number);
567 p_number.reserve(particle_type_maximum_number);
568 p_density.reserve(particle_type_maximum_number);
569 p_youngs_modulus.reserve(particle_type_maximum_number);
570 p_poisson_ratio.reserve(particle_type_maximum_number);
571 p_restitution_coefficient.reserve(particle_type_maximum_number);
572 p_friction_coefficient.reserve(particle_type_maximum_number);
573 p_rolling_viscous_damping_coefficient.reserve(
575 p_rolling_friction_coefficient.reserve(particle_type_maximum_number);
576 p_surface_energy.reserve(particle_type_maximum_number);
577 p_hamaker_constant.reserve(particle_type_maximum_number);
578 p_thermal_conductivity.reserve(particle_type_maximum_number);
579 p_specific_heat.reserve(particle_type_maximum_number);
580 p_microhardness.reserve(particle_type_maximum_number);
581 p_surface_slope.reserve(particle_type_maximum_number);
582 p_surface_roughness.reserve(particle_type_maximum_number);
583 p_thermal_accommodation.reserve(particle_type_maximum_number);
584 p_real_youngs_modulus.reserve(particle_type_maximum_number);
585 }
586
587 template <int dim>
588 void
590 {
591 const InsertionInfo<dim> defaults;
592 prm.enter_subsection("insertion info");
593 {
595 "insertion method",
596 defaults.insertion_method,
597 "Choosing insertion method.");
598 prm.declare_entry("inserted number of particles at each time step",
599 Patterns::Tools::Convert<unsigned int>::to_string(
600 defaults.inserted_this_step),
601 Patterns::Integer(),
602 "Inserted number of particles at each time step");
603 prm.declare_entry("insertion frequency",
604 Patterns::Tools::Convert<int>::to_string(
605 defaults.insertion_frequency),
606 Patterns::Integer(),
607 "Insertion frequency");
608
609 // Removal box:
610 prm.declare_entry(
611 "remove particles",
612 Patterns::Tools::Convert<bool>::to_string(
614 Patterns::Bool(),
615 "State whether particles should be cleared on insertion.");
616
617 prm.declare_entry(
618 "removal box points coordinates",
619 Patterns::Tools::Convert<Point<3>>::to_string(
620 defaults.clear_box_point_1) +
621 " : " +
622 Patterns::Tools::Convert<Point<3>>::to_string(
623 defaults.clear_box_point_2),
624 Patterns::List(
625 Patterns::List(Patterns::Double(), 2, 3, ","), 2, 2, ":"),
626 "Coordinates of two points for the removal box (x1, y1, z1 : x2, y2, z2)");
627
628 // File:
629 prm.declare_entry(
630 "list of input files",
631 Patterns::Tools::Convert<std::vector<std::string>>::to_string(
632 defaults.list_of_input_files),
633 Patterns::List(Patterns::FileName()),
634 "The file name from which we load the particles");
635
636 // Plane:
637 prm.declare_entry("insertion plane point",
638 Patterns::Tools::Convert<Point<3>>::to_string(
639 defaults.insertion_plane_point),
640 Patterns::List(Patterns::Double()),
641 "Insertion plane point location");
642 prm.declare_entry("insertion plane normal vector",
643 Patterns::Tools::Convert<Tensor<1, 3>>::to_string(
645 Patterns::List(Patterns::Double()),
646 "Insertion plane normal vector");
647
648 // List:
649 prm.declare_entry(
650 "list x",
651 Patterns::Tools::Convert<std::vector<double>>::to_string(
652 defaults.list_x),
653 Patterns::List(Patterns::Double()),
654 "List of particles x positions");
655 prm.declare_entry(
656 "list y",
657 Patterns::Tools::Convert<std::vector<double>>::to_string(
658 defaults.list_y),
659 Patterns::List(Patterns::Double()),
660 "List of particles y positions");
661 prm.declare_entry(
662 "list z",
663 Patterns::Tools::Convert<std::vector<double>>::to_string(
664 defaults.list_z),
665 Patterns::List(Patterns::Double()),
666 "List of particles z positions");
667 prm.declare_entry(
668 "list velocity x",
669 Patterns::Tools::Convert<std::vector<double>>::to_string(
670 defaults.list_vx),
671 Patterns::List(Patterns::Double()),
672 "List of initial velocities x");
673 prm.declare_entry(
674 "list velocity y",
675 Patterns::Tools::Convert<std::vector<double>>::to_string(
676 defaults.list_vy),
677 Patterns::List(Patterns::Double()),
678 "List of initial velocities y");
679 prm.declare_entry(
680 "list velocity z",
681 Patterns::Tools::Convert<std::vector<double>>::to_string(
682 defaults.list_vz),
683 Patterns::List(Patterns::Double()),
684 "List of initial velocities z");
685 prm.declare_entry(
686 "list omega x",
687 Patterns::Tools::Convert<std::vector<double>>::to_string(
688 defaults.list_wx),
689 Patterns::List(Patterns::Double()),
690 "List of initial omega x");
691 prm.declare_entry(
692 "list omega y",
693 Patterns::Tools::Convert<std::vector<double>>::to_string(
694 defaults.list_wy),
695 Patterns::List(Patterns::Double()),
696 "List of initial omega y");
697 prm.declare_entry(
698 "list omega z",
699 Patterns::Tools::Convert<std::vector<double>>::to_string(
700 defaults.list_wz),
701 Patterns::List(Patterns::Double()),
702 "List of initial omega z");
703 prm.declare_entry(
704 "list diameters",
705 Patterns::Tools::Convert<std::vector<double>>::to_string(
706 defaults.list_d),
707 Patterns::List(Patterns::Double()),
708 "List of diameters");
709 prm.declare_entry(
710 "list temperatures",
711 Patterns::Tools::Convert<std::vector<double>>::to_string(
712 defaults.list_T),
713 Patterns::List(Patterns::Double()),
714 "List of initial temperatures");
715 // Volume:
716 prm.declare_entry(
717 "insertion direction sequence",
718 Patterns::Tools::Convert<std::vector<unsigned int>>::to_string(
719 defaults.direction_sequence),
720 Patterns::List(Patterns::Integer(0, dim - 1), dim, dim),
721 "Direction of particle insertion for the volume "
722 "insertion method.");
723 prm.declare_entry(
724 "insertion box points coordinates",
725 Patterns::Tools::Convert<Point<3>>::to_string(
726 defaults.insertion_box_point_1) +
727 " : " +
728 Patterns::Tools::Convert<Point<3>>::to_string(
729 defaults.insertion_box_point_2),
730 Patterns::List(
731 Patterns::List(Patterns::Double(), 2, 3, ","), 2, 2, ":"),
732 "Coordinates of two points for the insertion box (x1, y1, z1 : x2, y2, z2)");
733 prm.declare_entry("insertion distance threshold",
734 Patterns::Tools::Convert<double>::to_string(
735 defaults.distance_threshold),
736 Patterns::Double(),
737 "Distance threshold");
738
739
740 // By default, every point is accepted, thus we need a default value
741 // bigger than 0 (we use 1 here).
742 auto insertion_acceptance_function_parsed =
743 std::make_shared<Functions::ParsedFunction<dim>>(1);
744 prm.enter_subsection("insertion acceptance function");
745 {
746 insertion_acceptance_function_parsed->declare_parameters(prm, 1, "1");
747 }
748 prm.leave_subsection();
749
750 // Volume or plane:
751 prm.declare_entry(
752 "insertion maximum offset",
753 Patterns::Tools::Convert<double>::to_string(
754 defaults.insertion_maximum_offset),
755 Patterns::Double(),
756 "Maximum position offset when insertion of particles");
757
758 prm.declare_entry(
759 "insertion prn seed",
760 Patterns::Tools::Convert<int>::to_string(defaults.seed_for_insertion),
761 Patterns::Integer(),
762 "Pseudo-random number seed used to generate the position offsets");
763 prm.declare_entry("initial velocity",
764 Patterns::Tools::Convert<Tensor<1, 3>>::to_string(
765 defaults.initial_vel),
766 Patterns::List(Patterns::Double()),
767 "Initial velocity (x, y, z)");
768 prm.declare_entry("initial angular velocity",
769 Patterns::Tools::Convert<Tensor<1, 3>>::to_string(
770 defaults.initial_omega),
771 Patterns::List(Patterns::Double()),
772 "Initial angular velocity (x, y, z)");
773
774 // Multi-physics
775 auto initial_temperature_function_parsed =
776 std::make_shared<Functions::ParsedFunction<dim>>(1);
777 prm.enter_subsection("initial temperature function");
778 {
779 initial_temperature_function_parsed->declare_parameters(prm, 1);
780 }
781 prm.leave_subsection();
782 }
783 prm.leave_subsection();
784 }
785
786 template <int dim>
787 void
789 {
790 prm.enter_subsection("insertion info");
791 {
793 string_to_enum<InsertionMethod>(prm.get("insertion method"));
795 prm.get_integer("inserted number of particles at each time step");
796 insertion_frequency = prm.get_integer("insertion frequency");
797
798 // Clear:
799 removing_particles_in_region = prm.get_bool("remove particles");
800
801 const std::vector<std::string> removal_box_point_coordinates_list(
802 Utilities::split_string_list(
803 prm.get("removal box points coordinates"), ":"));
804
805 std::vector<double> removal_point_coord_temp_1 =
806 Utilities::string_to_double(Utilities::split_string_list(
807 removal_box_point_coordinates_list.at(0)));
808 std::vector<double> removal_point_coord_temp_2 =
809 Utilities::string_to_double(Utilities::split_string_list(
810 removal_box_point_coordinates_list.at(1)));
811
812 if (removal_point_coord_temp_1.size() == 2 &&
813 removal_point_coord_temp_2.size() == 2)
814 {
815 removal_point_coord_temp_1.push_back(0.);
816 removal_point_coord_temp_2.push_back(0.);
817 }
818
819 for (unsigned int i = 0; i < 3; ++i)
820 {
821 clear_box_point_1[i] = removal_point_coord_temp_1.at(i);
822 clear_box_point_2[i] = removal_point_coord_temp_2.at(i);
823 }
824
825 // File:
826 // File for the insertion
828 convert_string_to_vector<std::string>(prm, "list of input files");
829
830 // Plane:
831 // Insertion plane normal vector
833 value_string_to_tensor<3>(prm.get("insertion plane normal vector"));
834
835 // Insertion plane point
837 value_string_to_tensor<3>(prm.get("insertion plane point"));
838
839 // List:
840 // Read x, y and z lists
844
845 // Find which vector is the longest
846 int max_size = std::max({list_x.size(), list_y.size(), list_z.size()});
847
848 // Resize the vectors in the case that one was longer
849 list_x.resize(max_size);
850 list_y.resize(max_size);
851 list_z.resize(max_size);
852
853 // Read vx, vv and vz
854 list_vx = convert_string_to_vector<double>(prm, "list velocity x");
855 list_vy = convert_string_to_vector<double>(prm, "list velocity y");
856 list_vz = convert_string_to_vector<double>(prm, "list velocity z");
857
858 // Fill the velocity vectors with zeros to match the size of list_x
859 if (list_vx != list_x)
860 list_vx.resize(max_size);
861 if (list_vy != list_x)
862 list_vy.resize(max_size);
863 if (list_vz != list_x)
864 list_vz.resize(max_size);
865
866 // Read wx, wy and wz
867 list_wx = convert_string_to_vector<double>(prm, "list omega x");
868 list_wy = convert_string_to_vector<double>(prm, "list omega y");
869 list_wz = convert_string_to_vector<double>(prm, "list omega z");
870
871 // Fill the angular velocity vectors with zeros to match the size of
872 // list_x
873 if (list_wx != list_x)
874 list_wx.resize(max_size);
875 if (list_wy != list_x)
876 list_wy.resize(max_size);
877 if (list_wz != list_x)
878 list_wz.resize(max_size);
879
880 // Read the diameters list
881 list_d = convert_string_to_vector<double>(prm, "list diameters");
882
883 // Read the temperatures list
884 list_T = convert_string_to_vector<double>(prm, "list temperatures");
885
886 // Volume:
887 // The declare_entry pattern guarantees dim axes in [0, dim - 1].
888 const std::vector<int> axis_order =
889 convert_string_to_vector<int>(prm, "insertion direction sequence");
890 direction_sequence.assign(axis_order.begin(), axis_order.end());
891
892 // Check if the insertion directions are valid: direction_sequence must
893 // be a permutation of {0, ..., dim-1}, i.e. each axis appears exactly
894 // once.
895 std::array<bool, dim> axis_seen{}; // zero-initialized to false
896
897 for (int d = 0; d < dim; ++d)
898 {
899 const int axis = direction_sequence[d];
900
901 AssertThrow(
902 axis < dim,
903 ExcMessage(
904 "Invalid insertion directions: axis index out of range for the volume insertion box."));
905
906 AssertThrow(
907 !axis_seen[axis],
908 ExcMessage(
909 "Invalid insertion directions: an axis is present more than once"));
910
911 axis_seen[axis] = true;
912 }
913
914 const std::vector<std::string> point_coordinates_list(
915 Utilities::split_string_list(
916 prm.get("insertion box points coordinates"), ":"));
917
918 std::vector<double> point_coord_temp_1 = Utilities::string_to_double(
919 Utilities::split_string_list(point_coordinates_list.at(0)));
920 std::vector<double> point_coord_temp_2 = Utilities::string_to_double(
921 Utilities::split_string_list(point_coordinates_list.at(1)));
922
923 if (point_coord_temp_1.size() == 2 && point_coord_temp_2.size() == 2)
924 {
925 point_coord_temp_1.push_back(0.);
926 point_coord_temp_2.push_back(0.);
927 }
928 for (int i = 0; i < 3; ++i)
929 {
930 insertion_box_point_1[i] = point_coord_temp_1.at(i);
931 insertion_box_point_2[i] = point_coord_temp_2.at(i);
932 }
933
934 distance_threshold = prm.get_double("insertion distance threshold");
935 insertion_maximum_offset = prm.get_double("insertion maximum offset");
936 seed_for_insertion = prm.get_integer("insertion prn seed");
937 initial_vel = value_string_to_tensor<3>(prm.get("initial velocity"));
939 value_string_to_tensor<3>(prm.get("initial angular velocity"));
940
941 auto initial_temperature_function_parsed =
942 std::make_shared<Functions::ParsedFunction<dim>>(1);
943 prm.enter_subsection("initial temperature function");
944 {
945 initial_temperature_function_parsed->parse_parameters(prm);
946 initial_temperature_function = initial_temperature_function_parsed;
947 }
948 prm.leave_subsection();
949
950 auto insertion_acceptance_function =
951 std::make_shared<Functions::ParsedFunction<dim>>(1);
952
953 prm.enter_subsection("insertion acceptance function");
954 {
955 insertion_acceptance_function->parse_parameters(prm);
956 }
957 prm.leave_subsection();
958 insertion_acceptance_fct = insertion_acceptance_function;
959 }
960 prm.leave_subsection();
961 }
962
963 template <int dim>
964 void
966 {
967 const ModelParameters<dim> defaults;
968 prm.enter_subsection("model parameters");
969 {
970 prm.enter_subsection("load balancing");
971 {
973 "load balance method",
974 defaults.load_balance_method,
975 "Choosing load-balance method.");
976
977 prm.declare_entry(
978 "step",
979 Patterns::Tools::Convert<unsigned int>::to_string(
980 defaults.load_balance_step),
981 Patterns::Integer(),
982 "Step at which the triangulation is repartitioned "
983 "and load is balanced for single-step load-balancing");
984
985 prm.declare_entry(
986 "frequency",
987 Patterns::Tools::Convert<unsigned int>::to_string(
988 defaults.load_balance_frequency),
989 Patterns::Integer(),
990 "Frequency at which the triangulation is repartitioned "
991 "and load is balanced for frequent load-balancing");
992
993 prm.declare_entry("threshold",
994 Patterns::Tools::Convert<double>::to_string(
995 defaults.load_balance_threshold),
996 Patterns::Double(),
997 "Threshold for dynamic load-balancing");
998
999 prm.declare_entry("dynamic check frequency",
1000 Patterns::Tools::Convert<unsigned int>::to_string(
1002 Patterns::Integer(),
1003 "Checking frequency for dynamic load-balancing");
1004
1005
1006 auto cell_weight_function_parsed =
1007 std::make_shared<Functions::ParsedFunction<dim>>(1);
1008 prm.enter_subsection("cell weight function");
1009 {
1010 cell_weight_function_parsed->declare_parameters(prm, 1, "1000");
1011 }
1012 prm.leave_subsection();
1013
1014 prm.declare_entry(
1015 "particle weight",
1016 Patterns::Tools::Convert<unsigned int>::to_string(
1018 Patterns::Integer(),
1019 "The particle weight based on a default cell weight of 1000");
1020
1021 prm.declare_entry(
1022 "active weight factor",
1023 Patterns::Tools::Convert<double>::to_string(
1025 Patterns::Double(),
1026 "Factor applied on the particle weight in load balancing if the cell is active");
1027
1028 prm.declare_entry(
1029 "inactive weight factor",
1030 Patterns::Tools::Convert<double>::to_string(
1032 Patterns::Double(),
1033 "Factor applied on the particle weight in load balancing if the cell is inactive");
1034 }
1035 prm.leave_subsection();
1036
1037 prm.enter_subsection("contact detection");
1038 {
1040 "contact detection method",
1041 defaults.contact_detection_method,
1042 "Choosing contact detection method.");
1043
1044 prm.declare_entry("frequency",
1045 Patterns::Tools::Convert<unsigned int>::to_string(
1047 Patterns::Integer(),
1048 "Particle-particle contact list");
1049
1050 prm.declare_entry(
1051 "dynamic contact search size coefficient",
1052 Patterns::Tools::Convert<double>::to_string(
1054 Patterns::Double(),
1055 "Security coefficient for dynamic contact detection");
1056
1057 prm.declare_entry(
1058 "neighborhood threshold",
1059 Patterns::Tools::Convert<double>::to_string(
1060 defaults.neighborhood_threshold),
1061 Patterns::Double(),
1062 "Contact search zone diameter to particle diameter ratio");
1063 }
1064 prm.leave_subsection();
1065
1067 "particle particle contact force method",
1069 "Choosing particle-particle contact force model.",
1070 {},
1071 allowed_particle_particle_contact_force_models);
1072
1074 "particle wall contact force method",
1076 "Choosing particle-wall contact force model.",
1077 {},
1078 allowed_particle_wall_contact_force_models);
1079
1080 prm.declare_entry(
1081 "dmt cut-off threshold",
1082 Patterns::Tools::Convert<double>::to_string(
1083 defaults.dmt_cut_off_threshold),
1084 Patterns::Double(),
1085 "Cut-off threshold above which the Van der Waal forces are "
1086 "ignored for the DMT model relative to the pull-off force");
1087
1089 "rolling resistance torque method",
1091 "Choosing rolling resistance torque model.",
1092 deprecated_rolling_resistance_method_names);
1093
1094 prm.declare_entry(
1095 "f coefficient",
1096 Patterns::Tools::Convert<double>::to_string(
1097 defaults.f_coefficient_epsd),
1098 Patterns::Double(),
1099 "Model parameter for the EPSD rolling resistance model.");
1100
1102 "integration method",
1103 defaults.integration_method,
1104 "Choosing integration method.");
1105
1107 "solver type",
1108 defaults.solver_type,
1109 "Choosing solver type.");
1110
1111 prm.enter_subsection("adaptive sparse contacts");
1112 {
1113 prm.declare_entry(
1114 "enable adaptive sparse contacts",
1115 Patterns::Tools::Convert<bool>::to_string(
1116 defaults.sparse_particle_contacts),
1117 Patterns::Bool(),
1118 "Enable the dynamic search for sparse particle contacts. "
1119 "Choices are <true|false>.");
1120
1121 prm.declare_entry(
1122 "enable particle advection",
1123 Patterns::Tools::Convert<bool>::to_string(
1124 defaults.advect_particles),
1125 Patterns::Bool(),
1126 "Enable the advection of particles with hydrodynamic forces. "
1127 "Choices are <true|false>.");
1128
1129 prm.declare_entry(
1130 "granular temperature threshold",
1131 Patterns::Tools::Convert<double>::to_string(
1133 Patterns::Double(),
1134 "Minimum granular temperature where particle contacts are considered");
1135
1136 prm.declare_entry(
1137 "solid fraction threshold",
1138 Patterns::Tools::Convert<double>::to_string(
1139 defaults.solid_fraction_threshold),
1140 Patterns::Double(),
1141 "Maximum solid fraction where particle contacts are considered "
1142 "no matter the granular temperature");
1143 }
1144 prm.leave_subsection();
1145
1146 prm.declare_entry("disable position integration",
1147 Patterns::Tools::Convert<bool>::to_string(
1149 Patterns::Bool(),
1150 "Disable the integration of position and velocity. "
1151 "Choices are <true|false>.");
1152 }
1153 prm.leave_subsection();
1154 }
1155
1156 template <int dim>
1157 void
1159 {
1160 prm.enter_subsection("model parameters");
1161 {
1162 prm.enter_subsection("adaptive sparse contacts");
1163 {
1165 prm.get_bool("enable adaptive sparse contacts");
1166 advect_particles = prm.get_bool("enable particle advection");
1167
1168 // Thresholds for disabling contacts
1170 prm.get_double("granular temperature threshold");
1171 solid_fraction_threshold = prm.get_double("solid fraction threshold");
1172 }
1173 prm.leave_subsection();
1174
1175 prm.enter_subsection("load balancing");
1176 {
1178 string_to_enum<LoadBalanceMethod>(prm.get("load balance method"));
1179
1180 // Dynamic load balancing with sparse contacts relies on the mobility
1181 // status of the cells, which requires adaptive sparse contacts
1182 AssertThrow(
1186 ExcMessage(
1187 "The load balance method dynamic_with_sparse_contacts requires "
1188 "adaptive sparse contacts to be enabled. Enable adaptive sparse "
1189 "contacts or use the dynamic load balance method instead."));
1190
1191 load_balance_step = prm.get_integer("step");
1192 load_balance_frequency = prm.get_integer("frequency");
1193 load_balance_threshold = prm.get_double("threshold");
1195 prm.get_integer("dynamic check frequency");
1196
1197 // Weights for load balancing of active and inactive cells
1198 active_load_balancing_factor = prm.get_double("active weight factor");
1200 prm.get_double("inactive weight factor");
1201 auto cell_weight_function_parsed =
1202 std::make_shared<Functions::ParsedFunction<dim>>(1);
1203
1204 prm.enter_subsection("cell weight function");
1205 {
1206 cell_weight_function_parsed->parse_parameters(prm);
1207
1208 cell_weight_function = cell_weight_function_parsed;
1209 }
1210 prm.leave_subsection();
1211 load_balance_particle_weight = prm.get_integer("particle weight");
1212 }
1213 prm.leave_subsection();
1214
1215 prm.enter_subsection("contact detection");
1216 {
1217 contact_detection_frequency = prm.get_integer("frequency");
1219 prm.get_double("dynamic contact search size coefficient");
1220 neighborhood_threshold = prm.get_double("neighborhood threshold");
1221
1223 prm.get("contact detection method"));
1224 }
1225 prm.leave_subsection();
1226
1229 prm.get("particle particle contact force method"));
1230
1233 prm.get("particle wall contact force method"));
1234
1235 dmt_cut_off_threshold = prm.get_double("dmt cut-off threshold");
1236
1238 prm.get("rolling resistance torque method"),
1239 deprecated_rolling_resistance_method_names,
1240 "rolling resistance torque method");
1241
1242
1243 // Model parameter for the EPSD rolling resistance model
1244 f_coefficient_epsd = prm.get_double("f coefficient");
1245
1247 string_to_enum<IntegrationMethod>(prm.get("integration method"));
1248
1249 solver_type = string_to_enum<DEM::SolverType>(prm.get("solver type"));
1250
1252 prm.get_bool("disable position integration");
1253 }
1254 prm.leave_subsection();
1255 }
1256 template <int dim>
1257 void
1259 {
1260 const ForceTorqueOnWall<dim> defaults;
1261 prm.enter_subsection("boundary forces");
1262 prm.declare_entry("calculation",
1263 Patterns::Tools::Convert<bool>::to_string(
1264 defaults.calculate_force_torque),
1265 Patterns::Bool(),
1266 "Enable calculation of forces");
1268 prm,
1269 "verbosity",
1270 defaults.force_torque_verbosity,
1271 "State whether output from solver runs should be printed.",
1274 prm.declare_entry("filename",
1275 defaults.force_torque_output_name,
1276 Patterns::FileName(),
1277 "File output force prefix");
1278 prm.declare_entry("output frequency",
1279 Patterns::Tools::Convert<unsigned int>::to_string(
1280 defaults.output_frequency),
1281 Patterns::Integer(),
1282 "Output frequency");
1283 prm.enter_subsection("center of mass coordinate");
1284 prm.declare_entry("x",
1285 Patterns::Tools::Convert<double>::to_string(
1286 defaults.point_center_mass[0]),
1287 Patterns::Double(),
1288 "X coordinate of center of mass");
1289 prm.declare_entry("y",
1290 Patterns::Tools::Convert<double>::to_string(
1291 defaults.point_center_mass[1]),
1292 Patterns::Double(),
1293 "Y coordinate of center of mass");
1294 prm.declare_entry("z",
1295 Patterns::Tools::Convert<double>::to_string(
1296 defaults.point_center_mass[2]),
1297 Patterns::Double(),
1298 "Z coordinate of center of mass");
1299 prm.leave_subsection();
1300
1301 prm.leave_subsection();
1302 }
1303
1304 template <int dim>
1305 void
1307 {
1308 prm.enter_subsection("boundary forces");
1309 calculate_force_torque = prm.get_bool("calculation");
1311 string_to_enum<Verbosity>(prm.get("verbosity"),
1313 "verbosity");
1314 force_torque_output_name = prm.get("filename");
1315 output_frequency = prm.get_integer("output frequency");
1316 prm.enter_subsection("center of mass coordinate");
1317 point_center_mass[0] = prm.get_double("x");
1318 point_center_mass[1] = prm.get_double("y");
1319 point_center_mass[2] = prm.get_double("z");
1320 prm.leave_subsection();
1321 prm.leave_subsection();
1322 }
1323
1324 template <int dim>
1325 void
1326 FloatingWalls<dim>::declare_parameters(ParameterHandler &prm) const
1327 {
1328 prm.enter_subsection("floating walls");
1329 {
1330 prm.declare_entry("number of floating walls",
1331 Patterns::Tools::Convert<unsigned int>::to_string(
1333 Patterns::Integer(),
1334 "Number of floating walls");
1335
1336 for (unsigned int counter = 0; counter < max_number_floating_walls;
1337 ++counter)
1338 {
1339 prm.enter_subsection("wall " +
1340 Utilities::int_to_string(counter, 1));
1341 {
1343 }
1344 prm.leave_subsection();
1345 }
1346 }
1347 prm.leave_subsection();
1348 }
1349
1350 template <int dim>
1351 void
1353 {
1354 prm.enter_subsection("floating walls");
1355 {
1356 floating_walls_number = prm.get_integer("number of floating walls");
1357
1358 if (floating_walls_number >= 1)
1359 {
1360 prm.enter_subsection("wall 0");
1361 {
1363 }
1364 prm.leave_subsection();
1365 }
1366 if (floating_walls_number >= 2)
1367 {
1368 prm.enter_subsection("wall 1");
1369 {
1371 }
1372 prm.leave_subsection();
1373 }
1374 if (floating_walls_number >= 3)
1375 {
1376 prm.enter_subsection("wall 2");
1377 {
1379 }
1380 prm.leave_subsection();
1381 }
1382 if (floating_walls_number >= 4)
1383 {
1384 prm.enter_subsection("wall 3");
1385 {
1387 }
1388 prm.leave_subsection();
1389 }
1390 if (floating_walls_number >= 5)
1391 {
1392 prm.enter_subsection("wall 4");
1393 {
1395 }
1396 prm.leave_subsection();
1397 }
1398 if (floating_walls_number >= 6)
1399 {
1400 prm.enter_subsection("wall 5");
1401 {
1403 }
1404 prm.leave_subsection();
1405 }
1406 if (floating_walls_number >= 7)
1407 {
1408 prm.enter_subsection("wall 6");
1409 {
1411 }
1412 prm.leave_subsection();
1413 }
1414 if (floating_walls_number >= 8)
1415 {
1416 prm.enter_subsection("wall 7");
1417 {
1419 }
1420 prm.leave_subsection();
1421 }
1422 if (floating_walls_number >= 9)
1423 {
1424 prm.enter_subsection("wall 8");
1425 {
1427 }
1428 prm.leave_subsection();
1429 }
1430 if (floating_walls_number >= 10)
1431 {
1432 prm.enter_subsection("wall 9");
1433 {
1435 }
1436 prm.leave_subsection();
1437 }
1438 }
1439 prm.leave_subsection();
1440 }
1441
1442 template <int dim>
1443 void
1445 {
1446 prm.declare_entry("point on wall",
1447 "0., 0., 0.",
1448 Patterns::List(Patterns::Double(), 2, 3),
1449 "Point on wall");
1450 prm.declare_entry("normal vector",
1451 "1., 0., 0.",
1452 Patterns::List(Patterns::Double(), 2, 3),
1453 "Normal vector of the wall");
1454
1455 prm.enter_subsection("point on wall");
1456 prm.declare_entry("x", "0.", Patterns::Double(), "X Point on wall");
1457 prm.declare_entry("y", "0.", Patterns::Double(), "Y Point on wall");
1458 prm.declare_entry("z", "0.", Patterns::Double(), "Z Point on wall");
1459 prm.mark_as_deprecated("x");
1460 prm.mark_as_deprecated("y");
1461 prm.mark_as_deprecated("z");
1462 prm.leave_subsection();
1463
1464 prm.enter_subsection("normal vector");
1465 prm.declare_entry("nx", "0.", Patterns::Double(), "X Normal vector wall");
1466 prm.declare_entry("ny", "0.", Patterns::Double(), "Y Normal vector wall");
1467 prm.declare_entry("nz", "0.", Patterns::Double(), "Z Normal vector wall");
1468 prm.mark_as_deprecated("nx");
1469 prm.mark_as_deprecated("ny");
1470 prm.mark_as_deprecated("nz");
1471 prm.leave_subsection();
1472
1473 prm.declare_entry("start time", "0.", Patterns::Double(), "Start time");
1474
1475 prm.declare_entry("end time", "0.", Patterns::Double(), "End time");
1476 }
1477
1478 template <int dim>
1479 void
1480 FloatingWalls<dim>::parse_floating_wall(const ParameterHandler &prm)
1481 {
1482 // Position
1483 Point<dim> wall_point(
1484 value_string_to_tensor<dim>(prm.get("point on wall")));
1485 this->points_on_walls.push_back(wall_point);
1486
1487 // Normal
1488 Tensor<1, dim> wall_normal(
1489 value_string_to_tensor<dim>(prm.get("normal vector")));
1490 wall_normal = wall_normal / wall_normal.norm();
1491 this->floating_walls_normal_vectors.push_back(wall_normal);
1492
1493 // Time
1494 time_start.push_back(prm.get_double("start time"));
1495 time_end.push_back(prm.get_double("end time"));
1496 }
1497
1498 void
1499 BCDEM::declare_parameters(ParameterHandler &prm) const
1500 {
1501 prm.enter_subsection("DEM boundary conditions");
1502 {
1503 prm.declare_entry("number of boundary conditions",
1504 Patterns::Tools::Convert<unsigned int>::to_string(
1506 Patterns::Integer(),
1507 "Number of boundary conditions");
1508
1509 for (unsigned int counter = 0;
1511 ++counter)
1512 { // Example: "boundary condition 0"
1513 prm.enter_subsection("boundary condition " +
1514 Utilities::int_to_string(counter, 1));
1515 {
1516 declare_default_entry(prm, counter);
1517 }
1518 prm.leave_subsection();
1519 }
1520 }
1521 prm.leave_subsection();
1522 }
1523
1524 void
1525 BCDEM::parse_parameters(ParameterHandler &prm)
1526 {
1527 prm.enter_subsection("DEM boundary conditions");
1528
1530 prm.get_integer("number of boundary conditions");
1531
1532 for (unsigned int counter = 0;
1534 ++counter)
1535 {
1536 prm.enter_subsection("boundary condition " +
1537 Utilities::int_to_string(counter, 1));
1538 {
1540 }
1541 prm.leave_subsection();
1542 }
1543 prm.leave_subsection();
1544 }
1545
1546 void
1547 BCDEM::declare_default_entry(ParameterHandler &prm,
1548 const types::boundary_id default_boundary_id)
1549 {
1550 prm.declare_entry("boundary id",
1551 Utilities::to_string(default_boundary_id, 1),
1552 Patterns::List(Patterns::Integer()),
1553 "Boundary ID");
1554 prm.declare_entry(
1555 "type",
1556 "fixed_wall",
1557 Patterns::Selection(
1558 "fixed_wall|outlet|translational|rotational|periodic"),
1559 "Type of boundary condition. "
1560 "Choices are <fixed_wall|outlet|translational|rotational|periodic>.");
1561
1562 prm.declare_entry("speed x",
1563 "0.",
1564 Patterns::Double(),
1565 "Translational boundary speed in x direction");
1566 prm.declare_entry("speed y",
1567 "0.",
1568 Patterns::Double(),
1569 "Translational boundary speed in y direction");
1570 prm.declare_entry("speed z",
1571 "0.",
1572 Patterns::Double(),
1573 "Translational boundary speed in z direction");
1574
1575 prm.declare_entry("rotational speed",
1576 "0.",
1577 Patterns::Double(),
1578 "Rotational boundary speed");
1579
1580 prm.declare_entry("rotational vector",
1581 "1.,0.,0.",
1582 Patterns::List(Patterns::Double()),
1583 "Rotational vector elements");
1584
1585 prm.declare_entry("periodic id 0",
1586 "0",
1587 Patterns::Integer(),
1588 "Periodic boundary ID 0");
1589 prm.declare_entry("periodic id 1",
1590 "0",
1591 Patterns::Integer(),
1592 "Periodic boundary ID 1");
1593
1594 prm.declare_entry("point on rotational vector",
1595 "0, 0, 0",
1596 Patterns::List(Patterns::Double()),
1597 "Point on the rotational vector");
1598
1599 prm.declare_entry(
1600 "periodic direction",
1601 "0",
1602 Patterns::Integer(),
1603 "Periodic direction or normal direction of periodic boundary");
1604
1605 // Multiphysic DEM
1607 "thermal boundary type",
1609 "Thermal boundary type used in multiphysic DEM.");
1610
1611 auto wall_temperature_function_parsed =
1612 std::make_shared<Functions::ParsedFunction<3>>(1);
1613 prm.enter_subsection("wall temperature");
1614 {
1615 wall_temperature_function_parsed->declare_parameters(prm, 1);
1616 }
1617 prm.leave_subsection();
1618 }
1619
1620 void
1622 {
1623 std::vector<types::boundary_id> boundary_ids =
1625 const std::string boundary_type = prm.get("type");
1626
1627 for (const auto boundary_id : boundary_ids)
1628 {
1629 if (boundary_type == "outlet")
1630 {
1631 this->outlet_boundaries.insert(boundary_id);
1632 }
1633 else if (boundary_type == "translational")
1634 {
1635 Tensor<1, 3> translational_velocity;
1636 translational_velocity[0] = prm.get_double("speed x");
1637 translational_velocity[1] = prm.get_double("speed y");
1638 translational_velocity[2] = prm.get_double("speed z");
1639
1640 this->boundary_translational_velocity[boundary_id] =
1641 translational_velocity;
1642 }
1643 else if (boundary_type == "rotational")
1644 {
1645 double rotational_speed = prm.get_double("rotational speed");
1646
1647 // Read the rotational vector from a list of doubles
1648 Tensor<1, 3> rotational_vector =
1649 value_string_to_tensor<3>(prm.get("rotational vector"));
1650 AssertThrow(
1651 rotational_vector.norm() != 0.,
1652 ExcMessage(
1653 "Invalid rotational vector. Its norm cannot be equal to zero."));
1654 // Read the point from a list of doubles
1655 Tensor<1, 3> point_on_rotation_axis_tensor =
1657 prm.get("point on rotational vector"));
1658
1659 this->boundary_rotational_speed[boundary_id] = rotational_speed;
1660 this->boundary_rotational_vector[boundary_id] =
1661 rotational_vector / rotational_vector.norm();
1662 this->point_on_rotation_axis[boundary_id] =
1663 point_on_rotation_axis_tensor;
1664 }
1665 else if (boundary_type == "fixed_wall")
1666 {
1667 // Fixed walls are the default: they are not stored in any
1668 // container.
1669 }
1670 else if (boundary_type == "periodic")
1671 {
1672 // Periodic boundary conditions are keyed by the principal
1673 // periodic boundary id (periodic id 0) rather than the "boundary
1674 // id" field.
1675 const types::boundary_id periodic_id_0 =
1676 prm.get_integer("periodic id 0");
1677 this->periodic_boundaries[periodic_id_0] = {
1678 .neighbor_id = static_cast<types::boundary_id>(
1679 prm.get_integer("periodic id 1")),
1680 .direction = static_cast<unsigned int>(
1681 prm.get_integer("periodic direction"))};
1682 }
1683 else
1684 {
1685 AssertThrow(false,
1686 ExcMessage("Invalid DEM boundary condition type"));
1687 }
1688
1689 // Thermal boundary type, used only in multiphysic DEM. Only the
1690 // walls, which particles can touch, have a thermal boundary type.
1691 const bool is_wall = boundary_type == "fixed_wall" ||
1692 boundary_type == "translational" ||
1693 boundary_type == "rotational";
1694 const WallThermalBoundaryType thermal_type =
1696 prm.get("thermal boundary type"));
1697
1698 if (is_wall)
1699 {
1700 this->thermal_boundary_type[boundary_id] = thermal_type;
1701
1702 if (thermal_type == WallThermalBoundaryType::temperature)
1703 {
1704 // Temperature imposed on the boundary
1705 auto wall_temperature_function_parsed =
1706 std::make_shared<Functions::ParsedFunction<3>>(1);
1707 prm.enter_subsection("wall temperature");
1708 wall_temperature_function_parsed->parse_parameters(prm);
1709 prm.leave_subsection();
1710
1711 this->boundary_temperature[boundary_id] =
1712 wall_temperature_function_parsed;
1713 }
1714 }
1715 else
1716 {
1717 // The outlet and periodic boundaries are not walls: the particles
1718 // cannot touch them, so they cannot be something else than
1719 // adiabatic.
1720 AssertThrow(
1721 thermal_type == WallThermalBoundaryType::adiabatic,
1722 ExcMessage(
1723 "Invalid DEM boundary condition with an imposed temperature. Only "
1724 "the fixed_wall, translational and rotational boundary types can "
1725 "have the temperature thermal boundary type."));
1726 }
1727 }
1728 }
1729
1730 template <int dim>
1731 void
1733 {
1734 const GridMotion<dim> defaults;
1735 prm.enter_subsection("grid motion");
1736 {
1738 "motion type",
1739 defaults.motion_type,
1740 "Choosing grid motion type.");
1741
1742 prm.declare_entry("grid translational velocity x",
1743 Patterns::Tools::Convert<double>::to_string(
1744 defaults.grid_translational_velocity[0]),
1745 Patterns::Double(),
1746 "grid translational velocity x");
1747 prm.declare_entry("grid translational velocity y",
1748 Patterns::Tools::Convert<double>::to_string(
1749 defaults.grid_translational_velocity[1]),
1750 Patterns::Double(),
1751 "grid translational velocity y");
1752 prm.declare_entry("grid translational velocity z",
1753 dim == 3 ?
1754 Patterns::Tools::Convert<double>::to_string(
1755 defaults.grid_translational_velocity[dim - 1]) :
1756 "0",
1757 Patterns::Double(),
1758 "grid translational velocity z");
1759
1760 prm.declare_entry("grid rotational speed",
1761 Patterns::Tools::Convert<double>::to_string(
1762 defaults.grid_rotational_speed),
1763 Patterns::Double(),
1764 "grid rotational speed");
1765
1766 prm.declare_entry("grid rotational axis",
1767 Patterns::Tools::Convert<unsigned int>::to_string(
1768 defaults.grid_rotational_axis),
1769 Patterns::Integer(),
1770 "grid rotational axis");
1771 }
1772 prm.leave_subsection();
1773 }
1774
1775 template <int dim>
1776 void
1778 {
1779 prm.enter_subsection("grid motion");
1780 {
1781 motion_type = string_to_enum<MotionType>(prm.get("motion type"));
1782
1783 grid_rotational_speed = prm.get_double("grid rotational speed");
1784 grid_rotational_axis = prm.get_integer("grid rotational axis");
1785
1787 prm.get_double("grid translational velocity x");
1789 prm.get_double("grid translational velocity y");
1790 if (dim == 3)
1792 prm.get_double("grid translational velocity z");
1793 }
1794 prm.leave_subsection();
1795 }
1796
1797 void
1799 {
1800 const LagrangianPostProcessing defaults;
1801 prm.enter_subsection("post-processing");
1802 {
1803 prm.declare_entry(
1804 "lagrangian post-processing",
1805 Patterns::Tools::Convert<bool>::to_string(
1807 Patterns::Bool(),
1808 "State whether lagrangian post-processing should be performed.");
1809 prm.declare_entry(
1810 "force chains",
1811 Patterns::Tools::Convert<bool>::to_string(defaults.force_chains),
1812 Patterns::Bool(),
1813 "State whether force chains visualization should be performed.");
1814 prm.enter_subsection("particle wall collision statistics");
1815 {
1816 prm.declare_entry(
1817 "enable particle wall collision statistics",
1818 Patterns::Tools::Convert<bool>::to_string(
1820 Patterns::Bool(),
1821 "Enable the logging of particle-wall collision statistics. "
1822 "Choices are <true|false>.");
1823 prm.declare_entry(
1824 "log collisions with all walls",
1825 Patterns::Tools::Convert<bool>::to_string(
1827 Patterns::Bool(),
1828 "State whether collisions with all walls should be logged. "
1829 "Choices are <true|false>.");
1830 prm.declare_entry(
1831 "wall boundary ids",
1832 Patterns::Tools::Convert<std::vector<int>>::to_string(
1834 Patterns::List(Patterns::Integer()),
1835 "Boundary ids of the walls to log collisions with");
1836 prm.declare_entry(
1837 "collision statistics file",
1839 Patterns::FileName(),
1840 "Exported particle-wall collision results filename");
1841
1843 prm,
1844 "verbosity",
1845 defaults.collision_verbosity,
1846 "State whether collision starts and ends should be printed.",
1849 }
1850 prm.leave_subsection();
1851 }
1852 prm.leave_subsection();
1853 }
1854
1855 void
1857 {
1858 prm.enter_subsection("post-processing");
1859 {
1861 prm.get_bool("lagrangian post-processing");
1862 force_chains = prm.get_bool("force chains");
1863 prm.enter_subsection("particle wall collision statistics");
1864 {
1866 prm.get_bool("enable particle wall collision statistics");
1868 prm.get_bool("log collisions with all walls");
1870 convert_string_to_vector<int>(prm, "wall boundary ids");
1871 collision_stats_file_name = prm.get("collision statistics file");
1873 string_to_enum<Verbosity>(prm.get("verbosity"),
1875 "verbosity");
1876 }
1877 prm.leave_subsection();
1878 }
1879 prm.leave_subsection();
1880 }
1881 template <int dim>
1882 void
1884 {
1885 prm.enter_subsection("floating grid");
1886 {
1887 mesh.declare_parameters(prm);
1888 motion.declare_parameters(prm);
1889 prm.declare_entry("start time",
1890 Patterns::Tools::Convert<double>::to_string(
1891 time_start),
1892 Patterns::Double(),
1893 "Start time");
1894 prm.declare_entry("end time",
1895 Patterns::Tools::Convert<double>::to_string(time_end),
1896 Patterns::Double(),
1897 "End time");
1898 }
1899
1900 prm.leave_subsection();
1901 }
1902
1903 template <int dim>
1904 void
1906 {
1907 prm.enter_subsection("floating grid");
1908 {
1909 mesh.parse_parameters(prm);
1910 motion.parse_parameters(prm);
1911 time_start = prm.get_double("start time");
1912 time_end = prm.get_double("end time");
1913 }
1914
1915 prm.leave_subsection();
1916 }
1917
1918
1919 template <int dim>
1920 void
1922 {
1923 const ParticleRayTracing<dim> defaults;
1924 prm.enter_subsection("particle ray tracing");
1925 {
1926 // Location of the first photon to be inserted
1927 prm.declare_entry("starting photon insertion position",
1928 Patterns::Tools::Convert<Point<3>>::to_string(
1929 defaults.starting_point),
1930 Patterns::List(Patterns::Double()),
1931 "Location of the first photon being inserted.");
1932
1933 // In which direction will the photons be inserted relative to the
1934 // first photon.
1935 // The ":"-separated defaults are generated with the same patterns as
1936 // the ones used to declare the entries.
1937 const Patterns::List insertion_unit_tensors_pattern(
1938 Patterns::List(Patterns::Double(), 3, 3, ","), 3, 3, ":");
1939 prm.declare_entry(
1940 "insertion unit tensors",
1941 Patterns::Tools::Convert<std::vector<Tensor<1, 3>>>::to_string(
1943 insertion_unit_tensors_pattern),
1944 insertion_unit_tensors_pattern,
1945 "Directions used to insert photons.");
1946
1947 // How many photon will be inserted in each of those directions.
1948 const Patterns::List n_photons_pattern(Patterns::Integer(), 3, 3, ":");
1949 prm.declare_entry(
1950 "number of inserted photons per direction",
1951 Patterns::Tools::Convert<std::vector<unsigned int>>::to_string(
1952 defaults.n_photons_each_directions, n_photons_pattern),
1953 n_photons_pattern,
1954 "Number of inserted photon in each direction.");
1955
1956 // What is the distance between each photon in each of those directions
1957 // considering an offset equal to 0.
1958 const Patterns::List step_between_photons_pattern(Patterns::Double(),
1959 3,
1960 3,
1961 ":");
1962 prm.declare_entry(
1963 "distance between photons on insertion per direction",
1964 Patterns::Tools::Convert<std::vector<double>>::to_string(
1966 step_between_photons_pattern),
1967 step_between_photons_pattern,
1968 "Distance between inserted photons in each direction.");
1969
1970 // In which direction photons will move considering a photon maximum
1971 // angle offset equal to 0.
1972 prm.declare_entry("reference displacement vector",
1973 Patterns::Tools::Convert<Tensor<1, 3>>::to_string(
1975 Patterns::List(Patterns::Double()),
1976 "Reference displacement vector of each photons.");
1977
1978 // Insertion location
1979 prm.declare_entry(
1980 "photon insertion maximum offset",
1981 Patterns::Tools::Convert<double>::to_string(
1982 defaults.max_insertion_offset),
1983 Patterns::Double(),
1984 "Set the maximum offset applied on each photon position during their "
1985 "insertion, respectively to the insertion unit tensors. If set to 0., "
1986 "photons will be perfectly aligned.");
1987
1988 prm.declare_entry(
1989 "photon insertion prn seed",
1990 Patterns::Tools::Convert<unsigned int>::to_string(
1991 defaults.prn_seed_photon_insertion),
1992 Patterns::Integer(),
1993 "Pseudo random seed used to generate the offset for each photon "
1994 "insertion location.");
1995
1996 // Displacement unit vector
1997 prm.declare_entry(
1998 "photon maximum angular offset",
1999 Patterns::Tools::Convert<double>::to_string(
2000 defaults.max_angular_offset),
2001 Patterns::Double(),
2002 "Used to introduce randomness in the displacement direction of each "
2003 "photon. This parameter defines the maximum angle between a given "
2004 "photon displacement vector and the prescribed displacement vector "
2005 "parameter. If set to zero, every photon will move in the same "
2006 "direction defined by the prescribed displacement vector parameter. "
2007 "Otherwise, the offset is applied in a random orientation relative to "
2008 "the reference displacement vector parameter.");
2009
2010 prm.declare_entry("photon angular offset prn seed",
2011 Patterns::Tools::Convert<unsigned int>::to_string(
2013 Patterns::Integer(),
2014 "Pseudo random seed used to generated the angle "
2015 "offset and the random orientation.");
2016 }
2017 prm.leave_subsection();
2018 }
2019
2020 template <int dim>
2021 void
2023 {
2024 prm.enter_subsection("particle ray tracing");
2025 {
2026 // Location of the first photon to be inserted
2028 prm.get("starting photon insertion position"))));
2029
2030 // Extract the strings related to the three std::vector
2031 const std::vector<std::string> insertion_unit_tensors_string(
2032 Utilities::split_string_list(prm.get("insertion unit tensors"), ":"));
2033 const std::vector<std::string> n_photons_per_directions_strings(
2034 Utilities::split_string_list(
2035 prm.get("number of inserted photons per direction"), ":"));
2036 const std::vector<std::string>
2037 step_between_photon_per_direction_strings(
2038 Utilities::split_string_list(
2039 prm.get("distance between photons on insertion per direction"),
2040 ":"));
2041
2042 // We always use 3d tensor even in a dim=2 simulation. Still, we want to
2043 // make sure the user write 2d tensor in the prm when the simulation is
2044 // in 2d. They are put in 3D afterward.
2045 AssertThrow(
2046 insertion_unit_tensors_string.size() == dim &&
2047 n_photons_per_directions_strings.size() == dim &&
2048 step_between_photon_per_direction_strings.size() == dim,
2049 dealii::ExcMessage(
2050 "The \"insertion unit tensors\", \"distance between photons on"
2051 " insertion per direction\" and \"number of inserted photons per "
2052 "direction\" all need to have a number of dimension equal to the "
2053 "\"dimension\" parameter."));
2054
2055 // One entry per direction (dim entries), each stored as a 3D quantity.
2056 // The in-class defaults are cleared first, otherwise the parsed values
2057 // would be appended after them.
2062 n_photons_each_directions.reserve(3);
2064 for (int i = 0; i < dim; i++)
2065 {
2066 Tensor<1, dim> temp_direction_tensor =
2067 value_string_to_tensor<dim>(insertion_unit_tensors_string.at(i));
2068 temp_direction_tensor =
2069 temp_direction_tensor / temp_direction_tensor.norm();
2071 tensor_nd_to_3d(temp_direction_tensor));
2072
2073 n_photons_each_directions.emplace_back(
2074 Utilities::string_to_int(n_photons_per_directions_strings.at(i)));
2075
2077 Utilities::string_to_double(
2078 step_between_photon_per_direction_strings.at(i)));
2079 }
2080 // Reference displacement unit tensor
2083 prm.get("reference displacement vector")));
2086
2087 // Insertion offset
2089 prm.get_double("photon insertion maximum offset");
2091 prm.get_integer("photon insertion prn seed");
2092
2093 // Displacement direction offset
2094 max_angular_offset = prm.get_double("photon maximum angular offset");
2096 prm.get_integer("photon angular offset prn seed");
2097 }
2098 prm.leave_subsection();
2099 }
2100
2101 template class ForceTorqueOnWall<2>;
2102 template class ForceTorqueOnWall<3>;
2103 template class FloatingWalls<2>;
2104 template class FloatingWalls<3>;
2105 template class ModelParameters<2>;
2106 template class ModelParameters<3>;
2107 template class FloatingGrid<2>;
2108 template class FloatingGrid<3>;
2109 template class GridMotion<2>;
2110 template class GridMotion<3>;
2111 template class InsertionInfo<2>;
2112 template class InsertionInfo<3>;
2113 template struct ParticleRayTracing<2>;
2114 template struct ParticleRayTracing<3>;
2115
2116 } // namespace Lagrangian
2117} // namespace Parameters
Parameters for a floating grid in DEM simulations.
Parameters::Mesh< dim > mesh
Mesh parameters for the floating grid.
void declare_parameters(ParameterHandler &prm)
Declare the parameters in the parameter handler.
void parse_parameters(ParameterHandler &prm)
Parse the parameters from the parameter handler.
Parameters::Lagrangian::GridMotion< dim > motion
Motion parameters for the floating grid.
double time_start
Activation time of the floating grid.
double time_end
Deactivation time of the floating grid.
Parameters for floating walls in DEM simulations.
std::vector< double > time_end
Deactivation time of each floating wall.
static void declare_default_entry(ParameterHandler &prm)
Declare default parameter entries for a single floating wall.
std::vector< Point< dim > > points_on_walls
A point on each floating wall surface.
void parse_parameters(ParameterHandler &prm)
Parse the parameters from the parameter handler.
std::vector< Tensor< 1, dim > > floating_walls_normal_vectors
Outward normal vector of each floating wall.
void parse_floating_wall(const ParameterHandler &prm)
Parse parameters for a single floating wall.
void declare_parameters(ParameterHandler &prm) const
Declare the parameters in the parameter handler.
unsigned int floating_walls_number
Number of floating walls.
std::vector< double > time_start
Activation time of each floating wall.
ForceTorqueOnWall - Defines the parameters for the force and torques calculation on boundaries of the...
Parameters::Verbosity force_torque_verbosity
Verbosity level for force and torque output.
unsigned int output_frequency
Output frequency (in time steps).
Point< 3 > point_center_mass
Center of mass used for torque computation.
static void declare_parameters(ParameterHandler &prm)
Declare the parameters in the parameter handler.
void parse_parameters(ParameterHandler &prm)
Parse the parameters from the parameter handler.
std::string force_torque_output_name
File name prefix for force and torque output.
bool calculate_force_torque
Enable force and torque post-processing on wall boundaries.
Parameters for grid (mesh) motion in DEM simulations.
double grid_rotational_speed
Rotational speed of the rotating grid (rad/s).
unsigned int grid_rotational_axis
Rotational axis of the rotating grid (0=x, 1=y, 2=z).
enum Parameters::Lagrangian::GridMotion::MotionType motion_type
Type of grid motion.
void parse_parameters(ParameterHandler &prm)
Parse the parameters from the parameter handler.
Tensor< 1, dim > grid_translational_velocity
Translational velocity of the moving grid.
static void declare_parameters(ParameterHandler &prm)
Declare the parameters in the parameter handler.
Parameters controlling particle insertion in DEM simulations.
void parse_parameters(ParameterHandler &prm)
Parse the parameters from the parameter handler.
std::vector< double > list_vy
y-velocity for list insertion.
Point< 3 > insertion_box_point_1
First corner of the insertion box (volume method).
std::shared_ptr< Function< dim > > initial_temperature_function
std::vector< double > list_vx
x-velocity for list insertion.
std::shared_ptr< Function< dim > > insertion_acceptance_fct
Point< 3 > clear_box_point_1
First corner of the particle removal box.
std::vector< double > list_z
z-position for list insertion.
unsigned int inserted_this_step
Number of particles inserted at each insertion step.
std::vector< double > list_wz
z-angular velocity for list insertion.
Point< 3 > clear_box_point_2
Second corner of the particle removal box.
static void declare_parameters(ParameterHandler &prm)
Declare the parameters in the parameter handler.
std::vector< double > list_x
x-position for list insertion.
std::vector< double > list_T
Temperature for list insertion.
double insertion_maximum_offset
Maximum random offset applied to insertion positions.
Point< 3 > insertion_plane_point
Point on the insertion plane (plane method).
std::vector< double > list_wy
y-angular velocity for list insertion.
std::vector< double > list_vz
z-velocity for list insertion.
int insertion_frequency
Frequency of insertion (in time steps).
double distance_threshold
Minimum distance threshold between inserted particles.
std::vector< unsigned int > direction_sequence
Direction sequence for particle insertion (1st, 2nd, 3rd).
std::vector< double > list_y
y-position for list insertion.
Tensor< 1, 3 > initial_omega
Initial angular velocity of inserted particles.
std::vector< std::string > list_of_input_files
List of input files for the file insertion method.
bool removing_particles_in_region
Enable removal of particles in a specified region.
Tensor< 1, 3 > initial_vel
Initial translational velocity of inserted particles.
int seed_for_insertion
Random seed for particle insertion.
enum Parameters::Lagrangian::InsertionInfo::InsertionMethod insertion_method
Point< 3 > insertion_box_point_2
Second corner of the insertion box (volume method).
std::vector< double > list_wx
x-angular velocity for list insertion.
std::vector< double > list_d
Diameter for list insertion.
Tensor< 1, 3 > insertion_plane_normal_vector
Normal vector of the insertion plane (plane method).
Numerical model parameters for DEM simulations.
unsigned int dynamic_load_balance_check_frequency
Check frequency for dynamic load balancing.
double f_coefficient_epsd
Model parameter for the EPSD rolling resistance model.
std::shared_ptr< Function< dim > > cell_weight_function
enum Parameters::Lagrangian::ModelParameters::ContactDetectionMethod contact_detection_method
DEM::SolverType solver_type
Solver type (DEM, CFD-DEM, or DEM multiphysics).
RollingResistanceMethod rolling_resistance_method
Rolling resistance torque method.
unsigned int load_balance_particle_weight
Particle weight used for load balancing.
void parse_parameters(ParameterHandler &prm)
Parse the parameters from the parameter handler.
enum Parameters::Lagrangian::ModelParameters::LoadBalanceMethod load_balance_method
double dynamic_contact_search_factor
Safety factor for dynamic contact search.
unsigned int contact_detection_frequency
Frequency of particle-particle and particle-wall contact detection.
enum Parameters::Lagrangian::ModelParameters::IntegrationMethod integration_method
bool disable_position_integration
Disable position integration for particles.
unsigned int load_balance_frequency
Load balance frequency (in time steps).
double dmt_cut_off_threshold
Cut-off threshold beyond which Van der Waals forces are ignored.
bool sparse_particle_contacts
Enable sparse particle contacts to optimize performance.
double load_balance_threshold
Load balance threshold (for dynamic load balancing).
ParticleParticleContactForceModel particle_particle_contact_force_model
Particle-particle contact force model.
ParticleWallContactForceModel particle_wall_contact_force_method
Particle-wall contact force model.
static void declare_parameters(ParameterHandler &prm)
Declare the parameters in the parameter handler.
unsigned int load_balance_step
Load balance step (for single-step load balancing).
Tensor< 1, spacedim > value_string_to_tensor(const std::string &value_string)
Return the tensor corresponding to the value_string. If the dimension correspondence of the value_str...
Definition utilities.h:956
std::vector< std::pair< std::string, EnumType > > DeprecatedEnumNames
Deprecated strings of an enum parameter, each paired with the enumerator it stands for....
Definition utilities.h:765
std::vector< T > convert_string_to_vector(const ParameterHandler &prm, const std::string &entry_string)
Return the vector of size N of entry @entry_string. If the entry is specified in the ....
Definition utilities.h:1330
EnumType string_to_enum(const std::string &name)
Return the enumerator whose identifier is name, e.g. to parse the value of a parameter entry into its...
Definition utilities.h:734
void declare_enum_entry(ParameterHandler &prm, const std::string &entry_name, const EnumType default_value, const std::string &description, const DeprecatedEnumNames< EnumType > &deprecated_names={}, const std::vector< EnumType > &allowed_values={})
Declare a parameter entry whose value is an enumerator. The default value, the accepted values and th...
Definition utilities.h:888
@ hertz_JKR
Hertz model with Johnson-Kendall-Roberts cohesive force.
@ hertz_mindlin_limit_overlap
Hertz-Mindlin model with a limitation on tangential overlap.
@ hertz_mindlin_limit_force
Hertz-Mindlin model with a limitation on tangential force.
WallThermalBoundaryType
Thermal boundary type of the grid in multiphysic DEM. It is used to define the thermal boundary condi...
@ temperature
Temperature imposed on the wall. It can vary in space and time.
@ volume_based
Volume-based distribution weighting.
@ number_based
Number-based distribution weighting.
@ epsd
Elastic-plastic spring-dashpot.
@ viscous
Viscous rolling resistance.
@ constant
Constant rolling resistance.
@ none
No rolling resistance.
const std::vector< Verbosity > & quiet_or_verbose()
Return the verbosity levels accepted by the parameters which do not support Verbosity::extra_verbose.
const DeprecatedEnumNames< Verbosity > & deprecated_verbosity_names()
Return the deprecated strings of the parameters parsed into a Verbosity, which remain accepted in par...
Parameter structures for Lagrangian (DEM) particle simulations.
void parse_boundary_conditions(ParameterHandler &prm)
Parse boundary condition parameters for a single boundary.
std::map< types::boundary_id, double > boundary_rotational_speed
void parse_parameters(ParameterHandler &prm)
Parse the parameters from the parameter handler.
std::map< types::boundary_id, Tensor< 1, 3 > > boundary_translational_velocity
void declare_parameters(ParameterHandler &prm) const
Declare the parameters in the parameter handler.
static void declare_default_entry(ParameterHandler &prm, const types::boundary_id default_boundary_id)
Declare default parameter entries for a single boundary condition.
std::set< types::boundary_id > outlet_boundaries
std::map< types::boundary_id, std::shared_ptr< Function< 3 > > > boundary_temperature
unsigned int number_of_dem_boundary_conditions
Number of DEM boundary conditions.
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
static constexpr unsigned int max_number_of_dem_boundary_conditions
double specific_heats_ratio_gas
Specific heats ratio of the interstitial gas.
double molecular_mean_free_path_gas
Molecular mean free path of the interstitial gas.
std::vector< double > friction_coefficient_particle
Friction coefficient of each particle type.
double thermal_accommodation_wall
Thermal accommodation coefficient of the wall.
double dynamic_viscosity_gas
Dynamic viscosity of the interstitial gas.
void parse_parameters(ParameterHandler &prm)
Parse the parameters from the parameter handler.
std::vector< ProbabilityFunctionType > custom_probability_function_type
Custom distribution function type (PDF or CDF).
void parse_particle_properties(const unsigned int &particle_type, const ParameterHandler &prm)
Parse the physical properties for a given particle type.
std::vector< DistributionWeightingType > distribution_weighting_type
double thermal_conductivity_wall
Thermal conductivity of the wall.
Tensor< 1, 3 > g
Gravitational acceleration vector.
std::vector< double > rolling_friction_coefficient_particle
Rolling friction coefficient of each particle type.
std::vector< double > surface_energy_particle
Surface energy of each particle type.
std::vector< bool > custom_distribution_from_file
Indicate if the custom distribution is read from file.
double hamaker_constant_wall
Hamaker constant of the wall.
std::vector< double > youngs_modulus_particle
Young's modulus of each particle type.
std::vector< std::vector< double > > particle_custom_probability
std::vector< double > thermal_conductivity_particle
Thermal conductivity of each particle type.
std::vector< double > hamaker_constant_particle
Hamaker constant of each particle type.
std::vector< double > particle_size_std
Size standard deviation of each particle type.
std::vector< double > surface_roughness_particle
Surface roughness of each particle type.
void declare_parameters(ParameterHandler &prm) const
Declare the parameters in the parameter handler.
double real_youngs_modulus_wall
Real Young's modulus of the wall.
std::vector< double > specific_heat_particle
Specific heat of each particle type.
std::vector< double > diameter_min_cutoff
Minimum diameter cutoff for lognormal distribution.
double friction_coefficient_wall
Friction coefficient of the wall.
std::vector< double > rolling_viscous_damping_coefficient_particle
Rolling viscous damping coefficient of each particle type.
std::vector< double > real_youngs_modulus_particle
Real Young's modulus of each particle type.
void initialize_containers(std::vector< SizeDistributionType > &dist_types, std::vector< double > &p_average_diameter, std::vector< double > &p_size_std, std::vector< bool > &custom_dist_read_from_file, std::vector< std::string > &custom_dist_file_names, std::vector< ProbabilityFunctionType > &custom_function_type, std::vector< bool > &custom_interpolation, std::vector< std::vector< double > > &custom_diameter_values, std::vector< std::vector< double > > &custom_probabilities_values, std::vector< DistributionWeightingType > &distribution_weighting_basis_type, std::vector< unsigned int > &seed_for_dist, std::vector< double > &dia_min_cutoff, std::vector< double > &dia_max_cutoff, std::vector< int > &p_number, std::vector< double > &p_density, std::vector< double > &p_youngs_modulus, std::vector< double > &p_poisson_ratio, std::vector< double > &p_restitution_coefficient, std::vector< double > &p_friction_coefficient, std::vector< double > &p_rolling_viscous_damping_coefficient, std::vector< double > &p_rolling_friction_coefficient, std::vector< double > &p_surface_energy, std::vector< double > &p_hamaker_constant, std::vector< double > &p_thermal_conductivity, std::vector< double > &p_specific_heat, std::vector< double > &p_microhardness, std::vector< double > &p_surface_slope, std::vector< double > &p_surface_roughness, std::vector< double > &p_thermal_accommodation, std::vector< double > &p_real_youngs_modulus) const
initialize_containers - Initialize the containers used to store the particle size distribution and ph...
std::vector< double > poisson_ratio_particle
Poisson's ratio of each particle type.
static void declare_default_entry(ParameterHandler &prm)
Declare default parameter entries for a single particle type.
std::vector< double > diameter_max_cutoff
Maximum diameter cutoff for lognormal distribution.
std::vector< std::string > custom_distribution_filenames
Filename for the custom distribution for each particle type.
std::vector< double > density_particle
Density of each particle type.
std::vector< double > surface_slope_particle
Surface slope of each particle type.
std::vector< std::vector< double > > particle_custom_diameter
List of diameters for the custom distribution for each particle type.
std::vector< double > particle_average_diameter
Average diameter of each particle type.
std::vector< double > microhardness_particle
Microhardness of each particle type.
unsigned int particle_type_number
Number of particle types.
double specific_heat_gas
Specific heat of the interstitial gas.
double rolling_friction_wall
Rolling friction coefficient of the wall.
std::vector< double > thermal_accommodation_particle
Thermal accommodation coefficient of each particle type.
double thermal_conductivity_gas
Thermal conductivity of the interstitial gas.
double rolling_viscous_damping_wall
Rolling viscous damping coefficient of the wall.
double restitution_coefficient_wall
Coefficient of restitution of the wall.
std::vector< unsigned int > seed_for_distributions
Random seed for the size distribution.
std::vector< double > restitution_coefficient_particle
Coefficients of restitution of each particle type.
std::vector< int > number
Number particles of each particle type.
double surface_roughness_wall
Surface roughness of the wall.
Lagrangian Postprocessing - Defines the parameters for the Lagrangian post-processing.
Parameters::Verbosity collision_verbosity
Verbosity level for collision statistics output.
static void declare_parameters(ParameterHandler &prm)
Declare the parameters in the parameter handler.
bool lagrangian_post_processing_enabled
Enable Lagrangian post-processing.
std::vector< int > particle_wall_collision_boundary_ids
Boundary IDs of the walls for which collisions are logged.
bool particle_wall_collision_statistics
Enable logging of particle-wall contact statistics.
std::string collision_stats_file_name
File name for exporting collision statistics (CSV format).
bool force_chains
Enable force chains visualization.
bool log_collisions_with_all_walls
Log collisions with all walls (if false, only selected boundaries).
void parse_parameters(ParameterHandler &prm)
Parse the parameters from the parameter handler.
Defines parameters used to construct particle ray tracing class.
double max_angular_offset
Maximum angular offset applied to the photon displacement direction.
unsigned int prn_seed_photon_displacement
Random seed for photon displacement angular offset.
static void declare_parameters(ParameterHandler &prm)
Declare the parameters in the parameter handler.
void parse_parameters(ParameterHandler &prm)
Parse the parameters from the parameter handler.
double max_insertion_offset
Maximum random offset applied to the photon insertion position.
std::vector< Tensor< 1, 3 > > insertion_directions_units_vector
std::vector< unsigned int > n_photons_each_directions
Number of photons to insert along each direction.
Point< 3 > starting_point
Location of the first photon to be inserted.
unsigned int prn_seed_photon_insertion
Random seed for photon insertion position offset.
Tensor< 1, 3 > ref_displacement_tensor_unit
Reference unit tensor defining the photon displacement direction.
Tensor< 1, 3 > tensor_nd_to_3d(const Tensor< 1, dim > &tensor)
Point< 3 > point_nd_to_3d(const Point< dim > &point)