Line data Source code
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 : 12 : InputParameters 13 55 : ADSplitCHCRes::validParams() 14 : { 15 55 : InputParameters params = ADSplitCHBase::validParams(); 16 55 : params.addClassDescription("Split formulation Cahn-Hilliard Kernel"); 17 110 : params.addRequiredCoupledVar("w", "Chemical potential variable"); 18 110 : params.addRequiredParam<MaterialPropertyName>("kappa_name", "The kappa used with the kernel"); 19 55 : return params; 20 0 : } 21 : 22 29 : ADSplitCHCRes::ADSplitCHCRes(const InputParameters & parameters) 23 : : ADSplitCHBase(parameters), 24 29 : _kappa(getADMaterialProperty<Real>("kappa_name")), 25 58 : _w(adCoupledValue("w")) 26 : { 27 29 : } 28 : 29 : ADReal 30 11904000 : ADSplitCHCRes::computeQpResidual() 31 : { 32 11904000 : auto residual = ADSplitCHBase::computeQpResidual(); 33 : 34 23808000 : residual += -_w[_qp] * _test[_i][_qp]; 35 11904000 : residual += _kappa[_qp] * _grad_u[_qp] * _grad_test[_i][_qp]; 36 : 37 11904000 : return residual; 38 : }