5#ifndef lethe_flow_control_h
6#define lethe_flow_control_h
10#include <deal.II/base/tensor.h>
59 const unsigned int &step_number);
91 const double &particle_density)
const
93 Tensor<1, 3> beta_particle;
94 beta_particle[0] =
beta[0];
95 beta_particle[1] =
beta[1];
97 if constexpr (dim == 3)
98 beta_particle[2] =
beta[2];
100 return beta_particle * fluid_density / particle_density;
110 save(
const std::string &prefix)
const;
119 read(
const std::string &prefix);
135 const double &dt)
const;
152 const double &dt)
const;
double alpha
Relaxation coefficient of the controllers.
double force_free_velocity_band_factor
double previous_average_velocity
Average velocity of the previous time step.
static constexpr double initial_force_free_velocity_band_factor
void read(const std::string &prefix)
Read the state of the flow controller from a checkpoint file.
unsigned int flow_direction
Direction of the flow (0 for x, 1 for y and 2 for z).
bool force_free_deceleration_is_allowed
double main_flow_controller(const double &average_velocity_n, const double &dt) const
Calculate a beta force from the previous beta force and the average velocities of the last two time s...
static constexpr double zero_beta_tolerance
Below this magnitude, a beta force is considered to be zero.
double proportional_flow_controller(const double &average_velocity_n, const double &dt) const
Calculate a beta force from the last average velocity only. It is used for the first and second time ...
Tensor< 1, dim > get_beta() const
Get the beta force of the current time step.
double target_average_velocity
Target average velocity.
void calculate_beta(const double &average_velocity_n, const double &dt, const unsigned int &step_number)
Calculate the beta force coefficient applied during the current time step.
double previous_beta
Beta force applied during the previous time step.
void save(const std::string &prefix) const
Save the state of the flow controller to a checkpoint file.
static constexpr double minimum_force_free_velocity_band_factor
Tensor< 1, 3 > get_beta_particles(const double &fluid_density, const double &particle_density) const
Get the beta force of the current time step scaled for the particles.
FlowControl(const Parameters::DynamicFlowControl &flow_control)
Constructor of the flow controller.
FlowControl - Set average velocity on a boundary (CFD) or the domain (CFD-DEM).