11 #include "libmesh/utility.h"
19 InputParameters params = validParams<AuxKernel>();
20 params.addRequiredCoupledVar(
"v",
"Array of coupled variables");
21 params.addParam<Real>(
"a", 1.0,
"Modified Coefficent in Taylor series expansion");
22 params.addParam<Real>(
"b", 1.0,
"Modified Coefficent in Taylor series expansion");
23 params.addParam<Real>(
"c", 1.0,
"Modified Coefficent in Taylor series expansion");
24 params.addParam<
unsigned int>(
25 "num_exp_terms", 4,
"Number of terms to use in the Taylor series expansion");
26 MooseEnum log_options(
"tolerance cancelation expansion nothing");
27 params.addRequiredParam<MooseEnum>(
28 "log_approach", log_options,
"Which approach will be used to handle the natural log");
29 params.addParam<Real>(
"tol", 1.0e-9,
"Tolerance used when the tolerance approach is chosen");
34 : AuxKernel(parameters),
35 _order(coupledComponents(
"v")),
36 _a(getParam<Real>(
"a")),
37 _b(getParam<Real>(
"b")),
38 _c(getParam<Real>(
"c")),
39 _num_exp_terms(getParam<unsigned int>(
"num_exp_terms")),
40 _log_approach(getParam<MooseEnum>(
"log_approach")),
41 _tol(getParam<Real>(
"tol"))
44 for (
unsigned int i = 0; i <
_order; ++i)
45 _vals[i] = &coupledValue(
"v", i);
58 val += ((1.0 + (*
_vals[0])[_qp]) * std::log(1 + (*
_vals[0])[_qp])) - (*
_vals[0])[_qp];
62 val += ((1.0 + (*
_vals[0])[_qp]) * std::log(1.0 + (*
_vals[0])[_qp])) - (*
_vals[0])[_qp];
87 for (
unsigned int i = 1; i <
_order; ++i)
88 sumL += (*
_vals[i])[_qp] * 0.5;
90 val -= ((*
_vals[0])[_qp] * sumL);