www.mooseframework.org
CHPFCRFFSplitKernelAction.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 
9 #include "Factory.h"
10 #include "Conversion.h"
11 #include "FEProblem.h"
12 
13 template <>
14 InputParameters
16 {
17  InputParameters params = validParams<Action>();
18  params.addRequiredParam<unsigned int>(
19  "num_L", "specifies the number of complex L variables will be solved for");
20  params.addRequiredParam<NonlinearVariableName>("n_name", "Variable name used for the n variable");
21  params.addRequiredParam<std::string>("L_name_base", "Base name for the complex L variables");
22  params.addParam<MaterialPropertyName>("mob_name", "M", "The mobility used for n in this model");
23  MooseEnum log_options("tolerance cancelation expansion");
24  params.addRequiredParam<MooseEnum>(
25  "log_approach", log_options, "Which approach will be used to handle the natural log");
26  params.addParam<Real>("tol", 1.0e-9, "Tolerance used when the tolerance approach is chosen");
27  params.addParam<Real>(
28  "n_exp_terms", 4.0, "Number of terms used in the Taylor expansion of the natural log term");
29  params.addParam<bool>(
30  "use_displaced_mesh", false, "Whether to use displaced mesh in the kernels");
31  return params;
32 }
33 
35  : Action(params),
36  _num_L(getParam<unsigned int>("num_L")),
37  _L_name_base(getParam<std::string>("L_name_base")),
38  _n_name(getParam<NonlinearVariableName>("n_name"))
39 {
40 }
41 
42 void
44 {
45  // Create the two kernels required for the n_variable, starting with the time derivative
46  InputParameters poly_params = _factory.getValidParams("TimeDerivative");
47  poly_params.set<NonlinearVariableName>("variable") = _n_name;
48  poly_params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh");
49  _problem->addKernel("TimeDerivative", "IE_n", poly_params);
50 
51  // First, we have to create the vector containing the names of the real L variables
52  std::vector<VariableName> real_v(_num_L);
53  for (unsigned int l = 0; l < _num_L; ++l)
54  real_v[l] = _L_name_base + Moose::stringify(l) + "_real";
55 
56  // CHPFCRFF kernel
57  poly_params = _factory.getValidParams("CHPFCRFF");
58  poly_params.applyParameters(parameters());
59  poly_params.set<NonlinearVariableName>("variable") = _n_name;
60  poly_params.set<std::vector<VariableName>>("v") = real_v;
61  _problem->addKernel("CHPFCRFF", "CH_bulk_n", poly_params);
62 }
const NonlinearVariableName _n_name
InputParameters validParams< CHPFCRFFSplitKernelAction >()
CHPFCRFFSplitKernelAction(const InputParameters &params)