https://mooseframework.inl.gov
ComputeElasticityBeam.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 "ComputeElasticityBeam.h"
11 #include "Function.h"
12 
13 registerMooseObject("SolidMechanicsApp", ComputeElasticityBeam);
14 
17 {
19  params.addClassDescription("Computes the equivalent of the elasticity tensor for the beam "
20  "element, which are vectors of material translational and flexural "
21  "stiffness.");
22  params.addParam<FunctionName>(
23  "elasticity_prefactor",
24  "Optional function to use as a scalar prefactor on the elasticity vector for the beam.");
25  params.addRequiredCoupledVar(
26  "youngs_modulus",
27  "Young's modulus of the material. Can be supplied as either a number or a variable name.");
28  params.addRequiredCoupledVar(
29  "poissons_ratio",
30  "Poisson's ratio of the material. Can be supplied as either a number or a variable name.");
31  params.addCoupledVar(
32  "shear_coefficient",
33  1.0,
34  "Scale factor for the shear modulus. Can be supplied as either a number or a variable name.");
35  return params;
36 }
37 
39  : Material(parameters),
40  _material_stiffness(declareProperty<RealVectorValue>("material_stiffness")),
41  _material_flexure(declareProperty<RealVectorValue>("material_flexure")),
42  _prefactor_function(isParamValid("elasticity_prefactor") ? &getFunction("elasticity_prefactor")
43  : nullptr),
44  _youngs_modulus(coupledValue("youngs_modulus")),
45  _poissons_ratio(coupledValue("poissons_ratio")),
46  _shear_coefficient(coupledValue("shear_coefficient"))
47 {
48 }
49 
50 void
52 {
53  const Real shear_modulus = _youngs_modulus[_qp] / (2.0 * (1.0 + _poissons_ratio[_qp]));
54 
55  // material_stiffness relates the translational strains to forces
57  _material_stiffness[_qp](1) = _shear_coefficient[_qp] * shear_modulus;
59 
60  // material_flexure relates the rotational strains to moments
61  _material_flexure[_qp](0) = _shear_coefficient[_qp] * shear_modulus;
64 
65  // Multiply by prefactor
67  {
70  }
71 }
const MooseArray< Point > & _q_point
const VariableValue & _shear_coefficient
Shear coefficient for the beam cross-section.
virtual void computeQpProperties() override
MaterialProperty< RealVectorValue > & _material_flexure
Material flexure vector that relates rotational strain increments to moment increments.
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
MaterialProperty< RealVectorValue > & _material_stiffness
Material stiffness vector that relates displacement strain increments to force increments.
const VariableValue & _youngs_modulus
Young&#39;s modulus of the beam material.
unsigned int _qp
static InputParameters validParams()
Real & _t
ComputeElasticityBeam(const InputParameters &parameters)
const VariableValue & _poissons_ratio
Poisson&#39;s ratio of the beam material.
ComputeElasticityBeam computes the equivalent of the elasticity tensor for the beam element...
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
virtual Real value(Real t, const Point &p) const
const Function *const _prefactor_function
Prefactor function used to modify (i.e., multiply) the material stiffness and flexure vectors...
registerMooseObject("SolidMechanicsApp", ComputeElasticityBeam)