www.mooseframework.org
SplitCHCRes.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #include "SplitCHCRes.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<SplitCHBase>();
14  params.addClassDescription("Split formulation Cahn-Hilliard Kernel");
15  params.addRequiredCoupledVar("w", "chem poten");
16  params.addRequiredParam<MaterialPropertyName>("kappa_name", "The kappa used with the kernel");
17  return params;
18 }
19 
20 SplitCHCRes::SplitCHCRes(const InputParameters & parameters)
21  : SplitCHBase(parameters),
22  _kappa(getMaterialProperty<Real>("kappa_name")),
23  _w_var(coupled("w")),
24  _w(coupledValue("w"))
25 {
26 }
27 
28 /*Real
29 SplitCHCRes::computeDFDC(PFFunctionType type)
30 {
31  switch (type)
32  {
33  case Residual:
34  return _u[_qp]*_u[_qp]*_u[_qp] - _u[_qp]; // return Residual value
35 
36  case Jacobian:
37  return (3.0*_u[_qp]*_u[_qp] - 1.0)*_phi[_j][_qp]; //return Jacobian value
38 
39  }
40 
41  mooseError("Invalid type passed in");
42 }*/
43 
44 Real
46 {
47  Real residual =
48  SplitCHBase::computeQpResidual(); //(f_prime_zero+e_prime)*_test[_i][_qp] from SplitCHBase
49 
50  residual += -_w[_qp] * _test[_i][_qp];
51  residual += _kappa[_qp] * _grad_u[_qp] * _grad_test[_i][_qp];
52 
53  return residual;
54 }
55 
56 Real
58 {
59  Real jacobian = SplitCHBase::computeQpJacobian(); //(df_prime_zero_dc+de_prime_dc)*_test[_i][_qp];
60  // from SplitCHBase
61 
62  jacobian += _kappa[_qp] * _grad_phi[_j][_qp] * _grad_test[_i][_qp];
63 
64  return jacobian;
65 }
66 
67 Real
69 {
70  if (jvar == _w_var)
71  {
72  return -_phi[_j][_qp] * _test[_i][_qp];
73  }
74 
75  return 0.0;
76 }
SplitCHCRes(const InputParameters &parameters)
Definition: SplitCHCRes.C:20
virtual Real computeQpResidual()
Definition: SplitCHBase.C:37
const MaterialProperty< Real > & _kappa
Definition: SplitCHCRes.h:29
virtual Real computeQpJacobian()
Definition: SplitCHBase.C:48
unsigned int _w_var
Definition: SplitCHCRes.h:30
InputParameters validParams< SplitCHBase >()
Definition: SplitCHBase.C:11
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Definition: SplitCHCRes.C:68
The couple, SplitCHBase and SplitCHWRes, splits the CH equation by replacing chemical potential with ...
Definition: SplitCHBase.h:19
InputParameters validParams< SplitCHCRes >()
Definition: SplitCHCRes.C:11
virtual Real computeQpJacobian()
Definition: SplitCHCRes.C:57
virtual Real computeQpResidual()
Definition: SplitCHCRes.C:45
const VariableValue & _w
Definition: SplitCHCRes.h:31