https://mooseframework.inl.gov
LinearFVAdvectionDiffusionFunctorDirichletBC.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 
11 
13 
16 {
18  params.addClassDescription(
19  "Adds a dirichlet BC which can be used for the assembly of linear "
20  "finite volume system and whose face values are determined using a functor. This kernel is "
21  "only designed to work with advection-diffusion problems.");
22  params.addRequiredParam<MooseFunctorName>("functor", "The functor for this boundary condition.");
23  MooseEnum normal_component("x y z none", "none");
24  return params;
25 }
26 
28  const InputParameters & parameters)
29  : LinearFVAdvectionDiffusionBC(parameters), _functor(getFunctor<Real>("functor"))
30 {
31 }
32 
33 Real
35 {
37 }
38 
39 Real
41 {
46  return (computeBoundaryValue() - raw_value(_var(elem_arg, determineState()))) / distance;
47 }
48 
49 Real
51 {
52  // Ths will not contribute to the matrix from the value considering that
53  // the value is independent of the solution.
54  return 0.0;
55 }
56 
57 Real
59 {
60  // Fetch the boundary value from the provided functor.
61  return computeBoundaryValue();
62 }
63 
64 Real
66 {
67  // The implicit term from the central difference approximation of the normal
68  // gradient.
69  return 1.0 / computeCellToFaceDistance();
70 }
71 
72 Real
74 {
75  // The boundary term from the central difference approximation of the
76  // normal gradient.
78 }
virtual Real computeBoundaryValue() const override
Computes the boundary value of this object.
Moose::FaceArg functorFaceArg(const FunctorType &functor, const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const
Determine a face argument for evaluating a functor on a face.
Real computeCellToFaceDistance() const
Compute the distance between the cell center and the face.
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
auto raw_value(const Eigen::Map< T > &in)
Definition: EigenADReal.h:100
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Real distance(const Point &p)
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
Helper method to create an elemental argument for a functor that includes whether to perform skewness...
virtual Real computeBoundaryGradientRHSContribution() const override
Computes the boundary gradient&#39;s contribution to the linear system right hand side.
registerMooseObject("MooseApp", LinearFVAdvectionDiffusionFunctorDirichletBC)
Base class for boundary conditions that are valid for advection diffusion problems.
const Elem * neighborPtr() const
Definition: FaceInfo.h:88
FaceInfo::VarFaceNeighbors _current_face_type
Face ownership information for the current face.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:54
virtual Real computeBoundaryGradientMatrixContribution() const override
Computes the boundary gradient&#39;s contribution to the linear system matrix.
MooseLinearVariableFV< Real > & _var
Reference to the linear finite volume variable object.
const Elem * elemPtr() const
Definition: FaceInfo.h:86
const Moose::Functor< Real > & _functor
The functor for this BC (can be variable, function, etc)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const FaceInfo * _current_face_info
Pointer to the face info we are operating on right now.
LinearFVAdvectionDiffusionFunctorDirichletBC(const InputParameters &parameters)
Class constructor.
virtual Real computeBoundaryNormalGradient() const override
Computes the normal gradient (often used in diffusion terms) on the boundary.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
virtual Real computeBoundaryValueMatrixContribution() const override
Computes the boundary value&#39;s contribution to the linear system matrix.
Class implementing a Dirichlet boundary condition for linear finite volume variables.
virtual Real computeBoundaryValueRHSContribution() const override
Computes the boundary value&#39;s contribution to the linear system right hand side.