https://mooseframework.inl.gov
ParisLaw.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 "ParisLaw.h"
12 #include "MathUtils.h"
13 #include <limits>
14 
15 registerMooseObject("XFEMApp", ParisLaw);
16 
19 {
21  params.addClassDescription(
22  "This reporter computes the crack growth increment at all active crack front points "
23  "in the CrackMeshCut3DUserObject for fatigue crack growth based on the Paris Law. "
24  "Data for crack growth rates in this reporter are stored in the same order as in the "
25  "fracture integral VectorPostprocessors.");
26  params.addRequiredParam<Real>("paris_law_c", "parameter C in the Paris law for fatigue");
27  params.addRequiredParam<Real>("paris_law_m", "parameter m in the Paris law for fatigue");
28  params.addParam<VectorPostprocessorName>(
29  "kii_vectorpostprocessor", "II_KII_1", "Name of the vectorpostprocessor that computes K_II");
30  params.addParam<ReporterValueName>(
31  "growth_increment_name",
32  "growth_increment",
33  "ReporterValueName for storing computed growth increments for the crack front points.");
34  params.addParam<ReporterValueName>(
35  "cycles_to_max_growth_increment_name",
36  "dN",
37  "ReporterValueName for storing computed number of cycles to reach max_growth_increment.");
38  return params;
39 }
40 
42  : CrackGrowthReporterBase(parameters),
43  _paris_law_c(getParam<Real>("paris_law_c")),
44  _paris_law_m(getParam<Real>("paris_law_m")),
45  _kii_vpp(getVectorPostprocessorValue(
46  "kii_vectorpostprocessor", getParam<VectorPostprocessorName>("kii_vectorpostprocessor"))),
47  _dn(declareValueByName<Real>(getParam<ReporterValueName>("cycles_to_max_growth_increment_name"),
49  _growth_increment(declareValueByName<std::vector<Real>>(
50  getParam<ReporterValueName>("growth_increment_name"), REPORTER_MODE_ROOT))
51 {
52 }
53 
54 void
55 ParisLaw::computeGrowth(std::vector<int> & index)
56 {
57  _growth_increment.resize(_ki_x.size(), 0.0);
58  std::vector<Real> effective_k(_ki_x.size(), 0.0);
59  for (std::size_t i = 0; i < _ki_vpp.size(); ++i)
60  if (index[i] != -1)
61  effective_k[i] = std::sqrt(Utility::pow<2>(_ki_vpp[i]) + 2 * Utility::pow<2>(_kii_vpp[i]));
62 
63  Real _max_k = *std::max_element(effective_k.begin(), effective_k.end());
64  if (_max_k == 0)
65  _dn = std::numeric_limits<Real>::max();
66  else
68 
69  for (std::size_t i = 0; i < _ki_vpp.size(); ++i)
70  if (index[i] != -1)
71  {
72  if (_max_k == 0)
73  _growth_increment[i] = 0;
74  else
76  _max_growth_increment * std::pow(effective_k[i] / _max_k, _paris_law_m);
77  }
78 }
const Real _paris_law_c
Paris law parameters.
Definition: ParisLaw.h:27
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const Real _max_growth_increment
Maximum crack growth increment allowed for any of the crack front points.
const ReporterMode REPORTER_MODE_ROOT
virtual void computeGrowth(std::vector< int > &index) override
Compute crack growth increment at the specified crack front point and store increments in an internal...
Definition: ParisLaw.C:55
static InputParameters validParams()
const std::vector< Real > & _ki_vpp
The name of the reporter with K_I fracture integral values.
void addRequiredParam(const std::string &name, const std::string &doc_string)
ParisLaw(const InputParameters &parameters)
Definition: ParisLaw.C:41
std::vector< Real > & _growth_increment
growth rate reporter
Definition: ParisLaw.h:38
const std::vector< Real > & _ki_x
const Real _paris_law_m
Definition: ParisLaw.h:28
static InputParameters validParams()
Definition: ParisLaw.C:18
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("XFEMApp", ParisLaw)
const std::vector< Real > & _kii_vpp
The name of the reporter with K_II fracture integral values.
Definition: ParisLaw.h:32
Real & _dn
Vector containing number of cycles to reach max_growth_increment postprocessor for each crack front p...
Definition: ParisLaw.h:35
void addClassDescription(const std::string &doc_string)
MooseUnits pow(const MooseUnits &, int)