www.mooseframework.org
CoupledSusceptibilityTimeDerivative.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
13 
16 {
18  params.addClassDescription("A modified coupled time derivative Kernel that multiplies the time "
19  "derivative of a coupled variable by a generalized susceptibility");
20  params.addRequiredParam<MaterialPropertyName>(
21  "f_name", "Susceptibility function F defined in a FunctionMaterial");
22  return params;
23 }
24 
26  const InputParameters & parameters)
28  _F(getMaterialProperty<Real>("f_name")),
29  _dFdu(getMaterialPropertyDerivative<Real>("f_name", _var.name())),
30  _dFdarg(_n_args)
31 {
32  // fetch derivatives
33  for (unsigned int i = 0; i < _n_args; ++i)
34  _dFdarg[i] = &getMaterialPropertyDerivative<Real>("f_name", i);
35 }
36 
37 void
39 {
40  validateNonlinearCoupling<Real>("f_name");
41 }
42 
43 Real
45 {
47 }
48 
49 Real
51 {
52  return CoupledTimeDerivative::computeQpResidual() * _dFdu[_qp] * _phi[_j][_qp];
53 }
54 
55 Real
57 {
58  // get the coupled variable jvar is referring to
59  const unsigned int cvar = mapJvarToCvar(jvar);
60 
61  if (jvar == _v_var)
63  CoupledTimeDerivative::computeQpResidual() * _phi[_j][_qp] * (*_dFdarg[cvar])[_qp];
64 
65  return CoupledTimeDerivative::computeQpResidual() * _phi[_j][_qp] * (*_dFdarg[cvar])[_qp];
66 }
std::vector< const MaterialProperty< Real > * > _dFdarg
function derivatives w.r.t. coupled variables
This calculates a modified coupled time derivative that multiplies the time derivative of a coupled v...
void addRequiredParam(const std::string &name, const std::string &doc_string)
registerMooseObject("PhaseFieldApp", CoupledSusceptibilityTimeDerivative)
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
const std::string name
Definition: Setup.h:20
static InputParameters validParams()
virtual Real computeQpResidual() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MaterialProperty< Real > & _dFdu
function derivative w.r.t. the kernel variable
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
void addClassDescription(const std::string &doc_string)
CoupledSusceptibilityTimeDerivative(const InputParameters &parameters)
const MaterialProperty< Real > & _F
The function multiplied by the coupled time derivative.