20 #include "libmesh/string_to_enum.h" 41 params.
addClassDescription(
"Sets up variables, stress divergence kernels and materials required " 42 "for a static analysis with beam or truss elements. Also sets up aux " 43 "variables, aux kernels, and consistent or nodal inertia kernels for " 44 "dynamic analysis with beam elements.");
49 "Set to true if the line elements are truss elements instead of the default beam elements.");
50 params.
addParam<
bool>(
"add_variables",
52 "Add the displacement variables for truss elements " 53 "and both displacement and rotation variables for " 55 params.
addParam<std::vector<VariableName>>(
56 "displacements",
"The nonlinear displacement variables for the problem");
61 "Cross-section area of the beam. Can be supplied as either a number or a variable name.");
67 "use_displaced_mesh",
false,
"Whether to use displaced mesh in the kernels");
70 params.
addParam<std::vector<SubdomainName>>(
73 "The list of ids of the blocks (subdomain) " 74 "that the stress divergence, inertia kernels and materials will be " 77 params.
addParam<std::vector<AuxVariableName>>(
78 "save_in", {},
"The displacement and rotational residuals");
79 params.
addParam<std::vector<AuxVariableName>>(
80 "diag_save_in", {},
"The displacement and rotational diagonal preconditioner terms");
90 params.
addParam<std::vector<VariableName>>(
91 "rotations",
"The rotations appropriate for the simulation geometry and coordinate system");
93 MooseEnum strainType(
"SMALL FINITE",
"SMALL");
96 params.
addParam<std::vector<MaterialPropertyName>>(
97 "eigenstrain_names",
"List of beam eigenstrains to be applied in this strain calculation.");
101 "Orientation of the y direction along " 102 "which Iyy is provided. This should be " 103 "perpendicular to the axis of the beam.");
106 "Cross-section area of the beam. Can be supplied as either a number or a variable name.");
109 "First moment of area of the beam about y axis. Can be supplied " 110 "as either a number or a variable name.");
113 "First moment of area of the beam about z axis. Can be supplied " 114 "as either a number or a variable name.");
116 "Second moment of area of the beam about x axis. Can be supplied as " 117 "either a number or a variable name.");
119 "Second moment of area of the beam about y axis. Can be supplied as " 120 "either a number or a variable name.");
122 "Second moment of area of the beam about z axis. Can be supplied as " 123 "either a number or a variable name.");
126 params.
addParam<
bool>(
"add_dynamic_variables",
127 "Adds translational and rotational velocity and acceleration aux variables " 128 "and sets up the corresponding AuxKernels for calculating these variables " 129 "using Newmark time integration. When dynamic_consistent_inertia, " 130 "dynamic_nodal_rotational_inertia or dynamic_nodal_translational_inertia " 131 "are set to true, these variables are automatically set up.");
133 params.
addParam<std::vector<VariableName>>(
"velocities",
"Translational velocity variables");
134 params.
addParam<std::vector<VariableName>>(
"accelerations",
135 "Translational acceleration variables");
136 params.
addParam<std::vector<VariableName>>(
"rotational_velocities",
137 "Rotational velocity variables");
138 params.
addParam<std::vector<VariableName>>(
"rotational_accelerations",
139 "Rotational acceleration variables");
141 "beta",
"beta>0.0",
"beta parameter for Newmark Time integration");
143 "gamma",
"gamma>0.0",
"gamma parameter for Newmark Time integration");
144 params.
addParam<MaterialPropertyName>(
"eta",
146 "Name of material property or a constant real " 147 "number defining the eta parameter for mass proportional " 148 "Rayleigh damping.");
149 params.
addParam<MaterialPropertyName>(
152 "Name of material property or a constant real " 153 "number defining the zeta parameter for stiffness proportional " 154 "Rayleigh damping.");
157 "alpha>=-0.3333 & alpha<=0.0",
158 "alpha parameter for mass dependent numerical damping induced " 159 "by HHT time integration scheme");
162 params.
addParam<
bool>(
"dynamic_consistent_inertia",
164 "If set to true, consistent mass and " 165 "inertia matrices are used for the " 166 "inertial force/torque calculations.");
167 params.
addParam<MaterialPropertyName>(
169 "Name of Material Property or a constant real number defining the density of the beam.");
173 "dynamic_nodal_translational_inertia",
175 "If set to true, nodal mass matrix is used for the inertial force calculation.");
177 "nodal_mass",
"nodal_mass>0.0",
"Mass associated with the node");
180 "The file containing the nodal positions and the corresponding nodal masses.");
184 "dynamic_nodal_rotational_inertia",
186 "If set to true, nodal inertia matrix is used for the inertial torque calculation.");
188 "nodal_Ixx",
"nodal_Ixx>=0.0",
"Nodal moment of inertia in the x direction.");
190 "nodal_Iyy",
"nodal_Iyy>=0.0",
"Nodal moment of inertia in the y direction.");
192 "nodal_Izz",
"nodal_Izz>=0.0",
"Nodal moment of inertia in the z direction.");
193 params.
addParam<
Real>(
"nodal_Ixy", 0.0,
"Nodal moment of inertia in the xy direction.");
194 params.
addParam<
Real>(
"nodal_Ixz", 0.0,
"Nodal moment of inertia in the xz direction.");
195 params.
addParam<
Real>(
"nodal_Iyz", 0.0,
"Nodal moment of inertia in the yz direction.");
197 "nodal_x_orientation",
198 "Unit vector along the x direction if different from global x direction.");
200 "nodal_y_orientation",
201 "Unit vector along the y direction if different from global y direction.");
202 params.
addParam<std::vector<BoundaryName>>(
205 "The list of boundary IDs from the mesh where the nodal " 206 "mass/inertia will be applied.");
216 _rot_accelerations(0),
217 _subdomain_names(getParam<
std::vector<SubdomainName>>(
"block")),
219 _add_dynamic_variables(false)
228 if (action.size() == 1)
232 _save_in = getParam<std::vector<AuxVariableName>>(
"save_in");
233 _diag_save_in = getParam<std::vector<AuxVariableName>>(
"diag_save_in");
234 _strain_type = getParam<MooseEnum>(
"strain_type").getEnum<Strain>();
235 _rotation_type = getParam<MooseEnum>(
"rotation_type").getEnum<Strain>();
245 bool user_defined_add_dynamic_variables = getParam<bool>(
"add_dynamic_variables");
249 mooseError(
"LineElementAction: When using 'dynamic_consistent_inertia', " 250 "'dynamic_nodal_rotational_inertia' or '_dynamic_nodal_translational_inertia', " 251 "the velocity and acceleration AuxVariables and the corresponding AuxKernels are " 252 "automatically set by the action and this cannot be turned off by setting " 253 "'add_dynamic_variables' to false.");
255 _truss = getParam<bool>(
"truss");
259 "LineElementAction: A vector of displacement variable names should be provided as " 260 "input using `displacements`.");
262 _displacements = getParam<std::vector<VariableName>>(
"displacements");
269 bool use_displaced_mesh_param = getParam<bool>(
"use_displaced_mesh");
273 "LineElementAction: Wrong combination of " 274 "`use_displaced_mesh`, `strain_type` and `rotation_type`.");
280 "LineElementAction: Number of save_in variables should equal to the number of " 281 "displacement variables ",
286 "LineElementAction: Number of diag_save_in variables should equal to the number of " 287 "displacement variables ",
297 "LineElementAction: Rotational variable names should be provided for beam " 298 "elements using `rotations` parameter.");
300 _rotations = getParam<std::vector<VariableName>>(
"rotations");
304 "LineElementAction: Number of rotational and displacement variable names provided " 305 "as input for beam should be same.");
309 mooseError(
"LineElementAction: `y_orientation`, `area`, `Iy` and `Iz` should be provided for " 318 "LineElementAction: Variable names for translational and rotational velocities " 319 "and accelerations should be provided as input to perform dynamic simulation " 320 "using beam elements using `velocities`, `accelerations`, `rotational_velocities` and " 321 "`rotational_accelerations`.");
323 _velocities = getParam<std::vector<VariableName>>(
"velocities");
324 _accelerations = getParam<std::vector<VariableName>>(
"accelerations");
325 _rot_velocities = getParam<std::vector<VariableName>>(
"rotational_velocities");
330 mooseError(
"LineElementAction: Number of translational and rotational velocity and " 331 "acceleration variable names provided as input for the beam should be same as " 332 "number of displacement variables.");
335 mooseError(
"LineElementAction: Newmark time integration parameters `beta` and `gamma` " 336 "should be provided as input to perform dynamic simulations using beams.");
341 "LineElementAction: Either name of the density material property or a constant " 342 "density value should be provided as input using `density` for creating the " 343 "consistent mass/inertia matrix required for dynamic beam simulation.");
348 "LineElementAction: `nodal_mass` or `nodal_mass_file` should be provided as input " 350 "inertial forces on beam due to nodal mass.");
354 mooseError(
"LineElementAction: `nodal_Ixx`, `nodal_Iyy`, `nodal_Izz` should be provided as " 355 "input to calculate inertial torque on beam due to nodal inertia.");
361 "LineElementAction: `area` should be provided as input for " 366 "LineElementAction: Rotational variables cannot be set for truss elements.");
436 if (getParam<bool>(
"add_variables"))
439 for (
const auto & action : actions)
442 const auto added_size = action->_subdomain_ids.size();
446 if (size_after != size_before + added_size)
448 "LineElementAction: The block restrictions in the LineElement actions must be " 451 if (added_size == 0 && actions.size() > 1)
454 "LineElementAction: No LineElement action can be block unrestricted if more than one " 455 "LineElement action is specified.");
463 if (getParam<bool>(
"add_variables"))
468 const bool second =
_problem->mesh().hasSecondOrderElements();
470 mooseError(
"LineElementAction: Only linear truss and beam elements are currently supported. " 471 "Please change the order of elements in the mesh to use first order elements.");
473 params.set<
MooseEnum>(
"order") =
"FIRST";
474 params.set<
MooseEnum>(
"family") =
"LAGRANGE";
480 _problem->addVariable(
"MooseVariable", disp, params);
489 _problem->addVariable(
"MooseVariable", rot, params);
505 params.set<
bool>(
"use_displaced_mesh") =
false;
508 params.set<
bool>(
"large_strain") =
true;
510 _problem->addMaterial(
"ComputeIncrementalBeamStrain",
name() +
"_strain", params);
516 params.set<
bool>(
"use_displaced_mesh") =
false;
519 params.set<
bool>(
"large_strain") =
true;
521 _problem->addMaterial(
"ComputeFiniteBeamStrain",
name() +
"_strain", params);
536 for (
unsigned int i = 0; i < 2 *
_ndisp; ++i)
542 params.set<
unsigned int>(
"component") = i;
543 params.set<NonlinearVariableName>(
"variable") =
_displacements[i];
546 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i]};
548 params.set<std::vector<AuxVariableName>>(
"diag_save_in") = {
_diag_save_in[i]};
550 _problem->addKernel(
"StressDivergenceBeam", kernel_name, params);
554 params.set<
unsigned int>(
"component") = i;
555 params.set<NonlinearVariableName>(
"variable") =
_rotations[i - 3];
558 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i]};
560 params.set<std::vector<AuxVariableName>>(
"diag_save_in") = {
_diag_save_in[i]};
562 _problem->addKernel(
"StressDivergenceBeam", kernel_name, params);
574 for (
unsigned int i = 0; i < 2 *
_ndisp; ++i)
580 params.set<
unsigned int>(
"component") = i;
581 params.set<NonlinearVariableName>(
"variable") =
_displacements[i];
584 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i]};
586 params.set<std::vector<AuxVariableName>>(
"diag_save_in") = {
_diag_save_in[i]};
588 _problem->addKernel(
"InertialForceBeam", kernel_name, params);
592 params.set<
unsigned int>(
"component") = i;
593 params.set<NonlinearVariableName>(
"variable") =
_rotations[i - 3];
596 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i]};
598 params.set<std::vector<AuxVariableName>>(
"diag_save_in") = {
_diag_save_in[i]};
600 _problem->addKernel(
"InertialForceBeam", kernel_name, params);
610 params.set<
bool>(
"use_displaced_mesh") =
true;
612 for (
unsigned int i = 0; i <
_ndisp; ++i)
615 params.set<
unsigned int>(
"component") = i;
616 params.set<NonlinearVariableName>(
"variable") =
_displacements[i];
619 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i]};
621 params.set<std::vector<AuxVariableName>>(
"diag_save_in") = {
_diag_save_in[i]};
623 _problem->addKernel(
"StressDivergenceTensorsTruss", kernel_name, params);
636 params.set<
MooseEnum>(
"family") =
"LAGRANGE";
639 _problem->addAuxVariable(
"MooseVariable", vel, params);
642 _problem->addAuxVariable(
"MooseVariable", accel, params);
645 _problem->addAuxVariable(
"MooseVariable", rot_vel, params);
648 _problem->addAuxVariable(
"MooseVariable", rot_accel, params);
661 for (
unsigned i = 0; i < 2 *
_ndisp; ++i)
668 params.set<std::vector<VariableName>>(
"velocity") = {
_velocities[i]};
669 params.set<std::vector<VariableName>>(
"displacement") = {
_displacements[i]};
671 _problem->addAuxKernel(
"NewmarkAccelAux", aux_kernel_name, params);
677 params.set<std::vector<VariableName>>(
"displacement") = {
_rotations[i -
_ndisp]};
679 _problem->addAuxKernel(
"NewmarkAccelAux", aux_kernel_name, params);
687 for (
unsigned i = 0; i < 2 *
_ndisp; ++i)
693 params.set<AuxVariableName>(
"variable") =
_velocities[i];
694 params.set<std::vector<VariableName>>(
"acceleration") = {
_accelerations[i]};
695 _problem->addAuxKernel(
"NewmarkVelAux", aux_kernel_name, params);
701 _problem->addAuxKernel(
"NewmarkVelAux", aux_kernel_name, params);
717 std::string ss(getParam<MaterialPropertyName>(
"eta"));
718 Real real_value = MooseUtils::convert<Real>(ss);
727 {
"save_in",
"diag_save_in",
"use_displaced_mesh",
"eta"});
728 params.set<
Real>(
"mass") = getParam<Real>(
"nodal_mass");
729 params.set<
Real>(
"eta") = eta;
732 for (
unsigned i = 0; i <
_ndisp; ++i)
734 std::string nodal_kernel_name =
737 params.set<NonlinearVariableName>(
"variable") =
_displacements[i];
738 params.set<std::vector<VariableName>>(
"velocity") = {
_velocities[i]};
739 params.set<std::vector<VariableName>>(
"acceleration") = {
_accelerations[i]};
742 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i]};
745 params.set<std::vector<AuxVariableName>>(
"diag_save_in") = {
_diag_save_in[i]};
747 _problem->addNodalKernel(
"NodalTranslationalInertia", nodal_kernel_name, params);
757 "use_displaced_mesh",
761 params.set<
Real>(
"Ixx") = getParam<Real>(
"nodal_Ixx");
762 params.set<
Real>(
"Iyy") = getParam<Real>(
"nodal_Iyy");
763 params.set<
Real>(
"Izz") = getParam<Real>(
"nodal_Izz");
764 params.set<
Real>(
"eta") = eta;
768 params.set<
Real>(
"Ixy") = getParam<Real>(
"nodal_Ixy");
771 params.set<
Real>(
"Ixz") = getParam<Real>(
"nodal_Ixz");
774 params.set<
Real>(
"Iyz") = getParam<Real>(
"nodal_Iyz");
777 params.set<
Real>(
"x_orientation") = getParam<Real>(
"nodal_x_orientation");
780 params.set<
Real>(
"y_orientation") = getParam<Real>(
"nodal_y_orientation");
782 for (
unsigned i = 0; i <
_ndisp; ++i)
786 params.set<
unsigned int>(
"component") = i;
787 params.set<NonlinearVariableName>(
"variable") =
_rotations[i];
790 params.set<std::vector<AuxVariableName>>(
"save_in") = {
_save_in[i +
_ndisp]};
795 _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
InputParameters getValidParams(const std::string &name) const
bool _truss
Set to true if line element is a truss.
const ExecFlagType EXEC_TIMESTEP_END
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)