19#ifndef lethe_solid_objects_parameters_h
20#define lethe_solid_objects_parameters_h
25#include <deal.II/base/parameter_handler.h>
26#include <deal.II/base/parsed_function.h>
54 template <
int dim,
int spacedim = dim>
126 template <
int dim,
int spacedim>
131 prm.enter_subsection(
"nitsche solid " + Utilities::int_to_string(
id, 1));
135 prm.enter_subsection(
"solid velocity");
137 prm.leave_subsection();
141 prm.enter_subsection(
"solid temperature");
143 prm.leave_subsection();
145 prm.declare_entry(
"enable particles motion",
148 "Condition on the motion of particles");
150 "enable heat boundary condition",
153 "controls if a heat boundary condition is imposed on the Nitsche immersed boundary");
155 prm.declare_entry(
"beta",
158 "Penalization term for Nitsche method");
163 "Penalization term for Nitsche method applied to the heat equation");
166 "particles sub iterations",
169 "Number of sub iterations for the motion of the particles. This parameter"
170 "enables the uses of a higher CFL condition for the Nitsche solver while preventing the loss of particles");
173 "stop if particles lost",
176 "Enable stopping the simulation if Nitsche particles have been lost");
179 "number quadrature points",
182 "Number of Nitsche (quadrature) points to insert in a 1D cell. The number of"
183 "inserted points will be higher for higher dimensions. Increasing this"
184 "number will lead to a higher points density inside the solid.");
186 std::string default_rotation = (spacedim == 2) ?
"0., 0." :
"0., 0., 0.";
187 prm.declare_entry(
"center of rotation",
189 Patterns::List(Patterns::Double()),
190 "Solid object center of rotation");
193 prm.declare_entry(
"calculate force on solid",
196 "Enable calculation of forces on solid");
197 prm.declare_entry(
"calculate torque on solid",
200 "Enable calculation of torques on solid");
201 prm.declare_entry(
"solid force name",
203 Patterns::FileName(),
204 "File output solid force prefix");
205 prm.declare_entry(
"solid torque name",
207 Patterns::FileName(),
208 "File output solid torque prefix");
210 prm.leave_subsection();
213 template <
int dim,
int spacedim>
218 prm.enter_subsection(
"nitsche solid " + Utilities::int_to_string(
id, 1));
221 prm.enter_subsection(
"solid velocity");
223 prm.leave_subsection();
225 prm.enter_subsection(
"solid temperature");
227 prm.leave_subsection();
231 beta = prm.get_double(
"beta");
237 const std::vector<double> temp =
240 AssertThrow(temp.size() == spacedim,
241 ExcMessage(
"Invalid center of rotation. This should be a " +
242 Utilities::int_to_string(spacedim) +
243 " dimensional point."));
245 for (
int i = 0; i < spacedim; ++i)
255 prm.leave_subsection();
308 prm.enter_subsection(
"nitsche");
314 "State whether the force on the solid should be printed.",
318 prm.declare_entry(
"number of solids",
321 "Number of solid object");
329 prm.leave_subsection();
336 prm.enter_subsection(
"nitsche");
345 for (
unsigned int i_solid = 0; i_solid <
number_solids; ++i_solid)
348 prm.leave_subsection();
363 template <
int dim,
int spacedim = dim>
410 template <
int dim,
int spacedim>
419 auto translational_velocity_parsed =
420 std::make_shared<Functions::ParsedFunction<spacedim>>(spacedim);
421 auto angular_velocity_parsed =
422 std::make_shared<Functions::ParsedFunction<spacedim>>(spacedim);
423 auto solid_temperature_parsed =
424 std::make_shared<Functions::ParsedFunction<spacedim>>(1);
426 prm.enter_subsection(
"solid object " + Utilities::int_to_string(
id, 1));
430 prm.enter_subsection(
"translational velocity");
431 translational_velocity_parsed->declare_parameters(prm, spacedim);
432 prm.leave_subsection();
434 prm.enter_subsection(
"angular velocity");
435 angular_velocity_parsed->declare_parameters(prm, 3);
436 prm.leave_subsection();
438 std::string default_rotation = (spacedim == 2) ?
"0., 0." :
"0., 0., 0.";
439 prm.declare_entry(
"center of rotation",
441 Patterns::List(Patterns::Double()),
442 "Solid object center of rotation");
445 "thermal boundary type",
447 "Choosing thermal boundary type.");
450 prm.enter_subsection(
"temperature");
451 solid_temperature_parsed->declare_parameters(prm, 1);
452 prm.leave_subsection();
454 prm.declare_entry(
"output solid object",
457 "Controls the generation of output files");
459 prm.leave_subsection();
467 template <
int dim,
int spacedim>
476 auto translational_velocity_parsed =
477 std::make_shared<Functions::ParsedFunction<spacedim>>(spacedim);
478 auto angular_velocity_parsed =
479 std::make_shared<Functions::ParsedFunction<spacedim>>(spacedim);
480 auto solid_temperature_parsed =
481 std::make_shared<Functions::ParsedFunction<spacedim>>(1);
483 prm.enter_subsection(
"solid object " + Utilities::int_to_string(
id, 1));
486 prm.enter_subsection(
"translational velocity");
487 translational_velocity_parsed->parse_parameters(prm);
488 prm.leave_subsection();
490 prm.enter_subsection(
"angular velocity");
491 angular_velocity_parsed->parse_parameters(prm);
492 prm.leave_subsection();
494 const std::vector<double> temp =
497 AssertThrow(temp.size() == spacedim,
498 ExcMessage(
"Invalid center of rotation. This should be a " +
499 Utilities::int_to_string(spacedim) +
500 " dimensional point."));
502 for (
int i = 0; i < spacedim; ++i)
510 prm.get(
"thermal boundary type"));
513 prm.enter_subsection(
"temperature");
514 solid_temperature_parsed->parse_parameters(prm);
515 prm.leave_subsection();
517 prm.leave_subsection();
584 prm.enter_subsection(
"solid objects");
586 prm.enter_subsection(
"solid surfaces");
588 prm.declare_entry(
"number of solids",
591 "Number of solid surfaces");
601 prm.leave_subsection();
603 prm.enter_subsection(
"solid volumes");
605 prm.declare_entry(
"number of solids",
608 "Number of solid volumes");
614 std::make_shared<RigidSolidObject<dim, dim>>();
618 prm.leave_subsection();
620 prm.leave_subsection();
627 prm.enter_subsection(
"solid objects");
629 prm.enter_subsection(
"solid surfaces");
638 prm.leave_subsection();
640 prm.enter_subsection(
"solid volumes");
649 prm.leave_subsection();
651 prm.leave_subsection();
void declare_parameters(ParameterHandler &prm)
Declare the parameters in the parameter handler.
unsigned int number_solid_volumes
Number of active solid volume objects.
unsigned int number_solid_surfaces
Number of active solid surface objects.
std::vector< std::shared_ptr< RigidSolidObject< dim - 1, dim > > > solid_surfaces
Collection of rigid solid surface objects.
std::vector< std::shared_ptr< RigidSolidObject< dim, dim > > > solid_volumes
Collection of rigid solid volume objects.
DEMSolidObjects()=default
Verbosity verbosity
Verbosity level for force/torque output.
static const unsigned int max_number_of_solids
Maximum number of solid objects allowed.
void parse_parameters(ParameterHandler &prm)
Parse the parameters from the parameter handler.
Mesh - Parameters that control mesh reading and mesh generation.
double beta_heat
Penalization parameter for the Nitsche method (heat equation).
void declare_parameters(ParameterHandler &prm, unsigned int id)
Declare the parameters in the parameter handler.
Parameters::Mesh< dim, spacedim > solid_mesh
Mesh parameters for the solid object.
bool calculate_force_on_solid
Enable calculation of forces on the solid.
bool stop_particles_lost
Stop the simulation if Nitsche particles are lost.
bool enable_particles_motion
Enable the motion of Nitsche particles.
bool calculate_torque_on_solid
Enable calculation of torques on the solid.
double beta
Penalization parameter for the Nitsche method (momentum equation).
bool enable_heat_bc
Enable heat boundary condition on the immersed boundary.
unsigned int number_quadrature_points
Number of quadrature points per 1D cell used to represent the solid.
std::string torque_output_name
File name prefix for the torque output.
Functions::ParsedFunction< spacedim > solid_temperature
Temperature function imposed on the solid boundary.
unsigned int particles_sub_iterations
Number of sub-iterations for particle motion integration.
std::string force_output_name
File name prefix for the force output.
Point< spacedim > center_of_rotation
Center of rotation used for torque calculation.
void parse_parameters(ParameterHandler &prm, unsigned int id)
Parse the parameters from the parameter handler.
Functions::ParsedFunction< spacedim > solid_velocity
Velocity function imposed on the solid.
void parse_parameters(ParameterHandler &prm)
Parse the parameters from the parameter handler.
unsigned int number_solids
Number of active Nitsche solid objects.
Verbosity verbosity
Verbosity level for force/torque output.
static const unsigned int max_nitsche_solids
Maximum number of Nitsche solid objects allowed.
void declare_parameters(ParameterHandler &prm)
Declare the parameters in the parameter handler.
std::vector< std::shared_ptr< NitscheObject< dim > > > nitsche_solids
Collection of Nitsche solid objects.
Parameters for a single rigid solid object used in DEM simulations.
Point< spacedim > center_of_rotation
Center of rotation used to locate and rotate the solid object.
bool output_bool
Controls the generation of output files for this solid.
SolidObjectThermalBoundaryType thermal_boundary_type
Type of thermal boundary condition applied on the solid surface.
std::shared_ptr< Function< spacedim > > solid_temperature
Temperature function for the solid object boundary.
Parameters::Mesh< dim, spacedim > solid_mesh
Mesh parameters for the solid object.
std::shared_ptr< Function< spacedim > > angular_velocity
Angular velocity function of the solid object.
void declare_parameters(ParameterHandler &prm, unsigned int id)
Declare the parameters in the parameter handler.
RigidSolidObject()=default
void parse_parameters(ParameterHandler &prm, unsigned int id)
Parse the parameters from the parameter handler.
std::shared_ptr< Function< spacedim > > translational_velocity
Translational velocity function of the solid object.
std::vector< T > convert_string_to_vector(const ParameterHandler &prm, const std::string &entry_string)
Return the vector of size N of entry @entry_string. If the entry is specified in the ....
EnumType string_to_enum(const std::string &name)
Return the enumerator whose identifier is name, e.g. to parse the value of a parameter entry into its...
void declare_enum_entry(ParameterHandler &prm, const std::string &entry_name, const EnumType default_value, const std::string &description, const DeprecatedEnumNames< EnumType > &deprecated_names={}, const std::vector< EnumType > &allowed_values={})
Declare a parameter entry whose value is an enumerator. The default value, the accepted values and th...
const std::vector< Verbosity > & quiet_or_verbose()
Return the verbosity levels accepted by the parameters which do not support Verbosity::extra_verbose.
SolidObjectThermalBoundaryType
Thermal boundary condition type applied on a solid object surface.
@ isothermal
Fixed temperature imposed on the solid boundary.
@ adiabatic
No heat flux through the solid boundary.
const DeprecatedEnumNames< Verbosity > & deprecated_verbosity_names()
Return the deprecated strings of the parameters parsed into a Verbosity, which remain accepted in par...