www.mooseframework.org
InterfaceDiffusionFluxMatch.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 
9 template <>
10 InputParameters
12 {
13  InputParameters params = validParams<InterfaceDiffusionBase>();
14  params.addClassDescription(
15  "Enforce flux continuity between two different variables across a subdomain boundary");
16  return params;
17 }
18 
20  : InterfaceDiffusionBase(parameters)
21 {
22 }
23 
24 Real
26 {
27  // equal gradients means difference is zero
28  Real res =
29  _D * _grad_u[_qp] * _normals[_qp] - _D_neighbor * _grad_neighbor_value[_qp] * _normals[_qp];
30 
31  switch (type)
32  {
33  case Moose::Element:
34  return res * _test[_i][_qp];
35 
36  case Moose::Neighbor:
37  return res * _test_neighbor[_i][_qp];
38  }
39 
40  mooseError("Internal error.");
41 }
42 
43 Real
45 {
46  switch (type)
47  {
48  case Moose::ElementElement:
49  return _D * _grad_phi[_j][_qp] * _normals[_qp] * _test[_i][_qp];
50 
51  case Moose::NeighborNeighbor:
52  return -_D_neighbor * _grad_phi_neighbor[_j][_qp] * _normals[_qp] * _test_neighbor[_i][_qp];
53 
54  case Moose::ElementNeighbor:
55  return -_D_neighbor * _grad_phi_neighbor[_j][_qp] * _normals[_qp] * _test[_i][_qp];
56 
57  case Moose::NeighborElement:
58  return _D * _grad_phi[_j][_qp] * _normals[_qp] * _test_neighbor[_i][_qp];
59  }
60  mooseError("Internal error.");
61 }
InputParameters validParams< InterfaceDiffusionFluxMatch >()
const Real _D_neighbor
neighbor diffusion coefficient
Base class for Diffusion equation terms coupling two different variables across a subdomain boundary...
virtual Real computeQpJacobian(Moose::DGJacobianType type) override
InputParameters validParams< InterfaceDiffusionBase >()
virtual Real computeQpResidual(Moose::DGResidualType type) override
const Real _D
diffusion coefficient
InterfaceDiffusionFluxMatch(const InputParameters &parameters)