include/meltpooldg/particles/dem_time_integrators.hpp Source File

Developer Documentation: include/meltpooldg/particles/dem_time_integrators.hpp Source File
Developer Documentation
dem_time_integrators.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deal.II/base/timer.h>
4
9
10#include <concepts>
11#include <ranges>
12
13namespace MeltPoolDG
14{
43 template <int dim, typename number, typename ObstacleType, typename ContainerType>
44 requires std::ranges::range<ContainerType> and
45 std::same_as<std::ranges::range_value_t<ContainerType>,
46 DEMParticleAccessor<dim, number>>
47 void
48 symplectic_euler_advance_time_step(const number time_step, ContainerType particle_range)
49 {
50 for (DEMParticleAccessor<dim, number> &particle : particle_range)
51 {
52 for (unsigned d = 0; d < dim; ++d)
53 {
54 particle.linear_velocity(d) += time_step * particle.linear_acceleration(d);
55 particle.get_location()[d] += time_step * particle.linear_velocity(d);
56 particle.linear_acceleration(d) =
57 particle.force(d) / particle.get_property(ObstacleType::Properties::mass);
58 }
59
60 for (unsigned d = 0; d < axial_dim<dim>; ++d)
61 {
62 particle.angular_velocity(d) += time_step * particle.angular_acceleration(d);
63 particle.angular_acceleration(d) =
64 particle.torque(d) /
65 particle.get_property(ObstacleType::Properties::moment_of_inertia);
66 }
67 }
68 }
69} // namespace MeltPoolDG
Definition particle_accessor.hpp:20
Interface for a general preconditioner.
Definition boundary_condition_functions.hpp:17
and std::same_as< std::ranges::range_value_t< ContainerType >, DEMParticleAccessor< dim, number > > void symplectic_euler_advance_time_step(const number time_step, ContainerType particle_range)
Advances particle states by one time step using the symplectic Euler scheme.
Definition dem_time_integrators.hpp:48