20 "Cahn-Hilliard residual for the RFF form of the phase field crystal model");
22 MooseEnum log_options(
"tolerance cancelation expansion nothing");
24 "log_approach", log_options,
"Which approach will be used to handle the natural log");
25 params.
addParam<
Real>(
"tol", 1.0e-9,
"Tolerance used when the tolerance approach is chosen");
27 "n_exp_terms", 4,
"Number of terms used in the Taylor expansion of the natural log term");
28 params.
addParam<MaterialPropertyName>(
"mob_name",
"M",
"The mobility used with the kernel");
29 params.
addParam<MaterialPropertyName>(
"Dmob_name",
"DM",
"The D mobility used with the kernel");
30 params.
addParam<
bool>(
"has_MJac",
false,
"Jacobian information for the mobility is defined");
31 params.
addParam<
Real>(
"a", 1.0,
"Constants on Taylor Series");
32 params.
addParam<
Real>(
"b", 1.0,
"Constants on Taylor Series");
33 params.
addParam<
Real>(
"c", 1.0,
"Constants on Taylor Series");
39 _M(getMaterialProperty<
Real>(
"mob_name")),
40 _has_MJac(getParam<bool>(
"has_MJac")),
41 _DM(_has_MJac ? &getMaterialProperty<
Real>(
"Dmob_name") : NULL),
42 _log_approach(getParam<
MooseEnum>(
"log_approach")),
43 _tol(getParam<
Real>(
"tol")),
44 _num_L(coupledComponents(
"v")),
47 _n_exp_terms(getParam<
Real>(
"n_exp_terms")),
48 _a(getParam<
Real>(
"a")),
49 _b(getParam<
Real>(
"b")),
50 _c(getParam<
Real>(
"c"))
53 for (
unsigned int i = 0; i <
_num_L; ++i)
67 for (
unsigned int i = 0; i <
_num_L; ++i)
71 Real ln_expansion = 0.0;
79 frac = 1.0 / (1.0 +
c);
106 GradDFDCons = grad_c * frac - sum_grad_L;
110 GradDFDCons = grad_c - (1.0 +
c) * sum_grad_L;
114 GradDFDCons = ln_expansion * grad_c - sum_grad_L;
118 GradDFDCons = grad_c / (1.0 +
c) - sum_grad_L;
133 for (
unsigned int i = 0; i <
_num_L; ++i)
138 Real ln_expansion = 0.0;
150 frac = 1.0 / (1.0 +
c);
151 dfrac = -1.0 / ((1.0 +
c) * (1.0 +
c));
175 Real Dln_expansion = 0.0;
200 Dln_expansion += temp_coeff *
std::pow(static_cast<Real>(-1.0), static_cast<Real>(i)) *
201 (
static_cast<Real>(i) - 2.0) *
222 for (
unsigned int i = 0; i <
_num_L; ++i)
231 dGradDFDConsdL = -dsum_grad_L;
235 dGradDFDConsdL = -(1.0 +
c) * dsum_grad_L;
239 dGradDFDConsdL = -dsum_grad_L;
243 dGradDFDConsdL = -dsum_grad_L;
virtual unsigned int coupled(const std::string &var_name, unsigned int comp=0) const
const VariableGradient & _grad_u
static InputParameters validParams()
const VariablePhiGradient & _grad_phi
const MooseEnum _log_approach
std::vector< unsigned int > _vals_var
const unsigned int _n_exp_terms
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
virtual const VariableGradient & coupledGradient(const std::string &var_name, unsigned int comp=0) const
CHPFCRFF(const InputParameters ¶meters)
virtual Real computeQpJacobian()
This kernel calculates the main portion of the cahn-hilliard residual for the RFF form of the phase f...
static InputParameters validParams()
std::vector< const VariableGradient * > _grad_vals
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableTestGradient & _grad_test
const unsigned int _num_L
registerMooseObject("PhaseFieldApp", CHPFCRFF)
const MaterialProperty< Real > & _M
const VariablePhiValue & _phi
MooseUnits pow(const MooseUnits &, int)
virtual Real computeQpResidual()