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 42 of file AEFVKernel.h.

Constructor & Destructor Documentation

AEFVKernel::AEFVKernel ( const InputParameters &  parameters)

Definition at line 24 of file AEFVKernel.C.

25  : DGKernel(parameters),
26  _component(getParam<MooseEnum>("component")),
27  _uc1(coupledValue("u")),
28  _uc2(coupledNeighborValue("u")),
29  _u1(getMaterialProperty<Real>("u")),
30  _u2(getNeighborMaterialProperty<Real>("u")),
31  _flux(getUserObject<InternalSideFluxBase>("flux"))
32 {
33 }
const InternalSideFluxBase & _flux
flux user object
Definition: AEFVKernel.h:67
const MaterialProperty< Real > & _u2
Definition: AEFVKernel.h:64
const MaterialProperty< Real > & _u1
extrapolated variable values at side center
Definition: AEFVKernel.h:63
const VariableValue & _uc1
piecewise constant variable values in cells
Definition: AEFVKernel.h:59
const VariableValue & _uc2
Definition: AEFVKernel.h:60
MooseEnum _component
choose an equation
Definition: AEFVKernel.h:53
AEFVKernel::~AEFVKernel ( )
virtual

Definition at line 35 of file AEFVKernel.C.

35 {}

Member Function Documentation

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

Definition at line 64 of file AEFVKernel.C.

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

Definition at line 38 of file AEFVKernel.C.

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

Member Data Documentation

MooseEnum AEFVKernel::_component
protected

choose an equation

Definition at line 53 of file AEFVKernel.h.

Referenced by computeQpJacobian(), and computeQpResidual().

const InternalSideFluxBase& AEFVKernel::_flux
protected

flux user object

Definition at line 67 of file AEFVKernel.h.

Referenced by computeQpJacobian(), and computeQpResidual().

const MaterialProperty<Real>& AEFVKernel::_u1
protected

extrapolated variable values at side center

Definition at line 63 of file AEFVKernel.h.

Referenced by computeQpResidual().

const MaterialProperty<Real>& AEFVKernel::_u2
protected

Definition at line 64 of file AEFVKernel.h.

Referenced by computeQpResidual().

const VariableValue& AEFVKernel::_uc1
protected

piecewise constant variable values in cells

Definition at line 59 of file AEFVKernel.h.

Referenced by computeQpJacobian().

const VariableValue& AEFVKernel::_uc2
protected

Definition at line 60 of file AEFVKernel.h.

Referenced by computeQpJacobian().


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