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 "InterfaceDiffusion.h" 11 : 12 : registerMooseObject("MooseApp", InterfaceDiffusion); 13 : 14 : InputParameters 15 3619 : InterfaceDiffusion::validParams() 16 : { 17 3619 : InputParameters params = InterfaceKernel::validParams(); 18 14476 : params.addParam<MaterialPropertyName>("D", "D", "The diffusion coefficient."); 19 14476 : params.addParam<MaterialPropertyName>( 20 : "D_neighbor", "D_neighbor", "The neighboring diffusion coefficient."); 21 3619 : params.addClassDescription( 22 : "The kernel is utilized to establish flux equivalence on an interface for variables."); 23 3619 : return params; 24 0 : } 25 : 26 293 : InterfaceDiffusion::InterfaceDiffusion(const InputParameters & parameters) 27 : : InterfaceKernel(parameters), 28 293 : _D(getMaterialProperty<Real>("D")), 29 879 : _D_neighbor(getNeighborMaterialProperty<Real>("D_neighbor")) 30 : { 31 293 : } 32 : 33 : Real 34 4779764 : InterfaceDiffusion::computeQpResidual(Moose::DGResidualType type) 35 : { 36 4779764 : Real r = 0; 37 : 38 4779764 : switch (type) 39 : { 40 2389882 : case Moose::Element: 41 2389882 : r = _test[_i][_qp] * -_D_neighbor[_qp] * _grad_neighbor_value[_qp] * _normals[_qp]; 42 2389882 : break; 43 : 44 2389882 : case Moose::Neighbor: 45 2389882 : r = _test_neighbor[_i][_qp] * _D[_qp] * _grad_u[_qp] * _normals[_qp]; 46 2389882 : break; 47 : } 48 : 49 4779764 : return r; 50 : } 51 : 52 : Real 53 3460864 : InterfaceDiffusion::computeQpJacobian(Moose::DGJacobianType type) 54 : { 55 3460864 : Real jac = 0; 56 : 57 3460864 : switch (type) 58 : { 59 3213232 : case Moose::ElementElement: 60 : case Moose::NeighborNeighbor: 61 3213232 : break; 62 : 63 123816 : case Moose::NeighborElement: 64 123816 : jac = _test_neighbor[_i][_qp] * _D[_qp] * _grad_phi[_j][_qp] * _normals[_qp]; 65 123816 : break; 66 : 67 123816 : case Moose::ElementNeighbor: 68 123816 : jac = _test[_i][_qp] * -_D_neighbor[_qp] * _grad_phi_neighbor[_j][_qp] * _normals[_qp]; 69 123816 : break; 70 : } 71 : 72 3460864 : return jac; 73 : }