www.mooseframework.org
ComputeElasticityBeam.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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("TensorMechanicsApp", ComputeElasticityBeam);
14 
16 
17 InputParameters
19 {
20  InputParameters params = Material::validParams();
21  params.addClassDescription("Computes the equivalent of the elasticity tensor for the beam "
22  "element, which are vectors of material translational and flexural "
23  "stiffness.");
24  params.addParam<FunctionName>(
25  "elasticity_prefactor",
26  "Optional function to use as a scalar prefactor on the elasticity vector for the beam.");
27  params.addRequiredCoupledVar(
28  "youngs_modulus",
29  "Young's modulus of the material. Can be supplied as either a number or a variable name.");
30  params.addRequiredCoupledVar(
31  "poissons_ratio",
32  "Poisson's ratio of the material. Can be supplied as either a number or a variable name.");
33  params.addCoupledVar(
34  "shear_coefficient",
35  1.0,
36  "Scale factor for the shear modulus. Can be supplied as either a number or a variable name.");
37  return params;
38 }
39 
40 ComputeElasticityBeam::ComputeElasticityBeam(const InputParameters & parameters)
41  : Material(parameters),
42  _material_stiffness(declareProperty<RealVectorValue>("material_stiffness")),
43  _material_flexure(declareProperty<RealVectorValue>("material_flexure")),
44  _prefactor_function(isParamValid("elasticity_prefactor") ? &getFunction("elasticity_prefactor")
45  : nullptr),
46  _youngs_modulus(coupledValue("youngs_modulus")),
47  _poissons_ratio(coupledValue("poissons_ratio")),
48  _shear_coefficient(coupledValue("shear_coefficient"))
49 {
50 }
51 
52 void
54 {
55  const Real shear_modulus = _youngs_modulus[_qp] / (2.0 * (1.0 + _poissons_ratio[_qp]));
56 
57  // material_stiffness relates the translational strains to forces
58  _material_stiffness[_qp](0) = _youngs_modulus[_qp];
59  _material_stiffness[_qp](1) = _shear_coefficient[_qp] * shear_modulus;
60  _material_stiffness[_qp](2) = _material_stiffness[_qp](1);
61 
62  // material_flexure relates the rotational strains to moments
63  _material_flexure[_qp](0) = _shear_coefficient[_qp] * shear_modulus;
64  _material_flexure[_qp](1) = _youngs_modulus[_qp];
65  _material_flexure[_qp](2) = _material_flexure[_qp](1);
66 
67  // Multiply by prefactor
69  {
70  _material_stiffness[_qp] *= _prefactor_function->value(_t, _q_point[_qp]);
71  _material_flexure[_qp] *= _prefactor_function->value(_t, _q_point[_qp]);
72  }
73 }
ComputeElasticityBeam::ComputeElasticityBeam
ComputeElasticityBeam(const InputParameters &parameters)
Definition: ComputeElasticityBeam.C:40
ComputeElasticityBeam.h
ComputeElasticityBeam::_prefactor_function
const Function *const _prefactor_function
Prefactor function used to modify (i.e., multiply) the material stiffness and flexure vectors.
Definition: ComputeElasticityBeam.h:41
ComputeElasticityBeam::_youngs_modulus
const VariableValue & _youngs_modulus
Young's modulus of the beam material.
Definition: ComputeElasticityBeam.h:44
ComputeElasticityBeam
Definition: ComputeElasticityBeam.h:24
registerMooseObject
registerMooseObject("TensorMechanicsApp", ComputeElasticityBeam)
defineLegacyParams
defineLegacyParams(ComputeElasticityBeam)
ComputeElasticityBeam::validParams
static InputParameters validParams()
Definition: ComputeElasticityBeam.C:18
ComputeElasticityBeam::_shear_coefficient
const VariableValue & _shear_coefficient
Shear coefficient for the beam cross-section.
Definition: ComputeElasticityBeam.h:50
ComputeElasticityBeam::_poissons_ratio
const VariableValue & _poissons_ratio
Poisson's ratio of the beam material.
Definition: ComputeElasticityBeam.h:47
validParams
InputParameters validParams()
ComputeElasticityBeam::_material_stiffness
MaterialProperty< RealVectorValue > & _material_stiffness
Material stiffness vector that relates displacement strain increments to force increments.
Definition: ComputeElasticityBeam.h:35
ComputeElasticityBeam::computeQpProperties
virtual void computeQpProperties() override
Definition: ComputeElasticityBeam.C:53
ComputeElasticityBeam::_material_flexure
MaterialProperty< RealVectorValue > & _material_flexure
Material flexure vector that relates rotational strain increments to moment increments.
Definition: ComputeElasticityBeam.h:38