23 "advection term in a partial differential equation.");
24 params.
addRequiredParam<RealVectorValue>(
"velocity",
"Constant advection velocity");
26 "advected_interp_method_name",
27 "Name of the FVInterpolationMethod to use for the advected quantity.");
34 _velocity(getParam<RealVectorValue>(
"velocity")),
35 _adv_interp_method(getFVAdvectedInterpolationMethod(
36 getParam<InterpolationMethodName>(
"advected_interp_method_name"))),
37 _gradient_field(_adv_interp_method.needsGradients()
38 ? &_var.requestCellGradients(_adv_interp_method.gradientMethodName())
63 mooseAssert(
_gradient_field,
"Gradient field should be registered when gradients are needed.");
82 bc.second->type(),
" is not a compatible boundary condition with ", this->
type(),
"!");
114 const auto *
const adv_bc = cast_ptr<const LinearFVAdvectionDiffusionBC *>(&bc);
115 mooseAssert(adv_bc,
"This should be a valid BC!");
117 const auto boundary_value_matrix_contrib = adv_bc->computeBoundaryValueMatrixContribution();
128 const auto *
const adv_bc = cast_ptr<const LinearFVAdvectionDiffusionBC *>(&bc);
129 mooseAssert(adv_bc,
"This should be a valid BC!");
134 const auto boundary_value_rhs_contrib = adv_bc->computeBoundaryValueRHSContribution();
registerMooseObject("MooseApp", LinearFVAdvection)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
virtual AdvectedSystemContribution advectedInterpolate(const FaceInfo &face, Real elem_value, Real neighbor_value, const VectorValue< Real > *elem_grad, const VectorValue< Real > *neighbor_grad, Real mass_flux) const =0
Compute the matrix weights for the advected face value.
virtual bool needsGradients() const
Whether advected interpolation requires adjacent-cell gradients.
Helper interface for objects that need access to FVInterpolationMethod instances.
This data structure is used to store geometric and variable related metadata about each cell face in ...
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
Base class for boundary conditions that are valid for advection diffusion problems.
Kernel that adds contributions from an advection term discretized using the finite volume method to a...
VectorValue< Real > _neighbor_grad_storage
virtual Real computeBoundaryRHSContribution(const LinearFVBoundaryCondition &bc) override
Computes the right hand side contribution from a boundary face.
virtual Real computeElemMatrixContribution() override
Computes the system matrix contribution from an element side on an internal face.
VectorValue< Real > _elem_grad_storage
Reusable gradient storage used when advected interpolation requires gradients.
virtual Real computeElemRightHandSideContribution() override
Computes the right hand side contribution from the element side on an internal face.
virtual Real computeNeighborMatrixContribution() override
Computes the system matrix contribution from the neighbor side on an internal face.
const RealVectorValue _velocity
Constant advecting velocity vector.
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job.
FVAdvectedInterpolationMethod::AdvectedSystemContribution _adv_interp_result
Cached weights/correction for the current face (refreshed in setupFaceData)
virtual Real computeNeighborRightHandSideContribution() override
Computes the right hand side contribution from the neighbor side on an internal face.
virtual void setupFaceData(const FaceInfo *face_info) override
Set the current FaceInfo object.
static InputParameters validParams()
const LinearFVGradientReader *const _gradient_field
Gradient field used by advected interpolations that require gradients.
LinearFVAdvection(const InputParameters ¶ms)
Class constructor.
virtual Real computeBoundaryMatrixContribution(const LinearFVBoundaryCondition &bc) override
Computes the matrix contribution from a boundary face.
const FVAdvectedInterpolationMethod & _adv_interp_method
The interpolation method to use for the advected quantity.
Base class for boundary conditions for linear FV systems.
Finite volume kernel that contributes approximations of discretized face flux terms to the matrix and...
FaceInfo::VarFaceNeighbors _current_face_type
Face ownership information for the current face.
virtual void setupFaceData(const FaceInfo *face_info)
Set the current FaceInfo object.
Real _current_face_area
The current, coordinate system specific face area.
const FaceInfo * _current_face_info
Pointer to the face info we are operating on right now.
static InputParameters validParams()
RealVectorValue gradient(const ElemInfo &elem_info) const
Read the full gradient at an element.
MooseLinearVariableFV< Real > & _var
Reference to the linear finite volume variable.
const std::string & type() const
Get the type of this class.
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 std::unordered_map< BoundaryID, LinearFVBoundaryCondition * > & getBoundaryConditionMap() const
Boundary-condition map keyed by boundary ID for this variable.
Moose::StateArg determineState() const
Create a functor state argument that corresponds to the implicit state of this object.
std::pair< Real, Real > weights_matrix