https://mooseframework.inl.gov
Loading...
Searching...
No Matches
InteractionIntegralBenchmarkBC.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
11#include "Function.h"
12
14
17{
18 MooseEnum disp_component("x=0 y=1 z=2");
20 params.addClassDescription("Implements a boundary condition that enforces a displacement field "
21 "around a crack tip based on applied stress intensity factors.");
23 "component", disp_component, "The component of the displacement to apply BC on.");
24 params.addRequiredParam<UserObjectName>("crack_front_definition",
25 "The CrackFrontDefinition user object name");
26 params.addParam<unsigned int>(
27 "crack_front_point_index", 0, "The index of the point on the crack front.");
28 params.addRequiredParam<Real>("poissons_ratio", "Poisson's ratio for the material.");
29 params.addRequiredParam<Real>("youngs_modulus", "Young's modulus of the material.");
30 params.addRequiredParam<FunctionName>("KI_function",
31 "Function describing the Mode I stress intensity factor.");
32 params.addRequiredParam<FunctionName>("KII_function",
33 "Function describing the Mode II stress intensity factor.");
34 params.addRequiredParam<FunctionName>(
35 "KIII_function", "Function describing the Mode III stress intensity factor.");
36 params.set<bool>("preset") = true;
37 return params;
38}
39
41 : DirichletBCBase(parameters),
42 _component(getParam<MooseEnum>("component")),
43 _crack_front_definition(getUserObject<CrackFrontDefinition>("crack_front_definition")),
44 _crack_front_point_index(getParam<unsigned int>("crack_front_point_index")),
45 _poissons_ratio(getParam<Real>("poissons_ratio")),
46 _youngs_modulus(getParam<Real>("youngs_modulus")),
47 _ki_function(getFunction("KI_function")),
48 _kii_function(getFunction("KII_function")),
49 _kiii_function(getFunction("KIII_function"))
50{
51 _kappa = 3 - 4 * _poissons_ratio;
52 _mu = _youngs_modulus / (2 * (1 + _poissons_ratio));
53}
54
55Real
57{
58 const Real ki_val = _ki_function.value(_t, *_current_node);
59 const Real kii_val = _kii_function.value(_t, *_current_node);
60 const Real kiii_val = _kiii_function.value(_t, *_current_node);
61
62 const Point p(*_current_node);
64
65 if (_r == 0)
66 _theta = 0;
67
68 const Real st2 = std::sin(_theta / 2.0);
69 const Real ct2 = std::cos(_theta / 2.0);
70
71 Real disp(0.0);
72
73 if (_component == 0)
74 disp = 1 / (2 * _mu) * std::sqrt(_r / (2 * libMesh::pi)) *
75 (ki_val * ct2 * (_kappa - 1 + 2 * st2 * st2) +
76 kii_val * st2 * (_kappa + 1 + 2 * ct2 * ct2));
77 else if (_component == 1)
78 disp = 1 / (2 * _mu) * std::sqrt(_r / (2 * libMesh::pi)) *
79 (ki_val * st2 * (_kappa + 1 - 2 * ct2 * ct2) -
80 kii_val * ct2 * (_kappa - 1 - 2 * st2 * st2));
81 else if (_component == 2)
82 disp = 1 / _mu * std::sqrt(2 * _r / libMesh::pi) * kiii_val * st2;
83
84 return disp;
85}
const Real p
registerMooseObject("SolidMechanicsApp", InteractionIntegralBenchmarkBC)
void ErrorVector unsigned int
Class used in fracture integrals to define geometric characteristics of the crack front.
void calculateRThetaToCrackFront(const Point qp, const std::size_t point_index, Real &r, Real &theta) const
Calculate r and theta of a point in the crack front polar coordinates for a given crack point index.
static InputParameters validParams()
virtual Real value(Real t, const Point &p) const
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
Implements a boundary condition that enforces a displacement field around a crack tip based on applie...
virtual Real computeQpValue()
Evaluate the function at the current quadrature point and timestep.
InteractionIntegralBenchmarkBC(const InputParameters &parameters)
const CrackFrontDefinition & _crack_front_definition
const Node *const & _current_node
const Real pi