https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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"
18#include "UserObjectInterface.h"
19#include "TransientInterface.h"
25#include "TaggingInterface.h"
28#include "FaceArgInterface.h"
31
32#include "libmesh/linear_implicit_system.h"
33
34// Forward declerations
35class MooseMesh;
36class Problem;
37class SubProblem;
38class SystemBase;
39
45 public SetupInterface,
46 public FunctionInterface,
49 public TransientInterface,
54 public TaggingInterface,
55 public MooseVariableInterface<Real>,
59{
60public:
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
96protected:
100 Real computeCellToFaceDistance() const;
101
106 RealVectorValue computeCellToFaceVector() const;
107
116 const FaceInfo * fi,
118 bool correct_skewness = false) const;
119
128 template <typename FunctorType>
130 functorFaceArg(const FunctorType & functor,
131 const FaceInfo * fi,
133 bool correct_skewness = false) const;
134
137
140
143
146
149
152
155
158
160 const unsigned int _var_num;
161
163 const unsigned int _sys_num;
164};
165
166inline void
168 const FaceInfo::VarFaceNeighbors face_type)
169{
170 mooseAssert(
171 face_info,
172 "The face info pointer should not be null when passing to the LinearFVBoundaryCondition!");
173 _current_face_info = face_info;
174 _current_face_type = face_type;
175}
unsigned int THREAD_ID
Definition MooseTypes.h:237
A class for requiring an object to be boundary restricted.
Interface for objects that need to use distributions.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
An interface for producers of functor face arguments, e.g.
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition FaceInfo.h:38
VarFaceNeighbors
This enum is used to indicate which side(s) of a face a particular variable is defined on.
Definition FaceInfo.h:53
Interface for objects that need to use functions.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Base class for boundary conditions for linear FV systems.
const FaceInfo * _current_face_info
Pointer to the face info we are operating on right now.
const unsigned int _sys_num
Cache for the system number.
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.
SystemBase & _sys
Reference to system base class in MOOSE.
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.
void setupFaceData(const FaceInfo *face_info, const FaceInfo::VarFaceNeighbors face_type)
Set current face info.
virtual Real computeBoundaryValue() const =0
Computes the boundary value of this object.
FEProblemBase & _fv_problem
Reference to the ruling finite volume problem.
Real computeCellToFaceDistance() const
Compute the distance between the cell center and the face.
const FaceInfo * currentFaceInfo() const
FaceInfo::VarFaceNeighbors _current_face_type
Face ownership information for the current face.
RealVectorValue computeCellToFaceVector() const
Computes the vector connecting the cell and boundary face centers.
MooseLinearVariableFV< Real > & _var
Reference to the linear finite volume variable object.
static InputParameters validParams()
virtual bool hasFaceSide(const FaceInfo &fi, bool fi_elem_side) const override
const unsigned int _var_num
Cache for the variable number.
const MooseLinearVariableFV< Real > & variable() const
Return the linear finite volume variable.
FaceInfo::VarFaceNeighbors currentFaceType() const
MooseMesh & _mesh
Mesh this BC is defined on.
SubProblem & _subproblem
Reference to SubProblem.
const SubProblem & subProblem() const
Get a reference to the subproblem.
virtual Real computeBoundaryNormalGradient() const =0
Computes the normal gradient (often used in diffusion terms) on the boundary.
Interface for notifications that the mesh has changed.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
This class provides variable solution interface for linear finite volume problems.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
Interface for objects that need to get values of MooseVariables.
An interface for accessing Moose::Functors for systems that do not care about automatic differentiati...
Interface class for classes which interact with Postprocessors.
Class that hold the whole problem being solved.
Definition Problem.h:20
Generic class for solving transient nonlinear problems.
Definition SubProblem.h:79
Base class for a system (of equations)
Definition SystemBase.h:87
Interface for objects that needs transient capabilities.
Interface for objects that need to use UserObjects.
A structure defining a "face" evaluation calling argument for Moose functors.