https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SusceptibilityTimeDerivative.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
14
15template <bool is_ad>
18{
21 "A modified time derivative Kernel that multiplies the time derivative "
22 "of a variable by a generalized susceptibility");
23 params.addRequiredParam<MaterialPropertyName>(
24 "f_name", "Susceptibility function F defined in a FunctionMaterial");
25 params.addCoupledVar("coupled_variables", "Vector of variable arguments of the susceptibility");
26 return params;
27}
28
29template <bool is_ad>
31 const InputParameters & parameters)
33 parameters),
34 _Chi(this->template getGenericMaterialProperty<Real, is_ad>("f_name"))
35{
36}
37
39 : SusceptibilityTimeDerivativeTempl<false>(parameters),
40 _dChidu(getMaterialPropertyDerivative<Real>("f_name", _var.name())),
41 _dChidarg(_n_args)
42{
43 // fetch derivatives
44 for (unsigned int i = 0; i < _n_args; ++i)
45 _dChidarg[i] = &getMaterialPropertyDerivative<Real>("f_name", i);
46}
47
48void
50{
51 validateNonlinearCoupling<Real>("f_name");
52}
53
54Real
59
62{
63 return _u_dot[_qp] * _Chi[_qp];
64}
65
66Real
72
73Real
75{
76 // get the coupled variable jvar is referring to
77 const unsigned int cvar = mapJvarToCvar(jvar);
78
79 return TimeDerivative::computeQpResidual() * (*_dChidarg[cvar])[_qp] * _phi[_j][_qp];
80}
DualNumber< Real, DNDerivativeType, true > ADReal
const std::string name
Definition Setup.h:21
registerMooseObject("PhaseFieldApp", SusceptibilityTimeDerivative)
typename std::conditional< is_ad, ADTimeDerivative, TimeDerivative >::type SusceptibilityTimeDerivativeBase
This calculates the time derivative for a variable multiplied by a generalized susceptibility.
virtual ADReal precomputeQpResidual() override
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
const GenericMaterialProperty< Real, is_ad > & _Chi
susceptibility
SusceptibilityTimeDerivativeTempl(const InputParameters &parameters)
std::vector< const MaterialProperty< Real > * > _dChidarg
susceptibility derivatives w.r.t. coupled variables
SusceptibilityTimeDerivative(const InputParameters &parameters)
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
const MaterialProperty< Real > & _dChidu
susceptibility derivative w.r.t. the kernel variable
virtual Real computeQpResidual() override
virtual Real computeQpJacobian() override