Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
lagrangian_post_processing.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2021-2025 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_lagrangian_post_processing_h
5#define lethe_lagrangian_post_processing_h
6
7
8#include <core/pvd_handler.h>
9
11#include <dem/data_containers.h>
13
14#include <deal.II/distributed/tria.h>
15
16using namespace dealii;
17
18/**
19 * This class deals with Lagrangian post-processing. At the moment, calculation
20 * of time-averaged particles velocity and granular temperature are added to the
21 * class.
22 *
23 * @todo Add tracer particles
24 */
25
26/**
27 * @brief Carries out writing the cell data of the domain.
28 *
29 * @tparam dim An integer that denotes the number of spatial dimensions.
30 * @tparam PropertiesIndex Index of the properties used within the ParticleHandler.
31 *
32 * @param triangulation Triangulation of the domain.
33 * @param grid_pvdhandler PVD handler for grid.
34 * @param background_dh Background DoF handler.
35 * @param particle_handler Particle handler.
36 * @param dem_parameters DEM parameters.
37 * @param current_time Simulation time.
38 * @param step_number DEM step number.
39 * @param mpi_communicator MPI communicator.
40 * @param sparse_contacts_object Àdaptive sparse contacts object.
41 */
42template <int dim, typename PropertiesIndex>
43void
45 const parallel::distributed::Triangulation<dim> &triangulation,
46 PVDHandler &grid_pvdhandler,
47 const DoFHandler<dim> &background_dh,
48 const Particles::ParticleHandler<dim> &particle_handler,
49 const DEMSolverParameters<dim> &dem_parameters,
50 const double current_time,
51 const unsigned int step_number,
52 const MPI_Comm &mpi_communicator,
53 AdaptiveSparseContacts<dim, PropertiesIndex> &sparse_contacts_object);
54
55/**
56 * @brief Carries out the calculation of the average particles velocity in each local
57 * cell. These values are summed up during the post-processing steps (imposed
58 * by post-processing frequency), and finally divided by the sampling counter
59 * to calculate time-averaged particles velocity distribution.
60 *
61 * @param triangulation Triangulation.
62 * @param particle_handler Particle handler.
63 * @param velocity_average_x Average velocity in x-direction.
64 * @param velocity_average_y Average velocity in y-direction.
65 * @param velocity_average_z Average velocity in z-direction.
66 * @param velocity_average_magnitude Average velocity magnitude.
67 */
68template <int dim, typename PropertiesIndex>
69void
71 const parallel::distributed::Triangulation<dim> &triangulation,
72 const Particles::ParticleHandler<dim> &particle_handler,
73 Vector<double> &velocity_average_x,
74 Vector<double> &velocity_average_y,
75 Vector<double> &velocity_average_z,
76 Vector<double> &velocity_average_magnitude);
77
78/**
79 * @brief Carries out the calculation of the granular temperature in each local cell.
80 * These values are summed up during the post-processing steps (imposed by
81 * post-processing frequency), and finally divided by the sampling counter to
82 * calculate time-averaged granular temperature distribution.
83 *
84 * @param triangulation Triangulation.
85 * @param particle_handler Particle handler.
86 * @param granular_temperature_average Average granular temperature.
87 */
88template <int dim, typename PropertiesIndex>
89void
91 const parallel::distributed::Triangulation<dim> &triangulation,
92 const Particles::ParticleHandler<dim> &particle_handler,
93 Vector<double> &granular_temperature_average);
94
95/**
96 * @brief Carries out the calculation of average particles velocity for a single
97 * cell. It is defined as a separate private function since the
98 * calculate_average_granular_temperature function also needs to obtain the
99 * average velocity in the cell.
100 *
101 * @param cell A single cell in the triangulation
102 * @param particle_handler
103 *
104 * @return A tensor which stores the average particles velocity in the input cell
105 */
106template <int dim, typename PropertiesIndex>
107Tensor<1, dim>
109 const typename parallel::distributed::Triangulation<dim>::cell_iterator &cell,
110 const Particles::ParticleHandler<dim> &particle_handler);
111
112#endif
Mechanism that disables contacts computation through mobility status of cells based on granular tempe...
Handles all the parameters declared in the parameter handler file.
The PVDHandler class manages the storage of the information required to write pvd file....
Definition pvd_handler.h:17
Tensor< 1, dim > calculate_cell_average_particles_velocity(const typename parallel::distributed::Triangulation< dim >::cell_iterator &cell, const Particles::ParticleHandler< dim > &particle_handler)
Carries out the calculation of average particles velocity for a single cell. It is defined as a separ...
void calculate_average_particles_velocity(const parallel::distributed::Triangulation< dim > &triangulation, const Particles::ParticleHandler< dim > &particle_handler, Vector< double > &velocity_average_x, Vector< double > &velocity_average_y, Vector< double > &velocity_average_z, Vector< double > &velocity_average_magnitude)
Carries out the calculation of the average particles velocity in each local cell. These values are su...
void calculate_average_granular_temperature(const parallel::distributed::Triangulation< dim > &triangulation, const Particles::ParticleHandler< dim > &particle_handler, Vector< double > &granular_temperature_average)
Carries out the calculation of the granular temperature in each local cell. These values are summed u...
void write_post_processing_results(const parallel::distributed::Triangulation< dim > &triangulation, PVDHandler &grid_pvdhandler, const DoFHandler< dim > &background_dh, const Particles::ParticleHandler< dim > &particle_handler, const DEMSolverParameters< dim > &dem_parameters, const double current_time, const unsigned int step_number, const MPI_Comm &mpi_communicator, AdaptiveSparseContacts< dim, PropertiesIndex > &sparse_contacts_object)
Carries out writing the cell data of the domain.