www.mooseframework.org
InterfaceDiffusionFluxMatch.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
11 
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<InterfaceDiffusionBase>();
19  params.addClassDescription(
20  "Enforce flux continuity between two different variables across a subdomain boundary");
21  return params;
22 }
23 
25  : InterfaceDiffusionBase(parameters)
26 {
27 }
28 
29 Real
31 {
32  // equal gradients means difference is zero
33  Real res =
34  _D * _grad_u[_qp] * _normals[_qp] - _D_neighbor * _grad_neighbor_value[_qp] * _normals[_qp];
35 
36  switch (type)
37  {
38  case Moose::Element:
39  return res * _test[_i][_qp];
40 
41  case Moose::Neighbor:
42  return res * _test_neighbor[_i][_qp];
43  }
44 
45  mooseError("Internal error.");
46 }
47 
48 Real
50 {
51  switch (type)
52  {
53  case Moose::ElementElement:
54  return _D * _grad_phi[_j][_qp] * _normals[_qp] * _test[_i][_qp];
55 
56  case Moose::NeighborNeighbor:
57  return -_D_neighbor * _grad_phi_neighbor[_j][_qp] * _normals[_qp] * _test_neighbor[_i][_qp];
58 
59  case Moose::ElementNeighbor:
60  return -_D_neighbor * _grad_phi_neighbor[_j][_qp] * _normals[_qp] * _test[_i][_qp];
61 
62  case Moose::NeighborElement:
63  return _D * _grad_phi[_j][_qp] * _normals[_qp] * _test_neighbor[_i][_qp];
64  }
65  mooseError("Internal error.");
66 }
InterfaceDiffusionFluxMatch::computeQpResidual
virtual Real computeQpResidual(Moose::DGResidualType type) override
Definition: InterfaceDiffusionFluxMatch.C:30
InterfaceDiffusionBase
Base class for Diffusion equation terms coupling two different variables across a subdomain boundary.
Definition: InterfaceDiffusionBase.h:23
InterfaceDiffusionBase::_D
const Real _D
diffusion coefficient
Definition: InterfaceDiffusionBase.h:30
registerMooseObject
registerMooseObject("PhaseFieldApp", InterfaceDiffusionFluxMatch)
InterfaceDiffusionFluxMatch
Enforce gradient continuity between two different variables across a subdomain boundary.
Definition: InterfaceDiffusionFluxMatch.h:23
InterfaceDiffusionFluxMatch.h
validParams< InterfaceDiffusionBase >
InputParameters validParams< InterfaceDiffusionBase >()
Definition: InterfaceDiffusionBase.C:14
InterfaceDiffusionBase::_D_neighbor
const Real _D_neighbor
neighbor diffusion coefficient
Definition: InterfaceDiffusionBase.h:33
InterfaceDiffusionFluxMatch::computeQpJacobian
virtual Real computeQpJacobian(Moose::DGJacobianType type) override
Definition: InterfaceDiffusionFluxMatch.C:49
InterfaceDiffusionFluxMatch::InterfaceDiffusionFluxMatch
InterfaceDiffusionFluxMatch(const InputParameters &parameters)
Definition: InterfaceDiffusionFluxMatch.C:24
validParams< InterfaceDiffusionFluxMatch >
InputParameters validParams< InterfaceDiffusionFluxMatch >()
Definition: InterfaceDiffusionFluxMatch.C:16