https://mooseframework.inl.gov
Loading...
Searching...
No Matches
KKSACBulkBase.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
52void
54{
56 validateNonlinearCoupling<Real>("fa_name");
57 validateNonlinearCoupling<Real>("fb_name");
58}
const std::string name
Definition Setup.h:21
This is the Allen-Cahn equation base class that implements the bulk or local energy term of the equat...
Definition ACBulk.h:25
virtual void initialSetup()
Definition ACBulk.h:79
static InputParameters validParams()
Definition ACBulk.h:69
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
std::vector< const MaterialProperty< Real > * > _derivatives_Fa
Derivatives of with respect to all coupled variables.
std::vector< const MaterialProperty< Real > * > _derivatives_Fb
Derivatives of with respect to all coupled variables.
virtual void initialSetup()
KKSACBulkBase(const InputParameters &parameters)
std::vector< const VariableGradient * > _grad_args
Gradients for all coupled variables.
static InputParameters validParams()