LCOV - code coverage report
Current view: top level - src/interfacekernels - InterfaceDiffusion.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 419b9d Lines: 32 33 97.0 %
Date: 2025-08-08 20:01:16 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.14