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 
14 {
16  params.addClassDescription("KKS model kernel for the Bulk Allen-Cahn. This operates on the order "
17  "parameter 'eta' as the non-linear variable");
18  params.addRequiredParam<MaterialPropertyName>(
19  "fa_name",
20  "Base name of the free energy function F (f_base in the corresponding KKSBaseMaterial)");
21  params.addParam<MaterialPropertyName>(
22  "h_name", "h", "Base name for the switching function h(eta)");
23  return params;
24 }
25 
27  : ACBulk<Real>(parameters),
28  // number of coupled variables (ca, args_a[])
29  _eta_name(_var.name()),
30  _prop_Fa(getMaterialProperty<Real>("fa_name")),
31  _prop_dFa(getMaterialPropertyDerivative<Real>("fa_name", _eta_name)),
32  _prop_dh(getMaterialPropertyDerivative<Real>("h_name", _eta_name)),
33  _prop_d2h(getMaterialPropertyDerivative<Real>("h_name", _eta_name, _eta_name))
34 {
35  // reserve space for derivatives
36  _derivatives_Fa.resize(_n_args);
37  _derivatives_Fb.resize(_n_args);
38  _grad_args.resize(_n_args);
39 
40  // Iterate over all coupled variables
41  for (unsigned int i = 0; i < _n_args; ++i)
42  {
43  // get the first derivatives of Fa and Fb material property
44  _derivatives_Fa[i] = &getMaterialPropertyDerivative<Real>("fa_name", i);
45  _derivatives_Fb[i] = &getMaterialPropertyDerivative<Real>("fb_name", i);
46 
47  // get the gradient
48  _grad_args[i] = &(_coupled_standard_moose_vars[i]->gradSln());
49  }
50 }
51 
52 void
54 {
56  validateNonlinearCoupling<Real>("fa_name");
57  validateNonlinearCoupling<Real>("fb_name");
58 }
KKSACBulkBase(const InputParameters &parameters)
Definition: KKSACBulkBase.C:26
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
virtual void initialSetup()
Definition: ACBulk.h:79
virtual void initialSetup()
Definition: KKSACBulkBase.C:53
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
Definition: KKSACBulkBase.C:13
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
Definition: ACBulk.h:24
std::vector< const VariableGradient * > _grad_args
Gradients for all coupled variables.
Definition: KKSACBulkBase.h:54
const std::string name
Definition: Setup.h:20
std::vector< const MaterialProperty< Real > * > _derivatives_Fa
Derivatives of with respect to all coupled variables.
Definition: KKSACBulkBase.h:36
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Definition: ACBulk.h:69
std::vector< const MaterialProperty< Real > * > _derivatives_Fb
Derivatives of with respect to all coupled variables.
Definition: KKSACBulkBase.h:39