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)
65 RealGradient sum_grad_L;
67 for (
unsigned int i = 0; i <
_num_L; ++i)
71 Real ln_expansion = 0.0;
79 frac = 1.0 / (1.0 +
c);
96 ln_expansion += temp_coeff * std::pow(-1.0, Real(i)) * std::pow(
_u[
_qp], Real(i) - 2.0);
101 RealGradient GradDFDCons;
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;
131 RealGradient 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));
169 ln_expansion += temp_coeff * std::pow(-1.0, Real(i)) * std::pow(
_u[
_qp], Real(i) - 2.0);
174 RealGradient dGradDFDConsdC;
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) *
202 std::pow(
_u[
_qp],
static_cast<Real
>(i) - 3.0);
222 for (
unsigned int i = 0; i <
_num_L; ++i)
227 RealGradient dGradDFDConsdL;
231 dGradDFDConsdL = -dsum_grad_L;
235 dGradDFDConsdL = -(1.0 +
c) * dsum_grad_L;
239 dGradDFDConsdL = -dsum_grad_L;
243 dGradDFDConsdL = -dsum_grad_L;
registerMooseObject("PhaseFieldApp", CHPFCRFF)
This kernel calculates the main portion of the cahn-hilliard residual for the RFF form of the phase f...
virtual Real computeQpJacobian()
CHPFCRFF(const InputParameters ¶meters)
const MaterialProperty< Real > & _M
static InputParameters validParams()
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
std::vector< unsigned int > _vals_var
const unsigned int _num_L
std::vector< const VariableGradient * > _grad_vals
const MooseEnum _log_approach
const unsigned int _n_exp_terms
virtual Real computeQpResidual()
virtual const VariableGradient & coupledGradient(const std::string &var_name, unsigned int comp=0) const
virtual unsigned int coupled(const std::string &var_name, unsigned int comp=0) const
const VariableGradient & _grad_u
const VariablePhiValue & _phi
static InputParameters validParams()
const VariablePhiGradient & _grad_phi
const VariableTestGradient & _grad_test