Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
grid_motion.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2021-2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_grid_motion_h
5#define lethe_grid_motion_h
6
7#include <dem/contact_info.h>
10
11#include <deal.II/distributed/tria.h>
12
13using namespace dealii;
14
15/**
16 * @brief Carries out motion of the triangulation, including rotational, translational
17 * and rotational-translational motions.
18 *
19 * @note Grid motion with a ParsedFunction should be added to the code as a future
20 * improvement
21 * @param triangulation Triangulation
22 * @param dem_parameters Input DEM parameters in the parameter handler file
23 *
24 */
25
26template <int dim, int spacedim = dim>
28{
30 Triangulation<dim, spacedim> &triangulation);
32
33public:
34 /**
35 * @brief The constructor sets up the grid motion function defined in the parameter
36 * handler, and calculates the rotation angle for rotational and
37 * translational-rotational motions.
38 *
39 * @param grid_motion_parameters DEM parameters defined using the parameter handler
40 * @param dem_time_step DEM time step
41 */
43 const Parameters::Lagrangian::GridMotion<spacedim> &grid_motion_parameters,
44 const double dem_time_step);
45
46 /**
47 * @brief Calls the desired grid motion.
48 *
49 * @param triangulation Triangulation
50 */
51 void
52 move_grid(Triangulation<dim, spacedim> &triangulation)
53 {
54 (this->*grid_motion)(triangulation);
55 }
56
57 /**
58 * @brief Carries out updating the boundary points and normal vectors in the
59 * particle-wall contact list.
60 *
61 * @param particle_wall_pairs_in_contact The particle-wall contact list container.
62 * We will update the positions of the boundary points and normal vectors
63 * directly in this container.
64 * @param updated_boundary_points_and_normal_vectors A map that contains
65 * updated points on boundaries and normal vectors of the boundary faces.
66 * This container is used when the grid is moving. We use this vector to
67 * update the boundary points and normal vectors in particle-wall contact
68 * list.
69 */
70 void
73 &particle_wall_pairs_in_contact,
74 const typename DEM::dem_data_structures<
75 spacedim>::boundary_points_and_normal_vectors
76 &updated_boundary_points_and_normal_vectors);
77
78private:
79 /**
80 * @brief Carries out rotational motion of the triangulation
81 *
82 * @param triangulation Triangulation
83 */
84 void
85 move_grid_rotational(Triangulation<dim, spacedim> &triangulation);
86
87 /**
88 * @brief Carries out translational motion of the triangulation
89 *
90 * @param triangulation Triangulation
91 */
92 void
93 move_grid_translational(Triangulation<dim, spacedim> &triangulation);
94
95 /**
96 * @brief Dummy function for no motion for grid motion pointer to point to.
97 *
98 */
99 void
100 no_motion(Triangulation<dim, spacedim> & /* triangulation */)
101 {
102 return;
103 }
104
105
106 // Since the DEM time step and rotational speed are constant, we calculate the
107 // rotation angle at each time step once in the constructor and define it as a
108 // member variable.
110
111 unsigned int rotation_axis;
112
113 Tensor<1, spacedim> shift_vector;
114};
115
116
117#endif
FuncPtrType grid_motion
Definition grid_motion.h:31
void(GridMotionBase< dim, spacedim >::*)( Triangulation< dim, spacedim > &triangulation) FuncPtrType
Definition grid_motion.h:29
double rotation_angle
void update_boundary_points_and_normal_vectors_in_contact_list(typename DEM::dem_data_structures< spacedim >::particle_wall_in_contact &particle_wall_pairs_in_contact, const typename DEM::dem_data_structures< spacedim >::boundary_points_and_normal_vectors &updated_boundary_points_and_normal_vectors)
Carries out updating the boundary points and normal vectors in the particle-wall contact list.
GridMotionBase(const Parameters::Lagrangian::GridMotion< spacedim > &grid_motion_parameters, const double dem_time_step)
The constructor sets up the grid motion function defined in the parameter handler,...
void move_grid(Triangulation< dim, spacedim > &triangulation)
Calls the desired grid motion.
Definition grid_motion.h:52
void no_motion(Triangulation< dim, spacedim > &)
Dummy function for no motion for grid motion pointer to point to.
void move_grid_rotational(Triangulation< dim, spacedim > &triangulation)
Carries out rotational motion of the triangulation.
unsigned int rotation_axis
Tensor< 1, spacedim > shift_vector
void move_grid_translational(Triangulation< dim, spacedim > &triangulation)
Carries out translational motion of the triangulation.
Parameters for grid (mesh) motion in DEM simulations.
DEM data structure containers To improve readability of containers, there's a simple description abov...
ankerl::unordered_dense::map< types::particle_index, ankerl::unordered_dense::map< global_face_id, particle_wall_contact_info< dim > > > particle_wall_in_contact