www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AEFVKernel Class Reference

A dgkernel for the advection equation using a cell-centered finite volume method. More...

#include <AEFVKernel.h>

Inheritance diagram for AEFVKernel:
[legend]

Public Member Functions

 AEFVKernel (const InputParameters &parameters)
 
virtual ~AEFVKernel ()
 

Protected Member Functions

virtual Real computeQpResidual (Moose::DGResidualType type)
 
virtual Real computeQpJacobian (Moose::DGJacobianType type)
 

Protected Attributes

MooseEnum _component
 choose an equation More...
 
const VariableValue & _uc1
 piecewise constant variable values in cells More...
 
const VariableValue & _uc2
 
const MaterialProperty< Real > & _u1
 extrapolated variable values at side center More...
 
const MaterialProperty< Real > & _u2
 
const InternalSideFluxBase_flux
 flux user object More...
 

Detailed Description

A dgkernel for the advection equation using a cell-centered finite volume method.

Notes:

  1. This dgkernel itself does not do any complex calculation. It gets the internal side flux vector and Jacobian matrix from the internal side flux user object being called.
  2. In general, a approximate Riemann solver should be used in the internal flux user object for calculating the flux
  3. If a system of governing equations is being solved, the flux vector and Jacobian matrix are calculated only once for the first equation and cached for use for the rest of the equations in the system.
  4. On the "left" and "right" states of the internal side, the variable values are interpolated from the reconstructed linear polynomials in the "left" and "right "element, respectively, which are provided from the corresponding material kernel.

Definition at line 44 of file AEFVKernel.h.

Constructor & Destructor Documentation

◆ AEFVKernel()

AEFVKernel::AEFVKernel ( const InputParameters &  parameters)

Definition at line 28 of file AEFVKernel.C.

29  : DGKernel(parameters),
30  _component(getParam<MooseEnum>("component")),
31  _uc1(coupledValue("u")),
32  _uc2(coupledNeighborValue("u")),
33  _u1(getMaterialProperty<Real>("u")),
34  _u2(getNeighborMaterialProperty<Real>("u")),
35  _flux(getUserObject<InternalSideFluxBase>("flux"))
36 {
37 }
const InternalSideFluxBase & _flux
flux user object
Definition: AEFVKernel.h:69
const MaterialProperty< Real > & _u2
Definition: AEFVKernel.h:66
const MaterialProperty< Real > & _u1
extrapolated variable values at side center
Definition: AEFVKernel.h:65
const VariableValue & _uc1
piecewise constant variable values in cells
Definition: AEFVKernel.h:61
const VariableValue & _uc2
Definition: AEFVKernel.h:62
MooseEnum _component
choose an equation
Definition: AEFVKernel.h:55

◆ ~AEFVKernel()

AEFVKernel::~AEFVKernel ( )
virtual

Definition at line 39 of file AEFVKernel.C.

39 {}

Member Function Documentation

◆ computeQpJacobian()

Real AEFVKernel::computeQpJacobian ( Moose::DGJacobianType  type)
protectedvirtual

Definition at line 68 of file AEFVKernel.C.

69 {
70  // assemble the input vectors, which are
71  // the constant monomial from the current and neighbor elements
72  std::vector<Real> uvec1 = {_uc1[_qp]};
73  std::vector<Real> uvec2 = {_uc2[_qp]};
74 
75  // calculate the Jacobian matrices
76  const auto & fjac1 = _flux.getJacobian(Moose::Element,
77  _current_side,
78  _current_elem->id(),
79  _neighbor_elem->id(),
80  uvec1,
81  uvec2,
82  _normals[_qp]);
83 
84  const auto & fjac2 = _flux.getJacobian(Moose::Neighbor,
85  _current_side,
86  _current_elem->id(),
87  _neighbor_elem->id(),
88  uvec1,
89  uvec2,
90  _normals[_qp]);
91 
92  // distribute the contribution to the current and neighbor elements
93  switch (type)
94  {
95  case Moose::ElementElement:
96  return fjac1(_component, _component) * _phi[_j][_qp] * _test[_i][_qp];
97 
98  case Moose::ElementNeighbor:
99  return fjac2(_component, _component) * _phi_neighbor[_j][_qp] * _test[_i][_qp];
100 
101  case Moose::NeighborElement:
102  return -fjac1(_component, _component) * _phi[_j][_qp] * _test_neighbor[_i][_qp];
103 
104  case Moose::NeighborNeighbor:
105  return -fjac2(_component, _component) * _phi_neighbor[_j][_qp] * _test_neighbor[_i][_qp];
106  }
107 
108  return 0.0;
109 }
const InternalSideFluxBase & _flux
flux user object
Definition: AEFVKernel.h:69
virtual const DenseMatrix< Real > & getJacobian(Moose::DGResidualType type, unsigned int iside, dof_id_type ielem, dof_id_type ineig, const std::vector< Real > &uvec1, const std::vector< Real > &uvec2, const RealVectorValue &dwave) const
Get the Jacobian matrix.
const VariableValue & _uc1
piecewise constant variable values in cells
Definition: AEFVKernel.h:61
const VariableValue & _uc2
Definition: AEFVKernel.h:62
MooseEnum _component
choose an equation
Definition: AEFVKernel.h:55

◆ computeQpResidual()

Real AEFVKernel::computeQpResidual ( Moose::DGResidualType  type)
protectedvirtual

Definition at line 42 of file AEFVKernel.C.

43 {
44  // assemble the input vectors, which are
45  // the reconstructed linear monomial
46  // extrapolated at side center from the current and neighbor elements
47  std::vector<Real> uvec1 = {_u1[_qp]};
48  std::vector<Real> uvec2 = {_u2[_qp]};
49 
50  // calculate the flux
51  const auto & flux = _flux.getFlux(
52  _current_side, _current_elem->id(), _neighbor_elem->id(), uvec1, uvec2, _normals[_qp]);
53 
54  // distribute the contribution to the current and neighbor elements
55  switch (type)
56  {
57  case Moose::Element:
58  return flux[_component] * _test[_i][_qp];
59 
60  case Moose::Neighbor:
61  return -flux[_component] * _test_neighbor[_i][_qp];
62  }
63 
64  return 0.0;
65 }
const InternalSideFluxBase & _flux
flux user object
Definition: AEFVKernel.h:69
const MaterialProperty< Real > & _u2
Definition: AEFVKernel.h:66
const MaterialProperty< Real > & _u1
extrapolated variable values at side center
Definition: AEFVKernel.h:65
MooseEnum _component
choose an equation
Definition: AEFVKernel.h:55
virtual const std::vector< Real > & getFlux(unsigned int iside, dof_id_type ielem, dof_id_type ineig, const std::vector< Real > &uvec1, const std::vector< Real > &uvec2, const RealVectorValue &dwave) const
Get the flux vector.

Member Data Documentation

◆ _component

MooseEnum AEFVKernel::_component
protected

choose an equation

Definition at line 55 of file AEFVKernel.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _flux

const InternalSideFluxBase& AEFVKernel::_flux
protected

flux user object

Definition at line 69 of file AEFVKernel.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _u1

const MaterialProperty<Real>& AEFVKernel::_u1
protected

extrapolated variable values at side center

Definition at line 65 of file AEFVKernel.h.

Referenced by computeQpResidual().

◆ _u2

const MaterialProperty<Real>& AEFVKernel::_u2
protected

Definition at line 66 of file AEFVKernel.h.

Referenced by computeQpResidual().

◆ _uc1

const VariableValue& AEFVKernel::_uc1
protected

piecewise constant variable values in cells

Definition at line 61 of file AEFVKernel.h.

Referenced by computeQpJacobian().

◆ _uc2

const VariableValue& AEFVKernel::_uc2
protected

Definition at line 62 of file AEFVKernel.h.

Referenced by computeQpJacobian().


The documentation for this class was generated from the following files: