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

Flux boundary condition base class for variable dependent mobilities. More...

#include <CahnHilliardFluxBCBase.h>

Inheritance diagram for CahnHilliardFluxBCBase< T >:
[legend]

Public Member Functions

 CahnHilliardFluxBCBase (const InputParameters &parameters)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

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

Protected Attributes

const RealGradient _flux
 
const MaterialProperty< T > & _M
 
const MaterialProperty< T > & _dMdw
 
std::vector< const MaterialProperty< T > * > _dMdarg
 

Detailed Description

template<typename T>
class CahnHilliardFluxBCBase< T >

Flux boundary condition base class for variable dependent mobilities.

This class must be templated on the mobility type, which can be either a scalar (Real) or a tensor (RealValueTensor).

Definition at line 20 of file CahnHilliardFluxBCBase.h.

Constructor & Destructor Documentation

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

Definition at line 43 of file CahnHilliardFluxBCBase.h.

44  : DerivativeMaterialInterface<JvarMapIntegratedBCInterface<IntegratedBC>>(parameters),
45  _flux(getParam<RealGradient>("flux")),
46  _M(getMaterialProperty<T>("mob_name")),
47  _dMdw(getMaterialPropertyDerivative<T>("mob_name", _var.name()))
48 {
49  // Get number of coupled variables
50  unsigned int nvar = _coupled_moose_vars.size();
51 
52  // reserve space for derivatives
53  _dMdarg.resize(nvar);
54 
55  // Iterate over all coupled variables
56  for (unsigned int i = 0; i < nvar; ++i)
57  _dMdarg[i] = &getMaterialPropertyDerivative<T>("mob_name", _coupled_moose_vars[i]->name());
58 }
const MaterialProperty< T > & _dMdw
std::vector< const MaterialProperty< T > * > _dMdarg
const MaterialProperty< T > & _M

Member Function Documentation

template<typename T >
Real CahnHilliardFluxBCBase< T >::computeQpJacobian ( )
protectedvirtual

Definition at line 88 of file CahnHilliardFluxBCBase.h.

89 {
90  return -(_M[_qp] * _grad_phi[_j][_qp] + _phi[_j][_qp] * _dMdw[_qp] * _grad_u[_qp]) *
91  _normals[_qp] * _test[_i][_qp];
92 }
const MaterialProperty< T > & _dMdw
const MaterialProperty< T > & _M
template<typename T >
Real CahnHilliardFluxBCBase< T >::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 96 of file CahnHilliardFluxBCBase.h.

97 {
98  // get the coupled variable jvar is referring to
99  const unsigned int cvar = mapJvarToCvar(jvar);
100 
101  return -_phi[_j][_qp] * (*_dMdarg[cvar])[_qp] * _grad_u[_qp] * _normals[_qp] * _test[_i][_qp];
102 }
std::vector< const MaterialProperty< T > * > _dMdarg
template<typename T >
Real CahnHilliardFluxBCBase< T >::computeQpResidual ( )
protectedvirtual

Definition at line 81 of file CahnHilliardFluxBCBase.h.

82 {
83  return (_flux - _M[_qp] * _grad_u[_qp]) * _normals[_qp] * _test[_i][_qp];
84 }
const MaterialProperty< T > & _M
template<typename T >
void CahnHilliardFluxBCBase< T >::initialSetup ( )
protectedvirtual

Definition at line 74 of file CahnHilliardFluxBCBase.h.

75 {
76  validateNonlinearCoupling<Real>("mob_name");
77 }
template<typename T >
InputParameters CahnHilliardFluxBCBase< T >::validParams ( )
static

Definition at line 62 of file CahnHilliardFluxBCBase.h.

Referenced by validParams< CahnHilliardAnisoFluxBC >(), and validParams< CahnHilliardFluxBC >().

63 {
64  InputParameters params = ::validParams<IntegratedBC>();
65  params.addClassDescription("Cahn-Hilliard base Kernel");
66  params.addParam<RealGradient>("flux", "The flux set at the boundary");
67  params.addParam<MaterialPropertyName>("mob_name", "M", "The mobility used with the kernel");
68  params.addCoupledVar("args", "Vector of arguments of the mobility");
69  return params;
70 }

Member Data Documentation

template<typename T>
std::vector<const MaterialProperty<T> *> CahnHilliardFluxBCBase< T >::_dMdarg
protected
template<typename T>
const MaterialProperty<T>& CahnHilliardFluxBCBase< T >::_dMdw
protected
template<typename T>
const RealGradient CahnHilliardFluxBCBase< T >::_flux
protected
template<typename T>
const MaterialProperty<T>& CahnHilliardFluxBCBase< T >::_M
protected

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