19 "Adds a Robin BC of the form \\alpha * \\nabla \\phi*n + \\beta * \\phi = \\gamma, " 20 "which can be used for the assembly of linear " 21 "finite volume system and whose face values are determined using " 22 "three functors. This kernel is " 23 "only designed to work with advection-diffusion problems.");
25 "alpha",
"The functor which is the coefficient of the normal gradient term.");
27 "beta",
"The functor which is the coefficient of the scalar term.");
29 "gamma",
"The functor which is the constant term on the RHS of the Robin BC expression.");
36 _alpha(getFunctor<
Real>(
"alpha")),
37 _beta(getFunctor<
Real>(
"beta")),
38 _gamma(getFunctor<
Real>(
"gamma"))
45 std::istringstream ss(getParam<MooseFunctorName>(
"alpha"));
47 if (ss >> real_value && ss.eof())
50 "This value shall not be 0. Use a Dirichlet boundary condition instead!");
59 "This should not be assigned on an internal face!");
65 const auto alpha =
_alpha(face, state);
66 const auto beta =
_beta(face, state);
67 const auto gamma =
_gamma(face, state);
75 const auto projection = d_cf * nhat;
76 const auto vc = d_cf - (projection * nhat);
77 return ((alpha * phi) + (alpha * grad_phi * vc) + (gamma * projection)) /
78 (alpha + (beta * projection));
86 const auto alpha =
_alpha(face, state);
88 const auto beta =
_beta(face, state);
89 const auto gamma =
_gamma(face, state);
99 const auto alpha =
_alpha(face, state);
100 const auto beta =
_beta(face, state);
113 "This should not be assigned on an internal face!");
117 const auto alpha =
_alpha(face, state);
118 const auto beta =
_beta(face, state);
119 const auto gamma =
_gamma(face, state);
125 const auto projection = d_cf * nhat;
126 const auto vc = d_cf - (projection * nhat);
128 return (gamma * projection / (alpha + (beta * projection))) +
129 (alpha * grad_phi * vc / (alpha + (beta * projection)));
139 const auto alpha =
_alpha(face, state);
140 const auto beta =
_beta(face, state);
151 "This should not be assigned on an internal face!");
159 const auto alpha =
_alpha(face, state);
160 const auto beta =
_beta(face, state);
161 const auto gamma =
_gamma(face, state);
166 const auto projection = d_cf * nhat;
167 const auto vc = d_cf - (projection * nhat);
169 return (gamma / alpha) + (-beta * gamma * projection / alpha / (alpha + (beta * projection))) +
170 (-beta * grad_phi * vc / (alpha + (beta * projection)));
const Moose::Functor< Real > & _gamma
Functor giving the gamma coefficient (on right hand side, treated explicitly)
RealVectorValue computeCellToFaceVector() const
Computes the vector connecting the cell and boundary face centers.
virtual Real computeBoundaryGradientRHSContribution() const override
Computes the boundary gradient's contribution to the linear system right hand side.
const Moose::Functor< Real > & _beta
Functor giving the beta coefficient (multiplying value)
virtual Real computeBoundaryValueRHSContribution() const override
Computes the boundary value's contribution to the linear system right hand side.
bool isZero(const T &value, const Real tolerance=TOLERANCE *TOLERANCE *TOLERANCE)
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
Class implementing a Robin boundary condition for linear finite volume variables. ...
const ElemInfo * neighborInfo() const
const ElemInfo * elemInfo() const
virtual Real computeBoundaryNormalGradient() const override
Computes the normal gradient (often used in diffusion terms) on the boundary.
LinearFVAdvectionDiffusionFunctorRobinBC(const InputParameters ¶meters)
Class constructor.
Base class for boundary conditions that are valid for advection diffusion problems.
FaceInfo::VarFaceNeighbors _current_face_type
Face ownership information for the current face.
virtual Real computeBoundaryValueMatrixContribution() const override
Computes the boundary value's contribution to the linear system matrix.
static InputParameters validParams()
const Moose::Functor< Real > & _alpha
Functor giving the alpha coefficient (multiplying normal gradient)
const Point & normal() const
Returns the unit normal vector for the face oriented outward from the face's elem element...
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
MooseLinearVariableFV< Real > & _var
Reference to the linear finite volume variable object.
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.
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...
const VectorValue< Real > gradSln(const ElemInfo &elem_info) const
Get the variable gradient at a cell center.
virtual Real computeBoundaryValue() const override
Computes the boundary value of this object.
virtual Real computeBoundaryGradientMatrixContribution() const override
Computes the boundary gradient's contribution to the linear system matrix.
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.
void computeCellGradients()
Switch to request cell gradient computations.
static InputParameters validParams()
registerMooseObject("MooseApp", LinearFVAdvectionDiffusionFunctorRobinBC)