20 "Computes residual for the turbulent scaled diffusion operator for finite volume method.");
22 "scaling_coef", 1.0,
"Scaling factor to divide the diffusion coefficient with");
23 params.
addParam<std::vector<BoundaryName>>(
24 "walls", {},
"Boundaries that correspond to solid walls.");
31 _scaling_coef(getFunctor<
ADReal>(
"scaling_coef")),
32 _wall_boundary_names(getParam<
std::vector<BoundaryName>>(
"walls")),
33 _preserve_sparsity_pattern(_fe_problem.preserveMatrixSparsityPattern())
62 if (!coeff_elem.value() && !coeff_neighbor.value())
68 return 0 * (coeff_elem + coeff_neighbor) *
85 coeff =
_coeff(face, state);
89 return -1 * coeff / scaling_coef * dudn;
103 const Elem * elem = fi.
elemPtr();
108 if ((
_face_type == FaceInfo::VarFaceNeighbors::ELEM ||
109 _face_type == FaceInfo::VarFaceNeighbors::BOTH) &&
117 if ((
_face_type == FaceInfo::VarFaceNeighbors::NEIGHBOR ||
118 _face_type == FaceInfo::VarFaceNeighbors::BOTH) &&
139 const Elem * elem = fi.
elemPtr();
144 if ((
_face_type == FaceInfo::VarFaceNeighbors::ELEM ||
145 _face_type == FaceInfo::VarFaceNeighbors::BOTH) &&
148 mooseAssert(
_var.
dofIndices().size() == 1,
"We're currently built to use CONSTANT MONOMIALS");
154 if ((
_face_type == FaceInfo::VarFaceNeighbors::NEIGHBOR ||
155 _face_type == FaceInfo::VarFaceNeighbors::BOTH) &&
158 mooseAssert((
_face_type == FaceInfo::VarFaceNeighbors::NEIGHBOR) ==
160 "If the variable is only defined on the neighbor hand side of the face, then that "
161 "means it should have no dof indices on the elem element. Conversely if "
162 "the variable is defined on both sides of the face, then it should have a non-zero "
163 "number of degrees of freedom on the elem element");
169 "We're currently built to use CONSTANT MONOMIALS");
172 std::array<ADReal, 1>{{neighbor_r}},
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("NavierStokesApp", INSFVTurbulentDiffusion)
virtual const std::set< SubdomainID > & blockIDs() const
const bool _correct_skewness
static InputParameters validParams()
const Moose::FV::InterpMethod _coeff_interp_method
const Moose::Functor< ADReal > & _coeff
Moose::ElemArg neighborArg(bool correct_skewness=false) const
Moose::ElemArg elemArg(bool correct_skewness=false) const
virtual bool skipForBoundary(const FaceInfo &fi) const
MooseVariableFV< Real > & _var
Moose::FaceArg singleSidedFaceArg(const FaceInfo *fi=nullptr, Moose::FV::LimiterType limiter_type=Moose::FV::LimiterType::CentralDifference, bool correct_skewness=false, const Moose::StateArg *state_limiter=nullptr) const
virtual ADReal gradUDotNormal(const Moose::StateArg &time, const bool correct_skewness) const
const FaceInfo * _face_info
FaceInfo::VarFaceNeighbors _face_type
const Point & normal() const
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const
const Elem * neighborPtr() const
const Elem * elemPtr() const
INSFVTurbulentDiffusion implements a standard diffusion term for a turbulent problem:
static InputParameters validParams()
const std::vector< BoundaryName > & _wall_boundary_names
Wall boundaries.
const bool _preserve_sparsity_pattern
Whether a Newton's method is being used (and we need to preserve the sparsity pattern in edge cases)
void computeResidual() override
void computeJacobian() override
std::unordered_set< const Elem * > _wall_bounded
List for wall treatment.
const Moose::Functor< ADReal > & _scaling_coef
virtual ADReal computeQpResidual() override final
INSFVTurbulentDiffusion(const InputParameters ¶ms)
virtual void initialSetup() override
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
bool isInternalFace(const FaceInfo &) const
FEProblemBase & _fe_problem
virtual void initialSetup()
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.