https://mooseframework.inl.gov
Loading...
Searching...
No Matches
VolumeWeightedWeibull.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
13
16{
18 params.addRequiredParam<Real>("reference_volume", "Reference volume (of a test specimen)");
19 params.addRequiredParam<Real>("weibull_modulus", "Weibull modulus");
20 params.addParam<Real>(
21 "median",
22 "Median value of property measured in a specimen of volume equal to reference_volume");
23 params.addClassDescription("Initialize a variable with randomly generated numbers following "
24 "a volume-weighted Weibull distribution");
25 return params;
26}
27
29 : RandomICBase(parameters),
30 _reference_volume(getParam<Real>("reference_volume")),
31 _weibull_modulus(getParam<Real>("weibull_modulus")),
32 _median(getParam<Real>("median"))
33{
34}
35
36Real
37VolumeWeightedWeibull::value(const Point & /*p*/)
38{
39 return _median * std::pow(_reference_volume * std::log(generateRandom()) /
40 (_current_elem_volume * std::log(0.5)),
41 1.0 / _weibull_modulus);
42}
registerMooseObject("SolidMechanicsApp", VolumeWeightedWeibull)
const Real & _current_elem_volume
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)
static InputParameters validParams()
Real generateRandom()
VolumeWeightedWeibull generates a spatially randomized field that follows a Weibull distribution weig...
virtual Real value(const Point &p) override
const Real _weibull_modulus
The Weibull modulus.
const Real _reference_volume
The reference volume of the test specimen from which a median strength is obtained.
static InputParameters validParams()
const Real _median
The median value of the strength for specimens having volume equal to the reference volume.
VolumeWeightedWeibull(const InputParameters &parameters)