4#ifndef lethe_cfd_dem_coupling_h
5#define lethe_cfd_dem_coupling_h
20#include <deal.II/base/work_stream.h>
45template <
int dim,
typename PropertiesIndex>
102 std::shared_ptr<Integrator<dim, PropertiesIndex>>
137 const bool restart =
false)
override
139 unsigned int ref_iter = 0;
168 std::vector<OutputStructTableHandler>
356 "You are trying to use the DEMSubSimulationControl when it has not been allocated yet."));
358 const double time_step_rayleigh_ratio =
360 this->
pcout <<
"DEM time step is " << time_step_rayleigh_ratio * 100
361 <<
"% of Rayleigh time step" << std::endl;
443 std::shared_ptr<ParticleParticleContactForceBase<dim, PropertiesIndex>>
447 std::shared_ptr<ParticleWallContactForceBase<dim, PropertiesIndex>>
dem_data_structures< dim >::vector_on_boundary torques_boundary_information
Torque information stored on boundary elements.
double maximum_particle_diameter
Maximum diameter among all particles in the simulation.
void add_fluid_particle_interaction_force()
Calculate and add fluid-particle interaction forces.
ParticleInteractionOutcomes< PropertiesIndex > contact_outcome
Container for particle interaction outcomes (forces and torques).
DEM::dem_data_structures< dim >::periodic_boundaries_cells_info periodic_boundaries_cells_information
Information about cells involved in periodic boundary conditions.
void dem_contact_build()
Perform contact detection and build contact lists.
std::vector< OutputStructTableHandler > gather_tables() override
Gather TableHandler objects for serialization during checkpointing.
std::vector< std::shared_ptr< Distribution > > size_distribution_object_container
Container for particle size distribution objects.
dem_data_structures< dim >::vector_on_boundary forces_boundary_information
Force information stored on boundary elements.
void add_fluid_particle_interaction_torque()
Calculate and add fluid-particle interaction torques.
virtual void solve() override
Engine of the CFD-DEM solver. Calls all the necessary functions to set parameters,...
dem_data_structures< dim >::boundary_points_and_normal_vectors updated_boundary_points_and_normal_vectors
Updated boundary points and their corresponding normal vectors.
void report_rayleigh_time_ratio()
Reports the ratio between the DEM time step and the Rayleigh time.
double rayleigh_time_step
Rayleigh time step.
DEM::ParticleProperties< dim, PropertiesIndex > properties_class
Particle properties handler for DEM simulation.
AdaptiveSparseContacts< dim, PropertiesIndex > sparse_contacts_object
Object for handling adaptive sparse contact detection algorithms.
unsigned int contact_search_total_number
Total number of contact searches since simulation start.
std::shared_ptr< Integrator< dim, PropertiesIndex > > integrator_object
Time integration scheme for particle motion equations.
void print_particles_summary()
Print final summary of particle simulation results.
dem_data_structures< dim >::solid_surfaces_mesh_information solid_surfaces_mesh_info
Mesh information for solid surfaces in contact with particles.
std::shared_ptr< ParticleWallContactForceBase< dim, PropertiesIndex > > particle_wall_contact_force_object
Contact force model for particle-wall interactions.
TableHandler table_phase_volumes
void postprocess_fd(bool first_iteration) override
Perform fluid dynamics post-processing after each iteration.
DEMSolverParameters< dim > dem_parameters
DEM simulation parameters container.
void read_checkpoint() override
Read CFD-DEM simulation checkpoint files.
std::shared_ptr< Integrator< dim, PropertiesIndex > > set_integrator_type()
Set up the time integration method for particle motion.
void report_particle_statistics()
Calculate and report particle statistics to the terminal.
const unsigned int n_mpi_processes
Total number of MPI processes.
std::vector< Tensor< 1, 3 > > & force
Reference to force vector from contact outcomes.
void check_contact_detection_method(unsigned int counter)
Check if contact detection is required and execute it if necessary.
void set_initial_condition(const Parameters::FluidDynamicsInitialConditionType initial_condition_type, const bool restart=false) override
Set the initial condition. The version in this class does not output the solution,...
unsigned int contact_search_counter
Counter for contact searches performed in the current CFD iteration.
CompletedCollisionLog< dim > collision_event_log
Object to store completed collision events.
const unsigned int this_mpi_process
Current MPI process identifier.
BoundaryCellsInformation< dim > boundary_cell_object
Information about boundary cells for contact detection.
std::vector< Tensor< 1, 3 > > & torque
Reference to torque vector from contact outcomes.
void dynamic_flow_control() override
Calculate dynamic flow control accounting for void fraction.
void particle_wall_contact_force()
Calculate contact forces between particles and walls.
PVDHandler grid_pvdhandler
PVD handler for grid visualization output.
std::shared_ptr< ParticleParticleContactForceBase< dim, PropertiesIndex > > particle_particle_contact_force_object
Contact force model for particle-particle interactions.
Tensor< 1, 3 > g
Gravitational acceleration vector.
void setup_distribution_type()
Initialize the particle size distribution and related parameters.
statistics contact_list
Statistics container for timing and contact list information.
void sort_particles_into_subdomains_and_cells()
Sort particles into subdomains and cells for efficient processing.
void synchronize_particle_velocities()
Carry out the closing half velocity step of a staggered integration scheme at the end of the DEM sub-...
void dem_setup_parameters()
Set up the various parameters related to the DEM simulation.
LagrangianLoadBalancing< dim, PropertiesIndex > load_balancing
Load balancing handler for distributing particles across MPI processes.
~CFDDEMSolver() override
Destructor for the CFD-DEM solver.
PeriodicBoundariesManipulator< dim > periodic_boundaries_object
Handler for periodic boundary condition manipulations.
DEMActionManager * dem_action_manager
Pointer to DEM action manager for handling DEM-specific operations.
void dem_iterator()
Execute a complete DEM iteration step.
std::shared_ptr< SubSimulationControlDEM > dem_simulation_control
void read_dem() override
Read DEM restart files from a previous simulation.
double neighborhood_threshold_squared
Squared threshold distance for neighborhood particle detection.
DEMContactManager< dim, PropertiesIndex > contact_manager
void initialize_dem_parameters()
Initialize fundamental DEM simulation parameters.
std::vector< double > displacement
Displacement vector for particle motion calculations.
OngoingCollisionLog< dim > ongoing_collision_log
Object to store ongoing collision information.
double smallest_contact_search_criterion
Smallest criterion used for contact search algorithms.
void postprocess_cfd_dem()
Perform CFD-DEM coupled post-processing after each iteration.
PVDHandler particles_pvdhandler
PVD handler for particle visualization output.
Visualization< dim, PropertiesIndex > visualization_object
Visualization handler for DEM output generation.
void write_dem_output_results()
Write DEM simulation results to output files.
void write_checkpoint() override
Write CFD-DEM simulation checkpoint files.
ParticlePointLineForce< dim, PropertiesIndex > particle_point_line_contact_force_object
Handler for point and line contact forces between particles.
CFDDEMSolver(CFDDEMSimulationParameters< dim > &nsparam)
Constructor for the CFD-DEM solver.
std::shared_ptr< Insertion< dim, PropertiesIndex > > insertion_object
Particle insertion method handler.
void insert_particles()
Check if particles need to be inserted and perform insertion.
void load_balance()
Check if load balancing is required and perform it if necessary.
std::vector< double > MOI
Moment of inertia values for all particles.
Class that stores all the completed collision events.
Manage the actions to be performed in the DEM solver and on the DEM part of the coupling CFD-DEM solv...
Handles all the parameters declared in the parameter handler file.
Controls the name of output variables for the vtu.
virtual void set_initial_condition_fd(Parameters::FluidDynamicsInitialConditionType initial_condition_type, bool restart=false) override
Sets the initial condition for the solver.
FluidDynamicsVANS(CFDDEMSimulationParameters< dim > &nsparam)
Constructor for the VANS solver.
Manages the load balancing (repartitioning), of the domain according to the computational load of the...
virtual void refine_mesh()
SimulationParameters< dim > simulation_parameters
std::shared_ptr< MultiphysicsInterface< dim > > multiphysics
Class managing the ongoing collisions.
The PVDHandler class manages the storage of the information required to write pvd file....
Class where the outcomes of particle-particle interactions are stored.
Calculate the non-linear particle-point and particle-line contact force using the information obtaine...
Building patches of particle properties for visualization. This function is taken from Aspect and dea...
A simple container for storing basic statistical values.
FluidDynamicsInitialConditionType
std::vector< std::vector< std::pair< typename Triangulation< dim >::active_cell_iterator, typename Triangulation< dim - 1, dim >::active_cell_iterator > > > solid_surfaces_mesh_information
ankerl::unordered_dense::map< unsigned int, std::map< types::boundary_id, Tensor< 1, 3 > > > vector_on_boundary
ankerl::unordered_dense::map< global_face_id, std::pair< Tensor< 1, 3 >, Point< 3 > > > boundary_points_and_normal_vectors
std::unordered_multimap< types::global_cell_index, periodic_boundaries_cells_info_struct< dim > > periodic_boundaries_cells_info