20 "Functor describing a diagonal diffusion tensor.");
22 "use_two_term_expansion",
24 "Whether to reconstruct the boundary value using the prescribed flux and cell gradient. If "
25 "false, the boundary value is approximated by the adjacent cell value.");
27 "Adds a prescribed anisotropic diffusive flux boundary condition to a linear finite "
28 "volume system and reconstructs the boundary value using a diagonal diffusion tensor.");
35 _two_term_expansion(getParam<bool>(
"use_two_term_expansion")),
36 _diffusion_tensor(getFunctor<RealVectorValue>(
"diffusion_tensor"))
52 const auto boundary_normal =
56 const auto tangential_cell_to_face =
57 cell_to_face - (cell_to_face * boundary_normal) * boundary_normal;
60 _var.
gradSln(*elem_info, state) * tangential_cell_to_face;
73 const auto boundary_normal =
78 RealVectorValue normal_scaled_diffusion;
80 normal_scaled_diffusion(i) = boundary_normal(i) * diffusion_tensor(i);
82 const Real normal_diffusion = normal_scaled_diffusion * boundary_normal;
83 if (normal_diffusion <= 0.0)
84 mooseError(
"The boundary-normal diffusion coefficient must be positive, but its value is ",
88 const auto tangential_diffusion = normal_scaled_diffusion - normal_diffusion * boundary_normal;
89 const Real tangential_flux = tangential_diffusion *
_var.
gradSln(*elem_info, state);
registerMooseObject("MooseApp", LinearFVAnisotropicDiffusionFunctorNeumannBC)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
const Point & normal() const
Returns the unit normal vector for the face oriented outward from the face's elem element.
const ElemInfo * elemInfo() const
const ElemInfo * neighborInfo() const
Class implementing a Neumann boundary condition for linear finite volume variables.
const Moose::Functor< Real > & _functor
The functor for this BC (can be variable, function, etc)
static InputParameters validParams()
A Neumann boundary condition for linear finite volume anisotropic diffusion problems.
virtual Real computeBoundaryNormalGradient() const override
Computes the normal gradient (often used in diffusion terms) on the boundary.
const Moose::Functor< RealVectorValue > & _diffusion_tensor
The functor for the diagonal diffusion tensor.
virtual Real computeBoundaryValueRHSContribution() const override
Computes the boundary value's contribution to the linear system right hand side.
static InputParameters validParams()
LinearFVAnisotropicDiffusionFunctorNeumannBC(const InputParameters ¶meters)
Class constructor.
const bool _two_term_expansion
Whether to reconstruct the boundary value with the prescribed flux and cell gradient.
virtual Real computeBoundaryValue() const override
Computes the boundary value of this object.
const FaceInfo * _current_face_info
Pointer to the face info we are operating on right now.
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.
Real computeCellToFaceDistance() const
Compute the distance between the cell center and the face.
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.
Real getElemValue(const ElemInfo &elem_info, const StateArg &state) const
Get the solution value for the provided element and seed the derivative for the corresponding dof ind...
VectorValue< Real > gradSln(const ElemInfo &elem_info, const StateArg &state) const
Get the variable gradient at a cell center.
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.