22 "Set this to make v a coupled variable, otherwise it will use the " 23 "kernel's nonlinear variable for v");
25 "The reaction rate used with the kernel");
32 _rate(this->template getGenericMaterialProperty<
Real, is_ad>(
"reaction_rate")),
33 _v(this->isCoupled(
"v") ? this->template coupledGenericValue<is_ad>(
"v") : this->_u)
36 paramError(
"v",
"In order to correctly couple the primal variable, leave 'v' blank");
43 return -_rate[_qp] * _v[_qp] * _test[_i][_qp];
50 params.
addCoupledVar(
"args",
"Vector of nonlinear variable arguments this object depends on");
56 _is_coupled(isCoupled(
"v")),
57 _v_name(_is_coupled ? coupledName(
"v") : _var.
name()),
58 _v_var(_is_coupled ? coupled(
"v") : _var.number()),
59 _drate_du(getMaterialPropertyDerivative<
Real>(
"reaction_rate", _var.
name())),
60 _drate_dv(getMaterialPropertyDerivative<
Real>(
"reaction_rate", _v_name)),
64 for (
unsigned int i = 0; i <
_n_args; ++i)
65 _drate_darg[i] = &getMaterialPropertyDerivative<Real>(
"reaction_rate", i);
71 validateNonlinearCoupling<Real>(
"reaction_rate");
std::string name(const ElemQuality q)
virtual bool isCoupled(const std::string &var_name, unsigned int i=0) const
Returns true if a variables has been coupled as name.
const MaterialProperty< Real > & _drate_dv
Reaction rate derivative w.r.t. the variable being added by this kernel.
Moose::GenericType< Real, is_ad > GenericReal
virtual unsigned int coupled(const std::string &var_name, unsigned int comp=0) const
Returns the index for a coupled variable by name.
virtual GenericReal< is_ad > computeQpResidual()
Compute this Kernel's contribution to the residual at the current quadrature point.
MooseVariable & _var
This is a regular kernel so we cast to a regular MooseVariable.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
MatReactionTempl(const InputParameters ¶meters)
unsigned int number() const
Get variable number coming from libMesh.
static InputParameters validParams()
static InputParameters validParams()
virtual void initialSetup()
Gets called at the beginning of the simulation before this object is asked to do its job...
Interface class ("Veneer") for Kernel to provide a mapping from 'jvar' in computeQpOffDiagJacobian in...
MatReaction(const InputParameters ¶meters)
const VariableTestValue & _test
the current test function
std::vector< const MaterialProperty< Real > * > _drate_darg
Reaction rate derivatives w.r.t. other coupled variables.
unsigned int _i
current index for the test function
unsigned int mapJvarToCvar(unsigned int jvar)
Return index into the _coupled_moose_vars array for a given jvar.
const MaterialProperty< Real > & _drate_du
Reaction rate derivative w.r.t. primal variable.
unsigned int _j
current index for the shape function
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
For coupling standard variables.
const bool _is_coupled
is the kernel used in a coupled form?
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Interface class ("Veneer") to provide generator methods for derivative material property names...
const GenericVariableValue< is_ad > & _v
Kernel variable (can be nonlinear or coupled variable) (For constrained Allen-Cahn problems...
This kernel adds to the residual a contribution of where is a material property and is a variable ...
const unsigned int _n_args
number of coupled moose variables
const VariablePhiValue & _phi
the current shape functions
registerMooseObject("MooseApp", MatReaction)
const GenericMaterialProperty< Real, is_ad > & _rate
Reaction rate.
static InputParameters validParams()
unsigned int _qp
The current quadrature point index.
virtual Real computeQpJacobian()
Compute this Kernel's contribution to the Jacobian at the current quadrature point.