22 "diffusion term in a partial differential equation.");
24 "use_nonorthogonal_correction",
26 "If the nonorthogonal correction should be used when computing the normal gradient.");
27 params.
addParam<MooseFunctorName>(
"diffusion_coeff", 1.0,
"The diffusion coefficient.");
33 _diffusion_coeff(getFunctor<
Real>(
"diffusion_coeff")),
34 _use_nonorthogonal_correction(getParam<bool>(
"use_nonorthogonal_correction")),
35 _flux_matrix_contribution(0.0),
36 _flux_rhs_contribution(0.0)
46 if (!dynamic_cast<const LinearFVAdvectionDiffusionBC *>(bc.second))
48 bc.second->type(),
" is not a compatible boundary condition with ", this->
type(),
"!");
113 const auto interp_coeffs =
118 const auto correction_vector =
125 (interp_coeffs.first * grad_elem + interp_coeffs.second * grad_neighbor) *
137 mooseAssert(diff_bc,
"This should be a valid BC!");
139 auto grad_contrib = diff_bc->computeBoundaryGradientMatrixContribution() *
_current_face_area;
142 if (!diff_bc->includesMaterialPropertyMultiplier())
155 mooseAssert(diff_bc,
"This should be a valid BC!");
158 auto grad_contrib = diff_bc->computeBoundaryGradientRHSContribution() *
_current_face_area;
162 if (!diff_bc->includesMaterialPropertyMultiplier())
177 const Real boundary_normal_multiplier =
183 const auto correction_vector =
virtual Real computeElemMatrixContribution() override
Computes the system matrix contribution from an element side on an internal face. ...
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
Base class for boundary conditions for linear FV systems.
Kernel that adds contributions from a diffusion term discretized using the finite volume method to a ...
const Moose::Functor< Real > & _diffusion_coeff
The functor for the diffusion coefficient.
virtual Real computeElemRightHandSideContribution() override
Computes the right hand side contribution from the element side on an internal face.
std::pair< Real, Real > interpCoeffs(const InterpMethod m, const FaceInfo &fi, const bool one_is_elem, const T &face_flux=0.0)
Produce the interpolation coefficients in the equation:
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.
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
Real _flux_rhs_contribution
The cached right hand side contribution.
const ElemInfo * neighborInfo() const
const Point & faceCentroid() const
Returns the coordinates of the face centroid.
Finite volume kernel that contributes approximations of discretized face flux terms to the matrix and...
MooseLinearVariableFV< Real > & _var
Reference to the linear finite volume variable.
const ElemInfo * elemInfo() const
Real computeFluxMatrixContribution()
Computes the matrix contribution from the diffusive face flux.
FaceInfo::VarFaceNeighbors _current_face_type
Face ownership information for the current face.
static InputParameters validParams()
Base class for boundary conditions that are valid for advection diffusion problems.
static InputParameters validParams()
const FaceInfo * _current_face_info
Pointer to the face info we are operating on right now.
virtual Real computeNeighborRightHandSideContribution() override
Computes the right hand side contribution from the neighbor side on an internal face.
LinearFVDiffusion(const InputParameters ¶ms)
Class constructor.
virtual Real computeBoundaryRHSContribution(const LinearFVBoundaryCondition &bc) override
Computes the right hand side contribution from a boundary face.
Real _flux_matrix_contribution
The cached matrix contribution.
const std::string & type() const
Get the type of this class.
const Point & normal() const
Returns the unit normal vector for the face oriented outward from the face's elem element...
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
bool _cached_rhs_contribution
If we already built the right hand side contribution.
virtual Real computeBoundaryMatrixContribution(const LinearFVBoundaryCondition &bc) override
Computes the matrix contribution from a boundary face.
registerMooseObject("MooseApp", LinearFVDiffusion)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Point & eCN() const
const std::unordered_map< BoundaryID, LinearFVBoundaryCondition * > & getBoundaryConditionMap()
const VectorValue< Real > gradSln(const ElemInfo &elem_info) const
Get the variable gradient at a cell center.
virtual Real computeNeighborMatrixContribution() override
Computes the system matrix contribution from the neighbor side on an internal face.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Real computeFluxRHSContribution()
Computes the right hand side contribution from the diffusive face flux.
bool _cached_matrix_contribution
If we already built the matrix contribution.
Real _current_face_area
The current, coordinate system specific face area.
Moose::FaceArg makeCDFace(const FaceInfo &fi, const bool correct_skewness=false) const
Make a functor face argument with a central differencing limiter, e.g.
void computeCellGradients()
Switch to request cell gradient computations.
const Point & dCN() const
const bool _use_nonorthogonal_correction
Switch to enable/disable nonorthogonal correction.