www.mooseframework.org
InteractionIntegralBenchmarkBC.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 #include "Function.h"
10 
11 template <>
12 InputParameters
14 {
15  MooseEnum disp_component("x=0 y=1 z=2");
16  InputParameters params = validParams<PresetNodalBC>();
17  params.addRequiredParam<MooseEnum>(
18  "component", disp_component, "The component of the displacement to apply BC on.");
19  params.addRequiredParam<UserObjectName>("crack_front_definition",
20  "The CrackFrontDefinition user object name");
21  params.addParam<unsigned int>(
22  "crack_front_point_index", 0, "The index of the point on the crack front.");
23  params.addRequiredParam<Real>("poissons_ratio", "Poisson's ratio for the material.");
24  params.addRequiredParam<Real>("youngs_modulus", "Young's modulus of the material.");
25  params.addRequiredParam<FunctionName>("KI_function",
26  "Function describing the Mode I stress intensity factor.");
27  params.addRequiredParam<FunctionName>("KII_function",
28  "Function describing the Mode II stress intensity factor.");
29  params.addRequiredParam<FunctionName>(
30  "KIII_function", "Function describing the Mode III stress intensity factor.");
31  return params;
32 }
33 
35  : PresetNodalBC(parameters),
36  _component(getParam<MooseEnum>("component")),
37  _crack_front_definition(&getUserObject<CrackFrontDefinition>("crack_front_definition")),
38  _crack_front_point_index(getParam<unsigned int>("crack_front_point_index")),
39  _poissons_ratio(getParam<Real>("poissons_ratio")),
40  _youngs_modulus(getParam<Real>("youngs_modulus")),
41  _ki_function(getFunction("KI_function")),
42  _kii_function(getFunction("KII_function")),
43  _kiii_function(getFunction("KIII_function"))
44 {
45  _kappa = 3 - 4 * _poissons_ratio;
46  _mu = _youngs_modulus / (2 * (1 + _poissons_ratio));
47 }
48 
49 Real
51 {
52  const Real ki_val = _ki_function.value(_t, *_current_node);
53  const Real kii_val = _kii_function.value(_t, *_current_node);
54  const Real kiii_val = _kiii_function.value(_t, *_current_node);
55 
56  const Point p(*_current_node);
58 
59  if (_r == 0)
60  _theta = 0;
61 
62  const Real st2 = std::sin(_theta / 2.0);
63  const Real ct2 = std::cos(_theta / 2.0);
64 
65  Real disp(0.0);
66 
67  if (_component == 0)
68  disp = 1 / (2 * _mu) * std::sqrt(_r / (2 * libMesh::pi)) *
69  (ki_val * ct2 * (_kappa - 1 + 2 * st2 * st2) +
70  kii_val * st2 * (_kappa + 1 + 2 * ct2 * ct2));
71  else if (_component == 1)
72  disp = 1 / (2 * _mu) * std::sqrt(_r / (2 * libMesh::pi)) *
73  (ki_val * st2 * (_kappa + 1 - 2 * ct2 * ct2) -
74  kii_val * ct2 * (_kappa - 1 - 2 * st2 * st2));
75  else if (_component == 2)
76  disp = 1 / _mu * std::sqrt(2 * _r / libMesh::pi) * kiii_val * st2;
77 
78  return disp;
79 }
const CrackFrontDefinition * _crack_front_definition
virtual Real computeQpValue()
Evaluate the function at the current quadrature point and timestep.
void calculateRThetaToCrackFront(const Point qp, const unsigned int point_index, Real &r, Real &theta) const
calculate r and theta in the crack front polar cooridnate
Works on top of NodalNormalsPreprocessor.
InteractionIntegralBenchmarkBC(const InputParameters &parameters)
InputParameters validParams< InteractionIntegralBenchmarkBC >()