19#include "libmesh/string_to_enum.h"
30 "Set up the variable and the kernels needed for a non-conserved phase field variable");
36 "Specifies the family of FE "
37 "shape functions to use for this variable");
40 "Specifies the order of the FE "
41 "shape function to use for this variable");
42 params.
addParam<Real>(
"scaling", 1.0,
"Specifies a scaling factor to apply to this variable");
43 params.
addParam<
bool>(
"implicit",
true,
"Whether kernels are implicit or not");
45 "use_displaced_mesh",
false,
"Whether to use displaced mesh in the kernels");
47 params.
addParam<MaterialPropertyName>(
"mobility",
"L",
"The mobility used with the kernel");
49 "Vector of nonlinear variable arguments this kernel depends on");
51 "free_energy",
"Base name of the free energy function F defined in a free energy material");
52 params.
addParam<MaterialPropertyName>(
"kappa",
"kappa_op",
"The kappa used with the kernel");
53 params.
addParam<
bool>(
"variable_mobility",
55 "The mobility is a function of any MOOSE variable (if "
56 "this is set to false, L must be constant over the "
58 params.
addParam<std::vector<SubdomainName>>(
59 "block", {},
"Block restriction for the variables and kernels");
66 _fe_type(Utility::string_to_enum<Order>(getParam<
MooseEnum>(
"order")),
83 var_params.set<std::vector<Real>>(
"scaling") = {getParam<Real>(
"scaling")};
95 std::string kernel_type =
"TimeDerivative";
97 std::string kernel_name =
_var_name +
"_" + kernel_type;
99 params1.
set<NonlinearVariableName>(
"variable") =
_var_name;
102 _problem->addKernel(kernel_type, kernel_name, params1);
105 kernel_type =
"AllenCahn";
107 kernel_name =
_var_name +
"_" + kernel_type;
109 params2.
set<NonlinearVariableName>(
"variable") =
_var_name;
110 params2.
set<MaterialPropertyName>(
"mob_name") = getParam<MaterialPropertyName>(
"mobility");
111 params2.
set<MaterialPropertyName>(
"f_name") = getParam<MaterialPropertyName>(
"free_energy");
114 _problem->addKernel(kernel_type, kernel_name, params2);
117 kernel_type =
"ACInterface";
119 kernel_name =
_var_name +
"_" + kernel_type;
121 params3.
set<NonlinearVariableName>(
"variable") =
_var_name;
122 params3.
set<MaterialPropertyName>(
"mob_name") = getParam<MaterialPropertyName>(
"mobility");
123 params3.
set<MaterialPropertyName>(
"kappa_name") = getParam<MaterialPropertyName>(
"kappa");
124 params3.
set<
bool>(
"variable_L") = getParam<bool>(
"variable_mobility");
127 _problem->addKernel(kernel_type, kernel_name, params3);
registerMooseAction("PhaseFieldApp", NonconservedAction, "add_variable")
static InputParameters validParams()
std::shared_ptr< FEProblemBase > & _problem
const std::string & _current_task
static MooseEnum getNonlinearVariableFamilies()
static MooseEnum getNonlinearVariableOrders()
static std::string variableType(const libMesh::FEType &fe_type, const bool is_fv=false, const bool is_array=false)
InputParameters getValidParams(const std::string &name) const
const InputParameters & parameters() const
const std::string & type() const
const InputParameters & _pars
const NonlinearVariableName _var_name
Name of the variable being created.
const libMesh::FEType _fe_type
FEType for the variable being created.
NonconservedAction(const InputParameters ¶ms)
static InputParameters validParams()
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...