www.mooseframework.org
SusceptibilityTimeDerivative.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<TimeDerivative>();
14  params.addClassDescription(
15  "A modified time derivative Kernel that multiplies the time derivative "
16  "of a variable by a generalized susceptibility");
17  params.addRequiredParam<MaterialPropertyName>(
18  "f_name", "Susceptibility function F defined in a FunctionMaterial");
19  params.addCoupledVar("args", "Vector of arguments of the susceptibility");
20  return params;
21 }
22 
24  : DerivativeMaterialInterface<JvarMapKernelInterface<TimeDerivative>>(parameters),
25  _Chi(getMaterialProperty<Real>("f_name")),
26  _dChidu(getMaterialPropertyDerivative<Real>("f_name", _var.name())),
27  _dChidarg(_coupled_moose_vars.size())
28 {
29  // fetch derivatives
30  for (unsigned int i = 0; i < _dChidarg.size(); ++i)
31  _dChidarg[i] = &getMaterialPropertyDerivative<Real>("f_name", _coupled_moose_vars[i]->name());
32 }
33 
34 void
36 {
37  validateNonlinearCoupling<Real>("f_name");
38 }
39 
40 Real
42 {
43  return TimeDerivative::computeQpResidual() * _Chi[_qp];
44 }
45 
46 Real
48 {
49  return TimeDerivative::computeQpJacobian() * _Chi[_qp] +
50  TimeDerivative::computeQpResidual() * _dChidu[_qp] * _phi[_j][_qp];
51 }
52 
53 Real
55 {
56  // get the coupled variable jvar is referring to
57  const unsigned int cvar = mapJvarToCvar(jvar);
58 
59  return TimeDerivative::computeQpResidual() * (*_dChidarg[cvar])[_qp] * _phi[_j][_qp];
60 }
std::vector< const MaterialProperty< Real > * > _dChidarg
susceptibility derivatives w.r.t. coupled variables
const MaterialProperty< Real > & _Chi
susceptibility
InputParameters validParams< SusceptibilityTimeDerivative >()
SusceptibilityTimeDerivative(const InputParameters &parameters)
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
const MaterialProperty< Real > & _dChidu
susceptibility derivative w.r.t. the kernel variable