www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
ACKappaFunction Class Reference

#include <ACKappaFunction.h>

Inheritance diagram for ACKappaFunction:
[legend]

Public Member Functions

 ACKappaFunction (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 

Protected Attributes

const NonlinearVariableName _var_name
 
const MaterialPropertyName _L_name
 
const MaterialProperty< Real > & _L
 
const MaterialProperty< Real > & _dLdvar
 
const MaterialPropertyName _kappa_name
 
const MaterialProperty< Real > & _dkappadvar
 
const MaterialProperty< Real > & _d2kappadvar2
 
const unsigned int _op_num
 
std::vector< NonlinearVariableName > _v_name
 
std::vector< const VariableGradient * > _grad_v
 
std::vector< const MaterialProperty< Real > * > _dLdv
 
std::vector< const MaterialProperty< Real > * > _d2kappadvardv
 

Private Member Functions

Real computeFg ()
 

Detailed Description

Definition at line 27 of file ACKappaFunction.h.

Constructor & Destructor Documentation

◆ ACKappaFunction()

ACKappaFunction::ACKappaFunction ( const InputParameters &  parameters)

Definition at line 27 of file ACKappaFunction.C.

28  : DerivativeMaterialInterface<JvarMapKernelInterface<Kernel>>(parameters),
29  _var_name(getParam<NonlinearVariableName>("variable")),
30  _L_name(getParam<MaterialPropertyName>("mob_name")),
31  _L(getMaterialProperty<Real>(_L_name)),
32  _dLdvar(getMaterialPropertyDerivative<Real>(_L_name, _var_name)),
33  _kappa_name(getParam<MaterialPropertyName>("kappa_name")),
34  _dkappadvar(getMaterialPropertyDerivative<Real>(_kappa_name, _var_name)),
35  _d2kappadvar2(getMaterialPropertyDerivative<Real>(_kappa_name, _var_name, _var_name)),
36  _op_num(coupledComponents("v")),
39  _dLdv(_op_num),
41 {
42  for (unsigned int i = 0; i < _op_num; ++i)
43  {
44  _v_name[i] = getVar("v", i)->name();
45  _grad_v[i] = &coupledGradient("v", i);
46  _dLdv[i] = &getMaterialPropertyDerivative<Real>(_L_name, _v_name[i]);
47  _d2kappadvardv[i] = &getMaterialPropertyDerivative<Real>(_kappa_name, _var_name, _v_name[i]);
48  }
49 }
std::vector< const VariableGradient * > _grad_v
std::vector< NonlinearVariableName > _v_name
const MaterialPropertyName _kappa_name
const MaterialProperty< Real > & _dLdvar
const NonlinearVariableName _var_name
const MaterialPropertyName _L_name
std::vector< const MaterialProperty< Real > * > _dLdv
const MaterialProperty< Real > & _dkappadvar
const MaterialProperty< Real > & _L
const unsigned int _op_num
std::vector< const MaterialProperty< Real > * > _d2kappadvardv
const MaterialProperty< Real > & _d2kappadvar2

Member Function Documentation

◆ computeFg()

Real ACKappaFunction::computeFg ( )
private

Definition at line 78 of file ACKappaFunction.C.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

79 {
80  Real sum_grad_etai2 = 0.0;
81  for (unsigned int i = 0; i < _op_num; ++i)
82  sum_grad_etai2 += (*_grad_v[i])[_qp] * (*_grad_v[i])[_qp];
83 
84  Real grad_var2 = _grad_u[_qp] * _grad_u[_qp];
85  return sum_grad_etai2 + grad_var2;
86 }
std::vector< const VariableGradient * > _grad_v
const unsigned int _op_num

◆ computeQpJacobian()

Real ACKappaFunction::computeQpJacobian ( )
protectedvirtual

Definition at line 58 of file ACKappaFunction.C.

59 {
60  Real pre_jac = 0.5 * _test[_i][_qp] * _phi[_j][_qp] * computeFg();
61  Real term1 = _test[_i][_qp] * _L[_qp] * _dkappadvar[_qp] * _grad_u[_qp] * _grad_phi[_j][_qp];
62 
63  return pre_jac * (_dLdvar[_qp] * _dkappadvar[_qp] + _L[_qp] * _d2kappadvar2[_qp]) + term1;
64 }
const MaterialProperty< Real > & _dLdvar
const MaterialProperty< Real > & _dkappadvar
const MaterialProperty< Real > & _L
const MaterialProperty< Real > & _d2kappadvar2

◆ computeQpOffDiagJacobian()

Real ACKappaFunction::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 67 of file ACKappaFunction.C.

68 {
69  const unsigned int i = mapJvarToCvar(jvar);
70  Real pre_jac = 0.5 * _test[_i][_qp] * _phi[_j][_qp] * computeFg();
71  Real term1 =
72  _test[_i][_qp] * _L[_qp] * _dkappadvar[_qp] * (*_grad_v[i])[_qp] * _grad_phi[_j][_qp];
73  return pre_jac * ((*_dLdv[i])[_qp] * _dkappadvar[_qp] + _L[_qp] * (*_d2kappadvardv[i])[_qp]) +
74  term1;
75 }
std::vector< const VariableGradient * > _grad_v
std::vector< const MaterialProperty< Real > * > _dLdv
const MaterialProperty< Real > & _dkappadvar
const MaterialProperty< Real > & _L
std::vector< const MaterialProperty< Real > * > _d2kappadvardv

◆ computeQpResidual()

Real ACKappaFunction::computeQpResidual ( )
protectedvirtual

Definition at line 52 of file ACKappaFunction.C.

53 {
54  return 0.5 * _test[_i][_qp] * _L[_qp] * _dkappadvar[_qp] * computeFg();
55 }
const MaterialProperty< Real > & _dkappadvar
const MaterialProperty< Real > & _L

Member Data Documentation

◆ _d2kappadvar2

const MaterialProperty<Real>& ACKappaFunction::_d2kappadvar2
protected

Definition at line 43 of file ACKappaFunction.h.

Referenced by computeQpJacobian().

◆ _d2kappadvardv

std::vector<const MaterialProperty<Real> *> ACKappaFunction::_d2kappadvardv
protected

Definition at line 48 of file ACKappaFunction.h.

Referenced by ACKappaFunction(), and computeQpOffDiagJacobian().

◆ _dkappadvar

const MaterialProperty<Real>& ACKappaFunction::_dkappadvar
protected

◆ _dLdv

std::vector<const MaterialProperty<Real> *> ACKappaFunction::_dLdv
protected

Definition at line 47 of file ACKappaFunction.h.

Referenced by ACKappaFunction(), and computeQpOffDiagJacobian().

◆ _dLdvar

const MaterialProperty<Real>& ACKappaFunction::_dLdvar
protected

Definition at line 40 of file ACKappaFunction.h.

Referenced by computeQpJacobian().

◆ _grad_v

std::vector<const VariableGradient *> ACKappaFunction::_grad_v
protected

Definition at line 46 of file ACKappaFunction.h.

Referenced by ACKappaFunction(), computeFg(), and computeQpOffDiagJacobian().

◆ _kappa_name

const MaterialPropertyName ACKappaFunction::_kappa_name
protected

Definition at line 41 of file ACKappaFunction.h.

Referenced by ACKappaFunction().

◆ _L

const MaterialProperty<Real>& ACKappaFunction::_L
protected

◆ _L_name

const MaterialPropertyName ACKappaFunction::_L_name
protected

Definition at line 38 of file ACKappaFunction.h.

Referenced by ACKappaFunction().

◆ _op_num

const unsigned int ACKappaFunction::_op_num
protected

Definition at line 44 of file ACKappaFunction.h.

Referenced by ACKappaFunction(), and computeFg().

◆ _v_name

std::vector<NonlinearVariableName> ACKappaFunction::_v_name
protected

Definition at line 45 of file ACKappaFunction.h.

Referenced by ACKappaFunction().

◆ _var_name

const NonlinearVariableName ACKappaFunction::_var_name
protected

Definition at line 37 of file ACKappaFunction.h.

Referenced by ACKappaFunction().


The documentation for this class was generated from the following files: