-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12954 from bwspenc/weibull
Add a volume-weighted Weibull IC for randomized local strength
- Loading branch information
Showing
9 changed files
with
455 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
modules/tensor_mechanics/doc/content/source/ics/VolumeWeightedWeibull.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,33 @@ | |||
# Volume Weighted Weibull | |||
|
|||
!syntax description /ICs/VolumeWeightedWeibull | |||
|
|||
The VolumeWeightedWeibull class generates a spatially randomized distribution of a variable following a Weibull distribution, but weighted by the element volume to account for the fact that larger volumes are more likely to contain defects, and would thus have a reduced strength. This class follows the approach documented in [cite!strack_aleatory_2015], and using it to describe local strength for fracture models minimizes mesh size dependence. | |||
|
|||
The randomized value of a given variable $\eta$ used to characterize a strength can be expressed as: | |||
\begin{equation} | |||
\label{eqn:vww} | |||
\eta=\bar{\eta}\biggl[\frac{\bar{V}\ln(R)}{V\ln(0.5)}\biggr]^{1/k} | |||
\end{equation} | |||
where $\bar{\eta}$ is the median value of the strength variable, $\bar{V}$ is the reference volume, which is the volume of a test specimen that has a median strength equal to $\bar{\eta}$, $R$ is a uniform random number on the interval from 0 to 1, and $k$ is the Weibull modulus. | |||
|
|||
This has two important differences from using the standard Weibull distribution, which can also be used to define a randomized strength in MOOSE using a combination of the WeibullDistribution object in the `stochastic_tools` module and the MOOSE [RandomIC](RandomIC.md) object: | |||
|
|||
1. This Weibull distribution is defined by two parameters: the Weibull modulus, $k$, and the median value of the randomized variable, $\bar{\eta}$. This in contrast to the standard version, which has three parameters: the Weibull modulus, $k$, the shape parameter, $\lambda$, and the location parameter, $\theta$. The distribution generated by this Weibull distribution implicitly assumes that $\theta=0$. The value for $\lambda$ for the standard set of parameters in a Weibull distribution can be computed from $\bar{\eta}$ and $k$ as: | |||
\begin{equation} | |||
\lambda=\bar{\eta}\biggl[\frac{-1}{\ln(0.5)}\biggr]^{1/k} | |||
\end{equation} | |||
|
|||
2. The value of the samples from the standard Weibull distribution is scaled by the factor: | |||
\begin{equation} | |||
\biggl[\frac{\bar{V}}{V}\biggr]^{1/k} | |||
\end{equation} | |||
As a result of this scaling, elements larger than the reference volume typically have decreased strength, and elements smaller than the reference volume have increased strength (because $k$ is typically greater than 1). | |||
|
|||
!syntax parameters /ICs/VolumeWeightedWeibull | |||
|
|||
!syntax inputs /ICs/VolumeWeightedWeibull | |||
|
|||
!syntax children /ICs/VolumeWeightedWeibull | |||
|
|||
!bibtex bibliography |
50 changes: 50 additions & 0 deletions
50
modules/tensor_mechanics/include/ics/VolumeWeightedWeibull.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,50 @@ | |||
//* This file is part of the MOOSE framework | |||
//* https://www.mooseframework.org | |||
//* | |||
//* All rights reserved, see COPYRIGHT for full restrictions | |||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | |||
//* | |||
//* Licensed under LGPL 2.1, please see LICENSE for details | |||
//* https://www.gnu.org/licenses/lgpl-2.1.html | |||
|
|||
#ifndef VOLUMEWEIGHTEDWEIBULL_H | |||
#define VOLUMEWEIGHTEDWEIBULL_H | |||
|
|||
#include "RandomICBase.h" | |||
|
|||
// Forward Declarations | |||
class InputParameters; | |||
class VolumeWeightedWeibull; | |||
|
|||
template <typename T> | |||
InputParameters validParams(); | |||
|
|||
template <> | |||
InputParameters validParams<VolumeWeightedWeibull>(); | |||
|
|||
/** | |||
* VolumeWeightedWeibull generates a spatially randomized field that follows | |||
* a Weibull distribution weighted by the factor (V_ref/V_el)^1/m, where | |||
* V_ref is a reference volume from which the experimental data is obtained, | |||
* V_el is the finite element volume, and m is the Weibull modulus, to account | |||
* for the fact that larger material samples are more likely to contain defects. | |||
* This follows the approach of Strack, Leavy, and Brannon, IJNME (2015) | |||
* https://doi.org/10.1002/nme | |||
*/ | |||
class VolumeWeightedWeibull : public RandomICBase | |||
{ | |||
public: | |||
VolumeWeightedWeibull(const InputParameters & parameters); | |||
|
|||
virtual Real value(const Point & p) override; | |||
|
|||
protected: | |||
/// The reference volume of the test specimen from which a median strength is obtained | |||
const Real _reference_volume; | |||
/// The Weibull modulus | |||
const Real _weibull_modulus; | |||
/// The median value of the strength for specimens having volume equal to the reference volume | |||
const Real _median; | |||
}; | |||
|
|||
#endif // VOLUMEWEIGHTEDWEIBULL_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,45 @@ | |||
//* This file is part of the MOOSE framework | |||
//* https://www.mooseframework.org | |||
//* | |||
//* All rights reserved, see COPYRIGHT for full restrictions | |||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | |||
//* | |||
//* Licensed under LGPL 2.1, please see LICENSE for details | |||
//* https://www.gnu.org/licenses/lgpl-2.1.html | |||
|
|||
#include "VolumeWeightedWeibull.h" | |||
|
|||
registerMooseObject("TensorMechanicsApp", VolumeWeightedWeibull); | |||
|
|||
template <> | |||
InputParameters | |||
validParams<VolumeWeightedWeibull>() | |||
{ | |||
InputParameters params = validParams<RandomICBase>(); | |||
params.addRequiredParam<Real>("reference_volume", "Reference volume (of a test specimen)"); | |||
params.addRequiredParam<Real>("weibull_modulus", "Weibull modulus"); | |||
params.addParam<Real>( | |||
"median", | |||
"Median value of property measured in a specimen of volume equal to reference_volume"); | |||
params.addClassDescription("Initialize a variable with randomly generated numbers following " | |||
"a volume-weighted Weibull distribution"); | |||
return params; | |||
} | |||
|
|||
VolumeWeightedWeibull::VolumeWeightedWeibull(const InputParameters & parameters) | |||
: RandomICBase(parameters), | |||
_reference_volume(getParam<Real>("reference_volume")), | |||
_weibull_modulus(getParam<Real>("weibull_modulus")), | |||
_median(getParam<Real>("median")) | |||
{ | |||
} | |||
|
|||
Real | |||
VolumeWeightedWeibull::value(const Point & /*p*/) | |||
{ | |||
const Real & element_volume = _current_elem->volume(); | |||
|
|||
return _median * | |||
std::pow(_reference_volume * std::log(generateRandom()) / (element_volume * std::log(0.5)), | |||
1.0 / _weibull_modulus); | |||
} |
101 changes: 101 additions & 0 deletions
101
...sts/ics/volume_weighted_weibull/gold/volume_weighted_weibull_finer_initial_histo_0000.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,101 @@ | |||
u_vww,n | |||
0.01,0 | |||
0.03,0 | |||
0.05,0 | |||
0.07,0 | |||
0.09,0 | |||
0.11,0 | |||
0.13,0 | |||
0.15,0 | |||
0.17,0 | |||
0.19,0 | |||
0.21,0 | |||
0.23,0 | |||
0.25,0 | |||
0.27,0 | |||
0.29,0 | |||
0.31,0 | |||
0.33,0 | |||
0.35,0 | |||
0.37,0 | |||
0.39,0 | |||
0.41,0 | |||
0.43,2.5e-05 | |||
0.45,0 | |||
0.47,0 | |||
0.49,0 | |||
0.51,2.5e-05 | |||
0.53,0 | |||
0.55,0 | |||
0.57,7.5e-05 | |||
0.59,0.0002 | |||
0.61,0.0002 | |||
0.63,0.00035 | |||
0.65,0.000675 | |||
0.67,0.000725 | |||
0.69,0.001225 | |||
0.71,0.001625 | |||
0.73,0.002675 | |||
0.75,0.003775 | |||
0.77,0.0049 | |||
0.79,0.0072 | |||
0.81,0.010825 | |||
0.83,0.01435 | |||
0.85,0.0198 | |||
0.87,0.0265 | |||
0.89,0.03615 | |||
0.91,0.047774999999999 | |||
0.93,0.059724999999997 | |||
0.95,0.076299999999996 | |||
0.97,0.087399999999994 | |||
0.99,0.099549999999993 | |||
1.01,0.10674999999999 | |||
1.03,0.10527499999999 | |||
1.05,0.098824999999993 | |||
1.07,0.077499999999996 | |||
1.09,0.056099999999998 | |||
1.11,0.031625000000001 | |||
1.13,0.01505 | |||
1.15,0.005425 | |||
1.17,0.00105 | |||
1.19,0.000325 | |||
1.21,2.5e-05 | |||
1.23,0 | |||
1.25,0 | |||
1.27,0 | |||
1.29,0 | |||
1.31,0 | |||
1.33,0 | |||
1.35,0 | |||
1.37,0 | |||
1.39,0 | |||
1.41,0 | |||
1.43,0 | |||
1.45,0 | |||
1.47,0 | |||
1.49,0 | |||
1.51,0 | |||
1.53,0 | |||
1.55,0 | |||
1.57,0 | |||
1.59,0 | |||
1.61,0 | |||
1.63,0 | |||
1.65,0 | |||
1.67,0 | |||
1.69,0 | |||
1.71,0 | |||
1.73,0 | |||
1.75,0 | |||
1.77,0 | |||
1.79,0 | |||
1.81,0 | |||
1.83,0 | |||
1.85,0 | |||
1.87,0 | |||
1.89,0 | |||
1.91,0 | |||
1.93,0 | |||
1.95,0 | |||
1.97,0 | |||
1.99,0 |
101 changes: 101 additions & 0 deletions
101
...est/tests/ics/volume_weighted_weibull/gold/volume_weighted_weibull_initial_histo_0000.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,101 @@ | |||
u_vww,n | |||
0.01,0 | |||
0.03,0 | |||
0.05,0 | |||
0.07,0 | |||
0.09,0 | |||
0.11,0 | |||
0.13,0 | |||
0.15,0 | |||
0.17,0 | |||
0.19,0 | |||
0.21,0 | |||
0.23,0 | |||
0.25,0 | |||
0.27,0 | |||
0.29,0 | |||
0.31,0 | |||
0.33,0 | |||
0.35,0 | |||
0.37,0 | |||
0.39,0 | |||
0.41,0 | |||
0.43,0 | |||
0.45,0 | |||
0.47,0 | |||
0.49,0 | |||
0.51,0 | |||
0.53,0 | |||
0.55,0 | |||
0.57,0 | |||
0.59,0.0002 | |||
0.61,0.0004 | |||
0.63,0.0003 | |||
0.65,0.001 | |||
0.67,0.0009 | |||
0.69,0.0017 | |||
0.71,0.0014 | |||
0.73,0.0022 | |||
0.75,0.004 | |||
0.77,0.0053 | |||
0.79,0.007 | |||
0.81,0.0117 | |||
0.83,0.0135 | |||
0.85,0.021 | |||
0.87,0.0262 | |||
0.89,0.035 | |||
0.91,0.0486 | |||
0.93,0.0606 | |||
0.95,0.073500000000001 | |||
0.97,0.082500000000001 | |||
0.99,0.098900000000002 | |||
1.01,0.1058 | |||
1.03,0.104 | |||
1.05,0.1015 | |||
1.07,0.082100000000001 | |||
1.09,0.0553 | |||
1.11,0.0338 | |||
1.13,0.0139 | |||
1.15,0.0064 | |||
1.17,0.001 | |||
1.19,0.0003 | |||
1.21,0 | |||
1.23,0 | |||
1.25,0 | |||
1.27,0 | |||
1.29,0 | |||
1.31,0 | |||
1.33,0 | |||
1.35,0 | |||
1.37,0 | |||
1.39,0 | |||
1.41,0 | |||
1.43,0 | |||
1.45,0 | |||
1.47,0 | |||
1.49,0 | |||
1.51,0 | |||
1.53,0 | |||
1.55,0 | |||
1.57,0 | |||
1.59,0 | |||
1.61,0 | |||
1.63,0 | |||
1.65,0 | |||
1.67,0 | |||
1.69,0 | |||
1.71,0 | |||
1.73,0 | |||
1.75,0 | |||
1.77,0 | |||
1.79,0 | |||
1.81,0 | |||
1.83,0 | |||
1.85,0 | |||
1.87,0 | |||
1.89,0 | |||
1.91,0 | |||
1.93,0 | |||
1.95,0 | |||
1.97,0 | |||
1.99,0 |
28 changes: 28 additions & 0 deletions
28
modules/tensor_mechanics/test/tests/ics/volume_weighted_weibull/tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,28 @@ | |||
[Tests] | |||
design = 'VolumeWeightedWeibull.md' | |||
issues = '#10221' | |||
[./test] | |||
type = 'CSVDiff' | |||
input = 'volume_weighted_weibull.i' | |||
csvdiff = 'volume_weighted_weibull_initial_histo_0000.csv' | |||
requirement = 'VolumeWeightedWeibull shall generate a randomly distributed field that approximates the analytic expression for the Weibull distribution when the mesh is uniform and the reference volume is set equal to the element size' | |||
[../] | |||
[./test_finer] | |||
prereq = test | |||
type = 'CSVDiff' | |||
input = 'volume_weighted_weibull.i' | |||
cli_args = 'Mesh/nx=200 Mesh/ny=200 Outputs/initial/file_base=volume_weighted_weibull_finer_initial ICs/u_vww/reference_volume=0.000025' | |||
csvdiff = 'volume_weighted_weibull_finer_initial_histo_0000.csv' | |||
requirement = 'VolumeWeightedWeibull shall generate a randomly distributed field that approaches the analytic expression for the Weibull distribution when the mesh is uniform and the reference volume is set equal to the element size as the mesh density is increased' | |||
[../] | |||
[./test_ref_vol] | |||
prereq = test_finer | |||
type = 'CSVDiff' | |||
input = 'volume_weighted_weibull.i' | |||
# Setting the median to 1/(V_ref/V_el)^(1/weibull_modulus) should give the same result as the baseline case | |||
#The ratio V_ref/V_el is 2 in this case, so the median should be 1/(2^(1/15)), or 0.9548416039 | |||
cli_args = 'ICs/u_vww/median=0.9548416039 ICs/u_vww/reference_volume=0.0002' | |||
csvdiff = 'volume_weighted_weibull_initial_histo_0000.csv' | |||
requirement = 'VolumeWeightedWeibull shall generate a randomly distributed field that approximates the analytic expression for the Weibull distribution when the mesh is uniform, the reference volume is set to a value different from the element size, and the median is adjusted to account for the different reference volume' | |||
[../] | |||
[] |
Oops, something went wrong.