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

SplitCHBulk child class that takes all the necessary data from a KKSBaseMaterial. More...

#include <KKSSplitCHCRes.h>

Inheritance diagram for KKSSplitCHCRes:
[legend]

Public Member Functions

 KKSSplitCHCRes (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeDFDC (PFFunctionType type)
 Note that per product and chain rules: \( \frac{d}{du_j}\left(F(u)\nabla u\right) = \nabla u \frac {dF(u)}{du}\frac{du}{du_j} + F(u)\frac{d\nabla u}{du_j} \) which is: \( \nabla u \frac {dF(u)}{du} \phi_j + F(u) \nabla \phi_j \). More...
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
virtual Real computeQpResidual ()
 
virtual void initialSetup ()
 

Private Attributes

unsigned int _nvar
 Number of coupled variables. More...
 
std::vector< const MaterialProperty< Real > * > _d2Fadcadarg
 Derivatives of \( dFa/dca \) with respect to all coupled variables. More...
 
const MaterialProperty< Real > & _prop_h
 h(eta) material property More...
 
const MaterialProperty< Real > & _first_derivative_Fa
 Second derivative \( d^2Fa/dca^2 \). More...
 
const MaterialProperty< Real > & _second_derivative_Fa
 Second derivative \( d^2Fa/dca^2 \). More...
 
const MaterialProperty< Real > & _second_derivative_Fb
 Second derivative \( d^2Fb/dcb^2 \). More...
 
unsigned int _w_var
 Chemical potential. More...
 
const VariableValue & _w
 
unsigned int _ca_var
 
VariableName _ca_name
 
unsigned int _cb_var
 
VariableName _cb_name
 

Detailed Description

SplitCHBulk child class that takes all the necessary data from a KKSBaseMaterial.

We calculate \( \frac{\partial F_a}{\partial c_a} \). This takes advantage of the KKS identity

\( dF/dc = dF_a/dc_a (= dF_b/dc_b) \)

The non-linear variable for this Kernel is the concentration 'c'. The user picks one phase free energy \( F_a \) (f_base) and its corresponding phase concentration \( c_a \)

Definition at line 32 of file KKSSplitCHCRes.h.

Constructor & Destructor Documentation

KKSSplitCHCRes::KKSSplitCHCRes ( const InputParameters &  parameters)

Definition at line 36 of file KKSSplitCHCRes.C.

37  : DerivativeMaterialInterface<JvarMapKernelInterface<SplitCHBase>>(parameters),
38  // number of coupled variables (ca, args_a[])
39  _nvar(_coupled_moose_vars.size()),
40  _ca_var(coupled("ca")),
41  _ca_name(getVar("ca", 0)->name()),
42  _cb_var(coupled("cb")),
43  _cb_name(getVar("cb", 0)->name()),
44  _prop_h(getMaterialProperty<Real>("h_name")),
45  _first_derivative_Fa(getMaterialPropertyDerivative<Real>("fa_name", _ca_name)),
46  _second_derivative_Fa(getMaterialPropertyDerivative<Real>("fa_name", _ca_name, _ca_name)),
47  _second_derivative_Fb(getMaterialPropertyDerivative<Real>("fb_name", _cb_name, _cb_name)),
48  _w_var(coupled("w")),
49  _w(coupledValue("w"))
50 {
51  // reserve space for derivatives
52  _d2Fadcadarg.resize(_nvar);
53 
54  // Iterate over all coupled variables
55  for (unsigned int i = 0; i < _nvar; ++i)
56  {
57  MooseVariable * cvar = this->_coupled_moose_vars[i];
58 
59  // get the second derivative material property
60  _d2Fadcadarg[i] = &getMaterialPropertyDerivative<Real>("fa_name", _ca_name, cvar->name());
61  }
62 }
unsigned int _ca_var
const MaterialProperty< Real > & _second_derivative_Fa
Second derivative .
VariableName _cb_name
const VariableValue & _w
const MaterialProperty< Real > & _first_derivative_Fa
Second derivative .
unsigned int _cb_var
const MaterialProperty< Real > & _second_derivative_Fb
Second derivative .
const MaterialProperty< Real > & _prop_h
h(eta) material property
unsigned int _nvar
Number of coupled variables.
std::vector< const MaterialProperty< Real > * > _d2Fadcadarg
Derivatives of with respect to all coupled variables.
VariableName _ca_name
unsigned int _w_var
Chemical potential.

Member Function Documentation

Real KKSSplitCHCRes::computeDFDC ( PFFunctionType  type)
protectedvirtual

Note that per product and chain rules: \( \frac{d}{du_j}\left(F(u)\nabla u\right) = \nabla u \frac {dF(u)}{du}\frac{du}{du_j} + F(u)\frac{d\nabla u}{du_j} \) which is: \( \nabla u \frac {dF(u)}{du} \phi_j + F(u) \nabla \phi_j \).

Definition at line 88 of file KKSSplitCHCRes.C.

89 {
90  switch (type)
91  {
92  case Residual:
93  return _first_derivative_Fa[_qp]; // dFa/dca ( = dFb/dcb = dF/dc)
94 
95  case Jacobian:
96  return 0.0;
97  }
98 
99  mooseError("Invalid type passed in");
100 }
const MaterialProperty< Real > & _first_derivative_Fa
Second derivative .
Real KKSSplitCHCRes::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 103 of file KKSSplitCHCRes.C.

104 {
105  // treat w variable explicitly
106  if (jvar == _w_var)
107  return -_phi[_j][_qp] * _test[_i][_qp];
108 
109  if (jvar == _ca_var)
110  return _phi[_j][_qp] * _test[_i][_qp] * _second_derivative_Fa[_qp];
111 
112  // get the coupled variable jvar is referring to
113  const unsigned int cvar = mapJvarToCvar(jvar);
114 
115  return _phi[_j][_qp] * _test[_i][_qp] * (*_d2Fadcadarg[cvar])[_qp];
116 }
unsigned int _ca_var
const MaterialProperty< Real > & _second_derivative_Fa
Second derivative .
std::vector< const MaterialProperty< Real > * > _d2Fadcadarg
Derivatives of with respect to all coupled variables.
unsigned int _w_var
Chemical potential.
Real KKSSplitCHCRes::computeQpResidual ( )
protectedvirtual

Definition at line 72 of file KKSSplitCHCRes.C.

73 {
74  Real residual = SplitCHBase::computeQpResidual();
75  residual += -_w[_qp] * _test[_i][_qp];
76 
77  return residual;
78 }
virtual Real computeQpResidual()
Definition: SplitCHBase.C:37
const VariableValue & _w
void KKSSplitCHCRes::initialSetup ( )
protectedvirtual

Definition at line 65 of file KKSSplitCHCRes.C.

66 {
67  validateNonlinearCoupling<Real>("fa_name");
68  validateDerivativeMaterialPropertyBase<Real>("fa_name");
69 }

Member Data Documentation

VariableName KKSSplitCHCRes::_ca_name
private

Definition at line 50 of file KKSSplitCHCRes.h.

Referenced by KKSSplitCHCRes().

unsigned int KKSSplitCHCRes::_ca_var
private

Phase concnetration variables

Definition at line 49 of file KKSSplitCHCRes.h.

Referenced by computeQpOffDiagJacobian().

VariableName KKSSplitCHCRes::_cb_name
private

Definition at line 52 of file KKSSplitCHCRes.h.

unsigned int KKSSplitCHCRes::_cb_var
private

Definition at line 51 of file KKSSplitCHCRes.h.

std::vector<const MaterialProperty<Real> *> KKSSplitCHCRes::_d2Fadcadarg
private

Derivatives of \( dFa/dca \) with respect to all coupled variables.

Definition at line 56 of file KKSSplitCHCRes.h.

Referenced by computeQpOffDiagJacobian(), and KKSSplitCHCRes().

const MaterialProperty<Real>& KKSSplitCHCRes::_first_derivative_Fa
private

Second derivative \( d^2Fa/dca^2 \).

Definition at line 62 of file KKSSplitCHCRes.h.

Referenced by computeDFDC().

unsigned int KKSSplitCHCRes::_nvar
private

Number of coupled variables.

Definition at line 45 of file KKSSplitCHCRes.h.

Referenced by KKSSplitCHCRes().

const MaterialProperty<Real>& KKSSplitCHCRes::_prop_h
private

h(eta) material property

Definition at line 59 of file KKSSplitCHCRes.h.

const MaterialProperty<Real>& KKSSplitCHCRes::_second_derivative_Fa
private

Second derivative \( d^2Fa/dca^2 \).

Definition at line 65 of file KKSSplitCHCRes.h.

Referenced by computeQpOffDiagJacobian().

const MaterialProperty<Real>& KKSSplitCHCRes::_second_derivative_Fb
private

Second derivative \( d^2Fb/dcb^2 \).

Definition at line 68 of file KKSSplitCHCRes.h.

const VariableValue& KKSSplitCHCRes::_w
private

Definition at line 72 of file KKSSplitCHCRes.h.

Referenced by computeQpResidual().

unsigned int KKSSplitCHCRes::_w_var
private

Chemical potential.

Definition at line 71 of file KKSSplitCHCRes.h.

Referenced by computeQpOffDiagJacobian().


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