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 35 of file KKSSplitCHCRes.h.

Constructor & Destructor Documentation

◆ KKSSplitCHCRes()

KKSSplitCHCRes::KKSSplitCHCRes ( const InputParameters &  parameters)

Definition at line 41 of file KKSSplitCHCRes.C.

42  : DerivativeMaterialInterface<JvarMapKernelInterface<SplitCHBase>>(parameters),
43  // number of coupled variables (ca, args_a[])
44  _nvar(_coupled_moose_vars.size()),
45  _ca_var(coupled("ca")),
46  _ca_name(getVar("ca", 0)->name()),
47  _cb_var(coupled("cb")),
48  _cb_name(getVar("cb", 0)->name()),
49  _prop_h(getMaterialProperty<Real>("h_name")),
50  _first_derivative_Fa(getMaterialPropertyDerivative<Real>("fa_name", _ca_name)),
51  _second_derivative_Fa(getMaterialPropertyDerivative<Real>("fa_name", _ca_name, _ca_name)),
52  _second_derivative_Fb(getMaterialPropertyDerivative<Real>("fb_name", _cb_name, _cb_name)),
53  _w_var(coupled("w")),
54  _w(coupledValue("w"))
55 {
56  // reserve space for derivatives
57  _d2Fadcadarg.resize(_nvar);
58 
59  // Iterate over all coupled variables
60  for (unsigned int i = 0; i < _nvar; ++i)
61  {
62  MooseVariableFEBase * cvar = this->_coupled_moose_vars[i];
63 
64  // get the second derivative material property
65  _d2Fadcadarg[i] = &getMaterialPropertyDerivative<Real>("fa_name", _ca_name, cvar->name());
66  }
67 }
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

◆ computeDFDC()

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 93 of file KKSSplitCHCRes.C.

94 {
95  switch (type)
96  {
97  case Residual:
98  return _first_derivative_Fa[_qp]; // dFa/dca ( = dFb/dcb = dF/dc)
99 
100  case Jacobian:
101  return 0.0;
102  }
103 
104  mooseError("Invalid type passed in");
105 }
const MaterialProperty< Real > & _first_derivative_Fa
Second derivative .

◆ computeQpOffDiagJacobian()

Real KKSSplitCHCRes::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 108 of file KKSSplitCHCRes.C.

109 {
110  // treat w variable explicitly
111  if (jvar == _w_var)
112  return -_phi[_j][_qp] * _test[_i][_qp];
113 
114  if (jvar == _ca_var)
115  return _phi[_j][_qp] * _test[_i][_qp] * _second_derivative_Fa[_qp];
116 
117  // get the coupled variable jvar is referring to
118  const unsigned int cvar = mapJvarToCvar(jvar);
119 
120  return _phi[_j][_qp] * _test[_i][_qp] * (*_d2Fadcadarg[cvar])[_qp];
121 }
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.

◆ computeQpResidual()

Real KKSSplitCHCRes::computeQpResidual ( )
protectedvirtual

Definition at line 77 of file KKSSplitCHCRes.C.

78 {
79  Real residual = SplitCHBase::computeQpResidual();
80  residual += -_w[_qp] * _test[_i][_qp];
81 
82  return residual;
83 }
virtual Real computeQpResidual()
Definition: SplitCHBase.C:40
const VariableValue & _w

◆ initialSetup()

void KKSSplitCHCRes::initialSetup ( )
protectedvirtual

Definition at line 70 of file KKSSplitCHCRes.C.

71 {
72  validateNonlinearCoupling<Real>("fa_name");
73  validateDerivativeMaterialPropertyBase<Real>("fa_name");
74 }

Member Data Documentation

◆ _ca_name

VariableName KKSSplitCHCRes::_ca_name
private

Definition at line 53 of file KKSSplitCHCRes.h.

Referenced by KKSSplitCHCRes().

◆ _ca_var

unsigned int KKSSplitCHCRes::_ca_var
private

Phase concnetration variables

Definition at line 52 of file KKSSplitCHCRes.h.

Referenced by computeQpOffDiagJacobian().

◆ _cb_name

VariableName KKSSplitCHCRes::_cb_name
private

Definition at line 55 of file KKSSplitCHCRes.h.

◆ _cb_var

unsigned int KKSSplitCHCRes::_cb_var
private

Definition at line 54 of file KKSSplitCHCRes.h.

◆ _d2Fadcadarg

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

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

Definition at line 59 of file KKSSplitCHCRes.h.

Referenced by computeQpOffDiagJacobian(), and KKSSplitCHCRes().

◆ _first_derivative_Fa

const MaterialProperty<Real>& KKSSplitCHCRes::_first_derivative_Fa
private

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

Definition at line 65 of file KKSSplitCHCRes.h.

Referenced by computeDFDC().

◆ _nvar

unsigned int KKSSplitCHCRes::_nvar
private

Number of coupled variables.

Definition at line 48 of file KKSSplitCHCRes.h.

Referenced by KKSSplitCHCRes().

◆ _prop_h

const MaterialProperty<Real>& KKSSplitCHCRes::_prop_h
private

h(eta) material property

Definition at line 62 of file KKSSplitCHCRes.h.

◆ _second_derivative_Fa

const MaterialProperty<Real>& KKSSplitCHCRes::_second_derivative_Fa
private

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

Definition at line 68 of file KKSSplitCHCRes.h.

Referenced by computeQpOffDiagJacobian().

◆ _second_derivative_Fb

const MaterialProperty<Real>& KKSSplitCHCRes::_second_derivative_Fb
private

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

Definition at line 71 of file KKSSplitCHCRes.h.

◆ _w

const VariableValue& KKSSplitCHCRes::_w
private

Definition at line 75 of file KKSSplitCHCRes.h.

Referenced by computeQpResidual().

◆ _w_var

unsigned int KKSSplitCHCRes::_w_var
private

Chemical potential.

Definition at line 74 of file KKSSplitCHCRes.h.

Referenced by computeQpOffDiagJacobian().


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