https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADSplitCHCRes.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 "ADSplitCHCRes.h"
11
14{
16 params.addClassDescription("Split formulation Cahn-Hilliard Kernel");
17 params.addRequiredCoupledVar("w", "Chemical potential variable");
18 params.addRequiredParam<MaterialPropertyName>("kappa_name", "The kappa used with the kernel");
19 return params;
20}
21
23 : ADSplitCHBase(parameters),
24 _kappa(getADMaterialProperty<Real>("kappa_name")),
25 _w(adCoupledValue("w"))
26{
27}
28
31{
32 auto residual = ADSplitCHBase::computeQpResidual();
33
34 residual += -_w[_qp] * _test[_i][_qp];
35 residual += _kappa[_qp] * _grad_u[_qp] * _grad_test[_i][_qp];
36
37 return residual;
38}
DualNumber< Real, DNDerivativeType, true > ADReal
const ADTemplateVariableTestValue< T > & _test
const ADTemplateVariableTestGradient< T > & _grad_test
const ADTemplateVariableGradient< T > & _grad_u
The pair, ADSplitCHCRes and ADSplitCHWRes, splits the Cahn-Hilliard equation by replacing chemical po...
static InputParameters validParams()
virtual ADReal computeQpResidual()
static InputParameters validParams()
virtual ADReal computeQpResidual()
const ADMaterialProperty< Real > & _kappa
ADSplitCHCRes(const InputParameters &parameters)
const ADVariableValue & _w
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
unsigned int _qp
unsigned int _i