https://mooseframework.inl.gov
LinearFVBoundaryCondition.h
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 #pragma once
11 
12 // MOOSE
13 #include "MooseObject.h"
14 #include "SetupInterface.h"
15 #include "ParallelUniqueId.h"
16 #include "FunctionInterface.h"
17 #include "DistributionInterface.h"
18 #include "UserObjectInterface.h"
19 #include "TransientInterface.h"
20 #include "PostprocessorInterface.h"
24 #include "MeshChangedInterface.h"
25 #include "TaggingInterface.h"
27 #include "NonADFunctorInterface.h"
28 #include "FaceArgInterface.h"
29 #include "MooseLinearVariableFV.h"
30 #include "MooseVariableInterface.h"
31 
32 #include "libmesh/linear_implicit_system.h"
33 
34 // Forward declerations
35 class MooseMesh;
36 class Problem;
37 class SubProblem;
38 class SystemBase;
39 
45  public SetupInterface,
46  public FunctionInterface,
47  public DistributionInterface,
48  public UserObjectInterface,
49  public TransientInterface,
53  public MeshChangedInterface,
54  public TaggingInterface,
55  public MooseVariableInterface<Real>,
57  public NonADFunctorInterface,
59 {
60 public:
66 
68 
69  virtual bool hasFaceSide(const FaceInfo & fi, bool fi_elem_side) const override;
70 
75  const SubProblem & subProblem() const { return _subproblem; }
76 
78  const MooseLinearVariableFV<Real> & variable() const { return _var; }
79 
83  virtual Real computeBoundaryValue() const = 0;
84 
88  virtual Real computeBoundaryNormalGradient() const = 0;
89 
91  void setupFaceData(const FaceInfo * face_info, const FaceInfo::VarFaceNeighbors face_type);
92 
93  const FaceInfo * currentFaceInfo() const { return _current_face_info; }
95 
96 protected:
101 
107 
116  const FaceInfo * fi,
118  bool correct_skewness = false) const;
119 
122 
125 
128 
131 
134 
137 
140 
143 
145  const unsigned int _var_num;
146 
148  const unsigned int _sys_num;
149 };
150 
151 inline void
153  const FaceInfo::VarFaceNeighbors face_type)
154 {
155  mooseAssert(
156  face_info,
157  "The face info pointer should not be null when passing to the LinearFVBoundaryCondition!");
158  _current_face_info = face_info;
159  _current_face_type = face_type;
160 }
An interface for accessing Moose::Functors for systems that do not care about automatic differentiati...
virtual bool hasFaceSide(const FaceInfo &fi, bool fi_elem_side) const override
RealVectorValue computeCellToFaceVector() const
Computes the vector connecting the cell and boundary face centers.
A class for requiring an object to be boundary restricted.
Base class for boundary conditions for linear FV systems.
Real computeCellToFaceDistance() const
Compute the distance between the cell center and the face.
const MooseLinearVariableFV< Real > & variable() const
Return the linear finite volume variable.
const FaceInfo * currentFaceInfo() const
virtual Real computeBoundaryNormalGradient() const =0
Computes the normal gradient (often used in diffusion terms) on the boundary.
const unsigned int _sys_num
Cache for the system number.
void setupFaceData(const FaceInfo *face_info, const FaceInfo::VarFaceNeighbors face_type)
Set current face info.
Class that hold the whole problem being solved.
Definition: Problem.h:19
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Base class for a system (of equations)
Definition: SystemBase.h:84
const THREAD_ID _tid
Thread id.
FaceInfo::VarFaceNeighbors currentFaceType() const
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
static InputParameters validParams()
FEProblemBase & _fv_problem
Reference to the ruling finite volume problem.
MooseMesh & _mesh
Mesh this BC is defined on.
Interface for objects that needs transient capabilities.
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:36
Interface for notifications that the mesh has changed.
A structure defining a "face" evaluation calling argument for Moose functors.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
An interface for producers of functor face arguments, e.g.
Interface for objects that need to use distributions.
SystemBase & _sys
Reference to system base class in MOOSE.
LinearFVBoundaryCondition(const InputParameters &parameters)
Class constructor.
FaceInfo::VarFaceNeighbors _current_face_type
Face ownership information for the current face.
VarFaceNeighbors
This enum is used to indicate which side(s) of a face a particular variable is defined on...
Definition: FaceInfo.h:48
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
LimiterType
Definition: Limiter.h:26
const unsigned int _var_num
Cache for the variable number.
const SubProblem & subProblem() const
Get a reference to the subproblem.
Interface for objects that need to use UserObjects.
MooseLinearVariableFV< Real > & _var
Reference to the linear finite volume variable object.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
const FaceInfo * _current_face_info
Pointer to the face info we are operating on right now.
Interface for objects that need to get values of MooseVariables.
const InputParameters & parameters() const
Get the parameters of the object.
virtual Real computeBoundaryValue() const =0
Computes the boundary value of this object.
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false) const
Determine the single sided face argument when evaluating a functor on a face.
Interface for objects that need to use functions.
Interface class for classes which interact with Postprocessors.
unsigned int THREAD_ID
Definition: MooseTypes.h:209
SubProblem & _subproblem
Reference to SubProblem.