Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
SubSimulationControlDEM Class Reference

#include <sub_simulation_control.h>

Public Types

enum class  DEMSubIterationLogic { fixed_number_of_iterations = 0 , fixed_fraction_of_rayleigh_time_step = 1 }

Public Member Functions

 SubSimulationControlDEM (const DEMSubIterationLogic iteration_logic, const double time_interval, const unsigned int coupling_frequency, const double rayleigh_characteristic_time, const double fraction_of_rayleigh_characteristic_time)
bool iterate ()
unsigned int get_iteration () const
double get_time_step () const
bool is_first_iteration () const
bool is_last_iteration () const

Private Attributes

const DEMSubIterationLogic iteration_logic
const double time_interval
const unsigned int coupling_frequency
const double rayleigh_characteristic_time
const double fraction_of_rayleigh_characteristic_time
unsigned int iteration_number
unsigned int total_number_of_iterations
double time_step

Detailed Description

Controls DEM sub iteration logic.

The SubSimulationControlDEM class is responsible for managing the progression of the DEM component of a CFD-DEM simulation.

This class supports two approaches for the DEM iteration:

  • Fixed number of iterations: In this case, a fixed number of DEM iterations is carried out for each CFD time step. If the CFD uses adaptive time stepping, then the DEM simulation time step may change dynamically during the simulation.
  • Fixed fraction of Rayleigh characteristic time: In this case, the DEM time step is fixed to a fraction of the Rayleigh characteristic time step. This means that the number of DEM iterations per CFD time step is adjusted dynamically.

Definition at line 44 of file sub_simulation_control.h.

Member Enumeration Documentation

◆ DEMSubIterationLogic

Type of iteration method for DEM sub simulation control.

Declares the types of sub simulation control that are available for CFD-DEM simulations.

Enumerator
fixed_number_of_iterations 

Fixed number of DEM iterations per CFD time step.

fixed_fraction_of_rayleigh_time_step 

DEM time step is fixed at a constant fraction of the Rayleigh time step.

Definition at line 54 of file sub_simulation_control.h.

Constructor & Destructor Documentation

◆ SubSimulationControlDEM()

SubSimulationControlDEM::SubSimulationControlDEM ( const DEMSubIterationLogic iteration_logic,
const double time_interval,
const unsigned int coupling_frequency,
const double rayleigh_characteristic_time,
const double fraction_of_rayleigh_characteristic_time )

Construct a SubSimulationControlDEM object.

Depending on the iteration logic, the constructor calculates the total number of DEM iterations and the DEM time step. When using a fixed number of iterations, the time step is derived from the time interval and the coupling frequency. When using a fixed fraction of the Rayleigh characteristic time, the time step is set to the specified fraction and the number of iterations is derived accordingly.

Parameters
[in]iteration_logicThe logic used to determine the DEM sub iteration time step and number of iterations.
[in]time_intervalThe time interval over which the DEM sub iterations are to be carried out. This corresponds to the CFD time step.
[in]coupling_frequencyThe number of DEM iterations per CFD time step. Only used when iteration_logic is DEMSubIterationLogic::fixed_number_of_iterations.
[in]rayleigh_characteristic_timeThe Rayleigh characteristic time step of the particles.
[in]fraction_of_rayleigh_characteristic_timeThe target fraction of the Rayleigh characteristic time to use as the DEM time step. Only used when iteration_logic is DEMSubIterationLogic::fixed_fraction_of_rayleigh_time_step.

Definition at line 9 of file sub_simulation_control.cc.

References coupling_frequency, fixed_number_of_iterations, fraction_of_rayleigh_characteristic_time, iteration_logic, iteration_number, rayleigh_characteristic_time, time_interval, time_step, and total_number_of_iterations.

Member Function Documentation

◆ get_iteration()

unsigned int SubSimulationControlDEM::get_iteration ( ) const
inline

Get the current DEM sub iteration number.

Returns
The current iteration number within the DEM sub simulation.

Definition at line 114 of file sub_simulation_control.h.

References iteration_number.

◆ get_time_step()

double SubSimulationControlDEM::get_time_step ( ) const
inline

Get the DEM sub simulation time step.

Returns
The time step used for the DEM sub iterations.

Definition at line 125 of file sub_simulation_control.h.

References time_step.

◆ is_first_iteration()

bool SubSimulationControlDEM::is_first_iteration ( ) const
inline

Check if this is the first DEM sub iteration.

The first iteration corresponds to either the state before the sub simulation control has started iterating (iteration_number == 0) or the first iteration it is actually carrying out (iteration_number == 1).

Returns
true if this is the first iteration, false otherwise.

Definition at line 140 of file sub_simulation_control.h.

References iteration_number.

◆ is_last_iteration()

bool SubSimulationControlDEM::is_last_iteration ( ) const
inline

Check if this is the last DEM sub iteration.

The last iteration is reached when the iteration number equals the total number of iterations required to complete the DEM sub simulation within the current CFD time step.

Returns
true if this is the last iteration, false otherwise.

Definition at line 155 of file sub_simulation_control.h.

References iteration_number, and total_number_of_iterations.

◆ iterate()

bool SubSimulationControlDEM::iterate ( )

Advance the DEM sub simulation by one iteration.

Increments the iteration counter by one and checks whether additional iterations are required to complete the DEM sub simulation within the current CFD time step. As long as this method returns true, the DEM simulation should continue iterating.

Returns
true if more iterations are needed, false if the sub simulation is complete.

Definition at line 74 of file sub_simulation_control.cc.

References iteration_number, and total_number_of_iterations.

Member Data Documentation

◆ coupling_frequency

const unsigned int SubSimulationControlDEM::coupling_frequency
private

Coupling frequency. This is only used when iteration_logic=fixed_number_of_iterations

Definition at line 169 of file sub_simulation_control.h.

◆ fraction_of_rayleigh_characteristic_time

const double SubSimulationControlDEM::fraction_of_rayleigh_characteristic_time
private

Targeted fraction of the Rayleigh characteristic time. This is only used when iteration_logic=fixed_fraction_of_rayleigh_time_step

Definition at line 176 of file sub_simulation_control.h.

◆ iteration_logic

const DEMSubIterationLogic SubSimulationControlDEM::iteration_logic
private

Logic used for the DEM iterations.

Definition at line 162 of file sub_simulation_control.h.

◆ iteration_number

unsigned int SubSimulationControlDEM::iteration_number
private

Current value of the sub iteration number. This is initialized to zero.

Definition at line 179 of file sub_simulation_control.h.

◆ rayleigh_characteristic_time

const double SubSimulationControlDEM::rayleigh_characteristic_time
private

Rayleigh characteristic time for the particles.

Definition at line 172 of file sub_simulation_control.h.

◆ time_interval

const double SubSimulationControlDEM::time_interval
private

Time interval over which the time integration is to be carried out.

Definition at line 165 of file sub_simulation_control.h.

◆ time_step

double SubSimulationControlDEM::time_step
private

Time step value of the sub time stepping.

Definition at line 186 of file sub_simulation_control.h.

◆ total_number_of_iterations

unsigned int SubSimulationControlDEM::total_number_of_iterations
private

Total number of iterations. This is the number of iterations that is required until the completion of the sub simulation control

Definition at line 183 of file sub_simulation_control.h.


The documentation for this class was generated from the following files: