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 "SimpleCHInterface.h" 11 : 12 : registerMooseObject("PhaseFieldApp", SimpleCHInterface); 13 : 14 : InputParameters 15 11 : SimpleCHInterface::validParams() 16 : { 17 11 : InputParameters params = Kernel::validParams(); 18 11 : params.addClassDescription("Gradient energy for Cahn-Hilliard equation with constant Mobility " 19 : "and Interfacial parameter"); 20 22 : params.addRequiredParam<MaterialPropertyName>( 21 : "kappa_name", "The kappa used with the kernel, should be constant value"); 22 22 : params.addRequiredParam<MaterialPropertyName>( 23 : "mob_name", "The mobility used with the kernel, should be constant value"); 24 11 : return params; 25 0 : } 26 : 27 6 : SimpleCHInterface::SimpleCHInterface(const InputParameters & parameters) 28 : : Kernel(parameters), 29 12 : _second_u(second()), 30 6 : _second_test(secondTest()), 31 6 : _second_phi(secondPhi()), 32 12 : _M(getMaterialProperty<Real>("mob_name")), 33 18 : _kappa_c(getMaterialProperty<Real>("kappa_name")) 34 : { 35 6 : } 36 : 37 : Real 38 4194304 : SimpleCHInterface::computeQpResidual() 39 : { 40 4194304 : return _kappa_c[_qp] * _second_u[_qp].tr() * _M[_qp] * _second_test[_i][_qp].tr(); 41 : } 42 : 43 : Real 44 57671680 : SimpleCHInterface::computeQpJacobian() 45 : { 46 57671680 : return _kappa_c[_qp] * _second_phi[_j][_qp].tr() * _M[_qp] * _second_test[_i][_qp].tr(); 47 : }