www.mooseframework.org
KKSACBulkBase.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 "KKSACBulkBase.h"
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = ACBulk<Real>::validParams();
14  params.addClassDescription("KKS model kernel for the Bulk Allen-Cahn. This operates on the order "
15  "parameter 'eta' as the non-linear variable");
16  params.addRequiredParam<MaterialPropertyName>(
17  "fa_name",
18  "Base name of the free energy function F (f_base in the corresponding KKSBaseMaterial)");
19  params.addRequiredParam<MaterialPropertyName>(
20  "fb_name",
21  "Base name of the free energy function F (f_base in the corresponding KKSBaseMaterial)");
22  params.addParam<MaterialPropertyName>(
23  "h_name", "h", "Base name for the switching function h(eta)");
24  return params;
25 }
26 
27 KKSACBulkBase::KKSACBulkBase(const InputParameters & parameters)
28  : ACBulk<Real>(parameters),
29  // number of coupled variables (ca, args_a[])
30  _nvar(_coupled_moose_vars.size()),
31  _eta_name(_var.name()),
32  _prop_Fa(getMaterialProperty<Real>("fa_name")),
33  _prop_Fb(getMaterialProperty<Real>("fb_name")),
34  _prop_dFa(getMaterialPropertyDerivative<Real>("fa_name", _eta_name)),
35  _prop_dFb(getMaterialPropertyDerivative<Real>("fb_name", _eta_name)),
36  _prop_dh(getMaterialPropertyDerivative<Real>("h_name", _eta_name)),
37  _prop_d2h(getMaterialPropertyDerivative<Real>("h_name", _eta_name, _eta_name))
38 {
39  // reserve space for derivatives
40  _derivatives_Fa.resize(_nvar);
41  _derivatives_Fb.resize(_nvar);
42  _grad_args.resize(_nvar);
43 
44  // Iterate over all coupled variables
45  for (unsigned int i = 0; i < _nvar; ++i)
46  {
47  MooseVariable * cvar = _coupled_moose_vars[i];
48 
49  // get the first derivatives of Fa and Fb material property
50  _derivatives_Fa[i] = &getMaterialPropertyDerivative<Real>("fa_name", cvar->name());
51  _derivatives_Fb[i] = &getMaterialPropertyDerivative<Real>("fb_name", cvar->name());
52 
53  // get the gradient
54  _grad_args[i] = &(cvar->gradSln());
55  }
56 }
57 
58 void
60 {
62  validateNonlinearCoupling<Real>("fa_name");
63  validateNonlinearCoupling<Real>("fb_name");
64 }
KKSACBulkBase(const InputParameters &parameters)
Definition: KKSACBulkBase.C:27
virtual void initialSetup()
Definition: ACBulk.h:83
virtual void initialSetup()
Definition: KKSACBulkBase.C:59
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
Definition: ACBulk.h:22
std::vector< const VariableGradient * > _grad_args
Gradients for all coupled variables.
Definition: KKSACBulkBase.h:63
InputParameters validParams< KKSACBulkBase >()
Definition: KKSACBulkBase.C:11
unsigned int _nvar
Number of coupled variables.
Definition: KKSACBulkBase.h:33
std::vector< const MaterialProperty< Real > * > _derivatives_Fa
Derivatives of with respect to all coupled variables.
Definition: KKSACBulkBase.h:39
static InputParameters validParams()
Definition: ACBulk.h:72
std::vector< const MaterialProperty< Real > * > _derivatives_Fb
Derivatives of with respect to all coupled variables.
Definition: KKSACBulkBase.h:42