https://mooseframework.inl.gov
StressCorrosionCrackingExponential.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 
12 
14 
17 {
19  params.addClassDescription(
20  "This reporter computes the crack growth increment at all active crack front points "
21  "in the CrackMeshCut3DUserObject for stress corrosion cracking fit to an exponential "
22  "function. Crack growth rates computed by this reporter are stored in the same order as in "
23  "the fracture integral VectorPostprocessors.");
24 
25  params.addRequiredRangeCheckedParam<Real>("k_low",
26  "k_low>0",
27  "Value of K_I below which the crack growth rate is "
28  "constant and equal to the mid growth rate function "
29  "evaluated with a K_I=k_low.");
30  params.addRequiredRangeCheckedParam<Real>("k_high",
31  "k_high>0",
32  "Value of K_I above which the crack growth rate is "
33  "constant and equal to the mid growth rate function "
34  "evaluated with a K_I=k_high.");
35  params.addRequiredParam<Real>("growth_rate_mid_multiplier",
36  "Growth rate multiplier when K_I is between k_low and k_high");
37  params.addRequiredParam<Real>("growth_rate_mid_exp_factor", "Growth rate exponential factor");
38 
39  params.addParam<ReporterValueName>(
40  "growth_increment_name",
41  "growth_increment",
42  "ReporterValueName for storing computed growth increments for the crack front points.");
43  params.addParam<ReporterValueName>(
44  "time_to_max_growth_increment_name",
45  "max_growth_timestep",
46  "ReporterValueName for storing computed timestep to reach max_growth_increment.");
47  return params;
48 }
49 
51  const InputParameters & parameters)
52  : CrackGrowthReporterBase(parameters),
53  _k_low(getParam<Real>("k_low")),
54  _k_high(getParam<Real>("k_high")),
55  _growth_rate_mid_multiplier(getParam<Real>("growth_rate_mid_multiplier")),
56  _growth_rate_mid_exp_factor(getParam<Real>("growth_rate_mid_exp_factor")),
57 
58  _time_increment(declareValueByName<Real>(
59  getParam<ReporterValueName>("time_to_max_growth_increment_name"), REPORTER_MODE_ROOT)),
60  _growth_increment(declareValueByName<std::vector<Real>>(
61  getParam<ReporterValueName>("growth_increment_name"), REPORTER_MODE_ROOT))
62 {
63  if (_k_low > _k_high)
64  paramError("k_high", "k_high must be larger than k_low");
65 }
66 
67 void
69 {
70  _growth_increment.resize(_ki_x.size(), 0.0);
71  std::vector<Real> growth_rate(_ki_x.size(), 0.0);
72 
73  for (std::size_t i = 0; i < _ki_vpp.size(); ++i)
74  {
75  if (index[i] != -1)
76  {
77  Real ki = _ki_vpp[i];
78  if (ki < _k_low)
79  ki = _k_low;
80  else if (ki > _k_high)
81  ki = _k_high;
82 
84  }
85  }
86 
87  Real max_growth_rate = *std::max_element(growth_rate.begin(), growth_rate.end());
88  if (max_growth_rate <= 0)
89  mooseError("Negative max growth rate encountered on crack front. ");
90 
91  _time_increment = _max_growth_increment / max_growth_rate;
92 
93  for (std::size_t i = 0; i < _ki_vpp.size(); ++i)
94  {
95  if (index[i] != -1)
96  _growth_increment[i] = growth_rate[i] * _time_increment;
97  }
98 }
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
std::vector< Real > & _growth_increment
growth increment reporters
void paramError(const std::string &param, Args... args) const
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...
registerMooseObject("XFEMApp", StressCorrosionCrackingExponential)
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)
Real & _time_increment
timestep size to reach max_growth_increment postprocessor
StressCorrosionCrackingExponential(const InputParameters &parameters)
const std::vector< Real > & _ki_x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
MooseUnits pow(const MooseUnits &, int)
const Real & _k_low
Material specific scc parameters.