Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://www.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 "ADPhaseFieldCoupledDoubleWellPotential.h" 11 : 12 : registerMooseObject("PhaseFieldApp", ADPhaseFieldCoupledDoubleWellPotential); 13 : 14 : InputParameters 15 431 : ADPhaseFieldCoupledDoubleWellPotential::validParams() 16 : { 17 431 : InputParameters params = ADKernelValue::validParams(); 18 431 : params.addClassDescription("Double well potential for Cahn-Hilliard advection."); 19 862 : params.addRequiredCoupledVar("c", "phase field variable"); 20 862 : params.addRequiredParam<Real>("prefactor", "prefactor for double well potential"); 21 431 : return params; 22 0 : } 23 : 24 228 : ADPhaseFieldCoupledDoubleWellPotential::ADPhaseFieldCoupledDoubleWellPotential( 25 228 : const InputParameters & parameters) 26 456 : : ADKernelValue(parameters), _c(adCoupledValue("c")), _prefactor(getParam<Real>("prefactor")) 27 : 28 : { 29 228 : } 30 : 31 : ADReal 32 22489836 : ADPhaseFieldCoupledDoubleWellPotential::precomputeQpResidual() 33 : { 34 67469508 : return _prefactor * _c[_qp] * (_c[_qp] * _c[_qp] - 1); 35 : }