20 params.addClassDescription(
21 "Advects an arbitrary turbulent quantity, the associated nonlinear 'variable'.");
22 params.addRequiredParam<MooseFunctorName>(
NS::density,
"fluid density");
23 params.addParam<std::vector<BoundaryName>>(
24 "walls", {},
"Boundaries that correspond to solid walls.");
25 params.addParam<
bool>(
"neglect_advection_derivatives",
27 "Whether to remove automatic differentiation derivative terms "
28 "for velocity in the advection term");
34 _rho(getFunctor<
ADReal>(
NS::density)),
35 _wall_boundary_names(getParam<
std::vector<BoundaryName>>(
"walls")),
36 _neglect_advection_derivatives(getParam<bool>(
"neglect_advection_derivatives"))
62 return _normal *
v * rho_face * var_face;
78 const Elem * elem = fi.
elemPtr();
83 if ((
_face_type == FaceInfo::VarFaceNeighbors::ELEM ||
84 _face_type == FaceInfo::VarFaceNeighbors::BOTH) &&
92 if ((
_face_type == FaceInfo::VarFaceNeighbors::NEIGHBOR ||
93 _face_type == FaceInfo::VarFaceNeighbors::BOTH) &&
114 const Elem * elem = fi.
elemPtr();
119 if ((
_face_type == FaceInfo::VarFaceNeighbors::ELEM ||
120 _face_type == FaceInfo::VarFaceNeighbors::BOTH) &&
123 mooseAssert(
_var.
dofIndices().size() == 1,
"We're currently built to use CONSTANT MONOMIALS");
129 if ((
_face_type == FaceInfo::VarFaceNeighbors::NEIGHBOR ||
130 _face_type == FaceInfo::VarFaceNeighbors::BOTH) &&
133 mooseAssert((
_face_type == FaceInfo::VarFaceNeighbors::NEIGHBOR) ==
135 "If the variable is only defined on the neighbor hand side of the face, then that "
136 "means it should have no dof indices on the elem element. Conversely if "
137 "the variable is defined on both sides of the face, then it should have a non-zero "
138 "number of degrees of freedom on the elem element");
144 "We're currently built to use CONSTANT MONOMIALS");
147 std::array<ADReal, 1>{{neighbor_r}},
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("NavierStokesApp", INSFVTurbulentAdvection)
virtual const std::set< SubdomainID > & blockIDs() const
void computeJacobian() override
MooseVariableFV< Real > & _var
void computeResidual() override
const FaceInfo * _face_info
FaceInfo::VarFaceNeighbors _face_type
Moose::FaceArg makeFace(const FaceInfo &fi, const Moose::FV::LimiterType limiter_type, const bool elem_is_upwind, const bool correct_skewness=false, const Moose::StateArg *state_limiter=nullptr) const
const Point & normal() const
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const
const Elem * neighborPtr() const
const Elem * elemPtr() const
An advection kernel that implements interpolation schemes specific to Navier-Stokes flow physics.
bool skipForBoundary(const FaceInfo &fi) const override
Moose::FV::InterpMethod _velocity_interp_method
The interpolation method to use for the velocity.
void initialSetup() override
Moose::FV::InterpMethod _advected_interp_method
The interpolation method to use for the advected quantity.
static InputParameters validParams()
const RhieChowInterpolatorBase & _rc_vel_provider
The Rhie-Chow user object that provides us with the velocity.
Computes the advection term with the assumption that the advected quantity will have special wall tre...
static InputParameters validParams()
const Moose::Functor< ADReal > & _rho
std::unordered_set< const Elem * > _wall_bounded
List for wall treatment.
const bool _neglect_advection_derivatives
Whether to remove the derivative of this term wrt to velocity.
INSFVTurbulentAdvection(const InputParameters ¶ms)
virtual void initialSetup() override
ADReal computeQpResidual() override
const std::vector< BoundaryName > & _wall_boundary_names
Wall boundaries.
void scalingFactor(const std::vector< Real > &factor)
unsigned int number() const
virtual const std::vector< dof_id_type > & dofIndices() const final
virtual const std::vector< dof_id_type > & dofIndicesNeighbor() const final
FEProblemBase & _fe_problem
virtual VectorValue< ADReal > getVelocity(const Moose::FV::InterpMethod m, const FaceInfo &fi, const Moose::StateArg &time, const THREAD_ID tid, bool subtract_mesh_velocity) const =0
Retrieve a face velocity.
unsigned int number() const
void accumulateTaggedLocalResidual()
void addResidualsAndJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
void prepareVectorTagNeighbor(Assembly &assembly, unsigned int ivar)
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
DenseVector< Number > _local_re
Moose::StateArg determineState() const
void getWallBoundedElements(const std::vector< BoundaryName > &wall_boundary_name, const FEProblemBase &fe_problem, const SubProblem &subproblem, const std::set< SubdomainID > &block_ids, std::unordered_set< const Elem * > &wall_bounded)
Map marking wall bounded elements The map passed in wall_bounded_map gets cleared and re-populated.
static const std::string density