25 #include "libmesh/mesh_base.h" 26 #include "libmesh/elem_range.h" 27 #include "libmesh/parallel_algebra.h" 28 #include "libmesh/remote_elem.h" 29 #include "metaphysicl/dualsemidynamicsparsenumberarray.h" 30 #include "metaphysicl/parallel_dualnumber.h" 31 #include "metaphysicl/parallel_dynamic_std_array_wrapper.h" 32 #include "metaphysicl/parallel_semidynamicsparsenumberarray.h" 44 params.addClassDescription(
45 "Computes the Rhie-Chow velocity based on gathered 'a' coefficient data.");
48 params.suppressParameter<
bool>(
"force_preic");
50 params.addRequiredParam<VariableName>(
NS::pressure,
"The pressure variable.");
51 params.addRequiredParam<VariableName>(
"u",
"The x-component of velocity");
52 params.addParam<VariableName>(
"v",
"The y-component of velocity");
53 params.addParam<VariableName>(
"w",
"The z-component of velocity");
55 MooseEnum velocity_interp_method(
"average rc",
"rc");
57 "velocity_interp_method",
58 velocity_interp_method,
59 "The interpolation to use for the velocity. Options are " 60 "'average' and 'rc' which stands for Rhie-Chow. The default is Rhie-Chow.");
71 _dim(blocksMaxDimension()),
75 &
UserObject::_subproblem.getVariable(0, getParam<VariableName>(
"u")))),
77 &
UserObject::_subproblem.getVariable(0, getParam<VariableName>(
"v")))
80 &
UserObject::_subproblem.getVariable(0, getParam<VariableName>(
"w")))
86 _sys(*getCheckedPointerParam<
SystemBase *>(
"_sys")),
94 paramError(
"u",
"the u velocity must be an INSFVVelocityVariable.");
101 mooseError(
"In two or more dimensions, the v velocity must be supplied and it must be an " 102 "INSFVVelocityVariable.");
110 mooseError(
"In three-dimensions, the w velocity must be supplied and it must be an " 111 "INSFVVelocityVariable.");
123 mooseError(
"x and y velocity component face interpolation methods do not match");
129 mooseError(
"x and z velocity component face interpolation methods do not match");
134 mooseError(
"Different subproblems in RhieChowInterpolatorBase!");
136 const auto & velocity_interp_method = params.
get<
MooseEnum>(
"velocity_interp_method");
137 if (velocity_interp_method ==
"average")
139 else if (velocity_interp_method ==
"rc")
148 bool subtract_mesh_velocity)
const
INSFVPressureVariable *const _p
The thread 0 copy of the pressure variable.
std::vector< MooseVariableFVReal * > _ps
All the thread copies of the pressure variable.
T & getMesh(MooseMesh &mesh)
function to cast mesh
INSFVVelocityVariable *const _u
The thread 0 copy of the x-velocity variable.
unsigned int number() const
INSFVVelocityVariable *const _v
The thread 0 copy of the y-velocity variable (null if the problem is 1D)
static InputParameters validParams()
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
static InputParameters validParams()
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.
std::vector< MooseVariableFVReal * > _us
All the thread copies of the x-velocity variable.
RhieChowInterpolatorBase(const InputParameters ¶ms)
const unsigned int _dim
The dimension of the mesh, e.g. 3 for hexes and tets, 2 for quads and tris.
const Point & normal() const
void paramError(const std::string ¶m, Args... args) const
Moose::FV::InterpMethod _velocity_interp_method
The interpolation method to use for the velocity.
void fillContainer(const std::string &var_name, Container &container)
Fill the passed-in variable container with the thread copies of var_name.
virtual Real getVolumetricFaceFlux(const Moose::FV::InterpMethod m, const FaceInfo &fi, const Moose::StateArg &time, const THREAD_ID tid, bool subtract_mesh_velocity) const override
Retrieve the volumetric face flux, will not include derivatives.
void checkBlocks(const VarType &var) const
Check the block consistency between the passed in var and us.
Moose::FV::InterpMethod faceInterpolationMethod() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
INSFVVelocityVariable *const _w
The thread 0 copy of the z-velocity variable (null if the problem is not 3D)
std::vector< unsigned int > _var_numbers
The velocity variable numbers.
static const std::string pressure
void mooseError(Args &&... args) const
std::vector< MooseVariableFVReal * > _ws
All the thread copies of the z-velocity variable.
static InputParameters validParams()
std::vector< MooseVariableFVReal * > _vs
All the thread copies of the y-velocity variable.
static InputParameters validParams()