www.mooseframework.org
ComputeAxisymmetric1DSmallStrain.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<Compute1DSmallStrain>();
15  params.addClassDescription("Compute a small strain in an Axisymmetric 1D problem");
16  params.addParam<UserObjectName>("subblock_index_provider",
17  "SubblockIndexProvider user object name");
18  params.addCoupledVar("scalar_out_of_plane_strain", "Scalar variable for axisymmetric 1D problem");
19  params.addCoupledVar("out_of_plane_strain", "Nonlinear variable for axisymmetric 1D problem");
20 
21  return params;
22 }
23 
25  const InputParameters & parameters)
26  : Compute1DSmallStrain(parameters),
27  _subblock_id_provider(isParamValid("subblock_index_provider")
28  ? &getUserObject<SubblockIndexProvider>("subblock_index_provider")
29  : nullptr),
30  _has_out_of_plane_strain(isParamValid("out_of_plane_strain")),
31  _out_of_plane_strain(_has_out_of_plane_strain ? coupledValue("out_of_plane_strain") : _zero),
32  _has_scalar_out_of_plane_strain(isParamValid("scalar_out_of_plane_strain")),
33  _nscalar_strains(
34  _has_scalar_out_of_plane_strain ? coupledScalarComponents("scalar_out_of_plane_strain") : 0)
35 {
37  mooseError("Must define only one of out_of_plane_strain or scalar_out_of_plane_strain");
38 
40  mooseError("Must define either out_of_plane_strain or scalar_out_of_plane_strain");
41 
42  // in case when the provided scalar_out_of_plane_strain is not a coupled
43  // scalar variable, still set _nscalar_strains = 1 but return its default value 0
44  if (coupledScalarComponents("scalar_out_of_plane_strain") == 0)
45  _nscalar_strains = 1;
46 
48  {
50  for (unsigned int i = 0; i < _nscalar_strains; ++i)
51  _scalar_out_of_plane_strain[i] = &coupledScalarValue("scalar_out_of_plane_strain", i);
52  }
53 }
54 
55 void
57 {
58  if (getBlockCoordSystem() != Moose::COORD_RZ)
59  mooseError("The coordinate system must be set to RZ for Axisymmetric geometries.");
60 }
61 
62 Real
64 {
67  else
68  return _out_of_plane_strain[_qp];
69 }
70 
71 Real
73 {
74  if (!MooseUtils::absoluteFuzzyEqual(_q_point[_qp](0), 0.0))
75  return (*_disp[0])[_qp] / _q_point[_qp](0);
76  else
77  return 0.0;
78 }
Real computeStrainZZ() override
Computes the strain_zz for axisymmetric problems, where .
InputParameters validParams< ComputeAxisymmetric1DSmallStrain >()
ComputeAxisymmetric1DSmallStrain(const InputParameters &parameters)
Abstract base class for user objects that provide an index for a given element that is independent of...
unsigned int getCurrentSubblockIndex() const
gets its subblock index for current element
std::vector< const VariableValue * > _disp
InputParameters validParams< Compute1DSmallStrain >()
Real computeStrainYY() override
Computes the strain_yy for axisymmetric problems.
std::vector< const VariableValue * > _scalar_out_of_plane_strain
Compute1DSmallStrain defines a strain tensor, assuming small strains, in 1D problems, handling strains in other two directions.