23 "advection term for a turbulence variable.");
26 "rhie_chow_user_object",
27 "The rhie-chow user-object which is used to determine the face velocity.");
30 "advected_interp_method_name",
31 "Name of the FVInterpolationMethod to use for the advected quantity.");
33 params.
addParam<std::vector<BoundaryName>>(
34 "walls", {},
"Boundaries that correspond to solid walls.");
42 _mass_flux_provider(getUserObject<
RhieChowMassFlux>(
"rhie_chow_user_object")),
43 _adv_interp_method(getFVAdvectedInterpolationMethod(
44 getParam<InterpolationMethodName>(
"advected_interp_method_name"))),
45 _gradient_field(_adv_interp_method.needsGradients()
46 ? &_var.requestCellGradients(_adv_interp_method.gradientMethodName())
49 _wall_boundary_names(getParam<
std::vector<BoundaryName>>(
"walls"))
103 "We should only have one boundary on every face.");
121 else if ((
_current_face_type == FaceInfo::VarFaceNeighbors::NEIGHBOR) && !(bounded_neigh))
123 const auto dof_id_neighbor =
167 "We should only have one boundary on every face.");
185 else if ((
_current_face_type == FaceInfo::VarFaceNeighbors::NEIGHBOR) && !(bounded_neigh))
187 const auto dof_id_neighbor =
224 const auto *
const adv_bc = cast_ptr<const LinearFVAdvectionDiffusionBC *>(&bc);
225 mooseAssert(adv_bc,
"This should be a valid BC!");
227 const auto boundary_value_matrix_contrib = adv_bc->computeBoundaryValueMatrixContribution();
230 const auto factor = (
_current_face_type == FaceInfo::VarFaceNeighbors::ELEM) ? 1.0 : -1.0;
238 const auto *
const adv_bc = cast_ptr<const LinearFVAdvectionDiffusionBC *>(&bc);
239 mooseAssert(adv_bc,
"This should be a valid BC!");
242 const auto factor = (
_current_face_type == FaceInfo::VarFaceNeighbors::ELEM ? 1.0 : -1.0);
244 const auto boundary_value_rhs_contrib = adv_bc->computeBoundaryValueRHSContribution();
270 mooseAssert(
_gradient_field,
"Gradient field should be registered when gradients are needed.");
registerMooseObject("NavierStokesApp", LinearFVTurbulentAdvection)
bool hasBlocks(const SubdomainName &name) const
virtual const std::set< SubdomainID > & blockIDs() const
SubdomainID subdomain_id() const
const std::vector< std::vector< dof_id_type > > & dofIndices() const
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
virtual bool needsGradients() const
const std::set< BoundaryID > & boundaryIDs() const
const Elem * neighborPtr() const
const ElemInfo * elemInfo() const
const ElemInfo * neighborInfo() const
const Elem * elemPtr() const
void setupFaceData(const FaceInfo *face_info, const FaceInfo::VarFaceNeighbors face_type)
FaceInfo::VarFaceNeighbors _current_face_type
DenseMatrix< Real > _matrix_contribution
virtual void setupFaceData(const FaceInfo *face_info)
DenseVector< Real > _rhs_contribution
DenseVector< dof_id_type > _dof_indices
const bool _force_boundary_execution
const FaceInfo * _current_face_info
static InputParameters validParams()
RealVectorValue gradient(const ElemInfo &elem_info) const
MooseLinearVariableFV< Real > & _var
const unsigned int _sys_num
const unsigned int _var_num
An advection kernel that implements the advection term for the turbulent variables limited for the fi...
virtual Real computeNeighborRightHandSideContribution() override
virtual Real computeElemRightHandSideContribution() override
const RhieChowMassFlux & _mass_flux_provider
The Rhie-Chow user object that provides us with the face velocity.
virtual Real computeNeighborMatrixContribution() override
VectorValue< Real > _neighbor_grad_storage
virtual void addRightHandSideContribution() override
VectorValue< Real > _elem_grad_storage
Reusable gradient storage used when advected interpolation requires gradients.
const std::vector< BoundaryName > & _wall_boundary_names
Wall boundaries.
virtual Real computeBoundaryRHSContribution(const LinearFVBoundaryCondition &bc) override
const LinearFVGradientReader *const _gradient_field
Gradient field used by advected interpolations that require gradients.
virtual void addMatrixContribution() override
const FVAdvectedInterpolationMethod & _adv_interp_method
The interpolation method to use for the advected quantity.
virtual Real computeBoundaryMatrixContribution(const LinearFVBoundaryCondition &bc) override
virtual Real computeElemMatrixContribution() override
virtual void initialSetup() override
FVAdvectedInterpolationMethod::AdvectedSystemContribution _adv_interp_result
Cached weights/correction for the current face (refreshed in setupFaceData)
LinearFVTurbulentAdvection(const InputParameters ¶ms)
std::unordered_set< const Elem * > _wall_bounded
List for wall bounded elements.
Real _mass_face_flux
Container for the mass flux on the face which will be reused in the advection term's matrix and right...
virtual void setupFaceData(const FaceInfo *face_info) override
static InputParameters validParams()
FEProblemBase & _fe_problem
libMesh::LinearImplicitSystem & _linear_system
Real getElemValue(const ElemInfo &elem_info, const StateArg &state) const
LinearFVBoundaryCondition * getBoundaryCondition(const BoundaryID bd_id) const
User object responsible for determining the face fluxes using the Rhie-Chow interpolation in a segreg...
Real getMassFlux(const FaceInfo &fi) const
Get the face velocity times density (used in advection terms)
virtual void initialSetup()
Moose::StateArg determineState() const
std::vector< T > & get_values()
NumericVector< Number > * rhs
SparseMatrix< Number > * matrix
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.
std::pair< Real, Real > weights_matrix