www.mooseframework.org
AEFVBC.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "AEFVBC.h"
11 
12 registerMooseObject("RdgApp", AEFVBC);
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<IntegratedBC>();
19  params.addClassDescription("A boundary condition kernel for the advection equation using a "
20  "cell-centered finite volume method.");
21  MooseEnum component("concentration");
22  params.addParam<MooseEnum>("component", component, "Choose one of the equations");
23  params.addRequiredCoupledVar("u", "Name of the variable to use");
24  params.addRequiredParam<UserObjectName>("flux", "Name of the boundary flux object to use");
25  return params;
26 }
27 
28 AEFVBC::AEFVBC(const InputParameters & parameters)
29  : IntegratedBC(parameters),
30  _component(getParam<MooseEnum>("component")),
31  _uc1(coupledValue("u")),
32  _u1(getMaterialProperty<Real>("u")),
33  _flux(getUserObject<BoundaryFluxBase>("flux"))
34 {
35 }
36 
37 Real
39 {
40  // assemble the input vectors, which are
41  // the reconstructed linear monomial
42  // extrapolated at side center from the current element
43  std::vector<Real> uvec1 = {_u1[_qp]};
44 
45  // calculate the flux
46  const auto & flux = _flux.getFlux(_current_side, _current_elem->id(), uvec1, _normals[_qp]);
47 
48  // distribute the contribution to the current element
49  return flux[_component] * _test[_i][_qp];
50 }
51 
52 Real
54 {
55  // assemble the input vectors, which are
56  // the constant monomial from the current element
57  std::vector<Real> uvec1 = {_uc1[_qp]};
58 
59  // calculate the flux
60  auto & fjac1 = _flux.getJacobian(_current_side, _current_elem->id(), uvec1, _normals[_qp]);
61 
62  // distribute the contribution to the current element
63  return fjac1(_component, _component) * _phi[_j][_qp] * _test[_i][_qp];
64 }
AEFVBC
A boundary condition object for the advection equation using a cell-centered finite volume method.
Definition: AEFVBC.h:44
BoundaryFluxBase
A base class for computing/caching fluxes at boundaries.
Definition: BoundaryFluxBase.h:30
registerMooseObject
registerMooseObject("RdgApp", AEFVBC)
BoundaryFluxBase::getJacobian
virtual const DenseMatrix< Real > & getJacobian(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave) const
Get the boundary Jacobian matrix.
Definition: BoundaryFluxBase.C:70
AEFVBC::_component
MooseEnum _component
choose an equation
Definition: AEFVBC.h:55
AEFVBC::computeQpJacobian
virtual Real computeQpJacobian()
Definition: AEFVBC.C:53
AEFVBC::computeQpResidual
virtual Real computeQpResidual()
Definition: AEFVBC.C:38
AEFVBC::_flux
const BoundaryFluxBase & _flux
bounadry flux object
Definition: AEFVBC.h:66
AEFVBC::_uc1
const VariableValue & _uc1
piecewise constant variable values in host element
Definition: AEFVBC.h:60
MaterialTensorCalculatorTools::component
Real component(const SymmTensor &symm_tensor, unsigned int index)
Definition: MaterialTensorCalculatorTools.C:16
AEFVBC::AEFVBC
AEFVBC(const InputParameters &parameters)
Definition: AEFVBC.C:28
validParams< AEFVBC >
InputParameters validParams< AEFVBC >()
Definition: AEFVBC.C:16
AEFVBC::_u1
const MaterialProperty< Real > & _u1
extrapolated variable values at side center
Definition: AEFVBC.h:63
AEFVBC.h
BoundaryFluxBase::getFlux
virtual const std::vector< Real > & getFlux(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave) const
Get the boundary flux vector.
Definition: BoundaryFluxBase.C:54