www.mooseframework.org
KKSACBulkBase.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "KKSACBulkBase.h"
11 
12 template <>
13 InputParameters
15 {
16  InputParameters params = ACBulk<Real>::validParams();
17  params.addClassDescription("KKS model kernel for the Bulk Allen-Cahn. This operates on the order "
18  "parameter 'eta' as the non-linear variable");
19  params.addRequiredParam<MaterialPropertyName>(
20  "fa_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_dFa(getMaterialPropertyDerivative<Real>("fa_name", _eta_name)),
34  _prop_dh(getMaterialPropertyDerivative<Real>("h_name", _eta_name)),
35  _prop_d2h(getMaterialPropertyDerivative<Real>("h_name", _eta_name, _eta_name))
36 {
37  // reserve space for derivatives
38  _derivatives_Fa.resize(_nvar);
39  _derivatives_Fb.resize(_nvar);
40  _grad_args.resize(_nvar);
41 
42  // Iterate over all coupled variables
43  for (unsigned int i = 0; i < _nvar; ++i)
44  {
45  MooseVariable * cvar = _coupled_standard_moose_vars[i];
46 
47  // get the first derivatives of Fa and Fb material property
48  _derivatives_Fa[i] = &getMaterialPropertyDerivative<Real>("fa_name", cvar->name());
49  _derivatives_Fb[i] = &getMaterialPropertyDerivative<Real>("fb_name", cvar->name());
50 
51  // get the gradient
52  _grad_args[i] = &(cvar->gradSln());
53  }
54 }
55 
56 void
58 {
60  validateNonlinearCoupling<Real>("fa_name");
61  validateNonlinearCoupling<Real>("fb_name");
62 }
ACBulk
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
Definition: ACBulk.h:24
KKSACBulkBase::KKSACBulkBase
KKSACBulkBase(const InputParameters &parameters)
Definition: KKSACBulkBase.C:27
validParams< KKSACBulkBase >
InputParameters validParams< KKSACBulkBase >()
Definition: KKSACBulkBase.C:14
KKSACBulkBase::_nvar
unsigned int _nvar
Number of coupled variables.
Definition: KKSACBulkBase.h:35
KKSACBulkBase::_grad_args
std::vector< const VariableGradient * > _grad_args
Gradients for all coupled variables.
Definition: KKSACBulkBase.h:59
name
const std::string name
Definition: Setup.h:21
KKSACBulkBase::_derivatives_Fb
std::vector< const MaterialProperty< Real > * > _derivatives_Fb
Derivatives of with respect to all coupled variables.
Definition: KKSACBulkBase.h:44
ACBulk::initialSetup
virtual void initialSetup()
Definition: ACBulk.h:85
KKSACBulkBase.h
KKSACBulkBase::initialSetup
virtual void initialSetup()
Definition: KKSACBulkBase.C:57
ACBulk::validParams
static InputParameters validParams()
Definition: ACBulk.h:74
KKSACBulkBase::_derivatives_Fa
std::vector< const MaterialProperty< Real > * > _derivatives_Fa
Derivatives of with respect to all coupled variables.
Definition: KKSACBulkBase.h:41