20 #include "libmesh/string_to_enum.h" 37 params.
addClassDescription(
"Sets up variables, stress divergence kernels and materials required " 38 "for a static analysis with beam or truss elements. Also sets up aux " 39 "variables, aux kernels, and consistent or nodal inertia kernels for " 40 "dynamic analysis with beam elements.");
45 "Set to true if the line elements are truss elements instead of the default beam elements.");
46 params.
addParam<
bool>(
"add_variables",
48 "Add the displacement variables for truss elements " 49 "and both displacement and rotation variables for " 51 params.
addParam<std::vector<VariableName>>(
52 "displacements",
"The nonlinear displacement variables for the problem");
57 "Cross-section area of the beam. Can be supplied as either a number or a variable name.");
63 "use_displaced_mesh",
false,
"Whether to use displaced mesh in the kernels");
66 params.
addParam<std::vector<SubdomainName>>(
69 "The list of ids of the blocks (subdomain) " 70 "that the stress divergence, inertia kernels and materials will be " 73 params.
addParam<std::vector<AuxVariableName>>(
74 "save_in", {},
"The displacement and rotational residuals");
75 params.
addParam<std::vector<AuxVariableName>>(
76 "diag_save_in", {},
"The displacement and rotational diagonal preconditioner terms");
86 params.
addParam<std::vector<VariableName>>(
87 "rotations",
"The rotations appropriate for the simulation geometry and coordinate system");
89 MooseEnum strainType(
"SMALL FINITE",
"SMALL");
92 params.
addParam<std::vector<MaterialPropertyName>>(
93 "eigenstrain_names",
"List of beam eigenstrains to be applied in this strain calculation.");
97 "Orientation of the y direction along " 98 "which Iyy is provided. This should be " 99 "perpendicular to the axis of the beam.");
102 "Cross-section area of the beam. Can be supplied as either a number or a variable name.");
105 "First moment of area of the beam about y axis. Can be supplied " 106 "as either a number or a variable name.");
109 "First moment of area of the beam about z axis. Can be supplied " 110 "as either a number or a variable name.");
112 "Second moment of area of the beam about x axis. Can be supplied as " 113 "either a number or a variable name.");
115 "Second moment of area of the beam about y axis. Can be supplied as " 116 "either a number or a variable name.");
118 "Second moment of area of the beam about z axis. Can be supplied as " 119 "either a number or a variable name.");
122 params.
addParam<
bool>(
"add_dynamic_variables",
123 "Adds translational and rotational velocity and acceleration aux variables " 124 "and sets up the corresponding AuxKernels for calculating these variables " 125 "using Newmark time integration. When dynamic_consistent_inertia, " 126 "dynamic_nodal_rotational_inertia or dynamic_nodal_translational_inertia " 127 "are set to true, these variables are automatically set up.");
129 params.
addParam<std::vector<VariableName>>(
"velocities",
"Translational velocity variables");
130 params.
addParam<std::vector<VariableName>>(
"accelerations",
131 "Translational acceleration variables");
132 params.
addParam<std::vector<VariableName>>(
"rotational_velocities",
133 "Rotational velocity variables");
134 params.
addParam<std::vector<VariableName>>(
"rotational_accelerations",
135 "Rotational acceleration variables");
137 "beta",
"beta>0.0",
"beta parameter for Newmark Time integration");
139 "gamma",
"gamma>0.0",
"gamma parameter for Newmark Time integration");
140 params.
addParam<MaterialPropertyName>(
"eta",
142 "Name of material property or a constant real " 143 "number defining the eta parameter for mass proportional " 144 "Rayleigh damping.");
145 params.
addParam<MaterialPropertyName>(
148 "Name of material property or a constant real " 149 "number defining the zeta parameter for stiffness proportional " 150 "Rayleigh damping.");
153 "alpha>=-0.3333 & alpha<=0.0",
154 "alpha parameter for mass dependent numerical damping induced " 155 "by HHT time integration scheme");
158 params.
addParam<
bool>(
"dynamic_consistent_inertia",
160 "If set to true, consistent mass and " 161 "inertia matrices are used for the " 162 "inertial force/torque calculations.");
163 params.
addParam<MaterialPropertyName>(
165 "Name of Material Property or a constant real number defining the density of the beam.");
169 "dynamic_nodal_translational_inertia",
171 "If set to true, nodal mass matrix is used for the inertial force calculation.");
173 "nodal_mass",
"nodal_mass>0.0",
"Mass associated with the node");
176 "The file containing the nodal positions and the corresponding nodal masses.");
180 "dynamic_nodal_rotational_inertia",
182 "If set to true, nodal inertia matrix is used for the inertial torque calculation.");
184 "nodal_Ixx",
"nodal_Ixx>=0.0",
"Nodal moment of inertia in the x direction.");
186 "nodal_Iyy",
"nodal_Iyy>=0.0",
"Nodal moment of inertia in the y direction.");
188 "nodal_Izz",
"nodal_Izz>=0.0",
"Nodal moment of inertia in the z direction.");
189 params.
addParam<
Real>(
"nodal_Ixy", 0.0,
"Nodal moment of inertia in the xy direction.");
190 params.
addParam<
Real>(
"nodal_Ixz", 0.0,
"Nodal moment of inertia in the xz direction.");
191 params.
addParam<
Real>(
"nodal_Iyz", 0.0,
"Nodal moment of inertia in the yz direction.");
193 "nodal_x_orientation",
194 "Unit vector along the x direction if different from global x direction.");
196 "nodal_y_orientation",
197 "Unit vector along the y direction if different from global y direction.");
198 params.
addParam<std::vector<BoundaryName>>(
201 "The list of boundary IDs from the mesh where the nodal " 202 "mass/inertia will be applied.");
212 _rot_accelerations(0),
213 _subdomain_names(getParam<
std::vector<SubdomainName>>(
"block")),
215 _add_dynamic_variables(false)
224 if (action.size() == 1)
228 _save_in = getParam<std::vector<AuxVariableName>>(
"save_in");
229 _diag_save_in = getParam<std::vector<AuxVariableName>>(
"diag_save_in");
230 _strain_type = getParam<MooseEnum>(
"strain_type").getEnum<Strain>();
231 _rotation_type = getParam<MooseEnum>(
"rotation_type").getEnum<Strain>();
241 bool user_defined_add_dynamic_variables = getParam<bool>(
"add_dynamic_variables");
245 mooseError(
"LineElementAction: When using 'dynamic_consistent_inertia', " 246 "'dynamic_nodal_rotational_inertia' or '_dynamic_nodal_translational_inertia', " 247 "the velocity and acceleration AuxVariables and the corresponding AuxKernels are " 248 "automatically set by the action and this cannot be turned off by setting " 249 "'add_dynamic_variables' to false.");
251 _truss = getParam<bool>(
"truss");
255 "LineElementAction: A vector of displacement variable names should be provided as " 256 "input using `displacements`.");
258 _displacements = getParam<std::vector<VariableName>>(
"displacements");
265 bool use_displaced_mesh_param = getParam<bool>(
"use_displaced_mesh");
269 "LineElementAction: Wrong combination of " 270 "`use_displaced_mesh`, `strain_type` and `rotation_type`.");
276 "LineElementAction: Number of save_in variables should equal to the number of " 277 "displacement variables ",
282 "LineElementAction: Number of diag_save_in variables should equal to the number of " 283 "displacement variables ",
293 "LineElementAction: Rotational variable names should be provided for beam " 294 "elements using `rotations` parameter.");
296 _rotations = getParam<std::vector<VariableName>>(
"rotations");
300 "LineElementAction: Number of rotational and displacement variable names provided " 301 "as input for beam should be same.");
305 mooseError(
"LineElementAction: `y_orientation`, `area`, `Iy` and `Iz` should be provided for " 314 "LineElementAction: Variable names for translational and rotational velocities " 315 "and accelerations should be provided as input to perform dynamic simulation " 316 "using beam elements using `velocities`, `accelerations`, `rotational_velocities` and " 317 "`rotational_accelerations`.");
319 _velocities = getParam<std::vector<VariableName>>(
"velocities");
320 _accelerations = getParam<std::vector<VariableName>>(
"accelerations");
321 _rot_velocities = getParam<std::vector<VariableName>>(
"rotational_velocities");
326 mooseError(
"LineElementAction: Number of translational and rotational velocity and " 327 "acceleration variable names provided as input for the beam should be same as " 328 "number of displacement variables.");
331 mooseError(
"LineElementAction: Newmark time integration parameters `beta` and `gamma` " 332 "should be provided as input to perform dynamic simulations using beams.");
337 "LineElementAction: Either name of the density material property or a constant " 338 "density value should be provided as input using `density` for creating the " 339 "consistent mass/inertia matrix required for dynamic beam simulation.");
344 "LineElementAction: `nodal_mass` or `nodal_mass_file` should be provided as input " 346 "inertial forces on beam due to nodal mass.");
350 mooseError(
"LineElementAction: `nodal_Ixx`, `nodal_Iyy`, `nodal_Izz` should be provided as " 351 "input to calculate inertial torque on beam due to nodal inertia.");
357 "LineElementAction: `area` should be provided as input for " 362 "LineElementAction: Rotational variables cannot be set for truss elements.");
432 if (getParam<bool>(
"add_variables"))
435 for (
const auto & action : actions)
438 const auto added_size = action->_subdomain_ids.size();
442 if (size_after != size_before + added_size)
444 "LineElementAction: The block restrictions in the LineElement actions must be " 447 if (added_size == 0 && actions.size() > 1)
450 "LineElementAction: No LineElement action can be block unrestricted if more than one " 451 "LineElement action is specified.");
459 if (getParam<bool>(
"add_variables"))
461 auto params =
_factory.getValidParams(
"MooseVariable");
464 const bool second =
_problem->mesh().hasSecondOrderElements();
466 mooseError(
"LineElementAction: Only linear truss and beam elements are currently supported. " 467 "Please change the order of elements in the mesh to use first order elements.");
469 params.set<
MooseEnum>(
"order") =
"FIRST";
470 params.set<
MooseEnum>(
"family") =
"LAGRANGE";
477 _problem->addVariable(
"MooseVariable", disp, params);
487 _problem->addVariable(
"MooseVariable", rot, params);
501 auto params =
_factory.getValidParams(
"ComputeIncrementalBeamStrain");
502 params.applyParameters(
parameters(), {
"boundary",
"use_displaced_mesh"});
503 params.set<
bool>(
"use_displaced_mesh") =
false;
506 params.set<
bool>(
"large_strain") =
true;
508 _problem->addMaterial(
"ComputeIncrementalBeamStrain",
name() +
"_strain", params);
512 auto params =
_factory.getValidParams(
"ComputeFiniteBeamStrain");
513 params.applyParameters(
parameters(), {
"boundary",
"use_displaced_mesh"});
514 params.set<
bool>(
"use_displaced_mesh") =
false;
517 params.set<
bool>(
"large_strain") =
true;
519 _problem->addMaterial(
"ComputeFiniteBeamStrain",
name() +
"_strain", params);
530 auto params =
_factory.getValidParams(
"StressDivergenceBeam");
531 params.applyParameters(
parameters(), {
"use_displaced_mesh",
"save_in",
"diag_save_in"});
534 for (
unsigned int i = 0; i < 2 *
_ndisp; ++i)
540 params.set<
unsigned int>(
"component") = i;
541 params.set<NonlinearVariableName>(
"variable") =
_displacements[i];
544 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i]};
546 params.set<std::vector<AuxVariableName>>(
"diag_save_in") = {
_diag_save_in[i]};
548 _problem->addKernel(
"StressDivergenceBeam", kernel_name, params);
552 params.set<
unsigned int>(
"component") = i;
553 params.set<NonlinearVariableName>(
"variable") =
_rotations[i - 3];
556 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i]};
558 params.set<std::vector<AuxVariableName>>(
"diag_save_in") = {
_diag_save_in[i]};
560 _problem->addKernel(
"StressDivergenceBeam", kernel_name, params);
568 params =
_factory.getValidParams(
"InertialForceBeam");
569 params.applyParameters(
parameters(), {
"use_displaced_mesh",
"save_in",
"diag_save_in"});
572 for (
unsigned int i = 0; i < 2 *
_ndisp; ++i)
578 params.set<
unsigned int>(
"component") = i;
579 params.set<NonlinearVariableName>(
"variable") =
_displacements[i];
582 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i]};
584 params.set<std::vector<AuxVariableName>>(
"diag_save_in") = {
_diag_save_in[i]};
586 _problem->addKernel(
"InertialForceBeam", kernel_name, params);
590 params.set<
unsigned int>(
"component") = i;
591 params.set<NonlinearVariableName>(
"variable") =
_rotations[i - 3];
594 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i]};
596 params.set<std::vector<AuxVariableName>>(
"diag_save_in") = {
_diag_save_in[i]};
598 _problem->addKernel(
"InertialForceBeam", kernel_name, params);
606 auto params =
_factory.getValidParams(
"StressDivergenceTensorsTruss");
607 params.applyParameters(
parameters(), {
"use_displaced_mesh",
"save_in",
"diag_save_in"});
608 params.set<
bool>(
"use_displaced_mesh") =
true;
610 for (
unsigned int i = 0; i <
_ndisp; ++i)
613 params.set<
unsigned int>(
"component") = i;
614 params.set<NonlinearVariableName>(
"variable") =
_displacements[i];
617 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i]};
619 params.set<std::vector<AuxVariableName>>(
"diag_save_in") = {
_diag_save_in[i]};
621 _problem->addKernel(
"StressDivergenceTensorsTruss", kernel_name, params);
631 auto params =
_factory.getValidParams(
"MooseVariable");
633 params.set<
MooseEnum>(
"order") =
"FIRST";
634 params.set<
MooseEnum>(
"family") =
"LAGRANGE";
637 _problem->addAuxVariable(
"MooseVariable", vel, params);
640 _problem->addAuxVariable(
"MooseVariable", accel, params);
643 _problem->addAuxVariable(
"MooseVariable", rot_vel, params);
646 _problem->addAuxVariable(
"MooseVariable", rot_accel, params);
655 auto params =
_factory.getValidParams(
"NewmarkAccelAux");
656 params.applyParameters(
parameters(), {
"boundary"});
659 for (
unsigned i = 0; i < 2 *
_ndisp; ++i)
666 params.set<std::vector<VariableName>>(
"velocity") = {
_velocities[i]};
667 params.set<std::vector<VariableName>>(
"displacement") = {
_displacements[i]};
669 _problem->addAuxKernel(
"NewmarkAccelAux", aux_kernel_name, params);
675 params.set<std::vector<VariableName>>(
"displacement") = {
_rotations[i -
_ndisp]};
677 _problem->addAuxKernel(
"NewmarkAccelAux", aux_kernel_name, params);
681 params =
_factory.getValidParams(
"NewmarkVelAux");
682 params.applyParameters(
parameters(), {
"boundary"});
685 for (
unsigned i = 0; i < 2 *
_ndisp; ++i)
691 params.set<AuxVariableName>(
"variable") =
_velocities[i];
692 params.set<std::vector<VariableName>>(
"acceleration") = {
_accelerations[i]};
693 _problem->addAuxKernel(
"NewmarkVelAux", aux_kernel_name, params);
699 _problem->addAuxKernel(
"NewmarkVelAux", aux_kernel_name, params);
715 std::string ss(getParam<MaterialPropertyName>(
"eta"));
716 Real real_value = MooseUtils::convert<Real>(ss);
723 auto params =
_factory.getValidParams(
"NodalTranslationalInertia");
725 {
"save_in",
"diag_save_in",
"use_displaced_mesh",
"eta"});
726 params.set<
Real>(
"mass") = getParam<Real>(
"nodal_mass");
727 params.set<
Real>(
"eta") = eta;
730 for (
unsigned i = 0; i <
_ndisp; ++i)
732 std::string nodal_kernel_name =
735 params.set<NonlinearVariableName>(
"variable") =
_displacements[i];
736 params.set<std::vector<VariableName>>(
"velocity") = {
_velocities[i]};
737 params.set<std::vector<VariableName>>(
"acceleration") = {
_accelerations[i]};
740 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i]};
743 params.set<std::vector<AuxVariableName>>(
"diag_save_in") = {
_diag_save_in[i]};
745 _problem->addNodalKernel(
"NodalTranslationalInertia", nodal_kernel_name, params);
751 auto params =
_factory.getValidParams(
"NodalRotationalInertia");
755 "use_displaced_mesh",
759 params.set<
Real>(
"Ixx") = getParam<Real>(
"nodal_Ixx");
760 params.set<
Real>(
"Iyy") = getParam<Real>(
"nodal_Iyy");
761 params.set<
Real>(
"Izz") = getParam<Real>(
"nodal_Izz");
762 params.set<
Real>(
"eta") = eta;
766 params.set<
Real>(
"Ixy") = getParam<Real>(
"nodal_Ixy");
769 params.set<
Real>(
"Ixz") = getParam<Real>(
"nodal_Ixz");
772 params.set<
Real>(
"Iyz") = getParam<Real>(
"nodal_Iyz");
775 params.set<
Real>(
"x_orientation") = getParam<Real>(
"nodal_x_orientation");
778 params.set<
Real>(
"y_orientation") = getParam<Real>(
"nodal_y_orientation");
780 for (
unsigned i = 0; i <
_ndisp; ++i)
784 params.set<
unsigned int>(
"component") = i;
785 params.set<NonlinearVariableName>(
"variable") =
_rotations[i];
788 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i +
_ndisp]};
793 _problem->addNodalKernel(
"NodalRotationalInertia", nodal_kernel_name, params);
unsigned int _ndisp
Number of displacement variables.
void actAddAuxKernels()
Adds auxkernels corresponding to the translational and rotational velocity and acceleration aux varia...
bool _dynamic_consistent_inertia
Set to true to use consistent mass and inertia matrices to calculate inertial forces/torques in dynam...
std::vector< VariableName > _rotations
Names of rotational variables for beam element.
std::vector< AuxVariableName > _save_in
residual debugging
InputParameterWarehouse & getInputParameterWarehouse()
std::vector< VariableName > _accelerations
Names of translational acceleration variables for dynamic simulation beam element.
std::vector< VariableName > _velocities
Names of translational velocity variables for dynamic simulation using beam element.
static InputParameters validParams()
std::vector< AuxVariableName > _diag_save_in
bool _truss
Set to true if line element is a truss.
const ExecFlagType EXEC_TIMESTEP_END
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
MooseObjectName uniqueActionName() const
virtual const std::string & name() const
bool _add_dynamic_variables
Set to true to set up translational and acceleration AuxVariables and the corresponding AuxKernels us...
registerMooseAction("SolidMechanicsApp", LineElementAction, "create_problem")
std::set< SubdomainID > _subdomain_ids
set generated from the passed in vector of subdomain names
void actGatherActionParameters()
Gather all the block ids from all the actions of this type to create variables spanning all the block...
bool isParamValid(const std::string &name) const
enum LineElementAction::Strain _strain_type
std::set< SubdomainID > _subdomain_id_union
set generated from the combined block restrictions of all LineElementAction action blocks ...
void actAddMaterials()
Adds material objects required for beam and truss elements.
static InputParameters validParams()
void actAddNodalKernels()
Adds nodal kernels that calculate inertial force/torque due to mass/inertia assigned to nodes of the ...
bool _use_displaced_mesh
use displaced mesh (true unless _strain is SMALL_STRAIN_AND_ROTATION)
Store common line element action parameters.
const std::string & _current_task
void paramError(const std::string ¶m, Args... args) const
std::string stringify(const T &t)
std::vector< VariableName > _displacements
Names of displacement variables.
bool _dynamic_nodal_rotational_inertia
Set to true to use nodal inertia matrix to calculate inertial torques in dynamic beam simulations...
void actAddKernels()
Adds StressDivergence kernels for beam and truss elements and inertia kernels for dynamic beam simula...
std::shared_ptr< MooseMesh > & _mesh
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
static InputParameters beamParameters()
Add parameters required for a beam element.
std::shared_ptr< FEProblemBase > & _problem
const InputParameters & parameters() const
void actAddVariables()
Adds displacement and rotation variables.
std::vector< SubdomainName > _subdomain_names
If this vector is not empty the variables, auxvariables, kernels, auxkernels, nodalkernels and materi...
std::vector< const T *> getActions()
std::vector< VariableName > _rot_velocities
Names of rotational velocity variables for dynamic simulation using beam element. ...
void actAddAuxVariables()
Adds translational and rotational velocity and acceleration aux variables for dynamic beam simulation...
bool _dynamic_nodal_translational_inertia
Set to true to use nodal mass matrix to calculate inertial forces in dynamic beam simulations...
std::vector< VariableName > _rot_accelerations
Names of rotational acceleration variables for dynamic simulation beam element.
LineElementAction(const InputParameters ¶ms)