18 #include "libmesh/vector_value.h" 19 #include "libmesh/id_types.h" 20 #include "libmesh/stored_range.h" 61 bool subtract_mesh_velocity)
const = 0;
67 bool subtract_mesh_velocity)
const override;
97 template <
typename Container>
98 void fillContainer(
const std::string & var_name, Container & container);
103 template <
typename VarType>
128 std::vector<MooseVariableFVReal *>
_ps;
131 std::vector<MooseVariableFVReal *>
_us;
134 std::vector<MooseVariableFVReal *>
_vs;
137 std::vector<MooseVariableFVReal *>
_ws;
162 mooseAssert(tid <
_ps.size(),
"Attempt to access out-of-bounds in pressure variable container");
166 template <
typename Container>
170 typedef typename Container::value_type ContainedType;
173 auto *
const var =
static_cast<ContainedType
>(
175 container[tid] = var;
179 template <
typename VarType>
183 const auto & var_blocks = var.blockIDs();
184 const auto & uo_blocks =
blockIDs();
187 std::set<SubdomainID> uo_blocks_minus_var_blocks;
188 std::set_difference(uo_blocks.begin(),
192 std::inserter(uo_blocks_minus_var_blocks, uo_blocks_minus_var_blocks.end()));
193 if (uo_blocks_minus_var_blocks.size() > 0)
194 mooseError(
"Block restriction of interpolator user object '",
198 ") includes blocks not in the block restriction of variable '",
205 std::set<SubdomainID> var_blocks_minus_uo_blocks;
206 std::set_difference(var_blocks.begin(),
210 std::inserter(var_blocks_minus_uo_blocks, var_blocks_minus_uo_blocks.end()));
214 for (
auto & block_id : var_blocks_minus_uo_blocks)
217 std::set<SubdomainID> connected_blocks_on_uo;
218 std::set_intersection(connected_blocks.begin(),
219 connected_blocks.end(),
222 std::inserter(connected_blocks_on_uo, connected_blocks_on_uo.end()));
223 if (connected_blocks_on_uo.size() > 0)
224 mooseError(
"Block restriction of interpolator user object '",
228 ") doesn't match the block restriction of variable '",
INSFVPressureVariable *const _p
The thread 0 copy of the pressure variable.
std::vector< MooseVariableFVReal * > _ps
All the thread copies of the pressure variable.
const INSFVPressureVariable & pressure(THREAD_ID tid) const
MooseMesh & _moose_mesh
The MooseMesh that this user object operates on.
virtual const Moose::FunctorBase< ADReal > & epsilon(THREAD_ID tid) const
A virtual method that allows us to only implement getVelocity once for free and porous flows...
INSFVVelocityVariable *const _u
The thread 0 copy of the x-velocity variable.
INSFVVelocityVariable *const _v
The thread 0 copy of the y-velocity variable (null if the problem is 1D)
static const std::string component
const std::set< SubdomainID > & getBlockConnectedBlocks(const SubdomainID subdomain_id) const
const bool _displaced
Whether this object is operating on the displaced mesh.
Moose::FV::InterpMethod velocityInterpolationMethod() const
Return the interpolation method used for velocity.
virtual const std::set< SubdomainID > & blockIDs() const
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
virtual void ghostADataOnBoundary(const BoundaryID)
makes sure coefficient data gets communicated on both sides of a given boundary.
DualNumber< Real, DNDerivativeType, true > ADReal
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.
const std::string & name() const
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
RhieChowInterpolatorBase(const InputParameters ¶ms)
virtual bool segregated() const =0
Bool of the Rhie Chow user object is used in monolithic/segregated approaches.
boundary_id_type BoundaryID
const unsigned int _dim
The dimension of the mesh, e.g. 3 for hexes and tets, 2 for quads and tris.
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const=0
std::string stringify(const T &t)
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.
const libMesh::MeshBase & _mesh
The libMesh mesh that this object acts on.
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.
const INSFVVelocityVariable * vel() const
const std::vector< SubdomainName > & blocks() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void addToA(const libMesh::Elem *elem, unsigned int component, const ADReal &value)=0
API for momentum residual objects that have on-diagonals for velocity call.
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.
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
std::vector< MooseVariableFVReal * > _ws
All the thread copies of the z-velocity variable.
const Moose::ConstantFunctor< ADReal > _unity_functor
A unity functor used in the epsilon virtual method.
std::vector< MooseVariableFVReal * > _vs
All the thread copies of the y-velocity variable.
static InputParameters validParams()