-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
120 additions
and
3 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
framework/include/interfacekernels/InterfaceDiffusionTest.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "InterfaceKernel.h" | ||
|
||
/** | ||
* DG kernel for interfacing diffusion between two variables on adjacent blocks | ||
*/ | ||
class InterfaceDiffusionTest : public InterfaceKernel | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
InterfaceDiffusionTest(const InputParameters & parameters); | ||
|
||
protected: | ||
virtual Real computeQpResidual(Moose::DGResidualType type) override; | ||
virtual Real computeQpJacobian(Moose::DGJacobianType type) override; | ||
|
||
const MaterialProperty<Real> & _D; | ||
const MaterialProperty<Real> & _D_neighbor; | ||
|
||
// dislocation velocities | ||
// slip direction and normal element | ||
const MaterialProperty<std::vector<RealVectorValue>> & _slip_direction_edge; | ||
const MaterialProperty<std::vector<RealVectorValue>> & _slip_plane_normalboth; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#include "InterfaceDiffusionTest.h" | ||
|
||
registerMooseObject("MooseApp", InterfaceDiffusionTest); | ||
|
||
InputParameters | ||
InterfaceDiffusionTest::validParams() | ||
{ | ||
InputParameters params = InterfaceKernel::validParams(); | ||
params.addParam<MaterialPropertyName>("D", "D", "The diffusion coefficient."); | ||
params.addParam<MaterialPropertyName>( | ||
"D_neighbor", "D_neighbor", "The neighboring diffusion coefficient."); | ||
params.addClassDescription( | ||
"The kernel is utilized to establish flux equivalence on an interface for variables."); | ||
return params; | ||
} | ||
|
||
InterfaceDiffusionTest::InterfaceDiffusionTest(const InputParameters & parameters) | ||
: InterfaceKernel(parameters), | ||
_D(getMaterialProperty<Real>("D")), | ||
_D_neighbor(getNeighborMaterialProperty<Real>("D_neighbor")), | ||
_slip_direction_edge(getMaterialProperty<std::vector<RealVectorValue>>("slip_direction_edge")), | ||
_slip_plane_normalboth( | ||
getMaterialProperty<std::vector<RealVectorValue>>("slip_plane_normalboth")) | ||
{ | ||
} | ||
|
||
Real | ||
InterfaceDiffusionTest::computeQpResidual(Moose::DGResidualType type) | ||
{ | ||
Real r = 0; | ||
|
||
switch (type) | ||
{ | ||
case Moose::Element: | ||
r = _test[_i][_qp] * -_D_neighbor[_qp] * _grad_neighbor_value[_qp] * _normals[_qp]; | ||
break; | ||
|
||
case Moose::Neighbor: | ||
r = _test_neighbor[_i][_qp] * _D[_qp] * _grad_u[_qp] * _normals[_qp]; | ||
break; | ||
} | ||
|
||
return r; | ||
} | ||
|
||
Real | ||
InterfaceDiffusionTest::computeQpJacobian(Moose::DGJacobianType type) | ||
{ | ||
Real jac = 0; | ||
|
||
switch (type) | ||
{ | ||
case Moose::ElementElement: | ||
case Moose::NeighborNeighbor: | ||
break; | ||
|
||
case Moose::NeighborElement: | ||
jac = _test_neighbor[_i][_qp] * _D[_qp] * _grad_phi[_j][_qp] * _normals[_qp]; | ||
break; | ||
|
||
case Moose::ElementNeighbor: | ||
jac = _test[_i][_qp] * -_D_neighbor[_qp] * _grad_phi_neighbor[_j][_qp] * _normals[_qp]; | ||
break; | ||
} | ||
|
||
return jac; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters