13 #include "libmesh/quadrature.h" 23 "List of variables to force to a target concentration value");
24 params.
addRequiredParam<UserObjectName>(
"map",
"DiscreteNucleationMap user object");
25 params.
addRequiredParam<std::vector<Real>>(
"op_values",
"List of target concentration values");
26 params.
addParam<
Real>(
"penalty", 20.0,
"Penalty factor for enforcing the target concentrations");
27 MooseEnum penalty_mode(
"MATCH MIN MAX",
"MATCH");
31 "Match the target concentration or take it as a minimum or maximum concentration target");
37 _nvar(coupledComponents(
"op_names")),
39 _op_values(getParam<
std::vector<
Real>>(
"op_values")),
40 _penalty(getParam<
Real>(
"penalty")),
41 _penalty_mode(getParam<
MooseEnum>(
"penalty_mode")),
46 mooseError(
"The op_names and op_values parameter vectors must have the same number of entries");
51 for (
unsigned int i = 0; i <
_nvar; ++i)
66 (*_prop_F)[
_qp] = 0.0;
68 for (
unsigned int i = 0; i <
_nvar; ++i)
84 (*_prop_F)[
_qp] += dc * dc * penalty;
91 for (
unsigned int jj = ii; jj <
_nvar; ++jj)
98 for (
unsigned int kk = jj; kk <
_nvar; ++kk)
virtual unsigned int coupled(const std::string &var_name, unsigned int comp=0) const
const QBase *const & _qrule
This UserObject maintains a per QP map that indicates if a nucleus is present or not.
virtual void computeProperties()
std::vector< std::vector< GenericMaterialProperty< Real, is_ad > *> > _prop_d2F
static InputParameters validParams()
const unsigned int _penalty_mode
Match concentration exactly or use the target as a minumum or maximum value.
const Real _penalty
Nucleation free energy prefactor.
DiscreteNucleation(const InputParameters ¶ms)
unsigned int argIndex(unsigned int i_var) const
registerMooseObject("PhaseFieldApp", DiscreteNucleation)
Free energy penalty contribution to force the nucleation of subresolution particles.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
GenericMaterialProperty< Real, is_ad > * _prop_F
void mooseError(Args &&... args) const
const DiscreteNucleationMap & _map
UserObject providing a map of currently active nuclei.
std::vector< std::vector< std::vector< GenericMaterialProperty< Real, is_ad > *> > > _prop_d3F
const std::vector< Real > & nuclei(const Elem *) const
std::vector< unsigned int > _op_index
map op_names indices to _args indices
std::vector< const GenericVariableValue< is_ad > *> _args
std::vector< GenericMaterialProperty< Real, is_ad > *> _prop_dF
const Elem *const & _current_elem
static InputParameters validParams()
const std::vector< Real > _op_values
Target concentration values.