18 params.
addParam<Real>(
"scaling_factor", 1,
"To scale the mass flux");
20 params.
addParam<PostprocessorName>(
"velocity_pp",
"Postprocessor with the inlet velocity norm");
24 "The direction of the flow at the boundary. This is mainly used for cases when an inlet "
25 "angle needs to be defined with respect to the normal and when a boundary is defined on an "
26 "internal face where the normal can point in both directions. Use positive mass flux and "
27 "velocity magnitude if the flux aligns with this direction vector.");
31 params.
addParam<PostprocessorName>(
"mdot_pp",
"Postprocessor with the inlet mass flow rate");
32 params.
addParam<PostprocessorName>(
"area_pp",
"Inlet area as a postprocessor");
41 _scaling_factor(getParam<Real>(
"scaling_factor")),
42 _velocity_pp(isParamValid(
"velocity_pp") ? &getPostprocessorValue(
"velocity_pp") : nullptr),
43 _mdot_pp(isParamValid(
"mdot_pp") ? &getPostprocessorValue(
"mdot_pp") : nullptr),
44 _area_pp(isParamValid(
"area_pp") ? &getPostprocessorValue(
"area_pp") : nullptr),
45 _rho(getFunctor<
ADReal>(
NS::density)),
46 _direction(getParam<Point>(
"direction")),
47 _direction_specified_by_user(params.isParamSetByUser(
"direction")),
48 _vel_x(getFunctor<
ADReal>(
NS::velocity_x)),
49 _vel_y(isParamValid(
NS::velocity_y) ? &getFunctor<
ADReal>(
NS::velocity_y) : nullptr),
50 _vel_z(isParamValid(
NS::velocity_z) ? &getFunctor<
ADReal>(
NS::velocity_z) : nullptr)
53 paramError(
"direction",
"The direction should be a unit vector with a tolerance of 1e-6!");
57 mooseWarning(
"If setting the mass flow rate directly, no need for inlet velocity");
60 mooseError(
"In two or more dimensions, the y-component of the velocity must be supplied.");
62 mooseError(
"In three dimensions, the z-component of the velocity must be supplied.");
75 mooseError(
"Either mdot_pp or velocity_pp need to be provided OR this function must be "
76 "overridden in derived classes if other input parameter combinations are valid. "
77 "Neither mdot_pp nor velocity_pp are provided.");
88 v(1) = (*_vel_y)(boundary_face, state);
90 v(2) = (*_vel_z)(boundary_face, state);
125 if (MooseUtils::absoluteFuzzyEqual(*
_area_pp, 0))
134 if (MooseUtils::absoluteFuzzyEqual(*
_area_pp, 0))
DualNumber< Real, DNDerivativeType, true > ADReal
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
ADRealVectorValue _normal
static InputParameters validParams()
A parent class for INSFV flow boundary conditions.
static InputParameters validParams()
void paramError(const std::string ¶m, Args... args) const
void mooseError(Args &&... args) const
void mooseWarning(Args &&... args) const
virtual unsigned int dimension() const
virtual void residualSetup()
virtual void jacobianSetup()
virtual MooseMesh & mesh()=0
WCNSFVFluxBCBase(const InputParameters ¶ms)
const Moose::Functor< ADReal > & _rho
Fluid density functor.
const bool _direction_specified_by_user
Flag to store if the flow direction is specified by the user.
ADReal inflowMassFlux(const Moose::StateArg &state) const
computes the inflow massflux
static InputParameters validParams()
const PostprocessorValue *const _mdot_pp
Postprocessor with the inlet mass flow rate.
void jacobianSetup() override
const Moose::Functor< ADReal > *const _vel_z
const PostprocessorValue *const _velocity_pp
Postprocessor with the inlet velocity.
void residualSetup() override
in residual and jacobian setup we check if the area is zero
void checkForInternalDirection() const
check for improper use on an internal face, e.g.
virtual bool isInflow() const
true if a boundary is an inflow boundary, false if outflow
ADReal inflowSpeed(const Moose::StateArg &state) const
computes the inflow speed
const Moose::Functor< ADReal > & _vel_x
Velocity components.
const Moose::Functor< ADReal > *const _vel_y
const Point _direction
The direction in which the flow is entering/leaving the domain.
const PostprocessorValue *const _area_pp
Postprocessor with the inlet area.
ADRealVectorValue varVelocity(const Moose::StateArg &state) const
returns the velocity vector (vel_x, vel_y, vel_z)
static const std::string density
static const std::string velocity_y
static const std::string velocity_z
static const std::string velocity_x