24 params.
addClassDescription(
"Calculate Grand Potential interface parameters for a specified "
25 "interfacial free energy and width");
26 params.
addRequiredParam<std::vector<Real>>(
"sigma",
"Interfacial free energies");
28 "width",
"width > 0",
"Interfacial width (for the interface with gamma = 1.5)");
29 params.
addParam<std::vector<MaterialPropertyName>>(
31 "Interfacial / grain boundary gamma parameter names (leave empty for gamma0... gammaN)");
32 params.
addParam<MaterialPropertyName>(
"kappa_name",
"kappa",
"Gradient interface parameter name");
33 params.
addParam<MaterialPropertyName>(
"mu_name",
"mu",
"Grain growth bulk energy parameter name");
34 MooseEnum reference_sigma(
"max median",
"max");
38 "Interface that is assigned gamma = 1.5 and the interfacial width 'width': the one with the "
39 "largest (max) or the median (median) interfacial free energy");
40 params.
addParam<
unsigned int>(
"sigma_index",
41 "Sigma index to choose gamma = 1.5 for. Omit this to choose it "
42 "according to reference_sigma.");
49 _sigma(getParam<
std::vector<Real>>(
"sigma")),
50 _width(getParam<Real>(
"width")),
51 _n_pair(_sigma.size()),
53 _gamma_name(getParam<
std::vector<MaterialPropertyName>>(
"gamma_names")),
55 _kappa_prop(declareProperty<Real>(getParam<MaterialPropertyName>(
"kappa_name"))),
56 _mu_prop(declareProperty<Real>(getParam<MaterialPropertyName>(
"mu_name")))
60 paramError(
"sigma",
"Specify at least one interfacial energy");
64 "Specify either as many entries are sigma values or none at all for auto-naming the "
65 "gamma material properties.");
69 for (
unsigned int i = 0; i <
_n_pair; i++)
73 for (
unsigned int i = 0; i <
_n_pair; i++)
78 unsigned int reference;
80 reference = getParam<unsigned int>(
"sigma_index");
81 else if (getParam<MooseEnum>(
"reference_sigma") ==
"max")
85 std::vector<size_t> indices;
87 reference = indices[(indices.size() - 1) / 2];
98 for (
unsigned int i = 0; i <
_n_pair; ++i)
107 "The interfacial free energy ",
111 ", which is outside the range 0.098 <= g <= 0.766 (0.53 <= gamma <= 40) covered "
112 "by interface_fit = moelans2022.");
124 for (
unsigned int i = 0; i <
_n_pair; ++i)
registerMooseObject("PhaseFieldApp", GrandPotentialInterface)
Calculate Grand Potential interface parameters for a specified interfacial free energy and width.
std::vector< MaterialPropertyName > _gamma_name
gamma material property names
std::vector< Real > _gamma
Calculated gamma parameter values.
MaterialProperty< Real > & _kappa_prop
MaterialProperty< Real > & _mu_prop
const Real _width
Interface width for the reference interface.
const std::vector< Real > _sigma
list of interfacial free energies
std::vector< MaterialProperty< Real > * > _gamma_prop
Material properties for all interface pairs.
virtual void computeQpProperties() override
const unsigned int _n_pair
number of interface pairs
GrandPotentialInterface(const InputParameters ¶meters)
static InputParameters validParams()
static InputParameters validParams()
void paramError(const std::string ¶m, Args... args) const
bool isParamValid(const std::string &name) const
Fit
Fits selectable through the "interface_fit" parameter.
Real inverseGamma(Real g2, Fit fit)
1/gamma as a function of g^2
InputParameters validParams()
Parameters for objects using these fits.
bool inRange(Real g2, Fit fit)
Whether g^2 lies within the range the fit was made for.
std::string stringify(const T &t)
void indirectSort(RandomAccessIterator beg, RandomAccessIterator end, std::vector< size_t > &b)