www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
CHBulk< T > Class Template Referenceabstract

This is the Cahn-Hilliard equation base class that implements the bulk or local energy term of the equation. More...

#include <CHBulk.h>

Inheritance diagram for CHBulk< T >:
[legend]

Public Member Functions

 CHBulk (const InputParameters &parameters)
 
virtual void initialSetup ()
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Types

enum  PFFunctionType { Jacobian, Residual }
 

Protected Member Functions

virtual RealGradient precomputeQpResidual ()
 
virtual RealGradient precomputeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
virtual RealGradient computeGradDFDCons (PFFunctionType type)=0
 

Protected Attributes

const MaterialProperty< T > & _M
 Mobility. More...
 
const MaterialProperty< T > & _dMdc
 Mobility derivative w.r.t. concentration. More...
 
std::vector< const MaterialProperty< T > * > _dMdarg
 Mobility derivative w.r.t coupled variables. More...
 

Detailed Description

template<typename T>
class CHBulk< T >

This is the Cahn-Hilliard equation base class that implements the bulk or local energy term of the equation.

It is templated on the type of the mobility, which can be either a number (Real) or a tensor (RealValueTensor). See M.R. Tonks et al. / Computational Materials Science 51 (2012) 20-29 for more information. Note that the function computeGradDFDCons MUST be overridden in any kernel that inherits from CHBulk. Use CHMath as an example of how this works.

Definition at line 23 of file CHBulk.h.

Member Enumeration Documentation

template<typename T>
enum CHBulk::PFFunctionType
protected
Enumerator
Jacobian 
Residual 

Definition at line 36 of file CHBulk.h.

37  {
38  Jacobian,
39  Residual
40  };

Constructor & Destructor Documentation

template<typename T >
CHBulk< T >::CHBulk ( const InputParameters &  parameters)

Definition at line 55 of file CHBulk.h.

56  : DerivativeMaterialInterface<JvarMapKernelInterface<KernelGrad>>(parameters),
57  _M(getMaterialProperty<T>("mob_name")),
58  _dMdc(getMaterialPropertyDerivative<T>("mob_name", _var.name()))
59 {
60  // Get number of coupled variables
61  unsigned int nvar = _coupled_moose_vars.size();
62 
63  // reserve space for derivatives
64  _dMdarg.resize(nvar);
65 
66  // Iterate over all coupled variables
67  for (unsigned int i = 0; i < nvar; ++i)
68  _dMdarg[i] = &getMaterialPropertyDerivative<T>("mob_name", _coupled_moose_vars[i]->name());
69 }
const MaterialProperty< T > & _M
Mobility.
Definition: CHBulk.h:45
const MaterialProperty< T > & _dMdc
Mobility derivative w.r.t. concentration.
Definition: CHBulk.h:48
std::vector< const MaterialProperty< T > * > _dMdarg
Mobility derivative w.r.t coupled variables.
Definition: CHBulk.h:51

Member Function Documentation

template<typename T>
virtual RealGradient CHBulk< T >::computeGradDFDCons ( PFFunctionType  type)
protectedpure virtual
template<typename T >
Real CHBulk< T >::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Reimplemented in KKSCHBulk, CahnHilliardBase< T >, CahnHilliardBase< RealTensorValue >, and CahnHilliardBase< Real >.

Definition at line 108 of file CHBulk.h.

Referenced by CahnHilliardBase< T >::computeQpOffDiagJacobian().

109 {
110  // get the coupled variable jvar is referring to
111  const unsigned int cvar = mapJvarToCvar(jvar);
112 
113  return (*_dMdarg[cvar])[_qp] * _phi[_j][_qp] * computeGradDFDCons(Residual) * _grad_test[_i][_qp];
114 }
virtual RealGradient computeGradDFDCons(PFFunctionType type)=0
std::vector< const MaterialProperty< T > * > _dMdarg
Mobility derivative w.r.t coupled variables.
Definition: CHBulk.h:51
template<typename T >
void CHBulk< T >::initialSetup ( )
virtual

Reimplemented in CahnHilliardBase< T >, CahnHilliardBase< RealTensorValue >, and CahnHilliardBase< Real >.

Definition at line 84 of file CHBulk.h.

85 {
86  validateNonlinearCoupling<Real>("mob_name");
87 }
template<typename T >
RealGradient CHBulk< T >::precomputeQpJacobian ( )
protectedvirtual

Definition at line 98 of file CHBulk.h.

99 {
100  RealGradient grad_value = _M[_qp] * computeGradDFDCons(Jacobian) +
101  _dMdc[_qp] * _phi[_j][_qp] * computeGradDFDCons(Residual);
102 
103  return grad_value;
104 }
virtual RealGradient computeGradDFDCons(PFFunctionType type)=0
const MaterialProperty< T > & _M
Mobility.
Definition: CHBulk.h:45
const MaterialProperty< T > & _dMdc
Mobility derivative w.r.t. concentration.
Definition: CHBulk.h:48
template<typename T >
RealGradient CHBulk< T >::precomputeQpResidual ( )
protectedvirtual

Definition at line 91 of file CHBulk.h.

92 {
93  return _M[_qp] * computeGradDFDCons(Residual);
94 }
virtual RealGradient computeGradDFDCons(PFFunctionType type)=0
const MaterialProperty< T > & _M
Mobility.
Definition: CHBulk.h:45
template<typename T >
InputParameters CHBulk< T >::validParams ( )
static

Definition at line 73 of file CHBulk.h.

Referenced by CahnHilliardBase< T >::validParams(), validParams< CHBulkPFCTrad >(), validParams< CHMath >(), and validParams< KKSCHBulk >().

74 {
75  InputParameters params = ::validParams<KernelGrad>();
76  params.addClassDescription("Cahn-Hilliard base Kernel");
77  params.addParam<MaterialPropertyName>("mob_name", "M", "The mobility used with the kernel");
78  params.addCoupledVar("args", "Vector of arguments of the mobility");
79  return params;
80 }

Member Data Documentation

template<typename T>
std::vector<const MaterialProperty<T> *> CHBulk< T >::_dMdarg
protected

Mobility derivative w.r.t coupled variables.

Definition at line 51 of file CHBulk.h.

Referenced by CHBulk< T >::CHBulk(), and CHBulk< T >::computeQpOffDiagJacobian().

template<typename T>
const MaterialProperty<T>& CHBulk< T >::_dMdc
protected

Mobility derivative w.r.t. concentration.

Definition at line 48 of file CHBulk.h.

Referenced by CHBulk< T >::precomputeQpJacobian().

template<typename T>
const MaterialProperty<T>& CHBulk< T >::_M
protected

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