13 #include "MooseMesh.h"
14 #include "MooseVariable.h"
23 params.addClassDescription(
"Bimodal size distribution of large particles (specified in input "
24 "file) and small particles (placed randomly outside the larger "
26 params.addRequiredParam<
unsigned int>(
"npart",
"The number of random (small) particles to place");
27 params.addRequiredParam<Real>(
29 "minimum spacing between small particles, measured from closest edge to closest edge");
30 params.addRequiredParam<Real>(
"large_spac",
31 "minimum spacing between large and small particles, "
32 "measured from closest edge to closest edge");
33 params.addRequiredParam<Real>(
34 "small_a",
"Mean semiaxis a value for the randomly placed (small) superellipsoids");
35 params.addRequiredParam<Real>(
36 "small_b",
"Mean semiaxis b value for the randomly placed (small) superellipsoids");
37 params.addRequiredParam<Real>(
38 "small_c",
"Mean semiaxis c value for the randomly placed (small) superellipsoids");
39 params.addRequiredParam<Real>(
"small_n",
40 "Exponent n for the randomly placed (small) superellipsoids");
41 params.addParam<Real>(
"size_variation",
43 "Plus or minus fraction of random variation in the "
44 "semiaxes for uniform, standard deviation for "
46 MooseEnum rand_options(
"uniform normal none",
"none");
47 params.addParam<MooseEnum>(
48 "size_variation_type", rand_options,
"Type of distribution that random semiaxes will follow");
49 params.addParam<
unsigned int>(
50 "numtries", 1000,
"The number of tries to place the random particles");
56 _npart(getParam<unsigned int>(
"npart")),
57 _small_spac(getParam<Real>(
"small_spac")),
58 _large_spac(getParam<Real>(
"large_spac")),
59 _small_a(getParam<Real>(
"small_a")),
60 _small_b(getParam<Real>(
"small_b")),
61 _small_c(getParam<Real>(
"small_c")),
62 _small_n(getParam<Real>(
"small_n")),
63 _size_variation(getParam<Real>(
"size_variation")),
64 _size_variation_type(getParam<MooseEnum>(
"size_variation_type")),
65 _max_num_tries(getParam<unsigned int>(
"numtries"))
73 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
81 mooseError(
"If size_variation > 0.0, you must pass in a size_variation_type in "
82 "BimodalSuperellipsoidsIC");
95 for (
unsigned int i = 0; i <
_input_as.size(); ++i)
110 Real rand_num =
_random.rand(_tid);
142 for (
unsigned int i = 0; i <
_input_ns.size(); ++i)
167 unsigned int num_tries = 0;
174 ran(0, 0) =
_random.rand(_tid);
175 ran(1, 1) =
_random.rand(_tid);
176 ran(2, 2) =
_random.rand(_tid);
181 for (
unsigned int j = 0; j < i; ++j)
189 const Real dist = dist_vec.norm();
192 Real rmn1 = (
std::pow(std::abs(dist_vec(0) / dist /
_as[j]),
_ns[j]) +
200 Real rmn2 = (
std::pow(std::abs(dist_vec(0) / dist /
_as[i]),
_ns[i]) +
220 mooseError(
"Too many tries in MultiSmoothCircleIC");