https://mooseframework.inl.gov
ShellResultantsAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "ShellResultantsAux.h"
11 #include "ArbitraryQuadrature.h"
12 #include "libmesh/quadrature.h"
13 #include "libmesh/utility.h"
14 #include "libmesh/enum_quadrature_type.h"
15 #include "libmesh/fe_type.h"
16 #include "libmesh/string_to_enum.h"
17 #include "libmesh/quadrature_gauss.h"
18 
19 registerMooseObject("SolidMechanicsApp", ShellResultantsAux);
20 
23 {
25  params.addClassDescription(
26  "Computes the local forces, bending moments and shear forces acting on shell elements");
27  params.addParam<std::string>("base_name", "Mechanical property base name");
28  params.addRequiredCoupledVar(
29  "thickness",
30  "Thickness of the shell. Can be supplied as either a number or a variable name.");
31  params.addRequiredParam<std::string>("through_thickness_order",
32  "Quadrature order in out of plane direction");
33  MooseEnum stress_resultant(
34  "axial_force_0 axial_force_1 normal_force bending_moment_0 bending_moment_1 "
35  "bending_moment_01 shear_force_01 shear_force_02 shear_force_12");
37  "stress_resultant",
38  stress_resultant,
39  "The stress resultant type to output, calculated on the shell element.");
40 
41  return params;
42 }
43 
45  : AuxKernel(parameters),
46  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
47  _thickness(coupledValue("thickness")),
48  _resultant(getParam<MooseEnum>("stress_resultant").getEnum<ResultantType>())
49 {
50  _t_qrule = std::make_unique<QGauss>(
51  1, Utility::string_to_enum<Order>(getParam<std::string>("through_thickness_order")));
52  _t_points = _t_qrule->get_points();
53  _t_weights = _t_qrule->get_weights();
54  _local_stress_t_points.resize(_t_points.size());
55 
56  for (const auto t : index_range(_t_points))
57  _local_stress_t_points[t] = &getMaterialProperty<RankTwoTensor>(
58  _base_name + "local_stress_t_points_" + std::to_string(t));
59 }
60 
61 Real
63 {
64  Real _shell_resultant = 0.0;
65 
66  switch (_resultant)
67  {
69  for (unsigned int i = 0; i < _t_points.size(); ++i)
70  {
71  _shell_resultant +=
72  (*_local_stress_t_points[i])[_qp](0, 0) * _t_weights[i] * (_thickness[_qp] / 2);
73  }
74  break;
75 
77  for (unsigned int i = 0; i < _t_points.size(); ++i)
78  {
79  _shell_resultant +=
80  (*_local_stress_t_points[i])[_qp](1, 1) * _t_weights[i] * (_thickness[_qp] / 2);
81  }
82  break;
83 
85  for (unsigned int i = 0; i < _t_points.size(); ++i)
86  {
87  _shell_resultant +=
88  (*_local_stress_t_points[i])[_qp](2, 2) * _t_weights[i] * (_thickness[_qp] / 2);
89  }
90  break;
91 
93  for (unsigned int i = 0; i < _t_points.size(); ++i)
94  {
95  _shell_resultant -= (*_local_stress_t_points[i])[_qp](1, 1) * _t_points[i](0) *
96  _t_weights[i] * (_thickness[_qp] / 2) * (_thickness[_qp] / 2);
97  }
98  break;
99 
101  for (unsigned int i = 0; i < _t_points.size(); ++i)
102  {
103  _shell_resultant -= (*_local_stress_t_points[i])[_qp](0, 0) * _t_points[i](0) *
104  _t_weights[i] * (_thickness[_qp] / 2) * (_thickness[_qp] / 2);
105  }
106  break;
107 
109  for (unsigned int i = 0; i < _t_points.size(); ++i)
110  {
111  _shell_resultant -= (*_local_stress_t_points[i])[_qp](0, 1) * _t_points[i](0) *
112  _t_weights[i] * (_thickness[_qp] / 2) * (_thickness[_qp] / 2);
113  }
114  break;
115 
117  for (unsigned int i = 0; i < _t_points.size(); ++i)
118  {
119  _shell_resultant +=
120  (*_local_stress_t_points[i])[_qp](0, 1) * _t_weights[i] * (_thickness[_qp] / 2);
121  }
122  break;
123 
125  for (unsigned int i = 0; i < _t_points.size(); ++i)
126  {
127  _shell_resultant +=
128  (*_local_stress_t_points[i])[_qp](0, 2) * _t_weights[i] * (_thickness[_qp] / 2);
129  }
130  break;
131 
133  for (unsigned int i = 0; i < _t_points.size(); ++i)
134  {
135  _shell_resultant +=
136  (*_local_stress_t_points[i])[_qp](1, 2) * _t_weights[i] * (_thickness[_qp] / 2);
137  }
138  break;
139  }
140 
141  return _shell_resultant;
142 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
std::unique_ptr< QGauss > _t_qrule
Quadrature rule in the out of plane direction.
registerMooseObject("SolidMechanicsApp", ShellResultantsAux)
const std::string _base_name
Base name of the material system used to calculate the elastic energy.
void addRequiredParam(const std::string &name, const std::string &doc_string)
std::vector< Point > _t_points
Quadrature points and weights in the out of plane direction in isoparametric coordinate system...
std::vector< Real > _t_weights
ShellResultantsAux(const InputParameters &parameters)
std::vector< const MaterialProperty< RankTwoTensor > * > _local_stress_t_points
The local stress tensor.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
const VariableValue & _thickness
Coupled variable for the shell thickness.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
enum ShellResultantsAux::ResultantType _resultant
virtual Real computeValue()
auto index_range(const T &sizable)