https://mooseframework.inl.gov
Loading...
Searching...
No Matches
AEFVBC.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
13
16{
18 params.addClassDescription("A boundary condition kernel for the advection equation using a "
19 "cell-centered finite volume method.");
20 MooseEnum component("concentration");
21 params.addParam<MooseEnum>("component", component, "Choose one of the equations");
22 params.addRequiredCoupledVar("u", "Name of the variable to use");
23 params.addRequiredParam<UserObjectName>("flux", "Name of the boundary flux object to use");
24 return params;
25}
26
28 : IntegratedBC(parameters),
29 _component(getParam<MooseEnum>("component")),
30 _uc1(coupledValue("u")),
31 _u1(getMaterialProperty<Real>("u")),
32 _flux(getUserObject<BoundaryFluxBase>("flux"))
33{
34}
35
36Real
38{
39 // assemble the input vectors, which are
40 // the reconstructed linear monomial
41 // extrapolated at side center from the current element
42 std::vector<Real> uvec1 = {_u1[_qp]};
43
44 // calculate the flux
45 const auto & flux = _flux.getFlux(_current_side, _current_elem->id(), uvec1, _normals[_qp]);
46
47 // distribute the contribution to the current element
48 return flux[_component] * _test[_i][_qp];
49}
50
51Real
53{
54 // assemble the input vectors, which are
55 // the constant monomial from the current element
56 std::vector<Real> uvec1 = {_uc1[_qp]};
57
58 // calculate the flux
59 auto & fjac1 = _flux.getJacobian(_current_side, _current_elem->id(), uvec1, _normals[_qp]);
60
61 // distribute the contribution to the current element
62 return fjac1(_component, _component) * _phi[_j][_qp] * _test[_i][_qp];
63}
registerMooseObject("RdgApp", AEFVBC)
A boundary condition object for the advection equation using a cell-centered finite volume method.
Definition AEFVBC.h:41
virtual Real computeQpJacobian()
Definition AEFVBC.C:52
static InputParameters validParams()
Definition AEFVBC.C:15
const MaterialProperty< Real > & _u1
extrapolated variable values at side center
Definition AEFVBC.h:61
AEFVBC(const InputParameters &parameters)
Definition AEFVBC.C:27
const BoundaryFluxBase & _flux
bounadry flux object
Definition AEFVBC.h:64
MooseEnum _component
choose an equation
Definition AEFVBC.h:53
virtual Real computeQpResidual()
Definition AEFVBC.C:37
const VariableValue & _uc1
piecewise constant variable values in host element
Definition AEFVBC.h:58
A base class for computing/caching fluxes at boundaries.
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.
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.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
const unsigned int & _current_side
unsigned int _qp
unsigned int _i
const Elem *const & _current_elem
unsigned int _j
static InputParameters validParams()
const VariablePhiValue & _phi
const MooseArray< Point > & _normals
const VariableTestValue & _test