www.mooseframework.org
AEFVBC.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 /****************************************************************/
7 
8 #include "AEFVBC.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<IntegratedBC>();
15  params.addClassDescription("A boundary condition kernel for the advection equation using a "
16  "cell-centered finite volume method.");
17  MooseEnum component("concentration");
18  params.addParam<MooseEnum>("component", component, "Choose one of the equations");
19  params.addRequiredCoupledVar("u", "Name of the variable to use");
20  params.addRequiredParam<UserObjectName>("flux", "Name of the boundary flux object to use");
21  return params;
22 }
23 
24 AEFVBC::AEFVBC(const InputParameters & parameters)
25  : IntegratedBC(parameters),
26  _component(getParam<MooseEnum>("component")),
27  _uc1(coupledValue("u")),
28  _u1(getMaterialProperty<Real>("u")),
29  _flux(getUserObject<BoundaryFluxBase>("flux"))
30 {
31 }
32 
33 Real
35 {
36  // assemble the input vectors, which are
37  // the reconstructed linear monomial
38  // extrapolated at side center from the current element
39  std::vector<Real> uvec1 = {_u1[_qp]};
40 
41  // calculate the flux
42  const auto & flux = _flux.getFlux(_current_side, _current_elem->id(), uvec1, _normals[_qp], _tid);
43 
44  // distribute the contribution to the current element
45  return flux[_component] * _test[_i][_qp];
46 }
47 
48 Real
50 {
51  // assemble the input vectors, which are
52  // the constant monomial from the current element
53  std::vector<Real> uvec1 = {_uc1[_qp]};
54 
55  // calculate the flux
56  auto & fjac1 = _flux.getJacobian(_current_side, _current_elem->id(), uvec1, _normals[_qp], _tid);
57 
58  // distribute the contribution to the current element
59  return fjac1(_component, _component) * _phi[_j][_qp] * _test[_i][_qp];
60 }
virtual Real computeQpJacobian()
Definition: AEFVBC.C:49
MooseEnum _component
choose an equation
Definition: AEFVBC.h:54
Real component(const SymmTensor &symm_tensor, unsigned int index)
const VariableValue & _uc1
piecewise constant variable values in host element
Definition: AEFVBC.h:59
A base class for computing/caching fluxes at boundaries.
virtual Real computeQpResidual()
Definition: AEFVBC.C:34
InputParameters validParams< AEFVBC >()
Definition: AEFVBC.C:12
virtual const DenseMatrix< Real > & getJacobian(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, THREAD_ID tid) const
Get the boundary Jacobian matrix.
const BoundaryFluxBase & _flux
bounadry flux object
Definition: AEFVBC.h:65
AEFVBC(const InputParameters &parameters)
Definition: AEFVBC.C:24
virtual const std::vector< Real > & getFlux(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, THREAD_ID tid) const
Get the boundary flux vector.
const MaterialProperty< Real > & _u1
extrapolated variable values at side center
Definition: AEFVBC.h:62