12 #include "libmesh/utility.h" 26 "contribution of mass dependent Rayleigh damping and HHT time " 27 "integration scheme.");
28 params.
set<
bool>(
"use_displaced_mesh") =
true;
31 "The rotational variables appropriate for the simulation geometry and coordinate system");
34 "The displacement variables appropriate for the simulation geometry and coordinate system");
35 params.
addCoupledVar(
"velocities",
"Translational velocity variables");
36 params.
addCoupledVar(
"accelerations",
"Translational acceleration variables");
37 params.
addCoupledVar(
"rotational_velocities",
"Rotational velocity variables");
38 params.
addCoupledVar(
"rotational_accelerations",
"Rotational acceleration variables");
40 "beta",
"beta>0.0",
"beta parameter for Newmark Time integration");
42 "gamma",
"gamma>0.0",
"gamma parameter for Newmark Time integration");
43 params.
addParam<MaterialPropertyName>(
"eta",
45 "Name of material property or a constant real " 46 "number defining the eta parameter for the " 50 "alpha >= -0.3333 & alpha <= 0.0",
51 "Alpha parameter for mass dependent numerical damping induced " 52 "by HHT time integration scheme");
53 params.
addParam<MaterialPropertyName>(
56 "Name of Material Property or a constant real number defining the density of the beam.");
58 params.
addCoupledVar(
"Ay", 0.0,
"Variable containing first moment of area about y axis");
59 params.
addCoupledVar(
"Az", 0.0,
"Variable containing first moment of area about z axis");
61 "Variable containing second moment of area about x axis. Defaults to Iy+Iz");
67 "An integer corresponding to the direction " 68 "the variable this kernel acts in. (0 for disp_x, " 69 "1 for disp_y, 2 for disp_z, 3 for rot_x, 4 for rot_y and 5 for rot_z)");
75 _has_beta(isParamValid(
"beta")),
76 _has_gamma(isParamValid(
"gamma")),
77 _has_velocities(isParamValid(
"velocities")),
78 _has_rot_velocities(isParamValid(
"rotational_velocities")),
79 _has_accelerations(isParamValid(
"accelerations")),
80 _has_rot_accelerations(isParamValid(
"rotational_accelerations")),
81 _has_Ix(isParamValid(
"Ix")),
82 _density(getMaterialProperty<
Real>(
"density")),
83 _nrot(coupledComponents(
"rotations")),
84 _ndisp(coupledComponents(
"displacements")),
90 _rot_accel_num(_nrot),
91 _area(coupledValue(
"area")),
92 _Ay(coupledValue(
"Ay")),
93 _Az(coupledValue(
"Az")),
94 _Ix(_has_Ix ? coupledValue(
"Ix") : _zero),
95 _Iy(coupledValue(
"Iy")),
96 _Iz(coupledValue(
"Iz")),
97 _beta(_has_beta ? getParam<
Real>(
"beta") : 0.1),
98 _gamma(_has_gamma ? getParam<
Real>(
"gamma") : 0.1),
99 _eta(getMaterialProperty<
Real>(
"eta")),
100 _alpha(getParam<
Real>(
"alpha")),
101 _original_local_config(getMaterialPropertyByName<
RankTwoTensor>(
"initial_rotation")),
102 _original_length(getMaterialPropertyByName<
Real>(
"original_length")),
103 _component(getParam<unsigned
int>(
"component")),
109 mooseError(
"InertialForceBeam: The number of variables supplied in 'displacements' and " 110 "'rotations' must match.");
120 "InertialForceBeam: The number of variables supplied in 'velocities', " 121 "'accelerations', 'rotational_velocities' and 'rotational_accelerations' must match " 122 "the number of displacement variables.");
125 for (
unsigned int i = 0; i <
_ndisp; ++i)
147 mooseError(
"InertialForceBeam: Either all or none of `beta`, `gamma`, `velocities`, " 148 "`accelerations`, `rotational_velocities` and `rotational_accelerations` should be " 149 "provided as input.");
152 for (
unsigned int i = 0; i <
_ndisp; ++i)
170 std::vector<const Node *> node;
171 for (
unsigned int i = 0; i < 2; ++i)
185 mooseAssert(
_beta > 0.0,
"InertialForceBeam: Beta parameter should be positive.");
186 mooseAssert(
_eta[0] >= 0.0,
"InertialForceBeam: Eta parameter should be non-negative.");
188 for (
unsigned int i = 0; i <
_ndisp; ++i)
191 unsigned int dof_index_0 = node[0]->dof_number(nonlinear_sys.
number(),
_disp_num[i], 0);
192 unsigned int dof_index_1 = node[1]->dof_number(nonlinear_sys.
number(),
_disp_num[i], 0);
193 const Real disp_0 = sol(dof_index_0) - sol_old(dof_index_0);
194 const Real disp_1 = sol(dof_index_1) - sol_old(dof_index_1);
196 dof_index_0 = node[0]->dof_number(nonlinear_sys.
number(),
_rot_num[i], 0);
197 dof_index_1 = node[1]->dof_number(nonlinear_sys.
number(),
_rot_num[i], 0);
198 const Real rot_0 = sol(dof_index_0) - sol_old(dof_index_0);
199 const Real rot_1 = sol(dof_index_1) - sol_old(dof_index_1);
210 const Real rot_accel_old_0 =
212 const Real rot_accel_old_1 =
237 mooseError(
"InertialForceBeam: Time derivative of solution (`u_dot`) is not stored. Please " 238 "set uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
241 mooseError(
"InertialForceBeam: Old time derivative of solution (`u_dot_old`) is not " 242 "stored. Please set uDotOldRequested() to true in FEProblemBase before " 243 "requesting `u_dot_old`.");
246 mooseError(
"InertialForceBeam: Second time derivative of solution (`u_dotdot`) is not " 247 "stored. Please set uDotDotRequested() to true in FEProblemBase before " 248 "requesting `u_dotdot`.");
254 for (
unsigned int i = 0; i <
_ndisp; ++i)
257 unsigned int dof_index_0 = node[0]->dof_number(nonlinear_sys.
number(),
_disp_num[i], 0);
258 unsigned int dof_index_1 = node[1]->dof_number(nonlinear_sys.
number(),
_disp_num[i], 0);
259 _vel_0(i) = vel(dof_index_0);
260 _vel_1(i) = vel(dof_index_1);
267 dof_index_0 = node[0]->dof_number(nonlinear_sys.
number(),
_rot_num[i], 0);
268 dof_index_1 = node[1]->dof_number(nonlinear_sys.
number(),
_rot_num[i], 0);
295 for (
unsigned int i = 0; i <
_ndisp; ++i)
416 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
417 for (
unsigned int i = 0; i <
_save_in.size(); ++i)
427 mooseAssert(
_beta > 0.0,
"InertialForceBeam: Beta parameter should be positive.");
435 for (
unsigned int i = 0; i <
_test.size(); ++i)
437 for (
unsigned int j = 0;
j <
_phi.size(); ++
j)
448 I(0, 0) =
_Iy[0] +
_Iz[0];
467 for (
unsigned int i = 0; i < rows; ++i)
470 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
479 mooseAssert(
_beta > 0.0,
"InertialForceBeam: Beta parameter should be positive.");
491 unsigned int coupled_component = 0;
492 bool disp_coupled =
false;
493 bool rot_coupled =
false;
495 for (
unsigned int i = 0; i <
_ndisp; ++i)
499 coupled_component = i;
505 for (
unsigned int i = 0; i <
_nrot; ++i)
509 coupled_component = i + 3;
517 if (disp_coupled || rot_coupled)
519 for (
unsigned int i = 0; i <
_test.size(); ++i)
521 for (
unsigned int j = 0;
j <
_phi.size(); ++
j)
523 if (_component < 3 && coupled_component > 2)
538 else if (
_component > 2 && coupled_component < 3)
553 else if (
_component > 2 && coupled_component > 2)
559 I(0, 0) =
_Iy[0] +
_Iz[0];
RealVectorValue _local_vel_old_0
Old translational and rotational velocities at the two nodes of the beam in the initial beam local co...
RealVectorValue _rot_vel_0
RealVectorValue _local_rot_vel_old_1
const bool _has_velocities
virtual void computeJacobian() override
const VariableValue * _du_dot_du
Coupled variable for du_dot_du calculated by time integrator.
static InputParameters validParams()
RealVectorValue _local_rot_vel_1
std::vector< RealVectorValue > _local_moment
RealVectorValue _local_vel_0
Current translational and rotational velocities at the two nodes of the beam in the initial beam loca...
unsigned int _nrot
Number of coupled rotational variables.
void accumulateTaggedLocalResidual()
std::vector< MooseVariableFEBase *> _save_in
RealVectorValue _rot_accel_1
const Real _gamma
Newmark time integraion parameter.
std::vector< unsigned int > _accel_num
Variable numbers corresponding to acceleraion aux variables.
RealVectorValue _vel_0
Current translational and rotational velocities at the two nodes of the beam in the global coordinate...
virtual const VariableValue & coupledDotDotDu(const std::string &var_name, unsigned int comp=0) const
const Real _beta
Newmark time integration parameter.
unsigned int number() const
const MaterialProperty< RankTwoTensor > & _original_local_config
Rotational transformation from global to initial beam local coordinate system.
RealVectorValue _local_rot_vel_0
RealVectorValue _local_accel_1
InertialForceBeam(const InputParameters ¶meters)
virtual void computeOffDiagJacobian(unsigned int jvar) override
unsigned int _ndisp
Number of coupled displacement variables.
const Real _alpha
HHT time integration parameter.
const VariableValue & _Iz
Coupled variable for second momemnt of area of beam in z direction, i.e., integral of z^2*dA over the...
RealVectorValue _local_rot_accel_0
RealVectorValue _local_rot_vel_old_0
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
const unsigned int _component
Direction along which residual is calculated.
std::vector< RealVectorValue > _local_force
Forces and moments at the two end nodes of the beam in the initial beam local configuration.
std::vector< unsigned int > _vel_num
Variable numbers corresponding to velocity aux variables.
const bool _has_accelerations
DenseMatrix< Number > _local_ke
std::vector< unsigned int > _rot_accel_num
Variable numbers corresponding to rotational acceleration aux variables.
std::vector< unsigned int > _rot_vel_num
Variable numbers corresponding to rotational velocity aux variables.
RealVectorValue _rot_vel_1
const VariableTestValue & _test
const VariableValue & _Ix
Coupled variable for second moment of area of beam in x direction, i.e., integral of (y^2+z^2)*dA ove...
virtual const NumericVector< Number > *const & currentSolution() const override final
std::vector< MooseVariableFEBase *> _diag_save_in
virtual NumericVector< Number > * solutionUDot()
virtual NumericVector< Number > * solutionUDotOld()
const VariableValue & _Ay
Coupled variable for first moment of area of beam in y direction, i.e., integral of y*dA over the cro...
FEProblemBase & _fe_problem
const VariableValue & _area
Coupled variable for beam cross-sectional area.
RealVectorValue _vel_old_1
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
unsigned int number() const
const MaterialProperty< Real > & _original_length
Initial length of beam.
void accumulateTaggedLocalMatrix()
const bool _has_rot_accelerations
AuxiliarySystem & getAuxiliarySystem()
RealVectorValue _rot_vel_old_0
RealVectorValue _global_moment_1
const VariableValue & _Iy
Coupled variable for second moment of area of beam in y direction, i.e., integral of y^2*dA over the ...
RealVectorValue _local_vel_1
virtual const VariableValue & coupledDotDu(const std::string &var_name, unsigned int comp=0) const
RealVectorValue _rot_vel_old_1
unsigned int coupledComponents(const std::string &var_name) const
RealVectorValue _vel_old_0
Old translational and rotational velocities at the two nodes of the beam in the global coordinate sys...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RealVectorValue _global_force_0
Forces and moments at the two end nodes of the beam in the global coordinate system.
const bool _has_rot_velocities
registerMooseObject("SolidMechanicsApp", InertialForceBeam)
DenseVector< Number > _local_re
const MaterialProperty< Real > & _density
Density of the beam.
void mooseError(Args &&... args) const
RealVectorValue _accel_0
Current translational and rotational accelerations at the two nodes of the beam in the global coordin...
const bool _has_beta
Booleans for validity of params.
RealVectorValue _global_moment_0
const MaterialProperty< Real > & _eta
Mass proportional Rayleigh damping parameter.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const Elem *const & _current_elem
RealVectorValue _local_rot_accel_1
std::vector< unsigned int > _disp_num
Variable numbers corresponding to displacement variables.
const VariableValue & _Az
Coupled variable for first moment of area of beam in z direction, i.e., integral of z*dA over the cro...
virtual NumericVector< Number > * solutionUDotDot()
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
void prepareMatrixTag(Assembly &assembly, unsigned int ivar, unsigned int jvar)
RealVectorValue _local_vel_old_1
virtual void computeResidual() override
NumericVector< Number > & solutionOld()
std::vector< unsigned int > _rot_num
Variable numbers corresponding to rotational variables.
const VariableValue * _du_dotdot_du
Coupled variable for du_dotdot_du calculated by time integrator.
const VariablePhiValue & _phi
static InputParameters validParams()
RealVectorValue _local_accel_0
Current translational and rotational accelerations at the two nodes of the beam in the initial beam l...
void ErrorVector unsigned int
RealVectorValue _global_force_1
RealVectorValue _rot_accel_0