Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
multiphysics_integrator.cc
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2025-2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
5
6template <int dim, typename PropertiesIndex>
7void
8integrate_temperature(Particles::ParticleHandler<dim> &particle_handler,
9 const double dt,
10 std::vector<double> &heat_transfer_rate,
11 const std::vector<double> &heat_source)
12{
13 for (auto particle = particle_handler.begin();
14 particle != particle_handler.end();
15 ++particle)
16 {
17 const types::particle_index particle_id = particle->get_local_index();
18 auto particle_properties = particle->get_properties();
19 double &particle_heat_transfer_rate = heat_transfer_rate[particle_id];
20 double particle_heat_source = heat_source[particle_id];
21 const double mass_inverse =
22 1 / particle_properties[PropertiesIndex::mass];
23 const double specific_heat_inverse =
24 1 / particle_properties[PropertiesIndex::specific_heat];
25
26 // Integration
27 particle_properties[PropertiesIndex::T] +=
28 dt * (particle_heat_transfer_rate + particle_heat_source) *
29 mass_inverse * specific_heat_inverse;
30
31 // Reinitialize heat_transfer_rate
32 particle_heat_transfer_rate = 0;
33 }
34}
35
36template void
38 Particles::ParticleHandler<2> &particle_handler,
39 const double dt,
40 std::vector<double> &heat_transfer_rate,
41 const std::vector<double> &heat_source);
42
43template void
45 Particles::ParticleHandler<3> &particle_handler,
46 const double dt,
47 std::vector<double> &heat_transfer_rate,
48 const std::vector<double> &heat_source);
49
50template void
52 Particles::ParticleHandler<2> &particle_handler,
53 const double dt,
54 std::vector<double> &heat_transfer_rate,
55 const std::vector<double> &heat_source);
56
57template void
59 Particles::ParticleHandler<3> &particle_handler,
60 const double dt,
61 std::vector<double> &heat_transfer_rate,
62 const std::vector<double> &heat_source);
template void integrate_temperature< 2, DEM::DEMMPProperties::PropertiesIndex >(Particles::ParticleHandler< 2 > &particle_handler, const double dt, std::vector< double > &heat_transfer_rate, const std::vector< double > &heat_source)
void integrate_temperature(Particles::ParticleHandler< dim > &particle_handler, const double dt, std::vector< double > &heat_transfer_rate, const std::vector< double > &heat_source)
Implementation of an explicit euler time-stepping scheme for the integration of the particles' temper...
template void integrate_temperature< 2, DEM::CFDDEMMPProperties::PropertiesIndex >(Particles::ParticleHandler< 2 > &particle_handler, const double dt, std::vector< double > &heat_transfer_rate, const std::vector< double > &heat_source)
template void integrate_temperature< 3, DEM::CFDDEMMPProperties::PropertiesIndex >(Particles::ParticleHandler< 3 > &particle_handler, const double dt, std::vector< double > &heat_transfer_rate, const std::vector< double > &heat_source)
template void integrate_temperature< 3, DEM::DEMMPProperties::PropertiesIndex >(Particles::ParticleHandler< 3 > &particle_handler, const double dt, std::vector< double > &heat_transfer_rate, const std::vector< double > &heat_source)